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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
removePropertySources | private void removePropertySources(MutablePropertySources propertySources, boolean isServletEnvironment) {
Set<String> names = new HashSet<>();
for (PropertySource<?> propertySource : propertySources) {
names.add(propertySource.getName());
}
for (String name : names) {
if (!isServletEnvironment || !SERVLE... | Converts the given {@code environment} to the given {@link StandardEnvironment}
type. If the environment is already of the same type, no conversion is performed
and it is returned unchanged.
@param environment the Environment to convert
@param type the type to convert the Environment to
@return the converted Environmen... | java | core/spring-boot/src/main/java/org/springframework/boot/EnvironmentConverter.java | 120 | [
"propertySources",
"isServletEnvironment"
] | void | true | 3 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
of | public static <E> Stream<E> of(final Iterable<E> iterable) {
return iterable == null ? Stream.empty() : StreamSupport.stream(iterable.spliterator(), false);
} | Creates a sequential stream on the given Iterable.
@param <E> the type of elements in the Iterable.
@param iterable the Iterable to stream or null.
@return a new Stream or {@link Stream#empty()} if the Iterable is null.
@since 3.13.0 | java | src/main/java/org/apache/commons/lang3/stream/Streams.java | 699 | [
"iterable"
] | true | 2 | 8.16 | apache/commons-lang | 2,896 | javadoc | false | |
getResourceByPath | @Override
protected Resource getResourceByPath(String path) {
if (path.startsWith("/")) {
path = path.substring(1);
}
return new FileSystemResource(path);
} | Resolve resource paths as file system paths.
<p>Note: Even if a given path starts with a slash, it will get
interpreted as relative to the current VM working directory.
This is consistent with the semantics in a Servlet container.
@param path the path to the resource
@return the Resource handle
@see org.springframework... | java | spring-context/src/main/java/org/springframework/context/support/FileSystemXmlApplicationContext.java | 157 | [
"path"
] | Resource | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
to_pickle | def to_pickle(
self,
path: FilePath | WriteBuffer[bytes],
*,
compression: CompressionOptions = "infer",
protocol: int = pickle.HIGHEST_PROTOCOL,
storage_options: StorageOptions | None = None,
) -> None:
"""
Pickle (serialize) object to file.
P... | Pickle (serialize) object to file.
Parameters
----------
path : str, path object, or file-like object
String, path object (implementing ``os.PathLike[str]``), or file-like
object implementing a binary ``write()`` function. File path where
the pickled object will be stored.
{compression_options}
protocol : ... | python | pandas/core/generic.py | 3,061 | [
"self",
"path",
"compression",
"protocol",
"storage_options"
] | None | true | 1 | 7.04 | pandas-dev/pandas | 47,362 | numpy | false |
isCamelCasePattern | function isCamelCasePattern(word: string): boolean {
let upper = 0, lower = 0, code = 0, whitespace = 0;
for (let i = 0; i < word.length; i++) {
code = word.charCodeAt(i);
if (isUpper(code)) { upper++; }
if (isLower(code)) { lower++; }
if (isWhitespace(code)) { whitespace++; }
}
if ((upper === 0 || lower... | Gets alternative codes to the character code passed in. This comes in the
form of an array of character codes, all of which must match _in order_ to
successfully match.
@param code The character code to check. | typescript | src/vs/base/common/filters.ts | 274 | [
"word"
] | true | 9 | 7.04 | microsoft/vscode | 179,840 | jsdoc | false | |
get6to4IPv4Address | public static Inet4Address get6to4IPv4Address(Inet6Address ip) {
checkArgument(is6to4Address(ip), "Address '%s' is not a 6to4 address.", toAddrString(ip));
return getInet4Address(Arrays.copyOfRange(ip.getAddress(), 2, 6));
} | Returns the IPv4 address embedded in a 6to4 address.
@param ip {@link Inet6Address} to be examined for embedded IPv4 in 6to4 address
@return {@link Inet4Address} of embedded IPv4 in 6to4 address
@throws IllegalArgumentException if the argument is not a valid IPv6 6to4 address | java | android/guava/src/com/google/common/net/InetAddresses.java | 733 | [
"ip"
] | Inet4Address | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false |
getResults | Map<String, String> getResults() {
results.clear();
if (simpleCount > 0) {
results.putAll(simpleResults);
}
if (referenceCount > 0) {
referenceResults.forEach((k, v) -> results.put(v.getKey(), v.getValue()));
}
if (appendCount > 0) {
ap... | Gets all the current matches. Pass the results of this to isValid to determine if a fully successful match has occurred.
@return the map of the results. | java | libs/dissect/src/main/java/org/elasticsearch/dissect/DissectMatch.java | 92 | [] | true | 4 | 8.08 | elastic/elasticsearch | 75,680 | javadoc | false | |
substituteExpressionIdentifier | function substituteExpressionIdentifier(node: Identifier): Identifier {
if (enabledSubstitutions & ES2015SubstitutionFlags.BlockScopedBindings && !isInternalName(node)) {
const declaration = resolver.getReferencedDeclarationWithCollidingName(node);
if (declaration && !(isClassLike(dec... | Substitutes an expression identifier.
@param node An Identifier node. | typescript | src/compiler/transformers/es2015.ts | 4,977 | [
"node"
] | true | 6 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
stampedLockVisitor | public static <O> StampedLockVisitor<O> stampedLockVisitor(final O object) {
return new LockingVisitors.StampedLockVisitor<>(object, new StampedLock());
} | Creates a new instance of {@link StampedLockVisitor} with the given object.
@param <O> The type of the object to protect.
@param object The object to protect.
@return A new {@link StampedLockVisitor}.
@see LockingVisitors | java | src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java | 746 | [
"object"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
toBloomFilter | @IgnoreJRERequirement // Users will use this only if they're already using streams.
public static <T extends @Nullable Object> Collector<T, ?, BloomFilter<T>> toBloomFilter(
Funnel<? super T> funnel, long expectedInsertions, double fpp) {
checkNotNull(funnel);
checkArgument(
expectedInsertions >... | Returns a {@code Collector} expecting the specified number of insertions, and yielding a {@link
BloomFilter} with the specified expected false positive probability.
<p>Note that if the {@code Collector} receives significantly more elements than specified, the
resulting {@code BloomFilter} will suffer a sharp deteriorat... | java | android/guava/src/com/google/common/hash/BloomFilter.java | 357 | [
"funnel",
"expectedInsertions",
"fpp"
] | true | 1 | 6.56 | google/guava | 51,352 | javadoc | false | |
_stripOrigin | function _stripOrigin(baseHref: string): string {
// DO NOT REFACTOR! Previously, this check looked like this:
// `/^(https?:)?\/\//.test(baseHref)`, but that resulted in
// syntactically incorrect code after Closure Compiler minification.
// This was likely caused by a bug in Closure Compiler, but
// for now... | @description
A service that applications can use to interact with a browser's URL.
Depending on the `LocationStrategy` used, `Location` persists
to the URL's path or the URL's hash segment.
@usageNotes
It's better to use the `Router.navigate()` service to trigger route changes. Use
`Location` only if you need to intera... | typescript | packages/common/src/location/location.ts | 325 | [
"baseHref"
] | true | 2 | 6.8 | angular/angular | 99,544 | jsdoc | false | |
nextOffsets | public Map<TopicPartition, OffsetAndMetadata> nextOffsets() {
return nextOffsets;
} | Get the next offsets and metadata corresponding to all topic partitions for which the position have been advanced in this poll call
@return the next offsets that the consumer will consume | java | clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRecords.java | 70 | [] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
build | public Escaper build() {
return new ArrayBasedCharEscaper(replacementMap, safeMin, safeMax) {
private final char @Nullable [] replacementChars =
unsafeReplacement != null ? unsafeReplacement.toCharArray() : null;
@Override
protected char @Nullable [] escapeUnsafe(char c) {
... | Returns a new escaper based on the current state of the builder. | java | android/guava/src/com/google/common/escape/Escapers.java | 149 | [] | Escaper | true | 2 | 7.04 | google/guava | 51,352 | javadoc | false |
_infer_selection | def _infer_selection(self, key, subset: Series | DataFrame):
"""
Infer the `selection` to pass to our constructor in _gotitem.
"""
# Shared by Rolling and Resample
selection = None
if subset.ndim == 2 and (
(lib.is_scalar(key) and key in subset) or lib.is_list... | Infer the `selection` to pass to our constructor in _gotitem. | python | pandas/core/base.py | 255 | [
"self",
"key",
"subset"
] | true | 8 | 6 | pandas-dev/pandas | 47,362 | unknown | false | |
categorical_column_to_series | def categorical_column_to_series(col: Column) -> tuple[pd.Series, Any]:
"""
Convert a column holding categorical data to a pandas Series.
Parameters
----------
col : Column
Returns
-------
tuple
Tuple of pd.Series holding the data and the memory owner object
that keeps ... | Convert a column holding categorical data to a pandas Series.
Parameters
----------
col : Column
Returns
-------
tuple
Tuple of pd.Series holding the data and the memory owner object
that keeps the memory alive. | python | pandas/core/interchange/from_dataframe.py | 249 | [
"col"
] | tuple[pd.Series, Any] | true | 6 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
indexOf | public int indexOf(final StrMatcher matcher) {
return indexOf(matcher, 0);
} | Searches the string builder using the matcher to find the first match.
<p>
Matchers can be used to perform advanced searching behavior.
For example you could write a matcher to find the character 'a'
followed by a number.
</p>
@param matcher the matcher to use, null returns -1
@return the first index matched, or -1 if... | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 2,053 | [
"matcher"
] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
asList | public static List<Integer> asList(int... backingArray) {
if (backingArray.length == 0) {
return Collections.emptyList();
}
return new IntArrayAsList(backingArray);
} | Returns a fixed-size list backed by the specified array, similar to {@link
Arrays#asList(Object[])}. The list supports {@link List#set(int, Object)}, but any attempt to
set a value to {@code null} will result in a {@link NullPointerException}.
<p>The returned list maintains the values, but not the identities, of {@code... | java | android/guava/src/com/google/common/primitives/Ints.java | 657 | [] | true | 2 | 7.92 | google/guava | 51,352 | javadoc | false | |
toStringAll | public String toStringAll() {
return "FastDateParser [pattern=" + pattern + ", timeZone=" + timeZone + ", locale=" + locale + ", century=" + century + ", startYear=" + startYear
+ ", patterns=" + patterns + "]";
} | Converts all state of this instance to a String handy for debugging.
@return a string.
@since 3.12.0 | java | src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 1,125 | [] | String | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false |
revoke | def revoke(state, task_id, terminate=False, signal=None, **kwargs):
"""Revoke task by task id (or list of ids).
Keyword Arguments:
terminate (bool): Also terminate the process if the task is active.
signal (str): Name of signal to use for terminate (e.g., ``KILL``).
"""
# pylint: disabl... | Revoke task by task id (or list of ids).
Keyword Arguments:
terminate (bool): Also terminate the process if the task is active.
signal (str): Name of signal to use for terminate (e.g., ``KILL``). | python | celery/worker/control.py | 138 | [
"state",
"task_id",
"terminate",
"signal"
] | false | 4 | 6.24 | celery/celery | 27,741 | unknown | false | |
_read_dump_from_disk | def _read_dump_from_disk(self) -> CacheDump | None:
"""Read the cache dump from disk.
Attempts to read and parse the shared cache JSON file.
Returns:
The cache dump if the file exists and is valid JSON, None otherwise.
"""
try:
with open(self._shared_cac... | Read the cache dump from disk.
Attempts to read and parse the shared cache JSON file.
Returns:
The cache dump if the file exists and is valid JSON, None otherwise. | python | torch/_inductor/runtime/caching/interfaces.py | 288 | [
"self"
] | CacheDump | None | true | 1 | 6.56 | pytorch/pytorch | 96,034 | unknown | false |
addAll | @CanIgnoreReturnValue
@Override
public Builder<E> addAll(Iterable<? extends E> elements) {
checkNotNull(elements);
if (elements instanceof Collection) {
Collection<?> collection = (Collection<?>) elements;
ensureRoomFor(collection.size());
if (collection instanceof ImmutableC... | Adds each element of {@code elements} to the {@code ImmutableList}.
@param elements the {@code Iterable} to add to the {@code ImmutableList}
@return this {@code Builder} object
@throws NullPointerException if {@code elements} is null or contains a null element | java | guava/src/com/google/common/collect/ImmutableList.java | 887 | [
"elements"
] | true | 3 | 7.76 | google/guava | 51,352 | javadoc | false | |
_get_doc_link | def _get_doc_link(self):
"""Generates a link to the API documentation for a given estimator.
This method generates the link to the estimator's documentation page
by using the template defined by the attribute `_doc_link_template`.
Returns
-------
url : str
T... | Generates a link to the API documentation for a given estimator.
This method generates the link to the estimator's documentation page
by using the template defined by the attribute `_doc_link_template`.
Returns
-------
url : str
The URL to the API documentation for this estimator. If the estimator does
not be... | python | sklearn/utils/_repr_html/base.py | 85 | [
"self"
] | false | 3 | 6.08 | scikit-learn/scikit-learn | 64,340 | unknown | false | |
length | public int length() {
return this.nameValuePairs.size();
} | Returns the number of name/value mappings in this object.
@return the number of name/value mappings in this object | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java | 193 | [] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
masked | def masked(mask: str, body: Callable[[], str], other: float) -> str:
"""
Computes body, but only uses the result where mask is true.
Where mask is false, uses the 'other' value instead.
"""
result = body()
# Format the 'other' value properly for JAX
if isinstance(... | Computes body, but only uses the result where mask is true.
Where mask is false, uses the 'other' value instead. | python | torch/_inductor/codegen/pallas.py | 197 | [
"mask",
"body",
"other"
] | str | true | 7 | 6 | pytorch/pytorch | 96,034 | unknown | false |
readDouble | @CanIgnoreReturnValue // to skip some bytes
@Override
public double readDouble() throws IOException {
return Double.longBitsToDouble(readLong());
} | Reads a {@code double} as specified by {@link DataInputStream#readDouble()}, except using
little-endian byte order.
@return the next eight bytes of the input stream, interpreted as a {@code double} in
little-endian byte order
@throws IOException if an I/O error occurs | java | android/guava/src/com/google/common/io/LittleEndianDataInputStream.java | 170 | [] | true | 1 | 6.4 | google/guava | 51,352 | javadoc | false | |
get_status | def get_status(self, aws_account_id: str | None, data_set_id: str, ingestion_id: str) -> str:
"""
Get the current status of QuickSight Create Ingestion API.
.. seealso::
- :external+boto3:py:meth:`QuickSight.Client.describe_ingestion`
:param aws_account_id: An AWS Account I... | Get the current status of QuickSight Create Ingestion API.
.. seealso::
- :external+boto3:py:meth:`QuickSight.Client.describe_ingestion`
:param aws_account_id: An AWS Account ID, if set to ``None`` then use associated AWS Account ID.
:param data_set_id: QuickSight Data Set ID
:param ingestion_id: QuickSight Inges... | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/quicksight.py | 95 | [
"self",
"aws_account_id",
"data_set_id",
"ingestion_id"
] | str | true | 2 | 7.44 | apache/airflow | 43,597 | sphinx | false |
getLocaleSpecificStrategy | private Strategy getLocaleSpecificStrategy(final int field, final Calendar definingCalendar) {
final ConcurrentMap<Locale, Strategy> cache = getCache(field);
return cache.computeIfAbsent(locale,
k -> field == Calendar.ZONE_OFFSET ? new TimeZoneStrategy(locale) : new CaseInsensitiveTextSt... | Constructs a Strategy that parses a Text field
@param field The Calendar field
@param definingCalendar The calendar to obtain the short and long values
@return a TextStrategy for the field and Locale | java | src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 900 | [
"field",
"definingCalendar"
] | Strategy | true | 2 | 7.28 | apache/commons-lang | 2,896 | javadoc | false |
execute_interactive | def execute_interactive(cmd: list[str], **kwargs) -> None:
"""
Run the new command as a subprocess.
Runs the new command as a subprocess and ensures that the terminal's state is restored to its original
state after the process is completed e.g. if the subprocess hides the cursor, it will be restored af... | Run the new command as a subprocess.
Runs the new command as a subprocess and ensures that the terminal's state is restored to its original
state after the process is completed e.g. if the subprocess hides the cursor, it will be restored after
the process is completed. | python | airflow-core/src/airflow/utils/process_utils.py | 226 | [
"cmd"
] | None | true | 5 | 6 | apache/airflow | 43,597 | unknown | false |
insert | public StrBuilder insert(final int index, final char value) {
validateIndex(index);
ensureCapacity(size + 1);
System.arraycopy(buffer, index, buffer, index + 1, size - index);
buffer[index] = value;
size++;
return this;
} | Inserts the value into this builder.
@param index the index to add at, must be valid
@param value the value to insert
@return {@code this} instance.
@throws IndexOutOfBoundsException if the index is invalid | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 2,124 | [
"index",
"value"
] | StrBuilder | true | 1 | 6.56 | apache/commons-lang | 2,896 | javadoc | false |
shift | public static void shift(final boolean[] array, final int offset) {
if (array != null) {
shift(array, 0, array.length, offset);
}
} | Shifts the order of the given boolean array.
<p>There is no special handling for multi-dimensional arrays. This method
does nothing for {@code null} or empty input arrays.</p>
@param array the array to shift, may be {@code null}.
@param offset
The number of positions to rotate the elements. If the offset is ... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 6,789 | [
"array",
"offset"
] | void | true | 2 | 6.88 | apache/commons-lang | 2,896 | javadoc | false |
drop_duplicates | def drop_duplicates(
self,
*,
keep: DropKeep = "first",
inplace: bool = False,
ignore_index: bool = False,
) -> Series | None:
"""
Return Series with duplicate values removed.
Parameters
----------
keep : {'first', 'last', ``False``}, ... | Return Series with duplicate values removed.
Parameters
----------
keep : {'first', 'last', ``False``}, default 'first'
Method to handle dropping duplicates:
- 'first' : Drop duplicates except for the first occurrence.
- 'last' : Drop duplicates except for the last occurrence.
- ``False`` : Drop all d... | python | pandas/core/series.py | 2,241 | [
"self",
"keep",
"inplace",
"ignore_index"
] | Series | None | true | 4 | 8.24 | pandas-dev/pandas | 47,362 | numpy | false |
subscribe | @Override
public void subscribe(SubscriptionPattern pattern, ConsumerRebalanceListener listener) {
if (listener == null)
throw new IllegalArgumentException("RebalanceListener cannot be null");
subscribeToRegex(pattern, Optional.of(listener));
} | This method signals the background thread to {@link CreateFetchRequestsEvent create fetch requests} for the
pre-fetch case, i.e. right before {@link #poll(Duration)} exits. In the pre-fetch case, the application thread
will not wait for confirmation of the request creation before continuing.
<p/>
At the point this meth... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java | 2,048 | [
"pattern",
"listener"
] | void | true | 2 | 6.72 | apache/kafka | 31,560 | javadoc | false |
nextToken | @Override
public Token nextToken() throws IOException {
try {
return convertToken(parser.nextToken());
} catch (IOException e) {
throw handleParserException(e);
}
} | Handle parser exception depending on type.
This converts known exceptions to XContentParseException and rethrows them. | java | libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentParser.java | 87 | [] | Token | true | 2 | 6.08 | elastic/elasticsearch | 75,680 | javadoc | false |
createInlineReturn | function createInlineReturn(expression?: Expression, location?: TextRange): ReturnStatement {
return setTextRange(
factory.createReturnStatement(
factory.createArrayLiteralExpression(
expression
? [createInstruction(Instruction.Return)... | Creates a statement that can be used indicate a Return operation.
@param expression The expression for the return statement.
@param location An optional source map location for the statement. | typescript | src/compiler/transformers/generators.ts | 2,575 | [
"expression?",
"location?"
] | true | 2 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
readInBuffer | private static int readInBuffer(DataBlock dataBlock, long pos, ByteBuffer buffer, int maxLen, int minLen)
throws IOException {
buffer.clear();
if (buffer.remaining() > maxLen) {
buffer.limit(maxLen);
}
int result = 0;
while (result < minLen) {
int count = dataBlock.read(buffer, pos);
if (count <= ... | Read a string value from the given data block.
@param data the source data
@param pos the position to read from
@param len the number of bytes to read
@return the contents as a string | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipString.java | 276 | [
"dataBlock",
"pos",
"buffer",
"maxLen",
"minLen"
] | true | 4 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false | |
valuesIn | function valuesIn(object) {
return object == null ? [] : baseValues(object, keysIn(object));
} | Creates an array of the own and inherited enumerable string keyed property
values of `object`.
**Note:** Non-object values are coerced to objects.
@static
@memberOf _
@since 3.0.0
@category Object
@param {Object} object The object to query.
@returns {Array} Returns the array of property values.
@example
function Foo() ... | javascript | lodash.js | 14,063 | [
"object"
] | false | 2 | 7.44 | lodash/lodash | 61,490 | jsdoc | false | |
indexOfIgnoreCase | @Deprecated
public static int indexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, final int startPos) {
return Strings.CI.indexOf(str, searchStr, startPos);
} | Case in-sensitive find of the first index within a CharSequence from the specified position.
<p>
A {@code null} CharSequence will return {@code -1}. A negative start position is treated as zero. An empty ("") search CharSequence always matches. A
start position greater than the string length only matches an empty searc... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 3,101 | [
"str",
"searchStr",
"startPos"
] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
describeMetadataQuorum | default DescribeMetadataQuorumResult describeMetadataQuorum() {
return describeMetadataQuorum(new DescribeMetadataQuorumOptions());
} | Describes the state of the metadata quorum.
<p>
This is a convenience method for {@link #describeMetadataQuorum(DescribeMetadataQuorumOptions)} with default options.
See the overload for more details.
@return the {@link DescribeMetadataQuorumResult} containing the result | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 1,608 | [] | DescribeMetadataQuorumResult | true | 1 | 6.16 | apache/kafka | 31,560 | javadoc | false |
removeInterface | public boolean removeInterface(Class<?> ifc) {
return this.interfaces.remove(ifc);
} | Remove a proxied interface.
<p>Does nothing if the given interface isn't proxied.
@param ifc the interface to remove from the proxy
@return {@code true} if the interface was removed; {@code false}
if the interface was not found and hence could not be removed | java | spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java | 249 | [
"ifc"
] | true | 1 | 6.96 | spring-projects/spring-framework | 59,386 | javadoc | false | |
ngroup | def ngroup(self, ascending: bool = True):
"""
Number each group from 0 to the number of groups - 1.
This is the enumerative complement of cumcount. Note that the
numbers given to the groups match the order in which the groups
would be seen when iterating over the groupby object... | Number each group from 0 to the number of groups - 1.
This is the enumerative complement of cumcount. Note that the
numbers given to the groups match the order in which the groups
would be seen when iterating over the groupby object, not the
order they are first observed.
Groups with missing keys (where `pd.isna()` ... | python | pandas/core/groupby/groupby.py | 4,623 | [
"self",
"ascending"
] | true | 5 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false | |
insert | def insert(self, key: str, value: bytes) -> bool:
"""Insert a key-value pair into the on-disk cache.
Args:
key: The key to insert (must be str).
value: The value to associate with the key (must be bytes).
Returns:
True if successfully inserted, False if the ... | Insert a key-value pair into the on-disk cache.
Args:
key: The key to insert (must be str).
value: The value to associate with the key (must be bytes).
Returns:
True if successfully inserted, False if the key already exists
with a valid version. | python | torch/_inductor/runtime/caching/implementations.py | 304 | [
"self",
"key",
"value"
] | bool | true | 4 | 8.24 | pytorch/pytorch | 96,034 | google | false |
getExportEqualsImportKind | function getExportEqualsImportKind(importingFile: SourceFile | FutureSourceFile, compilerOptions: CompilerOptions, forceImportKeyword: boolean): ImportKind {
const allowSyntheticDefaults = getAllowSyntheticDefaultImports(compilerOptions);
const isJS = hasJSFileExtension(importingFile.fileName);
// 1. 'im... | @param forceImportKeyword Indicates that the user has already typed `import`, so the result must start with `import`.
(In other words, do not allow `const x = require("...")` for JS files.)
@internal | typescript | src/services/codefixes/importFixes.ts | 1,667 | [
"importingFile",
"compilerOptions",
"forceImportKeyword"
] | true | 11 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
equals | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof ExtendedMessageFormat)) {
return false;
}
final ExtendedMessageFormat other... | Learn whether the specified Collection contains non-null elements.
@param coll to check
@return {@code true} if some Object was found, {@code false} otherwise. | java | src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java | 257 | [
"obj"
] | true | 5 | 8.24 | apache/commons-lang | 2,896 | javadoc | false | |
incrementAndGet | public byte incrementAndGet() {
value++;
return value;
} | Increments this instance's value by 1; this method returns the value associated with the instance
immediately after the increment operation. This method is not thread safe.
@return the value associated with the instance after it is incremented.
@since 3.5 | java | src/main/java/org/apache/commons/lang3/mutable/MutableByte.java | 302 | [] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
getManifest | private Manifest getManifest(Archive archive) {
try {
return (archive != null) ? archive.getManifest() : null;
}
catch (IOException ex) {
return null;
}
} | Create a new {@link LaunchedClassLoader} instance.
@param exploded if the underlying archive is exploded
@param rootArchive the root archive or {@code null}
@param urls the URLs from which to load classes and resources
@param parent the parent class loader for delegation | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/LaunchedClassLoader.java | 162 | [
"archive"
] | Manifest | true | 3 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
remove_docker_networks | def remove_docker_networks(networks: list[str] | None = None) -> None:
"""
Removes specified docker networks. If no networks are specified, it removes all networks created by breeze.
Any network with label "com.docker.compose.project=breeze" are removed when no networks are specified.
Errors are ignored... | Removes specified docker networks. If no networks are specified, it removes all networks created by breeze.
Any network with label "com.docker.compose.project=breeze" are removed when no networks are specified.
Errors are ignored (not even printed in the output), so you can safely call it without checking
if the networ... | python | dev/breeze/src/airflow_breeze/utils/docker_command_utils.py | 625 | [
"networks"
] | None | true | 4 | 7.04 | apache/airflow | 43,597 | sphinx | false |
setCount | @CanIgnoreReturnValue
@Override
public Builder<E> setCount(E element, int count) {
super.setCount(element, count);
return this;
} | Adds or removes the necessary occurrences of an element such that the element attains the
desired count.
@param element the element to add or remove occurrences of
@param count the desired count of the element in this multiset
@return this {@code Builder} object
@throws NullPointerException if {@code element} is null
@... | java | guava/src/com/google/common/collect/ImmutableSortedMultiset.java | 521 | [
"element",
"count"
] | true | 1 | 6.4 | google/guava | 51,352 | javadoc | false | |
equals | @Override
public boolean equals(final Object obj) {
if (obj instanceof MutableShort) {
return value == ((MutableShort) obj).shortValue();
}
return false;
} | Compares this object to the specified object. The result is {@code true} if and only if the argument
is not {@code null} and is a {@link MutableShort} object that contains the same {@code short}
value as this object.
@param obj the object to compare with, null returns false.
@return {@code true} if the objects are the... | java | src/main/java/org/apache/commons/lang3/mutable/MutableShort.java | 180 | [
"obj"
] | true | 2 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
readInt | @CanIgnoreReturnValue // to skip some bytes
@Override
public int readInt() throws IOException {
byte b1 = readAndCheckByte();
byte b2 = readAndCheckByte();
byte b3 = readAndCheckByte();
byte b4 = readAndCheckByte();
return Ints.fromBytes(b4, b3, b2, b1);
} | Reads an integer as specified by {@link DataInputStream#readInt()}, except using little-endian
byte order.
@return the next four bytes of the input stream, interpreted as an {@code int} in little-endian
byte order
@throws IOException if an I/O error occurs | java | android/guava/src/com/google/common/io/LittleEndianDataInputStream.java | 114 | [] | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false | |
get_job_description | def get_job_description(self, job_id: str) -> dict:
"""
Get job description (using status_retries).
:param job_id: a Batch job ID
:return: an API response for describe jobs
:raises: AirflowException
"""
for retries in range(self.status_retries):
if ... | Get job description (using status_retries).
:param job_id: a Batch job ID
:return: an API response for describe jobs
:raises: AirflowException | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/batch_client.py | 391 | [
"self",
"job_id"
] | dict | true | 4 | 7.76 | apache/airflow | 43,597 | sphinx | false |
getResource | Resource getResource(String location) {
validateNonPattern(location);
location = StringUtils.cleanPath(location);
if (!ResourceUtils.isUrl(location)) {
location = ResourceUtils.FILE_URL_PREFIX + location;
}
return this.resourceLoader.getResource(location);
} | Get a single resource from a non-pattern location.
@param location the location
@return the resource
@see #isPattern(String) | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/LocationResourceLoader.java | 74 | [
"location"
] | Resource | true | 2 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
indexesOf | public static BitSet indexesOf(final short[] array, final short valueToFind) {
return indexesOf(array, valueToFind, 0);
} | Finds the indices of the given value in the array.
<p>This method returns an empty BitSet for a {@code null} input array.</p>
@param array the array to search for the object, may be {@code null}.
@param valueToFind the value to find.
@return a BitSet of all the indices of the value within the array,
an empty BitSet ... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 2,324 | [
"array",
"valueToFind"
] | BitSet | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
list_mode_options | def list_mode_options(
mode: Optional[str] = None, dynamic: Optional[bool] = None
) -> dict[str, Any]:
r"""Returns a dictionary describing the optimizations that each of the available
modes passed to `torch.compile()` performs.
Args:
mode (str, optional): The mode to return the optimizations fo... | r"""Returns a dictionary describing the optimizations that each of the available
modes passed to `torch.compile()` performs.
Args:
mode (str, optional): The mode to return the optimizations for.
If None, returns optimizations for all modes
dynamic (bool, optional): Whether dynamic shape is enabled.
Exampl... | python | torch/_inductor/__init__.py | 337 | [
"mode",
"dynamic"
] | dict[str, Any] | true | 2 | 8 | pytorch/pytorch | 96,034 | google | false |
substituteExpression | function substituteExpression(node: Expression): Expression {
if (isIdentifier(node)) {
return substituteExpressionIdentifier(node);
}
return node;
} | Visits an ElementAccessExpression that contains a YieldExpression.
@param node The node to visit. | typescript | src/compiler/transformers/generators.ts | 2,060 | [
"node"
] | true | 2 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getNextToProcess | private @Nullable ConfigDataEnvironmentContributor getNextToProcess(ConfigDataEnvironmentContributors contributors,
@Nullable ConfigDataActivationContext activationContext, ImportPhase importPhase) {
for (ConfigDataEnvironmentContributor contributor : contributors.getRoot()) {
if (contributor.getKind() == Kind.... | Processes imports from all active contributors and return a new
{@link ConfigDataEnvironmentContributors} instance.
@param importer the importer used to import {@link ConfigData}
@param activationContext the current activation context or {@code null} if the
context has not yet been created
@return a {@link ConfigDataEn... | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributors.java | 156 | [
"contributors",
"activationContext",
"importPhase"
] | ConfigDataEnvironmentContributor | true | 3 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
join | public static String join(final Object[] array, final String delimiter, final int startIndex, final int endIndex) {
return array != null ? Streams.of(array).skip(startIndex).limit(Math.max(0, endIndex - startIndex))
.collect(LangCollectors.joining(delimiter, EMPTY, EMPTY, ObjectUtils::toString))... | Joins the elements of the provided array into a single String containing the provided list of elements.
<p>
No delimiter is added before or after the list. A {@code null} separator is the same as an empty String (""). Null objects or empty strings within the
array are represented by empty strings.
</p>
<pre>
StringUtil... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 4,599 | [
"array",
"delimiter",
"startIndex",
"endIndex"
] | String | true | 2 | 7.84 | apache/commons-lang | 2,896 | javadoc | false |
polydiv | def polydiv(c1, c2):
"""
Divide one polynomial by another.
Returns the quotient-with-remainder of two polynomials `c1` / `c2`.
The arguments are sequences of coefficients, from lowest order term
to highest, e.g., [1,2,3] represents ``1 + 2*x + 3*x**2``.
Parameters
----------
c1, c2 : a... | Divide one polynomial by another.
Returns the quotient-with-remainder of two polynomials `c1` / `c2`.
The arguments are sequences of coefficients, from lowest order term
to highest, e.g., [1,2,3] represents ``1 + 2*x + 3*x**2``.
Parameters
----------
c1, c2 : array_like
1-D arrays of polynomial coefficients order... | python | numpy/polynomial/polynomial.py | 368 | [
"c1",
"c2"
] | false | 6 | 6.08 | numpy/numpy | 31,054 | numpy | false | |
getNotFoundAction | private ConfigDataNotFoundAction getNotFoundAction(ConfigDataLocation location,
@Nullable ConfigDataResource resource) {
if (location.isOptional() || (resource != null && resource.isOptional())) {
return ConfigDataNotFoundAction.IGNORE;
}
return this.notFoundAction;
} | Resolve and load the given list of locations, filtering any that have been
previously loaded.
@param activationContext the activation context
@param locationResolverContext the location resolver context
@param loaderContext the loader context
@param locations the locations to resolve
@return a map of the loaded locatio... | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataImporter.java | 157 | [
"location",
"resource"
] | ConfigDataNotFoundAction | true | 4 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
createDatabaseLoader | private static CheckedSupplier<Reader, IOException> createDatabaseLoader(Path databasePath) {
return () -> {
Reader.FileMode mode = LOAD_DATABASE_ON_HEAP ? Reader.FileMode.MEMORY : Reader.FileMode.MEMORY_MAPPED;
return new Reader(pathToFile(databasePath), mode, NoCache.getInstance());
... | Prepares the database for lookup by incrementing the usage count.
If the usage count is already negative, it indicates that the database is being closed,
and this method will return false to indicate that no lookup should be performed.
@return true if the database is ready for lookup, false if it is being closed | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/DatabaseReaderLazyLoader.java | 166 | [
"databasePath"
] | true | 2 | 6.88 | elastic/elasticsearch | 75,680 | javadoc | false | |
kron | def kron(a, b):
"""
Kronecker product of two arrays.
Computes the Kronecker product, a composite array made of blocks of the
second array scaled by the first.
Parameters
----------
a, b : array_like
Returns
-------
out : ndarray
See Also
--------
outer : The outer... | Kronecker product of two arrays.
Computes the Kronecker product, a composite array made of blocks of the
second array scaled by the first.
Parameters
----------
a, b : array_like
Returns
-------
out : ndarray
See Also
--------
outer : The outer product
Notes
-----
The function assumes that the number of dimensions... | python | numpy/lib/_shape_base_impl.py | 1,039 | [
"a",
"b"
] | false | 7 | 7.76 | numpy/numpy | 31,054 | numpy | false | |
toString | @Override
public String toString() {
return "Deprecation{level='" + this.level + '\'' + ", reason='" + this.reason + '\'' + ", replacement='"
+ this.replacement + '\'' + '}';
} | The full name of the property that replaces the related deprecated property, if
any.
@return the replacement property name | java | configuration-metadata/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/Deprecation.java | 91 | [] | String | true | 1 | 6.72 | spring-projects/spring-boot | 79,428 | javadoc | false |
next | private ParsePosition next(final ParsePosition pos) {
pos.setIndex(pos.getIndex() + 1);
return pos;
} | Convenience method to advance parse position by 1
@param pos ParsePosition
@return {@code pos} | java | src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java | 362 | [
"pos"
] | ParsePosition | true | 1 | 6 | apache/commons-lang | 2,896 | javadoc | false |
sniffOnFailure | public void sniffOnFailure() {
// sniffOnFailure does nothing until the initial sniffing round has been completed
if (initialized.get()) {
/*
* If sniffing is already running, there is no point in scheduling another round right after the current one.
* Concurrent ca... | Schedule sniffing to run as soon as possible if it isn't already running. Once such sniffing round runs
it will also schedule a new round after sniffAfterFailureDelay ms. | java | client/sniffer/src/main/java/org/elasticsearch/client/sniff/Sniffer.java | 96 | [] | void | true | 3 | 6.72 | elastic/elasticsearch | 75,680 | javadoc | false |
isRegistered | private boolean isRegistered(@Nullable Throwable ex) {
if (ex == null) {
return false;
}
if (this.loggedExceptions.contains(ex)) {
return true;
}
if (ex instanceof InvocationTargetException) {
return isRegistered(ex.getCause());
}
return false;
} | Check if the exception is a log configuration message, i.e. the log call might not
have actually output anything.
@param ex the source exception
@return {@code true} if the exception contains a log configuration message | java | core/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionHandler.java | 108 | [
"ex"
] | true | 4 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false | |
__init__ | def __init__(self: Self, name: str | None = None) -> None:
"""
Initialize an on-disk cache instance.
Args:
name (str | None, optional): The name of the cache directory. If None,
defaults to "on_disk_cache".
"""
self.name = name or "on_disk_cache" | Initialize an on-disk cache instance.
Args:
name (str | None, optional): The name of the cache directory. If None,
defaults to "on_disk_cache". | python | torch/_inductor/cache.py | 261 | [
"self",
"name"
] | None | true | 2 | 6.88 | pytorch/pytorch | 96,034 | google | false |
printoptions | def printoptions(*args, **kwargs):
"""Context manager for setting print options.
Set print options for the scope of the `with` block, and restore the old
options at the end. See `set_printoptions` for the full description of
available options.
Examples
--------
>>> import numpy as np
... | Context manager for setting print options.
Set print options for the scope of the `with` block, and restore the old
options at the end. See `set_printoptions` for the full description of
available options.
Examples
--------
>>> import numpy as np
>>> from numpy.testing import assert_equal
>>> with np.printoptions(pr... | python | numpy/_core/arrayprint.py | 398 | [] | false | 1 | 6 | numpy/numpy | 31,054 | unknown | false | |
make_functional_deprecated_v1 | def make_functional_deprecated_v1(model: nn.Module):
"""make_functional_deprecated_v1(model) -> weights, func, weight_names
Given an nn.Module, make_functional_deprecated_v1 extracts the state (weights)
and returns a functional version of the model, `func`. This makes
it so that it is possible use tran... | make_functional_deprecated_v1(model) -> weights, func, weight_names
Given an nn.Module, make_functional_deprecated_v1 extracts the state (weights)
and returns a functional version of the model, `func`. This makes
it so that it is possible use transforms over the parameters of
`model`.
`func` can be invoked as follows... | python | torch/_functorch/make_functional.py | 171 | [
"model"
] | true | 2 | 7.12 | pytorch/pytorch | 96,034 | unknown | false | |
of | static SslManagerBundle of(KeyManagerFactory keyManagerFactory, TrustManagerFactory trustManagerFactory) {
Assert.notNull(keyManagerFactory, "'keyManagerFactory' must not be null");
Assert.notNull(trustManagerFactory, "'trustManagerFactory' must not be null");
return new SslManagerBundle() {
@Override
publ... | Factory method to create a new {@link SslManagerBundle} instance.
@param keyManagerFactory the key manager factory
@param trustManagerFactory the trust manager factory
@return a new {@link SslManagerBundle} instance | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/SslManagerBundle.java | 100 | [
"keyManagerFactory",
"trustManagerFactory"
] | SslManagerBundle | true | 1 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
ensureOpen | private void ensureOpen() {
if (this.closed) {
throw new IllegalStateException("Zip file closed");
}
if (this.resources.zipContent() == null) {
throw new IllegalStateException("The object is not initialized.");
}
} | Return if an entry with the given name exists.
@param name the name to check
@return if the entry exists | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/NestedJarFile.java | 412 | [] | void | true | 3 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
containsAny | @Deprecated
public static boolean containsAny(final CharSequence cs, final CharSequence... searchCharSequences) {
return Strings.CS.containsAny(cs, searchCharSequences);
} | Tests if the CharSequence contains any of the CharSequences in the given array.
<p>
A {@code null} {@code cs} CharSequence will return {@code false}. A {@code null} or zero length search array will
return {@code false}.
</p>
<pre>
StringUtils.containsAny(null, *) = false
StringUtils.containsAny("", *) ... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 1,125 | [
"cs"
] | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false | |
limit | public static <T extends @Nullable Object> Iterator<T> limit(
Iterator<T> iterator, int limitSize) {
checkNotNull(iterator);
checkArgument(limitSize >= 0, "limit is negative");
return new Iterator<T>() {
private int count;
@Override
public boolean hasNext() {
return count < ... | Returns a view containing the first {@code limitSize} elements of {@code iterator}. If {@code
iterator} contains fewer than {@code limitSize} elements, the returned view contains all of its
elements. The returned iterator supports {@code remove()} if {@code iterator} does.
@param iterator the iterator to limit
@param l... | java | android/guava/src/com/google/common/collect/Iterators.java | 956 | [
"iterator",
"limitSize"
] | true | 3 | 6.24 | google/guava | 51,352 | javadoc | false | |
toString | @Override
public String toString() {
return Objects.toString(value);
} | Returns the String value of this mutable.
@return the mutable value as a string. | java | src/main/java/org/apache/commons/lang3/mutable/MutableObject.java | 123 | [] | String | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false |
checkedCast | @CanIgnoreReturnValue
public static byte checkedCast(long value) {
checkArgument(value >> Byte.SIZE == 0, "out of range: %s", value);
return (byte) value;
} | Returns the {@code byte} value that, when treated as unsigned, is equal to {@code value}, if
possible.
@param value a value between 0 and 255 inclusive
@return the {@code byte} value that, when treated as unsigned, equals {@code value}
@throws IllegalArgumentException if {@code value} is negative or greater than 255 | java | android/guava/src/com/google/common/primitives/UnsignedBytes.java | 96 | [
"value"
] | true | 1 | 6.56 | google/guava | 51,352 | javadoc | false | |
iterator | @Override
public Iterator<ConsumerRecord<K, V>> iterator() {
return new ConcatenatedIterable<>(records.values()).iterator();
} | 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 | 96 | [] | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
namePredicate | private static <T> Predicate<T> namePredicate(final String name, final Function<T, String> nameGetter) {
return (Predicate<T>) t -> t != null && Objects.equals(nameGetter.apply(t), Objects.requireNonNull(name));
} | Waits for the given thread to die for the given duration. Implemented using {@link Thread#join(long, int)}.
@param thread The thread to join.
@param duration How long to wait.
@throws InterruptedException if any thread has interrupted the current thread.
@see Thread#join(long, int)
@since 3.12.0 | java | src/main/java/org/apache/commons/lang3/ThreadUtils.java | 483 | [
"name",
"nameGetter"
] | true | 2 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
isEnabled | protected boolean isEnabled(AnnotationMetadata metadata) {
if (getClass() == AutoConfigurationImportSelector.class) {
return getEnvironment().getProperty(EnableAutoConfiguration.ENABLED_OVERRIDE_PROPERTY, Boolean.class, true);
}
return true;
} | Return the {@link AutoConfigurationEntry} based on the {@link AnnotationMetadata}
of the importing {@link Configuration @Configuration} class.
@param annotationMetadata the annotation metadata of the configuration class
@return the auto-configurations that should be imported | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java | 162 | [
"metadata"
] | true | 2 | 7.12 | spring-projects/spring-boot | 79,428 | javadoc | false | |
withNewLineAtEnd | default JsonWriter<T> withNewLineAtEnd() {
return withSuffix("\n");
} | Return a new {@link JsonWriter} instance that appends a new line after the JSON has
been written.
@return a new {@link JsonWriter} instance that appends a new line after the JSON | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 114 | [] | true | 1 | 6.64 | spring-projects/spring-boot | 79,428 | javadoc | false | |
getNewRequires | function getNewRequires(moduleSpecifier: string, quotePreference: QuotePreference, defaultImport: Import | undefined, namedImports: readonly Import[] | undefined, namespaceLikeImport: Import | undefined): RequireVariableStatement | readonly RequireVariableStatement[] {
const quotedModuleSpecifier = makeStringLiter... | @param forceImportKeyword Indicates that the user has already typed `import`, so the result must start with `import`.
(In other words, do not allow `const x = require("...")` for JS files.)
@internal | typescript | src/services/codefixes/importFixes.ts | 2,096 | [
"moduleSpecifier",
"quotePreference",
"defaultImport",
"namedImports",
"namespaceLikeImport"
] | true | 6 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
_deserialize_operator_extra_links | def _deserialize_operator_extra_links(
cls, encoded_op_links: dict[str, str]
) -> dict[str, XComOperatorLink]:
"""
Deserialize Operator Links if the Classes are registered in Airflow Plugins.
Error is raised if the OperatorLink is not found in Plugins too.
:param encoded_op... | Deserialize Operator Links if the Classes are registered in Airflow Plugins.
Error is raised if the OperatorLink is not found in Plugins too.
:param encoded_op_links: Serialized Operator Link
:return: De-Serialized Operator Link | python | airflow-core/src/airflow/serialization/serialized_objects.py | 1,782 | [
"cls",
"encoded_op_links"
] | dict[str, XComOperatorLink] | true | 3 | 7.44 | apache/airflow | 43,597 | sphinx | false |
toString | public static String toString(final Character ch) {
return ch != null ? toString(ch.charValue()) : null;
} | Converts the character to a String that contains the one character.
<p>For ASCII 7 bit characters, this uses a cache that will return the
same String object each time.</p>
<p>If {@code null} is passed in, {@code null} will be returned.</p>
<pre>
CharUtils.toString(null) = null
CharUtils.toString(' ') = " "
CharU... | java | src/main/java/org/apache/commons/lang3/CharUtils.java | 493 | [
"ch"
] | String | true | 2 | 8 | apache/commons-lang | 2,896 | javadoc | false |
locateGradleResourcesDirectory | private File locateGradleResourcesDirectory(File standardAdditionalMetadataLocation) throws FileNotFoundException {
String path = standardAdditionalMetadataLocation.getPath();
int index = path.lastIndexOf(CLASSES_DIRECTORY);
if (index < 0) {
throw new FileNotFoundException();
}
String buildDirectoryPath = ... | Read additional {@link ConfigurationMetadata} for the {@link TypeElement} or
{@code null}.
@param typeElement the type to get additional metadata for
@return additional metadata for the given type or {@code null} if none is present | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/MetadataStore.java | 224 | [
"standardAdditionalMetadataLocation"
] | File | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
whenComplete | public abstract KafkaFuture<T> whenComplete(BiConsumer<? super T, ? super Throwable> action); | Returns a new KafkaFuture with the same result or exception as this future, that executes the given action
when this future completes.
When this future is done, the given action is invoked with the result (or null if none) and the exception
(or null if none) of this future as arguments.
The returned future is completed... | java | clients/src/main/java/org/apache/kafka/common/KafkaFuture.java | 141 | [
"action"
] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
addAll | @CanIgnoreReturnValue
@Override
public Builder<E> addAll(Iterator<? extends E> elements) {
checkNotNull(elements);
while (elements.hasNext()) {
add(elements.next());
}
return this;
} | Adds each element of {@code elements} to the {@code ImmutableSet}, ignoring duplicate
elements (only the first duplicate element is added).
@param elements the elements to add to the {@code ImmutableSet}
@return this {@code Builder} object
@throws NullPointerException if {@code elements} is null or contains a null elem... | java | android/guava/src/com/google/common/collect/ImmutableSet.java | 567 | [
"elements"
] | true | 2 | 7.6 | google/guava | 51,352 | javadoc | false | |
poll | public boolean poll(Timer timer, boolean waitForJoinGroup) {
maybeUpdateSubscriptionMetadata();
invokeCompletedOffsetCommitCallbacks();
if (subscriptions.hasAutoAssignedPartitions()) {
if (protocol == null) {
throw new IllegalStateException("User configured " + Cons... | Poll for coordinator events. This ensures that the coordinator is known and that the consumer
has joined the group (if it is using group management). This also handles periodic offset commits
if they are enabled.
<p>
Returns early if the timeout expires or if waiting on rejoin is not required
@param timer Timer boundin... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java | 511 | [
"timer",
"waitForJoinGroup"
] | true | 12 | 8 | apache/kafka | 31,560 | javadoc | false | |
newHashSetWithExpectedSize | @SuppressWarnings("NonApiType") // acts as a direct substitute for a constructor call
public static <E extends @Nullable Object> HashSet<E> newHashSetWithExpectedSize(
int expectedSize) {
return new HashSet<>(Maps.capacity(expectedSize));
} | Returns a new hash set using the smallest initial table size that can hold {@code expectedSize}
elements without resizing. Note that this is not what {@link HashSet#HashSet(int)} does, but it
is what most users want and expect it to do.
<p>This behavior can't be broadly guaranteed, but has been tested with OpenJDK 1.7 ... | java | android/guava/src/com/google/common/collect/Sets.java | 263 | [
"expectedSize"
] | true | 1 | 6.72 | google/guava | 51,352 | javadoc | false | |
compose | default FailableLongUnaryOperator<E> compose(final FailableLongUnaryOperator<E> before) {
Objects.requireNonNull(before);
return (final long v) -> applyAsLong(before.applyAsLong(v));
} | Returns a composed {@link FailableLongUnaryOperator} like {@link LongUnaryOperator#compose(LongUnaryOperator)}.
@param before the operator to apply before this one.
@return a composed {@link FailableLongUnaryOperator} like {@link LongUnaryOperator#compose(LongUnaryOperator)}.
@throws NullPointerException if before is n... | java | src/main/java/org/apache/commons/lang3/function/FailableLongUnaryOperator.java | 86 | [
"before"
] | true | 1 | 6 | apache/commons-lang | 2,896 | javadoc | false | |
lastIndexOf | public static int lastIndexOf(final byte[] array, final byte valueToFind, int startIndex) {
if (array == null || startIndex < 0) {
return INDEX_NOT_FOUND;
}
if (startIndex >= array.length) {
startIndex = array.length - 1;
}
for (int i = startIndex; i >= 0;... | Finds the last index of the given value in the array starting at the given index.
<p>
This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.
</p>
<p>
A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the array length will search from the... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 3,833 | [
"array",
"valueToFind",
"startIndex"
] | true | 6 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
sigmoid_kernel | def sigmoid_kernel(X, Y=None, gamma=None, coef0=1):
"""Compute the sigmoid kernel between X and Y.
.. code-block:: text
K(X, Y) = tanh(gamma <X, Y> + coef0)
Read more in the :ref:`User Guide <sigmoid_kernel>`.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples_... | Compute the sigmoid kernel between X and Y.
.. code-block:: text
K(X, Y) = tanh(gamma <X, Y> + coef0)
Read more in the :ref:`User Guide <sigmoid_kernel>`.
Parameters
----------
X : {array-like, sparse matrix} of shape (n_samples_X, n_features)
A feature array.
Y : {array-like, sparse matrix} of shape (n_sa... | python | sklearn/metrics/pairwise.py | 1,509 | [
"X",
"Y",
"gamma",
"coef0"
] | false | 2 | 7.68 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
append | public StrBuilder append(final double value) {
return append(String.valueOf(value));
} | Appends a double value to the string builder using {@code String.valueOf}.
@param value the value to append
@return {@code this} instance. | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 517 | [
"value"
] | StrBuilder | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false |
requestRunOnDemand | public void requestRunOnDemand() {
if (isCancelled() || isCompleted()) {
logger.debug("Not requesting downloader to run on demand because task is cancelled or completed");
return;
}
logger.trace("Requesting downloader run on demand");
// If queuedRuns was greater ... | This method requests that the downloader runs on the latest cluster state, which likely contains a change in the GeoIP metadata.
This method does nothing if this task is cancelled or completed. | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/AbstractGeoIpDownloader.java | 110 | [] | void | true | 4 | 6.88 | elastic/elasticsearch | 75,680 | javadoc | false |
get_import_status | def get_import_status(self, import_arn: str) -> tuple[str, str | None, str | None]:
"""
Get import status from Dynamodb.
:param import_arn: The Amazon Resource Name (ARN) for the import.
:return: Import status, Error code and Error message
"""
self.log.info("Poking for D... | Get import status from Dynamodb.
:param import_arn: The Amazon Resource Name (ARN) for the import.
:return: Import status, Error code and Error message | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/dynamodb.py | 86 | [
"self",
"import_arn"
] | tuple[str, str | None, str | None] | true | 2 | 8.24 | apache/airflow | 43,597 | sphinx | false |
setActiveTask | public <T> CompletableFuture<T> setActiveTask(final CompletableFuture<T> currentTask) {
Objects.requireNonNull(currentTask, "currentTask cannot be null");
pendingTask.getAndUpdate(task -> {
if (task == null) {
return new ActiveFuture(currentTask);
} else if (task ... | If there is no pending task, set the pending task active.
If wakeup was called before setting an active task, the current task will complete exceptionally with
WakeupException right away.
If there is an active task, throw exception.
@param currentTask
@param <T>
@return | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/WakeupTrigger.java | 75 | [
"currentTask"
] | true | 4 | 8.24 | apache/kafka | 31,560 | javadoc | false | |
_concat_same_type | def _concat_same_type(cls, to_concat) -> Self:
"""
Concatenate multiple ArrowExtensionArrays.
Parameters
----------
to_concat : sequence of ArrowExtensionArrays
Returns
-------
ArrowExtensionArray
"""
chunks = [array for ea in to_concat f... | Concatenate multiple ArrowExtensionArrays.
Parameters
----------
to_concat : sequence of ArrowExtensionArrays
Returns
-------
ArrowExtensionArray | python | pandas/core/arrays/arrow/array.py | 1,812 | [
"cls",
"to_concat"
] | Self | true | 3 | 6.08 | pandas-dev/pandas | 47,362 | numpy | false |
_get_task_creator | def _get_task_creator(
self,
created_counts: dict[str, int],
ti_mutation_hook: Callable,
hook_is_noop: Literal[True, False],
dag_version_id: UUIDType,
) -> Callable[[Operator, Iterable[int]], Iterator[dict[str, Any]] | Iterator[TI]]:
"""
Get the task creator f... | Get the task creator function.
This function also updates the created_counts dictionary with the number of tasks created.
:param created_counts: Dictionary of task_type -> count of created TIs
:param ti_mutation_hook: task_instance_mutation_hook function
:param hook_is_noop: Whether the task_instance_mutation_hook is... | python | airflow-core/src/airflow/models/dagrun.py | 1,838 | [
"self",
"created_counts",
"ti_mutation_hook",
"hook_is_noop",
"dag_version_id"
] | Callable[[Operator, Iterable[int]], Iterator[dict[str, Any]] | Iterator[TI]] | true | 6 | 6.4 | apache/airflow | 43,597 | sphinx | false |
APOS_ESCAPE | public static String[][] APOS_ESCAPE() {
return APOS_ESCAPE.clone();
} | Mapping to escape the apostrophe character to its XML character entity.
@return the mapping table. | java | src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java | 362 | [] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
ScopedEventBaseThread | ScopedEventBaseThread(ScopedEventBaseThread&& other) = delete; | Runs the passed-in function on the event base of the thread.
@param func Function to be run on event base of the thread.
@methodset Operations | cpp | folly/io/async/ScopedEventBaseThread.h | 116 | [] | true | 2 | 6.8 | facebook/folly | 30,157 | doxygen | false | |
asList | public static List<Short> asList(short... backingArray) {
if (backingArray.length == 0) {
return Collections.emptyList();
}
return new ShortArrayAsList(backingArray);
} | Returns a fixed-size list backed by the specified array, similar to {@link
Arrays#asList(Object[])}. The list supports {@link List#set(int, Object)}, but any attempt to
set a value to {@code null} will result in a {@link NullPointerException}.
<p>The returned list maintains the values, but not the identities, of {@code... | java | android/guava/src/com/google/common/primitives/Shorts.java | 618 | [] | true | 2 | 8.08 | google/guava | 51,352 | javadoc | false | |
copyOf | @IgnoreJRERequirement // Users will use this only if they're already using streams.
public static ImmutableIntArray copyOf(IntStream stream) {
// Note this uses very different growth behavior from copyOf(Iterable) and the builder.
int[] array = stream.toArray();
return (array.length == 0) ? EMPTY : new Im... | Returns an immutable array containing all the values from {@code stream}, in order.
@since 33.4.0 (but since 22.0 in the JRE flavor) | java | android/guava/src/com/google/common/primitives/ImmutableIntArray.java | 173 | [
"stream"
] | ImmutableIntArray | true | 2 | 6 | google/guava | 51,352 | javadoc | false |
newCall | private <K, V> Call newCall(AdminApiDriver<K, V> driver, AdminApiDriver.RequestSpec<K> spec) {
NodeProvider nodeProvider = spec.scope.destinationBrokerId().isPresent() ?
new ConstantNodeIdProvider(spec.scope.destinationBrokerId().getAsInt()) :
new LeastLoadedNodeProvider();
retur... | Forcefully terminates an ongoing transaction for a given transactional ID.
<p>
This API is intended for well-formed but long-running transactions that are known to the
transaction coordinator. It is primarily designed for supporting 2PC (two-phase commit) workflows,
where a coordinator may need to unilaterally terminat... | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 5,100 | [
"driver",
"spec"
] | Call | true | 3 | 7.6 | apache/kafka | 31,560 | javadoc | false |
updateLastAckedOffset | private void updateLastAckedOffset(ProduceResponse.PartitionResponse response, ProducerBatch batch) {
if (response.baseOffset == ProduceResponse.INVALID_OFFSET)
return;
long lastOffset = response.baseOffset + batch.recordCount - 1;
txnPartitionMap.updateLastAckedOffset(batch.topicPar... | Returns the first inflight sequence for a given partition. This is the base sequence of an inflight batch with
the lowest sequence number.
@return the lowest inflight sequence if the transaction manager is tracking inflight requests for this partition.
If there are no inflight requests being tracked for this pa... | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java | 740 | [
"response",
"batch"
] | void | true | 2 | 6.72 | 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.