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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
init | private static void init() {
init_X86_32Bit();
init_X86_64Bit();
init_IA64_32Bit();
init_IA64_64Bit();
init_PPC_32Bit();
init_PPC_64Bit();
init_Aarch_64Bit();
init_RISCV_32Bit();
init_RISCV_64Bit();
} | 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 | 91 | [] | void | true | 1 | 7.04 | apache/commons-lang | 2,896 | javadoc | false |
formatter | DocValueFormat formatter() {
return format;
} | Returns the normalized value. If no normalised factor has been specified
this method will return {@link #value()}
@return the normalized value | java | modules/aggregations/src/main/java/org/elasticsearch/aggregations/pipeline/Derivative.java | 60 | [] | DocValueFormat | true | 1 | 6.48 | elastic/elasticsearch | 75,680 | javadoc | false |
complement | @Override
public RangeSet<C> complement() {
RangeSet<C> result = complement;
return (result == null) ? complement = new Complement() : result;
} | Returns a {@code TreeRangeSet} representing the union of the specified ranges.
<p>This is the smallest {@code RangeSet} which encloses each of the specified ranges. An
element will be contained in this {@code RangeSet} if and only if it is contained in at least
one {@code Range} in {@code ranges}.
@since 21.0 | java | android/guava/src/com/google/common/collect/TreeRangeSet.java | 278 | [] | true | 2 | 6.88 | google/guava | 51,352 | javadoc | false | |
write | private void write(JarFile sourceJar, AbstractJarWriter writer, PackagedLibraries libraries) throws IOException {
if (isLayered()) {
writer.useLayers(this.layers, this.layersIndex);
}
writer.writeManifest(buildManifest(sourceJar));
writeLoaderClasses(writer);
writer.writeEntries(sourceJar, getEntityTransfo... | Sets if jarmode jars relevant for the packaging should be automatically included.
@param includeRelevantJarModeJars if relevant jars are included | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java | 202 | [
"sourceJar",
"writer",
"libraries"
] | void | true | 3 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
groups | def groups(self) -> list:
"""
Return a list of all the top-level nodes.
Each node returned is not a pandas storage object.
Returns
-------
list
List of objects.
See Also
--------
HDFStore.get_node : Returns the node with the key.
... | Return a list of all the top-level nodes.
Each node returned is not a pandas storage object.
Returns
-------
list
List of objects.
See Also
--------
HDFStore.get_node : Returns the node with the key.
Examples
--------
>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
>>> store = pd.HDFStore("store.h5"... | python | pandas/io/pytables.py | 1,555 | [
"self"
] | list | true | 5 | 7.28 | pandas-dev/pandas | 47,362 | unknown | false |
read_spss | def read_spss(
path: str | Path,
usecols: Sequence[str] | None = None,
convert_categoricals: bool = True,
dtype_backend: DtypeBackend | lib.NoDefault = lib.no_default,
**kwargs: Any,
) -> DataFrame:
"""
Load an SPSS file from the file path, returning a DataFrame.
Parameters
--------... | Load an SPSS file from the file path, returning a DataFrame.
Parameters
----------
path : str or Path
File path.
usecols : list-like, optional
Return a subset of the columns. If None, return all columns.
convert_categoricals : bool, default is True
Convert categorical columns into pd.Categorical.
dtype_bac... | python | pandas/io/spss.py | 27 | [
"path",
"usecols",
"convert_categoricals",
"dtype_backend"
] | DataFrame | true | 4 | 7.92 | pandas-dev/pandas | 47,362 | numpy | false |
nextTokenCanFollowModifier | function nextTokenCanFollowModifier() {
switch (token()) {
case SyntaxKind.ConstKeyword:
// 'const' is only a modifier if followed by 'enum'.
return nextToken() === SyntaxKind.EnumKeyword;
case SyntaxKind.ExportKeyword:
nextToken();
... | 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,766 | [] | false | 3 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
mean | function mean(array) {
return baseMean(array, identity);
} | Computes the mean of the values in `array`.
@static
@memberOf _
@since 4.0.0
@category Math
@param {Array} array The array to iterate over.
@returns {number} Returns the mean.
@example
_.mean([4, 2, 8, 6]);
// => 5 | javascript | lodash.js | 16,464 | [
"array"
] | false | 1 | 6.4 | lodash/lodash | 61,490 | jsdoc | false | |
loadBeanDefinitions | public int loadBeanDefinitions(String location, @Nullable Set<Resource> actualResources) throws BeanDefinitionStoreException {
ResourceLoader resourceLoader = getResourceLoader();
if (resourceLoader == null) {
throw new BeanDefinitionStoreException(
"Cannot load bean definitions from location [" + location ... | Load bean definitions from the specified resource location.
<p>The location can also be a location pattern, provided that the
ResourceLoader of this bean definition reader is a ResourcePatternResolver.
@param location the resource location, to be loaded with the ResourceLoader
(or ResourcePatternResolver) of this bean ... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java | 205 | [
"location",
"actualResources"
] | true | 8 | 7.6 | spring-projects/spring-framework | 59,386 | javadoc | false | |
getNestedLibraryTime | private long getNestedLibraryTime(Library library) {
try {
try (JarInputStream jarStream = new JarInputStream(library.openStream())) {
JarEntry entry = jarStream.getNextJarEntry();
while (entry != null) {
if (!entry.isDirectory()) {
return entry.getTime();
}
entry = jarStream.getNextJa... | Write a simple index file containing the specified UTF-8 lines.
@param location the location of the index file
@param lines the lines to write
@throws IOException if the write fails | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/AbstractJarWriter.java | 185 | [
"library"
] | true | 4 | 7.2 | spring-projects/spring-boot | 79,428 | javadoc | false | |
estimateMax | public static OptionalDouble estimateMax(
ZeroBucket zeroBucket,
ExponentialHistogram.Buckets negativeBuckets,
ExponentialHistogram.Buckets positiveBuckets
) {
int scale = negativeBuckets.iterator().scale();
assert scale == positiveBuckets.iterator().scale();
Optiona... | Estimates the maximum value of the histogram based on the populated buckets.
The returned value is guaranteed to be greater than or equal to the exact maximum value of the histogram values.
If the histogram is empty, an empty Optional is returned.
<p>
Note that this method can return +-Infinity if the histogram bucket ... | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ExponentialHistogramUtils.java | 118 | [
"zeroBucket",
"negativeBuckets",
"positiveBuckets"
] | OptionalDouble | true | 4 | 7.76 | elastic/elasticsearch | 75,680 | javadoc | false |
downgrade | def downgrade():
"""Unapply Add run_id to Log and increase Log event name length."""
with op.batch_alter_table("log") as batch_op:
batch_op.drop_column("run_id")
conn = op.get_bind()
if conn.dialect.name == "mssql":
with op.batch_alter_table("log") as batch_op:
batch_op.drop... | Unapply Add run_id to Log and increase Log event name length. | python | airflow-core/src/airflow/migrations/versions/0010_2_9_0_add_run_id_to_audit_log_table_and_change_event_name_length.py | 53 | [] | false | 3 | 6.08 | apache/airflow | 43,597 | unknown | false | |
_accumulate | def _accumulate(
self, name: str, *, skipna: bool = True, **kwargs
) -> ArrowExtensionArray | ExtensionArray:
"""
Return an ExtensionArray performing an accumulation operation.
The underlying data type might change.
Parameters
----------
name : str
... | Return an ExtensionArray performing an accumulation operation.
The underlying data type might change.
Parameters
----------
name : str
Name of the function, supported values are:
- cummin
- cummax
- cumsum
- cumprod
skipna : bool, default True
If True, skip NA values.
**kwargs
Additional k... | python | pandas/core/arrays/arrow/array.py | 1,833 | [
"self",
"name",
"skipna"
] | ArrowExtensionArray | ExtensionArray | true | 10 | 6.48 | pandas-dev/pandas | 47,362 | numpy | false |
iter_file_metadata | def iter_file_metadata(
self,
prefix: str,
bucket_name: str | None = None,
page_size: int | None = None,
max_items: int | None = None,
) -> Iterator:
"""
Yield metadata objects from a bucket under a prefix.
.. seealso::
- :external+boto3:p... | Yield metadata objects from a bucket under a prefix.
.. seealso::
- :external+boto3:py:class:`S3.Paginator.ListObjectsV2`
:param prefix: a key prefix
:param bucket_name: the name of the bucket
:param page_size: pagination size
:param max_items: maximum items to return
:return: an Iterator of metadata of objects | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/s3.py | 957 | [
"self",
"prefix",
"bucket_name",
"page_size",
"max_items"
] | Iterator | true | 4 | 7.44 | apache/airflow | 43,597 | sphinx | false |
newLinkedHashSet | @SuppressWarnings("NonApiType") // acts as a direct substitute for a constructor call
public static <E extends @Nullable Object> LinkedHashSet<E> newLinkedHashSet() {
return new LinkedHashSet<>();
} | Creates a <i>mutable</i>, empty {@code LinkedHashSet} instance.
<p><b>Note:</b> if mutability is not required, use {@link ImmutableSet#of()} instead.
<p><b>Note:</b> this method is now unnecessary and should be treated as deprecated. Instead,
use the {@code LinkedHashSet} constructor directly, taking advantage of <a
hr... | java | android/guava/src/com/google/common/collect/Sets.java | 316 | [] | true | 1 | 6 | google/guava | 51,352 | javadoc | false | |
toJsonString | default String toJsonString() {
try {
StringBuilder stringBuilder = new StringBuilder();
to(stringBuilder);
return stringBuilder.toString();
}
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
} | Write the JSON to a {@link String}.
@return the JSON string | java | core/spring-boot/src/main/java/org/springframework/boot/json/WritableJson.java | 53 | [] | String | true | 2 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false |
pickle_flatten | def pickle_flatten(
obj: object, cls: type[T] | tuple[type[T], ...]
) -> tuple[list[T], FlattenRest]:
"""
Use the pickle machinery to extract objects out of an arbitrary container.
Unlike regular ``pickle.dumps``, this function always succeeds.
Parameters
----------
obj : object
Th... | Use the pickle machinery to extract objects out of an arbitrary container.
Unlike regular ``pickle.dumps``, this function always succeeds.
Parameters
----------
obj : object
The object to pickle.
cls : type | tuple[type, ...]
One or multiple classes to extract from the object.
The instances of these class... | python | sklearn/externals/array_api_extra/_lib/_utils/_helpers.py | 362 | [
"obj",
"cls"
] | tuple[list[T], FlattenRest] | true | 4 | 8.4 | scikit-learn/scikit-learn | 64,340 | numpy | false |
is_dataclass | def is_dataclass(item: object) -> bool:
"""
Checks if the object is a data-class instance
Parameters
----------
item : object
Returns
--------
is_dataclass : bool
True if the item is an instance of a data-class,
will return false if you pass the data class itself
E... | Checks if the object is a data-class instance
Parameters
----------
item : object
Returns
--------
is_dataclass : bool
True if the item is an instance of a data-class,
will return false if you pass the data class itself
Examples
--------
>>> from dataclasses import dataclass
>>> @dataclass
... class Point:
.... | python | pandas/core/dtypes/inference.py | 485 | [
"item"
] | bool | true | 2 | 7.84 | pandas-dev/pandas | 47,362 | numpy | false |
commitAsyncExceptionForError | private Throwable commitAsyncExceptionForError(Throwable error) {
if (error instanceof RetriableException) {
return new RetriableCommitFailedException(error);
}
return error;
} | Commit offsets, retrying on expected retriable errors while the retry timeout hasn't expired.
@param offsets Offsets to commit
@param deadlineMs Time until which the request will be retried if it fails with
an expected retriable error.
@return Future that will complete when a successful response | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java | 496 | [
"error"
] | Throwable | true | 2 | 7.76 | apache/kafka | 31,560 | javadoc | false |
afterPropertiesSet | @Override
public void afterPropertiesSet() {
if (this.fallbackToNoOpCache) {
this.cacheManagers.add(new NoOpCacheManager());
}
} | Indicate whether a {@link NoOpCacheManager} should be added at the end of the delegate list.
In this case, any {@code getCache} requests not handled by the configured CacheManagers will
be automatically handled by the {@link NoOpCacheManager} (and hence never return {@code null}). | java | spring-context/src/main/java/org/springframework/cache/support/CompositeCacheManager.java | 94 | [] | void | true | 2 | 6.4 | spring-projects/spring-framework | 59,386 | javadoc | false |
orderedPermutations | public static <E extends Comparable<? super E>> Collection<List<E>> orderedPermutations(
Iterable<E> elements) {
return orderedPermutations(elements, Ordering.natural());
} | Returns a {@link Collection} of all the permutations of the specified {@link Iterable}.
<p><i>Notes:</i> This is an implementation of the algorithm for Lexicographical Permutations
Generation, described in Knuth's "The Art of Computer Programming", Volume 4, Chapter 7,
Section 7.2.1.2. The iteration order follows the l... | java | android/guava/src/com/google/common/collect/Collections2.java | 356 | [
"elements"
] | true | 1 | 6.16 | google/guava | 51,352 | javadoc | false | |
isTrue | public static void isTrue(final boolean expression) {
if (!expression) {
throw new IllegalArgumentException(DEFAULT_IS_TRUE_EX_MESSAGE);
}
} | Validate that the argument condition is {@code true}; otherwise
throwing an exception. This method is useful when validating according
to an arbitrary boolean expression, such as validating a
primitive number or using your own custom validation expression.
<pre>
Validate.isTrue(i > 0);
Validate.isTrue(myObject.isOk(... | java | src/main/java/org/apache/commons/lang3/Validate.java | 496 | [
"expression"
] | void | true | 2 | 6.24 | apache/commons-lang | 2,896 | javadoc | false |
nullToEmpty | public static boolean[] nullToEmpty(final boolean[] array) {
return isEmpty(array) ? EMPTY_BOOLEAN_ARRAY : array;
} | Defensive programming technique to change a {@code null}
reference to an empty one.
<p>
This method returns an empty array for a {@code null} input array.
</p>
<p>
As a memory optimizing technique an empty array passed in will be overridden with
the empty {@code public static} references in this class.
</p>
@param arra... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 4,280 | [
"array"
] | true | 2 | 8.16 | apache/commons-lang | 2,896 | javadoc | false | |
ignore | public void ignore(String key) {
used.add(key);
} | Called directly after user configs got parsed (and thus default values got set).
This allows to change default values for "secondary defaults" if required.
@param parsedValues unmodifiable map of current configuration
@return a map of updates that should be applied to the configuration (will be validated to prevent bad... | java | clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java | 181 | [
"key"
] | void | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
register_dataframe_accessor | def register_dataframe_accessor(name: str) -> Callable[[TypeT], TypeT]:
"""
Register a custom accessor on DataFrame objects.
Parameters
----------
name : str
Name under which the accessor should be registered. A warning is issued
if this name conflicts with a preexisting attribute.
... | Register a custom accessor on DataFrame objects.
Parameters
----------
name : str
Name under which the accessor should be registered. A warning is issued
if this name conflicts with a preexisting attribute.
Returns
-------
callable
A class decorator.
See Also
--------
register_dataframe_accessor : Regist... | python | pandas/core/accessor.py | 326 | [
"name"
] | Callable[[TypeT], TypeT] | true | 1 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
toString | public static String toString(final Object obj) {
return Objects.toString(obj, StringUtils.EMPTY);
} | Gets the {@code toString()} of an {@link Object} or the empty string ({@code ""}) if the input is {@code null}.
<pre>
ObjectUtils.toString(null) = ""
ObjectUtils.toString("") = ""
ObjectUtils.toString("bat") = "bat"
ObjectUtils.toString(Boolean.TRUE) = "true"
</pre>
@param obj the Object to {@... | java | src/main/java/org/apache/commons/lang3/ObjectUtils.java | 1,236 | [
"obj"
] | String | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
skew | def skew(
self,
axis: Axis | None = 0,
skipna: bool = True,
numeric_only: bool = False,
**kwargs,
) -> Series | Any:
"""
Return unbiased skew over requested axis.
Normalized by N-1.
Parameters
----------
axis : {index (0), col... | Return unbiased skew over requested axis.
Normalized by N-1.
Parameters
----------
axis : {index (0), columns (1)}
Axis for the function to be applied on.
For `Series` this parameter is unused and defaults to 0.
For DataFrames, specifying ``axis=None`` will apply the aggregation
across both axes.
... | python | pandas/core/frame.py | 13,790 | [
"self",
"axis",
"skipna",
"numeric_only"
] | Series | Any | true | 2 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false |
initializerNames | public Set<String> initializerNames() {
return Collections.unmodifiableSet(initializers.keySet());
} | Returns a set with the names of all {@link BackgroundInitializer} objects managed by the {@link MultiBackgroundInitializer}.
@return an (unmodifiable) set with the names of the managed {@code BackgroundInitializer} objects. | java | src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java | 196 | [] | true | 1 | 6 | apache/commons-lang | 2,896 | javadoc | false | |
bindAggregate | protected abstract @Nullable Object bindAggregate(ConfigurationPropertyName name, Bindable<?> target,
AggregateElementBinder elementBinder); | Perform the actual aggregate binding.
@param name the configuration property name to bind
@param target the target to bind
@param elementBinder an element binder
@return the bound result | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java | 74 | [
"name",
"target",
"elementBinder"
] | Object | true | 1 | 6.32 | spring-projects/spring-boot | 79,428 | javadoc | false |
registerFormatters | @Override
public void registerFormatters(FormatterRegistry registry) {
DateTimeConverters.registerConverters(registry);
DateTimeFormatter df = getFormatter(Type.DATE);
DateTimeFormatter tf = getFormatter(Type.TIME);
DateTimeFormatter dtf = getFormatter(Type.DATE_TIME);
// Efficient ISO_LOCAL_* variants for... | Set the formatter that will be used for objects representing date and time values.
<p>This formatter will be used for {@link LocalDateTime}, {@link ZonedDateTime},
and {@link OffsetDateTime} types. When specified, the
{@link #setDateTimeStyle dateTimeStyle} and
{@link #setUseIsoFormat useIsoFormat} properties will be i... | java | spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterRegistrar.java | 155 | [
"registry"
] | void | true | 4 | 6.4 | spring-projects/spring-framework | 59,386 | javadoc | false |
generateRandomString | function generateRandomString(length: number): string {
const array = new Uint8Array(length);
crypto.getRandomValues(array);
return Array.from(array)
.map(b => b.toString(16).padStart(2, '0'))
.join('')
.substring(0, length);
} | Generates a cryptographically secure random string for PKCE code verifier.
@param length The length of the string to generate
@returns A random hex string | typescript | extensions/github-authentication/src/flows.ts | 121 | [
"length"
] | true | 1 | 6.88 | microsoft/vscode | 179,840 | jsdoc | false | |
stubObject | function stubObject() {
return {};
} | This method returns a new empty object.
@static
@memberOf _
@since 4.13.0
@category Util
@returns {Object} Returns the new empty object.
@example
var objects = _.times(2, _.stubObject);
console.log(objects);
// => [{}, {}]
console.log(objects[0] === objects[1]);
// => false | javascript | lodash.js | 16,190 | [] | false | 1 | 6.96 | lodash/lodash | 61,490 | jsdoc | false | |
request_url | def request_url(self, request, proxies):
"""Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is o... | Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is only exposed for use
when subclassing the
:class:`HTTPAdapter <requests.adapt... | python | src/requests/adapters.py | 523 | [
"self",
"request",
"proxies"
] | false | 6 | 6.08 | psf/requests | 53,586 | sphinx | false | |
size | def size(self) -> int:
"""
Return an int representing the number of elements in this object.
Return the number of rows if Series. Otherwise return the number of
rows times number of columns if DataFrame.
See Also
--------
numpy.ndarray.size : Number of elements ... | Return an int representing the number of elements in this object.
Return the number of rows if Series. Otherwise return the number of
rows times number of columns if DataFrame.
See Also
--------
numpy.ndarray.size : Number of elements in the array.
Examples
--------
>>> s = pd.Series({"a": 1, "b": 2, "c": 3})
>>> s.... | python | pandas/core/generic.py | 669 | [
"self"
] | int | true | 1 | 6.08 | pandas-dev/pandas | 47,362 | unknown | false |
validate | def validate(self, names, defaultfmt="f%i", nbfields=None):
"""
Validate a list of strings as field names for a structured array.
Parameters
----------
names : sequence of str
Strings to be validated.
defaultfmt : str, optional
Default format stri... | Validate a list of strings as field names for a structured array.
Parameters
----------
names : sequence of str
Strings to be validated.
defaultfmt : str, optional
Default format string, used if validating a given string
reduces its length to zero.
nbfields : integer, optional
Final number of validated... | python | numpy/lib/_iotools.py | 312 | [
"self",
"names",
"defaultfmt",
"nbfields"
] | false | 14 | 6 | numpy/numpy | 31,054 | numpy | false | |
cos | public static double cos(double angle) {
angle = Math.abs(angle);
if (angle > SIN_COS_MAX_VALUE_FOR_INT_MODULO) {
// Faster than using normalizeZeroTwoPi.
angle = remainderTwoPi(angle);
if (angle < 0.0) {
angle += Constants.M_2PI;
}
... | @param angle Angle in radians.
@return Angle cosine. | java | libs/h3/src/main/java/org/elasticsearch/h3/FastMath.java | 341 | [
"angle"
] | true | 3 | 8.24 | elastic/elasticsearch | 75,680 | javadoc | false | |
_json_to_tensor_description | def _json_to_tensor_description(
cls,
json_dict: Optional[str],
tensor_name: Optional[str] = None,
) -> Optional["TensorDescription"]: # type: ignore[name-defined] # noqa: F821
"""Convert JSON string to TensorDescription object.
Args:
json_dict: JSON string rep... | Convert JSON string to TensorDescription object.
Args:
json_dict: JSON string representation
tensor_name: Name of the tensor to avoid cache in the same op
Returns:
Optional[TensorDescription]: Reconstructed object or None | python | torch/_inductor/codegen/cuda/serialization.py | 425 | [
"cls",
"json_dict",
"tensor_name"
] | Optional["TensorDescription"] | true | 2 | 7.28 | pytorch/pytorch | 96,034 | google | false |
drop | def drop(
self,
labels: Index | np.ndarray | Iterable[Hashable],
errors: IgnoreRaise = "raise",
) -> Index:
"""
Make new Index with passed list of labels deleted.
Parameters
----------
labels : array-like or scalar
Array-like object or a s... | Make new Index with passed list of labels deleted.
Parameters
----------
labels : array-like or scalar
Array-like object or a scalar value, representing the labels to be removed
from the Index.
errors : {'ignore', 'raise'}, default 'raise'
If 'ignore', suppress error and existing labels are dropped.
Retur... | python | pandas/core/indexes/base.py | 7,130 | [
"self",
"labels",
"errors"
] | Index | true | 5 | 8.48 | pandas-dev/pandas | 47,362 | numpy | false |
generateGetInstanceSupplierMethod | private GeneratedMethod generateGetInstanceSupplierMethod(Consumer<MethodSpec.Builder> method) {
return this.generatedMethods.add("getInstanceSupplier", method);
} | Generate the instance supplier code.
@param registeredBean the bean to handle
@param instantiationDescriptor the executable to use to create the bean
@return the generated code
@since 6.1.7 | java | spring-beans/src/main/java/org/springframework/beans/factory/aot/InstanceSupplierCodeGenerator.java | 398 | [
"method"
] | GeneratedMethod | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
isCommandInstanceOf | private boolean isCommandInstanceOf(Command command, Class<?>[] commandClasses) {
for (Class<?> commandClass : commandClasses) {
if (commandClass.isInstance(command)) {
return true;
}
}
return false;
} | Returns if the specified command is an option command.
@param command the command to test
@return {@code true} if the command is an option command
@see #setOptionCommands(Class...) | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java | 128 | [
"command",
"commandClasses"
] | true | 2 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false | |
declaredInSameAspect | private boolean declaredInSameAspect(Advisor advisor1, Advisor advisor2) {
return (hasAspectName(advisor1) && hasAspectName(advisor2) &&
getAspectName(advisor1).equals(getAspectName(advisor2)));
} | Create an {@code AspectJPrecedenceComparator}, using the given {@link Comparator}
for comparing {@link org.springframework.aop.Advisor} instances.
@param advisorComparator the {@code Comparator} to use for advisors | java | spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java | 125 | [
"advisor1",
"advisor2"
] | true | 3 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false | |
andThen | default FailableIntConsumer<E> andThen(final FailableIntConsumer<E> after) {
Objects.requireNonNull(after);
return (final int t) -> {
accept(t);
after.accept(t);
};
} | Returns a composed {@link FailableIntConsumer} like {@link IntConsumer#andThen(IntConsumer)}.
@param after the operation to perform after this one.
@return a composed {@link FailableIntConsumer} like {@link IntConsumer#andThen(IntConsumer)}.
@throws NullPointerException if {@code after} is null | java | src/main/java/org/apache/commons/lang3/function/FailableIntConsumer.java | 62 | [
"after"
] | true | 1 | 6.24 | apache/commons-lang | 2,896 | javadoc | false | |
getConfiguredCertificates | @Override
public Collection<? extends StoredCertificate> getConfiguredCertificates() {
final Path path = resolvePath();
final KeyStore trustStore = readKeyStore(path);
return KeyStoreUtil.stream(trustStore, ex -> keystoreException(path, ex)).map(entry -> {
final X509Certificate c... | @param path The path to the keystore file
@param password The password for the keystore
@param type The {@link KeyStore#getType() type} of the keystore (typically "PKCS12" or "jks").
See {@link KeyStoreUtil#inferKeyStoreType}.
@param algorithm The algorithm to use for the Trust Manager (see ... | java | libs/ssl-config/src/main/java/org/elasticsearch/common/ssl/StoreTrustConfig.java | 63 | [] | true | 2 | 6.4 | elastic/elasticsearch | 75,680 | javadoc | false | |
replaceAdvisor | boolean replaceAdvisor(Advisor a, Advisor b) throws AopConfigException; | Replace the given advisor.
<p><b>Note:</b> If the advisor is an {@link org.springframework.aop.IntroductionAdvisor}
and the replacement is not or implements different interfaces, the proxy will need
to be re-obtained or the old interfaces won't be supported and the new interface
won't be implemented.
@param a the advis... | java | spring-aop/src/main/java/org/springframework/aop/framework/Advised.java | 180 | [
"a",
"b"
] | true | 1 | 6.48 | spring-projects/spring-framework | 59,386 | javadoc | false | |
compute | public double compute(double... dataset) {
return computeInPlace(dataset.clone());
} | Computes the quantile value of the given dataset.
@param dataset the dataset to do the calculation on, which must be non-empty, which will not
be mutated by this call (it is copied instead)
@return the quantile value | java | android/guava/src/com/google/common/math/Quantiles.java | 253 | [] | true | 1 | 6.64 | google/guava | 51,352 | javadoc | false | |
clean_unused | def clean_unused(cls, session: Session = NEW_SESSION) -> None:
"""
Delete all triggers that have no tasks dependent on them and are not associated to an asset.
Triggers have a one-to-many relationship to task instances, so we need to clean those up first.
Afterward we can drop the trigg... | Delete all triggers that have no tasks dependent on them and are not associated to an asset.
Triggers have a one-to-many relationship to task instances, so we need to clean those up first.
Afterward we can drop the triggers not referenced by anyone. | python | airflow-core/src/airflow/models/trigger.py | 209 | [
"cls",
"session"
] | None | true | 4 | 6 | apache/airflow | 43,597 | unknown | false |
toString | public static String toString(final Object array, final String stringIfNull) {
if (array == null) {
return stringIfNull;
}
return new ToStringBuilder(array, ToStringStyle.SIMPLE_STYLE).append(array).toString();
} | Outputs an array as a String handling {@code null}s.
<p>
Multi-dimensional arrays are handled correctly, including
multi-dimensional primitive arrays.
</p>
<p>
The format is that of Java source code, for example {@code {a,b}}.
</p>
@param array the array to get a toString for, may be {@code null}.
@param stringIfNull ... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 9,266 | [
"array",
"stringIfNull"
] | String | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
fillna | def fillna(self, value, limit: int | None = None, copy: bool = True) -> Self:
"""
Fill NA/NaN values using the specified method.
Parameters
----------
value : scalar, dict, Series
If a scalar value is passed it is used to fill all missing values.
Alternat... | Fill NA/NaN values using the specified method.
Parameters
----------
value : scalar, dict, Series
If a scalar value is passed it is used to fill all missing values.
Alternatively, a Series or dict can be used to fill in different
values for each index. The value should not be a list. The
value(s) passe... | python | pandas/core/arrays/interval.py | 1,020 | [
"self",
"value",
"limit",
"copy"
] | Self | true | 3 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
defaultString | public static String defaultString(final String str) {
return Objects.toString(str, EMPTY);
} | Returns either the passed in String, or if the String is {@code null}, an empty String ("").
<pre>
StringUtils.defaultString(null) = ""
StringUtils.defaultString("") = ""
StringUtils.defaultString("bat") = "bat"
</pre>
@param str the String to check, may be null.
@return the passed in String, or the empty String if... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 1,570 | [
"str"
] | String | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
add_template_global | def add_template_global(
self, f: ft.TemplateGlobalCallable, name: str | None = None
) -> None:
"""Register a function to use as a custom Jinja global.
The :meth:`template_global` decorator can be used to register a function
by decorating instead.
:param f: The function to ... | Register a function to use as a custom Jinja global.
The :meth:`template_global` decorator can be used to register a function
by decorating instead.
:param f: The function to register.
:param name: The name to register the global as. If not given, uses the
function's name.
.. versionadded:: 0.10 | python | src/flask/sansio/app.py | 807 | [
"self",
"f",
"name"
] | None | true | 2 | 6.72 | pallets/flask | 70,946 | sphinx | false |
add | public void add(Layer layer, String name) {
String[] segments = name.split("/");
Node node = this.root;
for (int i = 0; i < segments.length; i++) {
boolean isDirectory = i < (segments.length - 1);
node = node.updateOrAddNode(segments[i], isDirectory, layer);
}
} | Add an item to the index.
@param layer the layer of the item
@param name the name of the item | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LayersIndex.java | 79 | [
"layer",
"name"
] | void | true | 2 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false |
derive | private <U extends @Nullable Object> ClosingFuture<U> derive(FluentFuture<U> future) {
ClosingFuture<U> derived = new ClosingFuture<>(future);
becomeSubsumedInto(derived.closeables);
return derived;
} | 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,102 | [
"future"
] | true | 1 | 6.72 | google/guava | 51,352 | javadoc | false | |
opj_uint_min | static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)
{
return a < b ? a : b;
} | Get the minimum of two integers
@return Returns a if a < b else b | cpp | 3rdparty/openjpeg/openjp2/opj_intmath.h | 65 | [
"a",
"b"
] | true | 2 | 6.48 | opencv/opencv | 85,374 | doxygen | false | |
slice | def slice(a, start=None, stop=np._NoValue, step=None, /):
"""
Slice the strings in `a` by slices specified by `start`, `stop`, `step`.
Like in the regular Python `slice` object, if only `start` is
specified then it is interpreted as the `stop`.
Parameters
----------
a : array-like, with ``S... | Slice the strings in `a` by slices specified by `start`, `stop`, `step`.
Like in the regular Python `slice` object, if only `start` is
specified then it is interpreted as the `stop`.
Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
Input array
start : None, an integer or a... | python | numpy/_core/strings.py | 1,730 | [
"a",
"start",
"stop",
"step"
] | false | 7 | 7.76 | numpy/numpy | 31,054 | numpy | false | |
touch | @SuppressWarnings("GoodTime") // reading system time without TimeSource
public static void touch(File file) throws IOException {
checkNotNull(file);
if (!file.createNewFile() && !file.setLastModified(System.currentTimeMillis())) {
throw new IOException("Unable to update modification time of " + file);
... | Creates an empty file or updates the last updated timestamp on the same as the unix command of
the same name.
@param file the file to create or update
@throws IOException if an I/O error occurs | java | android/guava/src/com/google/common/io/Files.java | 444 | [
"file"
] | void | true | 3 | 7.04 | google/guava | 51,352 | javadoc | false |
equals | @Override
public boolean equals(final Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof CharSet)) {
return false;
}
final CharSet other = (CharSet) obj;
return set.equals(other.set);
} | Compares two {@link CharSet} objects, returning true if they represent
exactly the same set of characters defined in the same way.
<p>The two sets {@code abc} and {@code a-c} are <em>not</em>
equal according to this method.</p>
@param obj the object to compare to
@return true if equal
@since 2.0 | java | src/main/java/org/apache/commons/lang3/CharSet.java | 238 | [
"obj"
] | true | 3 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
setOutput | void setOutput(@Nullable String output) {
if (output != null && output.endsWith("/")) {
this.output = output.substring(0, output.length() - 1);
this.extract = true;
}
else {
this.output = output;
}
} | The location of the generated project.
@return the location of the generated project | java | cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/ProjectGenerationRequest.java | 98 | [
"output"
] | void | true | 3 | 6.72 | spring-projects/spring-boot | 79,428 | javadoc | false |
as_unit | def as_unit(self, unit: TimeUnit) -> Self:
"""
Convert to a dtype with the given unit resolution.
This method is for converting the dtype of a ``DatetimeIndex`` or
``TimedeltaIndex`` to a new dtype with the given unit
resolution/precision.
Parameters
----------
... | Convert to a dtype with the given unit resolution.
This method is for converting the dtype of a ``DatetimeIndex`` or
``TimedeltaIndex`` to a new dtype with the given unit
resolution/precision.
Parameters
----------
unit : {'s', 'ms', 'us', 'ns'}
Returns
-------
same type as self
Converted to the specified unit.
... | python | pandas/core/indexes/datetimelike.py | 559 | [
"self",
"unit"
] | Self | true | 1 | 6.8 | pandas-dev/pandas | 47,362 | numpy | false |
validateAndGetRecordBatch | private RecordBatch validateAndGetRecordBatch() {
MemoryRecords memoryRecords = recordsBuilder.build();
Iterator<MutableRecordBatch> recordBatchIter = memoryRecords.batches().iterator();
if (!recordBatchIter.hasNext())
throw new IllegalStateException("Cannot split an empty producer ... | Finalize the state of a batch. Final state, once set, is immutable. This function may be called
once or twice on a batch. It may be called twice if
1. An inflight batch expires before a response from the broker is received. The batch's final
state is set to FAILED. But it could succeed on the broker and second time aro... | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerBatch.java | 330 | [] | RecordBatch | true | 5 | 8.08 | apache/kafka | 31,560 | javadoc | false |
toSupplier | private static Supplier<String> toSupplier(final String message, final Object... values) {
return () -> getMessage(message, values);
} | Validate that the specified argument is not {@code null};
otherwise throwing an exception with the specified message.
<pre>Validate.notNull(myObject, "The object must not be null");</pre>
@param <T> the object type.
@param object the object to check.
@param message the {@link String#format(String, Object...)} excepti... | java | src/main/java/org/apache/commons/lang3/Validate.java | 1,064 | [
"message"
] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
readFrom | long readFrom(ScatteringByteChannel channel) throws IOException; | Read bytes into this receive from the given channel
@param channel The channel to read from
@return The number of bytes read
@throws IOException If the reading fails | java | clients/src/main/java/org/apache/kafka/common/network/Receive.java | 44 | [
"channel"
] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
join | public StringBuilder join(final StringBuilder stringBuilder, @SuppressWarnings("unchecked") final T... elements) {
return joinSB(stringBuilder, prefix, suffix, delimiter, appender, elements);
} | Joins stringified objects from the given array into a StringBuilder.
@param stringBuilder The target.
@param elements The source.
@return the given target StringBuilder. | java | src/main/java/org/apache/commons/lang3/AppendableJoiner.java | 283 | [
"stringBuilder"
] | StringBuilder | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false |
unpark | void unpark() {
// This is racy with removeWaiter. The consequence of the race is that we may spuriously call
// unpark even though the thread has already removed itself from the list. But even if we did
// use a CAS, that race would still exist (it would just be ever so slightly smaller).
Threa... | Constructor for the TOMBSTONE, avoids use of ATOMIC_HELPER in case this class is loaded
before the ATOMIC_HELPER. Apparently this is possible on some android platforms. | java | android/guava/src/com/google/common/util/concurrent/AbstractFutureState.java | 324 | [] | void | true | 2 | 7.04 | google/guava | 51,352 | javadoc | false |
_set_name | def _set_name(self, name, inplace: bool = False) -> Series:
"""
Set the Series name.
Parameters
----------
name : str
inplace : bool
Whether to modify `self` directly or return a copy.
"""
inplace = validate_bool_kwarg(inplace, "inplace")
... | Set the Series name.
Parameters
----------
name : str
inplace : bool
Whether to modify `self` directly or return a copy. | python | pandas/core/series.py | 1,902 | [
"self",
"name",
"inplace"
] | Series | true | 2 | 6.56 | pandas-dev/pandas | 47,362 | numpy | false |
_despine | def _despine(ax):
"""Remove the top and right spines of the plot.
Parameters
----------
ax : matplotlib.axes.Axes
The axes of the plot to despine.
"""
for s in ["top", "right"]:
ax.spines[s].set_visible(False)
for s in ["bottom", "left"]:
ax.spines[s].set_bounds(0, 1... | Remove the top and right spines of the plot.
Parameters
----------
ax : matplotlib.axes.Axes
The axes of the plot to despine. | python | sklearn/utils/_plotting.py | 360 | [
"ax"
] | false | 3 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
withHook | public static <T> T withHook(SpringApplicationHook hook, ThrowingSupplier<T> action) {
applicationHook.set(hook);
try {
return action.get();
}
finally {
applicationHook.remove();
}
} | Perform the given action with the given {@link SpringApplicationHook} attached if
the action triggers an {@link SpringApplication#run(String...) application run}.
@param <T> the result type
@param hook the hook to apply
@param action the action to run
@return the result of the action
@since 3.0.0
@see #withHook(SpringA... | java | core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java | 1,462 | [
"hook",
"action"
] | T | true | 1 | 6.4 | spring-projects/spring-boot | 79,428 | javadoc | false |
format | @Deprecated
StringBuffer format(long millis, StringBuffer buf); | Formats a millisecond {@code long} value into the
supplied {@link StringBuffer}.
@param millis the millisecond value to format.
@param buf the buffer to format into.
@return the specified string buffer.
@deprecated Use {{@link #format(long, Appendable)}. | java | src/main/java/org/apache/commons/lang3/time/DatePrinter.java | 139 | [
"millis",
"buf"
] | StringBuffer | true | 1 | 6.16 | apache/commons-lang | 2,896 | javadoc | false |
_extract_multi_indexer_columns | def _extract_multi_indexer_columns(
self,
header,
index_names: Sequence[Hashable] | None,
passed_names: bool = False,
) -> tuple[
Sequence[Hashable], Sequence[Hashable] | None, Sequence[Hashable] | None, bool
]:
"""
Extract and return the names, index_name... | Extract and return the names, index_names, col_names if the column
names are a MultiIndex.
Parameters
----------
header: list of lists
The header rows
index_names: list, optional
The names of the future index
passed_names: bool, default False
A flag specifying if names where passed | python | pandas/io/parsers/base_parser.py | 190 | [
"self",
"header",
"index_names",
"passed_names"
] | tuple[
Sequence[Hashable], Sequence[Hashable] | None, Sequence[Hashable] | None, bool
] | true | 10 | 6.64 | pandas-dev/pandas | 47,362 | numpy | false |
finish | protected void finish() throws IOException {
if (sawReturn || line.length() > 0) {
finishLine(false);
}
} | Subclasses must call this method after finishing character processing, in order to ensure that
any unterminated line in the buffer is passed to {@link #handleLine}.
@throws IOException if an I/O error occurs | java | android/guava/src/com/google/common/io/LineBuffer.java | 104 | [] | void | true | 3 | 6.4 | google/guava | 51,352 | javadoc | false |
find_valid_index | def find_valid_index(how: str, is_valid: npt.NDArray[np.bool_]) -> int | None:
"""
Retrieves the positional index of the first valid value.
Parameters
----------
how : {'first', 'last'}
Use this parameter to change between the first or last valid index.
is_valid: np.ndarray
Mask... | Retrieves the positional index of the first valid value.
Parameters
----------
how : {'first', 'last'}
Use this parameter to change between the first or last valid index.
is_valid: np.ndarray
Mask to find na_values.
Returns
-------
int or None | python | pandas/core/missing.py | 239 | [
"how",
"is_valid"
] | int | None | true | 6 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
resetPositionsIfNeeded | public void resetPositionsIfNeeded() {
Map<TopicPartition, AutoOffsetResetStrategy> partitionAutoOffsetResetStrategyMap =
offsetFetcherUtils.getOffsetResetStrategyForPartitions();
if (partitionAutoOffsetResetStrategyMap.isEmpty())
return;
resetPositionsAsync(partiti... | Reset offsets for all assigned partitions that require it.
@throws org.apache.kafka.clients.consumer.NoOffsetForPartitionException If no offset reset strategy is defined
and one or more partitions aren't awaiting a seekToBeginning() or seekToEnd(). | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetFetcher.java | 103 | [] | void | true | 2 | 6.24 | apache/kafka | 31,560 | javadoc | false |
isSupportedType | public static boolean isSupportedType(EventListener listener) {
for (Class<?> type : SUPPORTED_TYPES) {
if (ClassUtils.isAssignableValue(type, listener)) {
return true;
}
}
return false;
} | Returns {@code true} if the specified listener is one of the supported types.
@param listener the listener to test
@return if the listener is of a supported type | java | core/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBean.java | 132 | [
"listener"
] | true | 2 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false | |
toString | @Override
public String toString() {
return "ListTransactionsOptions(" +
"filteredStates=" + filteredStates +
", filteredProducerIds=" + filteredProducerIds +
", filteredDuration=" + filteredDuration +
", filteredTransactionalIdPattern=" + filteredTransactiona... | Returns transactional ID being filtered.
@return the current transactional ID pattern filter (empty means no transactional IDs are filtered and all
transactions will be returned) | java | clients/src/main/java/org/apache/kafka/clients/admin/ListTransactionsOptions.java | 126 | [] | String | true | 1 | 6.08 | apache/kafka | 31,560 | javadoc | false |
rebucket | private void rebucket() {
rebucketCount++;
LongKeyedBucketOrds oldOrds = bucketOrds;
boolean success = false;
try {
long[] mergeMap = new long[Math.toIntExact(oldOrds.size())];
bucketOrds = new LongKeyedBucketOrds.FromMany(bigArrays());
... | Increase the rounding of {@code owningBucketOrd} using
estimated, bucket counts, {@link FromMany#rebucket() rebucketing} the all
buckets if the estimated number of wasted buckets is too high. | java | modules/aggregations/src/main/java/org/elasticsearch/aggregations/bucket/histogram/AutoDateHistogramAggregator.java | 568 | [] | void | true | 6 | 6.24 | elastic/elasticsearch | 75,680 | javadoc | false |
getNonSingletonFactoryBeanForTypeCheck | private @Nullable FactoryBean<?> getNonSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
if (isPrototypeCurrentlyInCreation(beanName)) {
return null;
}
Object instance;
try {
// Mark this bean as currently in creation, even if just partially.
beforePrototypeCreation(beanName)... | Obtain a "shortcut" non-singleton FactoryBean instance to use for a
{@code getObjectType()} call, without full initialization of the FactoryBean.
@param beanName the name of the bean
@param mbd the bean definition for the bean
@return the FactoryBean instance, or {@code null} to indicate
that we couldn't obtain a short... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java | 1,068 | [
"beanName",
"mbd"
] | true | 6 | 7.76 | spring-projects/spring-framework | 59,386 | javadoc | false | |
visitImportEqualsDeclaration | function visitImportEqualsDeclaration(node: ImportEqualsDeclaration): VisitResult<Statement | undefined> {
Debug.assert(isExternalModuleImportEqualsDeclaration(node), "import= for internal module references should be handled in an earlier transformer.");
let statements: Statement[] | undefined;
... | Visits an ImportEqualsDeclaration node.
@param node The node to visit. | typescript | src/compiler/transformers/module/esnextAnd2015.ts | 261 | [
"node"
] | true | 2 | 6.4 | microsoft/TypeScript | 107,154 | jsdoc | false | |
partitions | public Set<TopicPartition> partitions() {
return Collections.unmodifiableSet(records.keySet());
} | Get the partitions which have records contained in this record set.
@return the set of partitions with data in this record set (may be empty if no data was returned) | java | clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRecords.java | 92 | [] | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
partial_fit | def partial_fit(self, X, y, classes=None, sample_weight=None):
"""Incremental fit on a batch of samples.
This method is expected to be called several times consecutively
on different chunks of a dataset so as to implement out-of-core
or online learning.
This is especially usefu... | Incremental fit on a batch of samples.
This method is expected to be called several times consecutively
on different chunks of a dataset so as to implement out-of-core
or online learning.
This is especially useful when the whole dataset is too big to fit in
memory at once.
This method has some performance overhead h... | python | sklearn/naive_bayes.py | 664 | [
"self",
"X",
"y",
"classes",
"sample_weight"
] | false | 7 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
insertMACSeparators | private static String insertMACSeparators(String v) {
// Check that the length is correct for a MAC address without separators.
// And check that there isn't already a separator in the string.
if ((v.length() != EUI48_HEX_LENGTH && v.length() != EUI64_HEX_LENGTH)
|| v.charAt(2) == ':... | A utility method for determining whether a string contains only digits, possibly with a leading '+' or '-'.
That is, does this string have any hope of being parse-able as a Long? | java | modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/CefParser.java | 580 | [
"v"
] | String | true | 9 | 6 | elastic/elasticsearch | 75,680 | javadoc | false |
translateDisplayDataOutput | function translateDisplayDataOutput(
output: nbformat.IDisplayData | nbformat.IDisplayUpdate | nbformat.IExecuteResult
): NotebookCellOutput {
// Metadata could be as follows:
// We'll have metadata specific to each mime type as well as generic metadata.
/*
IDisplayData = {
output_type: 'display_data',
data: {... | Concatenates a multiline string or an array of strings into a single string.
Also normalizes line endings to use LF (`\n`) instead of CRLF (`\r\n`).
Same is done in serializer as well. | typescript | extensions/ipynb/src/deserializers.ts | 206 | [
"output"
] | true | 2 | 6 | microsoft/vscode | 179,840 | jsdoc | false | |
readFully | public static int readFully(InputStream reader, byte[] dest, int offset, int len) throws IOException {
int read = 0;
while (read < len) {
final int r = reader.read(dest, offset + read, len - read);
if (r == -1) {
break;
}
read += r;
... | 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 | 127 | [
"reader",
"dest",
"offset",
"len"
] | true | 3 | 7.92 | elastic/elasticsearch | 75,680 | javadoc | false | |
lagcompanion | def lagcompanion(c):
"""
Return the companion matrix of c.
The usual companion matrix of the Laguerre polynomials is already
symmetric when `c` is a basis Laguerre polynomial, so no scaling is
applied.
Parameters
----------
c : array_like
1-D array of Laguerre series coefficien... | Return the companion matrix of c.
The usual companion matrix of the Laguerre polynomials is already
symmetric when `c` is a basis Laguerre polynomial, so no scaling is
applied.
Parameters
----------
c : array_like
1-D array of Laguerre series coefficients ordered from low to high
degree.
Returns
-------
mat ... | python | numpy/polynomial/laguerre.py | 1,421 | [
"c"
] | false | 3 | 7.52 | numpy/numpy | 31,054 | numpy | false | |
mean_variance_axis | def mean_variance_axis(X, axis, weights=None, return_sum_weights=False):
"""Compute mean and variance along an axis on a CSR or CSC matrix.
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
Input data. It can be of CSR or CSC format.
axis : {0, 1}
Axis along ... | Compute mean and variance along an axis on a CSR or CSC matrix.
Parameters
----------
X : sparse matrix of shape (n_samples, n_features)
Input data. It can be of CSR or CSC format.
axis : {0, 1}
Axis along which the axis should be computed.
weights : ndarray of shape (n_samples,) or (n_features,), default=No... | python | sklearn/utils/sparsefuncs.py | 101 | [
"X",
"axis",
"weights",
"return_sum_weights"
] | false | 10 | 7.6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
assignOwnedPartitions | private void assignOwnedPartitions() {
for (Map.Entry<String, List<TopicPartition>> consumerEntry : currentAssignment.entrySet()) {
String consumer = consumerEntry.getKey();
List<TopicPartition> ownedPartitions = consumerEntry.getValue().stream()
.fil... | Constructs a constrained assignment builder.
@param partitionsPerTopic The partitions for each subscribed topic
@param rackInfo Rack information for consumers and racks
@param consumerToOwnedPartitions Each consumer's previously owned and still-subscribed partiti... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractStickyAssignor.java | 666 | [] | void | true | 9 | 6 | apache/kafka | 31,560 | javadoc | false |
_translate_header | def _translate_header(self, sparsify_cols: bool, max_cols: int):
"""
Build each <tr> within table <head> as a list
Using the structure:
+----------------------------+---------------+---------------------------+
| index_blanks ... | column_name_0 | column_hea... | Build each <tr> within table <head> as a list
Using the structure:
+----------------------------+---------------+---------------------------+
| index_blanks ... | column_name_0 | column_headers (level_0) |
1) | .. | .. | .. |
| inde... | python | pandas/io/formats/style_render.py | 399 | [
"self",
"sparsify_cols",
"max_cols"
] | true | 9 | 6.32 | pandas-dev/pandas | 47,362 | numpy | false | |
_bisect_failing_config_helper | def _bisect_failing_config_helper(
self, results: ResultType, failing_config: list[tuple[str, Any]]
) -> Optional[ConfigType]:
"""
Bisect a failing configuration to find minimal set of configs that cause failure.
Splits it into halves, then fourths, then tries dropping configs one-b... | Bisect a failing configuration to find minimal set of configs that cause failure.
Splits it into halves, then fourths, then tries dropping configs one-by-one. | python | torch/_inductor/fuzzer.py | 849 | [
"self",
"results",
"failing_config"
] | Optional[ConfigType] | true | 13 | 6 | pytorch/pytorch | 96,034 | unknown | false |
valueIterator | @Override
UnmodifiableIterator<V> valueIterator() {
return new UnmodifiableIterator<V>() {
final Iterator<? extends ImmutableCollection<V>> valueCollectionItr = map.values().iterator();
Iterator<V> valueItr = emptyIterator();
@Override
public boolean hasNext() {
return valueItr.ha... | Returns an immutable collection of the values in this multimap. Its iterator traverses the
values for the first key, the values for the second key, and so on. | java | android/guava/src/com/google/common/collect/ImmutableMultimap.java | 770 | [] | true | 3 | 6.88 | google/guava | 51,352 | javadoc | false | |
of | static SslBundleKey of(@Nullable String password, @Nullable String alias) {
return new SslBundleKey() {
@Override
public @Nullable String getPassword() {
return password;
}
@Override
public @Nullable String getAlias() {
return alias;
}
@Override
public String toString() {
ToStri... | Factory method to create a new {@link SslBundleKey} instance.
@param password the password used to access the key
@param alias the alias of the key
@return a new {@link SslBundleKey} instance | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/SslBundleKey.java | 87 | [
"password",
"alias"
] | SslBundleKey | true | 2 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false |
chain_as_binary_tree | def chain_as_binary_tree(*tasks):
# type: (BaseOperator) -> None
"""
Chain tasks as a binary tree where task i is child of task (i - 1) // 2.
Example:
t0 -> t1 -> t3 -> t7
| \
| -> t4 -> t8
|
-> t2 -> t5 -> t9
\
->... | Chain tasks as a binary tree where task i is child of task (i - 1) // 2.
Example:
t0 -> t1 -> t3 -> t7
| \
| -> t4 -> t8
|
-> t2 -> t5 -> t9
\
-> t6 | python | performance/src/performance_dags/performance_dag/performance_dag.py | 130 | [] | false | 2 | 7.12 | apache/airflow | 43,597 | unknown | false | |
stream | public Stream<O> stream() {
return stream;
} | Converts the FailableStream into an equivalent stream.
@return A stream, which will return the same elements, which this FailableStream would return. | java | src/main/java/org/apache/commons/lang3/Streams.java | 450 | [] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
get | @Override
public ImmutableList<V> get(K key) {
// This cast is safe as its type is known in constructor.
ImmutableList<V> list = (ImmutableList<V>) map.get(key);
return (list == null) ? ImmutableList.of() : list;
} | Returns an immutable list of the values for the given key. If no mappings in the multimap have
the provided key, an empty immutable list is returned. The values are in the same order as the
parameters used to build this multimap. | java | android/guava/src/com/google/common/collect/ImmutableListMultimap.java | 456 | [
"key"
] | true | 2 | 6 | google/guava | 51,352 | javadoc | false | |
_extend_region | def _extend_region(steep_point, xward_point, start, min_samples):
"""Extend the area until it's maximal.
It's the same function for both upward and downward reagions, depending on
the given input parameters. Assuming:
- steep_{upward/downward}: bool array indicating whether a point is a
... | Extend the area until it's maximal.
It's the same function for both upward and downward reagions, depending on
the given input parameters. Assuming:
- steep_{upward/downward}: bool array indicating whether a point is a
steep {upward/downward};
- upward/downward: bool array indicating whether a point is
... | python | sklearn/cluster/_optics.py | 922 | [
"steep_point",
"xward_point",
"start",
"min_samples"
] | false | 6 | 6 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
_cached_transform | def _cached_transform(
sub_pipeline, *, cache, param_name, param_value, transform_params
):
"""Transform a parameter value using a sub-pipeline and cache the result.
Parameters
----------
sub_pipeline : Pipeline
The sub-pipeline to be used for transformation.
cache : dict
The ca... | Transform a parameter value using a sub-pipeline and cache the result.
Parameters
----------
sub_pipeline : Pipeline
The sub-pipeline to be used for transformation.
cache : dict
The cache dictionary to store the transformed values.
param_name : str
The name of the parameter to be transformed.
param_value :... | python | sklearn/pipeline.py | 51 | [
"sub_pipeline",
"cache",
"param_name",
"param_value",
"transform_params"
] | false | 4 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
fill | public static float[] fill(final float[] a, final float val) {
if (a != null) {
Arrays.fill(a, val);
}
return a;
} | Fills and returns the given array, assigning the given {@code float} value to each element of the array.
@param a the array to be filled (may be null).
@param val the value to be stored in all elements of the array.
@return the given array.
@see Arrays#fill(float[],float) | java | src/main/java/org/apache/commons/lang3/ArrayFill.java | 101 | [
"a",
"val"
] | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
_default | def _default(self, name: str, args: tuple[Any, ...], kwargs: dict[str, Any]) -> Any:
"""
Default implementation for all ops. Override in a subclass to
provide generic op behavior.
Args:
name: name of the op, see OpHandler.{name}
args: positional args passed to t... | Default implementation for all ops. Override in a subclass to
provide generic op behavior.
Args:
name: name of the op, see OpHandler.{name}
args: positional args passed to the op
kwargs: keyword args passed to the op
Returns:
return value of the op | python | torch/_inductor/ops_handler.py | 751 | [
"self",
"name",
"args",
"kwargs"
] | Any | true | 1 | 6.88 | pytorch/pytorch | 96,034 | google | false |
containsNamedArgument | public boolean containsNamedArgument() {
for (ValueHolder valueHolder : this.indexedArgumentValues.values()) {
if (valueHolder.getName() != null) {
return true;
}
}
for (ValueHolder valueHolder : this.genericArgumentValues) {
if (valueHolder.getName() != null) {
return true;
}
}
return fal... | Determine whether at least one argument value refers to a name.
@since 6.0.3
@see ValueHolder#getName() | java | spring-beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java | 361 | [] | true | 3 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false | |
format | @Override
public <B extends Appendable> B format(final Calendar calendar, final B buf) {
// Don't edit the given Calendar, clone it only if needed.
Calendar actual = calendar;
if (!calendar.getTimeZone().equals(timeZone)) {
actual = (Calendar) calendar.clone();
actual... | 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,129 | [
"calendar",
"buf"
] | B | true | 2 | 8.4 | apache/commons-lang | 2,896 | javadoc | false |
wrap | public static String wrap(final String str, final char wrapWith) {
if (isEmpty(str) || wrapWith == CharUtils.NUL) {
return str;
}
return wrapWith + str + wrapWith;
} | Wraps a string with a char.
<pre>
StringUtils.wrap(null, *) = null
StringUtils.wrap("", *) = ""
StringUtils.wrap("ab", '\0') = "ab"
StringUtils.wrap("ab", 'x') = "xabx"
StringUtils.wrap("ab", '\'') = "'ab'"
StringUtils.wrap("\"ab\"", '\"') = "\"\"ab\"\""
</pre>
@param str the string to... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 9,070 | [
"str",
"wrapWith"
] | String | true | 3 | 7.76 | apache/commons-lang | 2,896 | javadoc | false |
createDecompressInterceptor | function createDecompressInterceptor (options = {}) {
// Emit experimental warning only once
if (!warningEmitted) {
process.emitWarning(
'DecompressInterceptor is experimental and subject to change',
'ExperimentalWarning'
)
warningEmitted = true
}
return (dispatch) => {
return (opts... | Creates a decompression interceptor for HTTP responses
@param {DecompressHandlerOptions} [options] - Options for the interceptor
@returns {Function} - Interceptor function | javascript | deps/undici/src/lib/interceptor/decompress.js | 235 | [] | false | 2 | 6 | nodejs/node | 114,839 | jsdoc | false | |
shouldRecord | public boolean shouldRecord() {
return this.recordingLevel.shouldRecord(config.recordLevel().id);
} | @return true if the sensor's record level indicates that the metric will be recorded, false otherwise | java | clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java | 176 | [] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.