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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
get_airflow_health | def get_airflow_health() -> dict[str, Any]:
"""Get the health for Airflow metadatabase, scheduler and triggerer."""
metadatabase_status = HEALTHY
latest_scheduler_heartbeat = None
latest_triggerer_heartbeat = None
latest_dag_processor_heartbeat = None
scheduler_status = UNHEALTHY
triggerer_... | Get the health for Airflow metadatabase, scheduler and triggerer. | python | airflow-core/src/airflow/api/common/airflow_health.py | 29 | [] | dict[str, Any] | true | 12 | 6.48 | apache/airflow | 43,597 | unknown | false |
get_executor_names | def get_executor_names(cls, validate_teams: bool = True) -> list[ExecutorName]:
"""
Return the executor names from Airflow configuration.
:param validate_teams: Whether to validate that team names exist in database
:return: List of executor names from Airflow configuration
"""
... | Return the executor names from Airflow configuration.
:param validate_teams: Whether to validate that team names exist in database
:return: List of executor names from Airflow configuration | python | airflow-core/src/airflow/executors/executor_loader.py | 260 | [
"cls",
"validate_teams"
] | list[ExecutorName] | true | 1 | 6.4 | apache/airflow | 43,597 | sphinx | false |
createDate | function createDate(year: number, month: number, date: number): Date {
// The `newDate` is set to midnight (UTC) on January 1st 1970.
// - In PST this will be December 31st 1969 at 4pm.
// - In GMT this will be January 1st 1970 at 1am.
// Note that they even have different years, dates and months!
const newDa... | Create a new Date object with the given date value, and the time set to midnight.
We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.
See: https://github.com/angular/angular/issues/40377
Note that this function returns a Date object whose time is midnight in the current loca... | typescript | packages/common/src/i18n/format_date.ts | 168 | [
"year",
"month",
"date"
] | true | 1 | 6 | angular/angular | 99,544 | jsdoc | false | |
onCancelled | @Override
protected void onCancelled() {
synchronized (this) {
if (scheduledPeriodicRun != null) {
scheduledPeriodicRun.cancel();
}
}
markAsCompleted();
} | Download, update, and clean up GeoIP databases as required by the GeoIP processors in the cluster.
Guaranteed to not be called concurrently. | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/AbstractGeoIpDownloader.java | 158 | [] | void | true | 2 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false |
resolve | default @Nullable File resolve(JarEntry entry, String newName) throws IOException {
return resolve(entry.getName(), newName);
} | Resolves the given {@link JarEntry} to a file.
@param entry the jar entry
@param newName the new name of the file
@return file where the contents should be written or {@code null} if this entry
should be skipped
@throws IOException if something went wrong | java | loader/spring-boot-jarmode-tools/src/main/java/org/springframework/boot/jarmode/tools/ExtractCommand.java | 378 | [
"entry",
"newName"
] | File | true | 1 | 6.64 | spring-projects/spring-boot | 79,428 | javadoc | false |
throwIfNoTransactionManager | private void throwIfNoTransactionManager() {
if (transactionManager == null)
throw new IllegalStateException("Cannot use transactional methods without enabling transactions " +
"by setting the " + ProducerConfig.TRANSACTIONAL_ID_CONFIG + " configuration property");
} | computes partition for given record.
if the record has partition returns the value otherwise
if custom partitioner is specified, call it to compute partition
otherwise try to calculate partition based on key.
If there is no key or key should be ignored return
RecordMetadata.UNKNOWN_PARTITION to indicate any partition
c... | java | clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java | 1,619 | [] | void | true | 2 | 6.56 | apache/kafka | 31,560 | javadoc | false |
invokeAwareMethods | private void invokeAwareMethods(Object instance) {
if (instance instanceof Aware) {
if (instance instanceof BeanClassLoaderAware beanClassLoaderAwareInstance) {
beanClassLoaderAwareInstance.setBeanClassLoader(this.beanClassLoader);
}
if (instance instanceof BeanFactoryAware beanFactoryAwareInstance) {
... | Returns the auto-configurations excluded by the
{@code spring.autoconfigure.exclude} property.
@return excluded auto-configurations
@since 2.3.2 | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java | 329 | [
"instance"
] | void | true | 6 | 6.4 | spring-projects/spring-boot | 79,428 | javadoc | false |
unescapeXml | public static final String unescapeXml(final String input) {
return UNESCAPE_XML.translate(input);
} | Unescapes a string containing XML entity escapes to a string
containing the actual Unicode characters corresponding to the
escapes.
<p>Supports only the five basic XML entities (gt, lt, quot, amp, apos).
Does not support DTDs or external entities.</p>
<p>Note that numerical \\u Unicode codes are unescaped to their resp... | java | src/main/java/org/apache/commons/lang3/StringEscapeUtils.java | 779 | [
"input"
] | String | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
mnk_symbolic | def mnk_symbolic(
self,
) -> tuple[sympy.Integer, sympy.Integer, sympy.Integer]:
"""
Get the symbolic M, N, K dimensions for matrix multiplication.
Handles both 2D (MM) and 3D (BMM) tensors.
M is extracted from the second-to-last dimension of the first operand (mat1).
... | Get the symbolic M, N, K dimensions for matrix multiplication.
Handles both 2D (MM) and 3D (BMM) tensors.
M is extracted from the second-to-last dimension of the first operand (mat1).
N is extracted from the last dimension of the second operand (mat2).
K is extracted from the last dimension of the first operand (mat1)... | python | torch/_inductor/kernel_inputs.py | 249 | [
"self"
] | tuple[sympy.Integer, sympy.Integer, sympy.Integer] | true | 1 | 7.04 | pytorch/pytorch | 96,034 | unknown | false |
indexOfIgnoreCase | @Deprecated
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) {
return Strings.CI.indexOf(str, searchStr);
} | Case in-sensitive find of the first index within a CharSequence.
<p>
A {@code null} CharSequence will return {@code -1}. A negative start position is treated as zero. An empty ("") search CharSequence always matches. A
start position greater than the string length only matches an empty search CharSequence.
</p>
<pre>
S... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 3,066 | [
"str",
"searchStr"
] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
visitExportDeclaration | function visitExportDeclaration(node: ExportDeclaration): VisitResult<Statement | undefined> {
if (node.isTypeOnly) {
return undefined;
}
if (!node.exportClause || isNamespaceExport(node.exportClause)) {
// never elide `export <whatever> from <whereever>` declarati... | Visits an export declaration, eliding it if it does not contain a clause that resolves to a value.
@param node The export declaration node. | typescript | src/compiler/transformers/ts.ts | 2,337 | [
"node"
] | true | 5 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
max | public static long max(long... array) {
checkArgument(array.length > 0);
long max = flip(array[0]);
for (int i = 1; i < array.length; i++) {
long next = flip(array[i]);
if (next > max) {
max = next;
}
}
return flip(max);
} | Returns the greatest value present in {@code array}, treating values as unsigned.
@param array a <i>nonempty</i> array of unsigned {@code long} values
@return the value present in {@code array} that is greater than or equal to every other value
in the array according to {@link #compare}
@throws IllegalArgumentExcep... | java | android/guava/src/com/google/common/primitives/UnsignedLongs.java | 110 | [] | true | 3 | 7.6 | google/guava | 51,352 | javadoc | false | |
initialize_config | def initialize_config() -> AirflowConfigParser:
"""
Load the Airflow config files.
Called for you automatically as part of the Airflow boot process.
"""
airflow_config_parser = AirflowConfigParser()
if airflow_config_parser.getboolean("core", "unit_test_mode"):
airflow_config_parser.loa... | Load the Airflow config files.
Called for you automatically as part of the Airflow boot process. | python | airflow-core/src/airflow/configuration.py | 789 | [] | AirflowConfigParser | true | 4 | 7.2 | apache/airflow | 43,597 | unknown | false |
record | public void record(double value, long timeMs) {
if (shouldRecord()) {
recordInternal(value, timeMs, true);
}
} | Record a value at a known time. This method is slightly faster than {@link #record(double)} since it will reuse
the time stamp.
@param value The value we are recording
@param timeMs The current POSIX time in milliseconds
@throws QuotaViolationException if recording this value moves a metric beyond its configured maximu... | java | clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java | 209 | [
"value",
"timeMs"
] | void | true | 2 | 6.56 | apache/kafka | 31,560 | javadoc | false |
getAccessibleMethodFromInterfaceNest | private static Method getAccessibleMethodFromInterfaceNest(Class<?> cls, final String methodName, final Class<?>... parameterTypes) {
// Search up the superclass chain
for (; cls != null; cls = cls.getSuperclass()) {
// Check the implemented interfaces of the parent class
final C... | Gets an accessible method (that is, one that can be invoked via
reflection) that implements the specified method, by scanning through
all implemented interfaces and subinterfaces. If no such method
can be found, return {@code null}.
<p>
There isn't any good reason why this method must be {@code private}.
It is because ... | java | src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | 167 | [
"cls",
"methodName"
] | Method | true | 5 | 8.24 | apache/commons-lang | 2,896 | javadoc | false |
bindEach | function bindEach(nodes: NodeArray<Node> | undefined, bindFunction: (node: Node) => void = bind): void {
if (nodes === undefined) {
return;
}
forEach(nodes, bindFunction);
} | Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names.
@param symbolTable - The symbol table which node will be added to.
@param parent - node's parent declaration.
@param node - The declaration to be added to the symbol table
@param includes - The SymbolFlags that n... | typescript | src/compiler/binder.ts | 1,083 | [
"nodes",
"bindFunction"
] | true | 2 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
compareIgnoreCase | public static int compareIgnoreCase(final String str1, final String str2, final boolean nullIsLess) {
if (str1 == str2) { // NOSONARLINT this intentionally uses == to allow for both null
return 0;
}
if (str1 == null) {
return nullIsLess ? -1 : 1;
}
if (str... | Compares two Strings lexicographically, ignoring case differences, as per {@link String#compareToIgnoreCase(String)}, returning :
<ul>
<li>{@code int = 0}, if {@code str1} is equal to {@code str2} (or both {@code null})</li>
<li>{@code int < 0}, if {@code str1} is less than {@code str2}</li>
<li>{@code int > 0}, if {@c... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 954 | [
"str1",
"str2",
"nullIsLess"
] | true | 6 | 7.76 | apache/commons-lang | 2,896 | javadoc | false | |
describeStreamsGroups | default DescribeStreamsGroupsResult describeStreamsGroups(Collection<String> groupIds) {
return describeStreamsGroups(groupIds, new DescribeStreamsGroupsOptions());
} | Describe streams groups in the cluster, with the default options.
<p>
This is a convenience method for {@link #describeStreamsGroups(Collection, DescribeStreamsGroupsOptions)}
with default options. See the overload for more details.
@param groupIds The IDs of the groups to describe.
@return The DescribeStreamsGroupsRes... | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 2,056 | [
"groupIds"
] | DescribeStreamsGroupsResult | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
get_used_airflow_sources | def get_used_airflow_sources() -> Path:
"""
Retrieves the Root of used Airflow Sources which we operate on. Those are either Airflow sources found
upwards in directory tree or sources where Breeze was installed from.
:return: the Path for Airflow sources we use.
"""
current_sources = search_upwa... | Retrieves the Root of used Airflow Sources which we operate on. Those are either Airflow sources found
upwards in directory tree or sources where Breeze was installed from.
:return: the Path for Airflow sources we use. | python | dev/breeze/src/airflow_breeze/utils/path_utils.py | 169 | [] | Path | true | 3 | 8.24 | apache/airflow | 43,597 | unknown | false |
_precompute_node_output_sets | def _precompute_node_output_sets(
snodes: list[BaseSchedulerNode],
) -> dict[BaseSchedulerNode, OrderedSet[str]]:
"""
Pre-compute output name sets for all nodes.
This optimization avoids creating OrderedSet objects repeatedly during
exposed time calculations.
Returns:
dict mapping each... | Pre-compute output name sets for all nodes.
This optimization avoids creating OrderedSet objects repeatedly during
exposed time calculations.
Returns:
dict mapping each node to a set of its output names | python | torch/_inductor/comms.py | 412 | [
"snodes"
] | dict[BaseSchedulerNode, OrderedSet[str]] | true | 1 | 6.56 | pytorch/pytorch | 96,034 | unknown | false |
format_array | def format_array(
values: ArrayLike,
formatter: Callable | None,
float_format: FloatFormatType | None = None,
na_rep: str = "NaN",
digits: int | None = None,
space: str | int | None = None,
justify: str = "right",
decimal: str = ".",
leading_space: bool | None = True,
quoting: in... | Format an array for printing.
Parameters
----------
values : np.ndarray or ExtensionArray
formatter
float_format
na_rep
digits
space
justify
decimal
leading_space : bool, optional, default True
Whether the array should be formatted with a leading space.
When an array as a column of a Series or DataFrame, we do... | python | pandas/io/formats/format.py | 1,090 | [
"values",
"formatter",
"float_format",
"na_rep",
"digits",
"space",
"justify",
"decimal",
"leading_space",
"quoting",
"fallback_formatter"
] | list[str] | true | 11 | 6.64 | pandas-dev/pandas | 47,362 | numpy | false |
callAs | <T> T callAs(Subject subject, Callable<T> action) throws CompletionException; | Executes a {@code Callable} with {@code subject} as the
current subject.
@param subject the {@code Subject} that the specified {@code action}
will run as. This parameter may be {@code null}.
@param action the code to be run with {@code subject} as its current
subject. Must not be {@code nu... | java | clients/src/main/java/org/apache/kafka/common/internals/SecurityManagerCompatibility.java | 101 | [
"subject",
"action"
] | T | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false |
take_nd | def take_nd(
self,
indexer: npt.NDArray[np.intp],
axis: AxisInt,
new_mgr_locs: BlockPlacement | None = None,
fill_value=lib.no_default,
) -> Block:
"""
Take values according to indexer and return them as a block.
"""
values = self.values
... | Take values according to indexer and return them as a block. | python | pandas/core/internals/blocks.py | 996 | [
"self",
"indexer",
"axis",
"new_mgr_locs",
"fill_value"
] | Block | true | 9 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
fuzz_scalar | def fuzz_scalar(spec, seed: int | None = None) -> float | int | bool | complex:
"""
Create a Python scalar value from a ScalarSpec.
Args:
spec: ScalarSpec containing the desired dtype and optionally a constant value
seed: Random seed for reproducibility. If None, uses current random state.
... | Create a Python scalar value from a ScalarSpec.
Args:
spec: ScalarSpec containing the desired dtype and optionally a constant value
seed: Random seed for reproducibility. If None, uses current random state.
Returns:
Python scalar (float, int, bool, complex) matching the dtype | python | tools/experimental/torchfuzz/tensor_fuzzer.py | 495 | [
"spec",
"seed"
] | float | int | bool | complex | true | 16 | 6.8 | pytorch/pytorch | 96,034 | google | false |
shouldBlock | boolean shouldBlock(); | Return whether the caller is still awaiting an IO event.
@return true if so, false otherwise. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java | 646 | [] | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false | |
getAcknowledgementBatches | public List<AcknowledgementBatch> getAcknowledgementBatches() {
List<AcknowledgementBatch> batches = new ArrayList<>();
if (acknowledgements.isEmpty())
return batches;
AcknowledgementBatch currentBatch = null;
for (Map.Entry<Long, AcknowledgeType> entry : acknowledgements.en... | Converts the acknowledgements into a list of {@link AcknowledgementBatch} which can easily
be converted into the form required for the RPC requests. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/Acknowledgements.java | 177 | [] | true | 5 | 6.56 | apache/kafka | 31,560 | javadoc | false | |
hoursFrac | public double hoursFrac() {
return ((double) nanos()) / C5;
} | @return the number of {@link #timeUnit()} units this value contains | java | libs/core/src/main/java/org/elasticsearch/core/TimeValue.java | 202 | [] | true | 1 | 6 | elastic/elasticsearch | 75,680 | javadoc | false | |
join | public static String join(final boolean[] array, final char delimiter) {
if (array == null) {
return null;
}
return join(array, delimiter, 0, array.length);
} | Joins the elements of the provided array into a single String containing the provided list of elements.
<p>
No delimiter is added before or after the list. Null objects or empty strings within the array are represented by empty strings.
</p>
<pre>
StringUtils.join(null, *) = null
StringUtils.join([], *) ... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 3,821 | [
"array",
"delimiter"
] | String | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
_load_into_existing_table | def _load_into_existing_table(self) -> str:
"""
Import S3 key or keys in an existing DynamoDB table.
:return:The Amazon resource number (ARN)
"""
if not self.wait_for_completion:
raise ValueError("wait_for_completion must be set to True when loading into an existing ... | Import S3 key or keys in an existing DynamoDB table.
:return:The Amazon resource number (ARN) | python | providers/amazon/src/airflow/providers/amazon/aws/transfers/s3_to_dynamodb.py | 207 | [
"self"
] | str | true | 3 | 6.56 | apache/airflow | 43,597 | unknown | false |
compare | @InlineMe(replacement = "Character.compare(a, b)")
public static int compare(char a, char b) {
return Character.compare(a, b);
} | Compares the two specified {@code char} values. The sign of the value returned is the same as
that of {@code ((Character) a).compareTo(b)}.
<p><b>Note:</b> this method is now unnecessary and should be treated as deprecated; use the
equivalent {@link Character#compare} method instead.
@param a the first {@code char} to ... | java | android/guava/src/com/google/common/primitives/Chars.java | 121 | [
"a",
"b"
] | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false | |
_lock_backfills | def _lock_backfills(self, dag_runs: Collection[DagRun], session: Session) -> dict[int, Backfill]:
"""
Lock Backfill rows to prevent race conditions when multiple schedulers run concurrently.
:param dag_runs: Collection of Dag runs to process
:param session: DB session
:return: D... | Lock Backfill rows to prevent race conditions when multiple schedulers run concurrently.
:param dag_runs: Collection of Dag runs to process
:param session: DB session
:return: Dict mapping backfill_id to locked Backfill objects | python | airflow-core/src/airflow/jobs/scheduler_job_runner.py | 1,965 | [
"self",
"dag_runs",
"session"
] | dict[int, Backfill] | true | 3 | 7.76 | apache/airflow | 43,597 | sphinx | false |
resolvePathsConfig | function resolvePathsConfig(options: TsConfig, cwd: string) {
if (options?.compilerOptions?.paths) {
const paths = Object.entries(options.compilerOptions.paths)
const resolvedPaths = paths.map(([key, paths]) => {
return [key, paths.map((v) => path.resolve(cwd, v))] as const
})
return Object.fr... | Recursive function to resolve the paths config from a tsconfig.json, whether
it is in the config directly or via an inherited config (via "extends").
@param options
@param cwd
@returns | typescript | helpers/compile/plugins/resolvePathsPlugin.ts | 18 | [
"options",
"cwd"
] | false | 3 | 7.28 | prisma/prisma | 44,834 | jsdoc | false | |
is_non_overlapping_monotonic | def is_non_overlapping_monotonic(self) -> bool:
"""
Return a boolean whether the IntervalArray/IntervalIndex\
is non-overlapping and monotonic.
Non-overlapping means (no Intervals share points), and monotonic means
either monotonic increasing or monotonic decreasing.
Se... | Return a boolean whether the IntervalArray/IntervalIndex\
is non-overlapping and monotonic.
Non-overlapping means (no Intervals share points), and monotonic means
either monotonic increasing or monotonic decreasing.
See Also
--------
overlaps : Check if two IntervalIndex objects overlap.
Examples
--------
For arrays... | python | pandas/core/arrays/interval.py | 1,709 | [
"self"
] | bool | true | 4 | 7.76 | pandas-dev/pandas | 47,362 | unknown | false |
make_mask_none | def make_mask_none(newshape, dtype=None):
"""
Return a boolean mask of the given shape, filled with False.
This function returns a boolean ndarray with all entries False, that can
be used in common mask manipulations. If a complex dtype is specified, the
type of each field is converted to a boolean... | Return a boolean mask of the given shape, filled with False.
This function returns a boolean ndarray with all entries False, that can
be used in common mask manipulations. If a complex dtype is specified, the
type of each field is converted to a boolean type.
Parameters
----------
newshape : tuple
A tuple indicat... | python | numpy/ma/core.py | 1,687 | [
"newshape",
"dtype"
] | false | 3 | 7.68 | numpy/numpy | 31,054 | numpy | false | |
shouldBeMerged | private boolean shouldBeMerged(ItemMetadata itemMetadata) {
String sourceType = itemMetadata.getType();
return (sourceType != null && !deletedInCurrentBuild(sourceType) &&
!processedInCurrentBuild(sourceType));
} | Create a new {@code MetadataProcessor} instance.
@param processingEnvironment the processing environment of the build
@param previousMetadata any previous metadata or {@code null} | java | spring-context-indexer/src/main/java/org/springframework/context/index/processor/MetadataCollector.java | 94 | [
"itemMetadata"
] | true | 3 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false | |
visitExpressionOfSpread | function visitExpressionOfSpread(node: Expression): SpreadSegment {
Debug.assertNode(node, isSpreadElement);
let expression = visitNode(node.expression, visitor, isExpression);
Debug.assert(expression);
// We don't need to pack already packed array literals, or existing calls to th... | Transforms an array of Expression nodes that contains a SpreadExpression.
@param elements The array of Expression nodes.
@param isArgumentList A value indicating whether to ensure that the result is a fresh array.
This should be `false` when spreading into an `ArrayLiteral`, and `true` when spreading into an
argum... | typescript | src/compiler/transformers/es2015.ts | 4,716 | [
"node"
] | true | 7 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
tags | private static <T> Map<String, String> tags(String key, T instance) {
Map<String, String> tags = new LinkedHashMap<>();
tags.put("config", key);
tags.put("class", instance.getClass().getSimpleName());
return tags;
} | Wrap an instance into a Plugin.
@param instance the instance to wrap
@param metrics the metrics
@param name extra tag name to add
@param value extra tag value to add
@param key the value for the <code>config</code> tag
@return the plugin | java | clients/src/main/java/org/apache/kafka/common/internals/Plugin.java | 95 | [
"key",
"instance"
] | true | 1 | 7.04 | apache/kafka | 31,560 | javadoc | false | |
appendFullDigits | private static void appendFullDigits(final Appendable buffer, int value, int minFieldWidth) throws IOException {
// specialized paths for 1 to 4 digits -> avoid the memory allocation from the temporary work array
// see LANG-1248
if (value < 10000) {
// less memory allocation path wo... | Appends all digits to the given buffer.
@param buffer the buffer to append to.
@param value the value to append digits from.
@param minFieldWidth Minimum field width.
@throws IOException If an I/O error occurs. | java | src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java | 927 | [
"buffer",
"value",
"minFieldWidth"
] | void | true | 11 | 6.96 | apache/commons-lang | 2,896 | javadoc | false |
declareObjectArrayOrNull | @Override
public <T> void declareObjectArrayOrNull(
BiConsumer<Value, List<T>> consumer,
ContextParser<Context, T> objectParser,
ParseField field
) {
declareField(
consumer,
(p, c) -> p.currentToken() == XContentParser.Token.VALUE_NULL ? null : parseArray(... | Declare a field that is an array of objects or null. Used to avoid calling the consumer when used with
{@link #optionalConstructorArg()} or {@link #constructorArg()}.
@param consumer Consumer that will be passed as is to the {@link #declareField(BiConsumer, ContextParser, ParseField, ValueType)}.
@param objectParser Pa... | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/ConstructingObjectParser.java | 230 | [
"consumer",
"objectParser",
"field"
] | void | true | 2 | 6.72 | elastic/elasticsearch | 75,680 | javadoc | false |
max_error | def max_error(y_true, y_pred):
"""
The max_error metric calculates the maximum residual error.
Read more in the :ref:`User Guide <max_error>`.
Parameters
----------
y_true : array-like of shape (n_samples,)
Ground truth (correct) target values.
y_pred : array-like of shape (n_samp... | The max_error metric calculates the maximum residual error.
Read more in the :ref:`User Guide <max_error>`.
Parameters
----------
y_true : array-like of shape (n_samples,)
Ground truth (correct) target values.
y_pred : array-like of shape (n_samples,)
Estimated target values.
Returns
-------
max_error : flo... | python | sklearn/metrics/_regression.py | 1,321 | [
"y_true",
"y_pred"
] | false | 2 | 7.52 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
parseContextualModifier | function parseContextualModifier(t: SyntaxKind): boolean {
return token() === t && tryParse(nextTokenCanFollowModifier);
} | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 2,754 | [
"t"
] | true | 2 | 6.64 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getFirstLookupIndex | private int getFirstLookupIndex(int nameHash) {
int lookupIndex = Arrays.binarySearch(this.nameHashLookups, 0, this.nameHashLookups.length, nameHash);
if (lookupIndex < 0) {
return -1;
}
while (lookupIndex > 0 && this.nameHashLookups[lookupIndex - 1] == nameHash) {
lookupIndex--;
}
return lookupIndex;... | Return the entry at the specified index.
@param index the entry index
@return the entry
@throws IndexOutOfBoundsException if the index is out of bounds | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipContent.java | 278 | [
"nameHash"
] | true | 4 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false | |
chebgauss | def chebgauss(deg):
"""
Gauss-Chebyshev quadrature.
Computes the sample points and weights for Gauss-Chebyshev quadrature.
These sample points and weights will correctly integrate polynomials of
degree :math:`2*deg - 1` or less over the interval :math:`[-1, 1]` with
the weight function :math:`f... | Gauss-Chebyshev quadrature.
Computes the sample points and weights for Gauss-Chebyshev quadrature.
These sample points and weights will correctly integrate polynomials of
degree :math:`2*deg - 1` or less over the interval :math:`[-1, 1]` with
the weight function :math:`f(x) = 1/\\sqrt{1 - x^2}`.
Parameters
----------... | python | numpy/polynomial/chebyshev.py | 1,791 | [
"deg"
] | false | 2 | 6.08 | numpy/numpy | 31,054 | numpy | false | |
_discover_hooks_from_hook_class_names | def _discover_hooks_from_hook_class_names(
self,
hook_class_names_registered: set[str],
already_registered_warning_connection_types: set[str],
package_name: str,
provider: ProviderInfo,
provider_uses_connection_types: bool,
):
"""
Discover hooks from "... | Discover hooks from "hook-class-names' property.
This property is deprecated but we should support it in Airflow 2.
The hook-class-names array contained just Hook names without connection type,
therefore we need to import all those classes immediately to know which connection types
are supported. This makes it impossi... | python | airflow-core/src/airflow/providers_manager.py | 667 | [
"self",
"hook_class_names_registered",
"already_registered_warning_connection_types",
"package_name",
"provider",
"provider_uses_connection_types"
] | true | 12 | 7.52 | apache/airflow | 43,597 | sphinx | false | |
copyto | def copyto(dst, src, casting="same_kind", where=True):
"""
copyto(dst, src, casting='same_kind', where=True)
Copies values from one array to another, broadcasting as necessary.
Raises a TypeError if the `casting` rule is violated, and if
`where` is provided, it selects which elements to copy.
... | copyto(dst, src, casting='same_kind', where=True)
Copies values from one array to another, broadcasting as necessary.
Raises a TypeError if the `casting` rule is violated, and if
`where` is provided, it selects which elements to copy.
Parameters
----------
dst : ndarray
The array into which values are copied.
sr... | python | numpy/_core/multiarray.py | 1,086 | [
"dst",
"src",
"casting",
"where"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
withOrigin | ConfigDataLocation withOrigin(@Nullable Origin origin) {
return new ConfigDataLocation(this.optional, this.value, origin);
} | Create a new {@link ConfigDataLocation} with a specific {@link Origin}.
@param origin the origin to set
@return a new {@link ConfigDataLocation} instance. | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocation.java | 136 | [
"origin"
] | ConfigDataLocation | true | 1 | 6 | spring-projects/spring-boot | 79,428 | javadoc | false |
broadcast_to | def broadcast_to(array, shape, subok=False):
"""Broadcast an array to a new shape.
Parameters
----------
array : array_like
The array to broadcast.
shape : tuple or int
The shape of the desired array. A single integer ``i`` is interpreted
as ``(i,)``.
subok : bool, optio... | Broadcast an array to a new shape.
Parameters
----------
array : array_like
The array to broadcast.
shape : tuple or int
The shape of the desired array. A single integer ``i`` is interpreted
as ``(i,)``.
subok : bool, optional
If True, then sub-classes will be passed-through, otherwise
the returned... | python | numpy/lib/_stride_tricks_impl.py | 401 | [
"array",
"shape",
"subok"
] | false | 1 | 6.32 | numpy/numpy | 31,054 | numpy | false | |
forBooleanValues | public static Frequencies forBooleanValues(MetricName falseMetricName, MetricName trueMetricName) {
List<Frequency> frequencies = new ArrayList<>();
if (falseMetricName != null) {
frequencies.add(new Frequency(falseMetricName, 0.0));
}
if (trueMetricName != null) {
... | Create a Frequencies instance with metrics for the frequency of a boolean sensor that records 0.0 for
false and 1.0 for true.
@param falseMetricName the name of the metric capturing the frequency of failures; may be null if not needed
@param trueMetricName the name of the metric capturing the frequency of successes; m... | java | clients/src/main/java/org/apache/kafka/common/metrics/stats/Frequencies.java | 54 | [
"falseMetricName",
"trueMetricName"
] | Frequencies | true | 4 | 7.92 | apache/kafka | 31,560 | javadoc | false |
create_diagonal | def create_diagonal(
x: Array, /, *, offset: int = 0, xp: ModuleType | None = None
) -> Array:
"""
Construct a diagonal array.
Parameters
----------
x : array
An array having shape ``(*batch_dims, k)``.
offset : int, optional
Offset from the leading diagonal (default is ``0`... | Construct a diagonal array.
Parameters
----------
x : array
An array having shape ``(*batch_dims, k)``.
offset : int, optional
Offset from the leading diagonal (default is ``0``).
Use positive ints for diagonals above the leading diagonal,
and negative ints for diagonals below the leading diagonal.
xp ... | python | sklearn/externals/array_api_extra/_lib/_funcs.py | 395 | [
"x",
"offset",
"xp"
] | Array | true | 5 | 8.24 | scikit-learn/scikit-learn | 64,340 | numpy | false |
sqrt | def sqrt(x):
"""
Compute the square root of x.
For negative input elements, a complex value is returned
(unlike `numpy.sqrt` which returns NaN).
Parameters
----------
x : array_like
The input value(s).
Returns
-------
out : ndarray or scalar
The square root of `x... | Compute the square root of x.
For negative input elements, a complex value is returned
(unlike `numpy.sqrt` which returns NaN).
Parameters
----------
x : array_like
The input value(s).
Returns
-------
out : ndarray or scalar
The square root of `x`. If `x` was a scalar, so is `out`,
otherwise an array is ret... | python | numpy/lib/_scimath_impl.py | 187 | [
"x"
] | false | 1 | 6 | numpy/numpy | 31,054 | numpy | false | |
init_X86_64Bit | private static void init_X86_64Bit() {
addProcessors(new Processor(Processor.Arch.BIT_64, Processor.Type.X86), "x86_64", "amd64", "em64t", "universal");
} | Gets a {@link Processor} object the given value {@link String}. The {@link String} must be like a value returned by the {@code "os.arch"} system
property.
@param value A {@link String} like a value returned by the {@code os.arch} System Property.
@return A {@link Processor} when it exists, else {@code null}. | java | src/main/java/org/apache/commons/lang3/ArchUtils.java | 135 | [] | void | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false |
collect | def collect(self, intermediate=False, **kwargs):
"""Collect results as they return.
Iterator, like :meth:`get` will wait for the task to complete,
but will also follow :class:`AsyncResult` and :class:`ResultSet`
returned by the task, yielding ``(result, value)`` tuples for each
... | Collect results as they return.
Iterator, like :meth:`get` will wait for the task to complete,
but will also follow :class:`AsyncResult` and :class:`ResultSet`
returned by the task, yielding ``(result, value)`` tuples for each
result in the tree.
An example would be having the following tasks:
.. code-block:: python... | python | celery/result.py | 274 | [
"self",
"intermediate"
] | false | 2 | 7.52 | celery/celery | 27,741 | unknown | false | |
toHumanReadableString | public String toHumanReadableString(int fractionPieces) {
if (duration < 0) {
return Long.toString(duration);
}
long nanos = nanos();
if (nanos == 0) {
return "0s";
}
double value = nanos;
String suffix = "nanos";
if (nanos >= C6) {... | Returns a {@link String} representation of the current {@link TimeValue}.
Note that this method might produce fractional time values (ex 1.6m) which cannot be
parsed by method like {@link TimeValue#parse(String, String, String, String)}. The number of
fractional decimals (up to 10 maximum) are truncated to the number o... | java | libs/core/src/main/java/org/elasticsearch/core/TimeValue.java | 247 | [
"fractionPieces"
] | String | true | 9 | 6.88 | elastic/elasticsearch | 75,680 | javadoc | false |
addAdvisors | public void addAdvisors(Collection<Advisor> advisors) {
if (isFrozen()) {
throw new AopConfigException("Cannot add advisor: Configuration is frozen.");
}
if (!CollectionUtils.isEmpty(advisors)) {
for (Advisor advisor : advisors) {
if (advisor instanceof IntroductionAdvisor introductionAdvisor) {
va... | Add all the given advisors to this proxy configuration.
@param advisors the advisors to register | java | spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java | 379 | [
"advisors"
] | void | true | 4 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
slice_indexer | def slice_indexer(
self,
start: Hashable | None = None,
end: Hashable | None = None,
step: int | None = None,
) -> slice:
"""
Compute the slice indexer for input labels and step.
Index needs to be ordered and unique.
Parameters
----------
... | Compute the slice indexer for input labels and step.
Index needs to be ordered and unique.
Parameters
----------
start : label, default None
If None, defaults to the beginning.
end : label, default None
If None, defaults to the end.
step : int, default None
If None, defaults to 1.
Returns
-------
slice
... | python | pandas/core/indexes/base.py | 6,662 | [
"self",
"start",
"end",
"step"
] | slice | true | 3 | 8.64 | pandas-dev/pandas | 47,362 | numpy | false |
buildRoundings | static RoundingInfo[] buildRoundings(ZoneId timeZone, String minimumInterval) {
int indexToSliceFrom = 0;
RoundingInfo[] roundings = new RoundingInfo[6];
roundings[0] = new RoundingInfo(Rounding.DateTimeUnit.SECOND_OF_MINUTE, timeZone, 1000L, "s", 1, 5, 10, 30);
roundings[1] = new Roun... | Build roundings, computed dynamically as roundings are time zone dependent.
The current implementation probably should not be invoked in a tight loop.
@return Array of RoundingInfo | java | modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/AutoDateHistogramAggregationBuilder.java | 80 | [
"timeZone",
"minimumInterval"
] | true | 3 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false | |
destroyScopedBean | @Override
public void destroyScopedBean(String beanName) {
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
if (mbd.isSingleton() || mbd.isPrototype()) {
throw new IllegalArgumentException(
"Bean name '" + beanName + "' does not correspond to an object in a mutable scope");
}
String sco... | Destroy the given bean instance (usually a prototype instance
obtained from this factory) according to the given bean definition.
@param beanName the name of the bean definition
@param bean the bean instance to destroy
@param mbd the merged bean definition | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | 1,242 | [
"beanName"
] | void | true | 5 | 6.56 | spring-projects/spring-framework | 59,386 | javadoc | false |
convertNamedExport | function convertNamedExport(
sourceFile: SourceFile,
assignment: BinaryExpression & { left: PropertyAccessExpression; },
changes: textChanges.ChangeTracker,
exports: ExportRenames,
): void {
// If "originalKeywordKind" was set, this is e.g. `exports.
const { text } = assignment.left.name;... | Convert `module.exports = { ... }` to individual exports..
We can't always do this if the module has interesting members -- then it will be a default export instead. | typescript | src/services/codefixes/convertToEsModule.ts | 370 | [
"sourceFile",
"assignment",
"changes",
"exports"
] | true | 3 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
defaultTo | function defaultTo(value, defaultValue) {
return (value == null || value !== value) ? defaultValue : value;
} | Checks `value` to determine whether a default value should be returned in
its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
or `undefined`.
@static
@memberOf _
@since 4.14.0
@category Util
@param {*} value The value to check.
@param {*} defaultValue The default value.
@returns {*} Returns the resol... | javascript | lodash.js | 15,529 | [
"value",
"defaultValue"
] | false | 3 | 7.44 | lodash/lodash | 61,490 | jsdoc | false | |
toArray | private static String @Nullable [] toArray(@Nullable Collection<String> collection) {
return (collection != null) ? collection.toArray(String[]::new) : null;
} | Helper method that provides a null-safe way to convert a {@code String[]} to a
{@link Collection} for client libraries to use.
@param array the array to convert
@return a collection or {@code null} | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/SslOptions.java | 119 | [
"collection"
] | true | 2 | 8.16 | spring-projects/spring-boot | 79,428 | javadoc | false | |
toString | @Override
public String toString() {
return CodeWarnings.class.getSimpleName() + this.warnings;
} | Return the currently registered warnings.
@return the warnings | java | spring-beans/src/main/java/org/springframework/beans/factory/aot/CodeWarnings.java | 172 | [] | String | true | 1 | 6.32 | spring-projects/spring-framework | 59,386 | javadoc | false |
getAttribute | @Override
public @Nullable Object getAttribute(String name) {
BeanMetadataAttribute attribute = (BeanMetadataAttribute) super.getAttribute(name);
return (attribute != null ? attribute.getValue() : null);
} | Look up the given BeanMetadataAttribute in this accessor's set of attributes.
@param name the name of the attribute
@return the corresponding BeanMetadataAttribute object,
or {@code null} if no such attribute defined | java | spring-beans/src/main/java/org/springframework/beans/BeanMetadataAttributeAccessor.java | 74 | [
"name"
] | Object | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
split | public void split() {
if (runningState != State.RUNNING) {
throw new IllegalStateException("Stopwatch is not running.");
}
stopTimeNanos = System.nanoTime();
splitState = SplitState.SPLIT;
splits.add(new Split(String.valueOf(splits.size()), Duration.ofNanos(stopTimeNa... | Splits the time.
<p>
This method sets the stop time of the watch to allow a time to be extracted. The start time is unaffected, enabling {@link #unsplit()} to continue the
timing from the original start point.
</p>
@throws IllegalStateException if this StopWatch is not running. | java | src/main/java/org/apache/commons/lang3/time/StopWatch.java | 687 | [] | void | true | 2 | 6.88 | apache/commons-lang | 2,896 | javadoc | false |
createConfiguration | public Configuration createConfiguration() throws IOException, TemplateException {
Configuration config = newConfiguration();
Properties props = new Properties();
// Load config file if specified.
if (this.configLocation != null) {
if (logger.isDebugEnabled()) {
logger.debug("Loading FreeMarker configur... | Prepare the FreeMarker {@link Configuration} and return it.
@return the FreeMarker {@code Configuration} object
@throws IOException if the config file wasn't found
@throws TemplateException on FreeMarker initialization failure | java | spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java | 279 | [] | Configuration | true | 11 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
refreshBeanFactory | @Override
protected final void refreshBeanFactory() throws BeansException {
if (hasBeanFactory()) {
destroyBeans();
closeBeanFactory();
}
try {
DefaultListableBeanFactory beanFactory = createBeanFactory();
beanFactory.setSerializationId(getId());
beanFactory.setApplicationStartup(getApplicationSta... | This implementation performs an actual refresh of this context's underlying
bean factory, shutting down the previous bean factory (if any) and
initializing a fresh bean factory for the next phase of the context's lifecycle. | java | spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java | 118 | [] | void | true | 3 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
startupTimes | public ImmutableMap<Service, Long> startupTimes() {
return state.startupTimes();
} | Returns the service load times. This value will only return startup times for services that
have finished starting.
@return Map of services and their corresponding startup time in millis, the map entries will be
ordered by startup time. | java | android/guava/src/com/google/common/util/concurrent/ServiceManager.java | 421 | [] | true | 1 | 6.8 | google/guava | 51,352 | javadoc | false | |
parseList | function parseList<T extends Node>(kind: ParsingContext, parseElement: () => T): NodeArray<T> {
const saveParsingContext = parsingContext;
parsingContext |= 1 << kind;
const list = [];
const listPos = getNodePos();
while (!isListTerminator(kind)) {
if (isListE... | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 3,094 | [
"kind",
"parseElement"
] | true | 4 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
check_grad_usage | def check_grad_usage(defn_name: str, derivatives: Sequence[Derivative]) -> None:
"""
Check for some subtle mistakes one might make when writing derivatives.
These mistakes will compile, but will be latent until a function is
used with double backwards.
"""
uses_grad = Fa... | Check for some subtle mistakes one might make when writing derivatives.
These mistakes will compile, but will be latent until a function is
used with double backwards. | python | tools/autograd/load_derivatives.py | 478 | [
"defn_name",
"derivatives"
] | None | true | 11 | 6 | pytorch/pytorch | 96,034 | unknown | false |
union | public ComposablePointcut union(MethodMatcher other) {
this.methodMatcher = MethodMatchers.union(this.methodMatcher, other);
return this;
} | Apply a union with the given MethodMatcher.
@param other the MethodMatcher to apply a union with
@return this composable pointcut (for call chaining) | java | spring-aop/src/main/java/org/springframework/aop/support/ComposablePointcut.java | 136 | [
"other"
] | ComposablePointcut | true | 1 | 6.48 | spring-projects/spring-framework | 59,386 | javadoc | false |
build | public <T extends SimpleAsyncTaskExecutor> T build(Class<T> taskExecutorClass) {
return configure(BeanUtils.instantiateClass(taskExecutorClass));
} | Build a new {@link SimpleAsyncTaskExecutor} instance of the specified type and
configure it using this builder.
@param <T> the type of task executor
@param taskExecutorClass the template type to create
@return a configured {@link SimpleAsyncTaskExecutor} instance.
@see #build()
@see #configure(SimpleAsyncTaskExecutor) | java | core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskExecutorBuilder.java | 254 | [
"taskExecutorClass"
] | T | true | 1 | 6 | spring-projects/spring-boot | 79,428 | javadoc | false |
append | private void append(char ch) {
try {
this.out.append(ch);
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
} | Write the specified pairs to an already started {@link Series#OBJECT object
series}.
@param <N> the name type in the pair
@param <V> the value type in the pair
@param pairs a callback that will be used to provide each pair. Typically a
{@code forEach} method reference.
@see #writePairs(Consumer) | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonValueWriter.java | 305 | [
"ch"
] | void | true | 2 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
_fit | def _fit(self, X, y=None, precomputed=False):
"""Fit the transformer on `X`.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number of features.
... | Fit the transformer on `X`.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number of features.
If `precomputed=True`, then `X` is a mask of the input data.
precomputed : bool
Whether ... | python | sklearn/impute/_base.py | 976 | [
"self",
"X",
"y",
"precomputed"
] | false | 7 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
getIndentationStringAtPosition | function getIndentationStringAtPosition(sourceFile: SourceFile, position: number): string {
const { text } = sourceFile;
const lineStart = getLineStartPositionForPosition(position, sourceFile);
let pos = lineStart;
for (; pos <= position && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++);
... | Checks if position points to a valid position to add JSDoc comments, and if so,
returns the appropriate template. Otherwise returns an empty string.
Valid positions are
- outside of comments, statements, and expressions, and
- preceding a:
- function/constructor/method declaration
- cl... | typescript | src/services/jsDoc.ts | 533 | [
"sourceFile",
"position"
] | true | 3 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
bind | public <T> BindResult<T> bind(String name, Bindable<T> target) {
return bind(ConfigurationPropertyName.of(name), target, null);
} | Bind the specified target {@link Bindable} using this binder's
{@link ConfigurationPropertySource property sources}.
@param name the configuration property name to bind
@param target the target bindable
@param <T> the bound type
@return the binding result (never {@code null})
@see #bind(ConfigurationPropertyName, Binda... | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java | 247 | [
"name",
"target"
] | true | 1 | 6 | spring-projects/spring-boot | 79,428 | javadoc | false | |
inferred_type | def inferred_type(self) -> str_t:
"""
Return a string of the type inferred from the values.
See Also
--------
Index.dtype : Return the dtype object of the underlying data.
Examples
--------
>>> idx = pd.Index([1, 2, 3])
>>> idx
Index([1, ... | Return a string of the type inferred from the values.
See Also
--------
Index.dtype : Return the dtype object of the underlying data.
Examples
--------
>>> idx = pd.Index([1, 2, 3])
>>> idx
Index([1, 2, 3], dtype='int64')
>>> idx.inferred_type
'integer' | python | pandas/core/indexes/base.py | 2,531 | [
"self"
] | str_t | true | 1 | 6.24 | pandas-dev/pandas | 47,362 | unknown | false |
negate | public static ClassFilter negate(ClassFilter classFilter) {
Assert.notNull(classFilter, "ClassFilter must not be null");
return new NegateClassFilter(classFilter);
} | Return a class filter that represents the logical negation of the specified
filter instance.
@param classFilter the {@link ClassFilter} to negate
@return a filter that represents the logical negation of the specified filter
@since 6.1 | java | spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java | 97 | [
"classFilter"
] | ClassFilter | true | 1 | 6.32 | spring-projects/spring-framework | 59,386 | javadoc | false |
parseOpenSslEC | private static PrivateKey parseOpenSslEC(BufferedReader bReader, Supplier<char[]> passwordSupplier) throws IOException,
GeneralSecurityException {
StringBuilder sb = new StringBuilder();
String line = bReader.readLine();
Map<String, String> pemHeaders = new HashMap<>();
while (li... | Creates a {@link PrivateKey} from the contents of {@code bReader} that contains an EC private key encoded in
OpenSSL traditional format.
@param bReader the {@link BufferedReader} containing the key file contents
@param passwordSupplier A password supplier for the potentially encrypted (password protected) key
... | java | libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/PemUtils.java | 263 | [
"bReader",
"passwordSupplier"
] | PrivateKey | true | 6 | 7.44 | elastic/elasticsearch | 75,680 | javadoc | false |
getResult | public static <T> T getResult(Future<T> future, long timeoutMs) {
try {
return future.get(timeoutMs, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
if (e.getCause() instanceof IllegalStateException)
throw (IllegalStateException) e.getCause();
... | Update subscription state and metadata using the provided committed offsets:
<li>Update partition offsets with the committed offsets</li>
<li>Update the metadata with any newer leader epoch discovered in the committed offsets
metadata</li>
</p>
This will ignore any partition included in the <code>offsetsAndMetadata</co... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerUtils.java | 219 | [
"future",
"timeoutMs"
] | T | true | 5 | 6.24 | apache/kafka | 31,560 | javadoc | false |
size | public int size() {
return tracked.size();
} | It is possible for the {@link AsyncKafkaConsumer#close() consumer to close} before completing the processing of
all the events in the queue. In this case, we need to
{@link CompletableFuture#completeExceptionally(Throwable) expire} any remaining events.
<p/>
Check each of the {@link #add(CompletableEvent) previously-ad... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/CompletableEventReaper.java | 155 | [] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
merge | protected abstract Configurations merge(Set<Class<?>> mergedClasses); | Merge configurations.
@param mergedClasses the merged classes
@return a new configurations instance (must be of the same type as this instance) | java | core/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java | 123 | [
"mergedClasses"
] | Configurations | true | 1 | 6.32 | spring-projects/spring-boot | 79,428 | javadoc | false |
nop | @SuppressWarnings("unchecked")
static <R, E extends Throwable> FailableIntFunction<R, E> nop() {
return NOP;
} | Gets the NOP singleton.
@param <R> Return type.
@param <E> The kind of thrown exception or error.
@return The NOP singleton. | java | src/main/java/org/apache/commons/lang3/function/FailableIntFunction.java | 43 | [] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
appendExportStatement | function appendExportStatement(statements: Statement[] | undefined, seen: IdentifierNameMap<boolean>, exportName: ModuleExportName, expression: Expression, location?: TextRange, allowComments?: boolean, liveBinding?: boolean): Statement[] | undefined {
if (exportName.kind !== SyntaxKind.StringLiteral) {
... | Appends the down-level representation of an export to a statement list, returning the
statement list.
@param statements A statement list to which the down-level export statements are to be
appended. If `statements` is `undefined`, a new array is allocated if statements are
appended.
@param exportName The name of ... | typescript | src/compiler/transformers/module/module.ts | 2,131 | [
"statements",
"seen",
"exportName",
"expression",
"location?",
"allowComments?",
"liveBinding?"
] | true | 3 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
parseObjectsInArray | private static <Value, Context, T> void parseObjectsInArray(
Consumer<Value> orderedModeCallback,
ParseField field,
BiFunction<XContentParser, Context, T> objectParser,
XContentParser p,
Value v,
Context c,
List<T> fields
) throws IOException {
ordered... | Parses a Value from the given {@link XContentParser}
@param parser the parser to build a value from
@param value the value to fill from the parser
@param context a context that is passed along to all declared field parsers
@return the parsed value
@throws IOException if an IOException occurs. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java | 519 | [
"orderedModeCallback",
"field",
"objectParser",
"p",
"v",
"c",
"fields"
] | void | true | 4 | 7.6 | elastic/elasticsearch | 75,680 | javadoc | false |
getFirstExpression | function getFirstExpression(code, startColumn) {
// Lazy load acorn.
if (tokenizer === undefined) {
const Parser = require('internal/deps/acorn/acorn/dist/acorn').Parser;
tokenizer = FunctionPrototypeBind(Parser.tokenizer, Parser);
}
let lastToken;
let firstMemberAccessNameToken;
let terminatingCol... | Get the first expression in a code string at the startColumn.
@param {string} code source code line
@param {number} startColumn which column the error is constructed
@returns {string} | javascript | lib/internal/errors/error_source.js | 70 | [
"code",
"startColumn"
] | false | 13 | 6 | nodejs/node | 114,839 | jsdoc | false | |
get_bundle | def get_bundle(self, name: str, version: str | None = None) -> BaseDagBundle:
"""
Get a DAG bundle by name.
:param name: The name of the DAG bundle.
:param version: The version of the DAG bundle you need (optional). If not provided, ``tracking_ref`` will be used instead.
:retur... | Get a DAG bundle by name.
:param name: The name of the DAG bundle.
:param version: The version of the DAG bundle you need (optional). If not provided, ``tracking_ref`` will be used instead.
:return: The DAG bundle. | python | airflow-core/src/airflow/dag_processing/bundles/manager.py | 325 | [
"self",
"name",
"version"
] | BaseDagBundle | true | 2 | 8.24 | apache/airflow | 43,597 | sphinx | false |
close | private void close() {
logger.get().log(FINER, "closing {0}", this);
closeables.close();
} | Attempts to cancel execution of this step. This attempt will fail if the step has already
completed, has already been cancelled, or could not be cancelled for some other reason. If
successful, and this step has not started when {@code cancel} is called, this step should never
run.
<p>If successful, causes the objects c... | java | android/guava/src/com/google/common/util/concurrent/ClosingFuture.java | 1,097 | [] | void | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false |
_quantile | def _quantile(self, qs: npt.NDArray[np.float64], interpolation: str) -> Self:
"""
Compute the quantiles of self for each quantile in `qs`.
Parameters
----------
qs : np.ndarray[float64]
interpolation: str
Returns
-------
same type as self
... | Compute the quantiles of self for each quantile in `qs`.
Parameters
----------
qs : np.ndarray[float64]
interpolation: str
Returns
-------
same type as self | python | pandas/core/arrays/arrow/array.py | 2,355 | [
"self",
"qs",
"interpolation"
] | Self | true | 8 | 7.2 | pandas-dev/pandas | 47,362 | numpy | false |
assertOpen | public void assertOpen(Supplier<String> message) {
if (isClosed.get())
throw new IllegalStateException(message.get());
} | This method serves as an assert that the {@link IdempotentCloser} is still open. If it is open, this method
simply returns. If it is closed, a new {@link IllegalStateException} will be thrown using the supplied message.
@param message {@link Supplier} that supplies the message for the exception | java | clients/src/main/java/org/apache/kafka/common/internals/IdempotentCloser.java | 91 | [
"message"
] | void | true | 2 | 6.64 | apache/kafka | 31,560 | javadoc | false |
loadNestedDirectory | private static ZipContent loadNestedDirectory(Source source, ZipContent zip, Entry directoryEntry)
throws IOException {
debug.log("Loading nested directory entry '%s' from '%s'", source.nestedEntryName(), source.path());
if (!source.nestedEntryName().endsWith("/")) {
throw new IllegalArgumentException("Ne... | Returns the location in the data that the archive actually starts. For most
files the archive data will start at 0, however, it is possible to have
prefixed bytes (often used for startup scripts) at the beginning of the data.
@param data the source data
@param eocd the end of central directory record
@param zip64Eocd t... | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipContent.java | 659 | [
"source",
"zip",
"directoryEntry"
] | ZipContent | true | 6 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
from | public <T> Source<T> from(Supplier<? extends @Nullable T> supplier) {
Assert.notNull(supplier, "'supplier' must not be null");
Source<T> source = getSource(supplier);
if (this.sourceOperator != null) {
source = this.sourceOperator.apply(source);
}
return source;
} | Return a new {@link Source} from the specified value supplier that can be used to
perform the mapping.
@param <T> the source type
@param supplier the value supplier
@return a {@link Source} that can be used to complete the mapping
@see #from(Object) | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java | 108 | [
"supplier"
] | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
fit | def fit(self, X, y=None):
"""Perform clustering.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Samples to cluster.
y : Ignored
Not used, present for API consistency by convention.
Returns
-------
self : ob... | Perform clustering.
Parameters
----------
X : array-like of shape (n_samples, n_features)
Samples to cluster.
y : Ignored
Not used, present for API consistency by convention.
Returns
-------
self : object
Fitted instance. | python | sklearn/cluster/_mean_shift.py | 470 | [
"self",
"X",
"y"
] | false | 12 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
getMessage | @Override
public String getMessage() {
// requireNonNull is safe because ExampleStackTrace sets a non-null message.
StringBuilder message = new StringBuilder(requireNonNull(super.getMessage()));
for (Throwable t = conflictingStackTrace; t != null; t = t.getCause()) {
message.append(", ").a... | Appends the chain of messages from the {@code conflictingStackTrace} to the original {@code
message}. | java | android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java | 550 | [] | String | true | 2 | 6.4 | google/guava | 51,352 | javadoc | false |
max | @ParametricNullness
public <E extends T> E max(Iterator<E> iterator) {
// let this throw NoSuchElementException as necessary
E maxSoFar = iterator.next();
while (iterator.hasNext()) {
maxSoFar = this.<E>max(maxSoFar, iterator.next());
}
return maxSoFar;
} | Returns the greatest of the specified values according to this ordering. If there are multiple
greatest values, the first of those is returned. The iterator will be left exhausted: its
{@code hasNext()} method will return {@code false}.
<p><b>Java 8+ users:</b> Use {@code Streams.stream(iterator).max(thisComparator).ge... | java | android/guava/src/com/google/common/collect/Ordering.java | 652 | [
"iterator"
] | E | true | 2 | 6.4 | google/guava | 51,352 | javadoc | false |
toStringYesNo | public static String toStringYesNo(final boolean bool) {
return toString(bool, YES, NO);
} | Converts a boolean to a String returning {@code 'yes'}
or {@code 'no'}.
<pre>
BooleanUtils.toStringYesNo(true) = "yes"
BooleanUtils.toStringYesNo(false) = "no"
</pre>
@param bool the Boolean to check
@return {@code 'yes'}, {@code 'no'}, or {@code null} | java | src/main/java/org/apache/commons/lang3/BooleanUtils.java | 1,122 | [
"bool"
] | String | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
format | @Override
public String format(final Date date) {
final Calendar c = newCalendar();
c.setTime(date);
return applyRulesToString(c);
} | Compares two objects for equality.
@param obj the object to compare to.
@return {@code true} if equal. | java | src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java | 1,152 | [
"date"
] | String | true | 1 | 7.04 | apache/commons-lang | 2,896 | javadoc | false |
put | public JSONArray put(double value) throws JSONException {
this.values.add(JSON.checkDouble(value));
return this;
} | Appends {@code value} to the end of this array.
@param value a finite value. May not be {@link Double#isNaN() NaNs} or
{@link Double#isInfinite() infinities}.
@return this array.
@throws JSONException if processing of json failed | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java | 145 | [
"value"
] | JSONArray | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false |
containsPreprocessorDirectives | static bool containsPreprocessorDirectives(const RecordDecl *Decl,
const SourceManager &SrcMgr,
const LangOptions &LangOpts) {
std::pair<FileID, unsigned> FileAndOffset =
SrcMgr.getDecomposedLoc(Decl->field_begin()->getBeginLo... | \returns nullptr if the name is ambiguous or not found. | cpp | clang-tools-extra/clang-reorder-fields/ReorderFieldsAction.cpp | 83 | [] | true | 7 | 7.04 | llvm/llvm-project | 36,021 | doxygen | false | |
of | public static <E extends Throwable> Duration of(final FailableConsumer<Instant, E> consumer) throws E {
return since(now(consumer::accept));
} | Runs the lambda and returns the duration of its execution.
@param <E> The type of exception throw by the lambda.
@param consumer What to execute.
@return The Duration of execution.
@throws E thrown by the lambda.
@see StopWatch
@since 3.13.0 | java | src/main/java/org/apache/commons/lang3/time/DurationUtils.java | 169 | [
"consumer"
] | Duration | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
parseOptional | function parseOptional(t: SyntaxKind): boolean {
if (token() === t) {
nextToken();
return true;
}
return false;
} | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 2,515 | [
"t"
] | true | 2 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
generate_private_key | def generate_private_key(key_type: str = "RSA", key_size: int = 2048):
"""
Generate a valid private key for testing.
Args:
key_type (str): Type of key to generate. Can be "RSA" or "Ed25516". Defaults to "RSA".
key_size (int): Size of the key in bits. Only applicable for RSA keys. Defaults t... | Generate a valid private key for testing.
Args:
key_type (str): Type of key to generate. Can be "RSA" or "Ed25516". Defaults to "RSA".
key_size (int): Size of the key in bits. Only applicable for RSA keys. Defaults to 2048.
Returns:
tuple: A tuple containing the private key in PEM format and the correspon... | python | airflow-core/src/airflow/api_fastapi/auth/tokens.py | 462 | [
"key_type",
"key_size"
] | true | 3 | 8.24 | apache/airflow | 43,597 | google | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.