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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getStateType | private Class<?> getStateType() {
S state = getState();
if (state instanceof Enum<?> enumState) {
return enumState.getDeclaringClass();
}
return state.getClass();
} | Return the changed availability state.
@return the availability state | java | core/spring-boot/src/main/java/org/springframework/boot/availability/AvailabilityChangeEvent.java | 61 | [] | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false | |
getDatabaseType | public static String getDatabaseType(final Path database) throws IOException {
final long fileSize = Files.size(database);
try (InputStream in = Files.newInputStream(database)) {
// read the last BUFFER_SIZE bytes (or the fileSize, whichever is smaller)
final long skip = fileSize... | Read the database type from the database. We do this manually instead of relying on the built-in mechanism to avoid reading the
entire database into memory merely to read the type. This is especially important to maintain on master nodes where pipelines are
validated. If we read the entire database into memory, we coul... | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/MMDBUtil.java | 41 | [
"database"
] | String | true | 10 | 7.12 | elastic/elasticsearch | 75,680 | javadoc | false |
translateInputToOutputLocationList | static DebugLocationsVector
translateInputToOutputLocationList(const BinaryFunction &BF,
const DebugLocationsVector &InputLL) {
DebugLocationsVector OutputLL;
// If the function hasn't changed - there's nothing to update.
if (!BF.isEmitted())
return InputLL;
for (const D... | Similar to translateInputToOutputRanges() but operates on location lists. | cpp | bolt/lib/Rewrite/DWARFRewriter.cpp | 133 | [] | true | 9 | 6.08 | llvm/llvm-project | 36,021 | doxygen | false | |
size | long size() throws IOException; | Return the size of this block.
@return the block size
@throws IOException on I/O error | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/DataBlock.java | 38 | [] | true | 1 | 6.64 | spring-projects/spring-boot | 79,428 | javadoc | false | |
isServletApplication | private static boolean isServletApplication() {
for (String servletIndicatorClass : SERVLET_INDICATOR_CLASSES) {
if (!ClassUtils.isPresent(servletIndicatorClass, null)) {
return false;
}
}
return true;
} | 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 | 73 | [] | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false | |
endNode | function endNode(): void {
if (parent.children) {
mergeChildren(parent.children, parent);
sortChildren(parent.children);
}
parent = parentsStack.pop()!;
trackedEs5Classes = trackedEs5ClassesStack.pop();
} | Call after calling `startNode` and adding children to it. | typescript | src/services/navigationBar.ts | 288 | [] | true | 2 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
collate | public static List<Configurations> collate(Collection<Configurations> configurations) {
LinkedList<Configurations> collated = new LinkedList<>();
for (Configurations configuration : sortConfigurations(configurations)) {
if (collated.isEmpty() || collated.getLast().getClass() != configuration.getClass()) {
co... | Collate the given configuration by sorting and merging them.
@param configurations the source configuration
@return the collated configurations
@since 3.4.0 | java | core/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java | 166 | [
"configurations"
] | true | 3 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false | |
clearAssignmentAndLeaveGroup | private void clearAssignmentAndLeaveGroup() {
subscriptions.unsubscribe();
clearAssignment();
// Transition to ensure that a heartbeat request is sent out to effectively leave the
// group (even in the case where the member had no assignment to release or when the
// callback ex... | Transition to {@link MemberState#PREPARE_LEAVING} to release the assignment. Once completed,
transition to {@link MemberState#LEAVING} to send the heartbeat request and leave the group.
This is expected to be invoked when the user calls the unsubscribe API or is closing the consumer.
@param runCallbacks {@code true} to... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java | 627 | [] | void | true | 1 | 6.88 | apache/kafka | 31,560 | javadoc | false |
indexOf | public static int indexOf(final Object[] array, final Object objectToFind) {
return indexOf(array, objectToFind, 0);
} | Finds the index of the given object in the array.
<p>
This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.
</p>
@param array the array to search for the object, may be {@code null}.
@param objectToFind the object to find, may be {@code null}.
@return the index of the object w... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 2,701 | [
"array",
"objectToFind"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
initializeClusterIPC | function initializeClusterIPC() {
if (process.argv[1] && process.env.NODE_UNIQUE_ID) {
const cluster = require('cluster');
cluster._setupWorker();
// Make sure it's not accidentally inherited by child processes.
delete process.env.NODE_UNIQUE_ID;
}
} | Patch the process object with legacy properties and normalizations.
Replace `process.argv[0]` with `process.execPath`, preserving the original `argv[0]` value as `process.argv0`.
Replace `process.argv[1]` with the resolved absolute file path of the entry point, if found.
@param {boolean} expandArgv1 - Whether to replac... | javascript | lib/internal/process/pre_execution.js | 595 | [] | false | 3 | 6.96 | nodejs/node | 114,839 | jsdoc | false | |
expireAfterAccess | @Deprecated // GoodTime
@CanIgnoreReturnValue
public CacheBuilder<K, V> expireAfterAccess(long duration, TimeUnit unit) {
checkState(
expireAfterAccessNanos == UNSET_INT,
"expireAfterAccess was already set to %s ns",
expireAfterAccessNanos);
checkArgument(duration >= 0, "duration can... | Specifies that each entry should be automatically removed from the cache once a fixed duration
has elapsed after the entry's creation, the most recent replacement of its value, or its last
access. Access time is reset by all cache read and write operations (including {@code
Cache.asMap().get(Object)} and {@code Cache.a... | java | android/guava/src/com/google/common/cache/CacheBuilder.java | 836 | [
"duration",
"unit"
] | true | 1 | 6.4 | google/guava | 51,352 | javadoc | false | |
newReference | public static <V extends @Nullable Object> AtomicReference<V> newReference(
@ParametricNullness V initialValue) {
return new AtomicReference<>(initialValue);
} | Creates an {@code AtomicReference} instance with the given initial value.
@param initialValue the initial value
@return a new {@code AtomicReference} with the given initial value | java | android/guava/src/com/google/common/util/concurrent/Atomics.java | 47 | [
"initialValue"
] | true | 1 | 6 | google/guava | 51,352 | javadoc | false | |
state_from_response | def state_from_response(response: dict[str, Any]) -> str:
"""
Get state from response dictionary.
:param response: response from AWS API
:return: execution state of the cluster step
"""
return response["Step"]["Status"]["State"] | Get state from response dictionary.
:param response: response from AWS API
:return: execution state of the cluster step | python | providers/amazon/src/airflow/providers/amazon/aws/sensors/emr.py | 620 | [
"response"
] | str | true | 1 | 7.04 | apache/airflow | 43,597 | sphinx | false |
applyAsLong | long applyAsLong(T t, U u) throws E; | Applies this function to the given arguments.
@param t the first function argument
@param u the second function argument
@return the function result
@throws E Thrown when the function fails. | java | src/main/java/org/apache/commons/lang3/function/FailableToLongBiFunction.java | 58 | [
"t",
"u"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
visitArrayLiteralExpression | function visitArrayLiteralExpression(node: ArrayLiteralExpression): Expression {
if (some(node.elements, isSpreadElement)) {
// We are here because we contain a SpreadElementExpression.
return transformAndSpreadElements(node.elements, /*isArgumentList*/ false, !!node.multiLine, /*hasT... | Visits an ArrayLiteralExpression that contains a spread element.
@param node An ArrayLiteralExpression node. | typescript | src/compiler/transformers/es2015.ts | 4,308 | [
"node"
] | true | 2 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
repackage | private void repackage(JarFile sourceJar, File destination, Libraries libraries,
@Nullable FileTime lastModifiedTime) throws IOException {
try (JarWriter writer = new JarWriter(destination, lastModifiedTime)) {
write(sourceJar, libraries, writer, lastModifiedTime != null);
}
if (lastModifiedTime != null) {
... | Repackage to the given destination so that it can be launched using '
{@literal java -jar}'.
@param destination the destination file (may be the same as the source)
@param libraries the libraries required to run the archive
@param lastModifiedTime an optional last modified time to apply to the archive and
its contents
... | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java | 138 | [
"sourceJar",
"destination",
"libraries",
"lastModifiedTime"
] | void | true | 2 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
duplicated | def duplicated(self, keep: DropKeep = "first") -> Series:
"""
Indicate duplicate Series values.
Duplicated values are indicated as ``True`` values in the resulting
Series. Either all duplicates, all except the first or all except the
last occurrence of duplicates can be indicate... | Indicate duplicate Series values.
Duplicated values are indicated as ``True`` values in the resulting
Series. Either all duplicates, all except the first or all except the
last occurrence of duplicates can be indicated.
Parameters
----------
keep : {'first', 'last', False}, default 'first'
Method to handle droppi... | python | pandas/core/series.py | 2,339 | [
"self",
"keep"
] | Series | true | 1 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
matrix_norm | def matrix_norm(x, /, *, keepdims=False, ord="fro"):
"""
Computes the matrix norm of a matrix (or a stack of matrices) ``x``.
This function is Array API compatible.
Parameters
----------
x : array_like
Input array having shape (..., M, N) and whose two innermost
dimensions form... | Computes the matrix norm of a matrix (or a stack of matrices) ``x``.
This function is Array API compatible.
Parameters
----------
x : array_like
Input array having shape (..., M, N) and whose two innermost
dimensions form ``MxN`` matrices.
keepdims : bool, optional
If this is set to True, the axes which a... | python | numpy/linalg/_linalg.py | 3,440 | [
"x",
"keepdims",
"ord"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
setBasicColor | function setBasicColor(styleCode: number): void {
// const theme = themeService.getColorTheme();
let colorType: 'foreground' | 'background' | undefined;
let colorIndex: number | undefined;
if (styleCode >= 30 && styleCode <= 37) {
colorIndex = styleCode - 30;
colorType = 'foreground';
} else if (styleC... | Calculate and set styling for basic bright and dark ANSI color codes. Uses
theme colors if available. Automatically distinguishes between foreground
and background colors; does not support color-clearing codes 39 and 49.
@param styleCode Integer color code on one of the following ranges:
[30-37, 90-97, 40-47, 100-107].... | typescript | extensions/notebook-renderers/src/ansi.ts | 356 | [
"styleCode"
] | true | 14 | 6.88 | microsoft/vscode | 179,840 | jsdoc | false | |
toString | @Override
public String toString() {
return "(principal=" + (principal == null ? "<any>" : principal) +
", host=" + (host == null ? "<any>" : host) +
", operation=" + operation +
", permissionType=" + permissionType + ")";
} | Returns a string describing an ANY or UNKNOWN field, or null if there is
no such field. | java | clients/src/main/java/org/apache/kafka/common/acl/AccessControlEntryData.java | 75 | [] | String | true | 3 | 6.88 | apache/kafka | 31,560 | javadoc | false |
toString | String toString(ToStringFormat format, boolean upperCase) {
String string = this.string[format.ordinal()];
if (string == null) {
string = buildToString(format);
this.string[format.ordinal()] = string;
}
return (!upperCase) ? string : string.toUpperCase(Locale.ENGLISH);
} | Returns {@code true} if this element is an ancestor (immediate or nested parent) of
the specified name.
@param name the name to check
@return {@code true} if this name is an ancestor | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java | 555 | [
"format",
"upperCase"
] | String | true | 3 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
needsRefresh | @Contract("null, _ -> true")
public static boolean needsRefresh(@Nullable InjectionMetadata metadata, Class<?> clazz) {
return (metadata == null || metadata.needsRefresh(clazz));
} | Check whether the given injection metadata needs to be refreshed.
@param metadata the existing metadata instance
@param clazz the current target class
@return {@code true} indicating a refresh, {@code false} otherwise
@see #needsRefresh(Class) | java | spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java | 186 | [
"metadata",
"clazz"
] | true | 2 | 7.2 | spring-projects/spring-framework | 59,386 | javadoc | false | |
cdf | public abstract double cdf(double x); | Returns the fraction of all points added which are ≤ x. Points
that are exactly equal get half credit (i.e. we use the mid-point
rule)
@param x The cutoff for the cdf.
@return The fraction of all data which is less or equal to x. | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/TDigest.java | 144 | [
"x"
] | true | 1 | 6.8 | elastic/elasticsearch | 75,680 | javadoc | false | |
getLinesBetweenNodes | function getLinesBetweenNodes(parent: Node, node1: Node, node2: Node): number {
if (getEmitFlags(parent) & EmitFlags.NoIndentation) {
return 0;
}
parent = skipSynthesizedParentheses(parent);
node1 = skipSynthesizedParentheses(node1);
node2 = skipSynthesizedPar... | Emits a list without brackets or raising events.
NOTE: You probably don't want to call this directly and should be using `emitList` or `emitExpressionList` instead. | typescript | src/compiler/emitter.ts | 5,179 | [
"parent",
"node1",
"node2"
] | true | 9 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
shutDownSharedReactorSchedulers | protected void shutDownSharedReactorSchedulers(ServletContext servletContext) {
if (Schedulers.class.getClassLoader() == servletContext.getClassLoader()) {
Schedulers.shutdownNow();
}
} | Shuts down the reactor {@link Schedulers} that were initialized by
{@code Schedulers.boundedElastic()} (or similar). The default implementation
{@link Schedulers#shutdownNow()} schedulers if they were initialized on this web
application's class loader.
@param servletContext the web application's servlet context
@since ... | java | core/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializer.java | 149 | [
"servletContext"
] | void | true | 2 | 6.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
filterTo | public FilterResult filterTo(RecordFilter filter, ByteBuffer destinationBuffer, BufferSupplier decompressionBufferSupplier) {
return filterTo(batches(), filter, destinationBuffer, decompressionBufferSupplier);
} | Filter the records into the provided ByteBuffer.
@param filter The filter function
@param destinationBuffer The byte buffer to write the filtered records to
@param decompressionBufferSupplier The supplier of ByteBuffer(s) used for decompression if supported. For small
... | java | clients/src/main/java/org/apache/kafka/common/record/MemoryRecords.java | 138 | [
"filter",
"destinationBuffer",
"decompressionBufferSupplier"
] | FilterResult | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
cutedsl | def cutedsl(self, kernel_name: str, source_code: str):
"""
Compile CuteDSL (CUTLASS Python DSL) kernels.
Args:
kernel_name: Name of the kernel to be defined
source_code: Source code of the CuteDSL kernel, as a string
Note:
CuteDSL currently requires ... | Compile CuteDSL (CUTLASS Python DSL) kernels.
Args:
kernel_name: Name of the kernel to be defined
source_code: Source code of the CuteDSL kernel, as a string
Note:
CuteDSL currently requires source files to do its compilation, there we
use the PyCodeCache to write the source code to a file and load it... | python | torch/_inductor/async_compile.py | 565 | [
"self",
"kernel_name",
"source_code"
] | true | 4 | 6.72 | pytorch/pytorch | 96,034 | google | false | |
getOutputChannel | function getOutputChannel(): vscode.OutputChannel {
if (!_channel) {
_channel = vscode.window.createOutputChannel('Gulp Auto Detection');
}
return _channel;
} | Check if the given filename is a file.
If returns false in case the file does not exist or
the file stats cannot be accessed/queried or it
is no file at all.
@param filename
the filename to the checked
@returns
true in case the file exists, in any other case false. | typescript | extensions/gulp/src/main.ts | 73 | [] | true | 2 | 7.92 | microsoft/vscode | 179,840 | jsdoc | false | |
where | def where(cond, left_op, right_op, use_numexpr: bool = True):
"""
Evaluate the where condition cond on left_op and right_op.
Parameters
----------
cond : np.ndarray[bool]
left_op : return if cond is True
right_op : return if cond is False
use_numexpr : bool, default True
Whether... | Evaluate the where condition cond on left_op and right_op.
Parameters
----------
cond : np.ndarray[bool]
left_op : return if cond is True
right_op : return if cond is False
use_numexpr : bool, default True
Whether to try to use numexpr. | python | pandas/core/computation/expressions.py | 247 | [
"cond",
"left_op",
"right_op",
"use_numexpr"
] | true | 3 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false | |
pollOnClose | @Override
public NetworkClientDelegate.PollResult pollOnClose(long currentTimeMs) {
if (membershipManager.isLeavingGroup()) {
NetworkClientDelegate.UnsentRequest request = makeHeartbeatRequestAndLogResponse(currentTimeMs);
return new NetworkClientDelegate.PollResult(heartbeatRequestS... | Generate a heartbeat request to leave the group if the state is still LEAVING when this is
called to close the consumer.
<p/>
Note that when closing the consumer, even though an event to Unsubscribe is generated
(triggers callbacks and sends leave group), it could be the case that the Unsubscribe event
processing does ... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java | 411 | [
"currentTimeMs"
] | true | 2 | 8.08 | apache/kafka | 31,560 | javadoc | false | |
isAnyNodeConnecting | private boolean isAnyNodeConnecting() {
for (Node node : metadataUpdater.fetchNodes()) {
if (connectionStates.isConnecting(node.idString())) {
return true;
}
}
return false;
} | Return true if there's at least one connection establishment is currently underway | java | clients/src/main/java/org/apache/kafka/clients/NetworkClient.java | 1,158 | [] | true | 2 | 6.24 | apache/kafka | 31,560 | javadoc | false | |
configure_s3_resources | def configure_s3_resources(self, config: dict) -> None:
"""
Extract the S3 operations from the configuration and execute them.
:param config: config of SageMaker operation
"""
s3_operations = config.pop("S3Operations", None)
if s3_operations is not None:
cre... | Extract the S3 operations from the configuration and execute them.
:param config: config of SageMaker operation | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/sagemaker.py | 190 | [
"self",
"config"
] | None | true | 6 | 6.08 | apache/airflow | 43,597 | sphinx | false |
generateConnectionId | public static String generateConnectionId(Socket socket, int processorId, int connectionIndex) {
String localHost = socket.getLocalAddress().getHostAddress();
int localPort = socket.getLocalPort();
String remoteHost = socket.getInetAddress().getHostAddress();
int remotePort = socket.getP... | Generates a unique connection ID for the given socket.
@param socket The socket for which the connection ID is to be generated.
@param processorId The ID of the server processor that will handle this connection.
@param connectionIndex The index to be used in the connection ID to ensure uniqueness.
@return A string repr... | java | clients/src/main/java/org/apache/kafka/common/network/ServerConnectionId.java | 122 | [
"socket",
"processorId",
"connectionIndex"
] | String | true | 1 | 6.72 | apache/kafka | 31,560 | javadoc | false |
deprecate_option | def deprecate_option(
key: str,
category: type[Warning],
msg: str | None = None,
rkey: str | None = None,
removal_ver: str | None = None,
) -> None:
"""
Mark option `key` as deprecated, if code attempts to access this option,
a warning will be produced, using `msg` if given, or a default... | Mark option `key` as deprecated, if code attempts to access this option,
a warning will be produced, using `msg` if given, or a default message
if not.
if `rkey` is given, any access to the key will be re-routed to `rkey`.
Neither the existence of `key` nor that if `rkey` is checked. If they
do not exist, any subseque... | python | pandas/_config/config.py | 596 | [
"key",
"category",
"msg",
"rkey",
"removal_ver"
] | None | true | 2 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
failure_message_from_response | def failure_message_from_response(response: dict[str, Any]) -> str | None:
"""
Get failure message from response dictionary.
:param response: response from AWS API
:return: failure message
"""
fail_details = response["Step"]["Status"].get("FailureDetails")
if fai... | Get failure message from response dictionary.
:param response: response from AWS API
:return: failure message | python | providers/amazon/src/airflow/providers/amazon/aws/sensors/emr.py | 630 | [
"response"
] | str | None | true | 2 | 7.76 | apache/airflow | 43,597 | sphinx | false |
stream | public static <O> FailableStream<O> stream(final Collection<O> collection) {
return new FailableStream<>(collection.stream());
} | Converts the given collection into a {@link FailableStream}. The {@link FailableStream} consists of the
collections elements. Shortcut for
<pre>
Functions.stream(collection.stream());</pre>
@param collection The collection, which is being converted into a {@link FailableStream}.
@param <O> The collections element type.... | java | src/main/java/org/apache/commons/lang3/Functions.java | 558 | [
"collection"
] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
applyAsBoolean | boolean applyAsBoolean(T t) throws E; | Applies this function to the given arguments.
@param t the first function argument
@return the function result
@throws E Thrown when the function fails. | java | src/main/java/org/apache/commons/lang3/function/FailableToBooleanFunction.java | 53 | [
"t"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
getCurrentPatchForPatchVersions | async function getCurrentPatchForPatchVersions(patchMajorMinor: { major: number; minor: number }): Promise<number> {
// TODO: could we add the name of the branch, as well as the relevant versions => faster
// $ npm view '@prisma/client@3.0.x' version --json
// [
// "3.0.1",
// "3.0.2"
// ]
// We retry ... | Takes the max dev version + 1
For now supporting X.Y.Z-dev.#
@param packages Local package definitions | typescript | scripts/ci/publish.ts | 249 | [
"patchMajorMinor"
] | true | 7 | 6.8 | prisma/prisma | 44,834 | jsdoc | true | |
addOrSuppress | private static Exception addOrSuppress(Exception firstException, Exception e) {
if (firstException == null) {
firstException = e;
} else {
firstException.addSuppressed(e);
}
return firstException;
} | Closes all given {@link Closeable}s. Some of the {@linkplain Closeable}s may be null; they are
ignored. After everything is closed, the method either throws the first exception it hit
while closing with other exceptions added as suppressed, or completes normally if there were
no exceptions.
@param objects objects to cl... | java | libs/core/src/main/java/org/elasticsearch/core/IOUtils.java | 130 | [
"firstException",
"e"
] | Exception | true | 2 | 6.88 | elastic/elasticsearch | 75,680 | javadoc | false |
join | public static String join(String separator, boolean... array) {
checkNotNull(separator);
if (array.length == 0) {
return "";
}
// For pre-sizing a builder, just get the right order of magnitude
StringBuilder builder = new StringBuilder(array.length * 7);
builder.append(array[0]);
for ... | Returns a string containing the supplied {@code boolean} values separated by {@code separator}.
For example, {@code join("-", false, true, false)} returns the string {@code
"false-true-false"}.
@param separator the text that should appear between consecutive values in the resulting string
(but not at the start or e... | java | android/guava/src/com/google/common/primitives/Booleans.java | 286 | [
"separator"
] | String | true | 3 | 6.72 | google/guava | 51,352 | javadoc | false |
initialize | private static <C extends ConfigurableApplicationContext> void initialize(
C applicationContext, String... initializerClassNames) {
Log logger = LogFactory.getLog(AotApplicationContextInitializer.class);
ClassLoader classLoader = applicationContext.getClassLoader();
logger.debug("Initializing ApplicationConte... | Factory method to create a new {@link AotApplicationContextInitializer}
instance that delegates to other initializers loaded from the given set
of class names.
@param <C> the application context type
@param initializerClassNames the class names of the initializers to load
@return a new {@link AotApplicationContextIniti... | java | spring-context/src/main/java/org/springframework/context/aot/AotApplicationContextInitializer.java | 64 | [
"applicationContext"
] | void | true | 1 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
baseOffset | @Override
public long baseOffset() {
return buffer.getLong(BASE_OFFSET_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 | 179 | [] | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false | |
update_crawler | def update_crawler(self, **crawler_kwargs) -> bool:
"""
Update crawler configurations.
.. seealso::
- :external+boto3:py:meth:`Glue.Client.update_crawler`
:param crawler_kwargs: Keyword args that define the configurations used for the crawler
:return: True if crawle... | Update crawler configurations.
.. seealso::
- :external+boto3:py:meth:`Glue.Client.update_crawler`
:param crawler_kwargs: Keyword args that define the configurations used for the crawler
:return: True if crawler was updated and false otherwise | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/glue_crawler.py | 77 | [
"self"
] | bool | true | 3 | 7.44 | apache/airflow | 43,597 | sphinx | false |
entryIterator | @Override
Iterator<Entry<K, V>> entryIterator() {
return new Itr<Entry<K, V>>() {
@Override
Entry<K, V> output(@ParametricNullness K key, @ParametricNullness V value) {
return immutableEntry(key, value);
}
};
} | Returns an iterator across all key-value map entries, used by {@code entries().iterator()} and
{@code values().iterator()}. The default behavior, which traverses the values for one key, the
values for a second key, and so on, suffices for most {@code AbstractMapBasedMultimap}
implementations.
@return an iterator across... | java | android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java | 1,264 | [] | true | 1 | 6.24 | google/guava | 51,352 | javadoc | false | |
checkPath | private boolean checkPath(String path, String[] paths) {
if (paths.length == 0) {
return false;
}
int endx = Arrays.binarySearch(forbiddenPaths, path, comparison.pathComparator());
if (endx < -1 && comparison.isParent(forbiddenPaths[-endx - 2], path) || endx >= 0) {
... | @return the "canonical" form of the given {@code path}, to be used for entitlement checks. | java | libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/FileAccessTree.java | 376 | [
"path",
"paths"
] | true | 6 | 7.04 | elastic/elasticsearch | 75,680 | javadoc | false | |
northPolarH3Address | public static String northPolarH3Address(int res) {
return h3ToString(northPolarH3(res));
} | Find the h3 address containing the North Pole at the given resolution.
@param res the provided resolution.
@return the h3 address containing the North Pole. | java | libs/h3/src/main/java/org/elasticsearch/h3/H3.java | 550 | [
"res"
] | String | true | 1 | 6.96 | elastic/elasticsearch | 75,680 | javadoc | false |
inplace_column_scale | def inplace_column_scale(X, scale):
"""Inplace column scaling of a CSC/CSR matrix.
Scale each feature of the data matrix by multiplying with specific scale
provided by the caller assuming a (n_samples, n_features) shape.
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
... | Inplace column scaling of a CSC/CSR matrix.
Scale each feature of the data matrix by multiplying with specific scale
provided by the caller assuming a (n_samples, n_features) shape.
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
Matrix to normalize using the variance of the features. It ... | python | sklearn/utils/sparsefuncs.py | 294 | [
"X",
"scale"
] | false | 6 | 7.68 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
verify_config | def verify_config() -> None:
"""
Verify main mkdocs.yml content to make sure it uses the latest language names.
"""
typer.echo("Verifying mkdocs.yml")
config = get_en_config()
updated_config = get_updated_config_content()
if config != updated_config:
typer.secho(
"docs/en... | Verify main mkdocs.yml content to make sure it uses the latest language names. | python | scripts/docs.py | 379 | [] | None | true | 2 | 7.04 | tiangolo/fastapi | 93,264 | unknown | false |
toInteger | public Integer toInteger() {
return Integer.valueOf(intValue());
} | Gets this mutable as an instance of Integer.
@return an Integer instance containing the value from this mutable, never null. | java | src/main/java/org/apache/commons/lang3/mutable/MutableInt.java | 363 | [] | Integer | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
getCustomEditor | private @Nullable PropertyEditor getCustomEditor(String propertyName, @Nullable Class<?> requiredType) {
CustomEditorHolder holder =
(this.customEditorsForPath != null ? this.customEditorsForPath.get(propertyName) : null);
return (holder != null ? holder.getPropertyEditor(requiredType) : null);
} | Get custom editor that has been registered for the given property.
@param propertyName the property path to look for
@param requiredType the type to look for
@return the custom editor, or {@code null} if none specific for this property | java | spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java | 394 | [
"propertyName",
"requiredType"
] | PropertyEditor | true | 3 | 7.76 | spring-projects/spring-framework | 59,386 | javadoc | false |
validValues | List<Object> validValues(String name, Map<String, Object> parsedConfig); | The valid values for the configuration given the current configuration values.
@param name The name of the configuration
@param parsedConfig The parsed configuration values
@return The list of valid values. To function properly, the returned objects should have the type
defined for the configuration using the recommend... | java | clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java | 938 | [
"name",
"parsedConfig"
] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
transformClassBody | function transformClassBody(node: ClassExpression | ClassDeclaration, extendsClauseElement: ExpressionWithTypeArguments | undefined): Block {
const statements: Statement[] = [];
const name = factory.getInternalName(node);
const constructorLikeName = isIdentifierANonContextualKeyword(name) ? f... | Transforms a ClassExpression or ClassDeclaration into a function body.
@param node A ClassExpression or ClassDeclaration node.
@param extendsClauseElement The expression for the class `extends` clause. | typescript | src/compiler/transformers/es2015.ts | 1,090 | [
"node",
"extendsClauseElement"
] | true | 2 | 6.4 | microsoft/TypeScript | 107,154 | jsdoc | false | |
name | public MetricName name() {
return this.name;
} | Get the name of this metric.
@return the metric name; never null | java | clients/src/main/java/org/apache/kafka/common/metrics/stats/Frequency.java | 46 | [] | MetricName | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false |
transform | def transform(self, X):
"""
Transform a new matrix using the built clustering.
Parameters
----------
X : array-like of shape (n_samples, n_features) or \
(n_samples, n_samples)
An M by N array of M observations in N dimensions or a length
... | Transform a new matrix using the built clustering.
Parameters
----------
X : array-like of shape (n_samples, n_features) or \
(n_samples, n_samples)
An M by N array of M observations in N dimensions or a length
M array of M one-dimensional observations.
Returns
-------
Y : ndarray of shape (n_samples,... | python | sklearn/cluster/_feature_agglomeration.py | 24 | [
"self",
"X"
] | false | 4 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
captureRanges | public Map<String, Object> captureRanges(String text) {
return innerCaptures(text, cfg -> cfg::rangeExtracter);
} | Matches and returns the ranges of any named captures.
@param text the text to match and extract values from.
@return a map containing field names and their respective ranges that matched or null if the pattern didn't match | java | libs/grok/src/main/java/org/elasticsearch/grok/Grok.java | 208 | [
"text"
] | true | 1 | 6.96 | elastic/elasticsearch | 75,680 | javadoc | false | |
get_exception_info | def get_exception_info(self, exception, token):
"""
Return a dictionary containing contextual line information of where
the exception occurred in the template. The following information is
provided:
message
The message of the exception raised.
source_lines
... | Return a dictionary containing contextual line information of where
the exception occurred in the template. The following information is
provided:
message
The message of the exception raised.
source_lines
The lines before, after, and including the line the exception
occurred on.
line
The line number ... | python | django/template/base.py | 215 | [
"self",
"exception",
"token"
] | false | 4 | 6.16 | django/django | 86,204 | unknown | false | |
configure | public <T extends SimpleAsyncTaskScheduler> T configure(T taskScheduler) {
PropertyMapper map = PropertyMapper.get();
map.from(this.threadNamePrefix).to(taskScheduler::setThreadNamePrefix);
map.from(this.concurrencyLimit).to(taskScheduler::setConcurrencyLimit);
map.from(this.virtualThreads).to(taskScheduler::se... | Configure the provided {@link SimpleAsyncTaskScheduler} instance using this
builder.
@param <T> the type of task scheduler
@param taskScheduler the {@link SimpleAsyncTaskScheduler} to configure
@return the task scheduler instance
@see #build() | java | core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskSchedulerBuilder.java | 203 | [
"taskScheduler"
] | T | true | 2 | 7.44 | spring-projects/spring-boot | 79,428 | javadoc | false |
result | function result(object, path, defaultValue) {
path = castPath(path, object);
var index = -1,
length = path.length;
// Ensure the loop is entered when path is empty.
if (!length) {
length = 1;
object = undefined;
}
while (++index < length) {
var val... | This method is like `_.get` except that if the resolved value is a
function it's invoked with the `this` binding of its parent object and
its result is returned.
@static
@since 0.1.0
@memberOf _
@category Object
@param {Object} object The object to query.
@param {Array|string} path The path of the property to resolve.
... | javascript | lodash.js | 13,730 | [
"object",
"path",
"defaultValue"
] | false | 6 | 7.68 | lodash/lodash | 61,490 | jsdoc | false | |
getLog | @Override
public Log getLog(Supplier<Log> destination) {
synchronized (this.lines) {
DeferredLog logger = new DeferredLog(destination, this.lines);
this.loggers.add(logger);
return logger;
}
} | Create a new {@link DeferredLog} for the given destination.
@param destination the ultimate log destination
@return a deferred log instance that will switch to the destination when
appropriate. | java | core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLogs.java | 70 | [
"destination"
] | Log | true | 1 | 6.4 | spring-projects/spring-boot | 79,428 | javadoc | false |
firstNonNull | public static <T> T firstNonNull(@Nullable T first, @Nullable T second) {
if (first != null) {
return first;
}
if (second != null) {
return second;
}
throw new NullPointerException("Both parameters are null");
} | Returns the first of two given parameters that is not {@code null}, if either is, or otherwise
throws a {@link NullPointerException}.
<p>To find the first non-null element in an iterable, use {@code Iterables.find(iterable,
Predicates.notNull())}. For varargs, use {@code Iterables.find(Arrays.asList(a, b, c, ...),
Pred... | java | android/guava/src/com/google/common/base/MoreObjects.java | 60 | [
"first",
"second"
] | T | true | 3 | 6.4 | google/guava | 51,352 | javadoc | false |
iterate_file_descriptors_safely | def iterate_file_descriptors_safely(fds_iter, source_data,
hub_method, *args, **kwargs):
"""Apply hub method to fds in iter, remove from list if failure.
Some file descriptors may become stale through OS reasons
or possibly other reasons, so safely manage our lists of FD... | Apply hub method to fds in iter, remove from list if failure.
Some file descriptors may become stale through OS reasons
or possibly other reasons, so safely manage our lists of FDs.
:param fds_iter: the file descriptors to iterate and apply hub_method
:param source_data: data source to remove FD if it renders OSError
... | python | celery/concurrency/asynpool.py | 198 | [
"fds_iter",
"source_data",
"hub_method"
] | false | 8 | 6.4 | celery/celery | 27,741 | sphinx | false | |
getOrCreateEnvironment | private ConfigurableEnvironment getOrCreateEnvironment() {
if (this.environment != null) {
return this.environment;
}
WebApplicationType webApplicationType = this.properties.getWebApplicationType();
ConfigurableEnvironment environment = this.applicationContextFactory.createEnvironment(webApplicationType);
... | 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 | 475 | [] | ConfigurableEnvironment | true | 5 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
from | public <V> Member<V> from(@Nullable V value) {
return from((instance) -> value);
} | Add members from a static value. One of the {@code Member.using(...)} methods
must be used to complete the configuration.
@param <V> the value type
@param value the member value
@return the added {@link Member} which may be configured further | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 272 | [
"value"
] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
fromarrays | def fromarrays(arraylist, dtype=None, shape=None, formats=None,
names=None, titles=None, aligned=False, byteorder=None,
fill_value=None):
"""
Creates a mrecarray from a (flat) list of masked arrays.
Parameters
----------
arraylist : sequence
A list of (masked) ... | Creates a mrecarray from a (flat) list of masked arrays.
Parameters
----------
arraylist : sequence
A list of (masked) arrays. Each element of the sequence is first converted
to a masked array if needed. If a 2D array is passed as argument, it is
processed line by line
dtype : {None, dtype}, optional
D... | python | numpy/ma/mrecords.py | 494 | [
"arraylist",
"dtype",
"shape",
"formats",
"names",
"titles",
"aligned",
"byteorder",
"fill_value"
] | false | 2 | 6.08 | numpy/numpy | 31,054 | numpy | false | |
_check_values_indices_shape_match | def _check_values_indices_shape_match(
values: np.ndarray, index: Index, columns: Index
) -> None:
"""
Check that the shape implied by our axes matches the actual shape of the
data.
"""
if values.shape[1] != len(columns) or values.shape[0] != len(index):
# Could let this raise in Block c... | Check that the shape implied by our axes matches the actual shape of the
data. | python | pandas/core/internals/construction.py | 344 | [
"values",
"index",
"columns"
] | None | true | 4 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
evaluate | protected @Nullable Object evaluate(TypedStringValue value) {
Object result = doEvaluate(value.getValue());
if (!ObjectUtils.nullSafeEquals(result, value.getValue())) {
value.setDynamic();
}
return result;
} | Evaluate the given value as an expression, if necessary.
@param value the candidate value (may be an expression)
@return the resolved value | java | spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java | 271 | [
"value"
] | Object | true | 2 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false |
adviceChanged | @Override
protected void adviceChanged() {
super.adviceChanged();
if (this.singleton) {
logger.debug("Advice has changed; re-caching singleton instance");
synchronized (this) {
this.singletonInstance = null;
}
}
} | Blow away and recache singleton on an advice change. | java | spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java | 567 | [] | void | true | 2 | 7.04 | spring-projects/spring-framework | 59,386 | javadoc | false |
get | public StructuredLogFormatter<E> get(String format) {
StructuredLogFormatter<E> formatter = this.commonFormatters.get(this.instantiator, format);
formatter = (formatter != null) ? formatter : getUsingClassName(format);
if (formatter != null) {
return formatter;
}
throw new IllegalArgumentException(
"Un... | Get a new {@link StructuredLogFormatter} instance for the specified format.
@param format the format requested (either a {@link CommonStructuredLogFormat} ID
or a fully-qualified class name)
@return a new {@link StructuredLogFormatter} instance
@throws IllegalArgumentException if the format is unknown | java | core/spring-boot/src/main/java/org/springframework/boot/logging/structured/StructuredLogFormatterFactory.java | 123 | [
"format"
] | true | 3 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false | |
maybeThrowInterruptException | private void maybeThrowInterruptException() {
if (Thread.interrupted()) {
throw new InterruptException(new InterruptedException());
}
} | Check whether there is pending request. This includes both requests that
have been transmitted (i.e. in-flight requests) and those which are awaiting transmission.
@return A boolean indicating whether there is pending request | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java | 535 | [] | void | true | 2 | 7.92 | apache/kafka | 31,560 | javadoc | false |
toString | @Override
public String toString() {
ToStringCreator creator = new ToStringCreator(this);
creator.append("key", this.key);
creator.append("options", this.options);
creator.append("protocol", this.protocol);
creator.append("stores", this.stores);
return creator.toString();
} | Get an {@link SslBundle} for the given {@link JksSslBundleProperties}.
@param properties the source properties
@param resourceLoader the resource loader used to load content
@return an {@link SslBundle} instance
@since 3.3.5 | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/PropertiesSslBundle.java | 183 | [] | String | true | 1 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
toDashedForm | public static String toDashedForm(String name) {
StringBuilder result = new StringBuilder(name.length());
boolean inIndex = false;
for (int i = 0; i < name.length(); i++) {
char ch = name.charAt(i);
if (inIndex) {
result.append(ch);
if (ch == ']') {
inIndex = false;
}
}
else {
if ... | Return the specified Java Bean property name in dashed form.
@param name the source name
@return the dashed from | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/DataObjectPropertyName.java | 37 | [
"name"
] | String | true | 9 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
inContainer | static boolean inContainer(final String dirPrefix) {
final String value = readFile(dirPrefix + "/proc/1/environ", "container");
if (value != null) {
return !value.isEmpty();
}
return fileExists(dirPrefix + "/.dockerenv") || fileExists(dirPrefix + "/run/.containerenv");
} | Tests whether we are running in a container like Docker or Podman.
<p>
<em>The following may change if we find better detection logic.</em>
</p>
<p>
We roughly follow the logic in SystemD:
</p>
<p>
<a href=
"https://github.com/systemd/systemd/blob/0747e3b60eb4496ee122066c844210ce818d76d9/src/basic/virt.c#L692">https://... | java | src/main/java/org/apache/commons/lang3/RuntimeEnvironment.java | 103 | [
"dirPrefix"
] | true | 3 | 6.24 | apache/commons-lang | 2,896 | javadoc | false | |
registered | def registered(self, *taskinfoitems):
"""Return all registered tasks per worker.
>>> app.control.inspect().registered()
{'celery@node1': ['task1', 'task1']}
>>> app.control.inspect().registered('serializer', 'max_retries')
{'celery@node1': ['task_foo [serializer=json max_retries... | Return all registered tasks per worker.
>>> app.control.inspect().registered()
{'celery@node1': ['task1', 'task1']}
>>> app.control.inspect().registered('serializer', 'max_retries')
{'celery@node1': ['task_foo [serializer=json max_retries=3]', 'tasb_bar [serializer=json max_retries=3]']}
Arguments:
taskinfoitems ... | python | celery/app/control.py | 256 | [
"self"
] | false | 1 | 6.88 | celery/celery | 27,741 | google | false | |
values | private XContentBuilder values(float[] values) throws IOException {
if (values == null) {
return nullValue();
}
startArray();
for (float f : values) {
value(f);
}
endArray();
return this;
} | @return the value of the "human readable" flag. When the value is equal to true,
some types of values are written in a format easier to read for a human. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java | 521 | [
"values"
] | XContentBuilder | true | 2 | 7.04 | elastic/elasticsearch | 75,680 | javadoc | false |
successfulAsList | @SafeVarargs
public static <V extends @Nullable Object> ListenableFuture<List<@Nullable V>> successfulAsList(
ListenableFuture<? extends V>... futures) {
/*
* Another way to express this signature would be to bound <V> by @NonNull and accept
* LF<? extends @Nullable V>. That might be better: There... | Creates a new {@code ListenableFuture} whose value is a list containing the values of all its
successful input futures. The list of results is in the same order as the input list, and if
any of the provided futures fails or is canceled, its corresponding position will contain
{@code null} (which is indistinguishable fr... | java | android/guava/src/com/google/common/util/concurrent/Futures.java | 849 | [] | true | 1 | 6.88 | google/guava | 51,352 | javadoc | false | |
groupId | public String groupId() {
return groupId;
} | @return Group ID of the group the member is part of (or wants to be part of). | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java | 262 | [] | String | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false |
customizers | public ThreadPoolTaskSchedulerBuilder customizers(ThreadPoolTaskSchedulerCustomizer... customizers) {
Assert.notNull(customizers, "'customizers' must not be null");
return customizers(Arrays.asList(customizers));
} | Set the {@link ThreadPoolTaskSchedulerCustomizer
threadPoolTaskSchedulerCustomizers} that should be applied to the
{@link ThreadPoolTaskScheduler}. Customizers are applied in the order that they
were added after builder configuration has been applied. Setting this value will
replace any previously configured customizer... | java | core/spring-boot/src/main/java/org/springframework/boot/task/ThreadPoolTaskSchedulerBuilder.java | 142 | [] | ThreadPoolTaskSchedulerBuilder | true | 1 | 6.16 | spring-projects/spring-boot | 79,428 | javadoc | false |
register_index_accessor | def register_index_accessor(name: str) -> Callable[[TypeT], TypeT]:
"""
Register a custom accessor on Index objects.
Parameters
----------
name : str
Name under which the accessor should be registered. A warning is issued
if this name conflicts with a preexisting attribute.
Ret... | Register a custom accessor on Index objects.
Parameters
----------
name : str
Name under which the accessor should be registered. A warning is issued
if this name conflicts with a preexisting attribute.
Returns
-------
callable
A class decorator.
See Also
--------
register_dataframe_accessor : Register a... | python | pandas/core/accessor.py | 519 | [
"name"
] | Callable[[TypeT], TypeT] | true | 1 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
trySubstituteNamespaceExportedName | function trySubstituteNamespaceExportedName(node: Identifier): Expression | undefined {
// If this is explicitly a local name, do not substitute.
if (enabledSubstitutions & applicableSubstitutions && !isGeneratedIdentifier(node) && !isLocalName(node)) {
// If we are nested within a namesp... | Hooks node substitutions.
@param hint A hint as to the intended usage of the node.
@param node The node to substitute. | typescript | src/compiler/transformers/ts.ts | 2,684 | [
"node"
] | true | 10 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
opj_uint_floorlog2 | static INLINE OPJ_UINT32 opj_uint_floorlog2(OPJ_UINT32 a)
{
OPJ_UINT32 l;
for (l = 0; a > 1; ++l) {
a >>= 1;
}
return l;
} | Get logarithm of an integer and round downwards
@return Returns log2(a) | cpp | 3rdparty/openjpeg/openjp2/opj_intmath.h | 248 | [
"a"
] | true | 2 | 6.4 | opencv/opencv | 85,374 | doxygen | false | |
poll_for_termination | def poll_for_termination(self, app_id: str) -> None:
"""
Pool for spark application termination.
:param app_id: id of the spark application to monitor
"""
state = self.hook.get_spark_state(app_id)
while AppState(state) not in AnalyticDBSparkHook.TERMINAL_STATES:
... | Pool for spark application termination.
:param app_id: id of the spark application to monitor | python | providers/alibaba/src/airflow/providers/alibaba/cloud/operators/analyticdb_spark.py | 64 | [
"self",
"app_id"
] | None | true | 3 | 6.88 | apache/airflow | 43,597 | sphinx | false |
execute | def execute(self, context: Context) -> dict:
"""
Trigger a Dag Run for the Dag in the Amazon MWAA environment.
:param context: the Context object
:return: dict with information about the Dag run
For details of the returned dict, see :py:meth:`botocore.client.MWAA.invoke_rest... | Trigger a Dag Run for the Dag in the Amazon MWAA environment.
:param context: the Context object
:return: dict with information about the Dag run
For details of the returned dict, see :py:meth:`botocore.client.MWAA.invoke_rest_api` | python | providers/amazon/src/airflow/providers/amazon/aws/operators/mwaa.py | 137 | [
"self",
"context"
] | dict | true | 3 | 7.6 | apache/airflow | 43,597 | sphinx | false |
describe_task_execution | def describe_task_execution(self, task_execution_arn: str) -> dict:
"""
Get description for the specified ``task_execution_arn``.
.. seealso::
- :external+boto3:py:meth:`DataSync.Client.describe_task_execution`
:param task_execution_arn: TaskExecutionArn
:return: AW... | Get description for the specified ``task_execution_arn``.
.. seealso::
- :external+boto3:py:meth:`DataSync.Client.describe_task_execution`
:param task_execution_arn: TaskExecutionArn
:return: AWS metadata about a task execution.
:raises AirflowBadRequest: If ``task_execution_arn`` is empty. | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/datasync.py | 267 | [
"self",
"task_execution_arn"
] | dict | true | 1 | 6.08 | apache/airflow | 43,597 | sphinx | false |
splitName | function splitName(fullPath: string): { name: string; parentPath: string } {
const p = fullPath.indexOf('/') !== -1 ? posix : win32;
const name = p.basename(fullPath);
const parentPath = p.dirname(fullPath);
if (name.length) {
return { name, parentPath };
}
// only the root segment
return { name: parentPath, p... | Splits a recent label in name and parent path, supporting both '/' and '\' and workspace suffixes.
If the location is remote, the remote name is included in the name part. | typescript | src/vs/base/common/labels.ts | 464 | [
"fullPath"
] | true | 3 | 6 | microsoft/vscode | 179,840 | jsdoc | false | |
stream | public static Stream<KeyStoreEntry> stream(
KeyStore keyStore,
Function<GeneralSecurityException, ? extends RuntimeException> exceptionHandler
) {
try {
return Collections.list(keyStore.aliases()).stream().map(a -> new KeyStoreEntry(keyStore, a, exceptionHandler));
} catc... | Creates a {@link X509ExtendedTrustManager} based on the provided certificates
@param certificates the certificates to trust
@return a trust manager that trusts the provided certificates | java | libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/KeyStoreUtil.java | 199 | [
"keyStore",
"exceptionHandler"
] | true | 2 | 6.8 | elastic/elasticsearch | 75,680 | javadoc | false | |
initializeAdvisorChain | private synchronized void initializeAdvisorChain() throws AopConfigException, BeansException {
if (!this.advisorChainInitialized && !ObjectUtils.isEmpty(this.interceptorNames)) {
if (this.beanFactory == null) {
throw new IllegalStateException("No BeanFactory available anymore (probably due to serialization) " ... | Create the advisor (interceptor) chain. Advisors that are sourced
from a BeanFactory will be refreshed each time a new prototype instance
is added. Interceptors added programmatically through the factory API
are unaffected by such changes. | java | spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java | 408 | [] | void | true | 11 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
onMemberEpochUpdated | @Override
public void onMemberEpochUpdated(Optional<Integer> memberEpochOpt, String memberId) {
this.memberId = Uuid.fromString(memberId);
} | The method checks whether the leader for a topicIdPartition has changed.
@param nodeId The previous leader for the partition.
@param topicIdPartition The TopicIdPartition to check.
@return Returns true if leader information is available and leader has changed.
If the leader information is not available or if the leader... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java | 1,145 | [
"memberEpochOpt",
"memberId"
] | void | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false |
task_render | def task_render(args, dag: DAG | None = None) -> None:
"""Render and displays templated fields for a given task."""
if not dag:
dag = get_bagged_dag(args.bundle_name, args.dag_id)
serialized_dag = SerializedDAG.deserialize_dag(SerializedDAG.serialize_dag(dag))
ti, _ = _get_ti(
serialized... | Render and displays templated fields for a given task. | python | airflow-core/src/airflow/cli/commands/task_command.py | 430 | [
"args",
"dag"
] | None | true | 3 | 6 | apache/airflow | 43,597 | unknown | false |
select | def select(
self,
key: str,
where=None,
start=None,
stop=None,
columns=None,
iterator: bool = False,
chunksize: int | None = None,
auto_close: bool = False,
):
"""
Retrieve pandas object stored in file, optionally based on where... | Retrieve pandas object stored in file, optionally based on where criteria.
.. warning::
Pandas uses PyTables for reading and writing HDF5 files, which allows
serializing object-dtype data with pickle when using the "fixed" format.
Loading pickled data received from untrusted sources can be unsafe.
See: h... | python | pandas/io/pytables.py | 839 | [
"self",
"key",
"where",
"start",
"stop",
"columns",
"iterator",
"chunksize",
"auto_close"
] | true | 2 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false | |
namespaceElementVisitorWorker | function namespaceElementVisitorWorker(node: Node): VisitResult<Node | undefined> {
if (
node.kind === SyntaxKind.ExportDeclaration ||
node.kind === SyntaxKind.ImportDeclaration ||
node.kind === SyntaxKind.ImportClause ||
(node.kind === SyntaxKind.ImportEqual... | Specialized visitor that visits the immediate children of a namespace.
@param node The node to visit. | typescript | src/compiler/transformers/ts.ts | 518 | [
"node"
] | true | 9 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
of | public static <E> Stream<E> of(final Enumeration<E> enumeration) {
return StreamSupport.stream(new EnumerationSpliterator<>(Long.MAX_VALUE, Spliterator.ORDERED, enumeration), false);
} | Streams the elements of the given enumeration in order.
@param <E> The enumeration element type.
@param enumeration The enumeration to stream.
@return a new stream.
@since 3.13.0 | java | src/main/java/org/apache/commons/lang3/stream/Streams.java | 687 | [
"enumeration"
] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
_truncate_datetime_for_granularity | def _truncate_datetime_for_granularity(
self,
dt: datetime,
granularity: Literal["hourly", "daily"],
) -> datetime:
"""
Truncate datetime based on granularity for planned tasks grouping.
Args:
dt: The datetime to truncate
granularity: Either "... | Truncate datetime based on granularity for planned tasks grouping.
Args:
dt: The datetime to truncate
granularity: Either "hourly" or "daily"
Returns:
Truncated datetime | python | airflow-core/src/airflow/api_fastapi/core_api/services/ui/calendar.py | 297 | [
"self",
"dt",
"granularity"
] | datetime | true | 2 | 7.28 | apache/airflow | 43,597 | google | false |
acknowledgeBatchIfImplicitAcknowledgement | private void acknowledgeBatchIfImplicitAcknowledgement() {
// If IMPLICIT, acknowledge all records
if (acknowledgementMode == ShareAcknowledgementMode.IMPLICIT) {
currentFetch.acknowledgeAll(AcknowledgeType.ACCEPT);
}
} | If the acknowledgement mode is IMPLICIT, acknowledges all records in the current batch. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumerImpl.java | 1,145 | [] | void | true | 2 | 7.04 | apache/kafka | 31,560 | javadoc | false |
update | def update(self, func, default=None, testing_value=None,
missing_values='', locked=False):
"""
Set StringConverter attributes directly.
Parameters
----------
func : function
Conversion function.
default : any, optional
Value to retu... | Set StringConverter attributes directly.
Parameters
----------
func : function
Conversion function.
default : any, optional
Value to return by default, that is, when the string to be
converted is flagged as missing. If not given,
`StringConverter` tries to supply a reasonable default value.
testing_val... | python | numpy/lib/_iotools.py | 766 | [
"self",
"func",
"default",
"testing_value",
"missing_values",
"locked"
] | false | 8 | 6 | numpy/numpy | 31,054 | numpy | false | |
fromMap | V fromMap(Map<String, Short> baseVersionRangeMap); | Convert the map representation of an object of type <V>, to an object of type <V>.
@param baseVersionRangeMap the map representation of a BaseVersionRange object.
@return the object of type <V> | java | clients/src/main/java/org/apache/kafka/common/feature/Features.java | 115 | [
"baseVersionRangeMap"
] | V | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
_get_fab_migration_version | def _get_fab_migration_version(*, session: Session) -> str | None:
"""
Get the current FAB migration version from the database.
This intentionally queries the db directly, as the FAB provider and FABDBManager may not even be installed.
:param session: sqlalchemy session for connection to airflow metad... | Get the current FAB migration version from the database.
This intentionally queries the db directly, as the FAB provider and FABDBManager may not even be installed.
:param session: sqlalchemy session for connection to airflow metadata database
:return: The current FAB migration revision, or None if not found | python | airflow-core/src/airflow/utils/db.py | 1,221 | [
"session"
] | str | None | true | 2 | 8.08 | apache/airflow | 43,597 | sphinx | false |
findCommonAncestorIndex | private static int findCommonAncestorIndex(StackTraceElement[] callStack, String className, String methodName) {
for (int i = 0; i < callStack.length; i++) {
StackTraceElement element = callStack[i];
if (className.equals(element.getClassName()) && methodName.equals(element.getMethodName())) {
return i;
}... | Rewrite the call stack of the specified {@code exception} so that it matches
the current call stack up to (included) the specified method invocation.
<p>Clone the specified exception. If the exception is not {@code serializable},
the original exception is returned. If no common ancestor can be found, returns
the origin... | java | spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java | 157 | [
"callStack",
"className",
"methodName"
] | true | 4 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false | |
toString | @Override
public String toString() {
return this.cause.toString();
} | Return the original cause of the error.
@return the error cause | java | core/spring-boot/src/main/java/org/springframework/boot/web/error/Error.java | 93 | [] | String | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false |
firstKey | function firstKey(parameters: Record<string, string>, ...keys: string[]): string | null {
for (const key of keys) {
if (key in parameters) {
return parameters[key]
}
}
return null
} | Return the value of the first key found in the parameters object
@param parameters
@param keys | typescript | packages/adapter-mssql/src/connection-string.ts | 282 | [
"parameters",
"...keys"
] | true | 2 | 6.4 | prisma/prisma | 44,834 | jsdoc | false | |
isNotInGroup | private boolean isNotInGroup() {
return state == MemberState.UNSUBSCRIBED ||
state == MemberState.FENCED ||
state == MemberState.FATAL ||
state == MemberState.STALE;
} | @return True if the member is preparing to leave the group (waiting for callbacks), or
leaving (sending last heartbeat). This is used to skip proactively leaving the group when
the poll timer expires. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java | 358 | [] | true | 4 | 8.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.