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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
greatCircleMaxLatitude | public double greatCircleMaxLatitude(LatLng latLng) {
if (isNumericallyIdentical(latLng)) {
return latLng.lat;
}
return latLng.lat > this.lat ? greatCircleMaxLatitude(latLng, this) : greatCircleMaxLatitude(this, latLng);
} | Determines the maximum latitude of the great circle defined by this LatLng to the provided LatLng.
@param latLng The LatLng.
@return The maximum latitude of the great circle in radians. | java | libs/h3/src/main/java/org/elasticsearch/h3/LatLng.java | 134 | [
"latLng"
] | true | 3 | 7.92 | elastic/elasticsearch | 75,680 | javadoc | false | |
positionToLineOffset | function positionToLineOffset(info: ScriptInfoOrConfig, position: number): protocol.Location {
return isConfigFile(info) ? locationFromLineAndCharacter(info.getLineAndCharacterOfPosition(position)) : info.positionToLineOffset(position);
} | @param projects Projects initially known to contain {@link initialLocation}
@param defaultProject The default project containing {@link initialLocation}
@param initialLocation Where the search operation was triggered
@param getResultsForPosition This is where you plug in `findReferences`, `renameLocation`, etc
@par... | typescript | src/server/session.ts | 4,002 | [
"info",
"position"
] | true | 2 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getMetadataStream | private InputStream getMetadataStream(FileObject fileObject) {
try {
return fileObject.openInputStream();
}
catch (IOException ex) {
return null;
}
} | Read additional {@link ConfigurationMetadata} for the {@link TypeElement} or
{@code null}.
@param typeElement the type to get additional metadata for
@return additional metadata for the given type or {@code null} if none is present | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataStore.java | 198 | [
"fileObject"
] | InputStream | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
backingMap | Map<K, Collection<V>> backingMap() {
return map;
} | Creates the collection of values for an explicitly provided key. By default, it simply calls
{@link #createCollection()}, which is the correct behavior for most implementations. The {@link
LinkedHashMultimap} class overrides it.
@param key key to associate with values in the collection
@return an empty collection of va... | java | android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java | 169 | [] | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false | |
SettingsContextController | function SettingsContextController({
browserTheme,
children,
componentsPortalContainer,
profilerPortalContainer,
suspensePortalContainer,
}: Props): React.Node {
const bridge = useContext(BridgeContext);
const [displayDensity, setDisplayDensity] =
useLocalStorageWithLog<DisplayDensity>(
'React:... | Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
@flow | javascript | packages/react-devtools-shared/src/devtools/views/Settings/SettingsContext.js | 89 | [] | false | 2 | 6 | facebook/react | 241,750 | jsdoc | false | |
chi2 | def chi2(X, y):
"""Compute chi-squared stats between each non-negative feature and class.
This score can be used to select the `n_features` features with the
highest values for the test chi-squared statistic from X, which must
contain only **non-negative integer feature values** such as booleans or fre... | Compute chi-squared stats between each non-negative feature and class.
This score can be used to select the `n_features` features with the
highest values for the test chi-squared statistic from X, which must
contain only **non-negative integer feature values** such as booleans or frequencies
(e.g., term counts in docu... | python | sklearn/feature_selection/_univariate_selection.py | 200 | [
"X",
"y"
] | false | 5 | 7.6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
partitionsForTopic | public List<PartitionInfo> partitionsForTopic(String topic) {
return partitionsByTopic.getOrDefault(topic, Collections.emptyList());
} | Get the list of partitions for this topic
@param topic The topic name
@return A list of partitions | java | clients/src/main/java/org/apache/kafka/common/Cluster.java | 294 | [
"topic"
] | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false | |
replaceFrom | public String replaceFrom(CharSequence sequence, char replacement) {
String string = sequence.toString();
int pos = indexIn(string);
if (pos == -1) {
return string;
}
char[] chars = string.toCharArray();
chars[pos] = replacement;
for (int i = pos + 1; i < chars.length; i++) {
if ... | Returns a string copy of the input character sequence, with each matching BMP character
replaced by a given replacement character. For example:
{@snippet :
CharMatcher.is('a').replaceFrom("radar", 'o')
}
... returns {@code "rodor"}.
<p>The default implementation uses {@link #indexIn(CharSequence)} to find the first mat... | java | android/guava/src/com/google/common/base/CharMatcher.java | 680 | [
"sequence",
"replacement"
] | String | true | 4 | 7.6 | google/guava | 51,352 | javadoc | false |
getAvailableParameter | private @Nullable Function<Class<?>, Object> getAvailableParameter(Class<?> parameterType) {
for (Map.Entry<Class<?>, Function<Class<?>, Object>> entry : this.availableParameters.entrySet()) {
if (entry.getKey().isAssignableFrom(parameterType)) {
return entry.getValue();
}
}
return null;
} | Get an injectable argument instance for the given type. This method can be used
when manually instantiating an object without reflection.
@param <A> the argument type
@param type the argument type
@return the argument to inject or {@code null}
@since 3.4.0 | java | core/spring-boot/src/main/java/org/springframework/boot/util/Instantiator.java | 233 | [
"parameterType"
] | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
fuzz_tensor_simple | def fuzz_tensor_simple(
size: tuple[int, ...] | None = None,
stride: tuple[int, ...] | None = None,
dtype: torch.dtype | None = None,
seed: int | None = None,
) -> torch.Tensor:
"""
Convenience function that returns just the tensor without the seed.
Args:
size: Tensor shape. If None... | Convenience function that returns just the tensor without the seed.
Args:
size: Tensor shape. If None, will be randomly generated.
stride: Tensor stride. If None, will be randomly generated based on size.
dtype: Tensor data type. If None, will be randomly generated.
seed: Random seed for reproducibilit... | python | tools/experimental/torchfuzz/tensor_fuzzer.py | 425 | [
"size",
"stride",
"dtype",
"seed"
] | torch.Tensor | true | 1 | 6.72 | pytorch/pytorch | 96,034 | google | false |
divide | public static long divide(long dividend, long divisor) {
if (divisor < 0) { // i.e., divisor >= 2^63:
if (compare(dividend, divisor) < 0) {
return 0; // dividend < divisor
} else {
return 1; // dividend >= divisor
}
}
// Optimization - use signed division if dividend < 2^6... | Returns dividend / divisor, where the dividend and divisor are treated as unsigned 64-bit
quantities.
<p><b>Java 8+ users:</b> use {@link Long#divideUnsigned(long, long)} instead.
@param dividend the dividend (numerator)
@param divisor the divisor (denominator)
@throws ArithmeticException if divisor is 0 | java | android/guava/src/com/google/common/primitives/UnsignedLongs.java | 250 | [
"dividend",
"divisor"
] | true | 5 | 6.24 | google/guava | 51,352 | javadoc | false | |
fileStoreChecks | private static Stream<InstrumentationService.InstrumentationInfo> fileStoreChecks() {
var fileStoreClasses = StreamSupport.stream(FileSystems.getDefault().getFileStores().spliterator(), false)
.map(FileStore::getClass)
.distinct();
return fileStoreClasses.flatMap(fileStoreClass -... | Initializes the dynamic (agent-based) instrumentation:
<ol>
<li>
Finds the version-specific subclass of {@link EntitlementChecker} to use
</li>
<li>
Builds the set of methods to instrument using {@link InstrumentationService#lookupMethods}
</li>
<li>
Augment this set “dynamically” using {@link InstrumentationService#lo... | java | libs/entitlement/src/main/java/org/elasticsearch/entitlement/initialization/DynamicInstrumentation.java | 185 | [] | true | 2 | 6.24 | elastic/elasticsearch | 75,680 | javadoc | false | |
resolve | static List<InetAddress> resolve(String host, HostResolver hostResolver) throws UnknownHostException {
InetAddress[] addresses = hostResolver.resolve(host);
List<InetAddress> result = filterPreferredAddresses(addresses);
if (log.isDebugEnabled())
log.debug("Resolved host {} as {}", h... | Create a new channel builder from the provided configuration.
@param config client configs
@param time the time implementation
@param logContext the logging context
@return configured ChannelBuilder based on the configs. | java | clients/src/main/java/org/apache/kafka/clients/ClientUtils.java | 124 | [
"host",
"hostResolver"
] | true | 2 | 7.28 | apache/kafka | 31,560 | javadoc | false | |
assert_allclose | def assert_allclose(
actual, desired, rtol=None, atol=0.0, equal_nan=True, err_msg="", verbose=True
):
"""dtype-aware variant of numpy.testing.assert_allclose
This variant introspects the least precise floating point dtype
in the input argument and automatically sets the relative tolerance
paramete... | dtype-aware variant of numpy.testing.assert_allclose
This variant introspects the least precise floating point dtype
in the input argument and automatically sets the relative tolerance
parameter to 1e-4 float32 and use 1e-7 otherwise (typically float64
in scikit-learn).
`atol` is always left to 0. by default. It shou... | python | sklearn/utils/_testing.py | 171 | [
"actual",
"desired",
"rtol",
"atol",
"equal_nan",
"err_msg",
"verbose"
] | false | 3 | 7.12 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
convertSingleIdentifierImport | function convertSingleIdentifierImport(name: Identifier, moduleSpecifier: StringLiteralLike, checker: TypeChecker, identifiers: Identifiers, quotePreference: QuotePreference): ConvertedImports {
const nameSymbol = checker.getSymbolAtLocation(name);
// Maps from module property name to name actually used. (The... | Convert `import x = require("x").`
Also:
- Convert `x.default()` to `x()` to handle ES6 default export
- Converts uses like `x.y()` to `y()` and uses a named import. | typescript | src/services/codefixes/convertToEsModule.ts | 528 | [
"name",
"moduleSpecifier",
"checker",
"identifiers",
"quotePreference"
] | true | 12 | 6 | microsoft/TypeScript | 107,154 | jsdoc | false | |
ensure_finished_tis | def ensure_finished_tis(self, dag_run: DagRun, session: Session) -> list[TaskInstance]:
"""
Ensure finished_tis is populated if it's currently None, which allows running tasks without dag_run.
:param dag_run: The DagRun for which to find finished tasks
:return: A list of all the finis... | Ensure finished_tis is populated if it's currently None, which allows running tasks without dag_run.
:param dag_run: The DagRun for which to find finished tasks
:return: A list of all the finished tasks of this DAG and logical_date | python | airflow-core/src/airflow/ti_deps/dep_context.py | 88 | [
"self",
"dag_run",
"session"
] | list[TaskInstance] | true | 6 | 7.92 | apache/airflow | 43,597 | sphinx | false |
configure | public <T extends SimpleAsyncTaskExecutor> T configure(T taskExecutor) {
PropertyMapper map = PropertyMapper.get();
map.from(this.virtualThreads).to(taskExecutor::setVirtualThreads);
map.from(this.threadNamePrefix).whenHasText().to(taskExecutor::setThreadNamePrefix);
map.from(this.cancelRemainingTasksOnClose).t... | Configure the provided {@link SimpleAsyncTaskExecutor} instance using this builder.
@param <T> the type of task executor
@param taskExecutor the {@link SimpleAsyncTaskExecutor} to configure
@return the task executor instance
@see #build()
@see #build(Class) | java | core/spring-boot/src/main/java/org/springframework/boot/task/SimpleAsyncTaskExecutorBuilder.java | 266 | [
"taskExecutor"
] | T | true | 2 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
computeReplacement | public static @Nullable String computeReplacement(CharEscaper escaper, char c) {
return stringOrNull(escaper.escape(c));
} | Returns a string that would replace the given character in the specified escaper, or {@code
null} if no replacement should be made. This method is intended for use in tests through the
{@code EscaperAsserts} class; production users of {@link CharEscaper} should limit themselves
to its public interface.
@param c the cha... | java | android/guava/src/com/google/common/escape/Escapers.java | 171 | [
"escaper",
"c"
] | String | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false |
where | def where(self, cond, other=None) -> Index:
"""
Replace values where the condition is False.
The replacement is taken from other.
Parameters
----------
cond : bool array-like with the same length as self
Condition to select the values on.
other : sca... | Replace values where the condition is False.
The replacement is taken from other.
Parameters
----------
cond : bool array-like with the same length as self
Condition to select the values on.
other : scalar, or array-like, default None
Replacement if the condition is False.
Returns
-------
pandas.Index
A ... | python | pandas/core/indexes/base.py | 5,144 | [
"self",
"cond",
"other"
] | Index | true | 2 | 8 | pandas-dev/pandas | 47,362 | numpy | false |
isLaziable | function isLaziable(func) {
var funcName = getFuncName(func),
other = lodash[funcName];
if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
return false;
}
if (func === other) {
return true;
}
var data = getData(other);
return !!... | Checks if `func` has a lazy counterpart.
@private
@param {Function} func The function to check.
@returns {boolean} Returns `true` if `func` has a lazy counterpart,
else `false`. | javascript | lodash.js | 6,440 | [
"func"
] | false | 5 | 6.24 | lodash/lodash | 61,490 | jsdoc | false | |
load | static @Nullable PemSslStore load(@Nullable PemSslStoreDetails details, ResourceLoader resourceLoader) {
if (details == null || details.isEmpty()) {
return null;
}
return new LoadedPemSslStore(details, resourceLoader);
} | Return a {@link PemSslStore} instance loaded using the given
{@link PemSslStoreDetails}.
@param details the PEM store details
@param resourceLoader the resource loader used to load content
@return a loaded {@link PemSslStore} or {@code null}.
@since 3.3.5 | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/pem/PemSslStore.java | 115 | [
"details",
"resourceLoader"
] | PemSslStore | true | 3 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
readBlock | private void readBlock() throws IOException {
if (in.remaining() < 4) {
throw new IOException(PREMATURE_EOS);
}
int blockSize = in.getInt();
boolean compressed = (blockSize & LZ4_FRAME_INCOMPRESSIBLE_MASK) == 0;
blockSize &= ~LZ4_FRAME_INCOMPRESSIBLE_MASK;
/... | Decompresses (if necessary) buffered data, optionally computes and validates a XXHash32 checksum, and writes the
result to a buffer.
@throws IOException | java | clients/src/main/java/org/apache/kafka/common/compress/Lz4BlockInputStream.java | 160 | [] | void | true | 10 | 6.56 | apache/kafka | 31,560 | javadoc | false |
replace | public static <V> String replace(final Object source, final Map<String, V> valueMap) {
return new StrSubstitutor(valueMap).replace(source);
} | Replaces all the occurrences of variables in the given source object with
their matching values from the map.
@param <V> the type of the values in the map.
@param source the source text containing the variables to substitute, null returns null.
@param valueMap the map with the values, may be null.
@return the result ... | java | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | 178 | [
"source",
"valueMap"
] | String | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
toIntValue | public static int toIntValue(final Character ch, final int defaultValue) {
return ch != null ? toIntValue(ch.charValue(), defaultValue) : defaultValue;
} | Converts the character to the Integer it represents, throwing an
exception if the character is not numeric.
<p>This method converts the char '1' to the int 1 and so on.</p>
<pre>
CharUtils.toIntValue(null, -1) = -1
CharUtils.toIntValue('3', -1) = 3
CharUtils.toIntValue('A', -1) = -1
</pre>
@param ch the charac... | java | src/main/java/org/apache/commons/lang3/CharUtils.java | 451 | [
"ch",
"defaultValue"
] | true | 2 | 7.84 | apache/commons-lang | 2,896 | javadoc | false | |
readConfig | async function readConfig(): Promise<NpsConfig | undefined> {
const data = await fs.promises
.readFile(getConfigPath(), 'utf-8')
.catch((err) => (err.code === 'ENOENT' ? Promise.resolve(undefined) : Promise.reject(err)))
if (data === undefined) {
return undefined
}
const obj = JSON.parse(data)
if... | Creates a proxy that aborts the readline interface when the underlying stream closes. | typescript | packages/cli/src/utils/nps/survey.ts | 164 | [] | true | 7 | 6.88 | prisma/prisma | 44,834 | jsdoc | true | |
transform | def transform(self, arg, *args, **kwargs):
"""
Call function producing a like-indexed Series on each group.
Return a Series with the transformed values.
Parameters
----------
arg : function
To apply to each group. Should return a Series with the same index.
... | Call function producing a like-indexed Series on each group.
Return a Series with the transformed values.
Parameters
----------
arg : function
To apply to each group. Should return a Series with the same index.
*args, **kwargs
Additional arguments and keywords.
Returns
-------
Series
A Series with the tr... | python | pandas/core/resample.py | 453 | [
"self",
"arg"
] | false | 1 | 6 | pandas-dev/pandas | 47,362 | numpy | false | |
registerContainedBean | public void registerContainedBean(String containedBeanName, String containingBeanName) {
synchronized (this.containedBeanMap) {
Set<String> containedBeans =
this.containedBeanMap.computeIfAbsent(containingBeanName, key -> new LinkedHashSet<>(8));
if (!containedBeans.add(containedBeanName)) {
return;
... | Register a containment relationship between two beans,
for example, between an inner bean and its containing outer bean.
<p>Also registers the containing bean as dependent on the contained bean
in terms of destruction order.
@param containedBeanName the name of the contained (inner) bean
@param containingBeanName the n... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java | 582 | [
"containedBeanName",
"containingBeanName"
] | void | true | 2 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
escapeEcmaScript | public static final String escapeEcmaScript(final String input) {
return ESCAPE_ECMASCRIPT.translate(input);
} | Escapes the characters in a {@link String} using EcmaScript String rules.
<p>Escapes any values it finds into their EcmaScript String form.
Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) </p>
<p>So a tab becomes the characters {@code '\\'} and
{@code 't'}.</p>
<p>The only difference betwee... | java | src/main/java/org/apache/commons/lang3/StringEscapeUtils.java | 458 | [
"input"
] | String | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
info | def info(self) -> str:
"""
Print detailed information on the store.
Returns
-------
str
A String containing the python pandas class name, filepath to the HDF5
file and all the object keys along with their respective dataframe shapes.
See Also
... | Print detailed information on the store.
Returns
-------
str
A String containing the python pandas class name, filepath to the HDF5
file and all the object keys along with their respective dataframe shapes.
See Also
--------
HDFStore.get_storer : Returns the storer object for a key.
Examples
--------
>>> df1... | python | pandas/io/pytables.py | 1,747 | [
"self"
] | str | true | 9 | 7.04 | pandas-dev/pandas | 47,362 | unknown | false |
toString | @Override
public String toString() {
// consistent with the original implementation
return " at character " + this.pos + " of " + this.in;
} | Returns the current position and the entire input string.
@return the current position and the entire input string. | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONTokener.java | 463 | [] | String | true | 1 | 7.04 | spring-projects/spring-boot | 79,428 | javadoc | false |
internalMatch | function internalMatch(string, regexp, message, fn) {
if (!isRegExp(regexp)) {
throw new ERR_INVALID_ARG_TYPE(
'regexp', 'RegExp', regexp,
);
}
const match = fn === Assert.prototype.match;
if (typeof string !== 'string' ||
RegExpPrototypeExec(regexp, string) !== null !== match) {
const ... | Throws `AssertionError` if the value is not `null` or `undefined`.
@param {any} err
@returns {void} | javascript | lib/assert.js | 822 | [
"string",
"regexp",
"message",
"fn"
] | false | 6 | 6.08 | nodejs/node | 114,839 | jsdoc | false | |
toString | @Override
public String toString() {
return this.element + (this.targetClass != null ? " on " + this.targetClass : "");
} | Create a new instance with the specified {@link AnnotatedElement} and
optional target {@link Class}. | java | spring-context/src/main/java/org/springframework/context/expression/AnnotatedElementKey.java | 65 | [] | String | true | 2 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
createMetadataResource | private FileObject createMetadataResource(String location) throws IOException {
return this.environment.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", location);
} | Read additional {@link ConfigurationMetadata} for the {@link TypeElement} or
{@code null}.
@param typeElement the type to get additional metadata for
@return additional metadata for the given type or {@code null} if none is present | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataStore.java | 177 | [
"location"
] | FileObject | true | 1 | 6.32 | spring-projects/spring-boot | 79,428 | javadoc | false |
to_string | def to_string(
self,
buf: FilePath | WriteBuffer[str] | None = None,
*,
columns: Axes | None = None,
col_space: int | list[int] | dict[Hashable, int] | None = None,
header: bool | SequenceNotStr[str] = True,
index: bool = True,
na_rep: str = "NaN",
... | Render a DataFrame to a console-friendly tabular output.
%(shared_params)s
line_width : int, optional
Width to wrap a line in characters.
min_rows : int, optional
The number of rows to display in the console in a truncated repr
(when number of rows is above `max_rows`).
max_colwidth : int, optional
Max ... | python | pandas/core/frame.py | 1,316 | [
"self",
"buf",
"columns",
"col_space",
"header",
"index",
"na_rep",
"formatters",
"float_format",
"sparsify",
"index_names",
"justify",
"max_rows",
"max_cols",
"show_dimensions",
"decimal",
"line_width",
"min_rows",
"max_colwidth",
"encoding"
] | str | None | true | 1 | 7.2 | pandas-dev/pandas | 47,362 | unknown | false |
create | public static URL create(File file) {
return create(file, (String) null);
} | Create a new jar URL.
@param file the jar file
@return a jar file URL | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrl.java | 40 | [
"file"
] | URL | true | 1 | 6.64 | spring-projects/spring-boot | 79,428 | javadoc | false |
_hc_cut | def _hc_cut(n_clusters, children, n_leaves):
"""Function cutting the ward tree for a given number of clusters.
Parameters
----------
n_clusters : int or ndarray
The number of clusters to form.
children : ndarray of shape (n_nodes-1, 2)
The children of each non-leaf node. Values les... | Function cutting the ward tree for a given number of clusters.
Parameters
----------
n_clusters : int or ndarray
The number of clusters to form.
children : ndarray of shape (n_nodes-1, 2)
The children of each non-leaf node. Values less than `n_samples`
correspond to leaves of the tree which are the origin... | python | sklearn/cluster/_agglomerative.py | 731 | [
"n_clusters",
"children",
"n_leaves"
] | false | 4 | 6.24 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
fit | def fit(self, X, y, sample_weight=None):
"""Fit the model using X, y as training data.
Parameters
----------
X : ndarray of shape (n_samples,) or (n_samples, n_classes)
Training data.
This should be the output of `decision_function` or `predict_proba`.
... | Fit the model using X, y as training data.
Parameters
----------
X : ndarray of shape (n_samples,) or (n_samples, n_classes)
Training data.
This should be the output of `decision_function` or `predict_proba`.
If the input appears to be probabilities (i.e., values between 0 and 1
that sum to 1 across c... | python | sklearn/calibration.py | 1,076 | [
"self",
"X",
"y",
"sample_weight"
] | false | 5 | 6.16 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
_do_scheduling | def _do_scheduling(self, session: Session) -> int:
"""
Make the main scheduling decisions.
It:
- Creates any necessary DAG runs by examining the next_dagrun_create_after column of DagModel
Since creating Dag Runs is a relatively time consuming process, we select only 10 dags ... | Make the main scheduling decisions.
It:
- Creates any necessary DAG runs by examining the next_dagrun_create_after column of DagModel
Since creating Dag Runs is a relatively time consuming process, we select only 10 dags by default
(configurable via ``scheduler.max_dagruns_to_create_per_loop`` setting) - putting ... | python | airflow-core/src/airflow/jobs/scheduler_job_runner.py | 1,583 | [
"self",
"session"
] | int | true | 8 | 6.8 | apache/airflow | 43,597 | unknown | false |
mergeValuesToHistogram | private void mergeValuesToHistogram() {
if (valueCount == 0) {
return;
}
Arrays.sort(rawValueBuffer, 0, valueCount);
int negativeValuesCount = 0;
while (negativeValuesCount < valueCount && rawValueBuffer[negativeValuesCount] < 0) {
negativeValuesCount++;
... | Returns the histogram representing the distribution of all accumulated values.
@return the histogram representing the distribution of all accumulated values | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramGenerator.java | 115 | [] | void | true | 12 | 7.6 | elastic/elasticsearch | 75,680 | javadoc | false |
setAsText | @Override
public void setAsText(String text) throws IllegalArgumentException {
boolean nioPathCandidate = !text.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX);
if (nioPathCandidate && !text.startsWith("/")) {
try {
URI uri = ResourceUtils.toURI(text);
String scheme = uri.getScheme();
if (scheme != n... | Create a new PathEditor, using the given ResourceEditor underneath.
@param resourceEditor the ResourceEditor to use | java | spring-beans/src/main/java/org/springframework/beans/propertyeditors/PathEditor.java | 75 | [
"text"
] | void | true | 12 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
containsNone | public static boolean containsNone(final CharSequence cs, final char... searchChars) {
if (cs == null || searchChars == null) {
return true;
}
final int csLen = cs.length();
final int csLast = csLen - 1;
final int searchLen = searchChars.length;
final int sear... | Tests that the CharSequence does not contain certain characters.
<p>
A {@code null} CharSequence will return {@code true}. A {@code null} invalid character array will return {@code true}. An empty CharSequence (length()=0)
always returns true.
</p>
<pre>
StringUtils.containsNone(null, *) = true
StringUtils.contai... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 1,216 | [
"cs"
] | true | 10 | 7.76 | apache/commons-lang | 2,896 | javadoc | false | |
getSpringInitializationConfig | @Override
protected @Nullable String getSpringInitializationConfig() {
ConfigurationFactory configurationFactory = ConfigurationFactory.getInstance();
try {
Configuration springConfiguration = configurationFactory.getConfiguration(getLoggerContext(), "-spring",
null, getClassLoader());
String configLoca... | Create a new {@link Log4J2LoggingSystem} instance.
@param classLoader the class loader to use.
@param loggerContext the {@link LoggerContext} to use. | java | core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java | 142 | [] | String | true | 4 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
build | @Override
public ImmutableSortedSet<E> build() {
sortAndDedup();
if (n == 0) {
return emptySet(comparator);
} else {
forceCopy = true;
return new RegularImmutableSortedSet<>(asImmutableList(elements, n), comparator);
}
} | Returns a newly-created {@code ImmutableSortedSet} based on the contents of the {@code
Builder} and its comparator. | java | guava/src/com/google/common/collect/ImmutableSortedSet.java | 586 | [] | true | 2 | 6.08 | google/guava | 51,352 | javadoc | false | |
deleteTopics | default DeleteTopicsResult deleteTopics(Collection<String> topics) {
return deleteTopics(TopicCollection.ofTopicNames(topics), new DeleteTopicsOptions());
} | This is a convenience method for {@link #deleteTopics(TopicCollection, DeleteTopicsOptions)}
with default options. See the overload for more details.
<p>
This operation is supported by brokers with version 0.10.1.0 or higher.
@param topics The topic names to delete.
@return The DeleteTopicsResult. | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 212 | [
"topics"
] | DeleteTopicsResult | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
getBean | public <T> T getBean(String name, @Nullable Class<T> requiredType, @Nullable Object @Nullable ... args)
throws BeansException {
return doGetBean(name, requiredType, args, false);
} | Return an instance, which may be shared or independent, of the specified bean.
@param name the name of the bean to retrieve
@param requiredType the required type of the bean to retrieve
@param args arguments to use when creating a bean instance using explicit arguments
(only applied when creating a new instance as oppo... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | 218 | [
"name",
"requiredType"
] | T | true | 1 | 6.32 | spring-projects/spring-framework | 59,386 | javadoc | false |
clearListeners | private @Nullable Listener clearListeners(@Nullable Listener onto) {
// We need to
// 1. atomically swap the listeners with TOMBSTONE, this is because addListener uses that
// to synchronize with us
// 2. reverse the linked list, because despite our rather clear contract, people depend on us
// ... | Clears the {@link #listeners} list and prepends its contents to {@code onto}, least recently
added first. | java | android/guava/src/com/google/common/util/concurrent/AbstractFuture.java | 840 | [
"onto"
] | Listener | true | 2 | 6 | google/guava | 51,352 | javadoc | false |
dotAllMatcher | public static Matcher dotAllMatcher(final String regex, final CharSequence text) {
return dotAll(regex).matcher(text);
} | Compiles the given regular expression into a pattern with the {@link Pattern#DOTALL} flag, then creates a matcher that will match the given text against
this pattern.
@param regex The expression to be compiled.
@param text The character sequence to be matched.
@return A new matcher for this pattern.
@since 3.18.0 | java | src/main/java/org/apache/commons/lang3/RegExUtils.java | 56 | [
"regex",
"text"
] | Matcher | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false |
columnKeySet | @Override
public Set<C> columnKeySet() {
Set<C> result = columnKeySet;
return (result == null) ? columnKeySet = new ColumnKeySet() : result;
} | {@inheritDoc}
<p>The returned set has an iterator that does not support {@code remove()}.
<p>The set's iterator traverses the columns of the first row, the columns of the second row,
etc., skipping any columns that have appeared previously. | java | android/guava/src/com/google/common/collect/StandardTable.java | 656 | [] | true | 2 | 6.72 | google/guava | 51,352 | javadoc | false | |
putmask | def putmask(self, mask, value) -> Index:
"""
Return a new Index of the values set with the mask.
Parameters
----------
mask : array-like of bool
Array of booleans denoting where values should be replaced.
value : scalar
Scalar value to use to fill... | Return a new Index of the values set with the mask.
Parameters
----------
mask : array-like of bool
Array of booleans denoting where values should be replaced.
value : scalar
Scalar value to use to fill holes (e.g. 0).
This value cannot be a list-likes.
Returns
-------
Index
A new Index of the values ... | python | pandas/core/indexes/base.py | 5,427 | [
"self",
"mask",
"value"
] | Index | true | 8 | 8.56 | pandas-dev/pandas | 47,362 | numpy | false |
forceMergeIndex | private void forceMergeIndex(ProjectId projectId, ForceMergeRequest forceMergeRequest, ActionListener<Void> listener) {
assert forceMergeRequest.indices() != null && forceMergeRequest.indices().length == 1
: "Data stream lifecycle force merges one index at a time";
final String targetIndex =... | This method sends requests to delete any indices in the datastream that exceed its retention policy. It returns the set of indices
it has sent delete requests for.
@param project The project metadata from which to get index metadata
@param dataStream The data stream
@param i... | java | modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleService.java | 1,332 | [
"projectId",
"forceMergeRequest",
"listener"
] | void | true | 5 | 7.76 | elastic/elasticsearch | 75,680 | javadoc | false |
newCopyOnWriteArrayList | @J2ktIncompatible
@GwtIncompatible // CopyOnWriteArrayList
@InlineMe(
replacement = "new CopyOnWriteArrayList<>()",
imports = {"java.util.concurrent.CopyOnWriteArrayList"})
public static <E extends @Nullable Object> CopyOnWriteArrayList<E> newCopyOnWriteArrayList() {
return new CopyOnWriteArrayLis... | Creates an empty {@code CopyOnWriteArrayList} instance.
<p><b>Note:</b> if you need an immutable empty {@link List}, use {@link Collections#emptyList}
instead.
@return a new, empty {@code CopyOnWriteArrayList}
@since 12.0 | java | android/guava/src/com/google/common/collect/Lists.java | 264 | [] | true | 1 | 6.4 | google/guava | 51,352 | javadoc | false | |
readToHeapBuffer | private static int readToHeapBuffer(InputStream input, ByteBuffer buffer, int count) throws IOException {
final int pos = buffer.position();
int read = readFully(input, buffer.array(), buffer.arrayOffset() + pos, count);
if (read > 0) {
buffer.position(pos + read);
}
... | Read up to {code count} bytes from {@code input} and store them into {@code buffer}.
The buffers position will be incremented by the number of bytes read from the stream.
@param input stream to read from
@param buffer buffer to read into
@param count maximum number of bytes to read
@return number of bytes read from the... | java | libs/core/src/main/java/org/elasticsearch/core/Streams.java | 99 | [
"input",
"buffer",
"count"
] | true | 2 | 7.92 | elastic/elasticsearch | 75,680 | javadoc | false | |
bind | @Contract("_, _, _, true -> !null")
private <T> @Nullable T bind(ConfigurationPropertyName name, Bindable<T> target, @Nullable BindHandler handler,
boolean create) {
Assert.notNull(name, "'name' must not be null");
Assert.notNull(target, "'target' must not be null");
handler = (handler != null) ? handler : th... | Bind the specified target {@link Bindable} using this binder's
{@link ConfigurationPropertySource property sources} or create a new instance using
the type of the {@link Bindable} if the result of the binding is {@code null}.
@param name the configuration property name to bind
@param target the target bindable
@param h... | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java | 353 | [
"name",
"target",
"handler",
"create"
] | T | true | 2 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false |
open | private static ZipContent open(Source source) throws IOException {
ZipContent zipContent = cache.get(source);
if (zipContent != null) {
debug.log("Opening existing cached zip content for %s", zipContent);
zipContent.data.open();
return zipContent;
}
debug.log("Loading zip content from %s", source);
z... | Open nested {@link ZipContent} from the specified path. The resulting
{@link ZipContent} <em>must</em> be {@link #close() closed} by the caller.
@param path the zip path
@param nestedEntryName the nested entry name to open
@return a {@link ZipContent} instance
@throws IOException on I/O error | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipContent.java | 376 | [
"source"
] | ZipContent | true | 3 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false |
timeoutCallsToSend | private int timeoutCallsToSend(TimeoutProcessor processor) {
int numTimedOut = 0;
for (List<Call> callList : callsToSend.values()) {
numTimedOut += processor.handleTimeouts(callList,
"Timed out waiting to send the call.");
}
if (numTime... | Time out calls which have been assigned to nodes.
@param processor The timeout processor. | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 1,139 | [
"processor"
] | true | 2 | 7.04 | apache/kafka | 31,560 | javadoc | false | |
ensureNotClosed | private void ensureNotClosed() {
if (this.closed)
throw new IllegalStateException("This consumer has already been closed.");
} | Schedule a task to be executed during a poll(). One enqueued task will be executed per {@link #poll(Duration)}
invocation. You can use this repeatedly to mock out multiple responses to poll invocations.
@param task the task to be executed | java | clients/src/main/java/org/apache/kafka/clients/consumer/MockConsumer.java | 617 | [] | void | true | 2 | 6.96 | apache/kafka | 31,560 | javadoc | false |
validate_host | def validate_host(host, allowed_hosts):
"""
Validate the given host for this site.
Check that the host looks valid and matches a host or host pattern in the
given list of ``allowed_hosts``. Any pattern beginning with a period
matches a domain and all its subdomains (e.g. ``.example.com`` matches
... | Validate the given host for this site.
Check that the host looks valid and matches a host or host pattern in the
given list of ``allowed_hosts``. Any pattern beginning with a period
matches a domain and all its subdomains (e.g. ``.example.com`` matches
``example.com`` and any subdomain), ``*`` matches anything, and an... | python | django/http/request.py | 826 | [
"host",
"allowed_hosts"
] | false | 2 | 6.24 | django/django | 86,204 | unknown | false | |
_get_contiguous_fusible_spans | def _get_contiguous_fusible_spans(gm: fx.GraphModule) -> list[list[fx.Node]]:
"""Get contiguous spans of fusible nodes from the graph.
Walks the graph in topological order and groups consecutive fusible
nodes into spans. Non-fusible nodes act as span boundaries.
"""
spans: list[list[fx.Node]] = []
... | Get contiguous spans of fusible nodes from the graph.
Walks the graph in topological order and groups consecutive fusible
nodes into spans. Non-fusible nodes act as span boundaries. | python | torch/_inductor/fx_passes/fusion_regions.py | 106 | [
"gm"
] | list[list[fx.Node]] | true | 6 | 6 | pytorch/pytorch | 96,034 | unknown | false |
python_type | def python_type(self) -> type:
"""
Abstract method to be implemented by subclasses of VariableTracker.
This method should return the type represented by the instance of the subclass.
The purpose is to provide a standardized way to retrieve the Python type information
of the vari... | Abstract method to be implemented by subclasses of VariableTracker.
This method should return the type represented by the instance of the subclass.
The purpose is to provide a standardized way to retrieve the Python type information
of the variable being tracked.
Returns:
type: The Python type (such as int, str, ... | python | torch/_dynamo/variables/base.py | 328 | [
"self"
] | type | true | 1 | 8.32 | pytorch/pytorch | 96,034 | unknown | false |
add | private void add(@Nullable Object[] elements, int n) {
ensureRoomFor(n);
/*
* The following call is not statically checked, since arraycopy accepts plain Object for its
* parameters. If it were statically checked, the checker would still be OK with it, since
* we're copying into a `cont... | Adds each element of {@code elements} to the {@code ImmutableList}.
@param elements the {@code Iterable} to add to the {@code ImmutableList}
@return this {@code Builder} object
@throws NullPointerException if {@code elements} is null or contains a null element | java | guava/src/com/google/common/collect/ImmutableList.java | 866 | [
"elements",
"n"
] | void | true | 1 | 6.72 | google/guava | 51,352 | javadoc | false |
getUmdImportKind | function getUmdImportKind(importingFile: SourceFile | FutureSourceFile, program: Program, forceImportKeyword: boolean): ImportKind {
// Import a synthetic `default` if enabled.
if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) {
return ImportKind.Default;
}
// When a synt... | @param forceImportKeyword Indicates that the user has already typed `import`, so the result must start with `import`.
(In other words, do not allow `const x = require("...")` for JS files.)
@internal | typescript | src/services/codefixes/importFixes.ts | 1,535 | [
"importingFile",
"program",
"forceImportKeyword"
] | true | 6 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
scratch | private ByteBuffer scratch() {
if (scratch == null) {
scratch = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN);
}
return scratch;
} | Updates the sink with the given number of bytes from the buffer. | java | android/guava/src/com/google/common/hash/AbstractByteHasher.java | 139 | [] | ByteBuffer | true | 2 | 6.88 | google/guava | 51,352 | javadoc | false |
dtypes | def dtypes(self):
"""
Return the dtypes in the DataFrame.
This returns a Series with the data type of each column.
The result's index is the original DataFrame's columns. Columns
with mixed types are stored with the ``object`` dtype. See
:ref:`the User Guide <basics.dtyp... | Return the dtypes in the DataFrame.
This returns a Series with the data type of each column.
The result's index is the original DataFrame's columns. Columns
with mixed types are stored with the ``object`` dtype. See
:ref:`the User Guide <basics.dtypes>` for more.
Returns
-------
pandas.Series
The data type of eac... | python | pandas/core/generic.py | 6,279 | [
"self"
] | false | 1 | 6.48 | pandas-dev/pandas | 47,362 | unknown | false | |
jit_user_function | def jit_user_function(func: Callable) -> Callable:
"""
If user function is not jitted already, mark the user's function
as jitable.
Parameters
----------
func : function
user defined function
Returns
-------
function
Numba JITed function, or function marked as JITab... | If user function is not jitted already, mark the user's function
as jitable.
Parameters
----------
func : function
user defined function
Returns
-------
function
Numba JITed function, or function marked as JITable by numba | python | pandas/core/util/numba_.py | 59 | [
"func"
] | Callable | true | 7 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false |
find_duplicates | def find_duplicates(a, key=None, ignoremask=True, return_index=False):
"""
Find the duplicates in a structured array along a given key
Parameters
----------
a : array-like
Input array
key : {string, None}, optional
Name of the fields along which to check the duplicates.
... | Find the duplicates in a structured array along a given key
Parameters
----------
a : array-like
Input array
key : {string, None}, optional
Name of the fields along which to check the duplicates.
If None, the search is performed by records
ignoremask : {True, False}, optional
Whether masked data should... | python | numpy/lib/recfunctions.py | 1,417 | [
"a",
"key",
"ignoremask",
"return_index"
] | false | 6 | 7.6 | numpy/numpy | 31,054 | numpy | false | |
make_low_rank_matrix | def make_low_rank_matrix(
n_samples=100,
n_features=100,
*,
effective_rank=10,
tail_strength=0.5,
random_state=None,
):
"""Generate a mostly low rank matrix with bell-shaped singular values.
Most of the variance can be explained by a bell-shaped curve of width
effective_rank: the lo... | Generate a mostly low rank matrix with bell-shaped singular values.
Most of the variance can be explained by a bell-shaped curve of width
effective_rank: the low rank part of the singular values profile is::
(1 - tail_strength) * exp(-1.0 * (i / effective_rank) ** 2)
The remaining singular values' tail is fat, d... | python | sklearn/datasets/_samples_generator.py | 1,423 | [
"n_samples",
"n_features",
"effective_rank",
"tail_strength",
"random_state"
] | false | 1 | 6.4 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
batchIterator | private AbstractIterator<FileChannelRecordBatch> batchIterator(int start) {
final int end;
if (isSlice)
end = this.end;
else
end = this.sizeInBytes();
FileLogInputStream inputStream = new FileLogInputStream(this, start, end);
return new RecordBatchIterator... | Get an iterator over the record batches in the file, starting at a specific position. This is similar to
{@link #batches()} except that callers specify a particular position to start reading the batches from. This
method must be used with caution: the start position passed in must be a known start of a batch.
@param st... | java | clients/src/main/java/org/apache/kafka/common/record/FileRecords.java | 434 | [
"start"
] | true | 2 | 8.24 | apache/kafka | 31,560 | javadoc | false | |
groupState | public Optional<GroupState> groupState() {
return groupState;
} | The group state.
<p>
If the broker returns a group state which is not recognised, as might
happen when talking to a broker with a later version, the state will be
<code>Optional.of(GroupState.UNKNOWN)</code>.
@return An Optional containing the state, if available. | java | clients/src/main/java/org/apache/kafka/clients/admin/GroupListing.java | 90 | [] | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false | |
visitLabeledStatement | function visitLabeledStatement(node: LabeledStatement): VisitResult<Statement | undefined> {
if (convertedLoopState && !convertedLoopState.labels) {
convertedLoopState.labels = new Map<string, boolean>();
}
const statement = unwrapInnermostStatementOfLabel(node, convertedLoopStat... | Visits a VariableDeclaration node with a binding pattern.
@param node A VariableDeclaration node. | typescript | src/compiler/transformers/es2015.ts | 2,943 | [
"node"
] | true | 6 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
nunique | def nunique(self, dropna: bool = True) -> Series | DataFrame:
"""
Return number of unique elements in the group.
Parameters
----------
dropna : bool, default True
Don't include NaN in the counts.
Returns
-------
Series
Number of u... | Return number of unique elements in the group.
Parameters
----------
dropna : bool, default True
Don't include NaN in the counts.
Returns
-------
Series
Number of unique values within each group.
See Also
--------
core.resample.Resampler.nunique : Method nunique for Resampler.
Examples
--------
>>> lst = ["... | python | pandas/core/groupby/generic.py | 962 | [
"self",
"dropna"
] | Series | DataFrame | true | 5 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false |
_freeze_unroll | def _freeze_unroll(self, new_tasks, group_id, chord, root_id, parent_id):
"""Generator for the frozen flattened group tasks.
Creates a flattened list of the tasks in the group, and freezes
each task in the group. Nested groups will be recursively flattened.
Exhausting the generator wil... | Generator for the frozen flattened group tasks.
Creates a flattened list of the tasks in the group, and freezes
each task in the group. Nested groups will be recursively flattened.
Exhausting the generator will create a new list of the flattened
tasks in the group and will return it in the new_tasks argument.
Argume... | python | celery/canvas.py | 1,892 | [
"self",
"new_tasks",
"group_id",
"chord",
"root_id",
"parent_id"
] | false | 4 | 6.08 | celery/celery | 27,741 | google | false | |
listGroups | ListGroupsResult listGroups(ListGroupsOptions options); | List the groups available in the cluster.
@param options The options to use when listing the groups.
@return The ListGroupsResult. | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 1,080 | [
"options"
] | ListGroupsResult | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false |
entryIterator | @Override
UnmodifiableIterator<Entry<K, V>> entryIterator() {
return new UnmodifiableIterator<Entry<K, V>>() {
final Iterator<? extends Entry<K, ? extends ImmutableCollection<V>>> asMapItr =
map.entrySet().iterator();
@Nullable K currentKey = null;
Iterator<V> valueItr = emptyIterator(... | Returns an immutable collection of all key-value pairs in the multimap. | java | android/guava/src/com/google/common/collect/ImmutableMultimap.java | 649 | [] | true | 3 | 7.04 | google/guava | 51,352 | javadoc | false | |
clearShort | public short clearShort(final short holder) {
return (short) clear(holder);
} | Clears the bits.
@param holder the short data containing the bits we're
interested in
@return the value of holder with the specified bits cleared
(set to {@code 0}) | java | src/main/java/org/apache/commons/lang3/BitField.java | 123 | [
"holder"
] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
withPassword | public PemSslStoreDetails withPassword(@Nullable String password) {
return new PemSslStoreDetails(this.type, this.alias, password, this.certificates, this.privateKey,
this.privateKeyPassword);
} | Return a new {@link PemSslStoreDetails} instance with a new password.
@param password the new password
@return a new {@link PemSslStoreDetails} instance
@since 3.2.0 | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/pem/PemSslStoreDetails.java | 112 | [
"password"
] | PemSslStoreDetails | true | 1 | 6.48 | spring-projects/spring-boot | 79,428 | javadoc | false |
initializeBean | Object initializeBean(Object existingBean, String beanName) throws BeansException; | Initialize the given raw bean, applying factory callbacks
such as {@code setBeanName} and {@code setBeanFactory},
also applying all bean post processors (including ones which
might wrap the given raw bean).
<p>Note that no bean definition of the given name has to exist
in the bean factory. The passed-in bean name will ... | java | spring-beans/src/main/java/org/springframework/beans/factory/config/AutowireCapableBeanFactory.java | 286 | [
"existingBean",
"beanName"
] | Object | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
_get_provider_version_from_package_name | def _get_provider_version_from_package_name(provider_package_name: str) -> str | None:
"""
Get the current version of a provider from its pyproject.toml.
Args:
provider_package_name: The full package name (e.g., "apache-airflow-providers-common-compat")
Returns:
The version string if f... | Get the current version of a provider from its pyproject.toml.
Args:
provider_package_name: The full package name (e.g., "apache-airflow-providers-common-compat")
Returns:
The version string if found, None otherwise | python | dev/breeze/src/airflow_breeze/utils/packages.py | 1,187 | [
"provider_package_name"
] | str | None | true | 3 | 7.76 | apache/airflow | 43,597 | google | false |
compile_fx_forward | def compile_fx_forward(
gm: GraphModule,
example_inputs: Sequence[InputType],
num_orig_model_outputs: int,
num_example_inputs: int,
compiler_config_extra: CompilerConfigExtra,
inner_compile: Callable[..., OutputCode] = compile_fx_inner,
is_inference: bool = False,
) -> OutputCode:
"""
... | Compile the forward graph of the given graph module.
Args:
gm: The graph module to compile.
example_inputs: The example inputs to use for compilation.
num_orig_model_outputs: The number of model outputs from the original dynamo graph.
num_example_inputs: The number of example inputs from the original d... | python | torch/_inductor/compile_fx.py | 2,258 | [
"gm",
"example_inputs",
"num_orig_model_outputs",
"num_example_inputs",
"compiler_config_extra",
"inner_compile",
"is_inference"
] | OutputCode | true | 8 | 6.32 | pytorch/pytorch | 96,034 | google | false |
clearMergedBeanDefinition | protected void clearMergedBeanDefinition(String beanName) {
RootBeanDefinition bd = this.mergedBeanDefinitions.get(beanName);
if (bd != null) {
bd.stale = true;
}
} | Remove the merged bean definition for the specified bean,
recreating it on next access.
@param beanName the bean name to clear the merged definition for | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | 1,523 | [
"beanName"
] | void | true | 2 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
typename | def typename(char):
"""
Return a description for the given data type code.
Parameters
----------
char : str
Data type code.
Returns
-------
out : str
Description of the input data type code.
See Also
--------
dtype
Examples
--------
>>> import ... | Return a description for the given data type code.
Parameters
----------
char : str
Data type code.
Returns
-------
out : str
Description of the input data type code.
See Also
--------
dtype
Examples
--------
>>> import numpy as np
>>> typechars = ['S1', '?', 'B', 'D', 'G', 'F', 'I', 'H', 'L', 'O', 'Q',
...... | python | numpy/lib/_type_check_impl.py | 586 | [
"char"
] | false | 1 | 6.32 | numpy/numpy | 31,054 | numpy | false | |
getBytes | public ByteBuffer getBytes(String name) {
Object result = get(name);
if (result instanceof byte[])
return ByteBuffer.wrap((byte[]) result);
return (ByteBuffer) result;
} | Check if the struct contains a field.
@param name
@return Whether a field exists. | java | clients/src/main/java/org/apache/kafka/common/protocol/types/Struct.java | 120 | [
"name"
] | ByteBuffer | true | 2 | 7.92 | apache/kafka | 31,560 | javadoc | false |
_get_providers_class_registry | def _get_providers_class_registry(
class_extras: dict[str, Callable] | None = None,
) -> dict[str, dict[str, Any]]:
"""
Builds a registry of classes from YAML configuration files.
This function scans through YAML configuration files to build a registry of classes.
It parses each YAML file to get th... | Builds a registry of classes from YAML configuration files.
This function scans through YAML configuration files to build a registry of classes.
It parses each YAML file to get the provider's name and registers classes from Python
module files within the provider's directory, excluding '__init__.py'.
:return: A dicti... | python | devel-common/src/sphinx_exts/providers_extensions.py | 231 | [
"class_extras"
] | dict[str, dict[str, Any]] | true | 7 | 7.04 | apache/airflow | 43,597 | unknown | false |
_maybe_convert_i8 | def _maybe_convert_i8(self, key):
"""
Maybe convert a given key to its equivalent i8 value(s). Used as a
preprocessing step prior to IntervalTree queries (self._engine), which
expects numeric data.
Parameters
----------
key : scalar or list-like
The k... | Maybe convert a given key to its equivalent i8 value(s). Used as a
preprocessing step prior to IntervalTree queries (self._engine), which
expects numeric data.
Parameters
----------
key : scalar or list-like
The key that should maybe be converted to i8.
Returns
-------
scalar or list-like
The original key if ... | python | pandas/core/indexes/interval.py | 650 | [
"self",
"key"
] | false | 13 | 6 | pandas-dev/pandas | 47,362 | numpy | false | |
chebcompanion | def chebcompanion(c):
"""Return the scaled companion matrix of c.
The basis polynomials are scaled so that the companion matrix is
symmetric when `c` is a Chebyshev basis polynomial. This provides
better eigenvalue estimates than the unscaled case and for basis
polynomials the eigenvalues are guara... | Return the scaled companion matrix of c.
The basis polynomials are scaled so that the companion matrix is
symmetric when `c` is a Chebyshev basis polynomial. This provides
better eigenvalue estimates than the unscaled case and for basis
polynomials the eigenvalues are guaranteed to be real if
`numpy.linalg.eigvalsh` i... | python | numpy/polynomial/chebyshev.py | 1,627 | [
"c"
] | false | 3 | 6.08 | numpy/numpy | 31,054 | numpy | false | |
getDefaultFileTypeMap | protected FileTypeMap getDefaultFileTypeMap(MimeMessage mimeMessage) {
if (mimeMessage instanceof SmartMimeMessage smartMimeMessage) {
FileTypeMap fileTypeMap = smartMimeMessage.getDefaultFileTypeMap();
if (fileTypeMap != null) {
return fileTypeMap;
}
}
ConfigurableMimeFileTypeMap fileTypeMap = new C... | Determine the default Java Activation FileTypeMap for the given MimeMessage.
@param mimeMessage the passed-in MimeMessage
@return the default FileTypeMap associated with the MimeMessage,
or a default ConfigurableMimeFileTypeMap if none found for the message
@see ConfigurableMimeFileTypeMap | java | spring-context-support/src/main/java/org/springframework/mail/javamail/MimeMessageHelper.java | 447 | [
"mimeMessage"
] | FileTypeMap | true | 3 | 7.28 | spring-projects/spring-framework | 59,386 | javadoc | false |
reset_modules | def reset_modules(*modules):
"""Remove modules from :data:`sys.modules` by name,
and reset back again when the test/context returns.
Example::
>>> with conftest.reset_modules('celery.result', 'celery.app.base'):
... pass
"""
prev = {
k: sys.modules.pop(k) for k in modules... | Remove modules from :data:`sys.modules` by name,
and reset back again when the test/context returns.
Example::
>>> with conftest.reset_modules('celery.result', 'celery.app.base'):
... pass | python | t/unit/conftest.py | 654 | [] | false | 2 | 7.04 | celery/celery | 27,741 | unknown | false | |
contains | public boolean contains(final StrMatcher matcher) {
return indexOf(matcher, 0) >= 0;
} | Checks if the string builder contains a string matched using the
specified matcher.
<p>
Matchers can be used to perform advanced searching behavior.
For example you could write a matcher to search for the character
'a' followed by a number.
</p>
@param matcher the matcher to use, null returns -1
@return true if the ma... | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 1,651 | [
"matcher"
] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
ensureNotNull | public static void ensureNotNull(Object value, String message) {
if (value == null) {
throw new IllegalArgumentException(message);
}
} | Returns a version used for serialising a response.
@return a compatible version | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java | 1,303 | [
"value",
"message"
] | void | true | 2 | 6.72 | elastic/elasticsearch | 75,680 | javadoc | false |
timeout | public Optional<Duration> timeout() {
return timeout;
} | Fluent method to set the group membership operation upon shutdown.
@param operation the group membership operation to apply. Must be one of {@code LEAVE_GROUP}, {@code REMAIN_IN_GROUP}, or {@code DEFAULT}.
@return this {@code CloseOptions} instance. | java | clients/src/main/java/org/apache/kafka/clients/consumer/CloseOptions.java | 109 | [] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
supportedFeatures | public static Features<SupportedVersionRange> supportedFeatures(Map<String, SupportedVersionRange> features) {
return new Features<>(features);
} | @param features Map of feature name to SupportedVersionRange.
@return Returns a new Features object representing supported features. | java | clients/src/main/java/org/apache/kafka/common/feature/Features.java | 55 | [
"features"
] | true | 1 | 6 | apache/kafka | 31,560 | javadoc | false | |
onHeartbeatRequestGenerated | public void onHeartbeatRequestGenerated() {
MemberState state = state();
if (state == MemberState.ACKNOWLEDGING) {
if (targetAssignmentReconciled()) {
transitionTo(MemberState.STABLE);
} else {
log.debug("Member {} with epoch {} transitioned to {} ... | Update state when a heartbeat is generated. This will transition out of the states that end
when a heartbeat request is sent, without waiting for a response (ex.
{@link MemberState#ACKNOWLEDGING} and {@link MemberState#LEAVING}). | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java | 702 | [] | void | true | 5 | 6.72 | apache/kafka | 31,560 | javadoc | false |
validateResponse | private void validateResponse(ClassicHttpResponse httpResponse, String serviceUrl) {
if (httpResponse.getEntity() == null) {
throw new ReportableException("No content received from server '" + serviceUrl + "'");
}
if (httpResponse.getCode() != 200) {
throw createException(serviceUrl, httpResponse);
}
} | Loads the service capabilities of the service at the specified URL. If the service
supports generating a textual representation of the capabilities, it is returned,
otherwise {@link InitializrServiceMetadata} is returned.
@param serviceUrl to url of the initializer service
@return the service capabilities (as a String)... | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java | 143 | [
"httpResponse",
"serviceUrl"
] | void | true | 3 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
reverse | public static String reverse(final String str) {
if (str == null) {
return null;
}
return new StringBuilder(str).reverse().toString();
} | Reverses a String as per {@link StringBuilder#reverse()}.
<p>
A {@code null} String returns {@code null}.
</p>
<pre>
StringUtils.reverse(null) = null
StringUtils.reverse("") = ""
StringUtils.reverse("bat") = "tab"
</pre>
@param str the String to reverse, may be null.
@return the reversed String, {@code null} if nul... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 6,792 | [
"str"
] | String | true | 2 | 7.6 | apache/commons-lang | 2,896 | javadoc | false |
getAutoConfigurationReplacements | private AutoConfigurationReplacements getAutoConfigurationReplacements() {
AutoConfigurationReplacements autoConfigurationReplacements = this.autoConfigurationReplacements;
if (autoConfigurationReplacements == null) {
autoConfigurationReplacements = AutoConfigurationReplacements.load(this.autoConfigurationAnnota... | 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 | 295 | [] | AutoConfigurationReplacements | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
get_db_instance_state | def get_db_instance_state(self, db_instance_id: str) -> str:
"""
Get the current state of a DB instance.
.. seealso::
- :external+boto3:py:meth:`RDS.Client.describe_db_instances`
:param db_instance_id: The ID of the target DB instance.
:return: Returns the status of... | Get the current state of a DB instance.
.. seealso::
- :external+boto3:py:meth:`RDS.Client.describe_db_instances`
:param db_instance_id: The ID of the target DB instance.
:return: Returns the status of the DB instance as a string (eg. "available")
:raises AirflowNotFoundException: If the DB instance does not exis... | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/rds.py | 227 | [
"self",
"db_instance_id"
] | str | true | 1 | 6.4 | apache/airflow | 43,597 | sphinx | false |
scheduleOnIdle | function scheduleOnIdle(fn: () => void): void {
if (typeof requestIdleCallback !== 'undefined') {
requestIdleCallback(fn);
} else {
setTimeout(fn, 0);
}
} | Schedules a function to be run in a new macrotask.
This is needed because the `requestIdleCallback` API is not available in all browsers.
@param fn | typescript | adev/src/app/features/references/api-reference-list/api-reference-list.component.ts | 178 | [
"fn"
] | true | 3 | 6.72 | angular/angular | 99,544 | jsdoc | false | |
semaphore | public static Striped<Semaphore> semaphore(int stripes, int permits) {
return custom(stripes, () -> new PaddedSemaphore(permits));
} | Creates a {@code Striped<Semaphore>} with eagerly initialized, strongly referenced semaphores,
with the specified number of permits.
@param stripes the minimum number of stripes (semaphores) required
@param permits the number of permits in each semaphore
@return a new {@code Striped<Semaphore>} | java | android/guava/src/com/google/common/util/concurrent/Striped.java | 245 | [
"stripes",
"permits"
] | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false | |
deleteAll | public StrBuilder deleteAll(final StrMatcher matcher) {
return replace(matcher, null, 0, size, -1);
} | Deletes all parts of the builder that the matcher matches.
<p>
Matchers can be used to perform advanced deletion behavior.
For example you could write a matcher to delete all occurrences
where the character 'a' is followed by a number.
</p>
@param matcher the matcher to use to find the deletion, null causes no action
... | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 1,724 | [
"matcher"
] | StrBuilder | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false |
resolve | private Stream<PropertyDescriptor> resolve(Bindable bindable, TypeElementMembers members) {
if (bindable.isConstructorBindingEnabled()) {
ExecutableElement bindConstructor = bindable.getBindConstructor();
return (bindConstructor != null)
? resolveConstructorBoundProperties(bindable.getType(), members, bind... | Return the {@link PropertyDescriptor} instances that are valid candidates for the
specified {@link TypeElement type} based on the specified {@link ExecutableElement
factory method}, if any.
@param type the target type
@param factoryMethod the method that triggered the metadata for that {@code type}
or {@code null}
@ret... | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java | 69 | [
"bindable",
"members"
] | true | 3 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false | |
replace_regex | def replace_regex(
values: ArrayLike, rx: re.Pattern, value, mask: npt.NDArray[np.bool_] | None
) -> None:
"""
Parameters
----------
values : ArrayLike
Object dtype.
rx : re.Pattern
value : Any
mask : np.ndarray[bool], optional
Notes
-----
Alters values in-place.
... | Parameters
----------
values : ArrayLike
Object dtype.
rx : re.Pattern
value : Any
mask : np.ndarray[bool], optional
Notes
-----
Alters values in-place. | python | pandas/core/array_algos/replace.py | 114 | [
"values",
"rx",
"value",
"mask"
] | None | true | 14 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.