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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
shortValue | @Override
public short shortValue() {
return value;
} | Returns the value of this MutableShort as a short.
@return the numeric value represented by this object after conversion to type short. | java | src/main/java/org/apache/commons/lang3/mutable/MutableShort.java | 342 | [] | true | 1 | 6.48 | apache/commons-lang | 2,896 | javadoc | false | |
isTrue | public static void isTrue(final boolean expression, final String message, final double value) {
if (!expression) {
throw new IllegalArgumentException(String.format(message, Double.valueOf(value)));
}
} | Validate that the argument condition is {@code true}; otherwise
throwing an exception with the specified message. This method is useful when
validating according to an arbitrary boolean expression, such as validating a
primitive number or using your own custom validation expression.
<pre>Validate.isTrue(d > 0.0, "Th... | java | src/main/java/org/apache/commons/lang3/Validate.java | 522 | [
"expression",
"message",
"value"
] | void | true | 2 | 6.4 | apache/commons-lang | 2,896 | javadoc | false |
longToIntArray | public static int[] longToIntArray(final long src, final int srcPos, final int[] dst, final int dstPos, final int nInts) {
if (0 == nInts) {
return dst;
}
if ((nInts - 1) * Integer.SIZE + srcPos >= Long.SIZE) {
throw new IllegalArgumentException("(nInts - 1) * 32 + srcPos... | Converts a long into an array of int using the default (little-endian, LSB0) byte and bit ordering.
@param src the long to convert.
@param srcPos the position in {@code src}, in bits, from where to start the conversion.
@param dst the destination array.
@param dstPos the position in {@code dst} where to copy the ... | java | src/main/java/org/apache/commons/lang3/Conversion.java | 1,172 | [
"src",
"srcPos",
"dst",
"dstPos",
"nInts"
] | true | 4 | 8.08 | apache/commons-lang | 2,896 | javadoc | false | |
_get_secret | def _get_secret(self, path_prefix: str, secret_id: str, lookup_pattern: str | None) -> str | None:
"""
Get secret value from Parameter Store.
:param path_prefix: Prefix for the Path to get Secret
:param secret_id: Secret Key
:param lookup_pattern: If provided, `secret_id` must m... | Get secret value from Parameter Store.
:param path_prefix: Prefix for the Path to get Secret
:param secret_id: Secret Key
:param lookup_pattern: If provided, `secret_id` must match this pattern to look up the secret in
Systems Manager | python | providers/amazon/src/airflow/providers/amazon/aws/secrets/systems_manager.py | 171 | [
"self",
"path_prefix",
"secret_id",
"lookup_pattern"
] | str | None | true | 3 | 6.56 | apache/airflow | 43,597 | sphinx | false |
opj_int_min | static INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b)
{
return a < b ? a : b;
} | Get the minimum of two integers
@return Returns a if a < b else b | cpp | 3rdparty/openjpeg/openjp2/opj_intmath.h | 56 | [
"a",
"b"
] | true | 2 | 6.48 | opencv/opencv | 85,374 | doxygen | false | |
inner | def inner(*args: _P.args, **kwargs: _P.kwargs) -> _R:
"""Attempt to replay from cache, or record on cache miss.
Args:
*args: Positional arguments to pass to the function.
**kwargs: Keyword arguments to pass to the function.
Return... | Attempt to replay from cache, or record on cache miss.
Args:
*args: Positional arguments to pass to the function.
**kwargs: Keyword arguments to pass to the function.
Returns:
The result from cache (if hit) or from executing the function (if miss). | python | torch/_inductor/runtime/caching/interfaces.py | 212 | [] | _R | true | 1 | 7.04 | pytorch/pytorch | 96,034 | google | false |
svdvals | def svdvals(x, /):
"""
Returns the singular values of a matrix (or a stack of matrices) ``x``.
When x is a stack of matrices, the function will compute the singular
values for each matrix in the stack.
This function is Array API compatible.
Calling ``np.svdvals(x)`` to get singular values is t... | Returns the singular values of a matrix (or a stack of matrices) ``x``.
When x is a stack of matrices, the function will compute the singular
values for each matrix in the stack.
This function is Array API compatible.
Calling ``np.svdvals(x)`` to get singular values is the same as
``np.svd(x, compute_uv=False, hermit... | python | numpy/linalg/_linalg.py | 1,861 | [
"x"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
apply | R apply(double input) throws E; | Applies this function.
@param input the input for the function
@return the result of the function
@throws E Thrown when the function fails. | java | src/main/java/org/apache/commons/lang3/function/FailableDoubleFunction.java | 55 | [
"input"
] | R | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false |
shift | def shift(self, periods: int = 1, fill_value: object = None) -> ExtensionArray:
"""
Shift values by desired number.
Newly introduced missing values are filled with
``self.dtype.na_value``.
Parameters
----------
periods : int, default 1
The number of ... | Shift values by desired number.
Newly introduced missing values are filled with
``self.dtype.na_value``.
Parameters
----------
periods : int, default 1
The number of periods to shift. Negative values are allowed
for shifting backwards.
fill_value : object, optional
The scalar value to use for newly intro... | python | pandas/core/arrays/base.py | 1,368 | [
"self",
"periods",
"fill_value"
] | ExtensionArray | true | 6 | 7.92 | pandas-dev/pandas | 47,362 | numpy | false |
_finalize_template_configs | def _finalize_template_configs(
self,
template_choices: dict[str, Generator[KernelTemplateChoice, None, None]],
kernel_inputs: KernelInputs,
templates: list[Union[KernelTemplate, ExternKernelChoice]],
op_name: str,
kwarg_overrides: Optional[dict[str, dict[str, Any]]] = No... | Check lookup table for hits, use those if found, otherwise fall back to parent. | python | torch/_inductor/lookup_table/choices.py | 312 | [
"self",
"template_choices",
"kernel_inputs",
"templates",
"op_name",
"kwarg_overrides"
] | list[KernelTemplateChoice] | true | 3 | 6 | pytorch/pytorch | 96,034 | unknown | false |
highlight_max | def highlight_max(
self,
subset: Subset | None = None,
color: str = "yellow",
axis: Axis | None = 0,
props: str | None = None,
) -> Styler:
"""
Highlight the maximum with a style.
Parameters
----------
%(subset)s
%(color)s
... | Highlight the maximum with a style.
Parameters
----------
%(subset)s
%(color)s
axis : {0 or 'index', 1 or 'columns', None}, default 0
Apply to each column (``axis=0`` or ``'index'``), to each row
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
with ``axis=None``.
%(props)s
Returns
------... | python | pandas/io/formats/style.py | 3,351 | [
"self",
"subset",
"color",
"axis",
"props"
] | Styler | true | 2 | 6.8 | pandas-dev/pandas | 47,362 | numpy | false |
flatten | function flatten<T extends L.List, I>(list: T & L.List<I>): Flatten<T> {
return reduce(list, (acc, item) => concat(acc, wrap(item)), [] as any[])
} | Returns a new array with all sub-array elements concatenated.
(more efficient than native flat)
@param list
@returns | typescript | helpers/blaze/flatten.ts | 19 | [
"list"
] | true | 1 | 6.8 | prisma/prisma | 44,834 | jsdoc | false | |
parseParameterWorker | function parseParameterWorker(inOuterAwaitContext: boolean, allowAmbiguity = true): ParameterDeclaration | undefined {
const pos = getNodePos();
const hasJSDoc = hasPrecedingJSDocComment();
// FormalParameter [Yield,Await]:
// BindingElement[?Yield,?Await]
// Decora... | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 4,036 | [
"inOuterAwaitContext",
"allowAmbiguity"
] | true | 6 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
removeOccurrences | @CanIgnoreReturnValue
public static boolean removeOccurrences(
Multiset<?> multisetToModify, Multiset<?> occurrencesToRemove) {
checkNotNull(multisetToModify);
checkNotNull(occurrencesToRemove);
boolean changed = false;
Iterator<? extends Entry<?>> entryIterator = multisetToModify.entrySet().it... | For each occurrence of an element {@code e} in {@code occurrencesToRemove}, removes one
occurrence of {@code e} in {@code multisetToModify}.
<p>Equivalently, this method modifies {@code multisetToModify} so that {@code
multisetToModify.count(e)} is set to {@code Math.max(0, multisetToModify.count(e) -
occurrencesToRemo... | java | android/guava/src/com/google/common/collect/Multisets.java | 800 | [
"multisetToModify",
"occurrencesToRemove"
] | true | 4 | 6.24 | google/guava | 51,352 | javadoc | false | |
maybe_coerce_values | def maybe_coerce_values(values: ArrayLike) -> ArrayLike:
"""
Input validation for values passed to __init__. Ensure that
any datetime64/timedelta64 dtypes are in nanoseconds. Ensure
that we do not have string dtypes.
Parameters
----------
values : np.ndarray or ExtensionArray
Returns
... | Input validation for values passed to __init__. Ensure that
any datetime64/timedelta64 dtypes are in nanoseconds. Ensure
that we do not have string dtypes.
Parameters
----------
values : np.ndarray or ExtensionArray
Returns
-------
values : np.ndarray or ExtensionArray | python | pandas/core/internals/blocks.py | 2,187 | [
"values"
] | ArrayLike | true | 5 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false |
createSuperElementAccessInAsyncMethod | function createSuperElementAccessInAsyncMethod(argumentExpression: Expression, location: TextRange): LeftHandSideExpression {
if (enclosingSuperContainerFlags & NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync) {
return setTextRange(
factory.createPropertyAccessExpression(
... | Hooks node substitutions.
@param hint The context for the emitter.
@param node The node to substitute. | typescript | src/compiler/transformers/es2018.ts | 1,461 | [
"argumentExpression",
"location"
] | true | 3 | 7.04 | microsoft/TypeScript | 107,154 | jsdoc | false | |
bindLoggerGroups | private void bindLoggerGroups(ConfigurableEnvironment environment) {
if (this.loggerGroups != null) {
Binder binder = Binder.get(environment);
binder.bind(LOGGING_GROUP, STRING_STRINGS_MAP).ifBound(this.loggerGroups::putAll);
}
} | Initialize the logging system according to preferences expressed through the
{@link Environment} and the classpath.
@param environment the environment
@param classLoader the classloader | java | core/spring-boot/src/main/java/org/springframework/boot/context/logging/LoggingApplicationListener.java | 368 | [
"environment"
] | void | true | 2 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
registerBeanDefinitions | public int registerBeanDefinitions(ResourceBundle rb) throws BeanDefinitionStoreException {
return registerBeanDefinitions(rb, null);
} | Register bean definitions contained in a resource bundle,
using all property keys (i.e. not filtering by prefix).
@param rb the ResourceBundle to load from
@return the number of bean definitions found
@throws BeanDefinitionStoreException in case of loading or parsing errors
@see #registerBeanDefinitions(java.util.Resou... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/PropertiesBeanDefinitionReader.java | 287 | [
"rb"
] | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false | |
flushPendingBuffer | private void flushPendingBuffer() {
int latestPosition = buffer.position();
buffer.reset();
if (latestPosition > buffer.position()) {
buffer.limit(latestPosition);
addBuffer(buffer.slice());
buffer.position(latestPosition);
buffer.limit(buffer.ca... | Write a record set. The underlying record data will be retained
in the result of {@link #build()}. See {@link BaseRecords#toSend()}.
@param records the records to write | java | clients/src/main/java/org/apache/kafka/common/protocol/SendBuilder.java | 159 | [] | void | true | 2 | 6.88 | apache/kafka | 31,560 | javadoc | false |
clear | public FluentBitSet clear() {
bitSet.clear();
return this;
} | Sets all of the bits in this BitSet to {@code false}.
@return {@code this} instance. | java | src/main/java/org/apache/commons/lang3/util/FluentBitSet.java | 138 | [] | FluentBitSet | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false |
invoke | def invoke( # type: ignore
self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any
) -> Result:
"""Invokes a CLI command in an isolated environment. See
:meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for
full method documentation. See :ref:`testing-cli` for examples.... | Invokes a CLI command in an isolated environment. See
:meth:`CliRunner.invoke <click.testing.CliRunner.invoke>` for
full method documentation. See :ref:`testing-cli` for examples.
If the ``obj`` argument is not given, passes an instance of
:class:`~flask.cli.ScriptInfo` that knows how to load the Flask
app being teste... | python | src/flask/testing.py | 275 | [
"self",
"cli",
"args"
] | Result | true | 3 | 7.6 | pallets/flask | 70,946 | sphinx | false |
bind | default @Nullable Object bind(ConfigurationPropertyName name, Bindable<?> target) {
return bind(name, target, null);
} | Bind the given name to a target bindable.
@param name the name to bind
@param target the target bindable
@return a bound object or {@code null} | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateElementBinder.java | 40 | [
"name",
"target"
] | Object | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false |
substitute | protected boolean substitute(final StrBuilder buf, final int offset, final int length) {
return substitute(buf, offset, length, null) > 0;
} | Internal method that substitutes the variables.
<p>
Most users of this class do not need to call this method. This method will
be called automatically by another (public) method.
</p>
<p>
Writers of subclasses can override this method if they need access to
the substitution process at the start or end.
</p>
@param buf ... | java | src/main/java/org/apache/commons/lang3/text/StrSubstitutor.java | 1,088 | [
"buf",
"offset",
"length"
] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
nextAcquiredRecord | private OffsetAndDeliveryCount nextAcquiredRecord() {
if (acquiredRecordIterator.hasNext()) {
return acquiredRecordIterator.next();
}
return null;
} | The {@link RecordBatch batch} of {@link Record records} is converted to a {@link List list} of
{@link ConsumerRecord consumer records} and returned. {@link BufferSupplier Decompression} and
{@link Deserializer deserialization} of the {@link Record record's} key and value are performed in
this step.
@param deserializers... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareCompletedFetch.java | 275 | [] | OffsetAndDeliveryCount | true | 2 | 7.6 | apache/kafka | 31,560 | javadoc | false |
requestAutoCommit | private CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> requestAutoCommit(final OffsetCommitRequestState requestState) {
AutoCommitState autocommit = autoCommitState.get();
CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> result;
if (requestState.offsets.isEmpty()) {
... | Generate a request to commit consumed offsets. Add the request to the queue of pending
requests to be sent out on the next call to {@link #poll(long)}. If there are empty
offsets to commit, no request will be generated and a completed future will be returned.
@param requestState Commit request
@return Future containing... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java | 250 | [
"requestState"
] | true | 2 | 8.08 | apache/kafka | 31,560 | javadoc | false | |
getObject | @Override
public @Nullable Object getObject() throws Exception {
if (this.singleton) {
if (!this.initialized) {
throw new FactoryBeanNotInitializedException();
}
// Singleton: return shared object.
return this.singletonObject;
}
else {
// Prototype: new object on each call.
return invokeWit... | Returns the same value each time if the singleton property is set
to "true", otherwise returns the value returned from invoking the
specified method on the fly. | java | spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java | 118 | [] | Object | true | 3 | 7.04 | spring-projects/spring-framework | 59,386 | javadoc | false |
_ensure_key_mapped_multiindex | def _ensure_key_mapped_multiindex(
index: MultiIndex, key: Callable, level=None
) -> MultiIndex:
"""
Returns a new MultiIndex in which key has been applied
to all levels specified in level (or all levels if level
is None). Used for key sorting for MultiIndex.
Parameters
----------
index... | Returns a new MultiIndex in which key has been applied
to all levels specified in level (or all levels if level
is None). Used for key sorting for MultiIndex.
Parameters
----------
index : MultiIndex
Index to which to apply the key function on the
specified levels.
key : Callable
Function that takes an Ind... | python | pandas/core/sorting.py | 500 | [
"index",
"key",
"level"
] | MultiIndex | true | 6 | 6.72 | pandas-dev/pandas | 47,362 | numpy | false |
get_bucket | def get_bucket(self, bucket_name: str | None = None) -> oss2.api.Bucket:
"""
Return a oss2.Bucket object.
:param bucket_name: the name of the bucket
:return: the bucket object to the bucket name.
"""
auth = self.get_credential()
return oss2.Bucket(auth, f"https:/... | Return a oss2.Bucket object.
:param bucket_name: the name of the bucket
:return: the bucket object to the bucket name. | python | providers/alibaba/src/airflow/providers/alibaba/cloud/hooks/oss.py | 132 | [
"self",
"bucket_name"
] | oss2.api.Bucket | true | 1 | 7.04 | apache/airflow | 43,597 | sphinx | false |
_validate_skipfooter | def _validate_skipfooter(kwds: dict[str, Any]) -> None:
"""
Check whether skipfooter is compatible with other kwargs in TextFileReader.
Parameters
----------
kwds : dict
Keyword arguments passed to TextFileReader.
Raises
------
ValueError
If skipfooter is not compatible... | Check whether skipfooter is compatible with other kwargs in TextFileReader.
Parameters
----------
kwds : dict
Keyword arguments passed to TextFileReader.
Raises
------
ValueError
If skipfooter is not compatible with other parameters. | python | pandas/io/parsers/readers.py | 2,371 | [
"kwds"
] | None | true | 5 | 6.24 | pandas-dev/pandas | 47,362 | numpy | false |
map | <T> Map<String, T> map(Supplier<Map<String, T>> mapFactory, CheckedFunction<XContentParser, T, IOException> mapValueParser)
throws IOException; | Returns an instance of {@link Map} holding parsed map.
Serves as a replacement for the "map", "mapOrdered" and "mapStrings" methods above.
@param mapFactory factory for creating new {@link Map} objects
@param mapValueParser parser for parsing a single map value
@param <T> map value type
@return {@link Map} object | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentParser.java | 101 | [
"mapFactory",
"mapValueParser"
] | true | 1 | 6.32 | elastic/elasticsearch | 75,680 | javadoc | false | |
_collect_all_valid_cia_ops | def _collect_all_valid_cia_ops() -> set["OperatorBase"]:
"""
This is an util function that gets the all CIA functional ops.
The algorithm is in 2 steps:
1. We first query C++ dispatcher to get the list of CIA ops
and then we call getattr on torch.ops.aten to lazily populate
them.
... | This is an util function that gets the all CIA functional ops.
The algorithm is in 2 steps:
1. We first query C++ dispatcher to get the list of CIA ops
and then we call getattr on torch.ops.aten to lazily populate
them.
2. Sometimes, handful of ops have CIA registered in python dispatcher
but not o... | python | torch/_export/utils.py | 1,339 | [] | set["OperatorBase"] | true | 5 | 7.04 | pytorch/pytorch | 96,034 | unknown | false |
appendFile | function appendFile(path, data, options, callback) {
callback ||= options;
validateFunction(callback, 'cb');
options = getOptions(options, { encoding: 'utf8', mode: 0o666, flag: 'a' });
// Don't make changes directly on options object
options = copyObject(options);
// Force append behavior when using a su... | Asynchronously appends data to a file.
@param {string | Buffer | URL | number} path
@param {string | Buffer} data
@param {{
encoding?: string | null;
mode?: number;
flag?: string;
flush?: boolean;
} | string} [options]
@param {(err?: Error) => any} callback
@returns {void} | javascript | lib/fs.js | 2,438 | [
"path",
"data",
"options",
"callback"
] | false | 3 | 6.24 | nodejs/node | 114,839 | jsdoc | false | |
setErrorAttributes | private void setErrorAttributes(HttpServletRequest request, int status, @Nullable String message) {
request.setAttribute(ERROR_STATUS_CODE, status);
request.setAttribute(ERROR_MESSAGE, message);
request.setAttribute(ERROR_REQUEST_URI, request.getRequestURI());
} | Return the description for the given request. By default this method will return a
description based on the request {@code servletPath} and {@code pathInfo}.
@param request the source request
@return the description | java | core/spring-boot/src/main/java/org/springframework/boot/web/servlet/support/ErrorPageFilter.java | 256 | [
"request",
"status",
"message"
] | void | true | 1 | 6.72 | spring-projects/spring-boot | 79,428 | javadoc | false |
lazyWeakReadWriteLock | public static Striped<ReadWriteLock> lazyWeakReadWriteLock(int stripes) {
return lazyWeakCustom(stripes, WeakSafeReadWriteLock::new);
} | Creates a {@code Striped<ReadWriteLock>} with lazily initialized, weakly referenced read-write
locks. Every lock is reentrant.
@param stripes the minimum number of stripes (locks) required
@return a new {@code Striped<ReadWriteLock>} | java | android/guava/src/com/google/common/util/concurrent/Striped.java | 279 | [
"stripes"
] | true | 1 | 6.16 | google/guava | 51,352 | javadoc | false | |
withExtraFieldLength | ZipLocalFileHeaderRecord withExtraFieldLength(short extraFieldLength) {
return new ZipLocalFileHeaderRecord(this.versionNeededToExtract, this.generalPurposeBitFlag,
this.compressionMethod, this.lastModFileTime, this.lastModFileDate, this.crc32, this.compressedSize,
this.uncompressedSize, this.fileNameLength, ... | Return a new {@link ZipLocalFileHeaderRecord} with a new
{@link #extraFieldLength()}.
@param extraFieldLength the new extra field length
@return a new {@link ZipLocalFileHeaderRecord} instance | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipLocalFileHeaderRecord.java | 66 | [
"extraFieldLength"
] | ZipLocalFileHeaderRecord | true | 1 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
get_secret_as_dict | def get_secret_as_dict(self, secret_name: str) -> dict:
"""
Retrieve secret value from AWS Secrets Manager as a dict.
:param secret_name: name of the secrets.
:return: dict with the information about the secrets
"""
return json.loads(self.get_secret(secret_name)) | Retrieve secret value from AWS Secrets Manager as a dict.
:param secret_name: name of the secrets.
:return: dict with the information about the secrets | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/secrets_manager.py | 64 | [
"self",
"secret_name"
] | dict | true | 1 | 7.04 | apache/airflow | 43,597 | sphinx | false |
withoutParameters | public MediaType withoutParameters() {
return parameters.isEmpty() ? this : create(type, subtype);
} | Returns a new instance with the same type and subtype as this instance, but without any
parameters. | java | android/guava/src/com/google/common/net/MediaType.java | 881 | [] | MediaType | true | 2 | 6.96 | google/guava | 51,352 | javadoc | false |
statfs | function statfs(path, options = { bigint: false }, callback) {
if (typeof options === 'function') {
callback = options;
options = kEmptyObject;
}
validateFunction(callback, 'cb');
path = getValidatedPath(path);
const req = new FSReqCallback(options.bigint);
req.oncomplete = (err, stats) => {
if ... | Asynchronously gets the stats of a file.
@param {string | Buffer | URL} path
@param {{ bigint?: boolean; }} [options]
@param {(
err?: Error,
stats?: Stats
) => any} callback
@returns {void} | javascript | lib/fs.js | 1,629 | [
"path",
"callback"
] | false | 3 | 6.08 | nodejs/node | 114,839 | jsdoc | false | |
of | public static Options of(Option... options) {
Assert.notNull(options, "'options' must not be null");
if (options.length == 0) {
return NONE;
}
return new Options(EnumSet.copyOf(Arrays.asList(options)));
} | Create a new instance with the given {@link Option} values.
@param options the options to include
@return a new {@link Options} instance | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java | 255 | [] | Options | true | 2 | 8.24 | spring-projects/spring-boot | 79,428 | javadoc | false |
baseUnset | function baseUnset(object, path) {
path = castPath(path, object);
// Prevent prototype pollution, see: https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
var index = -1,
length = path.length;
if (!length) {
return true;
}
var isRootPrimitive... | The base implementation of `_.unset`.
@private
@param {Object} object The object to modify.
@param {Array|string} path The property path to unset.
@returns {boolean} Returns `true` if the property is deleted, else `false`. | javascript | lodash.js | 4,371 | [
"object",
"path"
] | false | 15 | 6.4 | lodash/lodash | 61,490 | jsdoc | false | |
first_valid_index | def first_valid_index(self) -> Hashable:
"""
Return index for {position} non-missing value or None, if no value is found.
See the :ref:`User Guide <missing_data>` for more information
on which values are considered missing.
Returns
-------
type of index
... | Return index for {position} non-missing value or None, if no value is found.
See the :ref:`User Guide <missing_data>` for more information
on which values are considered missing.
Returns
-------
type of index
Index of {position} non-missing value.
See Also
--------
DataFrame.last_valid_index : Return index for l... | python | pandas/core/generic.py | 11,602 | [
"self"
] | Hashable | true | 1 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
optInt | public int optInt(int index) {
return optInt(index, 0);
} | Returns the value at {@code index} if it exists and is an int or can be coerced to
an int. Returns 0 otherwise.
@param index the index to get the value from
@return the {@code value} or {@code 0} | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java | 421 | [
"index"
] | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false | |
putIfAbsent | public static <K, V> V putIfAbsent(final ConcurrentMap<K, V> map, final K key, final V value) {
if (map == null) {
return null;
}
final V result = map.putIfAbsent(key, value);
return result != null ? result : value;
} | Puts a value in the specified {@link ConcurrentMap} if the key is not yet
present. This method works similar to the {@code putIfAbsent()} method of
the {@link ConcurrentMap} interface, but the value returned is different.
Basically, this method is equivalent to the following code fragment:
<pre>
if (!map.containsKey(ke... | java | src/main/java/org/apache/commons/lang3/concurrent/ConcurrentUtils.java | 345 | [
"map",
"key",
"value"
] | V | true | 3 | 8.08 | apache/commons-lang | 2,896 | javadoc | false |
createDeclarationName | function createDeclarationName(symbol: Symbol, declaration: Declaration | undefined): PropertyName {
if (getCheckFlags(symbol) & CheckFlags.Mapped) {
const nameType = (symbol as TransientSymbol).links.nameType;
if (nameType && isTypeUsableAsPropertyName(nameType)) {
r... | (#49811)
Note that there are cases in which the symbol declaration is not present. For example, in the code below both
`MappedIndirect.ax` and `MappedIndirect.ay` have no declaration node attached (due to their mapped-type
parent):
```ts
type Base = { ax: number; ay: string };
type BaseKeys = keyof Base;
type M... | typescript | src/services/codefixes/helpers.ts | 365 | [
"symbol",
"declaration"
] | true | 4 | 7.28 | microsoft/TypeScript | 107,154 | jsdoc | false | |
containsLocalBean | @Override
public boolean containsLocalBean(String name) {
String beanName = transformedBeanName(name);
return ((containsSingleton(beanName) || containsBeanDefinition(beanName)) &&
(!BeanFactoryUtils.isFactoryDereference(name) || isFactoryBean(beanName)));
} | Internal extended variant of {@link #isTypeMatch(String, ResolvableType)}
to check whether the bean with the given name matches the specified type. Allow
additional constraints to be applied to ensure that beans are not created early.
@param name the name of the bean to query
@param typeToMatch the type to match agains... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | 803 | [
"name"
] | true | 4 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false | |
isGroupReady | private boolean isGroupReady(List<StreamsGroupHeartbeatResponseData.Status> statuses) {
if (statuses != null) {
for (final StreamsGroupHeartbeatResponseData.Status status : statuses) {
switch (StreamsGroupHeartbeatResponse.Status.fromCode(status.statusCode())) {
c... | Notify about a successful heartbeat response.
@param response Heartbeat response to extract member info and errors from. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java | 729 | [
"statuses"
] | true | 2 | 6.72 | apache/kafka | 31,560 | javadoc | false | |
attributesFor | static @Nullable AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, String annotationTypeName) {
return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationTypeName));
} | Register all relevant annotation post processors in the given registry.
@param registry the registry to operate on
@param source the configuration source element (already extracted)
that this registration was triggered from. May be {@code null}.
@return a Set of BeanDefinitionHolders, containing all bean definitions
th... | java | spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java | 293 | [
"metadata",
"annotationTypeName"
] | AnnotationAttributes | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
assign | public abstract Map<String, List<TopicPartition>> assign(Map<String, Integer> partitionsPerTopic,
Map<String, Subscription> subscriptions); | Perform the group assignment given the partition counts and member subscriptions
@param partitionsPerTopic The number of partitions for each subscribed topic. Topics not in metadata will be excluded
from this map.
@param subscriptions Map from the member id to their respective topic subscripti... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractPartitionAssignor.java | 58 | [
"partitionsPerTopic",
"subscriptions"
] | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false | |
of | public static ConfigDataLocation of(@Nullable String location) {
boolean optional = location != null && location.startsWith(OPTIONAL_PREFIX);
String value = (location != null && optional) ? location.substring(OPTIONAL_PREFIX.length()) : location;
return (StringUtils.hasText(value)) ? new ConfigDataLocation(option... | Factory method to create a new {@link ConfigDataLocation} from a string.
@param location the location string
@return the {@link ConfigDataLocation} (which may be empty) | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocation.java | 167 | [
"location"
] | ConfigDataLocation | true | 5 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
findThreads | @Deprecated
public static Collection<Thread> findThreads(final ThreadPredicate predicate) {
return findThreads(getSystemThreadGroup(), true, predicate);
} | Finds all active threads which match the given predicate.
@param predicate the predicate.
@return An unmodifiable {@link Collection} of active threads matching the given predicate.
@throws NullPointerException if the predicate is null.
@throws SecurityException if the current thread cannot access the system thread g... | java | src/main/java/org/apache/commons/lang3/ThreadUtils.java | 380 | [
"predicate"
] | true | 1 | 6.32 | apache/commons-lang | 2,896 | javadoc | false | |
close | void close() throws Exception {
if (this.archive != null) {
this.archive.close();
}
} | Properties key for boolean flag (default false) which, if set, will cause the
external configuration properties to be copied to System properties (assuming that
is allowed by Java security). | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/launch/PropertiesLauncher.java | 445 | [] | void | true | 2 | 6.72 | spring-projects/spring-boot | 79,428 | javadoc | false |
replay | public static Log replay(Log source, Class<?> destination) {
return replay(source, LogFactory.getLog(destination));
} | Replay from a source log to a destination log when the source is deferred.
@param source the source logger
@param destination the destination logger class
@return the destination | java | core/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java | 233 | [
"source",
"destination"
] | Log | true | 1 | 6.8 | spring-projects/spring-boot | 79,428 | javadoc | false |
canHandleNewAssignment | public boolean canHandleNewAssignment() {
return MemberState.RECONCILING.getPreviousValidStates().contains(this);
} | @return True if the member is in a state where it should reconcile the new assignment.
Expected to be true whenever the member is part of the group and intends of staying in it
(ex. false when the member is preparing to leave the group). | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/MemberState.java | 159 | [] | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
is_fusible_node | def is_fusible_node(n: fx.Node) -> bool:
"""Check if a node is fusible based on whether it has an inductor lowering.
A node is fusible if:
- It has a lowering in torch._inductor.lowering.lowerings
- It does NOT have a flop counter (expensive compute ops like mm/conv)
- It is NOT a registered fallba... | Check if a node is fusible based on whether it has an inductor lowering.
A node is fusible if:
- It has a lowering in torch._inductor.lowering.lowerings
- It does NOT have a flop counter (expensive compute ops like mm/conv)
- It is NOT a registered fallback (ops that fall back to eager)
- It is NOT a collective or wai... | python | torch/_inductor/fx_passes/fusion_regions.py | 57 | [
"n"
] | bool | true | 11 | 6 | pytorch/pytorch | 96,034 | unknown | false |
leastLoadedNode | LeastLoadedNode leastLoadedNode(long now); | Choose the node with the fewest outstanding requests. This method will prefer a node with an existing connection,
but will potentially choose a node for which we don't yet have a connection if all existing connections are in
use.
@param now The current time in ms
@return The node with the fewest in-flight requests. | java | clients/src/main/java/org/apache/kafka/clients/KafkaClient.java | 133 | [
"now"
] | LeastLoadedNode | true | 1 | 6.8 | apache/kafka | 31,560 | javadoc | false |
chain_as_grid | def chain_as_grid(*tasks):
# type: (BaseOperator) -> None
"""
Chain tasks as a grid.
Example:
t0 -> t1 -> t2 -> t3
| | |
v v v
t4 -> t5 -> t6
| |
v v
t7 -> t8
|
v
t9
"""
if len(tasks) > 100 * 99 / 2:
raise V... | Chain tasks as a grid.
Example:
t0 -> t1 -> t2 -> t3
| | |
v v v
t4 -> t5 -> t6
| |
v v
t7 -> t8
|
v
t9 | python | performance/src/performance_dags/performance_dag/performance_dag.py | 148 | [] | false | 6 | 7.36 | apache/airflow | 43,597 | unknown | false | |
find | static @Nullable ConfigurationPropertyCaching find(@Nullable ConfigurationPropertySource source) {
if (source instanceof CachingConfigurationPropertySource cachingSource) {
return cachingSource.getCaching();
}
return null;
} | Find {@link ConfigurationPropertyCaching} for the given source.
@param source the configuration property source
@return a {@link ConfigurationPropertyCaching} instance or {@code null} if the
source does not support caching. | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/CachingConfigurationPropertySource.java | 41 | [
"source"
] | ConfigurationPropertyCaching | true | 2 | 7.28 | spring-projects/spring-boot | 79,428 | javadoc | false |
SetConsoleCtrlHandler | boolean SetConsoleCtrlHandler(ConsoleCtrlHandler handler, boolean add); | Native call to the Kernel32 API to set a new Console Ctrl Handler.
@param handler A callback to handle control events
@param add True if the handler should be added, false if it should replace existing handlers
@return true if the handler is correctly set
@see <a href="https://learn.microsoft.com/en-us/windows/cons... | java | libs/native/src/main/java/org/elasticsearch/nativeaccess/lib/Kernel32Library.java | 117 | [
"handler",
"add"
] | true | 1 | 6 | elastic/elasticsearch | 75,680 | javadoc | false | |
check_all_tuning_directions | def check_all_tuning_directions(
self,
# pyrefly: ignore [missing-attribute]
func: Callable[["triton.Config"], float],
best_config,
best_timing,
):
"""
Check all directions. We only do this once the regular coordinate
descent tuning find no better choi... | Check all directions. We only do this once the regular coordinate
descent tuning find no better choices any more.
We only have a few tunable fields, so this should be fine. | python | torch/_inductor/runtime/coordinate_descent_tuner.py | 224 | [
"self",
"func",
"best_config",
"best_timing"
] | true | 7 | 6 | pytorch/pytorch | 96,034 | unknown | false | |
asList | public static List<Boolean> asList(boolean... backingArray) {
if (backingArray.length == 0) {
return Collections.emptyList();
}
return new BooleanArrayAsList(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>There are at most two distinct objects in this list, {@code (Boolean) tru... | java | android/guava/src/com/google/common/primitives/Booleans.java | 383 | [] | true | 2 | 8.08 | google/guava | 51,352 | javadoc | false | |
commitSync | public CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> commitSync(final Map<TopicPartition, OffsetAndMetadata> offsets,
final long deadlineMs) {
if (offsets.isEmpty()) {
return CompletableFuture.completedFuture... | Commit offsets, retrying on expected retriable errors while the retry timeout hasn't expired.
@param offsets Offsets to commit
@param deadlineMs Time until which the request will be retried if it fails with
an expected retriable error.
@return Future that will complete when a successful response | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java | 429 | [
"offsets",
"deadlineMs"
] | true | 2 | 7.76 | apache/kafka | 31,560 | javadoc | false | |
all | public KafkaFuture<Void> all() {
return this.future.thenApply(topicPartitionErrorsMap -> {
List<TopicPartition> partitionsFailed = topicPartitionErrorsMap.entrySet()
.stream()
.filter(e -> e.getValue() != Errors.NONE)
.map(Map.Entry::getKey)
... | Return a future which succeeds if all the alter offsets succeed. | java | clients/src/main/java/org/apache/kafka/clients/admin/AlterConsumerGroupOffsetsResult.java | 67 | [] | true | 2 | 7.04 | apache/kafka | 31,560 | javadoc | false | |
moveProfileSpecificChildren | private ConfigDataEnvironmentContributor moveProfileSpecificChildren(ConfigDataEnvironmentContributor contributor,
List<ConfigDataEnvironmentContributor> removed) {
for (ImportPhase importPhase : ImportPhase.values()) {
List<ConfigDataEnvironmentContributor> children = contributor.getChildren(importPhase);
L... | Create a new {@link ConfigDataEnvironmentContributor} instance with a new set of
children for the given phase.
@param importPhase the import phase
@param children the new children
@return a new contributor instance | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java | 298 | [
"contributor",
"removed"
] | ConfigDataEnvironmentContributor | true | 2 | 7.76 | spring-projects/spring-boot | 79,428 | javadoc | false |
getPrimitiveType | PrimitiveType getPrimitiveType(TypeMirror typeMirror) {
if (getPrimitiveFor(typeMirror) != null) {
return this.types.unboxedType(typeMirror);
}
return null;
} | Return the {@link PrimitiveType} of the specified type or {@code null} if the type
does not represent a valid wrapper type.
@param typeMirror a type
@return the primitive type or {@code null} if the type is not a wrapper type | java | configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java | 194 | [
"typeMirror"
] | PrimitiveType | true | 2 | 7.92 | spring-projects/spring-boot | 79,428 | javadoc | false |
_maybe_infer_ndim | def _maybe_infer_ndim(values, placement: BlockPlacement, ndim: int | None) -> int:
"""
If `ndim` is not provided, infer it from placement and values.
"""
if ndim is None:
# GH#38134 Block constructor now assumes ndim is not None
if not isinstance(values.dtype, np.dtype):
if l... | If `ndim` is not provided, infer it from placement and values. | python | pandas/core/internals/api.py | 152 | [
"values",
"placement",
"ndim"
] | int | true | 6 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
_get_label_or_level_values | def _get_label_or_level_values(self, key: Level, axis: AxisInt = 0) -> ArrayLike:
"""
Return a 1-D array of values associated with `key`, a label or level
from the given `axis`.
Retrieval logic:
- (axis=0): Return column values if `key` matches a column label.
Othe... | Return a 1-D array of values associated with `key`, a label or level
from the given `axis`.
Retrieval logic:
- (axis=0): Return column values if `key` matches a column label.
Otherwise return index level values if `key` matches an index
level.
- (axis=1): Return row values if `key` matches an index label.
... | python | pandas/core/generic.py | 1,735 | [
"self",
"key",
"axis"
] | ArrayLike | true | 10 | 6.8 | pandas-dev/pandas | 47,362 | numpy | false |
construct | Object construct(ConstructorInvocation invocation) throws Throwable; | Implement this method to perform extra treatments before and
after the construction of a new object. Polite implementations
would certainly like to invoke {@link Joinpoint#proceed()}.
@param invocation the construction joinpoint
@return the newly created object, which is also the result of
the call to {@link Joinpoint#... | java | spring-aop/src/main/java/org/aopalliance/intercept/ConstructorInterceptor.java | 57 | [
"invocation"
] | Object | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
get_callable_argument_names | def get_callable_argument_names(fn) -> list[str]:
"""
Gets names of all POSITIONAL_OR_KEYWORD arguments for callable `fn`.
Returns an empty list when other types of arguments are present.
This is used by `torch.jit.trace` to assign meaningful argument names to
traced functions and modules.
Arg... | Gets names of all POSITIONAL_OR_KEYWORD arguments for callable `fn`.
Returns an empty list when other types of arguments are present.
This is used by `torch.jit.trace` to assign meaningful argument names to
traced functions and modules.
Args:
fn: A callable.
Returns:
Argument names: List[str] | python | torch/_jit_internal.py | 433 | [
"fn"
] | list[str] | true | 3 | 8.08 | pytorch/pytorch | 96,034 | google | false |
tryConsumeDefine | function tryConsumeDefine(): boolean {
let token = scanner.getToken();
if (token === SyntaxKind.Identifier && scanner.getTokenValue() === "define") {
token = nextToken();
if (token !== SyntaxKind.OpenParenToken) {
return true;
}
to... | Returns true if at least one token was consumed from the stream | typescript | src/services/preProcess.ts | 294 | [] | true | 13 | 6.56 | microsoft/TypeScript | 107,154 | jsdoc | false | |
readStaticField | public static Object readStaticField(final Field field, final boolean forceAccess) throws IllegalAccessException {
Objects.requireNonNull(field, "field");
Validate.isTrue(MemberUtils.isStatic(field), "The field '%s' is not static", field.getName());
return readField(field, (Object) null, forceAc... | Reads a static {@link Field}.
@param field
to read.
@param forceAccess
whether to break scope restrictions using the
{@link AccessibleObject#setAccessible(boolean)} method.
@return the field value.
@throws NullPointerException
if the field is {@code null}.
@throws IllegalArg... | java | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | 542 | [
"field",
"forceAccess"
] | Object | true | 1 | 6.24 | apache/commons-lang | 2,896 | javadoc | false |
uriParts | public static Map<String, Object> uriParts(String uri) {
return UriPartsProcessor.apply(uri);
} | Uses {@link CommunityIdProcessor} to compute community ID for network flow data.
@param sourceIpAddrString source IP address
@param destIpAddrString destination IP address
@param ianaNumber IANA number
@param transport transport protocol
@param sourcePort source port
@param destinationPort destination port
@param icmpT... | java | modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/Processors.java | 195 | [
"uri"
] | true | 1 | 6 | elastic/elasticsearch | 75,680 | javadoc | false | |
parseObject | @Override
public Object parseObject(final String source, final ParsePosition pos) {
return parser.parseObject(source, pos);
} | Uses the parser Format instance.
@param source the String source
@param pos the ParsePosition containing the position to parse from, will
be updated according to parsing success (index) or failure
(error index)
@return the parsed Object
@see Format#parseObject(String, ParsePosition) | java | src/main/java/org/apache/commons/lang3/text/CompositeFormat.java | 102 | [
"source",
"pos"
] | Object | true | 1 | 6 | apache/commons-lang | 2,896 | javadoc | false |
visitVariableStatement | function visitVariableStatement(node: VariableStatement): VisitResult<VariableStatement> {
if (hasSyntacticModifier(node, ModifierFlags.Export)) {
const savedExportedVariableStatement = exportedVariableStatement;
exportedVariableStatement = true;
const visited = visitEach... | @param expressionResultIsUnused Indicates the result of an expression is unused by the parent node (i.e., the left side of a comma or the
expression of an `ExpressionStatement`). | typescript | src/compiler/transformers/es2018.ts | 668 | [
"node"
] | true | 2 | 6.72 | microsoft/TypeScript | 107,154 | jsdoc | false | |
readFirstLine | public @Nullable String readFirstLine() throws IOException {
Closer closer = Closer.create();
try {
BufferedReader reader = closer.register(openBufferedStream());
return reader.readLine();
} catch (Throwable e) {
throw closer.rethrow(e);
} finally {
closer.close();
}
} | Reads the first line of this source as a string. Returns {@code null} if this source is empty.
<p>Like {@link BufferedReader#readLine()}, this method considers a line to be a sequence of
text that is terminated by (but does not include) one of {@code \r\n}, {@code \r} or {@code
\n}. If the source's content does not end... | java | android/guava/src/com/google/common/io/CharSource.java | 314 | [] | String | true | 2 | 6.88 | google/guava | 51,352 | javadoc | false |
groupInstanceId | public Optional<String> groupInstanceId() {
return groupInstanceId;
} | @return Instance ID used by the member when joining the group. If non-empty, it will indicate that
this is a static member. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java | 203 | [] | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
build_subgraph_module_buffer | def build_subgraph_module_buffer(
args: list[TensorBox],
graph_module: torch.fx.GraphModule,
) -> SubgraphResults:
"""This function's goal is to take in the required args and produce the subgraph buffer
The subgraph buffer is a ComputedBuffer that will be inlined into the triton template
Args:
... | This function's goal is to take in the required args and produce the subgraph buffer
The subgraph buffer is a ComputedBuffer that will be inlined into the triton template
Args:
args: The args that are passed into the subgraph. Contains both fixed and lifted inputs.
subgraph: The Subgraph ir for which to produc... | python | torch/_inductor/kernel/flex/common.py | 114 | [
"args",
"graph_module"
] | SubgraphResults | true | 3 | 6.88 | pytorch/pytorch | 96,034 | google | false |
_get_email_list_from_str | def _get_email_list_from_str(addresses: str) -> list[str]:
"""
Extract a list of email addresses from a string.
The string can contain multiple email addresses separated
by any of the following delimiters: ',' or ';'.
:param addresses: A string containing one or more email addresses.
:return: ... | Extract a list of email addresses from a string.
The string can contain multiple email addresses separated
by any of the following delimiters: ',' or ';'.
:param addresses: A string containing one or more email addresses.
:return: A list of email addresses. | python | airflow-core/src/airflow/utils/email.py | 320 | [
"addresses"
] | list[str] | true | 1 | 7.04 | apache/airflow | 43,597 | sphinx | false |
on_group_start | def on_group_start(self, group, **headers) -> dict:
"""Method that is called on group stamping start.
Arguments:
group (group): Group that is stamped.
headers (Dict): Partial headers that could be merged with existing headers.
Returns:
Dict: headers to u... | Method that is called on group stamping start.
Arguments:
group (group): Group that is stamped.
headers (Dict): Partial headers that could be merged with existing headers.
Returns:
Dict: headers to update. | python | celery/canvas.py | 124 | [
"self",
"group"
] | dict | true | 1 | 6.88 | celery/celery | 27,741 | google | false |
get_submodule_paths | def get_submodule_paths():
'''
Get paths to submodules so that we can exclude them from things like
check_test_name.py, check_unicode.py, etc.
'''
root_directory = os.path.dirname(os.path.dirname(__file__))
gitmodule_file = os.path.join(root_directory, '.gitmodules')
with open(gitmodule_file... | Get paths to submodules so that we can exclude them from things like
check_test_name.py, check_unicode.py, etc. | python | tools/get_submodule_paths.py | 5 | [] | false | 3 | 6.08 | numpy/numpy | 31,054 | unknown | false | |
visitCommaListExpression | function visitCommaListExpression(node: CommaListExpression) {
// flattened version of `visitCommaExpression`
let pendingExpressions: Expression[] = [];
for (const elem of node.elements) {
if (isBinaryExpression(elem) && elem.operatorToken.kind === SyntaxKind.CommaToken) {
... | Visits a comma-list expression.
@param node The node to visit. | typescript | src/compiler/transformers/generators.ts | 915 | [
"node"
] | false | 6 | 6.08 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getWarnings | public List<String> getWarnings() {
List<String> warnings = new ArrayList<>();
for (Header header : response.getHeaders("Warning")) {
String warning = header.getValue();
if (matchWarningHeaderPatternByPrefix(warning)) {
warnings.add(extractWarningValueFromWarningH... | Returns a list of all warning headers returned in the response. | java | client/rest/src/main/java/org/elasticsearch/client/Response.java | 176 | [] | true | 2 | 7.04 | elastic/elasticsearch | 75,680 | javadoc | false | |
wrapper | def wrapper(fn: Callable[_P, _R]) -> Callable[_P, _R]:
"""Wrap the function to enable memoization.
Args:
fn: The function to wrap.
Returns:
A wrapped version of the function.
"""
# If caching is disabled, return the original f... | Wrap the function to enable memoization.
Args:
fn: The function to wrap.
Returns:
A wrapped version of the function. | python | torch/_inductor/runtime/caching/interfaces.py | 662 | [
"fn"
] | Callable[_P, _R] | true | 2 | 8.24 | pytorch/pytorch | 96,034 | google | false |
_ensure_tensor_ssa | def _ensure_tensor_ssa(arg: CuteDSLArg, template_tensor: CuteDSLArg) -> str:
"""
Convert scalar arguments to TensorSSA using cute.full_like if needed.
Args:
arg: The argument to check (CSEVariable for tensors, str for scalars, or OpsValue wrapper)
template_tensor: A tens... | Convert scalar arguments to TensorSSA using cute.full_like if needed.
Args:
arg: The argument to check (CSEVariable for tensors, str for scalars, or OpsValue wrapper)
template_tensor: A tensor argument to use as template for full_like
Returns:
String representation suitable for CuteDSL operations | python | torch/_inductor/codegen/cutedsl/cutedsl_op_overrides.py | 65 | [
"arg",
"template_tensor"
] | str | true | 5 | 7.28 | pytorch/pytorch | 96,034 | google | false |
sumBy | function sumBy(array, iteratee) {
return (array && array.length)
? baseSum(array, getIteratee(iteratee, 2))
: 0;
} | This method is like `_.sum` except that it accepts `iteratee` which is
invoked for each element in `array` to generate the value to be summed.
The iteratee is invoked with one argument: (value).
@static
@memberOf _
@since 4.0.0
@category Math
@param {Array} array The array to iterate over.
@param {Function} [iteratee=_... | javascript | lodash.js | 16,652 | [
"array",
"iteratee"
] | false | 3 | 7.52 | lodash/lodash | 61,490 | jsdoc | false | |
obtainFreshBeanFactory | protected ConfigurableListableBeanFactory obtainFreshBeanFactory() {
refreshBeanFactory();
return getBeanFactory();
} | Tell the subclass to refresh the internal bean factory.
@return the fresh BeanFactory instance
@see #refreshBeanFactory()
@see #getBeanFactory() | java | spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java | 718 | [] | ConfigurableListableBeanFactory | true | 1 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false |
allMatch | public boolean allMatch(final FailablePredicate<T, ?> predicate) {
assertNotTerminated();
return stream().allMatch(Failable.asPredicate(predicate));
} | Returns whether all elements of this stream match the provided predicate. May not evaluate the predicate on all
elements if not necessary for determining the result. If the stream is empty then {@code true} is returned and the
predicate is not evaluated.
<p>
This is a short-circuiting terminal operation.
</p>
Note This... | java | src/main/java/org/apache/commons/lang3/stream/Streams.java | 203 | [
"predicate"
] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
keyOrNull | private static <K extends @Nullable Object> @Nullable K keyOrNull(@Nullable Node<K, ?> node) {
return node == null ? null : node.key;
} | Returns {@code true} if this BiMap contains an entry whose value is equal to {@code value} (or,
equivalently, if this inverse view contains a key that is equal to {@code value}).
<p>Due to the property that values in a BiMap are unique, this will tend to execute in
faster-than-linear time.
@param value the object to se... | java | guava/src/com/google/common/collect/HashBiMap.java | 805 | [
"node"
] | K | true | 2 | 7.84 | google/guava | 51,352 | javadoc | false |
getMessage | public static String getMessage(final Throwable th) {
if (th == null) {
return StringUtils.EMPTY;
}
final String clsName = ClassUtils.getShortClassName(th, null);
return clsName + ": " + StringUtils.defaultString(th.getMessage());
} | Gets a short message summarizing the exception.
<p>
The message returned is of the form
{ClassNameWithoutPackage}: {ThrowableMessage}
</p>
@param th the throwable to get a message for, null returns empty string.
@return the message, non-null.
@since 2.2 | java | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | 292 | [
"th"
] | String | true | 2 | 7.92 | apache/commons-lang | 2,896 | javadoc | false |
getNamedFormat | function getNamedFormat(locale: string, format: string): string {
const localeId = getLocaleId(locale);
NAMED_FORMATS[localeId] ??= {};
if (NAMED_FORMATS[localeId][format]) {
return NAMED_FORMATS[localeId][format];
}
let formatValue = '';
switch (format) {
case 'shortDate':
formatValue = get... | Create a new Date object with the given date value, and the time set to midnight.
We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.
See: https://github.com/angular/angular/issues/40377
Note that this function returns a Date object whose time is midnight in the current loca... | typescript | packages/common/src/i18n/format_date.ts | 190 | [
"locale",
"format"
] | true | 3 | 6.96 | angular/angular | 99,544 | jsdoc | false | |
add_defaults | def add_defaults(self, fun):
"""Add default configuration from dict ``d``.
If the argument is a callable function then it will be regarded
as a promise, and it won't be loaded until the configuration is
actually needed.
This method can be compared to:
.. code-block:: p... | Add default configuration from dict ``d``.
If the argument is a callable function then it will be regarded
as a promise, and it won't be loaded until the configuration is
actually needed.
This method can be compared to:
.. code-block:: pycon
>>> celery.conf.update(d)
with a difference that 1) no copy will be m... | python | celery/app/base.py | 653 | [
"self",
"fun"
] | false | 3 | 6.32 | celery/celery | 27,741 | unknown | false | |
make_lookup_key | def make_lookup_key(
self, kernel_inputs: KernelInputs, op_name: str, include_device: bool = False
) -> Optional[str]:
"""
Create a flattened lookup key from kernel inputs and operation name.
Override this method to customize key generation.
Args:
kernel_inputs: ... | Create a flattened lookup key from kernel inputs and operation name.
Override this method to customize key generation.
Args:
kernel_inputs: KernelInputs object containing input nodes and scalars
op_name: Operation name (e.g., "mm", "addmm")
include_device: Whether to include device key in the generated key... | python | torch/_inductor/lookup_table/choices.py | 90 | [
"self",
"kernel_inputs",
"op_name",
"include_device"
] | Optional[str] | true | 5 | 7.6 | pytorch/pytorch | 96,034 | google | false |
powFast | private static double powFast(double value, int power) {
if (power > 5) { // Most common case first.
double oddRemains = 1.0;
do {
// Test if power is odd.
if ((power & 1) != 0) {
oddRemains *= value;
}
v... | This treatment is somehow accurate for low values of |power|,
and for |power*getExponent(value)| < 1023 or so (to stay away
from double extreme magnitudes (large and small)).
@param value A double value.
@param power A power.
@return value^power. | java | libs/h3/src/main/java/org/elasticsearch/h3/FastMath.java | 609 | [
"value",
"power"
] | true | 12 | 8 | elastic/elasticsearch | 75,680 | javadoc | false | |
openInputStream | private synchronized InputStream openInputStream() throws IOException {
if (file != null) {
return new FileInputStream(file);
} else {
// requireNonNull is safe because we always have either `file` or `memory`.
requireNonNull(memory);
return new ByteArrayInputStream(memory.getBuffer(), 0... | Returns a readable {@link ByteSource} view of the data that has been written to this stream.
@since 15.0 | java | android/guava/src/com/google/common/io/FileBackedOutputStream.java | 165 | [] | InputStream | true | 2 | 6.88 | google/guava | 51,352 | javadoc | false |
validate | @SuppressWarnings("unchecked")
@Override
public Map<Integer, Object> validate(Object item) {
try {
NavigableMap<Integer, Object> objects = (NavigableMap<Integer, Object>) item;
for (Map.Entry<Integer, Object> entry : objects.entrySet()) {
Integer tag = entry.getKe... | Create a new TaggedFields object with the given tags and fields.
@param fields This is an array containing Integer tags followed
by associated Field objects.
@return The new {@link TaggedFields} | java | clients/src/main/java/org/apache/kafka/common/protocol/types/TaggedFields.java | 147 | [
"item"
] | true | 4 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
isCglibProxy | @Contract("null -> false")
public static boolean isCglibProxy(@Nullable Object object) {
return (object instanceof SpringProxy &&
object.getClass().getName().contains(ClassUtils.CGLIB_CLASS_SEPARATOR));
} | Check whether the given object is a CGLIB proxy.
<p>This method goes beyond the implementation of
{@link ClassUtils#isCglibProxy(Object)} by additionally checking if
the given object is an instance of {@link SpringProxy}.
@param object the object to check
@see ClassUtils#isCglibProxy(Object) | java | spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java | 108 | [
"object"
] | true | 2 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false | |
maximumWeight | @GwtIncompatible // To be supported
@CanIgnoreReturnValue
public CacheBuilder<K, V> maximumWeight(long maximumWeight) {
checkState(
this.maximumWeight == UNSET_INT,
"maximum weight was already set to %s",
this.maximumWeight);
checkState(
this.maximumSize == UNSET_INT, "maximu... | Specifies the maximum weight of entries the cache may contain. Weight is determined using the
{@link Weigher} specified with {@link #weigher}, and use of this method requires a
corresponding call to {@link #weigher} prior to calling {@link #build}.
<p>Note that the cache <b>may evict an entry before this limit is excee... | java | android/guava/src/com/google/common/cache/CacheBuilder.java | 535 | [
"maximumWeight"
] | true | 1 | 6.72 | google/guava | 51,352 | javadoc | false | |
create | public static <O> ReentrantLockVisitor<O> create(final O object, final ReentrantLock reentrantLock) {
return new LockingVisitors.ReentrantLockVisitor<>(object, reentrantLock);
} | Creates a new instance of {@link ReentrantLockVisitor} with the given object and lock.
@param <O> The type of the object to protect.
@param object The object to protect.
@param reentrantLock The lock to use.
@return A new {@link ReentrantLockVisitor}.
@see LockingVisitors
@since 3.18.0 | java | src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java | 709 | [
"object",
"reentrantLock"
] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
parse | Date parse(String source) throws ParseException; | Equivalent to DateFormat.parse(String).
See {@link java.text.DateFormat#parse(String)} for more information.
@param source A {@link String} whose beginning should be parsed.
@return A {@link Date} parsed from the string.
@throws ParseException if the beginning of the specified string cannot be parsed. | java | src/main/java/org/apache/commons/lang3/time/DateParser.java | 73 | [
"source"
] | Date | true | 1 | 6.16 | apache/commons-lang | 2,896 | javadoc | false |
select_key | def select_key(
self,
key: str,
bucket_name: str | None = None,
expression: str | None = None,
expression_type: str | None = None,
input_serialization: dict[str, Any] | None = None,
output_serialization: dict[str, Any] | None = None,
) -> str:
"""
... | Read a key with S3 Select.
.. seealso::
- :external+boto3:py:meth:`S3.Client.select_object_content`
:param key: S3 key that will point to the file
:param bucket_name: Name of the bucket in which the file is stored
:param expression: S3 Select expression
:param expression_type: S3 Select expression type
:param inp... | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/s3.py | 1,084 | [
"self",
"key",
"bucket_name",
"expression",
"expression_type",
"input_serialization",
"output_serialization"
] | str | true | 6 | 7.44 | apache/airflow | 43,597 | sphinx | false |
subscriptionPattern | public synchronized SubscriptionPattern subscriptionPattern() {
if (hasRe2JPatternSubscription())
return this.subscribedRe2JPattern;
return null;
} | @return The RE2J compatible pattern in use, provided via a call to
{@link #subscribe(SubscriptionPattern, Optional)}.
Null if there is no SubscriptionPattern in use. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java | 380 | [] | SubscriptionPattern | true | 2 | 7.44 | 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.