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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
equals | @Override
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
InjectionPoint otherPoint = (InjectionPoint) other;
return (ObjectUtils.nullSafeEquals(this.field, otherPoint.field) &&
ObjectUtils.... | Return the wrapped annotated element.
<p>Note: In case of a method/constructor parameter, this exposes
the annotations declared on the method or constructor itself
(i.e. at the method/constructor level, not at the parameter level).
Use {@link #getAnnotations()} to obtain parameter-level annotations in
such a scenario, ... | java | spring-beans/src/main/java/org/springframework/beans/factory/InjectionPoint.java | 176 | [
"other"
] | true | 5 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false | |
get | @Override
public ConfigData get(String path, Set<String> keys) {
if (path != null && !path.isEmpty()) {
log.error("Path is not supported for EnvVarConfigProvider, invalid value '{}'", path);
throw new ConfigException("Path is not supported for EnvVarConfigProvider, invalid value '" ... | @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 | 93 | [
"path",
"keys"
] | ConfigData | true | 4 | 7.76 | apache/kafka | 31,560 | javadoc | false |
benchmark_utilization | def benchmark_utilization(
f,
input,
trace_folder,
optimize_ctx=None,
trace_file_name="tmp_chrome_trace",
num_runs=1,
):
"""
Benchmark the GPU Utilization and percent of time spent on matmul and convolution operations of
running f(input, **kwargs_for_f) with [optimize_ctx] [num_runs]... | Benchmark the GPU Utilization and percent of time spent on matmul and convolution operations of
running f(input, **kwargs_for_f) with [optimize_ctx] [num_runs] times.
It will produce a chrome trace file in trace_folder/trace_file_name.json
Example:
```
def f(a):
return a.sum()
a = torch.rand(2**20, device="cuda... | python | torch/_functorch/benchmark_utils.py | 170 | [
"f",
"input",
"trace_folder",
"optimize_ctx",
"trace_file_name",
"num_runs"
] | false | 3 | 8.16 | pytorch/pytorch | 96,034 | google | false | |
iscontiguous | def iscontiguous(self):
"""
Return a boolean indicating whether the data is contiguous.
Parameters
----------
None
Examples
--------
>>> import numpy as np
>>> x = np.ma.array([1, 2, 3])
>>> x.iscontiguous()
True
`isconti... | Return a boolean indicating whether the data is contiguous.
Parameters
----------
None
Examples
--------
>>> import numpy as np
>>> x = np.ma.array([1, 2, 3])
>>> x.iscontiguous()
True
`iscontiguous` returns one of the flags of the masked array:
>>> x.flags
C_CONTIGUOUS : True
F_CONTIGUOUS : True
OWNDATA : Fa... | python | numpy/ma/core.py | 4,948 | [
"self"
] | false | 1 | 6.16 | numpy/numpy | 31,054 | numpy | false | |
writeSignatureFileIfNecessary | @Override
protected void writeSignatureFileIfNecessary(Map<String, Library> writtenLibraries, AbstractJarWriter writer)
throws IOException {
String sourceName = getSource().getName().toLowerCase(Locale.ROOT);
if ((sourceName.endsWith(".jar") || sourceName.endsWith(".war")) && hasSignedLibrary(writtenLibraries))... | Create a new {@link Repackager} instance.
@param source the source archive file to package | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java | 53 | [
"writtenLibraries",
"writer"
] | void | true | 4 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
ordered | def ordered(self) -> Ordered:
"""
Whether the categories have an ordered relationship.
See Also
--------
categories : An Index containing the unique categories allowed.
Examples
--------
>>> cat_type = pd.CategoricalDtype(categories=["a", "b"], ordered=T... | Whether the categories have an ordered relationship.
See Also
--------
categories : An Index containing the unique categories allowed.
Examples
--------
>>> cat_type = pd.CategoricalDtype(categories=["a", "b"], ordered=True)
>>> cat_type.ordered
True
>>> cat_type = pd.CategoricalDtype(categories=["a", "b"], ordered=... | python | pandas/core/dtypes/dtypes.py | 655 | [
"self"
] | Ordered | true | 1 | 6.48 | pandas-dev/pandas | 47,362 | unknown | false |
edgeCount | protected long edgeCount() {
long degreeSum = 0L;
for (N node : nodes()) {
degreeSum += degree(node);
}
// According to the degree sum formula, this is equal to twice the number of edges.
checkState((degreeSum & 1) == 0);
return degreeSum >>> 1;
} | Returns the number of edges in this graph; used to calculate the size of {@link Graph#edges()}.
This implementation requires O(|N|) time. Classes extending this one may manually keep track of
the number of edges as the graph is updated, and override this method for better performance. | java | android/guava/src/com/google/common/graph/AbstractBaseGraph.java | 52 | [] | true | 1 | 6 | google/guava | 51,352 | javadoc | false | |
getSubtype | public final TypeToken<? extends T> getSubtype(Class<?> subclass) {
checkArgument(
!(runtimeType instanceof TypeVariable), "Cannot get subtype of type variable <%s>", this);
if (runtimeType instanceof WildcardType) {
return getSubtypeFromLowerBounds(subclass, ((WildcardType) runtimeType).getLowerB... | Returns subtype of {@code this} with {@code subclass} as the raw class. For example, if this is
{@code Iterable<String>} and {@code subclass} is {@code List}, {@code List<String>} is
returned. | java | android/guava/src/com/google/common/reflect/TypeToken.java | 430 | [
"subclass"
] | true | 3 | 6 | google/guava | 51,352 | javadoc | false | |
add | public Member<T> add() {
return from((value) -> value);
} | Add a new member with access to the instance being written. The member is added
without a name, so one of the {@code Member.using(...)} methods must be used to
complete the configuration.
@return the added {@link Member} which may be configured further | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 249 | [] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
handleCoordinatorReady | void handleCoordinatorReady() {
NodeApiVersions nodeApiVersions = transactionCoordinator != null ?
apiVersions.get(transactionCoordinator.idString()) :
null;
ApiVersion initProducerIdVersion = nodeApiVersions != null ?
nodeApiVersions.apiVersion(ApiKeys.IN... | 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,105 | [] | void | true | 4 | 8.24 | apache/kafka | 31,560 | javadoc | false |
to_series | def to_series(self, index=None, name: Hashable | None = None) -> Series:
"""
Create a Series with both index and values equal to the index keys.
Useful with map for returning an indexer based on an index.
Parameters
----------
index : Index, optional
Index o... | Create a Series with both index and values equal to the index keys.
Useful with map for returning an indexer based on an index.
Parameters
----------
index : Index, optional
Index of resulting Series. If None, defaults to original index.
name : str, optional
Name of resulting Series. If None, defaults to name... | python | pandas/core/indexes/base.py | 1,650 | [
"self",
"index",
"name"
] | Series | true | 3 | 8.32 | pandas-dev/pandas | 47,362 | numpy | false |
asBiPredicate | public static <O1, O2> BiPredicate<O1, O2> asBiPredicate(final FailableBiPredicate<O1, O2, ?> predicate) {
return (input1, input2) -> test(predicate, input1, input2);
} | Converts the given {@link FailableBiPredicate} into a standard {@link BiPredicate}.
@param <O1> the type of the first argument used by the predicates
@param <O2> the type of the second argument used by the predicates
@param predicate a {@link FailableBiPredicate}
@return a standard {@link BiPredicate}
@since 3.10 | java | src/main/java/org/apache/commons/lang3/Functions.java | 379 | [
"predicate"
] | true | 1 | 6.24 | apache/commons-lang | 2,896 | javadoc | false | |
adviceIncluded | public boolean adviceIncluded(@Nullable Advice advice) {
if (advice != null) {
for (Advisor advisor : this.advisors) {
if (advisor.getAdvice() == advice) {
return true;
}
}
}
return false;
} | Is the given advice included in any advisor within this proxy configuration?
@param advice the advice to check inclusion of
@return whether this advice instance is included | java | spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java | 480 | [
"advice"
] | true | 3 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false | |
maybeBindPrimitiveArgsFromPointcutExpression | private void maybeBindPrimitiveArgsFromPointcutExpression() {
int numUnboundPrimitives = countNumberOfUnboundPrimitiveArguments();
if (numUnboundPrimitives > 1) {
throw new AmbiguousBindingException("Found " + numUnboundPrimitives +
" unbound primitive arguments with no way to distinguish between them.");
... | Match up args against unbound arguments of primitive types. | java | spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java | 641 | [] | void | true | 11 | 7.04 | spring-projects/spring-framework | 59,386 | javadoc | false |
to_numpy | def to_numpy(
self,
dtype: npt.DTypeLike | None = None,
copy: bool = False,
na_value: object = lib.no_default,
) -> np.ndarray:
"""
Convert to a NumPy ndarray.
This is similar to :meth:`numpy.asarray`, but may provide additional control
over how the c... | Convert to a NumPy ndarray.
This is similar to :meth:`numpy.asarray`, but may provide additional control
over how the conversion is done.
Parameters
----------
dtype : str or numpy.dtype, optional
The dtype to pass to :meth:`numpy.asarray`.
copy : bool, default False
Whether to ensure that the returned value ... | python | pandas/core/arrays/base.py | 607 | [
"self",
"dtype",
"copy",
"na_value"
] | np.ndarray | true | 6 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
resolve | @Override
public Object resolve(EvaluationContext context, String beanName) throws AccessException {
try {
return this.beanFactory.getBean(beanName);
}
catch (BeansException ex) {
throw new AccessException("Could not resolve bean reference against BeanFactory", ex);
}
} | Create a new {@code BeanFactoryResolver} for the given factory.
@param beanFactory the {@code BeanFactory} to resolve bean names against | java | spring-context/src/main/java/org/springframework/context/expression/BeanFactoryResolver.java | 47 | [
"context",
"beanName"
] | Object | true | 2 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
fit | def fit(self, X, y, copy_X=None):
"""Fit the model using X, y as training data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,)
Target values. Will be cast to X's dtype if necessar... | Fit the model using X, y as training data.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Training data.
y : array-like of shape (n_samples,)
Target values. Will be cast to X's dtype if necessary.
copy_X : bool, default=None
If provided, this parameter will override the choice
... | python | sklearn/linear_model/_least_angle.py | 2,225 | [
"self",
"X",
"y",
"copy_X"
] | false | 9 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
toString | @Override
public String toString() {
return "Generation{" +
"generationId=" + generationId +
", memberId='" + memberId + '\'' +
", protocol='" + protocolName + '\'' +
'}';
} | @return true if this generation has a valid member id, false otherwise. A member might have an id before
it becomes part of a group generation. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java | 1,625 | [] | String | true | 1 | 7.04 | apache/kafka | 31,560 | javadoc | false |
generateFixItHint | static FixItHint generateFixItHint(const FunctionDecl *Decl) {
// A fixit can be generated for functions of static storage class but
// otherwise the check cannot determine the appropriate function name prefix
// to use.
if (Decl->getStorageClass() != SC_Static)
return {};
const StringRef Name = Decl->ge... | other cases the user must determine an appropriate name on their own. | cpp | clang-tools-extra/clang-tidy/google/FunctionNamingCheck.cpp | 44 | [] | true | 7 | 7.04 | llvm/llvm-project | 36,021 | doxygen | false | |
createRound | function createRound(methodName) {
var func = Math[methodName];
return function(number, precision) {
number = toNumber(number);
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
if (precision && nativeIsFinite(number)) {
// Shift with exponential not... | Creates a function like `_.round`.
@private
@param {string} methodName The name of the `Math` method to use when rounding.
@returns {Function} Returns the new round function. | javascript | lodash.js | 5,515 | [
"methodName"
] | false | 4 | 6.08 | lodash/lodash | 61,490 | jsdoc | false | |
visitVariableDeclarationWorker | function visitVariableDeclarationWorker(node: VariableDeclaration, exportedVariableStatement: boolean): VisitResult<VariableDeclaration> {
// If we are here it is because the name contains a binding pattern with a rest somewhere in it.
if (isBindingPattern(node.name) && node.name.transformFlags & Tran... | Visits a VariableDeclaration node with a binding pattern.
@param node A VariableDeclaration node. | typescript | src/compiler/transformers/es2018.ts | 695 | [
"node",
"exportedVariableStatement"
] | true | 3 | 6.4 | microsoft/TypeScript | 107,154 | jsdoc | false | |
center | public static String center(final String str, final int size) {
return center(str, size, ' ');
} | Centers a String in a larger String of size {@code size} using the space character (' ').
<p>
If the size is less than the String length, the original String is returned. A {@code null} String returns {@code null}. A negative size is treated as
zero.
</p>
<p>
Equivalent to {@code center(str, size, " ")}.
</p>
<pre>
Str... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 568 | [
"str",
"size"
] | String | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
rank | def rank(
values: ArrayLike,
axis: AxisInt = 0,
method: str = "average",
na_option: str = "keep",
ascending: bool = True,
pct: bool = False,
) -> npt.NDArray[np.float64]:
"""
Rank the values along a given axis.
Parameters
----------
values : np.ndarray or ExtensionArray
... | Rank the values along a given axis.
Parameters
----------
values : np.ndarray or ExtensionArray
Array whose values will be ranked. The number of dimensions in this
array must not exceed 2.
axis : int, default 0
Axis over which to perform rankings.
method : {'average', 'min', 'max', 'first', 'dense'}, defau... | python | pandas/core/algorithms.py | 1,061 | [
"values",
"axis",
"method",
"na_option",
"ascending",
"pct"
] | npt.NDArray[np.float64] | true | 4 | 6.8 | pandas-dev/pandas | 47,362 | numpy | false |
charBufferOrNull | @Override
public CharBuffer charBufferOrNull() throws IOException {
if (currentToken() == Token.VALUE_NULL) {
return null;
}
return charBuffer();
} | Return the long that {@code stringValue} stores or throws an exception if the
stored value cannot be converted to a long that stores the exact same
value and {@code coerce} is false. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/support/AbstractXContentParser.java | 286 | [] | CharBuffer | true | 2 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false |
triu | def triu(m, k=0):
"""
Upper triangle of an array.
Return a copy of an array with the elements below the `k`-th diagonal
zeroed. For arrays with ``ndim`` exceeding 2, `triu` will apply to the
final two axes.
Please refer to the documentation for `tril` for further details.
See Also
---... | Upper triangle of an array.
Return a copy of an array with the elements below the `k`-th diagonal
zeroed. For arrays with ``ndim`` exceeding 2, `triu` will apply to the
final two axes.
Please refer to the documentation for `tril` for further details.
See Also
--------
tril : lower triangle of an array
Examples
----... | python | numpy/lib/_twodim_base_impl.py | 511 | [
"m",
"k"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | unknown | false | |
argsort | def argsort(
self,
axis: Axis = 0,
kind: SortKind = "quicksort",
order: None = None,
stable: None = None,
) -> Series:
"""
Return the integer indices that would sort the Series values.
Override ndarray.argsort. Argsorts the value, omitting NA/null val... | Return the integer indices that would sort the Series values.
Override ndarray.argsort. Argsorts the value, omitting NA/null values,
and places the result in the same locations as the non-NA values.
Parameters
----------
axis : {0 or 'index'}
Unused. Parameter needed for compatibility with DataFrame.
kind : {'mer... | python | pandas/core/series.py | 3,864 | [
"self",
"axis",
"kind",
"order",
"stable"
] | Series | true | 2 | 8.48 | pandas-dev/pandas | 47,362 | numpy | false |
transitionToJoining | public void transitionToJoining() {
if (state == MemberState.FATAL) {
log.warn("No action taken to join the group with the updated subscription because " +
"the member is in FATAL state");
return;
}
if (reconciliationInProgress) {
rejoinedW... | Transition to the {@link MemberState#JOINING} state, indicating that the member will
try to join the group on the next heartbeat request. This is expected to be invoked when
the user calls the subscribe API, or when the member wants to rejoin after getting fenced.
Visible for testing. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java | 528 | [] | void | true | 3 | 6.88 | apache/kafka | 31,560 | javadoc | false |
getProxy | @Override
public Object getProxy(@Nullable ClassLoader classLoader) {
if (logger.isTraceEnabled()) {
logger.trace("Creating JDK dynamic proxy: " + this.advised.getTargetSource());
}
return Proxy.newProxyInstance(determineClassLoader(classLoader), this.cache.proxiedInterfaces, this);
} | Construct a new JdkDynamicAopProxy for the given AOP configuration.
@param config the AOP configuration as AdvisedSupport object
@throws AopConfigException if the config is invalid. We try to throw an informative
exception in this case, rather than let a mysterious failure happen later. | java | spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java | 119 | [
"classLoader"
] | Object | true | 2 | 6.56 | spring-projects/spring-framework | 59,386 | javadoc | false |
containsKey | @Override
public boolean containsKey(@Nullable Object key) {
return map.containsKey(key);
} | Creates the collection of values for an explicitly provided key. By default, it simply calls
{@link #createCollection()}, which is the correct behavior for most implementations. The {@link
LinkedHashMultimap} class overrides it.
@param key key to associate with values in the collection
@return an empty collection of va... | java | android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java | 180 | [
"key"
] | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false | |
shouldNotWaitForHeartbeatInterval | public boolean shouldNotWaitForHeartbeatInterval() {
return state == MemberState.ACKNOWLEDGING || state == MemberState.LEAVING || state == MemberState.JOINING;
} | @return True if the member should send heartbeat to the coordinator without waiting for
the interval. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java | 607 | [] | true | 3 | 8 | apache/kafka | 31,560 | javadoc | false | |
_set_wrap_both | def _set_wrap_both(padded, axis, width_pair, original_period):
"""
Pad `axis` of `arr` with wrapped values.
Parameters
----------
padded : ndarray
Input array of arbitrary shape.
axis : int
Axis along which to pad `arr`.
width_pair : (int, int)
Pair of widths that ma... | Pad `axis` of `arr` with wrapped values.
Parameters
----------
padded : ndarray
Input array of arbitrary shape.
axis : int
Axis along which to pad `arr`.
width_pair : (int, int)
Pair of widths that mark the pad area on both sides in the given
dimension.
original_period : int
Original length of data... | python | numpy/lib/_arraypad_impl.py | 394 | [
"padded",
"axis",
"width_pair",
"original_period"
] | false | 7 | 6.16 | numpy/numpy | 31,054 | numpy | false | |
efficient_conv_bn_eval | def efficient_conv_bn_eval(
bn: nn.modules.batchnorm._BatchNorm, conv: nn.modules.conv._ConvNd, x: torch.Tensor
):
"""
Implementation based on https://arxiv.org/abs/2305.11624
"Efficient ConvBN Blocks for Transfer Learning and Beyond"
It leverages the associative law between convolution and affine t... | Implementation based on https://arxiv.org/abs/2305.11624
"Efficient ConvBN Blocks for Transfer Learning and Beyond"
It leverages the associative law between convolution and affine transform,
i.e., normalize (weight conv feature) = (normalize weight) conv feature.
It works for Eval mode of ConvBN blocks during validatio... | python | torch/_inductor/fx_passes/efficient_conv_bn_eval.py | 17 | [
"bn",
"conv",
"x"
] | true | 8 | 6.32 | pytorch/pytorch | 96,034 | google | false | |
_check_set_output_transform_dataframe | def _check_set_output_transform_dataframe(
name,
transformer_orig,
*,
dataframe_lib,
is_supported_dataframe,
create_dataframe,
assert_frame_equal,
context,
):
"""Check that a transformer can output a DataFrame when requested.
The DataFrame implementation is specified through the... | Check that a transformer can output a DataFrame when requested.
The DataFrame implementation is specified through the parameters of this function.
Parameters
----------
name : str
The name of the transformer.
transformer_orig : estimator
The original transformer instance.
dataframe_lib : str
The name of t... | python | sklearn/utils/estimator_checks.py | 5,133 | [
"name",
"transformer_orig",
"dataframe_lib",
"is_supported_dataframe",
"create_dataframe",
"assert_frame_equal",
"context"
] | false | 7 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
getExitCodeFromMappedException | private int getExitCodeFromMappedException(@Nullable ConfigurableApplicationContext context, Throwable exception) {
if (context == null || !context.isActive()) {
return 0;
}
ExitCodeGenerators generators = new ExitCodeGenerators();
Collection<ExitCodeExceptionMapper> beans = context.getBeansOfType(ExitCodeEx... | Register that the given exception has been logged. By default, if the running in
the main thread, this method will suppress additional printing of the stacktrace.
@param exception the exception that was logged | java | core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java | 902 | [
"context",
"exception"
] | true | 3 | 7.04 | spring-projects/spring-boot | 79,428 | javadoc | false | |
inverse | BiMap<V, K> inverse(); | Returns the inverse view of this bimap, which maps each of this bimap's values to its
associated key. The two bimaps are backed by the same data; any changes to one will appear in
the other.
<p><b>Note:</b> There is no guaranteed correspondence between the iteration order of a bimap
and that of its inverse.
@return the... | java | android/guava/src/com/google/common/collect/BiMap.java | 116 | [] | true | 1 | 6.8 | google/guava | 51,352 | javadoc | false | |
getMainPart | private MimeBodyPart getMainPart() throws MessagingException {
MimeMultipart mimeMultipart = getMimeMultipart();
MimeBodyPart bodyPart = null;
for (int i = 0; i < mimeMultipart.getCount(); i++) {
BodyPart bp = mimeMultipart.getBodyPart(i);
if (bp.getFileName() == null) {
bodyPart = (MimeBodyPart) bp;
... | Set the given plain text and HTML text as alternatives, offering
both options to the email client. Requires multipart mode.
<p><b>NOTE:</b> Invoke {@link #addInline} <i>after</i> {@code setText};
else, mail readers might not be able to resolve inline references correctly.
@param plainText the plain text for the message... | java | spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java | 850 | [] | MimeBodyPart | true | 4 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
addAotGeneratedEnvironmentPostProcessorIfNecessary | private void addAotGeneratedEnvironmentPostProcessorIfNecessary(List<EnvironmentPostProcessor> postProcessors,
SpringApplication springApplication) {
if (AotDetector.useGeneratedArtifacts()) {
ClassLoader classLoader = (springApplication.getResourceLoader() != null)
? springApplication.getResourceLoader().... | Factory method that creates an {@link EnvironmentPostProcessorApplicationListener}
with a specific {@link EnvironmentPostProcessorsFactory}.
@param postProcessorsFactory the environment post processor factory
@return an {@link EnvironmentPostProcessorApplicationListener} instance | java | core/spring-boot/src/main/java/org/springframework/boot/support/EnvironmentPostProcessorApplicationListener.java | 160 | [
"postProcessors",
"springApplication"
] | void | true | 4 | 7.12 | spring-projects/spring-boot | 79,428 | javadoc | false |
baseIsMap | function baseIsMap(value) {
return isObjectLike(value) && getTag(value) == mapTag;
} | The base implementation of `_.isMap` without Node.js optimizations.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a map, else `false`. | javascript | lodash.js | 3,385 | [
"value"
] | false | 2 | 6 | lodash/lodash | 61,490 | jsdoc | false | |
_validate_tz_from_dtype | def _validate_tz_from_dtype(
dtype, tz: tzinfo | None, explicit_tz_none: bool = False
) -> tzinfo | None:
"""
If the given dtype is a DatetimeTZDtype, extract the implied
tzinfo object from it and check that it does not conflict with the given
tz.
Parameters
----------
dtype : dtype, st... | If the given dtype is a DatetimeTZDtype, extract the implied
tzinfo object from it and check that it does not conflict with the given
tz.
Parameters
----------
dtype : dtype, str
tz : None, tzinfo
explicit_tz_none : bool, default False
Whether tz=None was passed explicitly, as opposed to lib.no_default.
Returns
-... | python | pandas/core/arrays/datetimes.py | 2,794 | [
"dtype",
"tz",
"explicit_tz_none"
] | tzinfo | None | true | 11 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
waiter | def waiter(
get_state_callable: Callable,
get_state_args: dict,
parse_response: list,
desired_state: set,
failure_states: set,
object_type: str,
action: str,
countdown: int | float | None = 25 * 60,
check_interval_seconds: int = 60,
) -> None:
"""
Call get_state_callable unti... | Call get_state_callable until it reaches the desired_state or the failure_states.
PLEASE NOTE: While not yet deprecated, we are moving away from this method
and encourage using the custom boto waiters as explained in
https://github.com/apache/airflow/tree/main/airflow/providers/amazon/aws/... | python | providers/amazon/src/airflow/providers/amazon/aws/utils/waiter.py | 30 | [
"get_state_callable",
"get_state_args",
"parse_response",
"desired_state",
"failure_states",
"object_type",
"action",
"countdown",
"check_interval_seconds"
] | None | true | 7 | 6.4 | apache/airflow | 43,597 | sphinx | false |
addBean | private static <B, T> void addBean(FormatterRegistry registry, B bean, @Nullable ResolvableType beanType,
Class<T> type, Consumer<B> standardRegistrar, @Nullable Runnable beanAdapterRegistrar) {
if (beanType != null && beanAdapterRegistrar != null
&& ResolvableType.forInstance(bean).as(type).hasUnresolvableGen... | Add {@link Printer}, {@link Parser}, {@link Formatter}, {@link Converter},
{@link ConverterFactory}, {@link GenericConverter}, and beans from the specified
bean factory.
@param registry the service to register beans with
@param beanFactory the bean factory to get the beans from
@param qualifier the qualifier required o... | java | core/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java | 389 | [
"registry",
"bean",
"beanType",
"type",
"standardRegistrar",
"beanAdapterRegistrar"
] | void | true | 4 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false |
autowireByName | protected void autowireByName(
String beanName, AbstractBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs) {
String[] propertyNames = unsatisfiedNonSimpleProperties(mbd, bw);
for (String propertyName : propertyNames) {
if (containsBean(propertyName)) {
Object bean = getBean(propertyName);
... | Fill in any missing property values with references to
other beans in this factory if autowire is set to "byName".
@param beanName the name of the bean we're wiring up.
Useful for debugging messages; not used functionally.
@param mbd bean definition to update through autowiring
@param bw the BeanWrapper from which we c... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java | 1,474 | [
"beanName",
"mbd",
"bw",
"pvs"
] | void | true | 4 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
countOrNull | @Override
public Integer countOrNull() {
return count();
} | Gets the base timestamp of the batch which is used to calculate the record timestamps from the deltas.
@return The base timestamp | java | clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java | 230 | [] | Integer | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false |
_check_engine | def _check_engine(engine: str | None) -> str:
"""
Make sure a valid engine is passed.
Parameters
----------
engine : str
String to validate.
Raises
------
KeyError
* If an invalid engine is passed.
ImportError
* If numexpr was requested but doesn't exist.
R... | Make sure a valid engine is passed.
Parameters
----------
engine : str
String to validate.
Raises
------
KeyError
* If an invalid engine is passed.
ImportError
* If numexpr was requested but doesn't exist.
Returns
-------
str
Engine name. | python | pandas/core/computation/eval.py | 38 | [
"engine"
] | str | true | 6 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
addInline | public void addInline(String contentId, @Nullable String inlineFilename, DataSource dataSource)
throws MessagingException {
Assert.notNull(contentId, "Content ID must not be null");
Assert.notNull(dataSource, "DataSource must not be null");
MimeBodyPart mimeBodyPart = new MimeBodyPart();
mimeBodyPart.setDis... | Add an inline element to the MimeMessage, taking the content from a
{@code jakarta.activation.DataSource} and assigning the provided
{@code inlineFileName} to the element.
<p>Note that the InputStream returned by the DataSource implementation
needs to be a <i>fresh one on each call</i>, as JavaMail will invoke
{@code g... | java | spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java | 927 | [
"contentId",
"inlineFilename",
"dataSource"
] | void | true | 4 | 6.4 | spring-projects/spring-framework | 59,386 | javadoc | false |
lazyValue | function lazyValue() {
var array = this.__wrapped__.value(),
dir = this.__dir__,
isArr = isArray(array),
isRight = dir < 0,
arrLength = isArr ? array.length : 0,
view = getView(0, arrLength, this.__views__),
start = view.start,
end = view.end,
... | Extracts the unwrapped value from its lazy wrapper.
@private
@name value
@memberOf LazyWrapper
@returns {*} Returns the unwrapped value. | javascript | lodash.js | 1,884 | [] | false | 15 | 6.64 | lodash/lodash | 61,490 | jsdoc | false | |
parseModifiersForConstructorType | function parseModifiersForConstructorType(): NodeArray<Modifier> | undefined {
let modifiers: NodeArray<Modifier> | undefined;
if (token() === SyntaxKind.AbstractKeyword) {
const pos = getNodePos();
nextToken();
const modifier = finishNode(factoryCreateToken(Synt... | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 4,497 | [] | true | 2 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
fchmodSync | function fchmodSync(fd, mode) {
if (permission.isEnabled()) {
throw new ERR_ACCESS_DENIED('fchmod API is disabled when Permission Model is enabled.');
}
binding.fchmod(
fd,
parseFileMode(mode, 'mode'),
);
} | Synchronously sets the permissions on the file.
@param {number} fd
@param {string | number} mode
@returns {void} | javascript | lib/fs.js | 1,949 | [
"fd",
"mode"
] | false | 2 | 6.24 | nodejs/node | 114,839 | jsdoc | false | |
initiateJoinGroup | private synchronized RequestFuture<ByteBuffer> initiateJoinGroup() {
// we store the join future in case we are woken up by the user after beginning the
// rebalance in the call to poll below. This ensures that we do not mistakenly attempt
// to rejoin before the pending rebalance has completed.... | Joins the group without starting the heartbeat thread.
If this function returns true, the state must always be in STABLE and heartbeat enabled.
If this function returns false, the state can be in one of the following:
* UNJOINED: got error response but times out before being able to re-join, heartbeat disabled
* PREP... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java | 566 | [] | true | 3 | 8.08 | apache/kafka | 31,560 | javadoc | false | |
resolvePattern | private List<StandardConfigDataResource> resolvePattern(StandardConfigDataReference reference) {
List<StandardConfigDataResource> resolved = new ArrayList<>();
for (Resource resource : this.resourceLoader.getResources(reference.getResourceLocation(), ResourceType.FILE)) {
if (!resource.exists() && reference.isSk... | Create a new {@link StandardConfigDataLocationResolver} instance.
@param logFactory the factory for loggers to use
@param binder a binder backed by the initial {@link Environment}
@param resourceLoader a {@link ResourceLoader} used to load resources | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataLocationResolver.java | 327 | [
"reference"
] | true | 3 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false | |
sendOffsetsForLeaderEpochRequestsAndValidatePositions | private void sendOffsetsForLeaderEpochRequestsAndValidatePositions(
Map<TopicPartition, SubscriptionState.FetchPosition> partitionsToValidate) {
final Map<Node, Map<TopicPartition, SubscriptionState.FetchPosition>> regrouped =
regroupFetchPositionsByLeader(partitionsToValidate);
... | For each partition that needs validation, make an asynchronous request to get the end-offsets
for the partition with the epoch less than or equal to the epoch the partition last saw.
<p/>
Requests are grouped by Node for efficiency.
This also adds the request to the list of unsentRequests.
@param partitionsToValidate a... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java | 722 | [
"partitionsToValidate"
] | void | true | 6 | 6.72 | apache/kafka | 31,560 | javadoc | false |
toString | @Override
public String toString() {
return "OffsetAndMetadata{" +
"offset=" + offset +
", leaderEpoch=" + leaderEpoch().orElse(null) +
", metadata='" + metadata + '\'' +
'}';
} | Get the leader epoch of the previously consumed record (if one is known). Log truncation is detected
if there exists a leader epoch which is larger than this epoch and begins at an offset earlier than
the committed offset.
@return the leader epoch or empty if not known | java | clients/src/main/java/org/apache/kafka/clients/consumer/OffsetAndMetadata.java | 119 | [] | String | true | 1 | 6.88 | apache/kafka | 31,560 | javadoc | false |
appendAll | public StrBuilder appendAll(final Iterator<?> it) {
if (it != null) {
it.forEachRemaining(this::append);
}
return this;
} | Appends each item in an iterator to the builder without any separators.
Appending a null iterator will have no effect.
Each object is appended using {@link #append(Object)}.
@param it the iterator to append
@return {@code this} instance.
@since 2.3 | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 804 | [
"it"
] | StrBuilder | true | 2 | 8.24 | apache/commons-lang | 2,896 | javadoc | false |
memory_usage | def memory_usage(self, index: bool = True, deep: bool = False) -> int:
"""
Return the memory usage of the Series.
The memory usage can optionally include the contribution of
the index and of elements of `object` dtype.
Parameters
----------
index : bool, default... | Return the memory usage of the Series.
The memory usage can optionally include the contribution of
the index and of elements of `object` dtype.
Parameters
----------
index : bool, default True
Specifies whether to include the memory usage of the Series index.
deep : bool, default False
If True, introspect the... | python | pandas/core/series.py | 5,829 | [
"self",
"index",
"deep"
] | int | true | 2 | 8.32 | pandas-dev/pandas | 47,362 | numpy | false |
buildDefaultToString | private String buildDefaultToString() {
if (this.elements.canShortcutWithSource(ElementType.UNIFORM, ElementType.DASHED)) {
return this.elements.getSource().toString();
}
int elements = getNumberOfElements();
StringBuilder result = new StringBuilder(elements * 8);
for (int i = 0; i < elements; i++) {
bo... | Returns {@code true} if this element is an ancestor (immediate or nested parent) of
the specified name.
@param name the name to check
@return {@code true} if this name is an ancestor | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java | 573 | [] | String | true | 6 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
computeToString | private String computeToString() {
StringBuilder builder = new StringBuilder().append(type).append('/').append(subtype);
if (!parameters.isEmpty()) {
builder.append("; ");
Multimap<String, String> quotedParameters =
Multimaps.transformValues(
parameters,
(String... | Returns the string representation of this media type in the format described in <a
href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>. | java | android/guava/src/com/google/common/net/MediaType.java | 1,238 | [] | String | true | 4 | 6.56 | google/guava | 51,352 | javadoc | false |
_find_manylinux_interpreters | def _find_manylinux_interpreters() -> list[str]:
"""Find Python interpreters in manylinux format (/opt/python/)."""
supported_versions = get_supported_python_versions()
interpreters = []
python_root = Path("/opt/python")
if not python_root.exists():
logger.warning("Path /opt/python does not... | Find Python interpreters in manylinux format (/opt/python/). | python | tools/packaging/build_wheel.py | 70 | [] | list[str] | true | 7 | 6.56 | pytorch/pytorch | 96,034 | unknown | false |
equals | @Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
final BaseVersionRange that = (BaseVersionRange) other;
return Objects.equals(this.minK... | Raises an exception unless the following condition is met:
minValue >= 0 and maxValue >= 0 and maxValue >= minValue.
@param minKeyLabel Label for the min version key, that's used only to convert to/from a map.
@param minValue The minimum version value.
@param maxKeyLabel Label for the max version key, that's u... | java | clients/src/main/java/org/apache/kafka/common/feature/BaseVersionRange.java | 109 | [
"other"
] | true | 7 | 6.72 | apache/kafka | 31,560 | javadoc | false | |
parseLiteralLikeNode | function parseLiteralLikeNode(kind: SyntaxKind): LiteralLikeNode {
const pos = getNodePos();
const node = isTemplateLiteralKind(kind) ? factory.createTemplateLiteralLikeNode(kind, scanner.getTokenValue(), getTemplateLiteralRawText(kind), scanner.getTokenFlags() & TokenFlags.TemplateLiteralLikeFlags) :... | 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,760 | [
"kind"
] | true | 7 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
update | @Override
protected void update(Sample sample, MetricConfig config, double value, long timeMs) {
HistogramSample hist = (HistogramSample) sample;
hist.histogram.record(value);
} | Return the computed frequency describing the number of occurrences of the values in the bucket for the given
center point, relative to the total number of occurrences in the samples.
@param config the metric configuration
@param now the current time in milliseconds
@param centerValue the value correspondin... | java | clients/src/main/java/org/apache/kafka/common/metrics/stats/Frequencies.java | 166 | [
"sample",
"config",
"value",
"timeMs"
] | void | true | 1 | 6.4 | apache/kafka | 31,560 | javadoc | false |
getTsconfigPath | async function getTsconfigPath(baseDirUri: vscode.Uri, pathValue: string, linkType: TsConfigLinkType): Promise<vscode.Uri | undefined> {
async function resolve(absolutePath: vscode.Uri): Promise<vscode.Uri> {
if (absolutePath.path.endsWith('.json') || await exists(absolutePath)) {
return absolutePath;
}
retur... | @returns Returns undefined in case of lack of result while trying to resolve from node_modules | typescript | extensions/typescript-language-features/src/languageFeatures/tsconfig.ts | 164 | [
"baseDirUri",
"pathValue",
"linkType"
] | true | 8 | 6.56 | microsoft/vscode | 179,840 | jsdoc | true | |
save_to_buffer | def save_to_buffer(
string: str,
buf: FilePath | WriteBuffer[str] | None = None,
encoding: str | None = None,
) -> str | None:
"""
Perform serialization. Write to buf or return as string if buf is None.
"""
with _get_buffer(buf, encoding=encoding) as fd:
fd.write(string)
if b... | Perform serialization. Write to buf or return as string if buf is None. | python | pandas/io/formats/format.py | 1,036 | [
"string",
"buf",
"encoding"
] | str | None | true | 2 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
_update_range_helper | def _update_range_helper(
self, node: int, start: int, end: int, left: int, right: int, value: T
) -> None:
"""
Helper method to update a range of values in the segment tree.
Args:
node: Current node index
start: Start index of the current segment
... | Helper method to update a range of values in the segment tree.
Args:
node: Current node index
start: Start index of the current segment
end: End index of the current segment
left: Start index of the range to update
right: End index of the range to update
value: Value to apply to the range | python | torch/_inductor/codegen/segmented_tree.py | 119 | [
"self",
"node",
"start",
"end",
"left",
"right",
"value"
] | None | true | 5 | 6.88 | pytorch/pytorch | 96,034 | google | false |
onClose | private void onClose(JarFile jarFile) {
this.cache.remove(jarFile);
} | Reconnect to the {@link JarFile}, returning a replacement {@link URLConnection}.
@param jarFile the jar file
@param existingConnection the existing connection
@return a newly opened connection inhering the same {@code useCaches} value as the
existing connection
@throws IOException on I/O error | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/UrlJarFiles.java | 134 | [
"jarFile"
] | void | true | 1 | 6 | spring-projects/spring-boot | 79,428 | javadoc | false |
claimArg | private @Nullable String claimArg(Deque<String> args) {
if (this.valueDescription == null) {
return null;
}
if (this.optionalValue) {
String nextArg = args.peek();
return (nextArg != null && !nextArg.startsWith("--")) ? args.removeFirst() : null;
}
try {
return args.removeFirst();
}
... | 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 | 315 | [
"args"
] | String | true | 6 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
build | public <K1 extends K, V1 extends V> Cache<K1, V1> build() {
checkWeightWithWeigher();
checkNonLoadingCache();
return new LocalCache.LocalManualCache<>(this);
} | Builds a cache which does not automatically load values when keys are requested.
<p>Consider {@link #build(CacheLoader)} instead, if it is feasible to implement a {@code
CacheLoader}.
<p>This method does not alter the state of this {@code CacheBuilder} instance, so it can be
invoked again to create multiple independent... | java | android/guava/src/com/google/common/cache/CacheBuilder.java | 1,054 | [] | true | 1 | 6.72 | google/guava | 51,352 | javadoc | false | |
add_references | def add_references(self, mgr: BaseBlockManager) -> None:
"""
Adds the references from one manager to another. We assume that both
managers have the same block structure.
"""
if len(self.blocks) != len(mgr.blocks):
# If block structure changes, then we made a copy
... | Adds the references from one manager to another. We assume that both
managers have the same block structure. | python | pandas/core/internals/managers.py | 318 | [
"self",
"mgr"
] | None | true | 3 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
fn | abstract long fn(long currentValue, long newValue); | Computes the function of current and new value. Subclasses should open-code this update
function for most uses, but the virtualized form is needed within retryUpdate.
@param currentValue the current value (of either base or a cell)
@param newValue the argument from a user update call
@return result of the update functi... | java | android/guava/src/com/google/common/cache/Striped64.java | 175 | [
"currentValue",
"newValue"
] | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false | |
compareTo | @Override
public int compareTo(final MutableBoolean other) {
return BooleanUtils.compare(this.value, other.value);
} | Compares this mutable to another in ascending order.
@param other the other mutable to compare to, not null
@return negative if this is less, zero if equal, positive if greater
where false is less than true | java | src/main/java/org/apache/commons/lang3/mutable/MutableBoolean.java | 91 | [
"other"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
lexx | static Token[] lexx(final String format) {
final ArrayList<Token> list = new ArrayList<>(format.length());
boolean inLiteral = false;
// Although the buffer is stored in a Token, the Tokens are only
// used internally, so cannot be accessed by other threads
StringBuilder buffer ... | Parses a classic date format string into Tokens
@param format the format to parse, not null
@return array of Token[] | java | src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java | 680 | [
"format"
] | true | 13 | 7.68 | apache/commons-lang | 2,896 | javadoc | false | |
from_codes | def from_codes(
cls,
codes,
categories=None,
ordered=None,
dtype: Dtype | None = None,
validate: bool = True,
) -> Self:
"""
Make a Categorical type from codes and categories or dtype.
This constructor is useful if you already have codes and
... | Make a Categorical type from codes and categories or dtype.
This constructor is useful if you already have codes and
categories/dtype and so do not need the (computation intensive)
factorization step, which is usually done on the constructor.
If your data does not follow this convention, please use the normal
constru... | python | pandas/core/arrays/categorical.py | 716 | [
"cls",
"codes",
"categories",
"ordered",
"dtype",
"validate"
] | Self | true | 3 | 8.24 | pandas-dev/pandas | 47,362 | numpy | false |
asBinderOptionsSet | private Set<BinderOption> asBinderOptionsSet(BinderOption... options) {
return ObjectUtils.isEmpty(options) ? EnumSet.noneOf(BinderOption.class)
: EnumSet.copyOf(Arrays.asList(options));
} | Return a {@link Binder} backed by the contributors.
@param activationContext the activation context
@param filter a filter used to limit the contributors
@param options binder options to apply
@return a binder instance | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java | 223 | [] | true | 2 | 7.52 | spring-projects/spring-boot | 79,428 | javadoc | false | |
compareIgnoreCase | @Deprecated
public static int compareIgnoreCase(final String str1, final String str2) {
return Strings.CI.compare(str1, str2);
} | Compares two Strings lexicographically, ignoring case differences, as per {@link String#compareToIgnoreCase(String)}, returning :
<ul>
<li>{@code int = 0}, if {@code str1} is equal to {@code str2} (or both {@code null})</li>
<li>{@code int < 0}, if {@code str1} is less than {@code str2}</li>
<li>{@code int > 0}, if {@c... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 907 | [
"str1",
"str2"
] | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false | |
anom | def anom(self, axis=None, dtype=None):
"""
Compute the anomalies (deviations from the arithmetic mean)
along the given axis.
Returns an array of anomalies, with the same shape as the input and
where the arithmetic mean is computed along the given axis.
Parameters
... | Compute the anomalies (deviations from the arithmetic mean)
along the given axis.
Returns an array of anomalies, with the same shape as the input and
where the arithmetic mean is computed along the given axis.
Parameters
----------
axis : int, optional
Axis over which the anomalies are taken.
The default is t... | python | numpy/ma/core.py | 5,430 | [
"self",
"axis",
"dtype"
] | false | 3 | 7.52 | numpy/numpy | 31,054 | numpy | false | |
bindModuleDeclaration | function bindModuleDeclaration(node: ModuleDeclaration) {
setExportContextFlag(node);
if (isAmbientModule(node)) {
if (hasSyntacticModifier(node, ModifierFlags.Export)) {
errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_a... | 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,351 | [
"node"
] | false | 13 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
requiresDestruction | default boolean requiresDestruction(Object bean) {
return true;
} | Determine whether the given bean instance requires destruction by this
post-processor.
<p>The default implementation returns {@code true}. If a pre-5 implementation
of {@code DestructionAwareBeanPostProcessor} does not provide a concrete
implementation of this method, Spring silently assumes {@code true} as well.
@para... | java | spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareBeanPostProcessor.java | 57 | [
"bean"
] | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false | |
asStoreDetails | private static JksSslStoreDetails asStoreDetails(JksSslBundleProperties.Store properties) {
return new JksSslStoreDetails(properties.getType(), properties.getProvider(), properties.getLocation(),
properties.getPassword());
} | Get an {@link SslBundle} for the given {@link JksSslBundleProperties}.
@param properties the source properties
@param resourceLoader the resource loader used to load content
@return an {@link SslBundle} instance
@since 3.3.5 | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/PropertiesSslBundle.java | 178 | [
"properties"
] | JksSslStoreDetails | true | 1 | 6.48 | spring-projects/spring-boot | 79,428 | javadoc | false |
_get_relative_fileloc | def _get_relative_fileloc(self, filepath: str) -> str:
"""
Get the relative file location for a given filepath.
:param filepath: Absolute path to the file
:return: Relative path from bundle_path, or original filepath if no bundle_path
"""
if self.bundle_path:
... | Get the relative file location for a given filepath.
:param filepath: Absolute path to the file
:return: Relative path from bundle_path, or original filepath if no bundle_path | python | airflow-core/src/airflow/dag_processing/dagbag.py | 391 | [
"self",
"filepath"
] | str | true | 2 | 8.24 | apache/airflow | 43,597 | sphinx | false |
handleDirents | function handleDirents({ result, currentPath, context }) {
const { 0: names, 1: types } = result;
const { length } = names;
for (let i = 0; i < length; i++) {
// Avoid excluding symlinks, as they are not directories.
// Refs: https://github.com/nodejs/node/issues/52663
const fullPath = pathModule.joi... | Synchronously creates a directory.
@param {string | Buffer | URL} path
@param {{
recursive?: boolean;
mode?: string | number;
} | number} [options]
@returns {string | void} | javascript | lib/fs.js | 1,403 | [] | false | 4 | 7.28 | nodejs/node | 114,839 | jsdoc | false | |
toArray | @GwtIncompatible // reflection
public @Nullable V[][] toArray(Class<V> valueClass) {
@SuppressWarnings("unchecked") // TODO: safe?
@Nullable V[][] copy =
(@Nullable V[][]) Array.newInstance(valueClass, rowList.size(), columnList.size());
for (int i = 0; i < rowList.size(); i++) {
arraycopy(a... | Returns a two-dimensional array with the table contents. The row and column indices correspond
to the positions of the row and column in the iterables provided during table construction. If
the table lacks a mapping for a given row and column, the corresponding array element is null.
<p>Subsequent table changes will no... | java | android/guava/src/com/google/common/collect/ArrayTable.java | 362 | [
"valueClass"
] | true | 2 | 6.72 | google/guava | 51,352 | javadoc | false | |
_unpack_nested_dtype | def _unpack_nested_dtype(other: Index) -> DtypeObj:
"""
When checking if our dtype is comparable with another, we need
to unpack CategoricalDtype to look at its categories.dtype.
Parameters
----------
other : Index
Returns
-------
np.dtype or ExtensionDtype
"""
dtype = othe... | When checking if our dtype is comparable with another, we need
to unpack CategoricalDtype to look at its categories.dtype.
Parameters
----------
other : Index
Returns
-------
np.dtype or ExtensionDtype | python | pandas/core/indexes/base.py | 7,856 | [
"other"
] | DtypeObj | true | 4 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false |
mergeNewValues | private void mergeNewValues(double compression) {
if (totalWeight == 0 && unmergedWeight == 0) {
// seriously nothing to do
return;
}
if (unmergedWeight > 0) {
// note that we run the merge in reverse every other merge to avoid left-to-right bias in merging
... | 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 | 290 | [
"compression"
] | void | true | 4 | 6.24 | elastic/elasticsearch | 75,680 | javadoc | false |
close | @Override
public void close() {
List<String> connections = new ArrayList<>(channels.keySet());
AtomicReference<Throwable> firstException = new AtomicReference<>();
Utils.closeAllQuietly(firstException, "release connections",
connections.stream().map(id -> (AutoCloseable) () -... | Close this selector and all associated connections | java | clients/src/main/java/org/apache/kafka/common/network/Selector.java | 368 | [] | void | true | 3 | 6.08 | apache/kafka | 31,560 | javadoc | false |
toString | public String toString() {
if (magic() > 0)
return String.format("Record(magic=%d, attributes=%d, compression=%s, crc=%d, %s=%d, key=%d bytes, value=%d bytes)",
magic(),
attributes(),
compressionType()... | Get the underlying buffer backing this record instance.
@return the buffer | java | clients/src/main/java/org/apache/kafka/common/record/LegacyRecord.java | 274 | [] | String | true | 6 | 8.08 | apache/kafka | 31,560 | javadoc | false |
initializeCjsConditions | function initializeCjsConditions() {
const userConditions = getOptionValue('--conditions');
const noAddons = getOptionValue('--no-addons');
const addonConditions = noAddons ? [] : ['node-addons'];
// TODO: Use this set when resolving pkg#exports conditions in loader.js.
cjsConditionsArray = [
'require',
... | Define the conditions that apply to the CommonJS loader.
@returns {void} | javascript | lib/internal/modules/helpers.js | 76 | [] | false | 3 | 7.12 | nodejs/node | 114,839 | jsdoc | false | |
send_callback | def send_callback(self, request: CallbackRequest) -> None:
"""
Send callback for execution.
Provides a default implementation which sends the callback to the `callback_sink` object.
:param request: Callback request to be executed.
"""
if not self.callback_sink:
... | Send callback for execution.
Provides a default implementation which sends the callback to the `callback_sink` object.
:param request: Callback request to be executed. | python | airflow-core/src/airflow/executors/base_executor.py | 586 | [
"self",
"request"
] | None | true | 2 | 6.72 | apache/airflow | 43,597 | sphinx | false |
handleCachedTransactionRequestResult | private TransactionalRequestResult handleCachedTransactionRequestResult(
Supplier<TransactionalRequestResult> transactionalRequestResultSupplier,
State nextState,
String operation
) {
ensureTransactional();
if (pendingTransition != null) {
if (pendingTransition.r... | 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,263 | [
"transactionalRequestResultSupplier",
"nextState",
"operation"
] | TransactionalRequestResult | true | 4 | 7.04 | apache/kafka | 31,560 | javadoc | false |
getSwitchCaseDefaultOccurrences | function getSwitchCaseDefaultOccurrences(switchStatement: SwitchStatement): Node[] {
const keywords: Node[] = [];
pushKeywordIf(keywords, switchStatement.getFirstToken(), SyntaxKind.SwitchKeyword);
// Go through each clause in the switch statement, collecting the 'case'/'default' keywords... | For lack of a better name, this function takes a throw statement and returns the
nearest ancestor that is a try-block (whose try statement has a catch clause),
function-block, or source file. | typescript | src/services/documentHighlights.ts | 392 | [
"switchStatement"
] | true | 2 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
add | @Override
public void add(double x, long w) {
checkValue(x);
needsCompression = true;
if (x < min) {
min = x;
}
if (x > max) {
max = x;
}
int start = summary.floor(x);
if (start == NIL) {
start = summary.first();
... | Sets the seed for the RNG.
In cases where a predictable tree should be created, this function may be used to make the
randomness in this AVLTree become more deterministic.
@param seed The random seed to use for RNG purposes | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/AVLTreeDigest.java | 95 | [
"x",
"w"
] | void | true | 14 | 7.12 | elastic/elasticsearch | 75,680 | javadoc | false |
common_fill_value | def common_fill_value(a, b):
"""
Return the common filling value of two masked arrays, if any.
If ``a.fill_value == b.fill_value``, return the fill value,
otherwise return None.
Parameters
----------
a, b : MaskedArray
The masked arrays for which to compare fill values.
Return... | Return the common filling value of two masked arrays, if any.
If ``a.fill_value == b.fill_value``, return the fill value,
otherwise return None.
Parameters
----------
a, b : MaskedArray
The masked arrays for which to compare fill values.
Returns
-------
fill_value : scalar or None
The common fill value, or N... | python | numpy/ma/core.py | 586 | [
"a",
"b"
] | false | 2 | 7.52 | numpy/numpy | 31,054 | numpy | false | |
endsWithElementsEqualTo | private boolean endsWithElementsEqualTo(ConfigurationPropertyName name) {
for (int i = this.elements.getSize() - 1; i >= 0; i--) {
if (elementDiffers(this.elements, name.elements, i)) {
return false;
}
}
return true;
} | Returns {@code true} if this element is an ancestor (immediate or nested parent) of
the specified name.
@param name the name to check
@return {@code true} if this name is an ancestor | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java | 385 | [
"name"
] | true | 3 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
storeToXML | @Override
public void storeToXML(OutputStream out, String comments) throws IOException {
super.storeToXML(out, (this.omitComments ? null : comments));
} | Construct a new {@code SortedProperties} instance with properties populated
from the supplied {@link Properties} object and honoring the supplied
{@code omitComments} flag.
<p>Default properties from the supplied {@code Properties} object will
not be copied.
@param properties the {@code Properties} object from which to... | java | spring-context-indexer/src/main/java/org/springframework/context/index/processor/SortedProperties.java | 111 | [
"out",
"comments"
] | void | true | 2 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false |
_validate_scalar | def _validate_scalar(
self,
value,
*,
allow_listlike: bool = False,
unbox: bool = True,
):
"""
Validate that the input value can be cast to our scalar_type.
Parameters
----------
value : object
allow_listlike: bool, default Fal... | Validate that the input value can be cast to our scalar_type.
Parameters
----------
value : object
allow_listlike: bool, default False
When raising an exception, whether the message should say
listlike inputs are allowed.
unbox : bool, default True
Whether to unbox the result before returning. Note: unbox... | python | pandas/core/arrays/datetimelike.py | 579 | [
"self",
"value",
"allow_listlike",
"unbox"
] | true | 8 | 6.8 | pandas-dev/pandas | 47,362 | numpy | false | |
get_dag_dependencies | def get_dag_dependencies(cls, session: Session = NEW_SESSION) -> dict[str, list[DagDependency]]:
"""
Get the dependencies between DAGs.
:param session: ORM Session
"""
load_json: Callable
data_col_to_select: ColumnElement[Any] | InstrumentedAttribute[bytes | None]
... | Get the dependencies between DAGs.
:param session: ORM Session | python | airflow-core/src/airflow/models/serialized_dag.py | 612 | [
"cls",
"session"
] | dict[str, list[DagDependency]] | true | 8 | 6.88 | apache/airflow | 43,597 | sphinx | false |
getClassOrFunctionName | function getClassOrFunctionName(fn: Function, defaultName?: string) {
const isArrow = !fn.hasOwnProperty('prototype');
const isEmptyName = fn.name === '';
if ((isArrow && isEmptyName) || isEmptyName) {
return '[Function]';
}
const hasDefaultName = fn.name === defaultName;
if (hasDefaultName) {
re... | Get the display name for a function or class.
@param fn - The function or class to get the name from
@param defaultName - Optional name to check against. If the function name matches this value,
'[Function]' is returned instead
@returns The formatted name: class name, function name with '()', or '[Function]' for anonym... | typescript | devtools/projects/ng-devtools-backend/src/lib/router-tree.ts | 191 | [
"fn",
"defaultName?"
] | false | 5 | 7.12 | angular/angular | 99,544 | jsdoc | false | |
getDouble | public double getDouble(int index) throws JSONException {
Object object = get(index);
Double result = JSON.toDouble(object);
if (result == null) {
throw JSON.typeMismatch(index, object, "double");
}
return result;
} | Returns the value at {@code index} if it exists and is a double or can be coerced
to a double.
@param index the index to get the value from
@return the {@code value}
@throws JSONException if the value at {@code index} doesn't exist or cannot be
coerced to a double. | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java | 366 | [
"index"
] | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
getVersionsMap | private Map<String, @Nullable Object> getVersionsMap(Environment environment, @Nullable String defaultValue) {
String appVersion = getApplicationVersion(environment);
String bootVersion = getBootVersion();
Map<String, @Nullable Object> versions = new HashMap<>();
versions.put("application.version", getVersionSt... | Return the application title that should be used for the source class. By default
will use {@link Package#getImplementationTitle()}.
@param sourceClass the source class
@return the application title | java | core/spring-boot/src/main/java/org/springframework/boot/ResourceBanner.java | 143 | [
"environment",
"defaultValue"
] | true | 1 | 6.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
set_names | def set_names(self, names, *, level=None, inplace: bool = False) -> Self | None:
"""
Set Index or MultiIndex name.
Able to set new names partially and by level.
Parameters
----------
names : Hashable or a sequence of the previous or dict-like for MultiIndex
... | Set Index or MultiIndex name.
Able to set new names partially and by level.
Parameters
----------
names : Hashable or a sequence of the previous or dict-like for MultiIndex
Name(s) to set.
level : int, Hashable or a sequence of the previous, optional
If the index is a MultiIndex and names is not dict-like, l... | python | pandas/core/indexes/base.py | 1,958 | [
"self",
"names",
"level",
"inplace"
] | Self | None | true | 24 | 7.2 | pandas-dev/pandas | 47,362 | numpy | false |
appendSeparator | public StrBuilder appendSeparator(final String separator, final int loopIndex) {
if (separator != null && loopIndex > 0) {
append(separator);
}
return this;
} | Appends a separator to the builder if the loop index is greater than zero.
Appending a null separator will have no effect.
The separator is appended using {@link #append(String)}.
<p>
This method is useful for adding a separator each time around the
loop except the first.
</p>
<pre>{@code
for (int i = 0; i < list.size(... | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 1,324 | [
"separator",
"loopIndex"
] | StrBuilder | true | 3 | 7.92 | apache/commons-lang | 2,896 | javadoc | false |
offsetsForInitializingPartitions | private Map<TopicPartition, OffsetAndMetadata> offsetsForInitializingPartitions(Map<TopicPartition, OffsetAndMetadata> offsets) {
Set<TopicPartition> currentlyInitializingPartitions = subscriptionState.initializingPartitions();
Map<TopicPartition, OffsetAndMetadata> result = new HashMap<>();
off... | Get the offsets, from the given collection, that belong to partitions that still require a position (partitions
that are initializing). This is expected to be used to filter out offsets that were retrieved for partitions
that do not need a position anymore.
@param offsets Offsets per partition
@return Subset of the off... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java | 437 | [
"offsets"
] | true | 2 | 8.08 | apache/kafka | 31,560 | javadoc | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.