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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
isWhitespace | public static boolean isWhitespace(final CharSequence cs) {
if (cs == null) {
return false;
}
final int sz = cs.length();
for (int i = 0; i < sz; i++) {
if (!Character.isWhitespace(cs.charAt(i))) {
return false;
}
}
retu... | Tests if the CharSequence contains only whitespace.
<p>
Whitespace is defined by {@link Character#isWhitespace(char)}.
</p>
<p>
{@code null} will return {@code false}. An empty CharSequence (length()=0) will return {@code true}.
</p>
<pre>
StringUtils.isWhitespace(null) = false
StringUtils.isWhitespace("") = true... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 3,789 | [
"cs"
] | true | 4 | 7.76 | apache/commons-lang | 2,896 | javadoc | false | |
wrapperClone | function wrapperClone(wrapper) {
if (wrapper instanceof LazyWrapper) {
return wrapper.clone();
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
result.__index__ = wrapper.__index__;
result.__values... | Creates a clone of `wrapper`.
@private
@param {Object} wrapper The wrapper to clone.
@returns {Object} Returns the cloned wrapper. | javascript | lodash.js | 6,908 | [
"wrapper"
] | false | 2 | 6.24 | lodash/lodash | 61,490 | jsdoc | false | |
nextTokenIsCurlyBraceOnSameLineAsCursor | function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken: Node, current: Node, lineAtPosition: number, sourceFile: SourceFile): NextTokenKind {
const nextToken = findNextToken(precedingToken, current, sourceFile);
if (!nextToken) {
return NextTokenKind.Unknown;
}
... | @param assumeNewLineBeforeCloseBrace
`false` when called on text from a real source file.
`true` when we need to assume `position` is on a newline.
This is useful for codefixes. Consider
```
function f() {
|}
```
with `position` at `|`.
When inserting some text after an open brace, we would like to get inden... | typescript | src/services/formatting/smartIndenter.ts | 365 | [
"precedingToken",
"current",
"lineAtPosition",
"sourceFile"
] | true | 6 | 8.48 | microsoft/TypeScript | 107,154 | jsdoc | false | |
of | public static DoubleRange of(final Double fromInclusive, final Double toInclusive) {
return new DoubleRange(fromInclusive, toInclusive);
} | Creates a range with the specified minimum and maximum values (both inclusive).
<p>
The range uses the natural ordering of the elements to determine where values lie in the range.
</p>
<p>
The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct valu... | java | src/main/java/org/apache/commons/lang3/DoubleRange.java | 68 | [
"fromInclusive",
"toInclusive"
] | DoubleRange | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
load | static AutoConfigurationReplacements load(Class<?> annotation, @Nullable ClassLoader classLoader) {
Assert.notNull(annotation, "'annotation' must not be null");
ClassLoader classLoaderToUse = decideClassloader(classLoader);
String location = String.format(LOCATION, annotation.getName());
Enumeration<URL> urls =... | Loads the relocations from the classpath. Relocations are stored in files named
{@code META-INF/spring/full-qualified-annotation-name.replacements} on the
classpath. The file is loaded using {@link Properties#load(java.io.InputStream)}
with each entry containing an auto-configuration class name as the key and the
repla... | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationReplacements.java | 93 | [
"annotation",
"classLoader"
] | AutoConfigurationReplacements | true | 2 | 7.44 | spring-projects/spring-boot | 79,428 | javadoc | false |
column_or_1d | def column_or_1d(y, *, dtype=None, input_name="y", warn=False, device=None):
"""Ravel column or 1d numpy array, else raises an error.
Parameters
----------
y : array-like
Input data.
dtype : data-type, default=None
Data type for `y`.
.. versionadded:: 1.2
input_name : ... | Ravel column or 1d numpy array, else raises an error.
Parameters
----------
y : array-like
Input data.
dtype : data-type, default=None
Data type for `y`.
.. versionadded:: 1.2
input_name : str, default="y"
The data name used to construct the error message.
.. versionadded:: 1.8
warn : bool, def... | python | sklearn/utils/validation.py | 1,361 | [
"y",
"dtype",
"input_name",
"warn",
"device"
] | false | 5 | 7.44 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
visitBreakStatement | function visitBreakStatement(node: BreakStatement): Statement {
if (inStatementContainingYield) {
const label = findBreakTarget(node.label && idText(node.label));
if (label > 0) {
return createInlineBreak(label, /*location*/ node);
}
}
... | Visits an ElementAccessExpression that contains a YieldExpression.
@param node The node to visit. | typescript | src/compiler/transformers/generators.ts | 1,775 | [
"node"
] | true | 4 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
bufferedPartitions | Set<TopicPartition> bufferedPartitions() {
try {
lock.lock();
final Set<TopicPartition> partitions = new HashSet<>();
if (nextInLineFetch != null && !nextInLineFetch.isConsumed()) {
partitions.add(nextInLineFetch.partition);
}
comple... | Return the set of {@link TopicPartition partitions} for which we have data in the buffer.
@return {@link TopicPartition Partition} set | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchBuffer.java | 244 | [] | true | 3 | 7.76 | apache/kafka | 31,560 | javadoc | false | |
sizeInBytes | @Override
public int sizeInBytes() {
return LOG_OVERHEAD + buffer.getInt(LENGTH_OFFSET);
} | 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 | 221 | [] | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false | |
recode_for_groupby | def recode_for_groupby(c: Categorical, sort: bool, observed: bool) -> Categorical:
"""
Code the categories to ensure we can groupby for categoricals.
If observed=True, we return a new Categorical with the observed
categories only.
If sort=False, return a copy of self, coded with categories as
... | Code the categories to ensure we can groupby for categoricals.
If observed=True, we return a new Categorical with the observed
categories only.
If sort=False, return a copy of self, coded with categories as
returned by .unique(), followed by any categories not appearing in
the data. If sort=True, return self.
This m... | python | pandas/core/groupby/categorical.py | 13 | [
"c",
"sort",
"observed"
] | Categorical | true | 7 | 6.64 | pandas-dev/pandas | 47,362 | numpy | false |
csc_median_axis_0 | def csc_median_axis_0(X):
"""Find the median across axis 0 of a CSC matrix.
It is equivalent to doing np.median(X, axis=0).
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
Input data. It should be of CSC format.
Returns
-------
median : ndarray of shap... | Find the median across axis 0 of a CSC matrix.
It is equivalent to doing np.median(X, axis=0).
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
Input data. It should be of CSC format.
Returns
-------
median : ndarray of shape (n_features,)
Median. | python | sklearn/utils/sparsefuncs.py | 690 | [
"X"
] | false | 4 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
isTypeMatch | @Override
public boolean isTypeMatch(String name, ResolvableType typeToMatch) throws NoSuchBeanDefinitionException {
String beanName = BeanFactoryUtils.transformedBeanName(name);
Object bean = obtainBean(beanName);
if (bean instanceof FactoryBean<?> factoryBean && !BeanFactoryUtils.isFactoryDereference(name)) {
... | Add a new singleton bean.
<p>Will overwrite any existing instance for the given name.
@param name the name of the bean
@param bean the bean instance | java | spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java | 232 | [
"name",
"typeToMatch"
] | true | 3 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false | |
onLoad | function onLoad(fillers: Fillers, args: esbuild.OnLoadArgs): esbuild.OnLoadResult {
// display useful info if no shim has been found
if (fillers[args.path].contents === undefined) {
throw `no shim for "${args.path}" imported by "${args.pluginData}"`
}
return fillers[args.path] // inject the contents
} | Handles the load step where esbuild loads the contents of the imports before
bundling them. This allows us to inject a filler via its `contents` if it was
provided. If not, the polyfill is empty and we display an error.
@param fillers to use the contents from
@param args from esbuild | typescript | helpers/compile/plugins/fill-plugin/fillPlugin.ts | 125 | [
"fillers",
"args"
] | true | 2 | 7.2 | prisma/prisma | 44,834 | jsdoc | false | |
describeLogDirs | @Override
public DescribeLogDirsResult describeLogDirs(Collection<Integer> brokers, DescribeLogDirsOptions options) {
final Map<Integer, KafkaFutureImpl<Map<String, LogDirDescription>>> futures = new HashMap<>(brokers.size());
final long now = time.milliseconds();
for (final Integer brokerI... | Fail futures in the given Map which were retried due to exceeding quota. We propagate
the initial error back to the caller if the request timed out. | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 2,998 | [
"brokers",
"options"
] | DescribeLogDirsResult | true | 3 | 6 | apache/kafka | 31,560 | javadoc | false |
scale_mm_epilogue | def scale_mm_epilogue():
"""
Create an epilogue function that applies scaling to matrix multiplication result
using the given scale factors.
Args:
dtype: The data type of the output
scale_a: Scale factor for matrix A
scale_b: Scale factor for matrix B
Returns:
Epilo... | Create an epilogue function that applies scaling to matrix multiplication result
using the given scale factors.
Args:
dtype: The data type of the output
scale_a: Scale factor for matrix A
scale_b: Scale factor for matrix B
Returns:
Epilogue function that takes the accumulator and applies scaling | python | torch/_inductor/kernel/mm_common.py | 106 | [] | false | 3 | 7.12 | pytorch/pytorch | 96,034 | google | false | |
toFullyQualifiedName | public static String toFullyQualifiedName(final Package context, final String resourceName) {
Objects.requireNonNull(context, "context");
Objects.requireNonNull(resourceName, "resourceName");
return context.getName() + "." + resourceName;
} | Returns the fully qualified name for the resource with name {@code resourceName} relative to the given context.
<p>
Note that this method does not check whether the resource actually exists. It only constructs the name. Null inputs are not allowed.
</p>
<pre>
ClassPathUtils.toFullyQualifiedName(StringUtils.class.getPac... | java | src/main/java/org/apache/commons/lang3/ClassPathUtils.java | 95 | [
"context",
"resourceName"
] | String | true | 1 | 6.4 | apache/commons-lang | 2,896 | javadoc | false |
proceed | @Nullable Object proceed() throws Throwable; | Proceed to the next interceptor in the chain.
<p>The implementation and the semantics of this method depends
on the actual joinpoint type (see the children interfaces).
@return see the children interfaces' proceed definition
@throws Throwable if the joinpoint throws an exception | java | spring-aop/src/main/java/org/aopalliance/intercept/Joinpoint.java | 51 | [] | Object | true | 1 | 6.64 | spring-projects/spring-framework | 59,386 | javadoc | false |
nextSequentialOffset | private long nextSequentialOffset() {
return lastOffset == null ? baseOffset : lastOffset + 1;
} | Get an estimate of the number of bytes written to the underlying buffer. The returned value
is exactly correct if the record set is not compressed or if the builder has been closed. | java | clients/src/main/java/org/apache/kafka/common/record/MemoryRecordsBuilder.java | 907 | [] | true | 2 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
joinWithPreposition | function joinWithPreposition(preposition: 'and' | 'or', items: string[]): string {
if (items.length === 1) {
return items[0]
}
const itemsCopy = [...items]
const lastItem = itemsCopy.pop()
return `${itemsCopy.join(', ')} ${preposition} ${lastItem}`
} | Given the validation error and arguments rendering tree, applies corresponding
formatting to an error tree and adds all relevant messages.
@param error
@param args | typescript | packages/client/src/runtime/core/errorRendering/applyValidationError.ts | 638 | [
"preposition",
"items"
] | true | 2 | 6.72 | prisma/prisma | 44,834 | jsdoc | false | |
getLength | private int getLength() throws IOException {
int i = derInputStream.read();
if (i == -1) throw new IOException("Invalid DER: length missing");
// A single byte short length
if ((i & ~0x7F) == 0) return i;
int num = i & 0x7F;
// We can't handle length longer than 4 byt... | Decode the length of the field. Can only support length
encoding up to 4 octets.
<p>
In BER/DER encoding, length can be encoded in 2 forms:
</p>
<ul>
<li>Short form. One octet. Bit 8 has value "0" and bits 7-1
give the length.
</li>
<li>Long form. Two to 127 octets (only 4 is supported here).
Bit 8 of first oc... | java | libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/DerParser.java | 124 | [] | true | 7 | 8.08 | elastic/elasticsearch | 75,680 | javadoc | false | |
acquire | private void acquire() {
final Thread thread = Thread.currentThread();
final long threadId = thread.getId();
if (threadId != currentThread.get() && !currentThread.compareAndSet(NO_CURRENT_THREAD, threadId))
throw new ConcurrentModificationException("KafkaShareConsumer is not safe for... | Acquire the light lock protecting this consumer from multithreaded access. Instead of blocking
when the lock is not available, however, we just throw an exception (since multithreaded usage is not
supported).
@throws ConcurrentModificationException if another thread already has the lock | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java | 1,085 | [] | void | true | 5 | 6.08 | apache/kafka | 31,560 | javadoc | false |
update_dtype | def update_dtype(self, dtype) -> SparseDtype:
"""
Convert the SparseDtype to a new dtype.
This takes care of converting the ``fill_value``.
Parameters
----------
dtype : Union[str, numpy.dtype, SparseDtype]
The new dtype to use.
* For a SparseDt... | Convert the SparseDtype to a new dtype.
This takes care of converting the ``fill_value``.
Parameters
----------
dtype : Union[str, numpy.dtype, SparseDtype]
The new dtype to use.
* For a SparseDtype, it is simply returned
* For a NumPy dtype (or str), the current fill value
is converted to the new ... | python | pandas/core/dtypes/dtypes.py | 2,022 | [
"self",
"dtype"
] | SparseDtype | true | 3 | 8.64 | pandas-dev/pandas | 47,362 | numpy | false |
_generate_temporary_array_pointer | def _generate_temporary_array_pointer(
c_type: str, elements: Sequence[str], *, force_mutable: bool = False
) -> str:
"""Get a pointer to an array that only exists for the duration of the C++
statement it's used in."""
# If the c_type is already a pointer, return a mutable pointer to... | Get a pointer to an array that only exists for the duration of the C++
statement it's used in. | python | torch/_inductor/codegen/cpp_wrapper_cpu.py | 114 | [
"c_type",
"elements",
"force_mutable"
] | str | true | 4 | 6 | pytorch/pytorch | 96,034 | unknown | false |
bind_output_assets_to_tasks | def bind_output_assets_to_tasks(
edges: list[dict], serialized_dag: SerializedDagModel, version_number: int, session: Session
) -> None:
"""
Try to bind the downstream assets to the relevant task that produces them.
This function will mutate the `edges` in place.
"""
# bind normal assets presen... | Try to bind the downstream assets to the relevant task that produces them.
This function will mutate the `edges` in place. | python | airflow-core/src/airflow/api_fastapi/core_api/services/ui/structure.py | 127 | [
"edges",
"serialized_dag",
"version_number",
"session"
] | None | true | 8 | 6 | apache/airflow | 43,597 | unknown | false |
logToConsole | function logToConsole(value: unknown) {
// tslint:disable-next-line:no-console
console.log(unwrapSignal(value));
} | Warning: This function mutates the `roots` arg!
Recursively traverse the DOM tree to find all Angular component root elements.
This function starts from the given element and traverses its children.
When it finds an Angular component, it adds that element to the `roots` set.
If we discover an angular component that we'... | typescript | devtools/projects/ng-devtools-backend/src/lib/component-tree/component-tree.ts | 764 | [
"value"
] | false | 1 | 6.4 | angular/angular | 99,544 | jsdoc | false | |
hashCode | @Override
public int hashCode() {
// racy single-check idiom
int h = hashCode;
if (h == 0) {
h = hash(type, subtype, parametersAsMap());
hashCode = h;
}
return h;
} | Parses a media type from its string representation.
@throws IllegalArgumentException if the input is not parsable | java | android/guava/src/com/google/common/net/MediaType.java | 1,210 | [] | true | 2 | 6.4 | google/guava | 51,352 | javadoc | false | |
create | public static ExponentialHistogramMerger create(int bucketLimit, ExponentialHistogramCircuitBreaker circuitBreaker) {
circuitBreaker.adjustBreaker(BASE_SIZE);
boolean success = false;
try {
ExponentialHistogramMerger result = new ExponentialHistogramMerger(bucketLimit, circuitBreaker... | Creates a new instance with the specified bucket limit.
@param bucketLimit the maximum number of buckets the result histogram is allowed to have, must be at least 4
@param circuitBreaker the circuit breaker to use to limit memory allocations | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramMerger.java | 71 | [
"bucketLimit",
"circuitBreaker"
] | ExponentialHistogramMerger | true | 2 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false |
append | @Override
public StrBuilder append(final CharSequence seq, final int startIndex, final int length) {
if (seq == null) {
return appendNull();
}
return append(seq.toString(), startIndex, length);
} | Appends part of a CharSequence to this string builder.
Appending null will call {@link #appendNull()}.
@param seq the CharSequence to append
@param startIndex the start index, inclusive, must be valid
@param length the length to append, must be valid
@return {@code this} instance.
@since 3.0 | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 503 | [
"seq",
"startIndex",
"length"
] | StrBuilder | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
toUriString | public static String toUriString(InetAddress ip) {
if (ip instanceof Inet6Address) {
return "[" + toAddrString(ip) + "]";
}
return toAddrString(ip);
} | Returns the string representation of an {@link InetAddress} suitable for inclusion in a URI.
<p>For IPv4 addresses, this is identical to {@link InetAddress#getHostAddress()}, but for IPv6
addresses it compresses zeroes and surrounds the text with square brackets; for example {@code
"[2001:db8::1]"}.
<p>Per section 3.2.... | java | android/guava/src/com/google/common/net/InetAddresses.java | 580 | [
"ip"
] | String | true | 2 | 7.36 | google/guava | 51,352 | javadoc | false |
deregister | def deregister() -> None:
"""
Remove pandas formatters and converters.
Removes the custom converters added by :func:`register`. This
attempts to set the state of the registry back to the state before
pandas registered its own units. Converters for pandas' own types like
Timestamp and Period are... | Remove pandas formatters and converters.
Removes the custom converters added by :func:`register`. This
attempts to set the state of the registry back to the state before
pandas registered its own units. Converters for pandas' own types like
Timestamp and Period are removed completely. Converters for types
pandas overw... | python | pandas/plotting/_misc.py | 133 | [] | None | true | 1 | 6.64 | pandas-dev/pandas | 47,362 | unknown | false |
WriteHeaderMessageForwardDecls | void WriteHeaderMessageForwardDecls(const google::protobuf::FileDescriptor* file,
Context& ctx) {
// Import forward-declaration of types defined in this file.
if (ctx.options().backend == Backend::UPB) {
ctx.Emit({{"upb_filename", UpbCFilename(file)}},
"#include ... | Writes includes for upb C minitables and fwd.h for transitive typedefs. | cpp | hpb_generator/generator.cc | 304 | [] | true | 5 | 7.2 | protocolbuffers/protobuf | 69,904 | doxygen | false | |
_validate_codes | def _validate_codes(self, level: Index, code: np.ndarray) -> np.ndarray:
"""
Reassign code values as -1 if their corresponding levels are NaN.
Parameters
----------
code : Index
Code to reassign.
level : np.ndarray
Level to check for missing value... | Reassign code values as -1 if their corresponding levels are NaN.
Parameters
----------
code : Index
Code to reassign.
level : np.ndarray
Level to check for missing values (NaN, NaT, None).
Returns
-------
new code where code value = -1 if it corresponds
to a level with missing values (NaN, NaT, None). | python | pandas/core/indexes/multi.py | 346 | [
"self",
"level",
"code"
] | np.ndarray | true | 2 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
comparePathComponents | function comparePathComponents(one: string, other: string, caseSensitive = false): number {
if (!caseSensitive) {
one = one && one.toLowerCase();
other = other && other.toLowerCase();
}
if (one === other) {
return 0;
}
return one < other ? -1 : 1;
} | Compares the case of the provided strings - uppercase before lowercase
@returns
```text
-1 if one is uppercase and other is lowercase
1 if one is lowercase and other is uppercase
0 otherwise
``` | typescript | src/vs/base/common/comparers.ts | 265 | [
"one",
"other",
"caseSensitive"
] | true | 6 | 7.52 | microsoft/vscode | 179,840 | jsdoc | false | |
parseGroup | private void parseGroup(JSONObject group, Map<String, Dependency> dependencies) throws JSONException {
if (group.has(VALUES_EL)) {
JSONArray content = group.getJSONArray(VALUES_EL);
for (int i = 0; i < content.length(); i++) {
Dependency dependency = parseDependency(content.getJSONObject(i));
dependenci... | Returns the defaults applicable to the service.
@return the defaults of the service | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java | 178 | [
"group",
"dependencies"
] | void | true | 3 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
registerListeners | protected void registerListeners() throws SchedulerException {
ListenerManager listenerManager = getScheduler().getListenerManager();
if (this.schedulerListeners != null) {
for (SchedulerListener listener : this.schedulerListeners) {
listenerManager.addSchedulerListener(listener);
}
}
if (this.globalJ... | Register all specified listeners with the Scheduler. | java | spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java | 341 | [] | void | true | 4 | 6.4 | spring-projects/spring-framework | 59,386 | javadoc | false |
indexOf | static int indexOf(final CharSequence cs, final CharSequence searchChar, final int start) {
if (cs == null || searchChar == null) {
return StringUtils.INDEX_NOT_FOUND;
}
if (cs instanceof String) {
return ((String) cs).indexOf(searchChar.toString(), start);
}
... | Used by the indexOf(CharSequence methods) as a green implementation of indexOf.
@param cs the {@link CharSequence} to be processed.
@param searchChar the {@link CharSequence} to be searched for.
@param start the start index.
@return the index where the search sequence was found, or {@code -1} if there is n... | java | src/main/java/org/apache/commons/lang3/CharSequenceUtils.java | 49 | [
"cs",
"searchChar",
"start"
] | true | 6 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
state | public MemberState state() {
return state;
} | @return Current state of this member in relationship to a group, as defined in
{@link MemberState}. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java | 1,318 | [] | MemberState | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
describe_option | def describe_option(pat: str = "", _print_desc: bool = True) -> str | None:
"""
Print the description for one or more registered options.
Call with no arguments to get a listing for all registered options.
Parameters
----------
pat : str, default ""
String or string regexp pattern.
... | Print the description for one or more registered options.
Call with no arguments to get a listing for all registered options.
Parameters
----------
pat : str, default ""
String or string regexp pattern.
Empty string will return all options.
For regexp strings, all matching keys will have their description... | python | pandas/_config/config.py | 291 | [
"pat",
"_print_desc"
] | str | None | true | 3 | 8.32 | pandas-dev/pandas | 47,362 | numpy | false |
get_plain_input_and_grad_nodes | def get_plain_input_and_grad_nodes(
graph: fx.Graph,
) -> dict[PlainAOTInput, tuple[fx.Node, Optional[fx.Node]]]:
"""Get plain input nodes and their corresponding gradient nodes from a joint graph.
Args:
graph: The FX joint graph with descriptors
Returns:
A dictionary mapping each Plai... | Get plain input nodes and their corresponding gradient nodes from a joint graph.
Args:
graph: The FX joint graph with descriptors
Returns:
A dictionary mapping each PlainAOTInput descriptor to a tuple containing:
- The plain input node
- The gradient (output) node if it exists, None otherwise | python | torch/_functorch/_aot_autograd/fx_utils.py | 167 | [
"graph"
] | dict[PlainAOTInput, tuple[fx.Node, Optional[fx.Node]]] | true | 1 | 6.56 | pytorch/pytorch | 96,034 | google | false |
column_stack | def column_stack(tup):
"""
Stack 1-D arrays as columns into a 2-D array.
Take a sequence of 1-D arrays and stack them as columns
to make a single 2-D array. 2-D arrays are stacked as-is,
just like with `hstack`. 1-D arrays are turned into 2-D columns
first.
Parameters
----------
t... | Stack 1-D arrays as columns into a 2-D array.
Take a sequence of 1-D arrays and stack them as columns
to make a single 2-D array. 2-D arrays are stacked as-is,
just like with `hstack`. 1-D arrays are turned into 2-D columns
first.
Parameters
----------
tup : sequence of 1-D or 2-D arrays.
Arrays to stack. All of... | python | numpy/lib/_shape_base_impl.py | 608 | [
"tup"
] | false | 3 | 7.68 | numpy/numpy | 31,054 | numpy | false | |
toLocalDateTime | public static LocalDateTime toLocalDateTime(final Date date, final TimeZone timeZone) {
return LocalDateTime.ofInstant(date.toInstant(), toZoneId(timeZone));
} | Converts a {@link Date} to a {@link LocalDateTime}.
@param date the Date to convert to a LocalDateTime, not null.
@param timeZone the time zone, null maps to to the default time zone.
@return a new LocalDateTime.
@since 3.19.0 | java | src/main/java/org/apache/commons/lang3/time/DateUtils.java | 1,651 | [
"date",
"timeZone"
] | LocalDateTime | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
add | @Override
public void add(TDigest other) {
reserve(other.size());
if (mergingDigest != null) {
mergingDigest.add(other);
} else {
sortingDigest.add(other);
}
} | Similar to the constructor above. The limit for switching from a {@link SortingDigest} to a {@link MergingDigest} implementation
is calculated based on the passed compression factor.
@param compression The compression factor for the MergingDigest | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/HybridDigest.java | 109 | [
"other"
] | void | true | 2 | 6.24 | elastic/elasticsearch | 75,680 | javadoc | false |
shape | def shape(a):
"""
Return the shape of an array.
Parameters
----------
a : array_like
Input array.
Returns
-------
shape : tuple of ints
The elements of the shape tuple give the lengths of the
corresponding array dimensions.
See Also
--------
len : `... | Return the shape of an array.
Parameters
----------
a : array_like
Input array.
Returns
-------
shape : tuple of ints
The elements of the shape tuple give the lengths of the
corresponding array dimensions.
See Also
--------
len : ``len(a)`` is equivalent to ``np.shape(a)[0]`` for N-D arrays with
``... | python | numpy/_core/fromnumeric.py | 2,085 | [
"a"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
asciiWords | function asciiWords(string) {
return string.match(reAsciiWord) || [];
} | Splits an ASCII `string` into an array of its words.
@private
@param {string} The string to inspect.
@returns {Array} Returns the words of `string`. | javascript | lodash.js | 774 | [
"string"
] | false | 2 | 6.16 | lodash/lodash | 61,490 | jsdoc | false | |
as_ordered | def as_ordered(self) -> Self:
"""
Set the Categorical to be ordered.
Returns
-------
Categorical
Ordered Categorical.
See Also
--------
as_unordered : Set the Categorical to be unordered.
Examples
--------
For :class:... | Set the Categorical to be ordered.
Returns
-------
Categorical
Ordered Categorical.
See Also
--------
as_unordered : Set the Categorical to be unordered.
Examples
--------
For :class:`pandas.Series`:
>>> ser = pd.Series(["a", "b", "c", "a"], dtype="category")
>>> ser.cat.ordered
False
>>> ser = ser.cat.as_order... | python | pandas/core/arrays/categorical.py | 1,008 | [
"self"
] | Self | true | 1 | 6.64 | pandas-dev/pandas | 47,362 | unknown | false |
visitParenthesizedExpression | function visitParenthesizedExpression(node: ParenthesizedExpression, expressionResultIsUnused: boolean): ParenthesizedExpression {
return visitEachChild(node, expressionResultIsUnused ? visitorWithUnusedExpressionResult : visitor, context);
} | Visits a ParenthesizedExpression that may contain a destructuring assignment.
@param node A ParenthesizedExpression node.
@param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
expression of an `ExpressionStatement`). | typescript | src/compiler/transformers/es2015.ts | 2,672 | [
"node",
"expressionResultIsUnused"
] | true | 2 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
properties | public Set<Property> properties() {
return properties;
} | @return a set representing all the valid properties for this database | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/Database.java | 214 | [] | true | 1 | 6.32 | elastic/elasticsearch | 75,680 | javadoc | false | |
fuzz_torch_tensor_type | def fuzz_torch_tensor_type(template: str = "default") -> torch.dtype:
"""
Fuzzes PyTorch tensor data types by randomly selecting and returning different dtypes.
Args:
template: Template name to determine supported dtypes
Returns:
torch.dtype: A randomly selected PyTorch tensor data typ... | Fuzzes PyTorch tensor data types by randomly selecting and returning different dtypes.
Args:
template: Template name to determine supported dtypes
Returns:
torch.dtype: A randomly selected PyTorch tensor data type based on template constraints | python | tools/experimental/torchfuzz/tensor_fuzzer.py | 37 | [
"template"
] | torch.dtype | true | 4 | 7.44 | pytorch/pytorch | 96,034 | google | false |
split_date_version_and_suffix | def split_date_version_and_suffix(file_name: str, suffix: str) -> VersionedFile:
"""Split file name with date-based version (YYYY-MM-DD format) and suffix.
Example: apache_airflow_providers-2025-11-18-source.tar.gz
"""
from packaging.version import Version
no_suffix_file = file_name[: -len(suffix)... | Split file name with date-based version (YYYY-MM-DD format) and suffix.
Example: apache_airflow_providers-2025-11-18-source.tar.gz | python | dev/breeze/src/airflow_breeze/commands/release_management_commands.py | 3,290 | [
"file_name",
"suffix"
] | VersionedFile | true | 2 | 6.72 | apache/airflow | 43,597 | unknown | false |
polyadd | def polyadd(a1, a2):
"""
Find the sum of two polynomials.
.. note::
This forms part of the old polynomial API. Since version 1.4, the
new polynomial API defined in `numpy.polynomial` is preferred.
A summary of the differences can be found in the
:doc:`transition guide </referenc... | Find the sum of two polynomials.
.. note::
This forms part of the old polynomial API. Since version 1.4, the
new polynomial API defined in `numpy.polynomial` is preferred.
A summary of the differences can be found in the
:doc:`transition guide </reference/routines.polynomials>`.
Returns the polynomial res... | python | numpy/lib/_polynomial_impl.py | 796 | [
"a1",
"a2"
] | false | 6 | 7.44 | numpy/numpy | 31,054 | numpy | false | |
writeEntry | private void writeEntry(JarArchiveEntry entry, @Nullable Library library, @Nullable EntryWriter entryWriter)
throws IOException {
String name = entry.getName();
if (this.writtenEntries.add(name)) {
writeParentDirectoryEntries(name);
entry.setUnixMode(name.endsWith("/") ? UNIX_DIR_MODE : UNIX_FILE_MODE);
... | Perform the actual write of a {@link JarEntry}. All other write methods delegate to
this one.
@param entry the entry to write
@param library the library for the entry or {@code null}
@param entryWriter the entry writer or {@code null} if there is no content
@throws IOException in case of I/O errors | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/AbstractJarWriter.java | 252 | [
"entry",
"library",
"entryWriter"
] | void | true | 5 | 6.72 | spring-projects/spring-boot | 79,428 | javadoc | false |
add | @CanIgnoreReturnValue
public Builder<E> add(E... elements) {
for (E element : elements) {
add(element);
}
return this;
} | Adds each element of {@code elements} to the {@code ImmutableCollection} being built.
<p>Note that each builder class overrides this method in order to covariantly return its own
type.
@param elements the elements to add
@return this {@code Builder} instance
@throws NullPointerException if {@code elements} is null or c... | java | android/guava/src/com/google/common/collect/ImmutableCollection.java | 441 | [] | true | 1 | 6.56 | google/guava | 51,352 | javadoc | false | |
bucket_collectives | def bucket_collectives(self) -> None:
"""Run the full bucketing and dep application flow.
Order is important:
1. Bucketing - merge collectives into buckets
2. Inline fusions - expand call_module back to original nodes
3. Transfer deps - move deps from erased nodes to their repla... | Run the full bucketing and dep application flow.
Order is important:
1. Bucketing - merge collectives into buckets
2. Inline fusions - expand call_module back to original nodes
3. Transfer deps - move deps from erased nodes to their replacements
4. Add control deps - apply effect tokens and topo sort
Steps 2-3 MUST h... | python | torch/_inductor/fx_passes/overlap_preserving_bucketer.py | 345 | [
"self"
] | None | true | 4 | 6 | pytorch/pytorch | 96,034 | unknown | false |
retrieveMaxExpressionLength | private static int retrieveMaxExpressionLength() {
String value = SpringProperties.getProperty(MAX_SPEL_EXPRESSION_LENGTH_PROPERTY_NAME);
if (!StringUtils.hasText(value)) {
return SpelParserConfiguration.DEFAULT_MAX_EXPRESSION_LENGTH;
}
try {
int maxLength = Integer.parseInt(value.trim());
Assert.isTr... | Template method for customizing the expression evaluation context.
<p>The default implementation is empty. | java | spring-context/src/main/java/org/springframework/context/expression/StandardBeanExpressionResolver.java | 196 | [] | true | 3 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false | |
printStackTraceToString | default String printStackTraceToString(Throwable throwable) {
try {
StringBuilder out = new StringBuilder(4096);
printStackTrace(throwable, out);
return out.toString();
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
} | Return a {@link String} containing the printed stack trace for a given
{@link Throwable}.
@param throwable the throwable that should have its stack trace printed
@return the stack trace string | java | core/spring-boot/src/main/java/org/springframework/boot/logging/StackTracePrinter.java | 38 | [
"throwable"
] | String | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
valuesIterator | Iterator<V> valuesIterator() {
Map<K, V> delegate = delegateOrNull();
if (delegate != null) {
return delegate.values().iterator();
}
return new Itr<V>() {
@Override
@ParametricNullness
V getOutput(int entry) {
return value(entry);
}
};
} | Updates the index an iterator is pointing to after a call to remove: returns the index of the
entry that should be looked at after a removal on indexRemoved, with indexBeforeRemove as the
index that *was* the next entry that would be looked at. | java | android/guava/src/com/google/common/collect/CompactHashMap.java | 932 | [] | true | 2 | 6.4 | google/guava | 51,352 | javadoc | false | |
close | @Override
public void close() {
if (closed) {
assert false : "ExponentialHistogramGenerator closed multiple times";
} else {
closed = true;
resultMerger.close();
valueBuffer.close();
circuitBreaker.adjustBreaker(-estimateBaseSize(rawValueBu... | Returns the histogram representing the distribution of all accumulated values.
@return the histogram representing the distribution of all accumulated values | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramGenerator.java | 192 | [] | void | true | 2 | 7.44 | elastic/elasticsearch | 75,680 | javadoc | false |
pipelinesWithGeoIpProcessor | @SuppressWarnings("unchecked")
private static Set<String> pipelinesWithGeoIpProcessor(ProjectMetadata projectMetadata, boolean downloadDatabaseOnPipelineCreation) {
List<PipelineConfiguration> configurations = IngestService.getPipelines(projectMetadata);
Map<String, PipelineConfiguration> pipelineCo... | Retrieve the set of pipeline ids that have at least one geoip processor.
@param projectMetadata project metadata
@param downloadDatabaseOnPipelineCreation Filter the list to include only pipeline with the download_database_on_pipeline_creation
matching the param.
@return A set ... | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTaskExecutor.java | 302 | [
"projectMetadata",
"downloadDatabaseOnPipelineCreation"
] | true | 3 | 7.76 | elastic/elasticsearch | 75,680 | javadoc | false | |
read | @Override
public NavigableMap<Integer, Object> read(ByteBuffer buffer) {
int numTaggedFields = ByteUtils.readUnsignedVarint(buffer);
if (numTaggedFields == 0) {
return Collections.emptyNavigableMap();
}
NavigableMap<Integer, Object> objects = new TreeMap<>();
int ... | 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 | 81 | [
"buffer"
] | true | 7 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
getDependencyType | public Class<?> getDependencyType() {
if (this.field != null) {
if (this.nestingLevel > 1) {
Class<?> clazz = getResolvableType().getRawClass();
return (clazz != null ? clazz : Object.class);
}
else {
return this.field.getType();
}
}
else {
return obtainMethodParameter().getNestedParame... | Determine the declared (non-generic) type of the wrapped parameter/field.
@return the declared type (never {@code null}) | java | spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java | 346 | [] | true | 4 | 7.76 | spring-projects/spring-framework | 59,386 | javadoc | false | |
devices | def devices(self):
"""
The devices supported by PyTorch.
Returns
-------
devices : list[Device]
The devices supported by PyTorch.
See Also
--------
__array_namespace_info__.capabilities,
__array_namespace_info__.default_device,
... | The devices supported by PyTorch.
Returns
-------
devices : list[Device]
The devices supported by PyTorch.
See Also
--------
__array_namespace_info__.capabilities,
__array_namespace_info__.default_device,
__array_namespace_info__.default_dtypes,
__array_namespace_info__.dtypes
Examples
--------
>>> info = xp.__a... | python | sklearn/externals/array_api_compat/torch/_info.py | 317 | [
"self"
] | false | 4 | 7.04 | scikit-learn/scikit-learn | 64,340 | unknown | false | |
isPrivateOrNotVisible | private static boolean isPrivateOrNotVisible(Method method, Class<?> beanClass) {
int modifiers = method.getModifiers();
if (Modifier.isPrivate(modifiers)) {
return true;
}
// Method is declared in a class that resides in a different package
// than the bean class and the method is neither public nor... | Determine if the supplied lifecycle {@link Method} is private or not
visible to the supplied bean {@link Class}.
@since 6.0.11 | java | spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java | 472 | [
"method",
"beanClass"
] | true | 4 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false | |
toKey | function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = (value + '');
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
} | Converts `value` to a string key if it's not a string or symbol.
@private
@param {*} value The value to inspect.
@returns {string|symbol} Returns the key. | javascript | lodash.js | 6,856 | [
"value"
] | false | 5 | 6.24 | lodash/lodash | 61,490 | jsdoc | false | |
contextProtocol | private String contextProtocol() {
if (supportedProtocols.isEmpty()) {
throw new SslConfigException("no SSL/TLS protocols have been configured");
}
for (Entry<String, String> entry : ORDERED_PROTOCOL_ALGORITHM_MAP.entrySet()) {
if (supportedProtocols.contains(entry.getKey... | Picks the best (highest security / most recent standard) SSL/TLS protocol (/version) that is supported by the
{@link #supportedProtocols() configured protocols}. | java | libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/SslConfiguration.java | 147 | [] | String | true | 3 | 6.08 | elastic/elasticsearch | 75,680 | javadoc | false |
applyReadLocked | public <T> T applyReadLocked(final FailableFunction<O, T, ?> function) {
return lockApplyUnlock(readLockSupplier, function);
} | Provides read (shared, non-exclusive) access to The object to protect for the purpose of computing a
result object. More precisely, what the method will do (in the given order):
<ol>
<li>Obtain a read (shared) lock on The object to protect. The current thread may block, until such a
lock is granted.</li>
<li>Invokes th... | java | src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java | 370 | [
"function"
] | T | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
wrapperValue | function wrapperValue() {
return baseWrapperValue(this.__wrapped__, this.__actions__);
} | Executes the chain sequence to resolve the unwrapped value.
@name value
@memberOf _
@since 0.1.0
@alias toJSON, valueOf
@category Seq
@returns {*} Returns the resolved unwrapped value.
@example
_([1, 2, 3]).value();
// => [1, 2, 3] | javascript | lodash.js | 9,152 | [] | false | 1 | 7.44 | lodash/lodash | 61,490 | jsdoc | false | |
remove | private static Object remove(final Object array, final int index) {
final int length = getLength(array);
if (index < 0 || index >= length) {
throw new IndexOutOfBoundsException("Index: " + index + ", Length: " + length);
}
final Object result = Array.newInstance(array.getClas... | Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their
indices).
<p>
This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the
returned array... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 4,872 | [
"array",
"index"
] | Object | true | 4 | 7.92 | apache/commons-lang | 2,896 | javadoc | false |
lastIndexOf | public int lastIndexOf(final CharSequence str, final CharSequence searchStr) {
if (str == null) {
return INDEX_NOT_FOUND;
}
return lastIndexOf(str, searchStr, str.length());
} | Finds the last index within a CharSequence, handling {@code null}. This method uses {@link String#lastIndexOf(String)} if possible.
<p>
A {@code null} CharSequence will return {@code -1}.
</p>
<p>
Case-sensitive examples
</p>
<pre>
Strings.CS.lastIndexOf(null, *) = -1
Strings.CS.lastIndexOf(*, null) =... | java | src/main/java/org/apache/commons/lang3/Strings.java | 916 | [
"str",
"searchStr"
] | true | 2 | 7.76 | apache/commons-lang | 2,896 | javadoc | false | |
load_arff_from_gzip_file | def load_arff_from_gzip_file(
gzip_file,
parser,
output_type,
openml_columns_info,
feature_names_to_select,
target_names_to_select,
shape=None,
read_csv_kwargs=None,
):
"""Load a compressed ARFF file using a given parser.
Parameters
----------
gzip_file : GzipFile instan... | Load a compressed ARFF file using a given parser.
Parameters
----------
gzip_file : GzipFile instance
The file compressed to be read.
parser : {"pandas", "liac-arff"}
The parser used to parse the ARFF file. "pandas" is recommended
but only supports loading dense datasets.
output_type : {"numpy", "sparse"... | python | sklearn/datasets/_arff_parser.py | 463 | [
"gzip_file",
"parser",
"output_type",
"openml_columns_info",
"feature_names_to_select",
"target_names_to_select",
"shape",
"read_csv_kwargs"
] | false | 4 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
describe_numeric_1d | def describe_numeric_1d(series: Series, percentiles: Sequence[float]) -> Series:
"""Describe series containing numerical data.
Parameters
----------
series : Series
Series to be described.
percentiles : list-like of numbers
The percentiles to include in the output.
"""
from ... | Describe series containing numerical data.
Parameters
----------
series : Series
Series to be described.
percentiles : list-like of numbers
The percentiles to include in the output. | python | pandas/core/methods/describe.py | 221 | [
"series",
"percentiles"
] | Series | true | 10 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
get_installed_libraries | def get_installed_libraries():
"""
Return the built-in template tag libraries and those from installed
applications. Libraries are stored in a dictionary where keys are the
individual module names, not the full module paths. Example:
django.templatetags.i18n is stored as i18n.
"""
return {
... | Return the built-in template tag libraries and those from installed
applications. Libraries are stored in a dictionary where keys are the
individual module names, not the full module paths. Example:
django.templatetags.i18n is stored as i18n. | python | django/template/backends/django.py | 155 | [] | false | 1 | 6.64 | django/django | 86,204 | unknown | false | |
formatDurationWords | public static String formatDurationWords(
final long durationMillis,
final boolean suppressLeadingZeroElements,
final boolean suppressTrailingZeroElements) {
// This method is generally replaceable by the format method, but
// there are a series of tweaks and special cases that ... | Formats an elapsed time into a pluralization correct string.
<p>This method formats durations using the days and lower fields of the
format pattern. Months and larger are not used.</p>
@param durationMillis the elapsed time to report in milliseconds
@param suppressLeadingZeroElements suppresses leading 0 elements
@pa... | java | src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java | 430 | [
"durationMillis",
"suppressLeadingZeroElements",
"suppressTrailingZeroElements"
] | String | true | 9 | 7.52 | apache/commons-lang | 2,896 | javadoc | false |
create_bucket | def create_bucket(self, bucket_name: str | None = None, region_name: str | None = None) -> None:
"""
Create an Amazon S3 bucket.
.. seealso::
- :external+boto3:py:meth:`S3.Client.create_bucket`
:param bucket_name: The name of the bucket
:param region_name: The name ... | Create an Amazon S3 bucket.
.. seealso::
- :external+boto3:py:meth:`S3.Client.create_bucket`
:param bucket_name: The name of the bucket
:param region_name: The name of the aws region in which to create the bucket. | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/s3.py | 340 | [
"self",
"bucket_name",
"region_name"
] | None | true | 5 | 6.4 | apache/airflow | 43,597 | sphinx | false |
matches | public abstract boolean matches(Method method); | Subclasses must override this to indicate whether they <em>match</em> the
given method. This allows for argument list checking as well as method
name checking.
@param method the method to check
@return whether this override matches the given method | java | spring-beans/src/main/java/org/springframework/beans/factory/support/MethodOverride.java | 104 | [
"method"
] | true | 1 | 6.64 | spring-projects/spring-framework | 59,386 | javadoc | false | |
toBin | int toBin(double value); | Determine the 0-based bin number in which the supplied value should be placed.
@param value the value
@return the 0-based index of the bin | java | clients/src/main/java/org/apache/kafka/common/metrics/stats/Histogram.java | 99 | [
"value"
] | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false | |
optBoolean | public boolean optBoolean(int index) {
return optBoolean(index, false);
} | Returns the value at {@code index} if it exists and is a boolean or can be coerced
to a boolean. Returns false otherwise.
@param index the index to get the value from
@return the {@code value} or {@code false} | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java | 341 | [
"index"
] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
build | @Override
public MetadataRequest build(short version) {
if (version < 1)
throw new UnsupportedVersionException("MetadataRequest versions older than 1 are not supported.");
if (!data.allowAutoTopicCreation() && version < 4)
throw new UnsupportedVersionExcep... | @return Builder for metadata request using topic IDs. | java | clients/src/main/java/org/apache/kafka/common/requests/MetadataRequest.java | 125 | [
"version"
] | MetadataRequest | true | 9 | 6.88 | apache/kafka | 31,560 | javadoc | false |
getLocalPropertyHandler | @Override
protected @Nullable PropertyHandler getLocalPropertyHandler(String propertyName) {
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(propertyName);
return (pd != null ? new BeanPropertyHandler((GenericTypeAwarePropertyDescriptor) pd) : null);
} | Convert the given value for the specified property to the latter's type.
<p>This method is only intended for optimizations in a BeanFactory.
Use the {@code convertIfNecessary} methods for programmatic conversion.
@param value the value to convert
@param propertyName the target property
(note that nested or indexed prop... | java | spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java | 191 | [
"propertyName"
] | PropertyHandler | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
min | def min(self, *, skipna: bool = True, **kwargs):
"""
The minimum value of the object.
Only ordered `Categoricals` have a minimum!
Raises
------
TypeError
If the `Categorical` is not `ordered`.
Returns
-------
min : the minimum of thi... | The minimum value of the object.
Only ordered `Categoricals` have a minimum!
Raises
------
TypeError
If the `Categorical` is not `ordered`.
Returns
-------
min : the minimum of this `Categorical`, NA value if empty | python | pandas/core/arrays/categorical.py | 2,464 | [
"self",
"skipna"
] | true | 7 | 6.56 | pandas-dev/pandas | 47,362 | unknown | false | |
to_frame | def to_frame(self, name: Hashable = lib.no_default) -> DataFrame:
"""
Convert Series to DataFrame.
Parameters
----------
name : object, optional
The passed name should substitute for the series name (if it has
one).
Returns
-------
... | Convert Series to DataFrame.
Parameters
----------
name : object, optional
The passed name should substitute for the series name (if it has
one).
Returns
-------
DataFrame
DataFrame representation of Series.
See Also
--------
Series.to_dict : Convert Series to dict object.
Examples
--------
>>> s = pd.S... | python | pandas/core/series.py | 1,810 | [
"self",
"name"
] | DataFrame | true | 5 | 8.64 | pandas-dev/pandas | 47,362 | numpy | false |
get | public static ResourceLoader get(ResourceLoader resourceLoader, boolean preferFileResolution) {
Assert.notNull(resourceLoader, "'resourceLoader' must not be null");
return get(resourceLoader, SpringFactoriesLoader.forDefaultResourceLocation(resourceLoader.getClassLoader()),
preferFileResolution);
} | Return a {@link ResourceLoader} delegating to the given resource loader and
supporting additional {@link ProtocolResolver ProtocolResolvers} registered in
{@code spring.factories}. The factories file will be resolved using the default
class loader at the time this call is made.
@param resourceLoader the delegate resour... | java | core/spring-boot/src/main/java/org/springframework/boot/io/ApplicationResourceLoader.java | 139 | [
"resourceLoader",
"preferFileResolution"
] | ResourceLoader | true | 1 | 6.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
replace | function replace() {
var args = arguments,
string = toString(args[0]);
return args.length < 3 ? string : string.replace(args[1], args[2]);
} | Replaces matches for `pattern` in `string` with `replacement`.
**Note:** This method is based on
[`String#replace`](https://mdn.io/String/replace).
@static
@memberOf _
@since 4.0.0
@category String
@param {string} [string=''] The string to modify.
@param {RegExp|string} pattern The pattern to replace.
@param {Function|... | javascript | lodash.js | 14,643 | [] | false | 2 | 8.4 | lodash/lodash | 61,490 | jsdoc | false | |
parseType | private ProjectType parseType(JSONObject object, @Nullable String defaultId) throws JSONException {
String id = getStringValue(object, ID_ATTRIBUTE, null);
String name = getStringValue(object, NAME_ATTRIBUTE, null);
String action = getStringValue(object, ACTION_ATTRIBUTE, null);
Assert.state(id != null, "'id' m... | Returns the defaults applicable to the service.
@return the defaults of the service | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java | 195 | [
"object",
"defaultId"
] | ProjectType | true | 2 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
getGenericReturnType | @Override
Type getGenericReturnType() {
Class<?> declaringClass = getDeclaringClass();
TypeVariable<?>[] typeParams = declaringClass.getTypeParameters();
if (typeParams.length > 0) {
return Types.newParameterizedType(declaringClass, typeParams);
} else {
return declaringClass... | If the class is parameterized, such as {@link java.util.ArrayList ArrayList}, this returns
{@code ArrayList<E>}. | java | android/guava/src/com/google/common/reflect/Invokable.java | 423 | [] | Type | true | 2 | 6.4 | google/guava | 51,352 | javadoc | false |
ensure_index_from_sequences | def ensure_index_from_sequences(sequences, names=None) -> Index:
"""
Construct an index from sequences of data.
A single sequence returns an Index. Many sequences returns a
MultiIndex.
Parameters
----------
sequences : sequence of sequences
names : sequence of str
Returns
----... | Construct an index from sequences of data.
A single sequence returns an Index. Many sequences returns a
MultiIndex.
Parameters
----------
sequences : sequence of sequences
names : sequence of str
Returns
-------
index : Index or MultiIndex
Examples
--------
>>> ensure_index_from_sequences([[1, 2, 4]], names=["name"... | python | pandas/core/indexes/base.py | 7,693 | [
"sequences",
"names"
] | Index | true | 5 | 8 | pandas-dev/pandas | 47,362 | numpy | false |
__contains__ | def __contains__(self, key: Any) -> bool:
"""
Return a boolean indicating whether the provided key is in the index.
Parameters
----------
key : label
The key to check if it is present in the index.
Returns
-------
bool
Whether the... | Return a boolean indicating whether the provided key is in the index.
Parameters
----------
key : label
The key to check if it is present in the index.
Returns
-------
bool
Whether the key search is in the index.
Raises
------
TypeError
If the key is not hashable.
See Also
--------
Index.isin : Returns ... | python | pandas/core/indexes/base.py | 5,243 | [
"self",
"key"
] | bool | true | 1 | 7.28 | pandas-dev/pandas | 47,362 | numpy | false |
hashCode | @Override
public int hashCode() {
int hashCode = getProperty().hashCode();
hashCode = 29 * hashCode + (isIgnoreCase() ? 1 : 0);
hashCode = 29 * hashCode + (isAscending() ? 1 : 0);
return hashCode;
} | Return whether to toggle the ascending flag if the same property gets set again
(that is, {@code setProperty} gets called with already set property name again). | java | spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java | 166 | [] | true | 3 | 6.56 | spring-projects/spring-framework | 59,386 | javadoc | false | |
register | def register() -> None:
"""
Register pandas formatters and converters with matplotlib.
This function modifies the global ``matplotlib.units.registry``
dictionary. pandas adds custom converters for
* pd.Timestamp
* pd.Period
* np.datetime64
* datetime.datetime
* datetime.date
* ... | Register pandas formatters and converters with matplotlib.
This function modifies the global ``matplotlib.units.registry``
dictionary. pandas adds custom converters for
* pd.Timestamp
* pd.Period
* np.datetime64
* datetime.datetime
* datetime.date
* datetime.time
See Also
--------
deregister_matplotlib_converters : ... | python | pandas/plotting/_misc.py | 86 | [] | None | true | 1 | 6.64 | pandas-dev/pandas | 47,362 | unknown | false |
dumps | def dumps(obj):
'''Serialize an object representing the ARFF document, returning a string.
:param obj: a dictionary.
:return: a string with the ARFF document.
'''
encoder = ArffEncoder()
return encoder.encode(obj) | Serialize an object representing the ARFF document, returning a string.
:param obj: a dictionary.
:return: a string with the ARFF document. | python | sklearn/externals/_arff.py | 1,099 | [
"obj"
] | false | 1 | 6.24 | scikit-learn/scikit-learn | 64,340 | sphinx | false | |
getLong | public long getLong(int index) throws JSONException {
Object object = get(index);
Long result = JSON.toLong(object);
if (result == null) {
throw JSON.typeMismatch(index, object, "long");
}
return result;
} | Returns the value at {@code index} if it exists and is a long or can be coerced to
a long.
@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 long. | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java | 446 | [
"index"
] | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
generateInstanceSupplierCode | @Override
public CodeBlock generateInstanceSupplierCode(
GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode,
boolean allowDirectSupplierShortcut) {
if (hasInstanceSupplier()) {
throw new AotBeanProcessingException(this.registeredBean, "instance supplier is not supported");
}
... | Extract the target class of a public {@link FactoryBean} based on its
constructor. If the implementation does not resolve the target class
because it itself uses a generic, attempt to extract it from the bean type.
@param factoryBeanType the factory bean type
@param beanType the bean type
@return the target class to us... | java | spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java | 225 | [
"generationContext",
"beanRegistrationCode",
"allowDirectSupplierShortcut"
] | CodeBlock | true | 2 | 7.76 | spring-projects/spring-framework | 59,386 | javadoc | false |
weakCompareAndSet | public final boolean weakCompareAndSet(int i, double expect, double update) {
return longs.weakCompareAndSet(i, doubleToRawLongBits(expect), doubleToRawLongBits(update));
} | Atomically sets the element at position {@code i} to the given updated value if the current
value is <a href="#bitEquals">bitwise equal</a> to the expected value.
<p>May <a
href="http://download.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/package-summary.html#Spurious">
fail spuriously</a> and does not pro... | java | android/guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java | 166 | [
"i",
"expect",
"update"
] | true | 1 | 6.16 | google/guava | 51,352 | javadoc | false | |
Buffer | function Buffer(arg, encodingOrOffset, length) {
showFlaggedDeprecation();
// Common case.
if (typeof arg === 'number') {
if (typeof encodingOrOffset === 'string') {
throw new ERR_INVALID_ARG_TYPE('string', 'string', arg);
}
return Buffer.alloc(arg);
}
return Buffer.from(arg, encodingOrOffse... | The Buffer() constructor is deprecated in documentation and should not be
used moving forward. Rather, developers should use one of the three new
factory APIs: Buffer.from(), Buffer.allocUnsafe() or Buffer.alloc() based on
their specific needs. There is no runtime deprecation because of the extent
to which the Buffer c... | javascript | lib/buffer.js | 274 | [
"arg",
"encodingOrOffset",
"length"
] | false | 3 | 6.08 | nodejs/node | 114,839 | jsdoc | false | |
getPackageJSONURL | function getPackageJSONURL(specifier, base) {
const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base);
// ResolveSelf
const packageConfig = getPackageScopeConfig(base);
if (packageConfig.exists) {
if (packageConfig.exports != null && packageConfig.name === packageName) {
c... | Parse a package name from a specifier.
@param {string} specifier - The import specifier.
@param {string | URL | undefined} base - The parent URL.
@returns {object} | javascript | lib/internal/modules/package_json_reader.js | 282 | [
"specifier",
"base"
] | false | 6 | 6.4 | nodejs/node | 114,839 | jsdoc | false | |
isOrderValid | static bool isOrderValid(const RecordDecl *RD, ArrayRef<unsigned> FieldOrder) {
if (FieldOrder.empty())
return false;
// If there is a flexible array member in the struct, it must remain the last
// field.
if (RD->hasFlexibleArrayMember() &&
FieldOrder.back() != FieldOrder.size() - 1) {
llvm::err... | \returns empty vector if the list of fields doesn't match the definition. | cpp | clang-tools-extra/clang-reorder-fields/ReorderFieldsAction.cpp | 167 | [
"FieldOrder"
] | true | 4 | 6 | llvm/llvm-project | 36,021 | doxygen | false | |
loadKeyStore | private void loadKeyStore(KeyStore store, @Nullable String location, char @Nullable [] password) {
Assert.state(StringUtils.hasText(location), () -> "Location must not be empty or null");
try {
try (InputStream stream = this.resourceLoader.getResource(location).getInputStream()) {
store.load(stream, password... | Create a new {@link JksSslStoreBundle} instance.
@param keyStoreDetails the key store details
@param trustStoreDetails the trust store details
@param resourceLoader the resource loader used to load content
@since 3.3.5 | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/jks/JksSslStoreBundle.java | 134 | [
"store",
"location",
"password"
] | void | true | 2 | 6.4 | spring-projects/spring-boot | 79,428 | javadoc | false |
IOBufIovecBuilder | IOBufIovecBuilder(IOBufIovecBuilder&&) = delete; | This is a helper class that is passed to IOBuf::takeOwnership()
for use as the custom free function.
This class allows multiple IOBuf objects to each point to non-overlapping
sections of the same buffer, allowing each IOBuf to consider its buffer
as non-shared even though they do share a single allocation. This class
... | cpp | folly/io/IOBufIovecBuilder.h | 109 | [] | true | 2 | 6.48 | facebook/folly | 30,157 | doxygen | false | |
build | public Send build() {
flushPendingSend();
if (sends.size() == 1) {
return sends.poll();
} else {
return new MultiRecordsSend(sends, sizeOfSends);
}
} | Write a record set. The underlying record data will be retained
in the result of {@link #build()}. See {@link BaseRecords#toSend()}.
@param records the records to write | java | clients/src/main/java/org/apache/kafka/common/protocol/SendBuilder.java | 173 | [] | Send | true | 2 | 6.88 | apache/kafka | 31,560 | javadoc | false |
batch_is_authorized | def batch_is_authorized(
self,
*,
requests: Sequence[IsAuthorizedRequest],
user: AwsAuthManagerUser | None,
) -> bool:
"""
Make a batch authorization decision against Amazon Verified Permissions.
Check whether the user has permissions to access all resources.... | Make a batch authorization decision against Amazon Verified Permissions.
Check whether the user has permissions to access all resources.
:param requests: the list of requests containing the method, the entity_type and the entity ID
:param user: the user | python | providers/amazon/src/airflow/providers/amazon/aws/auth_manager/avp/facade.py | 189 | [
"self",
"requests",
"user"
] | bool | true | 2 | 6.72 | apache/airflow | 43,597 | sphinx | false |
finishConnect | public boolean finishConnect() throws IOException {
//we need to grab remoteAddr before finishConnect() is called otherwise
//it becomes inaccessible if the connection was refused.
SocketChannel socketChannel = transportLayer.socketChannel();
if (socketChannel != null) {
remo... | Does handshake of transportLayer and authentication using configured authenticator.
For SSL with client authentication enabled, {@link TransportLayer#handshake()} performs
authentication. For SASL, authentication is performed by {@link Authenticator#authenticate()}. | java | clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.java | 217 | [] | true | 5 | 6.24 | 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.