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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
checkName | String checkName(String name) throws JSONException {
if (name == null) {
throw new JSONException("Names must be non-null");
}
return name;
} | Appends {@code value} to the array already mapped to {@code name}. If this object
has no mapping for {@code name}, this inserts a new mapping. If the mapping exists
but its value is not an array, the existing and new values are inserted in order
into a new array which is itself mapped to {@code name}. In aggregate, thi... | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java | 326 | [
"name"
] | String | true | 2 | 8.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
getShortPathName | public String getShortPathName(String path) {
String longPath = "\\\\?\\" + path;
// first we get the length of the buffer needed
final int length = kernel.GetShortPathNameW(longPath, null, 0);
if (length == 0) {
logger.warn("failed to get short path name: {}", kernel.GetLast... | Retrieves the short path form of the specified path.
@param path the path
@return the short path name, or the original path name if unsupported or unavailable | java | libs/native/src/main/java/org/elasticsearch/nativeaccess/WindowsFunctions.java | 34 | [
"path"
] | String | true | 3 | 8.4 | elastic/elasticsearch | 75,680 | javadoc | false |
kurt | def kurt(
self,
axis: Axis | None = 0,
skipna: bool = True,
numeric_only: bool = False,
**kwargs,
):
"""
Return unbiased kurtosis over requested axis.
Kurtosis obtained using Fisher's definition of
kurtosis (kurtosis of normal == 0.0). Normali... | Return unbiased kurtosis over requested axis.
Kurtosis obtained using Fisher's definition of
kurtosis (kurtosis of normal == 0.0). Normalized by N-1.
Parameters
----------
axis : {index (0)}
Axis for the function to be applied on.
For `Series` this parameter is unused and defaults to 0.
For DataFrames, s... | python | pandas/core/series.py | 8,004 | [
"self",
"axis",
"skipna",
"numeric_only"
] | true | 1 | 7.12 | pandas-dev/pandas | 47,362 | numpy | false | |
take | def take(
self,
indices,
axis: Axis = 0,
allow_fill: bool = True,
fill_value=None,
**kwargs,
) -> Self:
"""
Return a new Index of the values selected by the indices.
For internal compatibility with numpy arrays.
Parameters
---... | Return a new Index of the values selected by the indices.
For internal compatibility with numpy arrays.
Parameters
----------
indices : array-like
Indices to be taken.
axis : {0 or 'index'}, optional
The axis over which to select values, always 0 or 'index'.
allow_fill : bool, default True
How to handle n... | python | pandas/core/indexes/base.py | 1,229 | [
"self",
"indices",
"axis",
"allow_fill",
"fill_value"
] | Self | true | 7 | 8.4 | pandas-dev/pandas | 47,362 | numpy | false |
forOwn | function forOwn(object, iteratee) {
return object && baseForOwn(object, getIteratee(iteratee, 3));
} | Iterates over own enumerable string keyed properties of an object and
invokes `iteratee` for each property. The iteratee is invoked with three
arguments: (value, key, object). Iteratee functions may exit iteration
early by explicitly returning `false`.
@static
@memberOf _
@since 0.3.0
@category Object
@param {Object} o... | javascript | lodash.js | 13,120 | [
"object",
"iteratee"
] | false | 2 | 6.96 | lodash/lodash | 61,490 | jsdoc | false | |
grid_to_graph | def grid_to_graph(
n_x, n_y, n_z=1, *, mask=None, return_as=sparse.coo_matrix, dtype=int
):
"""Graph of the pixel-to-pixel connections.
Edges exist if 2 voxels are connected.
Read more in the :ref:`User Guide <connectivity_graph_image>`.
Parameters
----------
n_x : int
Dimension i... | Graph of the pixel-to-pixel connections.
Edges exist if 2 voxels are connected.
Read more in the :ref:`User Guide <connectivity_graph_image>`.
Parameters
----------
n_x : int
Dimension in x axis.
n_y : int
Dimension in y axis.
n_z : int, default=1
Dimension in z axis.
mask : ndarray of shape (n_x, n_y, n... | python | sklearn/feature_extraction/image.py | 206 | [
"n_x",
"n_y",
"n_z",
"mask",
"return_as",
"dtype"
] | false | 1 | 6.32 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
determineCacheOperations | protected @Nullable Collection<CacheOperation> determineCacheOperations(CacheOperationProvider provider) {
Collection<CacheOperation> ops = null;
for (CacheAnnotationParser parser : this.annotationParsers) {
Collection<CacheOperation> annOps = provider.getCacheOperations(parser);
if (annOps != null) {
if ... | Determine the cache operation(s) for the given {@link CacheOperationProvider}.
<p>This implementation delegates to configured
{@link CacheAnnotationParser CacheAnnotationParsers}
for parsing known annotations into Spring's metadata attribute class.
<p>Can be overridden to support custom annotations that carry caching m... | java | spring-context/src/main/java/org/springframework/cache/annotation/AnnotationCacheOperationSource.java | 142 | [
"provider"
] | true | 3 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false | |
addProcessor | private static void addProcessor(final String key, final Processor processor) {
if (ARCH_TO_PROCESSOR.containsKey(key)) {
throw new IllegalStateException("Key " + key + " already exists in processor map");
}
ARCH_TO_PROCESSOR.put(key, processor);
} | Adds the given {@link Processor} with the given key {@link String} to the map.
@param key The key as {@link String}.
@param processor The {@link Processor} to add.
@throws IllegalStateException If the key already exists. | java | src/main/java/org/apache/commons/lang3/ArchUtils.java | 49 | [
"key",
"processor"
] | void | true | 2 | 6.88 | apache/commons-lang | 2,896 | javadoc | false |
_refine_color | def _refine_color(color: str):
"""
Convert color in #RGB (12 bits) format to #RRGGBB (32 bits), if it possible.
Otherwise, it returns the original value. Graphviz does not support colors in #RGB format.
:param color: Text representation of color
:return: Refined representation of color
"""
... | Convert color in #RGB (12 bits) format to #RRGGBB (32 bits), if it possible.
Otherwise, it returns the original value. Graphviz does not support colors in #RGB format.
:param color: Text representation of color
:return: Refined representation of color | python | airflow-core/src/airflow/utils/dot_renderer.py | 55 | [
"color"
] | true | 3 | 8.24 | apache/airflow | 43,597 | sphinx | false | |
match_einsum_strings | def match_einsum_strings(s: str) -> bool:
"""
This function takes a string s as input, where s is in the format "3 letter string,
4 letter string -> 3 letter string".
It checks if the strings match the rule and returns True if they do, False otherwise.
The rule is:
- The three strings have the ... | This function takes a string s as input, where s is in the format "3 letter string,
4 letter string -> 3 letter string".
It checks if the strings match the rule and returns True if they do, False otherwise.
The rule is:
- The three strings have the same first two characters.
- The first two strings have the same third... | python | torch/_inductor/fx_passes/split_cat.py | 2,983 | [
"s"
] | bool | true | 7 | 6 | pytorch/pytorch | 96,034 | unknown | false |
getContentEntry | private ZipContent.Entry getContentEntry(String namePrefix, String name) {
synchronized (this) {
ensureOpen();
return this.resources.zipContent().getEntry(namePrefix, name);
}
} | 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 | 293 | [
"namePrefix",
"name"
] | true | 1 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false | |
close | @Override
public void close() {
SchedulerEngine engine = scheduler.get();
if (engine != null) {
engine.stop();
}
logger.trace("Clearing the error store as we are closing");
errorStore.clearStore();
} | Initializer method to avoid the publication of a self reference in the constructor. | java | modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleService.java | 292 | [] | void | true | 2 | 6.72 | elastic/elasticsearch | 75,680 | javadoc | false |
getStopTime | @Deprecated
public long getStopTime() {
// stopTimeNanos stores System.nanoTime() for elapsed time
return getStopInstant().toEpochMilli();
} | Gets the time this StopWatch was stopped in milliseconds, between the current time and midnight, January 1, 1970 UTC.
@return the time this StopWatch was stopped in milliseconds, between the current time and midnight, January 1, 1970 UTC.
@throws IllegalStateException if this StopWatch has not been started.
@since 3.12... | java | src/main/java/org/apache/commons/lang3/time/StopWatch.java | 519 | [] | true | 1 | 6.88 | apache/commons-lang | 2,896 | javadoc | false | |
format_percentiles | def format_percentiles(
percentiles: np.ndarray | Sequence[float],
) -> list[str]:
"""
Outputs rounded and formatted percentiles.
Parameters
----------
percentiles : list-like, containing floats from interval [0,1]
Returns
-------
formatted : list of strings
Notes
-----
... | Outputs rounded and formatted percentiles.
Parameters
----------
percentiles : list-like, containing floats from interval [0,1]
Returns
-------
formatted : list of strings
Notes
-----
Rounding precision is chosen so that: (1) if any two elements of
``percentiles`` differ, they remain different after rounding
(2) no ... | python | pandas/io/formats/format.py | 1,554 | [
"percentiles"
] | list[str] | true | 6 | 8.48 | pandas-dev/pandas | 47,362 | numpy | false |
getRootSource | private static PropertySource<?> getRootSource(PropertySource<?> source) {
while (source.getSource() instanceof PropertySource<?> propertySource) {
source = propertySource;
}
return source;
} | Create a new {@link SpringConfigurationPropertySource} for the specified
{@link PropertySource}.
@param source the source Spring {@link PropertySource}
@return a {@link SpringConfigurationPropertySource} or
{@link SpringIterableConfigurationPropertySource} instance | java | core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java | 202 | [
"source"
] | true | 2 | 7.12 | spring-projects/spring-boot | 79,428 | javadoc | false | |
op_list | def op_list(**configs):
"""Generate a list of ops organized in a specific format.
It takes two parameters which are "attr_names" and "attr".
attrs stores the name and function of operators.
Args:
configs: key-value pairs including the name and function of
operators. attrs and attr_names ... | Generate a list of ops organized in a specific format.
It takes two parameters which are "attr_names" and "attr".
attrs stores the name and function of operators.
Args:
configs: key-value pairs including the name and function of
operators. attrs and attr_names must be present in configs.
Return:
a sequence ... | python | benchmarks/operator_benchmark/benchmark_utils.py | 289 | [] | false | 3 | 8.72 | pytorch/pytorch | 96,034 | google | false | |
mapTypeVariablesToArguments | private static <T> void mapTypeVariablesToArguments(final Class<T> cls, final ParameterizedType parameterizedType,
final Map<TypeVariable<?>, Type> typeVarAssigns) {
// capture the type variables from the owner type that have assignments
final Type ownerType = parameterizedType.getOwnerType(... | Maps type variables.
@param <T> the generic type of the class in question.
@param cls the class in question.
@param parameterizedType the parameterized type.
@param typeVarAssigns the map to be filled. | java | src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | 1,290 | [
"cls",
"parameterizedType",
"typeVarAssigns"
] | void | true | 5 | 7.04 | apache/commons-lang | 2,896 | javadoc | false |
_graph_connected_component | def _graph_connected_component(graph, node_id):
"""Find the largest graph connected components that contains one
given node.
Parameters
----------
graph : array-like of shape (n_samples, n_samples)
Adjacency matrix of the graph, non-zero weight means an edge
between the nodes.
... | Find the largest graph connected components that contains one
given node.
Parameters
----------
graph : array-like of shape (n_samples, n_samples)
Adjacency matrix of the graph, non-zero weight means an edge
between the nodes.
node_id : int
The index of the query node of the graph.
Returns
-------
connec... | python | sklearn/manifold/_spectral_embedding.py | 27 | [
"graph",
"node_id"
] | false | 7 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
__init__ | def __init__(self, x=None, y=None, z=None, srid=None):
"""
The Point object may be initialized with either a tuple, or individual
parameters.
For example:
>>> p = Point((5, 23)) # 2D point, passed in as a tuple
>>> p = Point(5, 23, 8) # 3D point, passed as individual p... | The Point object may be initialized with either a tuple, or individual
parameters.
For example:
>>> p = Point((5, 23)) # 2D point, passed in as a tuple
>>> p = Point(5, 23, 8) # 3D point, passed as individual parameters | python | django/contrib/gis/geos/point.py | 14 | [
"self",
"x",
"y",
"z",
"srid"
] | false | 8 | 6.64 | django/django | 86,204 | unknown | false | |
checkNotZip64Extended | private void checkNotZip64Extended(long value) throws IOException {
if (value == 0xFFFFFFFF) {
throw new IOException("Zip64 extended information extra fields are not supported");
}
} | Open a {@link DataBlock} providing access to raw contents of the entry (not
including the local file header).
<p>
To release resources, the {@link #close()} method of the data block should be
called explicitly or by try-with-resources.
@return the contents of the entry
@throws IOException on I/O error | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipContent.java | 812 | [
"value"
] | void | true | 2 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false |
getResource | @Override
public @Nullable URL getResource(String name) {
Assert.state(this.resourceLoader != null, "ResourceLoaderClassLoadHelper not initialized");
Resource resource = this.resourceLoader.getResource(name);
if (resource.exists()) {
try {
return resource.getURL();
}
catch (IOException ex) {
if ... | Create a new ResourceLoaderClassLoadHelper for the given ResourceLoader.
@param resourceLoader the ResourceLoader to delegate to | java | spring-context-support/src/main/java/org/springframework/scheduling/quartz/ResourceLoaderClassLoadHelper.java | 89 | [
"name"
] | URL | true | 4 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
dot7uBulk | private static void dot7uBulk(MemorySegment a, MemorySegment b, int length, int count, MemorySegment result) {
try {
JdkVectorLibrary.dot7uBulk$mh.invokeExact(a, b, length, count, result);
} catch (Throwable t) {
throw new AssertionError(t);
}
... | Computes the square distance of given float32 vectors.
@param a address of the first vector
@param b address of the second vector
@param elementCount the vector dimensions, number of float32 elements in the segment | java | libs/native/src/main/java/org/elasticsearch/nativeaccess/jdk/JdkVectorLibrary.java | 299 | [
"a",
"b",
"length",
"count",
"result"
] | void | true | 2 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false |
lazyWeakCustom | static <L> Striped<L> lazyWeakCustom(int stripes, Supplier<L> supplier) {
return stripes < LARGE_LAZY_CUTOFF
? new SmallLazyStriped<L>(stripes, supplier)
: new LargeLazyStriped<L>(stripes, supplier);
} | Creates a {@code Striped<L>} with lazily initialized, weakly referenced locks. Every lock is
obtained from the passed supplier.
@param stripes the minimum number of stripes (locks) required
@param supplier a {@code Supplier<L>} object to obtain locks from
@return a new {@code Striped<L>} | java | android/guava/src/com/google/common/util/concurrent/Striped.java | 231 | [
"stripes",
"supplier"
] | true | 2 | 8.08 | google/guava | 51,352 | javadoc | false | |
_managle_lambda_list | def _managle_lambda_list(aggfuncs: Sequence[Any]) -> Sequence[Any]:
"""
Possibly mangle a list of aggfuncs.
Parameters
----------
aggfuncs : Sequence
Returns
-------
mangled: list-like
A new AggSpec sequence, where lambdas have been converted
to have unique names.
... | Possibly mangle a list of aggfuncs.
Parameters
----------
aggfuncs : Sequence
Returns
-------
mangled: list-like
A new AggSpec sequence, where lambdas have been converted
to have unique names.
Notes
-----
If just one aggfunc is passed, the name will not be mangled. | python | pandas/core/apply.py | 2,015 | [
"aggfuncs"
] | Sequence[Any] | true | 4 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
nanprod | def nanprod(
values: np.ndarray,
*,
axis: AxisInt | None = None,
skipna: bool = True,
min_count: int = 0,
mask: npt.NDArray[np.bool_] | None = None,
) -> float:
"""
Parameters
----------
values : ndarray[dtype]
axis : int, optional
skipna : bool, default True
min_coun... | Parameters
----------
values : ndarray[dtype]
axis : int, optional
skipna : bool, default True
min_count: int, default 0
mask : ndarray[bool], optional
nan-mask if known
Returns
-------
Dtype
The product of all elements on a given axis. ( NaNs are treated as 1)
Examples
--------
>>> from pandas.core import na... | python | pandas/core/nanops.py | 1,422 | [
"values",
"axis",
"skipna",
"min_count",
"mask"
] | float | true | 3 | 8.16 | pandas-dev/pandas | 47,362 | numpy | false |
_get_i8_values_and_mask | def _get_i8_values_and_mask(
self, other
) -> tuple[int | npt.NDArray[np.int64], None | npt.NDArray[np.bool_]]:
"""
Get the int64 values and b_mask to pass to add_overflowsafe.
"""
if isinstance(other, Period):
i8values = other.ordinal
mask = None
... | Get the int64 values and b_mask to pass to add_overflowsafe. | python | pandas/core/arrays/datetimelike.py | 1,050 | [
"self",
"other"
] | tuple[int | npt.NDArray[np.int64], None | npt.NDArray[np.bool_]] | true | 4 | 6 | pandas-dev/pandas | 47,362 | unknown | false |
has_job | def has_job(self, job_name: str) -> bool:
"""
Check if the job already exists.
.. seealso::
- :external+boto3:py:meth:`Glue.Client.get_job`
:param job_name: unique job name per AWS account
:return: Returns True if the job already exists and False if not.
"""... | Check if the job already exists.
.. seealso::
- :external+boto3:py:meth:`Glue.Client.get_job`
:param job_name: unique job name per AWS account
:return: Returns True if the job already exists and False if not. | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/glue.py | 445 | [
"self",
"job_name"
] | bool | true | 1 | 6.72 | apache/airflow | 43,597 | sphinx | false |
squeeze | def squeeze(self, axis=None):
"""
Return a possibly reshaped matrix.
Refer to `numpy.squeeze` for more documentation.
Parameters
----------
axis : None or int or tuple of ints, optional
Selects a subset of the axes of length one in the shape.
If ... | Return a possibly reshaped matrix.
Refer to `numpy.squeeze` for more documentation.
Parameters
----------
axis : None or int or tuple of ints, optional
Selects a subset of the axes of length one in the shape.
If an axis is selected with shape entry greater than one,
an error is raised.
Returns
-------
sq... | python | numpy/matrixlib/defmatrix.py | 330 | [
"self",
"axis"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
backend_fails | def backend_fails(
gm: fx.GraphModule,
example_inputs: Sequence[Any],
compiler_fn: CompilerFn,
orig_failure: Sequence[Any],
) -> bool:
"""
Minifier uses this function to identify if the minified graph module fails
with the same error.
One caveat is that minifier can potentially go into ... | Minifier uses this function to identify if the minified graph module fails
with the same error.
One caveat is that minifier can potentially go into a wrong direction when
the resulting graph module fails for a different reason. To avoid this, we
save the string for the original exception and check similarity between n... | python | torch/_dynamo/repro/after_dynamo.py | 391 | [
"gm",
"example_inputs",
"compiler_fn",
"orig_failure"
] | bool | true | 2 | 6 | pytorch/pytorch | 96,034 | unknown | false |
hydrationStatus | function hydrationStatus(element: Node): HydrationStatus {
if (!(element instanceof Element)) {
return null;
}
if (!!element.getAttribute('ngh')) {
return {status: 'dehydrated'};
}
const hydrationInfo = (element as HydrationNode).__ngDebugHydrationInfo__;
switch (hydrationInfo?.status) {
case ... | Group Nodes under a defer block if they are part of it.
@param node
@param deferredNodesToSkip Will mutate the set with the nodes that are grouped into the created deferblock.
@param deferBlocks
@param appendTo
@param getComponent
@param getDirectives
@param getDirectiveMetadata | typescript | devtools/projects/ng-devtools-backend/src/lib/directive-forest/render-tree.ts | 173 | [
"element"
] | true | 3 | 6.4 | angular/angular | 99,544 | jsdoc | false | |
iter_encode | def iter_encode(self, obj):
'''The iterative version of `arff.ArffEncoder.encode`.
This encodes iteratively a given object and return, one-by-one, the
lines of the ARFF file.
:param obj: the object containing the ARFF information.
:return: (yields) the ARFF file as strings.
... | The iterative version of `arff.ArffEncoder.encode`.
This encodes iteratively a given object and return, one-by-one, the
lines of the ARFF file.
:param obj: the object containing the ARFF information.
:return: (yields) the ARFF file as strings. | python | sklearn/externals/_arff.py | 981 | [
"self",
"obj"
] | false | 15 | 7.28 | scikit-learn/scikit-learn | 64,340 | sphinx | false | |
handshakeUnwrap | SSLEngineResult handshakeUnwrap(boolean doRead, boolean ignoreHandshakeStatus) throws IOException {
log.trace("SSLHandshake handshakeUnwrap {}", channelId);
SSLEngineResult result;
int read = 0;
if (doRead)
read = readFromSocketChannel();
boolean cont;
do {
... | Perform handshake unwrap.
Visible for testing.
@param doRead boolean If true, read more from the socket channel
@param ignoreHandshakeStatus If true, continue to unwrap if data available regardless of handshake status
@return SSLEngineResult
@throws IOException | java | clients/src/main/java/org/apache/kafka/common/network/SslTransportLayer.java | 517 | [
"doRead",
"ignoreHandshakeStatus"
] | SSLEngineResult | true | 8 | 7.44 | apache/kafka | 31,560 | javadoc | false |
reverse | function reverse(array) {
return array == null ? array : nativeReverse.call(array);
} | Reverses `array` so that the first element becomes the last, the second
element becomes the second to last, and so on.
**Note:** This method mutates `array` and is based on
[`Array#reverse`](https://mdn.io/Array/reverse).
@static
@memberOf _
@since 4.0.0
@category Array
@param {Array} array The array to modify.
@return... | javascript | lodash.js | 7,994 | [
"array"
] | false | 2 | 7.44 | lodash/lodash | 61,490 | jsdoc | false | |
exists | function exists(path, callback) {
validateFunction(callback, 'cb');
function suppressedCallback(err) {
callback(!err);
}
try {
fs.access(path, F_OK, suppressedCallback);
} catch {
return callback(false);
}
} | Tests whether or not the given path exists.
@param {string | Buffer | URL} path
@param {(exists?: boolean) => any} callback
@returns {void} | javascript | lib/fs.js | 246 | [
"path",
"callback"
] | false | 2 | 6.24 | nodejs/node | 114,839 | jsdoc | false | |
__getitem__ | def __getitem__(self, key: int | slice) -> Series:
"""
Index or slice lists in the Series.
Parameters
----------
key : int | slice
Index or slice of indices to access from each list.
Returns
-------
pandas.Series
The list at reque... | Index or slice lists in the Series.
Parameters
----------
key : int | slice
Index or slice of indices to access from each list.
Returns
-------
pandas.Series
The list at requested index.
See Also
--------
ListAccessor.flatten : Flatten list values.
Examples
--------
>>> import pyarrow as pa
>>> s = pd.Serie... | python | pandas/core/arrays/arrow/accessors.py | 123 | [
"self",
"key"
] | Series | true | 6 | 8.56 | pandas-dev/pandas | 47,362 | numpy | false |
equals | @Override
public boolean equals(final Object obj) {
if (!(obj instanceof FastDateParser)) {
return false;
}
final FastDateParser other = (FastDateParser) obj;
return pattern.equals(other.pattern) && timeZone.equals(other.timeZone) && locale.equals(other.locale);
} | Compares another object for equality with this object.
@param obj the object to compare to
@return {@code true}if equal to this instance | java | src/main/java/org/apache/commons/lang3/time/FastDateParser.java | 874 | [
"obj"
] | true | 4 | 8.24 | apache/commons-lang | 2,896 | javadoc | false | |
retainAll | @CanIgnoreReturnValue
public static boolean retainAll(Iterable<?> removeFrom, Collection<?> elementsToRetain) {
return (removeFrom instanceof Collection)
? ((Collection<?>) removeFrom).retainAll(checkNotNull(elementsToRetain))
: Iterators.retainAll(removeFrom.iterator(), elementsToRetain);
} | Removes, from an iterable, every element that does not belong to the provided collection.
<p>This method calls {@link Collection#retainAll} if {@code iterable} is a collection, and
{@link Iterators#retainAll} otherwise.
@param removeFrom the iterable to (potentially) remove elements from
@param elementsToRetain the ele... | java | android/guava/src/com/google/common/collect/Iterables.java | 164 | [
"removeFrom",
"elementsToRetain"
] | true | 2 | 7.28 | google/guava | 51,352 | javadoc | false | |
getRegistrationPaths | private Set<Path> getRegistrationPaths(Set<Path> paths) throws IOException {
Set<Path> result = new HashSet<>();
for (Path path : paths) {
collectRegistrationPaths(path, result);
}
return Collections.unmodifiableSet(result);
} | Retrieves all {@link Path Paths} that should be registered for the specified
{@link Path}. If the path is a symlink, changes to the symlink should be monitored,
not just the file it points to. For example, for the given {@code keystore.jks}
path in the following directory structure:<pre>
+- stores
| +─ keystore.jks
+-... | java | core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/FileWatcher.java | 119 | [
"paths"
] | true | 1 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false | |
compressedIterator | private CloseableIterator<Record> compressedIterator(BufferSupplier bufferSupplier, boolean skipKeyValue) {
final InputStream inputStream = recordInputStream(bufferSupplier);
if (skipKeyValue) {
return new StreamRecordIterator(inputStream) {
@Override
protect... | Gets the base timestamp of the batch which is used to calculate the record timestamps from the deltas.
@return The base timestamp | java | clients/src/main/java/org/apache/kafka/common/record/DefaultRecordBatch.java | 278 | [
"bufferSupplier",
"skipKeyValue"
] | true | 2 | 6.88 | apache/kafka | 31,560 | javadoc | false | |
exception | public RuntimeException exception() {
if (!failed())
throw new IllegalStateException("Attempt to retrieve exception from future which hasn't failed");
return (RuntimeException) result.get();
} | Get the exception from a failed result (only available if the request failed)
@return the exception set in {@link #raise(RuntimeException)}
@throws IllegalStateException if the future is not complete or completed successfully | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestFuture.java | 109 | [] | RuntimeException | true | 2 | 6.8 | apache/kafka | 31,560 | javadoc | false |
get_results | def get_results(
cls, choices: list[ChoiceCaller], inputs_key: str
) -> dict[ChoiceCaller, float]:
"""
Get autotuning results, blocking until complete.
Args:
timeout: Maximum time to wait in seconds. None means wait forever.
Returns:
Dict mapping Cho... | Get autotuning results, blocking until complete.
Args:
timeout: Maximum time to wait in seconds. None means wait forever.
Returns:
Dict mapping ChoiceCaller to benchmark timing | python | torch/_inductor/autotune_process.py | 1,291 | [
"cls",
"choices",
"inputs_key"
] | dict[ChoiceCaller, float] | true | 2 | 7.6 | pytorch/pytorch | 96,034 | google | false |
southPolarH3 | public static long southPolarH3(int res) {
checkResolution(res);
return SOUTH[res];
} | Find the h3 index containing the South Pole at the given resolution.
@param res the provided resolution.
@return the h3 index containing the South Pole. | java | libs/h3/src/main/java/org/elasticsearch/h3/H3.java | 561 | [
"res"
] | true | 1 | 6.96 | elastic/elasticsearch | 75,680 | javadoc | false | |
close | private static void close(ApplicationContext context) {
if (context instanceof ConfigurableApplicationContext closable) {
closable.close();
}
} | Perform the given action with the given {@link SpringApplicationHook} attached if
the action triggers an {@link SpringApplication#run(String...) application run}.
@param <T> the result type
@param hook the hook to apply
@param action the action to run
@return the result of the action
@since 3.0.0
@see #withHook(SpringA... | java | core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java | 1,472 | [
"context"
] | void | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
getActualIndentationForNode | function getActualIndentationForNode(current: Node, parent: Node, currentLineAndChar: LineAndCharacter, parentAndChildShareLine: boolean, sourceFile: SourceFile, options: EditorSettings): number {
// actual indentation is used for statements\declarations if one of cases below is true:
// - parent is S... | @param assumeNewLineBeforeCloseBrace
`false` when called on text from a real source file.
`true` when we need to assume `position` is on a newline.
This is useful for codefixes. Consider
```
function f() {
|}
```
with `position` at `|`.
When inserting some text after an open brace, we would like to get inden... | typescript | src/services/formatting/smartIndenter.ts | 345 | [
"current",
"parent",
"currentLineAndChar",
"parentAndChildShareLine",
"sourceFile",
"options"
] | true | 5 | 8.48 | microsoft/TypeScript | 107,154 | jsdoc | false | |
newHashMapWithExpectedSize | @SuppressWarnings("NonApiType") // acts as a direct substitute for a constructor call
public static <K extends @Nullable Object, V extends @Nullable Object>
HashMap<K, V> newHashMapWithExpectedSize(int expectedSize) {
return new HashMap<>(capacity(expectedSize));
} | Creates a {@code HashMap} instance, with a high enough "initial capacity" that it <i>should</i>
hold {@code expectedSize} elements without growth. This behavior cannot be broadly guaranteed,
but it is observed to be true for OpenJDK 1.7. It also can't be guaranteed that the method
isn't inadvertently <i>oversizing</i> ... | java | android/guava/src/com/google/common/collect/Maps.java | 248 | [
"expectedSize"
] | true | 1 | 6.56 | google/guava | 51,352 | javadoc | false | |
requestUpdate | public synchronized int requestUpdate(final boolean resetEquivalentResponseBackoff) {
this.needFullUpdate = true;
if (resetEquivalentResponseBackoff) {
this.equivalentResponseCount = 0;
}
return this.updateVersion;
} | Request an update of the current cluster metadata info, permitting backoff based on the number of
equivalent metadata responses, which indicates that responses did not make progress and may be stale.
@param resetEquivalentResponseBackoff Whether to reset backing off based on consecutive equivalent responses.
... | java | clients/src/main/java/org/apache/kafka/clients/Metadata.java | 200 | [
"resetEquivalentResponseBackoff"
] | true | 2 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
resolve | public @Nullable AutowiredArguments resolve(RegisteredBean registeredBean) {
Assert.notNull(registeredBean, "'registeredBean' must not be null");
return resolveArguments(registeredBean, getMethod(registeredBean));
} | Resolve the method arguments for the specified registered bean.
@param registeredBean the registered bean
@return the resolved method arguments | java | spring-beans/src/main/java/org/springframework/beans/factory/aot/AutowiredMethodArgumentsResolver.java | 134 | [
"registeredBean"
] | AutowiredArguments | true | 1 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false |
initialize | protected void initialize(ConfigurableEnvironment environment, ClassLoader classLoader) {
getLoggingSystemProperties(environment).apply();
this.logFile = LogFile.get(environment);
if (this.logFile != null) {
this.logFile.applyToSystemProperties();
}
this.loggerGroups = new LoggerGroups(DEFAULT_GROUP_LOGGER... | 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 | 293 | [
"environment",
"classLoader"
] | void | true | 2 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
xor | public static boolean xor(final boolean... array) {
ObjectUtils.requireNonEmpty(array, "array");
// false if the neutral element of the xor operator
boolean result = false;
for (final boolean element : array) {
result ^= element;
}
return result;
} | Performs an xor on a set of booleans.
<p>
This behaves like an XOR gate;
it returns true if the number of true values is odd,
and false if the number of true values is zero or even.
</p>
<pre>
BooleanUtils.xor(true, true) = false
BooleanUtils.xor(false, false) = false
BooleanUtils.xor(... | java | src/main/java/org/apache/commons/lang3/BooleanUtils.java | 1,175 | [] | true | 1 | 7.04 | apache/commons-lang | 2,896 | javadoc | false | |
field | public XContentBuilder field(String name, BigInteger value) throws IOException {
if (value == null) {
return nullField(name);
}
ensureNameNotNull(name);
generator.writeNumberField(name, value);
return this;
} | @return the value of the "human readable" flag. When the value is equal to true,
some types of values are written in a format easier to read for a human. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/XContentBuilder.java | 661 | [
"name",
"value"
] | XContentBuilder | true | 2 | 7.04 | elastic/elasticsearch | 75,680 | javadoc | false |
registerListeners | protected void registerListeners() {
// Register statically specified listeners first.
for (ApplicationListener<?> listener : getApplicationListeners()) {
getApplicationEventMulticaster().addApplicationListener(listener);
}
// Do not initialize FactoryBeans here: We need to leave all regular beans
// unin... | Add beans that implement ApplicationListener as listeners.
Doesn't affect other listeners, which can be added without being beans. | java | spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java | 913 | [] | void | true | 2 | 6.24 | spring-projects/spring-framework | 59,386 | javadoc | false |
maybePropagateCoordinatorFatalErrorEvent | private void maybePropagateCoordinatorFatalErrorEvent() {
coordinatorRequestManager.getAndClearFatalError()
.ifPresent(fatalError -> backgroundEventHandler.add(new ErrorEvent(fatalError)));
} | A heartbeat should be sent without waiting for the heartbeat interval to expire if:
- the member is leaving the group
or
- the member is joining the group or acknowledging the assignment and for both cases there is no heartbeat request
in flight.
@return true if a heartbeat should be sent before the interval expires,... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java | 474 | [] | void | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
squeeze | public static String squeeze(final String str, final String... set) {
if (isEmpty(str, set)) {
return str;
}
final CharSet chars = CharSet.getInstance(set);
final StringBuilder buffer = new StringBuilder(str.length());
final char[] chrs = str.toCharArray();
fi... | Squeezes any repetitions of a character that is mentioned in the
supplied set.
<pre>
CharSetUtils.squeeze(null, *) = null
CharSetUtils.squeeze("", *) = ""
CharSetUtils.squeeze(*, null) = *
CharSetUtils.squeeze(*, "") = *
CharSetUtils.squeeze("hello", "k-p") = "helo"
CharSetUtils.squeeze(... | java | src/main/java/org/apache/commons/lang3/CharSetUtils.java | 205 | [
"str"
] | String | true | 9 | 7.6 | apache/commons-lang | 2,896 | javadoc | false |
cov | def cov(
self,
other: DataFrame | Series | None = None,
pairwise: bool | None = None,
ddof: int = 1,
numeric_only: bool = False,
):
"""
Calculate the rolling sample covariance.
Parameters
----------
other : Series or DataFrame, optiona... | Calculate the rolling sample covariance.
Parameters
----------
other : Series or DataFrame, optional
If not supplied then will default to self and produce pairwise
output.
pairwise : bool, default None
If False then only matching columns between self and other will be
used and the output will be a Dat... | python | pandas/core/window/rolling.py | 3,262 | [
"self",
"other",
"pairwise",
"ddof",
"numeric_only"
] | true | 1 | 7.2 | pandas-dev/pandas | 47,362 | numpy | false | |
batchIterator | AbstractIterator<? extends RecordBatch> batchIterator(); | Get an iterator over the record batches. This is similar to {@link #batches()} but returns an {@link AbstractIterator}
instead of {@link Iterator}, so that clients can use methods like {@link AbstractIterator#peek() peek}.
@return An iterator over the record batches of the log | java | clients/src/main/java/org/apache/kafka/common/record/Records.java | 71 | [] | true | 1 | 6.16 | apache/kafka | 31,560 | javadoc | false | |
throwIfPendingState | private void throwIfPendingState(String operation) {
if (pendingTransition != null) {
if (pendingTransition.result.isAcked()) {
pendingTransition = null;
} else {
throw new IllegalStateException("Cannot attempt operation `" + operation + "` "
... | Check if the transaction is in the prepared state.
@return true if the current state is PREPARED_TRANSACTION | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java | 1,251 | [
"operation"
] | void | true | 3 | 7.04 | apache/kafka | 31,560 | javadoc | false |
size | public int size() {
return acknowledgements.size();
} | Returns the size of the set of acknowledgements.
@return The size of the set of acknowledgements. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/Acknowledgements.java | 114 | [] | true | 1 | 6.96 | apache/kafka | 31,560 | javadoc | false | |
isForeachProcessorWithGeoipProcessor | @SuppressWarnings("unchecked")
private static boolean isForeachProcessorWithGeoipProcessor(
Map<String, Object> processor,
boolean downloadDatabaseOnPipelineCreation,
Map<String, PipelineConfiguration> pipelineConfigById,
Map<String, Boolean> pipelineHasGeoProcessorById
) {
... | Check if a processor is a foreach processor containing at least a geoip processor.
@param processor Processor config.
@param downloadDatabaseOnPipelineCreation Should the download_database_on_pipeline_creation of the geoip processor be true or false.
@param pipelineConfigById A Map of pipeline id to PipelineConfigurati... | java | modules/ingest-geoip/src/main/java/org/elasticsearch/ingest/geoip/GeoIpDownloaderTaskExecutor.java | 459 | [
"processor",
"downloadDatabaseOnPipelineCreation",
"pipelineConfigById",
"pipelineHasGeoProcessorById"
] | true | 2 | 7.6 | elastic/elasticsearch | 75,680 | javadoc | false | |
createIdentifier | function createIdentifier(isIdentifier: boolean, diagnosticMessage?: DiagnosticMessage, privateIdentifierDiagnosticMessage?: DiagnosticMessage): Identifier {
if (isIdentifier) {
identifierCount++;
const pos = scanner.hasPrecedingJSDocLeadingAsterisks() ? scanner.getTokenStart() : getN... | Reports a diagnostic error for the current token being an invalid name.
@param blankDiagnostic Diagnostic to report for the case of the name being blank (matched tokenIfBlankName).
@param nameDiagnostic Diagnostic to report for all other cases.
@param tokenIfBlankName Current token if the name was invalid for being... | typescript | src/compiler/parser.ts | 2,648 | [
"isIdentifier",
"diagnosticMessage?",
"privateIdentifierDiagnosticMessage?"
] | true | 9 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
modelsLayer | function modelsLayer(client: Client): CompositeProxyLayer {
const dmmfModelKeys = Object.keys(client._runtimeDataModel.models)
const jsModelKeys = dmmfModelKeys.map(dmmfToJSModelName)
const allKeys = [...new Set(dmmfModelKeys.concat(jsModelKeys))]
return cacheProperties({
getKeys() {
return allKeys
... | Dynamically creates a model proxy interface for a give name. For each prop
accessed on this proxy, it will lookup the dmmf to find if that model exists.
If it is the case, it will create a proxy for that model via {@link applyModel}.
@param client to create the proxy around
@returns a proxy to access models | typescript | packages/client/src/runtime/core/model/applyModelsAndClientExtensions.ts | 54 | [
"client"
] | true | 4 | 8.24 | prisma/prisma | 44,834 | jsdoc | false | |
close | @Override
public void close() {
if (principalBuilder instanceof Closeable)
Utils.closeQuietly((Closeable) principalBuilder, "principal builder");
} | Constructs Principal using configured principalBuilder.
@return the built principal | java | clients/src/main/java/org/apache/kafka/common/network/SslChannelBuilder.java | 168 | [] | void | true | 2 | 7.28 | apache/kafka | 31,560 | javadoc | false |
get_job_state | def get_job_state(self, job_name: str, run_id: str) -> str:
"""
Get state of the Glue job; the job state can be running, finished, failed, stopped or timeout.
.. seealso::
- :external+boto3:py:meth:`Glue.Client.get_job_run`
:param job_name: unique job name per AWS account
... | Get state of the Glue job; the job state can be running, finished, failed, stopped or timeout.
.. seealso::
- :external+boto3:py:meth:`Glue.Client.get_job_run`
:param job_name: unique job name per AWS account
:param run_id: The job-run ID of the predecessor job run
:return: State of the Glue job | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/glue.py | 253 | [
"self",
"job_name",
"run_id"
] | str | true | 2 | 8.24 | apache/airflow | 43,597 | sphinx | false |
nullToEmpty | public static Double[] nullToEmpty(final Double[] array) {
return nullTo(array, EMPTY_DOUBLE_OBJECT_ARRAY);
} | Defensive programming technique to change a {@code null}
reference to an empty one.
<p>
This method returns an empty array for a {@code null} input array.
</p>
<p>
As a memory optimizing technique an empty array passed in will be overridden with
the empty {@code public static} references in this class.
</p>
@param arra... | java | src/main/java/org/apache/commons/lang3/ArrayUtils.java | 4,432 | [
"array"
] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
load | public static ImportCandidates load(Class<?> annotation, @Nullable ClassLoader classLoader) {
Assert.notNull(annotation, "'annotation' must not be null");
ClassLoader classLoaderToUse = decideClassloader(classLoader);
String location = String.format(LOCATION, annotation.getName());
Enumeration<URL> urls = findU... | Loads the names of import candidates from the classpath. The names of the import
candidates are stored in files named
{@code META-INF/spring/full-qualified-annotation-name.imports} on the classpath.
Every line contains the full qualified name of the candidate class. Comments are
supported using the # character.
@param ... | java | core/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java | 81 | [
"annotation",
"classLoader"
] | ImportCandidates | true | 2 | 7.6 | spring-projects/spring-boot | 79,428 | javadoc | false |
thru | function thru(value, interceptor) {
return interceptor(value);
} | This method is like `_.tap` except that it returns the result of `interceptor`.
The purpose of this method is to "pass thru" values replacing intermediate
results in a method chain sequence.
@static
@memberOf _
@since 3.0.0
@category Seq
@param {*} value The value to provide to `interceptor`.
@param {Function} intercep... | javascript | lodash.js | 8,897 | [
"value",
"interceptor"
] | false | 1 | 6.24 | lodash/lodash | 61,490 | jsdoc | false | |
load_sample_images | def load_sample_images():
"""Load sample images for image manipulation.
Loads both, ``china`` and ``flower``.
Read more in the :ref:`User Guide <sample_images>`.
Returns
-------
data : :class:`~sklearn.utils.Bunch`
Dictionary-like object, with the following attributes.
images... | Load sample images for image manipulation.
Loads both, ``china`` and ``flower``.
Read more in the :ref:`User Guide <sample_images>`.
Returns
-------
data : :class:`~sklearn.utils.Bunch`
Dictionary-like object, with the following attributes.
images : list of ndarray of shape (427, 640, 3)
The two sam... | python | sklearn/datasets/_base.py | 1,294 | [] | false | 3 | 7.2 | scikit-learn/scikit-learn | 64,340 | unknown | false | |
isTrue | public static void isTrue(final boolean expression, final Supplier<String> messageSupplier) {
if (!expression) {
throw new IllegalArgumentException(messageSupplier.get());
}
} | 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>{@code
Validate.isTrue(i >= min... | java | src/main/java/org/apache/commons/lang3/Validate.java | 594 | [
"expression",
"messageSupplier"
] | void | true | 2 | 6.24 | apache/commons-lang | 2,896 | javadoc | false |
_isna_array | def _isna_array(values: ArrayLike) -> npt.NDArray[np.bool_] | NDFrame:
"""
Return an array indicating which values of the input array are NaN / NA.
Parameters
----------
obj: ndarray or ExtensionArray
The input array whose elements are to be checked.
Returns
-------
array-like
... | Return an array indicating which values of the input array are NaN / NA.
Parameters
----------
obj: ndarray or ExtensionArray
The input array whose elements are to be checked.
Returns
-------
array-like
Array of boolean values denoting the NA status of each element. | python | pandas/core/dtypes/missing.py | 223 | [
"values"
] | npt.NDArray[np.bool_] | NDFrame | true | 6 | 6.88 | pandas-dev/pandas | 47,362 | numpy | false |
stateStrategy | private static AbstractStateStrategy stateStrategy(final State state) {
return STRATEGY_MAP.get(state);
} | Returns the {@link AbstractStateStrategy} object responsible for the given state.
@param state the state
@return the corresponding {@link AbstractStateStrategy}
@throws CircuitBreakingException if the strategy cannot be resolved | java | src/main/java/org/apache/commons/lang3/concurrent/EventCountCircuitBreaker.java | 306 | [
"state"
] | AbstractStateStrategy | true | 1 | 6 | apache/commons-lang | 2,896 | javadoc | false |
resolveValueIfNecessary | public @Nullable Object resolveValueIfNecessary(Object argName, @Nullable Object value) {
// We must check each value to see whether it requires a runtime reference
// to another bean to be resolved.
if (value instanceof RuntimeBeanReference ref) {
return resolveReference(argName, ref);
}
else if (value in... | Given a PropertyValue, return a value, resolving any references to other
beans in the factory if necessary. The value could be:
<li>A BeanDefinition, which leads to the creation of a corresponding
new bean instance. Singleton flags and names of such "inner beans"
are always ignored: Inner beans are anonymous prototypes... | java | spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java | 131 | [
"argName",
"value"
] | Object | true | 24 | 6.64 | spring-projects/spring-framework | 59,386 | javadoc | false |
obtainBean | private Object obtainBean(String beanName) {
Object bean = this.beans.get(beanName);
if (bean == null) {
throw new NoSuchBeanDefinitionException(beanName,
"Defined beans are [" + StringUtils.collectionToCommaDelimitedString(this.beans.keySet()) + "]");
}
return bean;
} | Add a new singleton bean.
<p>Will overwrite any existing instance for the given name.
@param name the name of the bean
@param bean the bean instance | java | spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java | 161 | [
"beanName"
] | Object | true | 2 | 6.88 | spring-projects/spring-framework | 59,386 | javadoc | false |
parse_args | def parse_args() -> argparse.Namespace:
"""
Parse command line arguments.
Returns:
argparse.Namespace: Parsed arguments.
"""
parser = argparse.ArgumentParser(description="Upload test stats to s3")
parser.add_argument(
"--workflow-run-id",
type=int,
required=True,... | Parse command line arguments.
Returns:
argparse.Namespace: Parsed arguments. | python | tools/stats/upload_utilization_stats/upload_utilization_stats.py | 428 | [] | argparse.Namespace | true | 1 | 6.16 | pytorch/pytorch | 96,034 | unknown | false |
handleCompletedSends | private void handleCompletedSends(List<ClientResponse> responses, long now) {
// if no response is expected then when the send is completed, return it
for (NetworkSend send : this.selector.completedSends()) {
InFlightRequest request = this.inFlightRequests.lastSent(send.destinationId());
... | Handle any completed request send. In particular if no response is expected consider the request complete.
@param responses The list of responses to update
@param now The current time | java | clients/src/main/java/org/apache/kafka/clients/NetworkClient.java | 958 | [
"responses",
"now"
] | void | true | 2 | 7.04 | apache/kafka | 31,560 | javadoc | false |
get_available_distributions | def get_available_distributions(
include_non_provider_doc_packages: bool = False,
include_all_providers: bool = False,
include_suspended: bool = False,
include_removed: bool = False,
include_not_ready: bool = False,
include_regular: bool = True,
) -> list[str]:
"""
Return provider ids fo... | Return provider ids for all packages that are available currently (not suspended).
:param include_suspended: whether the suspended packages should be included
:param include_removed: whether the removed packages should be included
:param include_not_ready: whether the not-ready packages should be included
:param inclu... | python | dev/breeze/src/airflow_breeze/utils/packages.py | 298 | [
"include_non_provider_doc_packages",
"include_all_providers",
"include_suspended",
"include_removed",
"include_not_ready",
"include_regular"
] | list[str] | true | 7 | 6.24 | apache/airflow | 43,597 | sphinx | false |
verify_non_translated | def verify_non_translated() -> None:
"""
Verify there are no files in the non translatable pages.
"""
print("Verifying non translated pages")
lang_paths = get_lang_paths()
error_paths = []
for lang in lang_paths:
if lang.name == "en":
continue
for non_translatable... | Verify there are no files in the non translatable pages. | python | scripts/docs.py | 398 | [] | None | true | 7 | 7.04 | tiangolo/fastapi | 93,264 | unknown | false |
describeAcls | default DescribeAclsResult describeAcls(AclBindingFilter filter) {
return describeAcls(filter, new DescribeAclsOptions());
} | This is a convenience method for {@link #describeAcls(AclBindingFilter, DescribeAclsOptions)} with
default options. See the overload for more details.
<p>
This operation is supported by brokers with version 0.11.0.0 or higher.
@param filter The filter to use.
@return The DescribeAclsResult. | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 366 | [
"filter"
] | DescribeAclsResult | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
determineBeanNameFromAnnotation | protected @Nullable String determineBeanNameFromAnnotation(AnnotatedBeanDefinition annotatedDef) {
AnnotationMetadata metadata = annotatedDef.getMetadata();
String beanName = getExplicitBeanName(metadata);
if (beanName != null) {
return beanName;
}
// List of annotations directly present on the class we'... | Derive a bean name from one of the annotations on the class.
@param annotatedDef the annotation-aware bean definition
@return the bean name, or {@code null} if none is found | java | spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java | 125 | [
"annotatedDef"
] | String | true | 12 | 8.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
stableInsertionSort | private static void stableInsertionSort(TDigestIntArray order, TDigestDoubleArray values, int start, int n, int limit) {
for (int i = start + 1; i < n; i++) {
int t = order.get(i);
double v = values.get(order.get(i));
int vi = order.get(i);
int m = Math.max(i - li... | Limited range insertion sort with primary key stabilized by the use of the
original position to break ties. We assume that no element has to move more
than limit steps because quick sort has done its thing.
@param order The permutation index
@param values The values we are sorting
@param start Where to start the ... | java | libs/tdigest/src/main/java/org/elasticsearch/tdigest/Sort.java | 163 | [
"order",
"values",
"start",
"n",
"limit"
] | void | true | 8 | 6.72 | elastic/elasticsearch | 75,680 | javadoc | false |
replaceAll | public StrBuilder replaceAll(final String searchStr, final String replaceStr) {
final int searchLen = StringUtils.length(searchStr);
if (searchLen > 0) {
final int replaceLen = StringUtils.length(replaceStr);
int index = indexOf(searchStr, 0);
while (index >= 0) {
... | Replaces the search string with the replace string throughout the builder.
@param searchStr the search string, null causes no action to occur
@param replaceStr the replace string, null is equivalent to an empty string
@return {@code this} instance. | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 2,590 | [
"searchStr",
"replaceStr"
] | StrBuilder | true | 3 | 7.92 | apache/commons-lang | 2,896 | javadoc | false |
of | public static OriginTrackedResource of(Resource resource, @Nullable Origin origin) {
if (resource instanceof WritableResource writableResource) {
return new OriginTrackedWritableResource(writableResource, origin);
}
return new OriginTrackedResource(resource, origin);
} | Return a new {@link OriginProvider origin tracked} version the given
{@link Resource}.
@param resource the tracked resource
@param origin the origin of the resource
@return an {@link OriginTrackedResource} instance | java | core/spring-boot/src/main/java/org/springframework/boot/origin/OriginTrackedResource.java | 183 | [
"resource",
"origin"
] | OriginTrackedResource | true | 2 | 7.44 | spring-projects/spring-boot | 79,428 | javadoc | false |
_create_task_instances | def _create_task_instances(
self,
dag_id: str,
tasks: Iterator[dict[str, Any]] | Iterator[TI],
created_counts: dict[str, int],
hook_is_noop: bool,
*,
session: Session,
) -> None:
"""
Create the necessary task instances from the given tasks.
... | Create the necessary task instances from the given tasks.
:param dag_id: DAG ID associated with the dagrun
:param tasks: the tasks to create the task instances from
:param created_counts: a dictionary of number of tasks -> total ti created by the task creator
:param hook_is_noop: whether the task_instance_mutation_hoo... | python | airflow-core/src/airflow/models/dagrun.py | 1,910 | [
"self",
"dag_id",
"tasks",
"created_counts",
"hook_is_noop",
"session"
] | None | true | 4 | 7.04 | apache/airflow | 43,597 | sphinx | false |
toInteger | public static int toInteger(final Boolean bool, final int trueValue, final int falseValue, final int nullValue) {
if (bool == null) {
return nullValue;
}
return bool.booleanValue() ? trueValue : falseValue;
} | Converts a Boolean to an int specifying the conversion values.
<pre>
BooleanUtils.toInteger(Boolean.TRUE, 1, 0, 2) = 1
BooleanUtils.toInteger(Boolean.FALSE, 1, 0, 2) = 0
BooleanUtils.toInteger(null, 1, 0, 2) = 2
</pre>
@param bool the Boolean to convert
@param trueValue the value to return if {@code t... | java | src/main/java/org/apache/commons/lang3/BooleanUtils.java | 922 | [
"bool",
"trueValue",
"falseValue",
"nullValue"
] | true | 3 | 7.92 | apache/commons-lang | 2,896 | javadoc | false | |
findQualifiedExecutor | protected @Nullable Executor findQualifiedExecutor(@Nullable BeanFactory beanFactory, String qualifier) {
if (beanFactory == null) {
throw new IllegalStateException("BeanFactory must be set on " + getClass().getSimpleName() +
" to access qualified executor '" + qualifier + "'");
}
return BeanFactoryAnnota... | Retrieve a target executor for the given qualifier.
@param qualifier the qualifier to resolve
@return the target executor, or {@code null} if none available
@since 4.2.6
@see #getExecutorQualifier(Method) | java | spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java | 212 | [
"beanFactory",
"qualifier"
] | Executor | true | 2 | 7.44 | spring-projects/spring-framework | 59,386 | javadoc | false |
iter_all_en_paths | def iter_all_en_paths() -> Iterable[Path]:
"""
Iterate on the markdown files to translate in order of priority.
"""
first_dirs = [
Path("docs/en/docs/learn"),
Path("docs/en/docs/tutorial"),
Path("docs/en/docs/advanced"),
Path("docs/en/docs/about"),
Path("docs/en/d... | Iterate on the markdown files to translate in order of priority. | python | scripts/translate.py | 771 | [] | Iterable[Path] | true | 5 | 6.88 | tiangolo/fastapi | 93,264 | unknown | false |
getBrowserEnv | function getBrowserEnv() {
// Attempt to honor this environment variable.
// It is specific to the operating system.
// See https://github.com/sindresorhus/open#app for documentation.
const value = process.env.BROWSER;
const args = process.env.BROWSER_ARGS ? process.env.BROWSER_ARGS.split(' ') : [];
let act... | Copyright (c) 2015-present, Facebook, Inc.
This source code is licensed under the MIT license found in the LICENSE file in the root
directory of this source tree. | typescript | code/core/src/core-server/utils/open-browser/opener.ts | 25 | [] | false | 8 | 6.4 | storybookjs/storybook | 88,865 | jsdoc | false | |
bfill | def bfill(self, limit: int | None = None):
"""
Backward fill the values.
Parameters
----------
limit : int, optional
Limit of how many values to fill.
Returns
-------
Series or DataFrame
Object with missing values filled.
... | Backward fill the values.
Parameters
----------
limit : int, optional
Limit of how many values to fill.
Returns
-------
Series or DataFrame
Object with missing values filled.
See Also
--------
Series.bfill : Backward fill the missing values in the dataset.
DataFrame.bfill: Backward fill the missing values ... | python | pandas/core/groupby/groupby.py | 4,183 | [
"self",
"limit"
] | true | 1 | 7.2 | pandas-dev/pandas | 47,362 | numpy | false | |
unmodifiableEntrySet | static <K extends @Nullable Object, V extends @Nullable Object>
Set<Entry<K, V>> unmodifiableEntrySet(Set<Entry<K, V>> entrySet) {
return new UnmodifiableEntrySet<>(Collections.unmodifiableSet(entrySet));
} | Returns an unmodifiable view of the specified set of entries. The {@link Entry#setValue}
operation throws an {@link UnsupportedOperationException}, as do any operations that would
modify the returned set.
@param entrySet the entries for which to return an unmodifiable view
@return an unmodifiable view of the entries | java | android/guava/src/com/google/common/collect/Maps.java | 1,427 | [
"entrySet"
] | true | 1 | 6.32 | google/guava | 51,352 | javadoc | false | |
getModules | function getModules() {
// Check if TypeScript is setup
const hasTsConfig = fs.existsSync(paths.appTsConfig);
const hasJsConfig = fs.existsSync(paths.appJsConfig);
if (hasTsConfig && hasJsConfig) {
throw new Error(
'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please... | Get jest aliases based on the baseUrl of a compilerOptions object.
@param {*} options | javascript | fixtures/flight/config/modules.js | 94 | [] | false | 8 | 6.08 | facebook/react | 241,750 | jsdoc | false | |
isBoolean | public static boolean isBoolean(char[] text, int offset, int length) {
if (text == null || length == 0) {
return false;
}
return isBoolean(new String(text, offset, length));
} | returns true iff the sequence of chars is one of "true","false".
@param text sequence to check
@param offset offset to start
@param length length to check | java | libs/core/src/main/java/org/elasticsearch/core/Booleans.java | 39 | [
"text",
"offset",
"length"
] | true | 3 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false | |
get_child_arguments | def get_child_arguments():
"""
Return the executable. This contains a workaround for Windows if the
executable is reported to not have the .exe extension which can cause bugs
on reloading.
"""
import __main__
py_script = Path(sys.argv[0])
exe_entrypoint = py_script.with_suffix(".exe")
... | Return the executable. This contains a workaround for Windows if the
executable is reported to not have the .exe extension which can cause bugs
on reloading. | python | django/utils/autoreload.py | 220 | [] | false | 13 | 6.4 | django/django | 86,204 | unknown | false | |
endOfData | @CanIgnoreReturnValue
protected final @Nullable T endOfData() {
state = State.DONE;
return null;
} | Implementations of {@link #computeNext} <b>must</b> invoke this method when there are no
elements left in the iteration.
@return {@code null}; a convenience so your {@code computeNext} implementation can use the
simple statement {@code return endOfData();} | java | android/guava/src/com/google/common/collect/AbstractIterator.java | 120 | [] | T | true | 1 | 6.24 | google/guava | 51,352 | javadoc | false |
get_task_log | def get_task_log(self, ti: TaskInstance, try_number: int) -> tuple[list[str], list[str]]:
"""
Return the task logs.
:param ti: A TaskInstance object
:param try_number: current try_number to read log from
:return: tuple of logs and messages
"""
return [], [] | Return the task logs.
:param ti: A TaskInstance object
:param try_number: current try_number to read log from
:return: tuple of logs and messages | python | airflow-core/src/airflow/executors/base_executor.py | 515 | [
"self",
"ti",
"try_number"
] | tuple[list[str], list[str]] | true | 1 | 6.72 | apache/airflow | 43,597 | sphinx | false |
lastIndexOf | public int lastIndexOf(final String str, final int startIndex) {
return Strings.CS.lastIndexOf(this, str, startIndex);
} | Searches the string builder to find the last reference to the specified
string starting searching from the given index.
<p>
Note that a null input string will return -1, whereas the JDK throws an exception.
</p>
@param str the string to find, null returns -1
@param startIndex the index to start at, invalid index roun... | java | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | 2,360 | [
"str",
"startIndex"
] | true | 1 | 6.64 | apache/commons-lang | 2,896 | javadoc | false | |
asList | public static <E extends @Nullable Object> List<E> asList(@ParametricNullness E first, E[] rest) {
return new OnePlusArrayList<>(first, rest);
} | Returns an unmodifiable list containing the specified first element and backed by the specified
array of additional elements. Changes to the {@code rest} array will be reflected in the
returned list. Unlike {@link Arrays#asList}, the returned list is unmodifiable.
<p>This is useful when a varargs method needs to use a ... | java | android/guava/src/com/google/common/collect/Lists.java | 307 | [
"first",
"rest"
] | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false | |
optLong | public long optLong(String name) {
return optLong(name, 0L);
} | Returns the value mapped by {@code name} if it exists and is a long or can be
coerced to a long. Returns 0 otherwise. Note that JSON represents numbers as
doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer numbers via
JSON.
@param name the name of the property
@return the value or {@code 0L} | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java | 531 | [
"name"
] | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false | |
getBeanNamesForAnnotation | @Override
public String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotationType) {
List<String> result = new ArrayList<>();
for (String beanName : this.beanDefinitionNames) {
BeanDefinition bd = this.beanDefinitionMap.get(beanName);
if (bd != null && !bd.isAbstract() && findAnnotationOnBean(be... | Check whether the specified bean would need to be eagerly initialized
in order to determine its type.
@param factoryBeanName a factory-bean reference that the bean definition
defines a factory method for
@return whether eager initialization is necessary | java | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java | 769 | [
"annotationType"
] | true | 6 | 7.6 | spring-projects/spring-framework | 59,386 | javadoc | false | |
_get_base_image_args | def _get_base_image_args(self, inputs: VllmBuildParameters) -> tuple[str, str, str]:
"""
Returns:
- base_image_arg: docker buildx arg string for base image
- final_base_image_arg: docker buildx arg string for vllm-base stage
- pull_flag: --pull=true or --pull=false d... | Returns:
- base_image_arg: docker buildx arg string for base image
- final_base_image_arg: docker buildx arg string for vllm-base stage
- pull_flag: --pull=true or --pull=false depending on whether the image exists locally | python | .ci/lumen_cli/cli/lib/core/vllm/vllm_build.py | 243 | [
"self",
"inputs"
] | tuple[str, str, str] | true | 3 | 6.08 | pytorch/pytorch | 96,034 | unknown | false |
doRegisterBean | private <T> void doRegisterBean(Class<T> beanClass, @Nullable String name,
Class<? extends Annotation> @Nullable [] qualifiers, @Nullable Supplier<T> supplier,
BeanDefinitionCustomizer @Nullable [] customizers) {
AnnotatedGenericBeanDefinition abd = new AnnotatedGenericBeanDefinition(beanClass);
if (this.con... | Register a bean from the given bean class, deriving its metadata from
class-declared annotations.
@param beanClass the class of the bean
@param name an explicit name for the bean
@param qualifiers specific qualifier annotations to consider, if any,
in addition to qualifiers at the bean class level
@param supplier a cal... | java | spring-context/src/main/java/org/springframework/context/annotation/AnnotatedBeanDefinitionReader.java | 250 | [
"beanClass",
"name",
"qualifiers",
"supplier",
"customizers"
] | void | true | 8 | 6.4 | spring-projects/spring-framework | 59,386 | javadoc | false |
splitWorker | private static String[] splitWorker(final String str, final String separatorChars, final int max, final boolean preserveAllTokens) {
// Performance tuned for 2.0 (JDK1.4)
// Direct code is quicker than StringTokenizer.
// Also, StringTokenizer uses isSpace() not isWhitespace()
if (str ==... | Performs the logic for the {@code split} and {@code splitPreserveAllTokens} methods that return a maximum array length.
@param str the String to parse, may be {@code null}.
@param separatorChars the separate character.
@param max the maximum number of elements to include in the array. A z... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 7,606 | [
"str",
"separatorChars",
"max",
"preserveAllTokens"
] | true | 23 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
combine_hash_arrays | def combine_hash_arrays(
arrays: Iterator[np.ndarray], num_items: int
) -> npt.NDArray[np.uint64]:
"""
Parameters
----------
arrays : Iterator[np.ndarray]
num_items : int
Returns
-------
np.ndarray[uint64]
Should be the same as CPython's tupleobject.c
"""
try:
f... | Parameters
----------
arrays : Iterator[np.ndarray]
num_items : int
Returns
-------
np.ndarray[uint64]
Should be the same as CPython's tupleobject.c | python | pandas/core/util/hashing.py | 48 | [
"arrays",
"num_items"
] | npt.NDArray[np.uint64] | true | 2 | 6.24 | pandas-dev/pandas | 47,362 | numpy | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.