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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
overArg | function overArg(func, transform) {
return function() {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : (length - 1);
args[in... | Creates a function that invokes `func` with its first argument transformed.
@private
@param {Function} func The function to wrap.
@param {Function} transform The argument transform.
@returns {Function} Returns the new function. | javascript | fp/_baseConvert.js | 443 | [
"func",
"transform"
] | false | 4 | 6.08 | lodash/lodash | 61,490 | jsdoc | false | |
format | public static String format(final Calendar calendar, final String pattern, final TimeZone timeZone, final Locale locale) {
final FastDateFormat df = FastDateFormat.getInstance(pattern, timeZone, locale);
return df.format(calendar);
} | Formats a calendar into a specific pattern in a time zone and locale.
@param calendar the calendar to format, not null.
@param pattern the pattern to use to format the calendar, not null.
@param timeZone the time zone to use, may be {@code null}.
@param locale the locale to use, may be {@code null}.
@return the fo... | java | src/main/java/org/apache/commons/lang3/time/DateFormatUtils.java | 254 | [
"calendar",
"pattern",
"timeZone",
"locale"
] | String | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
extractTypeArgumentsFrom | private static Type[] extractTypeArgumentsFrom(final Map<TypeVariable<?>, Type> mappings, final TypeVariable<?>[] variables) {
final Type[] result = new Type[variables.length];
int index = 0;
for (final TypeVariable<?> var : variables) {
Validate.isTrue(mappings.containsKey(var), () ... | Helper method to establish the formal parameters for a parameterized type.
@param mappings map containing the assignments.
@param variables expected map keys.
@return array of map values corresponding to specified keys. | java | src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | 544 | [
"mappings",
"variables"
] | true | 1 | 6.56 | apache/commons-lang | 2,896 | javadoc | false | |
parseExpected | function parseExpected(kind: PunctuationOrKeywordSyntaxKind, diagnosticMessage?: DiagnosticMessage, shouldAdvance = true): boolean {
if (token() === kind) {
if (shouldAdvance) {
nextToken();
}
return true;
}
// Report specific message ... | Invokes the provided callback. If the callback returns something falsy, then it restores
the parser to the state it was in immediately prior to invoking the callback. If the
callback returns something truthy, then the parser state is not rolled back. The result
of invoking the callback is returned from this funct... | typescript | src/compiler/parser.ts | 2,338 | [
"kind",
"diagnosticMessage?",
"shouldAdvance"
] | true | 5 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
columnKeySet | Set<C> columnKeySet(); | Returns a set of column keys that have one or more values in the table. Changes to the set will
update the underlying table, and vice versa.
@return set of column keys | java | android/guava/src/com/google/common/collect/Table.java | 224 | [] | true | 1 | 6.8 | google/guava | 51,352 | javadoc | false | |
items | def items(self) -> Iterable[tuple[Hashable, Series]]:
r"""
Iterate over (column name, Series) pairs.
Iterates over the DataFrame columns, returning a tuple with
the column name and the content as a Series.
Yields
------
label : object
The column name... | r"""
Iterate over (column name, Series) pairs.
Iterates over the DataFrame columns, returning a tuple with
the column name and the content as a Series.
Yields
------
label : object
The column names for the DataFrame being iterated over.
content : Series
The column entries belonging to each label, as a Series.... | python | pandas/core/frame.py | 1,491 | [
"self"
] | Iterable[tuple[Hashable, Series]] | true | 2 | 8.32 | pandas-dev/pandas | 47,362 | unknown | false |
publicSuffixIndex | private int publicSuffixIndex() {
int publicSuffixIndexLocal = publicSuffixIndexCache;
if (publicSuffixIndexLocal == SUFFIX_NOT_INITIALIZED) {
publicSuffixIndexCache =
publicSuffixIndexLocal = findSuffixOfType(Optional.<PublicSuffixType>absent());
}
return publicSuffixIndexLocal;
} | The index in the {@link #parts()} list at which the public suffix begins. For example, for the
domain name {@code myblog.blogspot.co.uk}, the value would be 1 (the index of the {@code
blogspot} part). The value is negative (specifically, {@link #NO_SUFFIX_FOUND}) if no public
suffix was found. | java | android/guava/src/com/google/common/net/InternetDomainName.java | 180 | [] | true | 2 | 7.04 | google/guava | 51,352 | javadoc | false | |
escapeUnsafe | protected abstract char @Nullable [] escapeUnsafe(char c); | Escapes a {@code char} value that has no direct explicit value in the replacement array and
lies outside the stated safe range. Subclasses should override this method to provide
generalized escaping for characters.
<p>Note that arrays returned by this method must not be modified once they have been returned.
However it... | java | android/guava/src/com/google/common/escape/ArrayBasedCharEscaper.java | 149 | [
"c"
] | true | 1 | 6.8 | google/guava | 51,352 | javadoc | false | |
peek | private Scope peek() throws JSONException {
if (this.stack.isEmpty()) {
throw new JSONException("Nesting problem");
}
return this.stack.get(this.stack.size() - 1);
} | Returns the value on the top of the stack.
@return the scope
@throws JSONException if processing of json failed | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONStringer.java | 213 | [] | Scope | true | 2 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
leftPad | public static String leftPad(final String str, final int size, String padStr) {
if (str == null) {
return null;
}
if (isEmpty(padStr)) {
padStr = SPACE;
}
final int padLen = padStr.length();
final int strLen = str.length();
final int pads =... | Left pad a String with a specified String.
<p>
Pad to a size of {@code size}.
</p>
<pre>
StringUtils.leftPad(null, *, *) = null
StringUtils.leftPad("", 3, "z") = "zzz"
StringUtils.leftPad("bat", 3, "yz") = "bat"
StringUtils.leftPad("bat", 5, "yz") = "yzbat"
StringUtils.leftPad("bat", 8, "yz") = "yzyzybat"
... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 5,155 | [
"str",
"size",
"padStr"
] | String | true | 9 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
stream | Stream<ConfigurationPropertyName> stream(); | Returns a sequential {@code Stream} for the {@link ConfigurationPropertyName names}
managed by this source.
@return a stream of names (never {@code null}) | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/IterableConfigurationPropertySource.java | 62 | [] | true | 1 | 6.16 | spring-projects/spring-boot | 79,428 | javadoc | false | |
getExtensions | protected List<String> getExtensions(@Nullable ClassLoader classLoader) {
List<String> extensions = new ArrayList<>();
List<PropertySourceLoader> propertySourceLoaders = getSpringFactoriesLoader(classLoader)
.load(PropertySourceLoader.class);
for (PropertySourceLoader propertySourceLoader : propertySourceLoade... | Get the application file extensions to consider. A valid extension starts with a
dot.
@param classLoader the classloader to use
@return the configuration file extensions | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocationRuntimeHints.java | 93 | [
"classLoader"
] | true | 2 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false | |
applyJBossLoggingProperties | private void applyJBossLoggingProperties() {
if (JBOSS_LOGGING_PRESENT) {
setSystemProperty("org.jboss.logging.provider", "slf4j");
}
} | Create a new {@link LoggingSystemProperties} instance.
@param environment the source environment
@param defaultValueResolver function used to resolve default values or {@code null}
@param setter setter used to apply the property or {@code null} for system
properties
@since 3.2.0 | java | core/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystemProperties.java | 88 | [] | void | true | 2 | 6.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
format_tensor_descriptor | def format_tensor_descriptor(spec: Spec) -> str:
"""
Format a tensor or scalar spec as a descriptor comment.
Args:
spec: TensorSpec or ScalarSpec to format
Returns:
Formatted descriptor string like "size=(64, 176, 96), stride=(16896, 96, 1), dtype=bfloat16, device=cuda"
"""
if ... | Format a tensor or scalar spec as a descriptor comment.
Args:
spec: TensorSpec or ScalarSpec to format
Returns:
Formatted descriptor string like "size=(64, 176, 96), stride=(16896, 96, 1), dtype=bfloat16, device=cuda" | python | tools/experimental/torchfuzz/tensor_descriptor.py | 7 | [
"spec"
] | str | true | 4 | 7.6 | pytorch/pytorch | 96,034 | google | false |
afterPropertiesSet | @Override
public void afterPropertiesSet() throws SchedulerException {
if (this.scheduler == null) {
this.scheduler = (this.schedulerName != null ? findScheduler(this.schedulerName) : findDefaultScheduler());
}
registerListeners();
registerJobsAndTriggers();
} | Return the Quartz Scheduler instance that this accessor operates on. | java | spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessorBean.java | 89 | [] | void | true | 3 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false |
hasUniqueWriteMethod | public static boolean hasUniqueWriteMethod(PropertyDescriptor pd) {
if (pd instanceof GenericTypeAwarePropertyDescriptor gpd) {
return gpd.hasUniqueWriteMethod();
}
else {
return (pd.getWriteMethod() != null);
}
} | Determine whether the specified property has a unique write method,
i.e. is writable but does not declare overloaded setter methods.
@param pd the PropertyDescriptor for the property
@return {@code true} if writable and unique, {@code false} otherwise
@since 6.1.4 | java | spring-beans/src/main/java/org/springframework/beans/BeanUtils.java | 618 | [
"pd"
] | true | 2 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false | |
set_new_process_group | def set_new_process_group() -> None:
"""
Try to set current process to a new process group.
That makes it easy to kill all sub-process of this at the OS-level,
rather than having to iterate the child processes.
If current process was spawned by system call ``exec()``, the current
process group... | Try to set current process to a new process group.
That makes it easy to kill all sub-process of this at the OS-level,
rather than having to iterate the child processes.
If current process was spawned by system call ``exec()``, the current
process group is kept. | python | airflow-core/src/airflow/utils/process_utils.py | 376 | [] | None | true | 2 | 7.2 | apache/airflow | 43,597 | unknown | false |
getAdvisorMethods | private List<Method> getAdvisorMethods(Class<?> aspectClass) {
List<Method> methods = new ArrayList<>();
ReflectionUtils.doWithMethods(aspectClass, methods::add, adviceMethodFilter);
if (methods.size() > 1) {
methods.sort(adviceMethodComparator);
}
return methods;
} | Create a new {@code ReflectiveAspectJAdvisorFactory}, propagating the given
{@link BeanFactory} to the created {@link AspectJExpressionPointcut} instances,
for bean pointcut handling as well as consistent {@link ClassLoader} resolution.
@param beanFactory the BeanFactory to propagate (may be {@code null})
@since 4.3.6
... | java | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java | 168 | [
"aspectClass"
] | true | 2 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false | |
get_async | def get_async(
self: Self, key: Key, executor: ThreadPoolExecutor
) -> Future[Value | None]:
"""
Retrieve a value from the cache asynchronously.
Args:
key (Key): The key to look up.
executor (ThreadPoolExecutor): Executor for async execution.
Returns:
... | Retrieve a value from the cache asynchronously.
Args:
key (Key): The key to look up.
executor (ThreadPoolExecutor): Executor for async execution.
Returns:
Future[Value | None]: Future for the cached value or None. | python | torch/_inductor/cache.py | 221 | [
"self",
"key",
"executor"
] | Future[Value | None] | true | 1 | 6.72 | pytorch/pytorch | 96,034 | google | false |
awaitNotEmpty | void awaitNotEmpty(Timer timer) {
lock.lock();
try {
while (completedFetches.isEmpty() && !wokenUp.compareAndSet(true, false)) {
// Update the timer before we head into the loop in case it took a while to get the lock.
timer.update();
if (time... | Allows the caller to await presence of data in the buffer. The method will block, returning only
under one of the following conditions:
<ol>
<li>The buffer was already non-empty on entry</li>
<li>The buffer was populated during the wait</li>
<li>The remaining time on the {@link Timer timer} elapsed</li>
... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchBuffer.java | 136 | [
"timer"
] | void | true | 7 | 6.24 | apache/kafka | 31,560 | javadoc | false |
get_scalar | def get_scalar(self, name: str) -> Union[float, int]:
"""
Get the scalar value for a given name.
Args:
name: Name of the scalar to get
Returns:
The scalar value
"""
assert name in self._scalars, f"Scalar {name} not found, but required"
re... | Get the scalar value for a given name.
Args:
name: Name of the scalar to get
Returns:
The scalar value | python | torch/_inductor/kernel_inputs.py | 186 | [
"self",
"name"
] | Union[float, int] | true | 1 | 6.56 | pytorch/pytorch | 96,034 | google | false |
containsRange | public boolean containsRange(final Range<T> otherRange) {
if (otherRange == null) {
return false;
}
return contains(otherRange.minimum)
&& contains(otherRange.maximum);
} | Checks whether this range contains all the elements of the specified range.
<p>This method may fail if the ranges have two different comparators or element types.</p>
@param otherRange the range to check, null returns false.
@return true if this range contains the specified range.
@throws RuntimeException if ranges ca... | java | src/main/java/org/apache/commons/lang3/Range.java | 263 | [
"otherRange"
] | true | 3 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
partitionCountForTopic | public Integer partitionCountForTopic(String topic) {
List<PartitionInfo> partitions = this.partitionsByTopic.get(topic);
return partitions == null ? null : partitions.size();
} | Get the number of partitions for the given topic.
@param topic The topic to get the number of partitions for
@return The number of partitions or null if there is no corresponding metadata | java | clients/src/main/java/org/apache/kafka/common/Cluster.java | 303 | [
"topic"
] | Integer | true | 2 | 8 | apache/kafka | 31,560 | javadoc | false |
truncate | function truncate(path, len, callback) {
if (typeof len === 'function') {
callback = len;
len = 0;
} else if (len === undefined) {
len = 0;
}
validateInteger(len, 'len');
len = MathMax(0, len);
validateFunction(callback, 'cb');
fs.open(path, 'r+', (er, fd) => {
if (er) return callback(er)... | Truncates the file.
@param {string | Buffer | URL} path
@param {number} [len]
@param {(err?: Error) => any} callback
@returns {void} | javascript | lib/fs.js | 1,028 | [
"path",
"len",
"callback"
] | false | 5 | 6.08 | nodejs/node | 114,839 | jsdoc | false | |
contains | public boolean contains(final char ch) {
final char[] thisBuf = buffer;
for (int i = 0; i < this.size; i++) {
if (thisBuf[i] == ch) {
return true;
}
}
return false;
} | Checks if the string builder contains the specified char.
@param ch the character to find
@return true if the builder contains the character | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 1,619 | [
"ch"
] | true | 3 | 8.24 | apache/commons-lang | 2,896 | javadoc | false | |
synchronizedListMultimap | @J2ktIncompatible // Synchronized
public static <K extends @Nullable Object, V extends @Nullable Object>
ListMultimap<K, V> synchronizedListMultimap(ListMultimap<K, V> multimap) {
return Synchronized.listMultimap(multimap, null);
} | Returns a synchronized (thread-safe) {@code ListMultimap} backed by the specified multimap.
<p>You must follow the warnings described in {@link #synchronizedMultimap}.
@param multimap the multimap to be wrapped
@return a synchronized view of the specified multimap | java | android/guava/src/com/google/common/collect/Multimaps.java | 983 | [
"multimap"
] | true | 1 | 6.24 | google/guava | 51,352 | javadoc | false | |
get_series_repr_params | def get_series_repr_params() -> dict[str, Any]:
"""Get the parameters used to repr(Series) calls using Series.to_string.
Supplying these parameters to Series.to_string is equivalent to calling
``repr(series)``. This is useful if you want to adjust the series repr output.
Example
-------
>>> im... | Get the parameters used to repr(Series) calls using Series.to_string.
Supplying these parameters to Series.to_string is equivalent to calling
``repr(series)``. This is useful if you want to adjust the series repr output.
Example
-------
>>> import pandas as pd
>>>
>>> ser = pd.Series([1, 2, 3, 4])
>>> repr_params = p... | python | pandas/io/formats/format.py | 386 | [] | dict[str, Any] | true | 3 | 8.32 | pandas-dev/pandas | 47,362 | unknown | false |
extractFileName | private @Nullable String extractFileName(@Nullable Header header) {
if (header != null) {
String value = header.getValue();
int start = value.indexOf(FILENAME_HEADER_PREFIX);
if (start != -1) {
value = value.substring(start + FILENAME_HEADER_PREFIX.length());
int end = value.indexOf('\"');
if (en... | Retrieves the meta-data of the service at the specified URL.
@param url the URL
@return the response | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java | 238 | [
"header"
] | String | true | 4 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
should_extension_dispatch | def should_extension_dispatch(left: ArrayLike, right: Any) -> bool:
"""
Identify cases where Series operation should dispatch to ExtensionArray method.
Parameters
----------
left : np.ndarray or ExtensionArray
right : object
Returns
-------
bool
"""
return isinstance(left, ... | Identify cases where Series operation should dispatch to ExtensionArray method.
Parameters
----------
left : np.ndarray or ExtensionArray
right : object
Returns
-------
bool | python | pandas/core/ops/dispatch.py | 18 | [
"left",
"right"
] | bool | true | 2 | 6.08 | pandas-dev/pandas | 47,362 | numpy | false |
beanProvider | <T> ObjectProvider<T> beanProvider(ParameterizedTypeReference<T> beanType); | Return a provider for the specified bean, allowing for lazy on-demand retrieval
of instances, including availability and uniqueness options. This variant allows
for specifying a generic type to match, similar to reflective injection points
with generic type declarations in method/constructor parameters.
<p>Note that co... | java | spring-beans/src/main/java/org/springframework/beans/factory/BeanRegistry.java | 278 | [
"beanType"
] | true | 1 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false | |
partition | @Override
public int partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, Cluster cluster) {
int nextValue = nextValue(topic);
List<PartitionInfo> availablePartitions = cluster.availablePartitionsForTopic(topic);
if (!availablePartitions.isEmpty()) {
... | Compute the partition for the given record.
@param topic The topic name
@param key The key to partition on (or null if no key)
@param keyBytes serialized key to partition on (or null if no key)
@param value The value to partition on or null
@param valueBytes serialized value to partition on or null
@param cluster The c... | java | clients/src/main/java/org/apache/kafka/clients/producer/RoundRobinPartitioner.java | 52 | [
"topic",
"key",
"keyBytes",
"value",
"valueBytes",
"cluster"
] | true | 2 | 6.72 | apache/kafka | 31,560 | javadoc | false | |
configureHeadlessProperty | private void configureHeadlessProperty() {
System.setProperty(SYSTEM_PROPERTY_JAVA_AWT_HEADLESS,
System.getProperty(SYSTEM_PROPERTY_JAVA_AWT_HEADLESS, Boolean.toString(this.headless)));
} | Run the Spring application, creating and refreshing a new
{@link ApplicationContext}.
@param args the application arguments (usually passed from a Java main method)
@return a running {@link ApplicationContext} | java | core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java | 448 | [] | void | true | 1 | 6 | spring-projects/spring-boot | 79,428 | javadoc | false |
preInstantiateSingletons | @Override
public void preInstantiateSingletons() throws BeansException {
if (logger.isTraceEnabled()) {
logger.trace("Pre-instantiating singletons in " + this);
}
// Iterate over a copy to allow for init methods which in turn register new bean definitions.
// While this may not be part of the regular facto... | Considers all beans as eligible for metadata caching
if the factory's configuration has been marked as frozen.
@see #freezeConfiguration() | java | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java | 1,101 | [] | void | true | 9 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
isin | def isin(self, values, level: str_t | int | None = None) -> npt.NDArray[np.bool_]:
"""
Return a boolean array where the index values are in `values`.
Compute boolean array of whether each index value is found in the
passed set of values. The length of the returned boolean array matches
... | Return a boolean array where the index values are in `values`.
Compute boolean array of whether each index value is found in the
passed set of values. The length of the returned boolean array matches
the length of the index.
Parameters
----------
values : set or list-like
Sought values.
level : str or int, option... | python | pandas/core/indexes/base.py | 6,584 | [
"self",
"values",
"level"
] | npt.NDArray[np.bool_] | true | 2 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false |
invokeHandlerMethod | private void invokeHandlerMethod(MethodInvocation mi, Throwable ex, Method method) throws Throwable {
Object[] handlerArgs;
if (method.getParameterCount() == 1) {
handlerArgs = new Object[] {ex};
}
else {
handlerArgs = new Object[] {mi.getMethod(), mi.getArguments(), mi.getThis(), ex};
}
try {
meth... | Determine the exception handle method for the given exception.
@param exception the exception thrown
@return a handler for the given exception type, or {@code null} if none found | java | spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java | 168 | [
"mi",
"ex",
"method"
] | void | true | 3 | 8.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
immutableEnumSet | public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(
E anElement, E... otherElements) {
return ImmutableEnumSet.asImmutable(EnumSet.of(anElement, otherElements));
} | Returns an immutable set instance containing the given enum elements. Internally, the returned
set will be backed by an {@link EnumSet}.
<p>The iteration order of the returned set follows the enum's iteration order, not the order in
which the elements are provided to the method.
@param anElement one of the elements the... | java | android/guava/src/com/google/common/collect/Sets.java | 105 | [
"anElement"
] | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false | |
supportsSourceType | @Override
public boolean supportsSourceType(@Nullable Class<?> sourceType) {
return (!(this.delegate instanceof SmartApplicationListener sal) || sal.supportsSourceType(sourceType));
} | Create a new GenericApplicationListener for the given delegate.
@param delegate the delegate listener to be invoked | java | spring-context/src/main/java/org/springframework/context/event/GenericApplicationListenerAdapter.java | 82 | [
"sourceType"
] | true | 2 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false | |
min | public ExponentialHistogramBuilder min(double min) {
this.min = min;
return this;
} | Sets the min value of the histogram values. If not set, the min will be estimated from the buckets.
@param min the min value
@return the builder | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramBuilder.java | 117 | [
"min"
] | ExponentialHistogramBuilder | true | 1 | 6.96 | elastic/elasticsearch | 75,680 | javadoc | false |
toString | @Override
public String toString() {
return getClass().getName() + ": advice [" + getAdvice() +
"], pointcut patterns " + ObjectUtils.nullSafeToString(this.patterns);
} | Create the actual pointcut: By default, a {@link JdkRegexpMethodPointcut}
will be used.
@return the Pointcut instance (never {@code null}) | java | spring-aop/src/main/java/org/springframework/aop/support/RegexpMethodPointcutAdvisor.java | 142 | [] | String | true | 1 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
declaresMultipleFieldsInStatement | static bool declaresMultipleFieldsInStatement(const RecordDecl *Decl) {
SourceLocation LastTypeLoc;
for (const auto &Field : Decl->fields()) {
SourceLocation TypeLoc =
Field->getTypeSourceInfo()->getTypeLoc().getBeginLoc();
if (LastTypeLoc.isValid() && TypeLoc == LastTypeLoc)
return true;
... | \returns nullptr if the name is ambiguous or not found. | cpp | clang-tools-extra/clang-reorder-fields/ReorderFieldsAction.cpp | 57 | [] | true | 3 | 7.04 | llvm/llvm-project | 36,021 | doxygen | false | |
methodIdentification | protected String methodIdentification(Method method, Class<?> targetClass) {
Method specificMethod = ClassUtils.getMostSpecificMethod(method, targetClass);
return ClassUtils.getQualifiedMethodName(specificMethod);
} | Convenience method to return a String representation of this Method
for use in logging. Can be overridden in subclasses to provide a
different identifier for the given method.
@param method the method we're interested in
@param targetClass class the method is on
@return log message identifying this method
@see org.spri... | java | spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java | 304 | [
"method",
"targetClass"
] | String | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
sizeOf | @SuppressWarnings("unchecked")
@Override
public int sizeOf(Object o) {
int size = 0;
NavigableMap<Integer, Object> objects = (NavigableMap<Integer, Object>) o;
size += ByteUtils.sizeOfUnsignedVarint(objects.size());
for (Map.Entry<Integer, Object> entry : objects.entrySet()) {
... | Create a new TaggedFields object with the given tags and fields.
@param fields This is an array containing Integer tags followed
by associated Field objects.
@return The new {@link TaggedFields} | java | clients/src/main/java/org/apache/kafka/common/protocol/types/TaggedFields.java | 113 | [
"o"
] | true | 2 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
getShortDescription | public String getShortDescription() {
if (this.aliases == null) {
return "Bean definition with name '" + this.beanName + "'";
}
return "Bean definition with name '" + this.beanName + "' and aliases [" + StringUtils.arrayToCommaDelimitedString(this.aliases) + ']';
} | Return a friendly, short description for the bean, stating name and aliases.
@see #getBeanName()
@see #getAliases() | java | spring-beans/src/main/java/org/springframework/beans/factory/config/BeanDefinitionHolder.java | 135 | [] | String | true | 2 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
deduce | public static WebApplicationType deduce() {
for (Deducer deducer : SpringFactoriesLoader.forDefaultResourceLocation().load(Deducer.class)) {
WebApplicationType deduced = deducer.deduceWebApplicationType();
if (deduced != null) {
return deduced;
}
}
return isServletApplication() ? WebApplicationType.S... | Deduce the {@link WebApplicationType} from the current classpath.
@return the deduced web application
@since 4.0.1 | java | core/spring-boot/src/main/java/org/springframework/boot/WebApplicationType.java | 63 | [] | WebApplicationType | true | 3 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
min | def min(
self,
numeric_only: bool = False,
engine: Literal["cython", "numba"] | None = None,
engine_kwargs: dict[str, bool] | None = None,
):
"""
Calculate the rolling minimum.
Parameters
----------
numeric_only : bool, default False
... | Calculate the rolling minimum.
Parameters
----------
numeric_only : bool, default False
Include only float, int, boolean columns.
engine : str, default None
* ``'cython'`` : Runs the operation through C-extensions from cython.
* ``'numba'`` : Runs the operation through JIT compiled code from numba.
* ... | python | pandas/core/window/rolling.py | 2,520 | [
"self",
"numeric_only",
"engine",
"engine_kwargs"
] | true | 1 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false | |
resolveNonPattern | private List<StandardConfigDataResource> resolveNonPattern(StandardConfigDataReference reference) {
Resource resource = this.resourceLoader.getResource(reference.getResourceLocation());
if (!resource.exists() && reference.isSkippable()) {
logSkippingResource(reference);
return Collections.emptyList();
}
r... | 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 | 318 | [
"reference"
] | true | 3 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false | |
calinski_harabasz_score | def calinski_harabasz_score(X, labels):
"""Compute the Calinski and Harabasz score.
It is also known as the Variance Ratio Criterion.
The score is defined as ratio of the sum of between-cluster dispersion and
of within-cluster dispersion.
Read more in the :ref:`User Guide <calinski_harabasz_index... | Compute the Calinski and Harabasz score.
It is also known as the Variance Ratio Criterion.
The score is defined as ratio of the sum of between-cluster dispersion and
of within-cluster dispersion.
Read more in the :ref:`User Guide <calinski_harabasz_index>`.
Parameters
----------
X : array-like of shape (n_samples, ... | python | sklearn/metrics/cluster/_unsupervised.py | 333 | [
"X",
"labels"
] | false | 6 | 7.12 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
add | @Override
@CanIgnoreReturnValue
public Builder<E> add(E... elements) {
if (hashTable != null) {
for (E e : elements) {
add(e);
}
} else {
super.add(elements);
}
return this;
} | Adds each element of {@code elements} to the {@code ImmutableSet}, ignoring duplicate
elements (only the first duplicate element is added).
@param elements the elements to add
@return this {@code Builder} object
@throws NullPointerException if {@code elements} is null or contains a null element | java | android/guava/src/com/google/common/collect/ImmutableSet.java | 506 | [] | true | 2 | 7.6 | google/guava | 51,352 | javadoc | false | |
put | public JSONObject put(String name, int value) throws JSONException {
this.nameValuePairs.put(checkName(name), value);
return this;
} | Maps {@code name} to {@code value}, clobbering any existing name/value mapping with
the same name.
@param name the name of the property
@param value the value of the property
@return this object.
@throws JSONException if an error occurs | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java | 232 | [
"name",
"value"
] | JSONObject | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false |
definePackage | @Override
protected Package definePackage(String name, String specTitle, String specVersion, String specVendor,
String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException {
if (!this.exploded) {
return super.definePackage(name, specTitle, specVersion, specVendor, imp... | Create a new {@link LaunchedClassLoader} instance.
@param exploded if the underlying archive is exploded
@param rootArchive the root archive or {@code null}
@param urls the URLs from which to load classes and resources
@param parent the parent class loader for delegation | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/LaunchedClassLoader.java | 125 | [
"name",
"specTitle",
"specVersion",
"specVendor",
"implTitle",
"implVersion",
"implVendor",
"sealBase"
] | Package | true | 2 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
Program | Program(
const Context& context,
const VECTOR_CLASS<Device>& devices,
const Binaries& binaries,
VECTOR_CLASS<cl_int>* binaryStatus = NULL,
cl_int* err = NULL)
{
cl_int error;
const ::size_t numDevices = devices.size();
// Catch size m... | Construct a program object from a list of devices and a per-device list of binaries.
\param context A valid OpenCL context in which to construct the program.
\param devices A vector of OpenCL device objects for which the program will be created.
\param binaries A vector of pairs of a pointer to a binary object and its ... | cpp | 3rdparty/include/opencl/1.2/CL/cl.hpp | 4,722 | [] | true | 8 | 6.88 | opencv/opencv | 85,374 | doxygen | false | |
getAccessibleMethodFromSuperclass | private static Method getAccessibleMethodFromSuperclass(final Class<?> cls, final String methodName, final Class<?>... parameterTypes) {
Class<?> parentClass = cls.getSuperclass();
while (parentClass != null) {
if (ClassUtils.isPublic(parentClass)) {
return getMethodObject(pa... | Gets an accessible method (that is, one that can be invoked via
reflection) by scanning through the superclasses. If no such method
can be found, return {@code null}.
@param cls Class to be checked.
@param methodName Method name of the method we wish to call.
@param parameterTypes The parameter type signatures.
@return... | java | src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | 205 | [
"cls",
"methodName"
] | Method | true | 3 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
formatVersion | function formatVersion(generator: Generator): string | undefined {
const version = generator.manifest?.version
if (generator.getProvider() === 'prisma-client-js') {
// version is always defined for prisma-client-js
return `v${version ?? '?.?.?'}`
}
return version
} | Creates and formats the success message for the given generator to print to
the console after generation finishes.
@param time time in milliseconds it took for the generator to run. | typescript | packages/internals/src/cli/getGeneratorSuccessMessage.ts | 20 | [
"generator"
] | true | 2 | 6.72 | prisma/prisma | 44,834 | jsdoc | false | |
randomAlphabetic | @Deprecated
public static String randomAlphabetic(final int minLengthInclusive, final int maxLengthExclusive) {
return secure().nextAlphabetic(minLengthInclusive, maxLengthExclusive);
} | Creates a random string whose length is between the inclusive minimum and the exclusive maximum.
<p>
Characters will be chosen from the set of Latin alphabetic characters (a-z, A-Z).
</p>
@param minLengthInclusive the inclusive minimum length of the string to generate.
@param maxLengthExclusive the exclusive maximum le... | java | src/main/java/org/apache/commons/lang3/RandomStringUtils.java | 442 | [
"minLengthInclusive",
"maxLengthExclusive"
] | String | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
isParentTheSame | private boolean isParentTheSame(MetadataGenerationEnvironment environment, Element returnType,
TypeElement element) {
if (returnType == null || element == null) {
return false;
}
returnType = getTopLevelType(returnType);
Element candidate = element;
while (candidate instanceof TypeElement) {
if (retu... | Return if this property has been explicitly marked as nested (for example using an
annotation}.
@param environment the metadata generation environment
@return if the property has been marked as nested | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptor.java | 157 | [
"environment",
"returnType",
"element"
] | true | 5 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false | |
shouldUseModuleEntryPoint | function shouldUseModuleEntryPoint(name, body) {
return getOptionValue('--experimental-detect-module') &&
getOptionValue('--input-type') === '' &&
containsModuleSyntax(body, name, null, 'no CJS variables');
} | @param {string} name - The filename of the script.
@param {string} body - The code of the script.
@returns {boolean} Whether the module entry point should be evaluated as a module. | javascript | lib/internal/process/execution.js | 406 | [
"name",
"body"
] | false | 3 | 6.24 | nodejs/node | 114,839 | jsdoc | false | |
from_arrow | def from_arrow(
cls, data: ArrowArrayExportable | ArrowStreamExportable
) -> DataFrame:
"""
Construct a DataFrame from a tabular Arrow object.
This function accepts any Arrow-compatible tabular object implementing
the `Arrow PyCapsule Protocol`_ (i.e. having an ``__arrow_c_a... | Construct a DataFrame from a tabular Arrow object.
This function accepts any Arrow-compatible tabular object implementing
the `Arrow PyCapsule Protocol`_ (i.e. having an ``__arrow_c_array__``
or ``__arrow_c_stream__`` method).
This function currently relies on ``pyarrow`` to convert the tabular
object in Arrow format... | python | pandas/core/frame.py | 1,839 | [
"cls",
"data"
] | DataFrame | true | 5 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
primitiveToWrapper | public static Class<?> primitiveToWrapper(final Class<?> cls) {
return cls != null && cls.isPrimitive() ? PRIMITIVE_WRAPPER_MAP.get(cls) : cls;
} | Converts the specified primitive Class object to its corresponding wrapper Class object.
<p>
NOTE: From v2.2, this method handles {@code Void.TYPE}, returning {@code Void.TYPE}.
</p>
@param cls the class to convert, may be null.
@return the wrapper class for {@code cls} or {@code cls} if {@code cls} is not a primitive.... | java | src/main/java/org/apache/commons/lang3/ClassUtils.java | 1,550 | [
"cls"
] | true | 3 | 8.16 | apache/commons-lang | 2,896 | javadoc | false | |
toBloomFilter | @IgnoreJRERequirement // Users will use this only if they're already using streams.
public static <T extends @Nullable Object> Collector<T, ?, BloomFilter<T>> toBloomFilter(
Funnel<? super T> funnel, long expectedInsertions) {
return toBloomFilter(funnel, expectedInsertions, 0.03);
} | Returns a {@code Collector} expecting the specified number of insertions, and yielding a {@link
BloomFilter} with false positive probability 3%.
<p>Note that if the {@code Collector} receives significantly more elements than specified, the
resulting {@code BloomFilter} will suffer a sharp deterioration of its false pos... | java | android/guava/src/com/google/common/hash/BloomFilter.java | 329 | [
"funnel",
"expectedInsertions"
] | true | 1 | 6.56 | google/guava | 51,352 | javadoc | false | |
errorMessageForResponse | public abstract String errorMessageForResponse(R response); | Returns the error message for the response.
@param response The heartbeat response
@return The error message | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractHeartbeatRequestManager.java | 515 | [
"response"
] | String | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false |
booleanValues | public static Boolean[] booleanValues() {
return new Boolean[] {Boolean.FALSE, Boolean.TRUE};
} | Returns a new array of possible values (like an enum would).
@return a new array of possible values (like an enum would).
@since 3.12.0 | java | src/main/java/org/apache/commons/lang3/BooleanUtils.java | 143 | [] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
runLockedCleanup | void runLockedCleanup() {
if (tryLock()) {
try {
maybeDrainReferenceQueues();
readCount.set(0);
} finally {
unlock();
}
}
} | Performs routine cleanup prior to executing a write. This should be called every time a write
thread acquires the segment lock, immediately after acquiring the lock. | java | android/guava/src/com/google/common/collect/MapMakerInternalMap.java | 2,007 | [] | void | true | 2 | 6.88 | google/guava | 51,352 | javadoc | false |
length | public static int length(final CharSequence cs) {
return cs == null ? 0 : cs.length();
} | Gets a CharSequence length or {@code 0} if the CharSequence is {@code null}.
@param cs a CharSequence or {@code null}.
@return CharSequence length or {@code 0} if the CharSequence is {@code null}.
@since 2.4
@since 3.0 Changed signature from length(String) to length(CharSequence) | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 5,193 | [
"cs"
] | true | 2 | 7.68 | apache/commons-lang | 2,896 | javadoc | false | |
entryIterator | @Override
Iterator<Entry<K, V>> entryIterator() {
return new BiIterator<K, V, Entry<K, V>>(HashBiMap.this) {
@Override
Entry<K, V> output(Node<K, V> node) {
return new MapEntry(node);
}
final class MapEntry extends AbstractMapEntry<K, V> {
private Node<K, V> node;
... | Returns {@code true} if this BiMap contains an entry whose value is equal to {@code value} (or,
equivalently, if this inverse view contains a key that is equal to {@code value}).
<p>Due to the property that values in a BiMap are unique, this will tend to execute in
faster-than-linear time.
@param value the object to se... | java | guava/src/com/google/common/collect/HashBiMap.java | 539 | [] | true | 4 | 7.92 | google/guava | 51,352 | javadoc | false | |
isUsingSources | @Contract("null, _ -> false")
private static boolean isUsingSources(@Nullable PropertySource<?> attached, MutablePropertySources sources) {
return attached instanceof ConfigurationPropertySourcesPropertySource
&& ((SpringConfigurationPropertySources) attached.getSource()).isUsingSources(sources);
} | Attach a {@link ConfigurationPropertySource} support to the specified
{@link Environment}. Adapts each {@link PropertySource} managed by the environment
to a {@link ConfigurationPropertySource} and allows classic
{@link PropertySourcesPropertyResolver} calls to resolve using
{@link ConfigurationPropertyName configurati... | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java | 101 | [
"attached",
"sources"
] | true | 2 | 6.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
generateWithGeneratorCode | private CodeBlock generateWithGeneratorCode(boolean hasArguments, CodeBlock newInstance) {
CodeBlock lambdaArguments = (hasArguments ?
CodeBlock.of("($L, $L)", REGISTERED_BEAN_PARAMETER_NAME, ARGS_PARAMETER_NAME) :
CodeBlock.of("($L)", REGISTERED_BEAN_PARAMETER_NAME));
Builder code = CodeBlock.builder();
... | Generate the instance supplier code.
@param registeredBean the bean to handle
@param instantiationDescriptor the executable to use to create the bean
@return the generated code
@since 6.1.7 | java | spring-beans/src/main/java/org/springframework/beans/factory/aot/InstanceSupplierCodeGenerator.java | 369 | [
"hasArguments",
"newInstance"
] | CodeBlock | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
and | default FailableIntPredicate<E> and(final FailableIntPredicate<E> other) {
Objects.requireNonNull(other);
return t -> test(t) && other.test(t);
} | Returns a composed {@link FailableIntPredicate} like {@link IntPredicate#and(IntPredicate)}.
@param other a predicate that will be logically-ANDed with this predicate.
@return a composed {@link FailableIntPredicate} like {@link IntPredicate#and(IntPredicate)}.
@throws NullPointerException if other is null | java | src/main/java/org/apache/commons/lang3/function/FailableIntPredicate.java | 69 | [
"other"
] | true | 2 | 7.36 | apache/commons-lang | 2,896 | javadoc | false | |
getFixesInfoForUMDImport | function getFixesInfoForUMDImport({ sourceFile, program, host, preferences }: CodeFixContextBase, token: Node): (FixInfo & { fix: ImportFixWithModuleSpecifier; })[] | undefined {
const checker = program.getTypeChecker();
const umdSymbol = getUmdSymbol(token, checker);
if (!umdSymbol) return undefined;
... | @returns `Comparison.LessThan` if `a` is better than `b`. | typescript | src/services/codefixes/importFixes.ts | 1,475 | [
"{ sourceFile, program, host, preferences }",
"token"
] | true | 2 | 6.4 | microsoft/TypeScript | 107,154 | jsdoc | false | |
find_package | def find_package(import_name: str) -> tuple[str | None, str]:
"""Find the prefix that a package is installed under, and the path
that it would be imported from.
The prefix is the directory containing the standard directory
hierarchy (lib, bin, etc.). If the package is not installed to the
system (:... | Find the prefix that a package is installed under, and the path
that it would be imported from.
The prefix is the directory containing the standard directory
hierarchy (lib, bin, etc.). If the package is not installed to the
system (:attr:`sys.prefix`) or a virtualenv (``site-packages``),
``None`` is returned.
The pa... | python | src/flask/sansio/scaffold.py | 754 | [
"import_name"
] | tuple[str | None, str] | true | 5 | 6 | pallets/flask | 70,946 | unknown | false |
implementsInterface | boolean implementsInterface(Class<?> intf); | Does this introduction advice implement the given interface?
@param intf the interface to check
@return whether the advice implements the specified interface | java | spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java | 46 | [
"intf"
] | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false | |
createExportExpression | function createExportExpression(name: Identifier | StringLiteral, value: Expression) {
const exportName = isIdentifier(name) ? factory.createStringLiteralFromNode(name) : name;
setEmitFlags(value, getEmitFlags(value) | EmitFlags.NoComments);
return setCommentRange(factory.createCallExpression... | Creates a call to the current file's export function to export a value.
@param name The bound name of the export.
@param value The exported value. | typescript | src/compiler/transformers/module/system.ts | 1,216 | [
"name",
"value"
] | false | 2 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
load_configs_dict | def load_configs_dict(file_path: str) -> dict[str, str]:
"""
Load configs from a text file.
``JSON``, `YAML` and ``.env`` files are supported.
:param file_path: The location of the file that will be processed.
:return: A dictionary where the key contains a config name and the value contains the co... | Load configs from a text file.
``JSON``, `YAML` and ``.env`` files are supported.
:param file_path: The location of the file that will be processed.
:return: A dictionary where the key contains a config name and the value contains the config value. | python | airflow-core/src/airflow/secrets/local_filesystem.py | 281 | [
"file_path"
] | dict[str, str] | true | 4 | 8.24 | apache/airflow | 43,597 | sphinx | false |
createCollection | @Override
Collection<V> createCollection(@ParametricNullness K key) {
if (key == null) {
int unused = keyComparator().compare(key, key);
}
return super.createCollection(key);
} | {@inheritDoc}
<p>Creates an empty {@code TreeSet} for a collection of values for one key.
@return a new {@code TreeSet} containing a collection of values for one key | java | android/guava/src/com/google/common/collect/TreeMultimap.java | 144 | [
"key"
] | true | 2 | 6.72 | google/guava | 51,352 | javadoc | false | |
implementsInterface | public boolean implementsInterface(Class<?> ifc) {
for (Class<?> pubIfc : this.publishedInterfaces) {
if (ifc.isInterface() && ifc.isAssignableFrom(pubIfc)) {
return true;
}
}
return false;
} | Check whether the specified interfaces is a published introduction interface.
@param ifc the interface to check
@return whether the interface is part of this introduction | java | spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java | 72 | [
"ifc"
] | true | 3 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false | |
getRelatedSymbol | function getRelatedSymbol(search: Search, referenceSymbol: Symbol, referenceLocation: Node, state: State): RelatedSymbol | undefined {
const { checker } = state;
return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, /*onlyIncludeBindingE... | Find symbol of the given property-name and add the symbol to the given result array
@param symbol a symbol to start searching for the given propertyName
@param propertyName a name of property to search for
@param result an array of symbol of found property symbols
@param previousIterationSymbolsCache a cache of sym... | typescript | src/services/findAllReferences.ts | 2,701 | [
"search",
"referenceSymbol",
"referenceLocation",
"state"
] | true | 10 | 6.4 | microsoft/TypeScript | 107,154 | jsdoc | false | |
checkConfigurationClassCandidate | static boolean checkConfigurationClassCandidate(
BeanDefinition beanDef, MetadataReaderFactory metadataReaderFactory) {
String className = beanDef.getBeanClassName();
if (className == null || beanDef.getFactoryMethodName() != null) {
return false;
}
AnnotationMetadata metadata;
if (beanDef instanceof ... | Check whether the given bean definition is a candidate for a configuration class
(or a nested component class declared within a configuration/component class,
to be auto-registered as well), and mark it accordingly.
@param beanDef the bean definition to check
@param metadataReaderFactory the current factory in use by t... | java | spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassUtils.java | 106 | [
"beanDef",
"metadataReaderFactory"
] | true | 19 | 6.48 | spring-projects/spring-framework | 59,386 | javadoc | false | |
indexOf | public static int indexOf(long[] array, long target) {
return indexOf(array, target, 0, array.length);
} | Returns the index of the first appearance of the value {@code target} in {@code array}.
@param array an array of {@code long} values, possibly empty
@param target a primitive {@code long} value
@return the least index {@code i} for which {@code array[i] == target}, or {@code -1} if no
such index exists. | java | android/guava/src/com/google/common/primitives/Longs.java | 119 | [
"array",
"target"
] | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false | |
visitConditionalExpression | function visitConditionalExpression(node: ConditionalExpression): Expression {
// [source]
// x = a() ? yield : b();
//
// [intermediate]
// .local _a
// .brfalse whenFalseLabel, (a())
// .yield resumeLabel
// .mark resumeLabel
//... | Visits a conditional expression containing `yield`.
@param node The node to visit. | typescript | src/compiler/transformers/generators.ts | 991 | [
"node"
] | true | 3 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
customizers | public SimpleAsyncTaskSchedulerBuilder customizers(SimpleAsyncTaskSchedulerCustomizer... customizers) {
Assert.notNull(customizers, "'customizers' must not be null");
return customizers(Arrays.asList(customizers));
} | Set the {@link SimpleAsyncTaskSchedulerCustomizer customizers} that should be
applied to the {@link SimpleAsyncTaskScheduler}. Customizers are applied in the
order that they were added after builder configuration has been applied. Setting
this value will replace any previously configured customizers.
@param customizers... | java | core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskSchedulerBuilder.java | 136 | [] | SimpleAsyncTaskSchedulerBuilder | true | 1 | 6.16 | spring-projects/spring-boot | 79,428 | javadoc | false |
nextString | public String nextString(char quote) throws JSONException {
/*
* For strings that are free of escape sequences, we can just extract the result
* as a substring of the input. But if we encounter an escape sequence, we need to
* use a StringBuilder to compose the result.
*/
StringBuilder builder = null;
... | Returns the string up to but not including {@code quote}, unescaping any character
escape sequences encountered along the way. The opening quote should have already
been read. This consumes the closing quote, but does not include it in the returned
string.
@param quote either ' or ".
@return the string up to but not in... | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONTokener.java | 187 | [
"quote"
] | String | true | 7 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
max | public abstract double max(double q, double normalizer); | Computes the maximum relative size a cluster can have at quantile q. Note that exactly where within the range
spanned by a cluster that q should be isn't clear. That means that this function usually has to be taken at
multiple points and the smallest value used.
<p>
Note that this is the relative size of a cluster. To ... | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/ScaleFunction.java | 558 | [
"q",
"normalizer"
] | true | 1 | 6.64 | elastic/elasticsearch | 75,680 | javadoc | false | |
last | function last(array) {
var length = array == null ? 0 : array.length;
return length ? array[length - 1] : undefined;
} | Gets the last element of `array`.
@static
@memberOf _
@since 0.1.0
@category Array
@param {Array} array The array to query.
@returns {*} Returns the last element of `array`.
@example
_.last([1, 2, 3]);
// => 3 | javascript | lodash.js | 7,712 | [
"array"
] | false | 3 | 7.6 | lodash/lodash | 61,490 | jsdoc | false | |
_expand_user | def _expand_user(filepath_or_buffer: str | BaseBufferT) -> str | BaseBufferT:
"""
Return the argument with an initial component of ~ or ~user
replaced by that user's home directory.
Parameters
----------
filepath_or_buffer : object to be converted if possible
Returns
-------
expand... | Return the argument with an initial component of ~ or ~user
replaced by that user's home directory.
Parameters
----------
filepath_or_buffer : object to be converted if possible
Returns
-------
expanded_filepath_or_buffer : an expanded filepath or the
input if not expandable | python | pandas/io/common.py | 183 | [
"filepath_or_buffer"
] | str | BaseBufferT | true | 2 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
transform | def transform(self, X):
"""Reduce X to the selected features.
Parameters
----------
X : array of shape [n_samples, n_features]
The input samples.
Returns
-------
X_r : array of shape [n_samples, n_selected_features]
The input samples with... | Reduce X to the selected features.
Parameters
----------
X : array of shape [n_samples, n_features]
The input samples.
Returns
-------
X_r : array of shape [n_samples, n_selected_features]
The input samples with only the selected features. | python | sklearn/feature_selection/_base.py | 87 | [
"self",
"X"
] | false | 2 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
indexesOf | public static BitSet indexesOf(final boolean[] array, final boolean valueToFind, int startIndex) {
final BitSet bitSet = new BitSet();
if (array == null) {
return bitSet;
}
while (startIndex < array.length) {
startIndex = indexOf(array, valueToFind, startIndex);
... | Finds the indices of the given value in the array starting at the given index.
<p>
This method returns an empty BitSet for a {@code null} input array.
</p>
<p>
A negative startIndex is treated as zero. A startIndex larger than the array length will return an empty BitSet ({@code -1}).
</p>
@param array the array ... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 1,914 | [
"array",
"valueToFind",
"startIndex"
] | BitSet | true | 4 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
descr_to_dtype | def descr_to_dtype(descr):
"""
Returns a dtype based off the given description.
This is essentially the reverse of `~lib.format.dtype_to_descr`. It will
remove the valueless padding fields created by, i.e. simple fields like
dtype('float32'), and then convert the description to its corresponding
... | Returns a dtype based off the given description.
This is essentially the reverse of `~lib.format.dtype_to_descr`. It will
remove the valueless padding fields created by, i.e. simple fields like
dtype('float32'), and then convert the description to its corresponding
dtype.
Parameters
----------
descr : object
The ... | python | numpy/lib/_format_impl.py | 311 | [
"descr"
] | false | 10 | 6.08 | numpy/numpy | 31,054 | numpy | false | |
array_equiv | def array_equiv(a1, a2):
"""
Returns True if input arrays are shape consistent and all elements equal.
Shape consistent means they are either the same shape, or one input array
can be broadcasted to create the same shape as the other one.
Parameters
----------
a1, a2 : array_like
I... | Returns True if input arrays are shape consistent and all elements equal.
Shape consistent means they are either the same shape, or one input array
can be broadcasted to create the same shape as the other one.
Parameters
----------
a1, a2 : array_like
Input arrays.
Returns
-------
out : bool
True if equivale... | python | numpy/_core/numeric.py | 2,553 | [
"a1",
"a2"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
getResourceBundle | protected @Nullable ResourceBundle getResourceBundle(String basename, Locale locale) {
if (getCacheMillis() >= 0) {
// Fresh ResourceBundle.getBundle call in order to let ResourceBundle
// do its native caching, at the expense of more extensive lookup steps.
return doGetBundle(basename, locale);
}
else {... | Return a ResourceBundle for the given basename and Locale,
fetching already generated ResourceBundle from the cache.
@param basename the basename of the ResourceBundle
@param locale the Locale to find the ResourceBundle for
@return the resulting ResourceBundle, or {@code null} if none
found for the given basename and L... | java | spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java | 187 | [
"basename",
"locale"
] | ResourceBundle | true | 7 | 7.76 | spring-projects/spring-framework | 59,386 | javadoc | false |
sortedLastIndexBy | function sortedLastIndexBy(array, value, iteratee) {
return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
} | This method is like `_.sortedLastIndex` except that it accepts `iteratee`
which is invoked for `value` and each element of `array` to compute their
sort ranking. The iteratee is invoked with one argument: (value).
@static
@memberOf _
@since 4.0.0
@category Array
@param {Array} array The sorted array to inspect.
@param ... | javascript | lodash.js | 8,154 | [
"array",
"value",
"iteratee"
] | false | 1 | 6.24 | lodash/lodash | 61,490 | jsdoc | false | |
value | @Override
default Double value(MetricConfig config, long now) {
return measure(config, now);
} | Measure this quantity and return the result as a double.
This default implementation delegates to {@link #measure(MetricConfig, long)}.
@param config The configuration for this metric
@param now The POSIX time in milliseconds the measurement is being taken
@return The measured value as a {@link Double} | java | clients/src/main/java/org/apache/kafka/common/metrics/Measurable.java | 42 | [
"config",
"now"
] | Double | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
ramBytesUsed | @Override
public long ramBytesUsed() {
return estimateSize(bucketIndices.length);
} | @return true, if the last bucket added successfully via {@link #tryAddBucket(long, long, boolean)} was a positive one. | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/FixedCapacityExponentialHistogram.java | 239 | [] | true | 1 | 6 | elastic/elasticsearch | 75,680 | javadoc | false | |
_validate_can_reindex | def _validate_can_reindex(self, indexer: np.ndarray) -> None:
"""
Check if we are allowing reindexing with this particular indexer.
Parameters
----------
indexer : an integer ndarray
Raises
------
ValueError if its a duplicate axis
"""
# ... | Check if we are allowing reindexing with this particular indexer.
Parameters
----------
indexer : an integer ndarray
Raises
------
ValueError if its a duplicate axis | python | pandas/core/indexes/base.py | 4,133 | [
"self",
"indexer"
] | None | true | 3 | 6.56 | pandas-dev/pandas | 47,362 | numpy | false |
setAsText | @Override
public void setAsText(String text) throws IllegalArgumentException {
this.resourceEditor.setAsText(text);
Resource resource = (Resource) this.resourceEditor.getValue();
try {
setValue(resource != null ? new InputSource(resource.getURL().toString()) : null);
}
catch (IOException ex) {
throw ne... | Create a new InputSourceEditor,
using the given ResourceEditor underneath.
@param resourceEditor the ResourceEditor to use | java | spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java | 67 | [
"text"
] | void | true | 3 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
getDefaultExecutor | protected @Nullable Executor getDefaultExecutor(@Nullable BeanFactory beanFactory) {
if (beanFactory != null) {
try {
// Search for TaskExecutor bean... not plain Executor since that would
// match with ScheduledExecutorService as well, which is unusable for
// our purposes here. TaskExecutor is more c... | Retrieve or build a default executor for this advice instance.
<p>An executor returned from here will be cached for further use.
<p>The default implementation searches for a unique {@link TaskExecutor} bean
in the context, or for an {@link Executor} bean named "taskExecutor" otherwise.
If neither of the two is resolvab... | java | spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java | 232 | [
"beanFactory"
] | Executor | true | 7 | 7.6 | spring-projects/spring-framework | 59,386 | javadoc | false |
isAllZeros | private static boolean isAllZeros(final String str) {
if (str == null) {
return true;
}
for (int i = str.length() - 1; i >= 0; i--) {
if (str.charAt(i) != '0') {
return false;
}
}
return true;
} | Utility method for {@link #createNumber(java.lang.String)}.
<p>
Returns {@code true} if s is {@code null} or empty.
</p>
@param str the String to check.
@return if it is all zeros or {@code null}. | java | src/main/java/org/apache/commons/lang3/math/NumberUtils.java | 518 | [
"str"
] | true | 4 | 7.92 | apache/commons-lang | 2,896 | javadoc | false | |
fenceProducers | @Override
public FenceProducersResult fenceProducers(Collection<String> transactionalIds, FenceProducersOptions options) {
AdminApiFuture.SimpleAdminApiFuture<CoordinatorKey, ProducerIdAndEpoch> future =
FenceProducersHandler.newFuture(transactionalIds);
FenceProducersHandler handler = n... | Forcefully terminates an ongoing transaction for a given transactional ID.
<p>
This API is intended for well-formed but long-running transactions that are known to the
transaction coordinator. It is primarily designed for supporting 2PC (two-phase commit) workflows,
where a coordinator may need to unilaterally terminat... | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 4,874 | [
"transactionalIds",
"options"
] | FenceProducersResult | true | 1 | 6.24 | apache/kafka | 31,560 | javadoc | false |
_determine_constraint_branch_used | def _determine_constraint_branch_used(airflow_constraints_reference: str, use_airflow_version: str | None):
"""
Determine which constraints reference to use.
When use-airflow-version is branch or version, we derive the constraints branch from it, unless
someone specified the constraints branch explicit... | Determine which constraints reference to use.
When use-airflow-version is branch or version, we derive the constraints branch from it, unless
someone specified the constraints branch explicitly.
:param airflow_constraints_reference: the constraint reference specified (or default)
:param use_airflow_version: which air... | python | dev/breeze/src/airflow_breeze/commands/developer_commands.py | 146 | [
"airflow_constraints_reference",
"use_airflow_version"
] | true | 7 | 7.76 | apache/airflow | 43,597 | sphinx | false | |
fromBin | public double fromBin(int b) {
if (b < MIN_BIN_NUMBER) {
return Float.NEGATIVE_INFINITY;
}
if (b > maxBinNumber) {
return Float.POSITIVE_INFINITY;
}
return min + b * bucketWidth;
} | Create a bin scheme with the specified number of bins that all have the same width.
@param bins the number of bins; must be at least 2
@param min the minimum value to be counted in the bins
@param max the maximum value to be counted in the bins | java | clients/src/main/java/org/apache/kafka/common/metrics/stats/Histogram.java | 143 | [
"b"
] | true | 3 | 7.04 | apache/kafka | 31,560 | javadoc | false | |
add | def add(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
"""
Return Addition of series and other, element-wise (binary operator `add`).
Equivalent to ``series + other``, but with support to substitute a fill_value
for missing data in either one of the inputs.
... | Return Addition of series and other, element-wise (binary operator `add`).
Equivalent to ``series + other``, but with support to substitute a fill_value
for missing data in either one of the inputs.
Parameters
----------
other : Series or scalar value
With which to compute the addition.
level : int or name
Br... | python | pandas/core/series.py | 7,036 | [
"self",
"other",
"level",
"fill_value",
"axis"
] | Series | true | 1 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
priority | public Builder priority(final int priority) {
this.priority = Integer.valueOf(priority);
return this;
} | Sets the priority for the threads created by the new {@code
BasicThreadFactory}.
@param priority the priority
@return a reference to this {@link Builder} | java | src/main/java/org/apache/commons/lang3/concurrent/BasicThreadFactory.java | 187 | [
"priority"
] | Builder | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.