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
_categorize_entities
def _categorize_entities( self, entities: Sequence[str | BulkTaskInstanceBody], results: BulkActionResponse, ) -> tuple[set[tuple[str, str, str, int]], set[tuple[str, str, str]]]: """ Validate entities and categorize them into specific and all map index update sets. ...
Validate entities and categorize them into specific and all map index update sets. :param entities: Sequence of entities to validate :param results: BulkActionResponse object to track errors :return: tuple of (specific_map_index_task_keys, all_map_index_task_keys)
python
airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
194
[ "self", "entities", "results" ]
tuple[set[tuple[str, str, str, int]], set[tuple[str, str, str]]]
true
8
7.44
apache/airflow
43,597
sphinx
false
_fetch_from_db
def _fetch_from_db(model_reference: Mapped, session=None, **conditions) -> datetime | None: """ Fetch a datetime value from the database using the provided model reference and filtering conditions. For example, to fetch a TaskInstance's start_date: _fetch_from_db( TaskInstance.start_dat...
Fetch a datetime value from the database using the provided model reference and filtering conditions. For example, to fetch a TaskInstance's start_date: _fetch_from_db( TaskInstance.start_date, dag_id='example_dag', task_id='example_task', run_id='example_run' ) This generates SQL equivalent to: S...
python
airflow-core/src/airflow/models/deadline.py
435
[ "model_reference", "session" ]
datetime | None
true
4
6.24
apache/airflow
43,597
sphinx
false
getAndClearFatalError
public Optional<Throwable> getAndClearFatalError() { Optional<Throwable> fatalError = this.fatalError; this.fatalError = Optional.empty(); return fatalError; }
Returns the current coordinator node. @return the current coordinator node.
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CoordinatorRequestManager.java
256
[]
true
1
6.4
apache/kafka
31,560
javadoc
false
bindLabeledStatement
function bindLabeledStatement(node: LabeledStatement): void { const postStatementLabel = createBranchLabel(); activeLabelList = { next: activeLabelList, name: node.label.escapedText, breakTarget: postStatementLabel, continueTarget: undefined, ...
Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. @param symbolTable - The symbol table which node will be added to. @param parent - node's parent declaration. @param node - The declaration to be added to the symbol table @param includes - The SymbolFlags that n...
typescript
src/compiler/binder.ts
1,789
[ "node" ]
true
2
6.72
microsoft/TypeScript
107,154
jsdoc
false
isActive
boolean isActive(@Nullable ConfigDataActivationContext activationContext) { if (activationContext == null) { return false; } CloudPlatform cloudPlatform = activationContext.getCloudPlatform(); boolean activate = isActive((cloudPlatform != null) ? cloudPlatform : CloudPlatform.NONE); activate = activa...
Return {@code true} if the properties indicate that the config data property source is active for the given activation context. @param activationContext the activation context @return {@code true} if the config data property source is active
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java
122
[ "activationContext" ]
true
4
7.6
spring-projects/spring-boot
79,428
javadoc
false
_from_sequence_of_strings
def _from_sequence_of_strings( cls, strings, *, dtype: ExtensionDtype, copy: bool = False ) -> Self: """ Construct a new ExtensionArray from a sequence of strings. Parameters ---------- strings : Sequence Each element will be an instance of the scalar typ...
Construct a new ExtensionArray from a sequence of strings. Parameters ---------- strings : Sequence Each element will be an instance of the scalar type for this array, ``cls.dtype.type``. dtype : ExtensionDtype Construct for this particular dtype. This should be a Dtype compatible with the ExtensionArr...
python
pandas/core/arrays/base.py
320
[ "cls", "strings", "dtype", "copy" ]
Self
true
1
6.64
pandas-dev/pandas
47,362
numpy
false
readBytes
@Deprecated @InlineMe( replacement = "Files.asByteSource(file).read(processor)", imports = "com.google.common.io.Files") @CanIgnoreReturnValue // some processors won't return a useful result @ParametricNullness public static <T extends @Nullable Object> T readBytes(File file, ByteProcessor<T> proc...
Process the bytes of a file. <p>(If this seems too complicated, maybe you're looking for {@link #toByteArray}.) @param file the file to read @param processor the object to which the bytes of the file are passed. @return the result of the byte processor @throws IOException if an I/O error occurs @deprecated Prefer {@cod...
java
android/guava/src/com/google/common/io/Files.java
599
[ "file", "processor" ]
T
true
1
6.88
google/guava
51,352
javadoc
false
getDefaultType
@Nullable ProjectType getDefaultType() { if (this.projectTypes.getDefaultItem() != null) { return this.projectTypes.getDefaultItem(); } String defaultTypeId = getDefaults().get("type"); if (defaultTypeId != null) { return this.projectTypes.getContent().get(defaultTypeId); } return null; }
Return the default type to use or {@code null} if the metadata does not define any default. @return the default project type or {@code null}
java
cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrServiceMetadata.java
111
[]
ProjectType
true
3
8.24
spring-projects/spring-boot
79,428
javadoc
false
ensureCapacity
private void ensureCapacity(int needed) { if (buffer.remaining() >= needed) { return; } int currentCapacity = buffer.capacity(); int requiredCapacity = buffer.position() + needed; int newCapacity = Math.max(currentCapacity * 2, requiredCapacity); ByteBuffer newBuffer = Byte...
Resizes the buffer if necessary. Guaranteed to leave `buffer` in Write Mode ready for new data.
java
android/guava/src/com/google/common/hash/AbstractNonStreamingHashFunction.java
88
[ "needed" ]
void
true
2
6
google/guava
51,352
javadoc
false
torch_version_hash
def torch_version_hash() -> str: """Get base64-encoded PyTorch version hash. Returns: A base64-encoded string representing the PyTorch version hash. """ from torch._inductor.codecache import torch_key return b64encode(torch_key()).decode()
Get base64-encoded PyTorch version hash. Returns: A base64-encoded string representing the PyTorch version hash.
python
torch/_inductor/runtime/caching/context.py
144
[]
str
true
1
6.24
pytorch/pytorch
96,034
unknown
false
property
function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); }
Creates a function that returns the value at `path` of a given object. @static @memberOf _ @since 2.4.0 @category Util @param {Array|string} path The path of the property to get. @returns {Function} Returns the new accessor function. @example var objects = [ { 'a': { 'b': 2 } }, { 'a': { 'b': 1 } } ]; _.map(objects...
javascript
lodash.js
16,021
[ "path" ]
false
2
7.6
lodash/lodash
61,490
jsdoc
false
take
def take( self: MultiIndex, indices, axis: Axis = 0, allow_fill: bool = True, fill_value=None, **kwargs, ) -> MultiIndex: """ Return a new MultiIndex of the values selected by the indices. For internal compatibility with numpy arrays. ...
Return a new MultiIndex of the values selected by the indices. For internal compatibility with numpy arrays. Parameters ---------- indices : array-like Indices to be taken. axis : {0 or 'index'}, optional The axis over which to select values, always 0 or 'index'. allow_fill : bool, default True How to han...
python
pandas/core/indexes/multi.py
2,289
[ "self", "indices", "axis", "allow_fill", "fill_value" ]
MultiIndex
true
6
8.4
pandas-dev/pandas
47,362
numpy
false
_get_module_class_registry
def _get_module_class_registry( module_filepath: Path, module_name: str, class_extras: dict[str, Callable] ) -> dict[str, dict[str, Any]]: """ Extracts classes and its information from a Python module file. The function parses the specified module file and registers all classes. The registry for ea...
Extracts classes and its information from a Python module file. The function parses the specified module file and registers all classes. The registry for each class includes the module filename, methods, base classes and any additional class extras provided. :param module_filepath: The file path of the module. :param...
python
devel-common/src/sphinx_exts/providers_extensions.py
150
[ "module_filepath", "module_name", "class_extras" ]
dict[str, dict[str, Any]]
true
1
7.04
apache/airflow
43,597
sphinx
false
h3ToChildrenSize
public static long h3ToChildrenSize(long h3, int childRes) { final int parentRes = H3Index.H3_get_resolution(h3); if (childRes <= parentRes || childRes > MAX_H3_RES) { throw new IllegalArgumentException("Invalid child resolution [" + childRes + "]"); } final int n = childRes ...
h3ToChildrenSize returns the exact number of children for a cell at a given child resolution. @param h3 H3Index to find the number of children of @param childRes The child resolution you're interested in @return long Exact number of children (handles hexagons and pentagons correctly)
java
libs/h3/src/main/java/org/elasticsearch/h3/H3.java
452
[ "h3", "childRes" ]
true
4
7.76
elastic/elasticsearch
75,680
javadoc
false
_find_buffers_with_changed_last_use
def _find_buffers_with_changed_last_use( candidate: BaseSchedulerNode, gns: list[BaseSchedulerNode], buf_to_snode_last_use: dict, candidate_buffer_map: dict[BaseSchedulerNode, OrderedSet], ) -> dict[BaseSchedulerNode, list[Union[FreeableInputBuffer, Any]]]: """ Find buffers whose last use will c...
Find buffers whose last use will change after swapping candidate with group. When we swap [candidate [group]] to [[group] candidate], some buffers that were last used by a group node will now be last used by candidate instead. This affects memory deallocation timing. Args: candidate: The node being moved gns:...
python
torch/_inductor/comms.py
687
[ "candidate", "gns", "buf_to_snode_last_use", "candidate_buffer_map" ]
dict[BaseSchedulerNode, list[Union[FreeableInputBuffer, Any]]]
true
3
8.08
pytorch/pytorch
96,034
google
false
compress_nd
def compress_nd(x, axis=None): """Suppress slices from multiple dimensions which contain masked values. Parameters ---------- x : array_like, MaskedArray The array to operate on. If not a MaskedArray instance (or if no array elements are masked), `x` is interpreted as a MaskedArray with...
Suppress slices from multiple dimensions which contain masked values. Parameters ---------- x : array_like, MaskedArray The array to operate on. If not a MaskedArray instance (or if no array elements are masked), `x` is interpreted as a MaskedArray with `mask` set to `nomask`. axis : tuple of ints or int, ...
python
numpy/ma/extras.py
841
[ "x", "axis" ]
false
7
7.76
numpy/numpy
31,054
numpy
false
isKeyable
function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); }
Checks if `value` is suitable for use as unique object key. @private @param {*} value The value to check. @returns {boolean} Returns `true` if `value` is suitable, else `false`.
javascript
lodash.js
6,425
[ "value" ]
false
5
6.24
lodash/lodash
61,490
jsdoc
false
resolveFilePath
@Nullable String resolveFilePath(String location, Resource resource);
Return the {@code path} of the given resource if it can also be represented as a {@link FileSystemResource}. @param location the location used to create the resource @param resource the resource to check @return the file path of the resource or {@code null} if the it is not possible to represent the resource as a {@lin...
java
core/spring-boot/src/main/java/org/springframework/boot/io/ApplicationResourceLoader.java
243
[ "location", "resource" ]
String
true
1
6.32
spring-projects/spring-boot
79,428
javadoc
false
copy
public static long copy(final InputStream in, final OutputStream out, byte[] buffer, boolean close) throws IOException { Exception err = null; try { long byteCount = 0; int bytesRead; while ((bytesRead = in.read(buffer)) != -1) { out.write(buffer, 0, b...
Copy the contents of the given InputStream to the given OutputStream. Optionally, closes both streams when done. @param in the stream to copy from @param out the stream to copy to @param close whether to close both streams after copying @param buffer buffer to use for copying @return the number of bytes copied ...
java
libs/core/src/main/java/org/elasticsearch/core/Streams.java
41
[ "in", "out", "buffer", "close" ]
true
4
7.92
elastic/elasticsearch
75,680
javadoc
false
softmax
def softmax(X, copy=True): """ Calculate the softmax function. The softmax function is calculated by np.exp(X) / np.sum(np.exp(X), axis=1) This will cause overflow when large values are exponentiated. Hence the largest value in each row is subtracted from each data point to prevent this. ...
Calculate the softmax function. The softmax function is calculated by np.exp(X) / np.sum(np.exp(X), axis=1) This will cause overflow when large values are exponentiated. Hence the largest value in each row is subtracted from each data point to prevent this. Parameters ---------- X : array-like of float of shape (M, ...
python
sklearn/utils/extmath.py
981
[ "X", "copy" ]
false
4
6.08
scikit-learn/scikit-learn
64,340
numpy
false
getProperty
@SuppressWarnings("unchecked") private <T> @Nullable T getProperty(PropertyResolver resolver, String key, Class<T> type) { try { return resolver.getProperty(key, type); } catch (ConversionFailedException | ConverterNotFoundException ex) { if (type != DataSize.class) { throw ex; } String value = r...
Create a new {@link LoggingSystemProperties} instance. @param environment the source environment @param defaultValueResolver function used to resolve default values or {@code null} @param setter setter used to apply the property or {@code null} for system properties @since 3.2.0
java
core/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystemProperties.java
115
[ "resolver", "key", "type" ]
T
true
3
6.24
spring-projects/spring-boot
79,428
javadoc
false
codes
def codes(self) -> FrozenList: """ Codes of the MultiIndex. Codes are the position of the index value in the list of level values for each level. Returns ------- tuple of numpy.ndarray The codes of the MultiIndex. Each array in the tuple corresponds ...
Codes of the MultiIndex. Codes are the position of the index value in the list of level values for each level. Returns ------- tuple of numpy.ndarray The codes of the MultiIndex. Each array in the tuple corresponds to a level in the MultiIndex. See Also -------- MultiIndex.set_codes : Set new codes on MultiI...
python
pandas/core/indexes/multi.py
1,107
[ "self" ]
FrozenList
true
1
6.08
pandas-dev/pandas
47,362
unknown
false
getEnginesCommitHash
function getEnginesCommitHash(): string { const npmEnginesVersion = dependenciesPrismaEnginesPkg['@prisma/engines-version'] const sha1Pattern = /\b[0-9a-f]{5,40}\b/ const commitHash = npmEnginesVersion.match(sha1Pattern)![0] return commitHash }
Only used when publishing to the `dev` and `integration` npm channels (see `getNewDevVersion()` and `getNewIntegrationVersion()`) @returns The next minor version for the `latest` channel Example: If latest is `4.9.0` it will return `4.10.0`
typescript
scripts/ci/publish.ts
636
[]
true
1
6.08
prisma/prisma
44,834
jsdoc
false
_decode32Bits
private int _decode32Bits() throws IOException { int ptr = _inputPtr; if ((ptr + 3) >= _inputEnd) { return _slow32(); } final byte[] b = _inputBuffer; int v = (b[ptr++] << 24) + ((b[ptr++] & 0xFF) << 16) + ((b[ptr++] & 0xFF) << 8) + (b[ptr++] & 0xFF); _inputPt...
Method used to decode explicit length of a variable-length value (or, for indefinite/chunked, indicate that one is not known). Note that long (64-bit) length is only allowed if it fits in 32-bit signed int, for now; expectation being that longer values are always encoded as chunks.
java
libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/cbor/ESCborParser.java
167
[]
true
2
6.88
elastic/elasticsearch
75,680
javadoc
false
createCollection
@Override Set<V> createCollection() { return Platform.newLinkedHashSetWithExpectedSize(valueSetCapacity); }
{@inheritDoc} <p>Creates an empty {@code LinkedHashSet} for a collection of values for one key. @return a new {@code LinkedHashSet} containing a collection of values for one key
java
android/guava/src/com/google/common/collect/LinkedHashMultimap.java
178
[]
true
1
6.48
google/guava
51,352
javadoc
false
close
@Override public void close() { if (closed == false) { closed = true; arrays.adjustBreaker(-SHALLOW_SIZE); Releasables.close(values); } }
Returns an upper bound on the number bytes that will be required to represent this histogram.
java
libs/tdigest/src/main/java/org/elasticsearch/tdigest/SortingDigest.java
164
[]
void
true
2
6.88
elastic/elasticsearch
75,680
javadoc
false
isAutowireCandidate
protected boolean isAutowireCandidate( String beanName, DependencyDescriptor descriptor, AutowireCandidateResolver resolver) throws NoSuchBeanDefinitionException { String bdName = transformedBeanName(beanName); if (containsBeanDefinition(bdName)) { return isAutowireCandidate(beanName, getMergedLocalBeanDe...
Determine whether the specified bean definition qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type. @param beanName the name of the bean definition to check @param descriptor the descriptor of the dependency to resolve @param resolver the AutowireCandidateRes...
java
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
914
[ "beanName", "descriptor", "resolver" ]
true
5
7.76
spring-projects/spring-framework
59,386
javadoc
false
get_rocm_bundler
def get_rocm_bundler() -> str: """ Get path to clang-offload-bundler. Uses PyTorch's ROCM_HOME detection. Returns: Path to bundler Raises: RuntimeError: If bundler is not found """ if ROCM_HOME is None: raise RuntimeError( "ROCm installation not found. "...
Get path to clang-offload-bundler. Uses PyTorch's ROCM_HOME detection. Returns: Path to bundler Raises: RuntimeError: If bundler is not found
python
torch/_inductor/rocm_multiarch_utils.py
42
[]
str
true
3
7.76
pytorch/pytorch
96,034
unknown
false
getDefaultEditor
public @Nullable PropertyEditor getDefaultEditor(Class<?> requiredType) { if (!this.defaultEditorsActive) { return null; } if (this.overriddenDefaultEditors == null && this.defaultEditorRegistrar != null) { this.defaultEditorRegistrar.registerCustomEditors(this); } if (this.overriddenDefaultEditors != n...
Retrieve the default editor for the given property type, if any. <p>Lazily registers the default editors, if they are active. @param requiredType type of the property @return the default editor, or {@code null} if none found @see #registerDefaultEditors
java
spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java
190
[ "requiredType" ]
PropertyEditor
true
7
7.76
spring-projects/spring-framework
59,386
javadoc
false
send
default void send(MimeMessagePreparator... mimeMessagePreparators) throws MailException { try { List<MimeMessage> mimeMessages = new ArrayList<>(mimeMessagePreparators.length); for (MimeMessagePreparator preparator : mimeMessagePreparators) { MimeMessage mimeMessage = createMimeMessage(); preparator.pre...
Send the JavaMail MIME messages prepared by the given MimeMessagePreparators. <p>Alternative way to prepare MimeMessage instances, instead of {@link #createMimeMessage()} and {@link #send(MimeMessage[])} calls. Takes care of proper exception conversion. @param mimeMessagePreparators the preparator to use @throws org.sp...
java
spring-context-support/src/main/java/org/springframework/mail/javamail/JavaMailSender.java
150
[]
void
true
4
6.24
spring-projects/spring-framework
59,386
javadoc
false
findLibSSL
async function findLibSSL(directory: string) { try { const dirContents = await fs.readdir(directory) return dirContents.find((value) => value.startsWith('libssl.so.') && !value.startsWith('libssl.so.0')) } catch (e) { if (e.code === 'ENOENT') { return undefined } throw e } }
Looks for libssl in specific directory @param directory @returns
typescript
packages/get-platform/src/getPlatform.ts
425
[ "directory" ]
false
4
6.32
prisma/prisma
44,834
jsdoc
true
lastIndexIn
public int lastIndexIn(CharSequence sequence) { for (int i = sequence.length() - 1; i >= 0; i--) { if (matches(sequence.charAt(i))) { return i; } } return -1; }
Returns the index of the last matching BMP character in a character sequence, or {@code -1} if no matching character is present. <p>The default implementation iterates over the sequence in reverse order calling {@link #matches} for each character. @param sequence the character sequence to examine from the end @return a...
java
android/guava/src/com/google/common/base/CharMatcher.java
584
[ "sequence" ]
true
3
8.08
google/guava
51,352
javadoc
false
add
Headers add(String key, byte[] value) throws IllegalStateException;
Creates and adds a header, to the end, returning if the operation succeeded. @param key of the header to be added; must not be null. @param value of the header to be added; may be null. @return this instance of the Headers, once the header is added. @throws IllegalStateException is thrown if headers are in a read-only ...
java
clients/src/main/java/org/apache/kafka/common/header/Headers.java
44
[ "key", "value" ]
Headers
true
1
6.64
apache/kafka
31,560
javadoc
false
toString
@Override public String toString() { return Double.toString(get()); }
Returns the String representation of the current value. @return the String representation of the current value
java
android/guava/src/com/google/common/util/concurrent/AtomicDouble.java
189
[]
String
true
1
6.8
google/guava
51,352
javadoc
false
getCustomTargetSource
protected @Nullable TargetSource getCustomTargetSource(Class<?> beanClass, String beanName) { // We can't create fancy target sources for directly registered singletons. if (this.customTargetSourceCreators != null && this.beanFactory != null && this.beanFactory.containsBean(beanName)) { for (TargetSourceCrea...
Create a target source for bean instances. Uses any TargetSourceCreators if set. Returns {@code null} if no custom TargetSource should be used. <p>This implementation uses the "customTargetSourceCreators" property. Subclasses can override this method to use a different mechanism. @param beanClass the class of the bean ...
java
spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java
396
[ "beanClass", "beanName" ]
TargetSource
true
6
7.76
spring-projects/spring-framework
59,386
javadoc
false
getBeanDefinitionRegistry
private BeanDefinitionRegistry getBeanDefinitionRegistry(ApplicationContext context) { if (context instanceof BeanDefinitionRegistry registry) { return registry; } if (context instanceof AbstractApplicationContext abstractApplicationContext) { return (BeanDefinitionRegistry) abstractApplicationContext.getBe...
Get the bean definition registry. @param context the application context @return the BeanDefinitionRegistry if it can be determined
java
core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
731
[ "context" ]
BeanDefinitionRegistry
true
3
7.28
spring-projects/spring-boot
79,428
javadoc
false
decideClassloader
private static ClassLoader decideClassloader(@Nullable ClassLoader classLoader) { if (classLoader == null) { return ImportCandidates.class.getClassLoader(); } return classLoader; }
Loads the relocations from the classpath. Relocations are stored in files named {@code META-INF/spring/full-qualified-annotation-name.replacements} on the classpath. The file is loaded using {@link Properties#load(java.io.InputStream)} with each entry containing an auto-configuration class name as the key and the repla...
java
core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationReplacements.java
106
[ "classLoader" ]
ClassLoader
true
2
7.44
spring-projects/spring-boot
79,428
javadoc
false
toString
@Override public String toString() { StringBuilder sb = new StringBuilder(getClass().getName()); sb.append(": advice "); if (this.adviceBeanName != null) { sb.append("bean '").append(this.adviceBeanName).append('\''); } else { sb.append(this.advice); } return sb.toString(); }
Specify a particular instance of the target advice directly, avoiding lazy resolution in {@link #getAdvice()}. @since 3.1
java
spring-aop/src/main/java/org/springframework/aop/support/AbstractBeanFactoryPointcutAdvisor.java
118
[]
String
true
2
6.08
spring-projects/spring-framework
59,386
javadoc
false
addAll
@CanIgnoreReturnValue public Builder<E> addAll(Iterator<? extends E> elements) { while (elements.hasNext()) { add(elements.next()); } return this; }
Adds each element of {@code elements} to the {@code ImmutableCollection} being built. <p>Note that each builder class overrides this method in order to covariantly return its own type. @param elements the elements to add @return this {@code Builder} instance @throws NullPointerException if {@code elements} is null or c...
java
android/guava/src/com/google/common/collect/ImmutableCollection.java
477
[ "elements" ]
true
2
7.76
google/guava
51,352
javadoc
false
getMainClass
private @Nullable String getMainClass(JarFile source, Manifest manifest) throws IOException { if (this.mainClass != null) { return this.mainClass; } String attributeValue = manifest.getMainAttributes().getValue(MAIN_CLASS_ATTRIBUTE); if (attributeValue != null) { return attributeValue; } return findMa...
Writes a signature file if necessary for the given {@code writtenLibraries}. @param writtenLibraries the libraries @param writer the writer to use to write the signature file if necessary @throws IOException if a failure occurs when writing the signature file
java
loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Packager.java
332
[ "source", "manifest" ]
String
true
3
6.56
spring-projects/spring-boot
79,428
javadoc
false
nextInLineFetch
ShareCompletedFetch nextInLineFetch() { lock.lock(); try { return nextInLineFetch; } finally { lock.unlock(); } }
Returns {@code true} if there are no completed fetches pending to return to the user. @return {@code true} if the buffer is empty, {@code false} otherwise
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetchBuffer.java
86
[]
ShareCompletedFetch
true
1
7.04
apache/kafka
31,560
javadoc
false
forBindables
public static BindableRuntimeHintsRegistrar forBindables(Bindable<?>... bindables) { return new BindableRuntimeHintsRegistrar(bindables); }
Create a new {@link BindableRuntimeHintsRegistrar} for the specified bindables. @param bindables the bindables to process @return a new {@link BindableRuntimeHintsRegistrar} instance @since 3.0.8
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java
142
[]
BindableRuntimeHintsRegistrar
true
1
6.32
spring-projects/spring-boot
79,428
javadoc
false
of
public static TaggedFieldsSection of(Object... fields) { return new TaggedFieldsSection(TaggedFields.of(fields)); }
Create a new TaggedFieldsSection with the given tags and fields. @param fields This is an array containing Integer tags followed by associated Field objects. @return The new {@link TaggedFieldsSection}
java
clients/src/main/java/org/apache/kafka/common/protocol/types/Field.java
60
[]
TaggedFieldsSection
true
1
6.48
apache/kafka
31,560
javadoc
false
visitObjectLiteralExpression
function visitObjectLiteralExpression(node: ObjectLiteralExpression): Expression { const properties = node.properties; // Find the first computed property. // Everything until that point can be emitted as part of the initial object literal. let numInitialProperties = -1, hasCompute...
Visits an ObjectLiteralExpression with computed property names. @param node An ObjectLiteralExpression node.
typescript
src/compiler/transformers/es2015.ts
3,310
[ "node" ]
true
9
6.24
microsoft/TypeScript
107,154
jsdoc
false
reorder_levels
def reorder_levels(self, order) -> MultiIndex: """ Rearrange levels using input order. May not drop or duplicate levels. `reorder_levels` is useful when you need to change the order of levels in a MultiIndex, such as when reordering levels for hierarchical indexing. It maintains...
Rearrange levels using input order. May not drop or duplicate levels. `reorder_levels` is useful when you need to change the order of levels in a MultiIndex, such as when reordering levels for hierarchical indexing. It maintains the integrity of the MultiIndex, ensuring that all existing levels are present and no leve...
python
pandas/core/indexes/multi.py
2,779
[ "self", "order" ]
MultiIndex
true
1
7.12
pandas-dev/pandas
47,362
numpy
false
equal
public static boolean equal(File file1, File file2) throws IOException { checkNotNull(file1); checkNotNull(file2); if (file1 == file2 || file1.equals(file2)) { return true; } /* * Some operating systems may return zero as the length for files denoting system-dependent * entities suc...
Returns true if the given files exist, are not directories, and contain the same bytes. @throws IOException if an I/O error occurs
java
android/guava/src/com/google/common/io/Files.java
371
[ "file1", "file2" ]
true
6
6
google/guava
51,352
javadoc
false
predict
def predict(self, X): """Predict the target for the provided data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_queries, n_features), \ or (n_queries, n_indexed) if metric == 'precomputed', or None Test samples. If `None`, predictions for...
Predict the target for the provided data. Parameters ---------- X : {array-like, sparse matrix} of shape (n_queries, n_features), \ or (n_queries, n_indexed) if metric == 'precomputed', or None Test samples. If `None`, predictions for all indexed points are returned; in this case, points are not consid...
python
sklearn/neighbors/_regression.py
229
[ "self", "X" ]
false
8
6.08
scikit-learn/scikit-learn
64,340
numpy
false
getTargetClass
public static Class<?> getTargetClass(Object candidate) { Assert.notNull(candidate, "Candidate object must not be null"); Class<?> result = null; if (candidate instanceof TargetClassAware targetClassAware) { result = targetClassAware.getTargetClass(); } if (result == null) { result = (isCglibProxy(candi...
Determine the target class of the given bean instance which might be an AOP proxy. <p>Returns the target class for an AOP proxy or the plain class otherwise. @param candidate the instance to check (might be an AOP proxy) @return the target class (or the plain class of the given object as fallback; never {@code null}) @...
java
spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java
123
[ "candidate" ]
true
4
7.6
spring-projects/spring-framework
59,386
javadoc
false
assignedState
private TopicPartitionState assignedState(TopicPartition tp) { TopicPartitionState state = this.assignment.stateValue(tp); if (state == null) throw new IllegalStateException("No current assignment for partition " + tp); return state; }
Get the subscription topics for which metadata is required. For the leader, this will include the union of the subscriptions of all group members. For followers, it is just that member's subscription. This is used when querying topic metadata to detect the metadata changes which would require rebalancing. The leader fe...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java
426
[ "tp" ]
TopicPartitionState
true
2
6.72
apache/kafka
31,560
javadoc
false
putIfAbsent
default @Nullable ValueWrapper putIfAbsent(Object key, @Nullable Object value) { ValueWrapper existingValue = get(key); if (existingValue == null) { put(key, value); } return existingValue; }
Atomically associate the specified value with the specified key in this cache if it is not set already. <p>This is equivalent to: <pre><code> ValueWrapper existingValue = cache.get(key); if (existingValue == null) { cache.put(key, value); } return existingValue; </code></pre> except that the action is performed ato...
java
spring-context/src/main/java/org/springframework/cache/Cache.java
213
[ "key", "value" ]
ValueWrapper
true
2
7.92
spring-projects/spring-framework
59,386
javadoc
false
_generate_range_overflow_safe
def _generate_range_overflow_safe( endpoint: int, periods: int, stride: int, side: str = "start" ) -> int: """ Calculate the second endpoint for passing to np.arange, checking to avoid an integer overflow. Catch OverflowError and re-raise as OutOfBoundsDatetime. Parameters ---------- e...
Calculate the second endpoint for passing to np.arange, checking to avoid an integer overflow. Catch OverflowError and re-raise as OutOfBoundsDatetime. Parameters ---------- endpoint : int nanosecond timestamp of the known endpoint of the desired range periods : int number of periods in the desired range stri...
python
pandas/core/arrays/_ranges.py
99
[ "endpoint", "periods", "stride", "side" ]
int
true
9
6.64
pandas-dev/pandas
47,362
numpy
false
applyEditorRegistrars
private void applyEditorRegistrars(PropertyEditorRegistry registry, Set<PropertyEditorRegistrar> registrars) { for (PropertyEditorRegistrar registrar : registrars) { try { registrar.registerCustomEditors(registry); } catch (BeanCreationException ex) { Throwable rootCause = ex.getMostSpecificCause(); ...
Initialize the given PropertyEditorRegistry with the custom editors that have been registered with this BeanFactory. <p>To be called for BeanWrappers that will create and populate bean instances, and for SimpleTypeConverter used for constructor argument and factory method type conversion. @param registry the PropertyEd...
java
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
1,331
[ "registry", "registrars" ]
void
true
6
6.08
spring-projects/spring-framework
59,386
javadoc
false
applyNonNull
public static <T, R, E extends Throwable> R applyNonNull(final T value, final FailableFunction<? super T, ? extends R, E> mapper) throws E { return value != null ? Objects.requireNonNull(mapper, "mapper").apply(value) : null; }
Applies a value to a function if the value isn't {@code null}, otherwise the method returns {@code null}. If the value isn't {@code null} then return the result of the applying function. <pre>{@code Failable.applyNonNull("a", String::toUpperCase) = "A" Failable.applyNonNull(null, String::toUpperCase) = null Failable.a...
java
src/main/java/org/apache/commons/lang3/function/Failable.java
204
[ "value", "mapper" ]
R
true
2
7.84
apache/commons-lang
2,896
javadoc
false
unescapeHtml3
public static final String unescapeHtml3(final String input) { return UNESCAPE_HTML3.translate(input); }
Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. Supports only HTML 3.0 entities. @param input the {@link String} to unescape, may be null @return a new unescaped {@link String}, {@code null} if null string input @since 3.0
java
src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
709
[ "input" ]
String
true
1
6.96
apache/commons-lang
2,896
javadoc
false
clear
@Override public void clear() { if (needsAllocArrays()) { return; } this.firstEntry = ENDPOINT; this.lastEntry = ENDPOINT; if (links != null) { Arrays.fill(links, 0, size(), 0); } super.clear(); }
Pointer to the last node in the linked list, or {@code ENDPOINT} if there are no entries.
java
android/guava/src/com/google/common/collect/CompactLinkedHashMap.java
225
[]
void
true
3
6.72
google/guava
51,352
javadoc
false
convert_conv_weights_to_channels_last
def convert_conv_weights_to_channels_last(gm: torch.fx.GraphModule): """ Convert 4d convolution weight tensor to channels last format. This pass is performed before freezing so the added nodes can be constant folded by freezing. """ with dynamo_timed("convert_conv_weights_to_channels_last"): ...
Convert 4d convolution weight tensor to channels last format. This pass is performed before freezing so the added nodes can be constant folded by freezing.
python
torch/_inductor/freezing.py
266
[ "gm" ]
true
4
6
pytorch/pytorch
96,034
unknown
false
endSwitchBlock
function endSwitchBlock(): void { Debug.assert(peekBlockKind() === CodeBlockKind.Switch); const block = endBlock() as SwitchBlock; const breakLabel = block.breakLabel; if (!block.isScript) { markLabel(breakLabel); } }
Ends a code block that supports `break` statements that are defined in generated code.
typescript
src/compiler/transformers/generators.ts
2,379
[]
true
2
7.04
microsoft/TypeScript
107,154
jsdoc
false
lockApplyUnlock
protected <T> T lockApplyUnlock(final Supplier<Lock> lockSupplier, final FailableFunction<O, T, ?> function) { final Lock lock = Objects.requireNonNull(Suppliers.get(lockSupplier), "lock"); lock.lock(); try { return Failable.apply(function, object); } fina...
This method provides the actual implementation for {@link #applyReadLocked(FailableFunction)}, and {@link #applyWriteLocked(FailableFunction)}. @param <T> The result type (both the functions, and this method's.) @param lockSupplier A supplier for the lock. (This provides, in fact, a long, because a {@link StampedLock} ...
java
src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java
455
[ "lockSupplier", "function" ]
T
true
1
6.4
apache/commons-lang
2,896
javadoc
false
_parse_secret_file
def _parse_secret_file(file_path: str) -> dict[str, Any]: """ Based on the file extension format, selects a parser, and parses the file. :param file_path: The location of the file that will be processed. :return: Map of secret key (e.g. connection ID) and value. :raises AirflowUnsupportedFileTypeEx...
Based on the file extension format, selects a parser, and parses the file. :param file_path: The location of the file that will be processed. :return: Map of secret key (e.g. connection ID) and value. :raises AirflowUnsupportedFileTypeException: If the file type is not supported. :raises AirflowFileParseException: If ...
python
airflow-core/src/airflow/secrets/local_filesystem.py
165
[ "file_path" ]
dict[str, Any]
true
3
7.92
apache/airflow
43,597
sphinx
false
millisFrac
public double millisFrac() { return ((double) nanos()) / C2; }
@return the number of {@link #timeUnit()} units this value contains
java
libs/core/src/main/java/org/elasticsearch/core/TimeValue.java
178
[]
true
1
6
elastic/elasticsearch
75,680
javadoc
false
tryGetLocalNamedExportCompletionSymbols
function tryGetLocalNamedExportCompletionSymbols(): GlobalsSearch { const namedExports = contextToken && (contextToken.kind === SyntaxKind.OpenBraceToken || contextToken.kind === SyntaxKind.CommaToken) ? tryCast(contextToken.parent, isNamedExports) : undefined; if (!namedEx...
Adds local declarations for completions in named exports: export { | }; Does not check for the absence of a module specifier (`export {} from "./other"`) because `tryGetImportOrExportClauseCompletionSymbols` runs first and handles that, preventing this function from running.
typescript
src/services/completions.ts
4,707
[]
true
6
6.08
microsoft/TypeScript
107,154
jsdoc
false
toString
@Override public String toString() { return StringUtils.repeat(this.value.toString(), this.count); }
Represents this token as a String. @return String representation of the token
java
src/main/java/org/apache/commons/lang3/time/DurationFormatUtils.java
190
[]
String
true
1
6.8
apache/commons-lang
2,896
javadoc
false
asFunction
public static <I, O> Function<I, O> asFunction(final FailableFunction<I, O, ?> function) { return input -> apply(function, input); }
Converts the given {@link FailableFunction} into a standard {@link Function}. @param <I> the type of the input of the functions @param <O> the type of the output of the functions @param function a {code FailableFunction} @return a standard {@link Function} @since 3.10
java
src/main/java/org/apache/commons/lang3/Functions.java
416
[ "function" ]
true
1
6.64
apache/commons-lang
2,896
javadoc
false
withFileNameLength
ZipCentralDirectoryFileHeaderRecord withFileNameLength(short fileNameLength) { return (this.fileNameLength != fileNameLength) ? new ZipCentralDirectoryFileHeaderRecord(this.versionMadeBy, this.versionNeededToExtract, this.generalPurposeBitFlag, this.compressionMethod, this.lastModFileTime, this.lastModFileDat...
Return a new {@link ZipCentralDirectoryFileHeaderRecord} with a new {@link #fileNameLength()}. @param fileNameLength the new file name length @return a new {@link ZipCentralDirectoryFileHeaderRecord} instance
java
loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipCentralDirectoryFileHeaderRecord.java
138
[ "fileNameLength" ]
ZipCentralDirectoryFileHeaderRecord
true
2
7.12
spring-projects/spring-boot
79,428
javadoc
false
strerror
String strerror(int errno);
Return a string description for an error. @param errno The error number @return a String description for the error @see <a href="https://man7.org/linux/man-pages/man3/strerror.3.html">strerror manpage</a>
java
libs/native/src/main/java/org/elasticsearch/nativeaccess/lib/PosixCLibrary.java
156
[ "errno" ]
String
true
1
6.32
elastic/elasticsearch
75,680
javadoc
false
update
def update( key: str, value: Any, serialize_json: bool = False, team_name: str | None = None, session: Session | None = None, ) -> None: """ Update a given Airflow Variable with the Provided value. :param key: Variable Key :param value: Value ...
Update a given Airflow Variable with the Provided value. :param key: Variable Key :param value: Value to set for the Variable :param serialize_json: Serialize the value to a JSON string :param team_name: Team name associated to the variable (if any) :param session: optional session, use if provided or create a new one
python
airflow-core/src/airflow/models/variable.py
325
[ "key", "value", "serialize_json", "team_name", "session" ]
None
true
8
6.8
apache/airflow
43,597
sphinx
false
asFunction
public static <T, R> Function<T, R> asFunction(final FailableFunction<T, R, ?> function) { return input -> apply(function, input); }
Converts the given {@link FailableFunction} into a standard {@link Function}. @param <T> the type of the input of the functions @param <R> the type of the output of the functions @param function a {code FailableFunction} @return a standard {@link Function}
java
src/main/java/org/apache/commons/lang3/function/Failable.java
351
[ "function" ]
true
1
6.64
apache/commons-lang
2,896
javadoc
false
intersect1d
def intersect1d(ar1, ar2, assume_unique=False): """ Returns the unique elements common to both arrays. Masked values are considered equal one to the other. The output is always a masked array. See `numpy.intersect1d` for more details. See Also -------- numpy.intersect1d : Equivalent f...
Returns the unique elements common to both arrays. Masked values are considered equal one to the other. The output is always a masked array. See `numpy.intersect1d` for more details. See Also -------- numpy.intersect1d : Equivalent function for ndarrays. Examples -------- >>> import numpy as np >>> x = np.ma.array(...
python
numpy/ma/extras.py
1,317
[ "ar1", "ar2", "assume_unique" ]
false
3
6.64
numpy/numpy
31,054
unknown
false
initBsdSandbox
private void initBsdSandbox() { RLimit limit = libc.newRLimit(); limit.rlim_cur(0); limit.rlim_max(0); // not a standard limit, means something different on linux, etc! final int RLIMIT_NPROC = 7; if (libc.setrlimit(RLIMIT_NPROC, limit) != 0) { throw new Unsup...
Installs exec system call filtering on MacOS. <p> Two different methods of filtering are used. Since MacOS is BSD based, process creation is first restricted with {@code setrlimit(RLIMIT_NPROC)}. <p> Additionally, on Mac OS X Leopard or above, a custom {@code sandbox(7)} ("Seatbelt") profile is installed that denies th...
java
libs/native/src/main/java/org/elasticsearch/nativeaccess/MacNativeAccess.java
130
[]
void
true
2
6.24
elastic/elasticsearch
75,680
javadoc
false
completeness_score
def completeness_score(labels_true, labels_pred): """Compute completeness metric of a cluster labeling given a ground truth. A clustering result satisfies completeness if all the data points that are members of a given class are elements of the same cluster. This metric is independent of the absolute ...
Compute completeness metric of a cluster labeling given a ground truth. A clustering result satisfies completeness if all the data points that are members of a given class are elements of the same cluster. This metric is independent of the absolute values of the labels: a permutation of the class or cluster label val...
python
sklearn/metrics/cluster/_supervised.py
649
[ "labels_true", "labels_pred" ]
false
1
6
scikit-learn/scikit-learn
64,340
numpy
false
buildStatements
function buildStatements(): Statement[] { if (operations) { for (let operationIndex = 0; operationIndex < operations.length; operationIndex++) { writeOperation(operationIndex); } flushFinalLabel(operations.length); } else { ...
Builds the statements for the generator function body.
typescript
src/compiler/transformers/generators.ts
2,777
[]
true
6
6.88
microsoft/TypeScript
107,154
jsdoc
false
value
public XContentBuilder value(Long value) throws IOException { return (value == null) ? nullValue() : value(value.longValue()); }
@return the value of the "human readable" flag. When the value is equal to true, some types of values are written in a format easier to read for a human.
java
libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java
611
[ "value" ]
XContentBuilder
true
2
6.96
elastic/elasticsearch
75,680
javadoc
false
seconds
public long seconds() { return timeUnit.toSeconds(duration); }
@return the number of {@link #timeUnit()} units this value contains
java
libs/core/src/main/java/org/elasticsearch/core/TimeValue.java
138
[]
true
1
6
elastic/elasticsearch
75,680
javadoc
false
chebsub
def chebsub(c1, c2): """ Subtract one Chebyshev series from another. Returns the difference of two Chebyshev series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, ...
Subtract one Chebyshev series from another. Returns the difference of two Chebyshev series `c1` - `c2`. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series ``T_0 + 2*T_1 + 3*T_2``. Parameters ---------- c1, c2 : array_like 1-D arrays of Chebyshev series coeffi...
python
numpy/polynomial/chebyshev.py
609
[ "c1", "c2" ]
false
1
6.16
numpy/numpy
31,054
numpy
false
next
public String next(final int count, final char... chars) { if (chars == null) { return random(count, 0, 0, false, false, null, random()); } return random(count, 0, chars.length, false, false, chars, random()); }
Creates a random string whose length is the number of characters specified. <p> Characters will be chosen from the set of characters specified. </p> @param count the length of random string to create. @param chars the character array containing the set of characters to use, may be null. @return the random string. @thro...
java
src/main/java/org/apache/commons/lang3/RandomStringUtils.java
726
[ "count" ]
String
true
2
8.08
apache/commons-lang
2,896
javadoc
false
_log_stream_to_parsed_log_stream
def _log_stream_to_parsed_log_stream( log_stream: RawLogStream, ) -> ParsedLogStream: """ Turn a str log stream into a generator of parsed log lines. :param log_stream: The stream to parse. :return: A generator of parsed log lines. """ from airflow._shared.timezones.timezone import coerce_d...
Turn a str log stream into a generator of parsed log lines. :param log_stream: The stream to parse. :return: A generator of parsed log lines.
python
airflow-core/src/airflow/utils/log/file_task_handler.py
247
[ "log_stream" ]
ParsedLogStream
true
5
8.4
apache/airflow
43,597
sphinx
false
connectionFailed
boolean connectionFailed(Node node);
Check if the connection of the node has failed, based on the connection state. Such connection failure are usually transient and can be resumed in the next {@link #ready(org.apache.kafka.common.Node, long)} call, but there are cases where transient failures needs to be caught and re-acted upon. @param node the node to ...
java
clients/src/main/java/org/apache/kafka/clients/KafkaClient.java
79
[ "node" ]
true
1
6.8
apache/kafka
31,560
javadoc
false
read
def read( self, task_instance: TaskInstance | TaskInstanceHistory, try_number: int | None = None, metadata: LogMetadata | None = None, ) -> tuple[LogHandlerOutputStream, LogMetadata]: """ Read logs of given task instance from local machine. :param task_instan...
Read logs of given task instance from local machine. :param task_instance: task instance object :param try_number: task instance try_number to read logs from. If None it returns the log of task_instance.try_number :param metadata: log metadata, can be used for steaming log reading and auto-tailing....
python
airflow-core/src/airflow/utils/log/file_task_handler.py
728
[ "self", "task_instance", "try_number", "metadata" ]
tuple[LogHandlerOutputStream, LogMetadata]
true
15
8.16
apache/airflow
43,597
sphinx
false
drainReferenceQueues
@GuardedBy("this") void drainReferenceQueues() { if (map.usesKeyReferences()) { drainKeyReferenceQueue(); } if (map.usesValueReferences()) { drainValueReferenceQueue(); } }
Drain the key and value reference queues, cleaning up internal entries containing garbage collected keys or values.
java
android/guava/src/com/google/common/cache/LocalCache.java
2,379
[]
void
true
3
6.88
google/guava
51,352
javadoc
false
notNull
public static <T> T notNull(final T object, final String message, final Object... values) { return Objects.requireNonNull(object, toSupplier(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,060
[ "object", "message" ]
T
true
1
6.32
apache/commons-lang
2,896
javadoc
false
add
public boolean add() { if (root == NIL) { root = nodeAllocator.newNode(); copy(root); fixAggregates(root); return true; } else { int node = root; assert parent(root) == NIL; int parent; int cmp; d...
Add current data to the tree and return <code>true</code> if a new node was added to the tree or <code>false</code> if the node was merged into an existing node.
java
libs/tdigest/src/main/java/org/elasticsearch/tdigest/IntAVLTree.java
243
[]
true
6
7.04
elastic/elasticsearch
75,680
javadoc
false
shapes_symbolic
def shapes_symbolic(self) -> tuple[tuple[Any, ...], ...]: """ Get the symbolic shapes of all input nodes. Returns: A tuple of shape tuples for each input node """ return tuple(node.get_size() for node in self._input_nodes)
Get the symbolic shapes of all input nodes. Returns: A tuple of shape tuples for each input node
python
torch/_inductor/kernel_inputs.py
108
[ "self" ]
tuple[tuple[Any, ...], ...]
true
1
6.56
pytorch/pytorch
96,034
unknown
false
handleShareFetchFailure
private void handleShareFetchFailure(Node fetchTarget, ShareFetchRequestData requestData, Throwable error) { try { log.debug("Completed ShareFetch request from node {} unsuccessfully {}", fetchTarget.id(), Errors.forEx...
The method checks whether the leader for a topicIdPartition has changed. @param nodeId The previous leader for the partition. @param topicIdPartition The TopicIdPartition to check. @return Returns true if leader information is available and leader has changed. If the leader information is not available or if the leader...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java
894
[ "fetchTarget", "requestData", "error" ]
void
true
7
7.92
apache/kafka
31,560
javadoc
false
unmodifiableNavigableMap
@GwtIncompatible // NavigableMap public static <K extends @Nullable Object, V extends @Nullable Object> NavigableMap<K, V> unmodifiableNavigableMap(NavigableMap<K, ? extends V> map) { checkNotNull(map); if (map instanceof UnmodifiableNavigableMap) { @SuppressWarnings("unchecked") // covariant ...
Returns an unmodifiable view of the specified navigable map. Query operations on the returned map read through to the specified map, and attempts to modify the returned map, whether direct or via its views, result in an {@code UnsupportedOperationException}. <p>The returned navigable map will be serializable if the spe...
java
android/guava/src/com/google/common/collect/Maps.java
3,293
[ "map" ]
true
2
7.92
google/guava
51,352
javadoc
false
loadBeanDefinitions
public int loadBeanDefinitions(InputSource inputSource, @Nullable String resourceDescription) throws BeanDefinitionStoreException { return doLoadBeanDefinitions(inputSource, new DescriptiveResource(resourceDescription)); }
Load bean definitions from the specified XML file. @param inputSource the SAX InputSource to read from @param resourceDescription a description of the resource (can be {@code null} or empty) @return the number of bean definitions found @throws BeanDefinitionStoreException in case of loading or parsing errors
java
spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java
377
[ "inputSource", "resourceDescription" ]
true
1
6.32
spring-projects/spring-framework
59,386
javadoc
false
hasNext
@Override public boolean hasNext() { checkTokenized(); return tokenPos < tokens.length; }
Checks whether there are any more tokens. @return true if there are more tokens.
java
src/main/java/org/apache/commons/lang3/text/StrTokenizer.java
567
[]
true
1
6.88
apache/commons-lang
2,896
javadoc
false
getDefaultValueResolver
protected Function<@Nullable String, @Nullable String> getDefaultValueResolver(Environment environment) { String defaultLogCorrelationPattern = getDefaultLogCorrelationPattern(); return (name) -> { String applicationPropertyName = LoggingSystemProperty.CORRELATION_PATTERN.getApplicationPropertyName(); Assert....
Return the default value resolver to use when resolving system properties. @param environment the environment @return the default value resolver @since 3.2.0
java
core/spring-boot/src/main/java/org/springframework/boot/logging/AbstractLoggingSystem.java
192
[ "environment" ]
true
4
7.76
spring-projects/spring-boot
79,428
javadoc
false
count_nonzero
def count_nonzero(X, axis=None, sample_weight=None): """A variant of X.getnnz() with extension to weighting on axis 0. Useful in efficiently calculating multilabel metrics. Parameters ---------- X : sparse matrix of shape (n_samples, n_labels) Input data. It should be of CSR format. a...
A variant of X.getnnz() with extension to weighting on axis 0. Useful in efficiently calculating multilabel metrics. Parameters ---------- X : sparse matrix of shape (n_samples, n_labels) Input data. It should be of CSR format. axis : {0, 1}, default=None The axis on which the data is aggregated. sample_wei...
python
sklearn/utils/sparsefuncs.py
605
[ "X", "axis", "sample_weight" ]
false
13
6.08
scikit-learn/scikit-learn
64,340
numpy
false
future
CompletableFuture<T> future();
Returns the {@link CompletableFuture future} associated with this event. Any event will have some related logic that is executed on its behalf. The event can complete in one of the following ways: <ul> <li> Success: when the logic for the event completes successfully, the data generated by that event ...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/CompletableEvent.java
63
[]
true
1
6
apache/kafka
31,560
javadoc
false
sanitizeNotificationText
function sanitizeNotificationText(text: string): string { return text.replace(/`/g, '\''); // convert backticks to single quotes }
Attempts to open a window and returns whether it succeeded. This technique is not appropriate in certain contexts, like for example when the JS context is executing inside a sandboxed iframe. If it is not necessary to know if the browser blocked the new window, use {@link windowOpenNoOpener}. See https://github.com/mic...
typescript
src/vs/base/browser/dom.ts
1,599
[ "text" ]
true
1
6.32
microsoft/vscode
179,840
jsdoc
false
codes
def codes(self) -> np.ndarray: """ The category codes of this categorical index. Codes are an array of integers which are the positions of the actual values in the categories array. There is no setter, use the other categorical methods and the normal item setter to chan...
The category codes of this categorical index. Codes are an array of integers which are the positions of the actual values in the categories array. There is no setter, use the other categorical methods and the normal item setter to change values in the categorical. Returns ------- ndarray[int] A non-writable view...
python
pandas/core/arrays/categorical.py
897
[ "self" ]
np.ndarray
true
1
6.64
pandas-dev/pandas
47,362
unknown
false
toEnrichedRst
public String toEnrichedRst() { StringBuilder b = new StringBuilder(); String lastKeyGroupName = ""; for (ConfigKey key : sortedConfigs()) { if (key.internalConfig) { continue; } if (key.group != null) { if (!lastKeyGroupName.e...
Configs with new metadata (group, orderInGroup, dependents) formatted with reStructuredText, suitable for embedding in Sphinx documentation.
java
clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
1,514
[]
String
true
7
6.08
apache/kafka
31,560
javadoc
false
createCacheControl
private CacheControl createCacheControl() { if (Boolean.TRUE.equals(this.noStore)) { return CacheControl.noStore(); } if (Boolean.TRUE.equals(this.noCache)) { return CacheControl.noCache(); } if (this.maxAge != null) { return CacheControl.maxAge(this.maxAge.getSeconds(), TimeU...
Maximum time the response should be cached by shared caches, in seconds if no duration suffix is not specified.
java
core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebProperties.java
599
[]
CacheControl
true
4
6.88
spring-projects/spring-boot
79,428
javadoc
false
size
public int size() { checkTokenized(); return tokens.length; }
Gets the number of tokens found in the String. @return the number of matched tokens.
java
src/main/java/org/apache/commons/lang3/text/StrTokenizer.java
1,051
[]
true
1
6.8
apache/commons-lang
2,896
javadoc
false
lchmod
function lchmod(path, mode, callback) { validateFunction(callback, 'cb'); mode = parseFileMode(mode, 'mode'); fs.open(path, O_WRONLY | O_SYMLINK, (err, fd) => { if (err) { callback(err); return; } // Prefer to return the chmod error, if one occurs, // but still try to close, and report...
Changes the permissions on a symbolic link. @param {string | Buffer | URL} path @param {number} mode @param {(err?: Error) => any} callback @returns {void}
javascript
lib/fs.js
1,966
[ "path", "mode", "callback" ]
false
2
6.4
nodejs/node
114,839
jsdoc
false
withAdditionalProfiles
public Augmented withAdditionalProfiles(String... profiles) { Set<String> merged = new LinkedHashSet<>(this.additionalProfiles); merged.addAll(Arrays.asList(profiles)); return new Augmented(this.main, this.sources, merged); }
Return a new {@link SpringApplication.Augmented} instance with additional profiles that should be applied when the application runs. @param profiles the profiles that should be applied @return a new {@link SpringApplication.Augmented} instance @since 3.4.0
java
core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
1,523
[]
Augmented
true
1
6.4
spring-projects/spring-boot
79,428
javadoc
false
addToLocal
private long addToLocal(List<DataBlock> parts, ZipCentralDirectoryFileHeaderRecord centralRecord, ZipLocalFileHeaderRecord originalRecord, ZipDataDescriptorRecord dataDescriptorRecord, DataBlock name, DataBlock content) throws IOException { ZipLocalFileHeaderRecord record = originalRecord.withFileNameLength((sh...
Create a new {@link VirtualZipDataBlock} for the given entries. @param data the source zip data @param nameOffsetLookups the name offsets to apply @param centralRecords the records that should be copied to the virtual zip @param centralRecordPositions the record positions in the data block. @throws IOException on I/O e...
java
loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/VirtualZipDataBlock.java
89
[ "parts", "centralRecord", "originalRecord", "dataDescriptorRecord", "name", "content" ]
true
4
6.56
spring-projects/spring-boot
79,428
javadoc
false
generate
def generate( # type: ignore[override] self, name: str, input_nodes: list[Buffer], layout: Layout, make_fx_graph: Callable[..., Any], description: str = "", input_gen_fns: dict[int, Callable[[Any], torch.Tensor]] | None = None, **kwargs: Any, ) -> Sub...
Generate a SubgraphChoiceCaller instance for autotuning. Args: name: The name for this subgraph choice input_nodes: List of input nodes to the subgraph layout: Memory layout information for the output make_fx_graph: Callable that creates the FX graph for this subgraph description: Optional descript...
python
torch/_inductor/codegen/subgraph.py
247
[ "self", "name", "input_nodes", "layout", "make_fx_graph", "description", "input_gen_fns" ]
SubgraphChoiceCaller
true
1
6.08
pytorch/pytorch
96,034
google
false
hashCode
@Override public int hashCode() { int result = 31; result = 31 * result + Long.hashCode(producerId); result = 31 * result + (int) epoch; return result; }
Returns a serialized string representation of this transaction state. The format is "producerId:epoch" for an initialized state, or an empty string for an uninitialized state (where producerId and epoch are both -1). @return a serialized string representation
java
clients/src/main/java/org/apache/kafka/clients/producer/PreparedTxnState.java
121
[]
true
1
6.08
apache/kafka
31,560
javadoc
false
policyEntitlements
ModuleEntitlements policyEntitlements( String componentName, Collection<Path> componentPaths, String moduleName, List<Entitlement> entitlements ) { FilesEntitlement filesEntitlement = FilesEntitlement.EMPTY; for (Entitlement entitlement : entitlements) { i...
This class contains all the entitlements by type, plus the {@link FileAccessTree} for the special case of filesystem entitlements. <p> We use layers when computing {@link ModuleEntitlements}; first, we check whether the module we are building it for is in the server layer ({@link PolicyManager#SERVER_LAYER_MODULES}) (*...
java
libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java
163
[ "componentName", "componentPaths", "moduleName", "entitlements" ]
ModuleEntitlements
true
2
6.72
elastic/elasticsearch
75,680
javadoc
false