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
getOptionsHelp
public Collection<OptionHelp> getOptionsHelp() { if (this.optionHelp == null) { OptionHelpFormatter formatter = new OptionHelpFormatter(); getParser().formatHelpWith(formatter); try { getParser().printHelpOn(new ByteArrayOutputStream()); } catch (Exception ex) { // Ignore and provide no hints ...
Run the command using the specified parsed {@link OptionSet}. @param options the parsed option set @return an ExitStatus @throws Exception in case of errors
java
cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java
134
[]
true
3
7.92
spring-projects/spring-boot
79,428
javadoc
false
_extract_task_identifiers
def _extract_task_identifiers( self, entity: str | BulkTaskInstanceBody ) -> tuple[str, str, str, int | None]: """ Extract task identifiers from an id or entity object. :param entity: Task identifier as string or BulkTaskInstanceBody object :return: tuple of (dag_id, dag_run...
Extract task identifiers from an id or entity object. :param entity: Task identifier as string or BulkTaskInstanceBody object :return: tuple of (dag_id, dag_run_id, task_id, map_index)
python
airflow-core/src/airflow/api_fastapi/core_api/services/public/task_instances.py
172
[ "self", "entity" ]
tuple[str, str, str, int | None]
true
5
7.44
apache/airflow
43,597
sphinx
false
asend_message
async def asend_message( self, queue_url: str, message_body: str, delay_seconds: int = 0, message_attributes: dict | None = None, message_group_id: str | None = None, message_deduplication_id: str | None = None, ) -> dict: """ Send message to t...
Send message to the queue (async). .. seealso:: - :external+boto3:py:meth:`SQS.Client.send_message` :param queue_url: queue url :param message_body: the contents of the message :param delay_seconds: seconds to delay the message :param message_attributes: additional attributes for the message (default: None) :para...
python
providers/amazon/src/airflow/providers/amazon/aws/hooks/sqs.py
109
[ "self", "queue_url", "message_body", "delay_seconds", "message_attributes", "message_group_id", "message_deduplication_id" ]
dict
true
1
6.4
apache/airflow
43,597
sphinx
false
def_kernel
def def_kernel( self, inputs: list[IRNode], outputs: list[IRNode], names_str: str = "", input_reorder: Optional[list[int]] = None, ) -> str: """ Hook called from template code to generate function definition and needed args. Args: ...
Hook called from template code to generate function definition and needed args. Args: inputs: List of input IRNodes outputs: List of output IRNodes names_str: Comma separated list of input + output argument names. input_reorder: The actual order of input nodes. e.g. The template migh...
python
torch/_inductor/codegen/cuda/cuda_kernel.py
249
[ "self", "inputs", "outputs", "names_str", "input_reorder" ]
str
true
13
6.8
pytorch/pytorch
96,034
google
false
afterPropertiesSet
@Override public void afterPropertiesSet() { this.cache = (this.store != null ? new ConcurrentMapCache(this.name, this.store, this.allowNullValues) : new ConcurrentMapCache(this.name, this.allowNullValues)); }
Set whether to allow {@code null} values (adapting them to an internal null holder value). <p>Default is "true".
java
spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheFactoryBean.java
86
[]
void
true
2
7.04
spring-projects/spring-framework
59,386
javadoc
false
getExitingScheduledExecutorService
@J2ktIncompatible @GwtIncompatible // TODO public static ScheduledExecutorService getExitingScheduledExecutorService( ScheduledThreadPoolExecutor executor) { return new Application().getExitingScheduledExecutorService(executor); }
Converts the given ScheduledThreadPoolExecutor into a ScheduledExecutorService that exits when the application is complete. It does so by using daemon threads and adding a shutdown hook to wait for their completion. <p>This method waits 120 seconds before continuing with JVM termination, even if the executor has not fi...
java
android/guava/src/com/google/common/util/concurrent/MoreExecutors.java
192
[ "executor" ]
ScheduledExecutorService
true
1
6.72
google/guava
51,352
javadoc
false
linearize
def linearize(func: Callable, *primals) -> tuple[Any, Callable]: """ Returns the value of ``func`` at ``primals`` and linear approximation at ``primals``. Args: func (Callable): A Python function that takes one or more arguments. primals (Tensors): Positional arguments to ``func`` that ...
Returns the value of ``func`` at ``primals`` and linear approximation at ``primals``. Args: func (Callable): A Python function that takes one or more arguments. primals (Tensors): Positional arguments to ``func`` that must all be Tensors. These are the values at which the function is linearly approxima...
python
torch/_functorch/eager_transforms.py
1,680
[ "func" ]
tuple[Any, Callable]
true
6
9.44
pytorch/pytorch
96,034
google
false
findAnnotationOnBean
@Override public <A extends Annotation> @Nullable A findAnnotationOnBean(String beanName, Class<A> annotationType) throws NoSuchBeanDefinitionException { return findAnnotationOnBean(beanName, annotationType, true); }
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
799
[ "beanName", "annotationType" ]
A
true
1
6.4
spring-projects/spring-framework
59,386
javadoc
false
writeReplace
@Override @J2ktIncompatible @GwtIncompatible Object writeReplace() { return new SerializedForm(toArray()); }
Returns a view of this immutable list in reverse order. For example, {@code ImmutableList.of(1, 2, 3).reverse()} is equivalent to {@code ImmutableList.of(3, 2, 1)}. @return a view of this immutable list in reverse order @since 7.0
java
android/guava/src/com/google/common/collect/ImmutableList.java
714
[]
Object
true
1
6.88
google/guava
51,352
javadoc
false
columnMap
Map<C, Map<R, V>> columnMap();
Returns a view that associates each column key with the corresponding map from row keys to values. Changes to the returned map will update this table. The returned map does not support {@code put()} or {@code putAll()}, or {@code setValue()} on its entries. <p>In contrast, the maps returned by {@code columnMap().get()}...
java
android/guava/src/com/google/common/collect/Table.java
258
[]
true
1
6.64
google/guava
51,352
javadoc
false
isna
def isna(self) -> Self: """ Detect missing values. Return a boolean same-sized object indicating if the values are NA. NA values, such as None or :attr:`numpy.NaN`, gets mapped to True values. Everything else gets mapped to False values. Characters such as empty ...
Detect missing values. Return a boolean same-sized object indicating if the values are NA. NA values, such as None or :attr:`numpy.NaN`, gets mapped to True values. Everything else gets mapped to False values. Characters such as empty strings ``''`` or :attr:`numpy.inf` are not considered NA values. Returns ------- S...
python
pandas/core/generic.py
7,981
[ "self" ]
Self
true
1
7.2
pandas-dev/pandas
47,362
unknown
false
shortToBinary
public static boolean[] shortToBinary(final short src, final int srcPos, final boolean[] dst, final int dstPos, final int nBools) { if (0 == nBools) { return dst; } if (nBools - 1 + srcPos >= Short.SIZE) { throw new IllegalArgumentException("nBools - 1 + srcPos >= 16"); ...
Converts a short into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. @param src the short 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 cop...
java
src/main/java/org/apache/commons/lang3/Conversion.java
1,286
[ "src", "srcPos", "dst", "dstPos", "nBools" ]
true
4
8.08
apache/commons-lang
2,896
javadoc
false
intersection
def intersection(self, other, sort: bool = False): # default sort keyword is different here from other setops intentionally # done in GH#25063 """ Form the intersection of two Index objects. This returns a new Index with elements common to the index and `other`. Parame...
Form the intersection of two Index objects. This returns a new Index with elements common to the index and `other`. Parameters ---------- other : Index or array-like An Index or an array-like object containing elements to form the intersection with the original Index. sort : True, False or None, default False...
python
pandas/core/indexes/base.py
3,245
[ "self", "other", "sort" ]
true
16
7.2
pandas-dev/pandas
47,362
numpy
false
doDoubleValue
@Override public double doDoubleValue() throws IOException { try { return parser.getDoubleValue(); } catch (IOException e) { throw handleParserException(e); } }
Handle parser exception depending on type. This converts known exceptions to XContentParseException and rethrows them.
java
libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentParser.java
290
[]
true
2
6.08
elastic/elasticsearch
75,680
javadoc
false
parseResponse
public static AbstractResponse parseResponse(ByteBuffer responseBuffer, RequestHeader requestHeader) { try { return AbstractResponse.parseResponse(responseBuffer, requestHeader); } catch (BufferUnderflowException e) { throw new SchemaException("Buffer underflow while parsing resp...
Choose the node with the fewest outstanding requests which is at least eligible for connection. 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. If no connection exists, this method will prefer...
java
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java
824
[ "responseBuffer", "requestHeader" ]
AbstractResponse
true
5
7.04
apache/kafka
31,560
javadoc
false
isin
def isin(element, test_elements, assume_unique=False, invert=False): """ Calculates `element in test_elements`, broadcasting over `element` only. The output is always a masked array of the same shape as `element`. See `numpy.isin` for more details. See Also -------- in1d : Flatte...
Calculates `element in test_elements`, broadcasting over `element` only. The output is always a masked array of the same shape as `element`. See `numpy.isin` for more details. See Also -------- in1d : Flattened version of this function. numpy.isin : Equivalent function for ndarrays. Examples -------- >>> impor...
python
numpy/ma/extras.py
1,434
[ "element", "test_elements", "assume_unique", "invert" ]
false
1
6
numpy/numpy
31,054
unknown
false
applyAsLong
long applyAsLong(long operand) throws E;
Applies this operator to the given operand. @param operand the operand @return the operator result @throws E Thrown when a consumer fails.
java
src/main/java/org/apache/commons/lang3/function/FailableLongUnaryOperator.java
76
[ "operand" ]
true
1
6.64
apache/commons-lang
2,896
javadoc
false
times
function times(n, iteratee) { n = toInteger(n); if (n < 1 || n > MAX_SAFE_INTEGER) { return []; } var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee = getIteratee(iteratee); n -= MAX_ARRAY_LENGTH; var result = baseTimes(length, i...
Invokes the iteratee `n` times, returning an array of the results of each invocation. The iteratee is invoked with one argument; (index). @static @since 0.1.0 @memberOf _ @category Util @param {number} n The number of times to invoke `iteratee`. @param {Function} [iteratee=_.identity] The function invoked per iteration...
javascript
lodash.js
16,247
[ "n", "iteratee" ]
false
4
7.52
lodash/lodash
61,490
jsdoc
false
addAotGeneratedInitializerIfNecessary
private void addAotGeneratedInitializerIfNecessary(List<ApplicationContextInitializer<?>> initializers) { if (NativeDetector.inNativeImage()) { NativeImageRequirementsException.throwIfNotMet(); } if (AotDetector.useGeneratedArtifacts()) { List<ApplicationContextInitializer<?>> aotInitializers = new ArrayLis...
Run the Spring application, creating and refreshing a new {@link ApplicationContext}. @param args the application arguments (usually passed from a Java main method) @return a running {@link ApplicationContext}
java
core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
421
[ "initializers" ]
void
true
5
7.28
spring-projects/spring-boot
79,428
javadoc
false
generate
def generate( # type: ignore[override] self, name: str, description: str, input_key: str, layout_repr: str, input_tensor_meta: Union[TensorMeta, list[TensorMeta]], output_tensor_meta: Union[TensorMeta, list[TensorMeta]], **kwargs, ) -> CUDATemplateCal...
Generates the CUDA template caller object for the given GEMM template and operation. This CUDATemplateCaller may be used to call and benchmark the generated CUDA kernel in a standalone manner to enable Autotuning. Args: description: op name followed by swizzle. kwargs: Additional keyword arguments. Returns: ...
python
torch/_inductor/codegen/cuda/cuda_template.py
168
[ "self", "name", "description", "input_key", "layout_repr", "input_tensor_meta", "output_tensor_meta" ]
CUDATemplateCaller
true
4
7.52
pytorch/pytorch
96,034
google
false
next
public char next() { return this.pos < this.in.length() ? this.in.charAt(this.pos++) : '\0'; }
Returns the current position and the entire input string. @return the current position and the entire input string.
java
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONTokener.java
481
[]
true
2
8
spring-projects/spring-boot
79,428
javadoc
false
LoadBufferFromGCS
static int64_t LoadBufferFromGCS(const std::string& path, size_t offset, size_t buffer_size, char* buffer, tf_gcs_filesystem::GCSFile* gcs_file, TF_Status* status) { std::string bucket, object; ParseGCSPath(path, fals...
Appends a trailing slash if the name doesn't already have one.
cpp
tensorflow/c/experimental/filesystem/plugins/gcs/gcs_filesystem.cc
128
[ "offset", "buffer_size" ]
true
10
6
tensorflow/tensorflow
192,880
doxygen
false
reorder_levels
def reorder_levels(self, order: Sequence[Level]) -> Series: """ Rearrange index levels using input order. May not drop or duplicate levels. Parameters ---------- order : list of int representing new level order Reference level by number or key. Retu...
Rearrange index levels using input order. May not drop or duplicate levels. Parameters ---------- order : list of int representing new level order Reference level by number or key. Returns ------- Series Type of caller with index as MultiIndex (new object). See Also -------- DataFrame.reorder_levels : Rearr...
python
pandas/core/series.py
4,225
[ "self", "order" ]
Series
true
2
8.48
pandas-dev/pandas
47,362
numpy
false
parseCustomElement
public @Nullable BeanDefinition parseCustomElement(Element ele, @Nullable BeanDefinition containingBd) { String namespaceUri = getNamespaceURI(ele); if (namespaceUri == null) { return null; } NamespaceHandler handler = this.readerContext.getNamespaceHandlerResolver().resolve(namespaceUri); if (handler == n...
Parse a custom element (outside the default namespace). @param ele the element to parse @param containingBd the containing bean definition (if any) @return the resulting bean definition
java
spring-beans/src/main/java/org/springframework/beans/factory/xml/BeanDefinitionParserDelegate.java
1,369
[ "ele", "containingBd" ]
BeanDefinition
true
3
7.6
spring-projects/spring-framework
59,386
javadoc
false
createCollection
@Override SortedSet<V> createCollection() { return new TreeSet<>(valueComparator); }
{@inheritDoc} <p>Creates an empty {@code TreeSet} for a collection of values for one key. @return a new {@code TreeSet} containing a collection of values for one key
java
android/guava/src/com/google/common/collect/TreeMultimap.java
139
[]
true
1
6.64
google/guava
51,352
javadoc
false
registrySuffixIndex
private int registrySuffixIndex() { int registrySuffixIndexLocal = registrySuffixIndexCache; if (registrySuffixIndexLocal == SUFFIX_NOT_INITIALIZED) { registrySuffixIndexCache = registrySuffixIndexLocal = findSuffixOfType(Optional.of(PublicSuffixType.REGISTRY)); } return registrySuffixIn...
The index in the {@link #parts()} list at which the registry suffix begins. For example, for the domain name {@code myblog.blogspot.co.uk}, the value would be 2 (the index of the {@code co} part). The value is negative (specifically, {@link #NO_SUFFIX_FOUND}) if no registry suffix was found.
java
android/guava/src/com/google/common/net/InternetDomainName.java
195
[]
true
2
7.04
google/guava
51,352
javadoc
false
requestRejoinIfNecessary
public synchronized void requestRejoinIfNecessary(final String shortReason, final String fullReason) { if (!this.rejoinNeeded) { requestRejoin(shortReason, fullReason); } }
Get the current generation state if the group is stable, otherwise return null @return the current generation or null
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
1,089
[ "shortReason", "fullReason" ]
void
true
2
6.4
apache/kafka
31,560
javadoc
false
findLastIndex
function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length +...
This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. @static @memberOf _ @since 2.0.0 @category Array @param {Array} array The array to inspect. @param {Function} [predicate=_.identity] The function invoked per iteration. @param {number} [fromIndex=array.length-1] ...
javascript
lodash.js
7,399
[ "array", "predicate", "fromIndex" ]
false
5
7.2
lodash/lodash
61,490
jsdoc
false
callWithTimeout
@ParametricNullness private <T extends @Nullable Object> T callWithTimeout( Callable<T> callable, long timeoutDuration, TimeUnit timeoutUnit, boolean amInterruptible) throws Exception { checkNotNull(callable); checkNotNull(timeoutUnit); checkPositiveTimeout(timeoutDuration); Future<T> fut...
Creates a TimeLimiter instance using the given executor service to execute method calls. <p><b>Warning:</b> using a bounded executor may be counterproductive! If the thread pool fills up, any time callers spend waiting for a thread may count toward their time limit, and in this case the call may even time out before th...
java
android/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java
110
[ "callable", "timeoutDuration", "timeoutUnit", "amInterruptible" ]
T
true
5
6.72
google/guava
51,352
javadoc
false
join
public StringBuilder join(final StringBuilder stringBuilder, final Iterable<T> elements) { return joinI(stringBuilder, prefix, suffix, delimiter, appender, elements); }
Joins stringified objects from the given Iterable into a StringBuilder. @param stringBuilder The target. @param elements The source. @return The given StringBuilder.
java
src/main/java/org/apache/commons/lang3/AppendableJoiner.java
272
[ "stringBuilder", "elements" ]
StringBuilder
true
1
6.48
apache/commons-lang
2,896
javadoc
false
getTemplateLoaderForPath
protected TemplateLoader getTemplateLoaderForPath(String templateLoaderPath) { if (isPreferFileSystemAccess()) { // Try to load via the file system, fall back to SpringTemplateLoader // (for hot detection of template changes, if possible). try { Resource path = getResourceLoader().getResource(templateLoa...
Determine a FreeMarker {@link TemplateLoader} for the given path. <p>Default implementation creates either a {@link FileTemplateLoader} or a {@link SpringTemplateLoader}. @param templateLoaderPath the path to load templates from @return an appropriate {@code TemplateLoader} @see freemarker.cache.FileTemplateLoader @see...
java
spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java
363
[ "templateLoaderPath" ]
TemplateLoader
true
5
7.6
spring-projects/spring-framework
59,386
javadoc
false
readFile
private static String readFile(final String envVarFile, final String key) { try { final byte[] bytes = Files.readAllBytes(Paths.get(envVarFile)); final String content = new String(bytes, Charset.defaultCharset()); // Split by null byte character final String[] lin...
Tests whether the {@code /proc/N/environ} file at the given path string contains a specific line prefix. @param envVarFile The path to a /proc/N/environ file. @param key The env var key to find. @return value The env var value or null.
java
src/main/java/org/apache/commons/lang3/RuntimeEnvironment.java
118
[ "envVarFile", "key" ]
String
true
2
8.24
apache/commons-lang
2,896
javadoc
false
maybe_box_native
def maybe_box_native(value: Scalar | None | NAType) -> Scalar | None | NAType: """ If passed a scalar cast the scalar to a python native type. Parameters ---------- value : scalar or Series Returns ------- scalar or Series """ if is_float(value): value = float(value) ...
If passed a scalar cast the scalar to a python native type. Parameters ---------- value : scalar or Series Returns ------- scalar or Series
python
pandas/core/dtypes/cast.py
186
[ "value" ]
Scalar | None | NAType
true
6
6.88
pandas-dev/pandas
47,362
numpy
false
logInvalidating
private void logInvalidating(CacheOperationContext context, CacheEvictOperation operation, @Nullable Object key) { if (logger.isTraceEnabled()) { logger.trace("Invalidating " + (key != null ? "cache key [" + key + "]" : "entire cache") + " for operation " + operation + " on method " + context.metadata.method)...
Find a cached value only for {@link CacheableOperation} that passes the condition. @param contexts the cacheable operations @return a {@link Cache.ValueWrapper} holding the cached value, or {@code null} if none is found
java
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
709
[ "context", "operation", "key" ]
void
true
3
7.92
spring-projects/spring-framework
59,386
javadoc
false
describe_endpoint_config
def describe_endpoint_config(self, name: str) -> dict: """ Get the endpoint config info associated with the name. .. seealso:: - :external+boto3:py:meth:`SageMaker.Client.describe_endpoint_config` :param name: the name of the endpoint config :return: A dict contains...
Get the endpoint config info associated with the name. .. seealso:: - :external+boto3:py:meth:`SageMaker.Client.describe_endpoint_config` :param name: the name of the endpoint config :return: A dict contains all the endpoint config info
python
providers/amazon/src/airflow/providers/amazon/aws/hooks/sagemaker.py
688
[ "self", "name" ]
dict
true
1
6.24
apache/airflow
43,597
sphinx
false
perform_heartbeat
def perform_heartbeat( job: Job, heartbeat_callback: Callable[[Session], None], only_if_necessary: bool ) -> None: """ Perform heartbeat for the Job passed to it,optionally checking if it is necessary. :param job: job to perform heartbeat for :param heartbeat_callback: callback to run by the heartb...
Perform heartbeat for the Job passed to it,optionally checking if it is necessary. :param job: job to perform heartbeat for :param heartbeat_callback: callback to run by the heartbeat :param only_if_necessary: only heartbeat if it is necessary (i.e. if there are things to run for triggerer for example)
python
airflow-core/src/airflow/jobs/job.py
418
[ "job", "heartbeat_callback", "only_if_necessary" ]
None
true
5
6.72
apache/airflow
43,597
sphinx
false
BASIC_UNESCAPE
public static String[][] BASIC_UNESCAPE() { return BASIC_UNESCAPE.clone(); }
Reverse of {@link #BASIC_ESCAPE()} for unescaping purposes. @return the mapping table.
java
src/main/java/org/apache/commons/lang3/text/translate/EntityArrays.java
391
[]
true
1
6.48
apache/commons-lang
2,896
javadoc
false
registerMetric
synchronized KafkaMetric registerMetric(KafkaMetric metric) { MetricName metricName = metric.metricName(); KafkaMetric existingMetric = this.metrics.putIfAbsent(metricName, metric); if (existingMetric != null) { return existingMetric; } // newly added metric f...
Register a metric if not present or return the already existing metric with the same name. When a metric is newly registered, this method returns null @param metric The KafkaMetric to register @return the existing metric with the same name or null
java
clients/src/main/java/org/apache/kafka/common/metrics/Metrics.java
588
[ "metric" ]
KafkaMetric
true
3
7.92
apache/kafka
31,560
javadoc
false
argwhere
def argwhere(a): """ Find the indices of array elements that are non-zero, grouped by element. Parameters ---------- a : array_like Input data. Returns ------- index_array : (N, a.ndim) ndarray Indices of elements that are non-zero. Indices are grouped by element. ...
Find the indices of array elements that are non-zero, grouped by element. Parameters ---------- a : array_like Input data. Returns ------- index_array : (N, a.ndim) ndarray Indices of elements that are non-zero. Indices are grouped by element. This array will have shape ``(N, a.ndim)`` where ``N`` is the ...
python
numpy/_core/numeric.py
625
[ "a" ]
false
2
7.84
numpy/numpy
31,054
numpy
false
withSuppliedValue
public Bindable<T> withSuppliedValue(@Nullable Supplier<T> suppliedValue) { return new Bindable<>(this.type, this.boxedType, suppliedValue, this.annotations, this.bindRestrictions, this.bindMethod); }
Create an updated {@link Bindable} instance with a value supplier. @param suppliedValue the supplier for the value @return an updated {@link Bindable}
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java
214
[ "suppliedValue" ]
true
1
6.48
spring-projects/spring-boot
79,428
javadoc
false
visitGetAccessor
function visitGetAccessor(node: GetAccessorDeclaration, parent: ClassLikeDeclaration | ObjectLiteralExpression) { if (!(node.transformFlags & TransformFlags.ContainsTypeScript)) { return node; } if (!shouldEmitAccessorDeclaration(node)) { return undefined; ...
Determines whether to emit an accessor declaration. We should not emit the declaration if it does not have a body and is abstract. @param node The declaration node.
typescript
src/compiler/transformers/ts.ts
1,502
[ "node", "parent" ]
false
5
6.08
microsoft/TypeScript
107,154
jsdoc
false
concat
public static char[] concat(char[]... arrays) { long length = 0; for (char[] array : arrays) { length += array.length; } char[] result = new char[checkNoOverflow(length)]; int pos = 0; for (char[] array : arrays) { System.arraycopy(array, 0, result, pos, array.length); pos += a...
Returns the values from each provided array combined into a single array. For example, {@code concat(new char[] {a, b}, new char[] {}, new char[] {c}} returns the array {@code {a, b, c}}. @param arrays zero or more {@code char} arrays @return a single array containing all the values from the source arrays, in order @th...
java
android/guava/src/com/google/common/primitives/Chars.java
280
[]
true
1
6.56
google/guava
51,352
javadoc
false
mode
@SafeVarargs public static <T> T mode(final T... items) { if (ArrayUtils.isNotEmpty(items)) { final HashMap<T, MutableInt> occurrences = new HashMap<>(items.length); for (final T t : items) { ArrayUtils.increment(occurrences, t); } T result = n...
Finds the most frequently occurring item. @param <T> type of values processed by this method. @param items to check. @return most populous T, {@code null} if non-unique or no items supplied. @since 3.0.1
java
src/main/java/org/apache/commons/lang3/ObjectUtils.java
1,122
[]
T
true
4
8.24
apache/commons-lang
2,896
javadoc
false
isConditionPassing
private boolean isConditionPassing(CacheOperationContext context, @Nullable Object result) { boolean passing = context.isConditionPassing(result); if (!passing && logger.isTraceEnabled()) { logger.trace("Cache condition failed on method " + context.metadata.method + " for operation " + context.metadata.oper...
Collect a {@link CachePutRequest} for every {@link CacheOperation} using the specified result value. @param contexts the contexts to handle @param result the result value @param putRequests the collection to update
java
spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
733
[ "context", "result" ]
true
3
6.08
spring-projects/spring-framework
59,386
javadoc
false
createBind
function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return w...
Creates a function that wraps `func` to invoke it with the optional `this` binding of `thisArg`. @private @param {Function} func The function to wrap. @param {number} bitmask The bitmask flags. See `createWrap` for more details. @param {*} [thisArg] The `this` binding of `func`. @returns {Function} Returns the new wrap...
javascript
lodash.js
5,024
[ "func", "bitmask", "thisArg" ]
false
5
6.08
lodash/lodash
61,490
jsdoc
false
reduction_prefix_array
def reduction_prefix_array( acc_var: Union[str, CSEVariable], acc_type: str, reduction_type: str, dtype: torch.dtype, len: Union[str, int], init_fn, ): """ MSVC don't support dynamic array(VLA). So we use std::unique_ptr here. Ref: https://stackoverflow.com/questions/56555406/creatin...
MSVC don't support dynamic array(VLA). So we use std::unique_ptr here. Ref: https://stackoverflow.com/questions/56555406/creating-dynamic-sized-array-using-msvc-c-compiler MSVC is the only one compiler without VLA. support. Since MSVC can't get good performance here. We just use unique_ptr make it works on MSVC. For ot...
python
torch/_inductor/codegen/cpp.py
316
[ "acc_var", "acc_type", "reduction_type", "dtype", "len", "init_fn" ]
true
2
6.72
pytorch/pytorch
96,034
unknown
false
of
static AutowiredArguments of(@Nullable Object[] arguments) { Assert.notNull(arguments, "'arguments' must not be null"); return () -> arguments; }
Factory method to create a new {@link AutowiredArguments} instance from the given object array. @param arguments the arguments @return a new {@link AutowiredArguments} instance
java
spring-beans/src/main/java/org/springframework/beans/factory/aot/AutowiredArguments.java
85
[ "arguments" ]
AutowiredArguments
true
1
6
spring-projects/spring-framework
59,386
javadoc
false
unmodifiableListMultimap
public static <K extends @Nullable Object, V extends @Nullable Object> ListMultimap<K, V> unmodifiableListMultimap(ListMultimap<K, V> delegate) { if (delegate instanceof UnmodifiableListMultimap || delegate instanceof ImmutableListMultimap) { return delegate; } return new UnmodifiableListMultima...
Returns an unmodifiable view of the specified {@code ListMultimap}. Query operations on the returned multimap "read through" to the specified multimap, and attempts to modify the returned multimap, either directly or through the multimap's views, result in an {@code UnsupportedOperationException}. <p>The returned multi...
java
android/guava/src/com/google/common/collect/Multimaps.java
1,000
[ "delegate" ]
true
3
7.44
google/guava
51,352
javadoc
false
bindExportDeclaration
function bindExportDeclaration(node: ExportDeclaration) { if (!container.symbol || !container.symbol.exports) { // Export * in some sort of block construct bindAnonymousDeclaration(node, SymbolFlags.ExportStar, getDeclarationName(node)!); } else if (!node.exportClaus...
Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. @param symbolTable - The symbol table which node will be added to. @param parent - node's parent declaration. @param node - The declaration to be added to the symbol table @param includes - The SymbolFlags that n...
typescript
src/compiler/binder.ts
3,164
[ "node" ]
false
7
6.08
microsoft/TypeScript
107,154
jsdoc
false
invocableClone
MethodInvocation invocableClone(@Nullable Object... arguments);
Create a clone of this object. If cloning is done before {@code proceed()} is invoked on this object, {@code proceed()} can be invoked once per clone to invoke the joinpoint (and the rest of the advice chain) more than once. @param arguments the arguments that the cloned invocation is supposed to use, overriding the or...
java
spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java
61
[]
MethodInvocation
true
1
6.8
spring-projects/spring-framework
59,386
javadoc
false
toString
@Override public String toString() { StringBuilder builder = new StringBuilder(getOrDeduceName(this)); if (this.servletNames.isEmpty() && this.urlPatterns.isEmpty()) { builder.append(" urls=").append(Arrays.toString(DEFAULT_URL_MAPPINGS)); } else { if (!this.servletNames.isEmpty()) { builder.append("...
Returns the filter name that will be registered. @return the filter name @since 3.2.0
java
core/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java
280
[]
String
true
5
8.24
spring-projects/spring-boot
79,428
javadoc
false
createAcls
default CreateAclsResult createAcls(Collection<AclBinding> acls) { return createAcls(acls, new CreateAclsOptions()); }
This is a convenience method for {@link #createAcls(Collection, CreateAclsOptions)} 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 acls The ACLs to create @return The CreateAclsResult.
java
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
393
[ "acls" ]
CreateAclsResult
true
1
6.32
apache/kafka
31,560
javadoc
false
equals
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if ((obj == null) || (getClass() != obj.getClass())) { return false; } StandardConfigDataReference other = (StandardConfigDataReference) obj; return this.resourceLocation.equals(other.resourceLocation); }
Create a new {@link StandardConfigDataReference} instance. @param configDataLocation the original location passed to the resolver @param directory the directory of the resource or {@code null} if the reference is to a file @param root the root of the resource location @param profile the profile being loaded @param exte...
java
core/spring-boot/src/main/java/org/springframework/boot/context/config/StandardConfigDataReference.java
91
[ "obj" ]
true
4
6.4
spring-projects/spring-boot
79,428
javadoc
false
unsatisfiedNonSimpleProperties
protected String[] unsatisfiedNonSimpleProperties(AbstractBeanDefinition mbd, BeanWrapper bw) { Set<String> result = new TreeSet<>(); PropertyValues pvs = mbd.getPropertyValues(); PropertyDescriptor[] pds = bw.getPropertyDescriptors(); for (PropertyDescriptor pd : pds) { if (pd.getWriteMethod() != null && !i...
Return an array of non-simple bean properties that are unsatisfied. These are probably unsatisfied references to other beans in the factory. Does not include simple properties like primitives or Strings. @param mbd the merged bean definition the bean was created with @param bw the BeanWrapper the bean was created with ...
java
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
1,558
[ "mbd", "bw" ]
true
5
7.44
spring-projects/spring-framework
59,386
javadoc
false
erase
@CanIgnoreReturnValue public @Nullable V erase(@Nullable Object rowKey, @Nullable Object columnKey) { Integer rowIndex = rowKeyToIndex.get(rowKey); Integer columnIndex = columnKeyToIndex.get(columnKey); if (rowIndex == null || columnIndex == null) { return null; } return set(rowIndex, column...
Associates the value {@code null} with the specified keys, assuming both keys are valid. If either key is null or isn't among the keys provided during construction, this method has no effect. <p>This method is equivalent to {@code put(rowKey, columnKey, null)} when both provided keys are valid. @param rowKey row key of...
java
android/guava/src/com/google/common/collect/ArrayTable.java
512
[ "rowKey", "columnKey" ]
V
true
3
7.92
google/guava
51,352
javadoc
false
randomBoolean
public boolean randomBoolean() { return random().nextBoolean(); }
Generates a random boolean value. @return the random boolean. @since 3.16.0
java
src/main/java/org/apache/commons/lang3/RandomUtils.java
303
[]
true
1
6.8
apache/commons-lang
2,896
javadoc
false
shift
def shift( self, periods: int | Sequence[int] = 1, freq=None, fill_value=lib.no_default, suffix: str | None = None, ): """ Shift each group by periods observations. If freq is passed, the index will be increased using the periods and the freq. ...
Shift each group by periods observations. If freq is passed, the index will be increased using the periods and the freq. Parameters ---------- periods : int | Sequence[int], default 1 Number of periods to shift. If a list of values, shift each group by each period. freq : str, optional Frequency string. f...
python
pandas/core/groupby/groupby.py
5,116
[ "self", "periods", "freq", "fill_value", "suffix" ]
true
15
8.24
pandas-dev/pandas
47,362
numpy
false
setException
@CanIgnoreReturnValue protected boolean setException(Throwable throwable) { Object valueToSet = new Failure(checkNotNull(throwable)); if (casValue(this, null, valueToSet)) { complete(this, /* callInterruptTask= */ false); return true; } return false; }
Sets the failed result of this {@code Future} unless this {@code Future} has already been cancelled or set (including {@linkplain #setFuture set asynchronously}). When a call to this method returns, the {@code Future} is guaranteed to be {@linkplain #isDone done} <b>only if</b> the call was accepted (in which case it r...
java
android/guava/src/com/google/common/util/concurrent/AbstractFuture.java
512
[ "throwable" ]
true
2
8.08
google/guava
51,352
javadoc
false
skip
static <T> boolean skip(@Nullable T extracted) { return extracted == SKIP; }
Return if the extracted value should be skipped. @param <T> the value type @param extracted the value to test @return if the value is to be skipped
java
core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java
762
[ "extracted" ]
true
1
6.96
spring-projects/spring-boot
79,428
javadoc
false
filled
def filled(a, fill_value=None): """ Return input as an `~numpy.ndarray`, with masked values replaced by `fill_value`. If `a` is not a `MaskedArray`, `a` itself is returned. If `a` is a `MaskedArray` with no masked values, then ``a.data`` is returned. If `a` is a `MaskedArray` and `fill_valu...
Return input as an `~numpy.ndarray`, with masked values replaced by `fill_value`. If `a` is not a `MaskedArray`, `a` itself is returned. If `a` is a `MaskedArray` with no masked values, then ``a.data`` is returned. If `a` is a `MaskedArray` and `fill_value` is None, `fill_value` is set to ``a.fill_value``. Parameters...
python
numpy/ma/core.py
619
[ "a", "fill_value" ]
false
5
7.76
numpy/numpy
31,054
numpy
false
contains
public boolean contains(CompletableEvent<?> event) { return event != null && tracked.contains(event); }
It is possible for the {@link AsyncKafkaConsumer#close() consumer to close} before completing the processing of all the events in the queue. In this case, we need to {@link CompletableFuture#completeExceptionally(Throwable) expire} any remaining events. <p/> Check each of the {@link #add(CompletableEvent) previously-ad...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/CompletableEventReaper.java
159
[ "event" ]
true
2
7.52
apache/kafka
31,560
javadoc
false
tryLockMemory
@Override public void tryLockMemory() { Handle process = kernel.GetCurrentProcess(); // By default, Windows limits the number of pages that can be locked. // Thus, we need to first increase the working set size of the JVM by // the amount of memory we wish to lock, plus a small overh...
Constant for LimitFlags, indicating a process limit has been set
java
libs/native/src/main/java/org/elasticsearch/nativeaccess/WindowsNativeAccess.java
61
[]
void
true
6
6.24
elastic/elasticsearch
75,680
javadoc
false
tryComputeIndentationForListItem
function tryComputeIndentationForListItem(startPos: number, endPos: number, parentStartLine: number, range: TextRange, inheritedIndentation: number): number { if ( rangeOverlapsWithStartEnd(range, startPos, endPos) || rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-...
Tries to compute the indentation for a list element. If list element is not in range then function will pick its actual indentation so it can be pushed downstream as inherited indentation. If list element is in the range - its indentation will be equal to inherited indentation from its predecessors.
typescript
src/services/formatting/formatting.ts
592
[ "startPos", "endPos", "parentStartLine", "range", "inheritedIndentation" ]
true
8
6
microsoft/TypeScript
107,154
jsdoc
false
findTopicNameInGlobalOrLocalCache
private Optional<String> findTopicNameInGlobalOrLocalCache(Uuid topicId) { String nameFromMetadataCache = metadata.topicNames().getOrDefault(topicId, null); if (nameFromMetadataCache != null) { // Add topic name to local cache, so it can be reused if included in a next target // ...
Look for topic in the global metadata cache. If found, add it to the local cache and return it. If not found, look for it in the local metadata cache. Return empty if not found in any of the two.
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java
1,102
[ "topicId" ]
true
2
6
apache/kafka
31,560
javadoc
false
registerDeprecationIfNecessary
private void registerDeprecationIfNecessary(@Nullable AnnotatedElement element) { if (element == null) { return; } register(element.getAnnotation(Deprecated.class)); if (element instanceof Class<?> type) { registerDeprecationIfNecessary(type.getEnclosingClass()); } }
Return the currently registered warnings. @return the warnings
java
spring-beans/src/main/java/org/springframework/beans/factory/aot/CodeWarnings.java
142
[ "element" ]
void
true
3
6.4
spring-projects/spring-framework
59,386
javadoc
false
_is_all_dates
def _is_all_dates(self) -> bool: """ Whether or not the index values only consist of dates. """ if needs_i8_conversion(self.dtype): return True elif self.dtype != _dtype_obj: # TODO(ExtensionIndex): 3rd party EA might override? # Note: this inc...
Whether or not the index values only consist of dates.
python
pandas/core/indexes/base.py
2,551
[ "self" ]
bool
true
4
6
pandas-dev/pandas
47,362
unknown
false
intToHex
function intToHex(int: number) { const hex = int.toString(16); return hex.length === 1 ? `0${hex}` : hex; }
Converts a color from CSS hex format to CSS rgb format. @param color - Hex color, i.e. #nnn or #nnnnnn @returns A CSS rgb color string @beta
typescript
packages/grafana-data/src/themes/colorManipulator.ts
56
[ "int" ]
false
2
7.36
grafana/grafana
71,362
jsdoc
false
setitem_datetimelike_compat
def setitem_datetimelike_compat(values: np.ndarray, num_set: int, other): """ Parameters ---------- values : np.ndarray num_set : int For putmask, this is mask.sum() other : Any """ if values.dtype == object: dtype, _ = infer_dtype_from(other) if lib.is_np_dtype(...
Parameters ---------- values : np.ndarray num_set : int For putmask, this is mask.sum() other : Any
python
pandas/core/array_algos/putmask.py
130
[ "values", "num_set", "other" ]
true
5
6.4
pandas-dev/pandas
47,362
numpy
false
checkAndRemoveCompletedAcknowledgements
private boolean checkAndRemoveCompletedAcknowledgements() { boolean areAnyAcksLeft = false; Iterator<Map.Entry<Integer, Tuple<AcknowledgeRequestState>>> iterator = acknowledgeRequestStates.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<Integer, Tuple<AcknowledgeReques...
Prunes the empty acknowledgementRequestStates in {@link #acknowledgeRequestStates} @return Returns true if there are still any acknowledgements left to be processed.
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java
479
[]
true
9
7.28
apache/kafka
31,560
javadoc
false
read
def read(self, nrows: int | None = None) -> pd.DataFrame: """Read observations from SAS Xport file, returning as data frame. Parameters ---------- nrows : int Number of rows to read from data file; if None, read whole file. Returns ------- ...
Read observations from SAS Xport file, returning as data frame. Parameters ---------- nrows : int Number of rows to read from data file; if None, read whole file. Returns ------- A DataFrame.
python
pandas/io/sas/sas_xport.py
452
[ "self", "nrows" ]
pd.DataFrame
true
9
6.88
pandas-dev/pandas
47,362
numpy
false
transformAndSpreadElements
function transformAndSpreadElements(elements: NodeArray<Expression>, isArgumentList: boolean, multiLine: boolean, hasTrailingComma: boolean): Expression { // When there is no leading SpreadElement: // // [source] // [a, ...b, c] // // [output (downlevelIteratio...
Transforms an array of Expression nodes that contains a SpreadExpression. @param elements The array of Expression nodes. @param isArgumentList A value indicating whether to ensure that the result is a fresh array. This should be `false` when spreading into an `ArrayLiteral`, and `true` when spreading into an argum...
typescript
src/compiler/transformers/es2015.ts
4,633
[ "elements", "isArgumentList", "multiLine", "hasTrailingComma" ]
true
11
6.8
microsoft/TypeScript
107,154
jsdoc
false
initializeAllParameterDetails
private static List<CacheParameterDetail> initializeAllParameterDetails(Method method) { int parameterCount = method.getParameterCount(); List<CacheParameterDetail> result = new ArrayList<>(parameterCount); for (int i = 0; i < parameterCount; i++) { CacheParameterDetail detail = new CacheParameterDetail(method...
Construct a new {@code AbstractJCacheOperation}. @param methodDetails the {@link CacheMethodDetails} related to the cached method @param cacheResolver the cache resolver to resolve regular caches
java
spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractJCacheOperation.java
68
[ "method" ]
true
2
6.08
spring-projects/spring-framework
59,386
javadoc
false
quantile_with_mask
def quantile_with_mask( values: np.ndarray, mask: npt.NDArray[np.bool_], fill_value, qs: npt.NDArray[np.float64], interpolation: str, ) -> np.ndarray: """ Compute the quantiles of the given values for each quantile in `qs`. Parameters ---------- values : np.ndarray For E...
Compute the quantiles of the given values for each quantile in `qs`. Parameters ---------- values : np.ndarray For ExtensionArray, this is _values_for_factorize()[0] mask : np.ndarray[bool] mask = isna(values) For ExtensionArray, this is computed before calling _value_for_factorize fill_value : Scalar ...
python
pandas/core/array_algos/quantile.py
44
[ "values", "mask", "fill_value", "qs", "interpolation" ]
np.ndarray
true
4
6.32
pandas-dev/pandas
47,362
numpy
false
stop
@Override public void stop() throws SchedulingException { if (this.scheduler != null) { try { this.scheduler.standby(); } catch (SchedulerException ex) { throw new SchedulingException("Could not stop Quartz Scheduler", ex); } } }
Start the Quartz Scheduler, respecting the "startupDelay" setting. @param scheduler the Scheduler to start @param startupDelay the number of seconds to wait before starting the Scheduler asynchronously
java
spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java
798
[]
void
true
3
6.24
spring-projects/spring-framework
59,386
javadoc
false
merge
protected abstract T merge(Supplier<T> existing, T additional);
Merge any additional elements into the existing aggregate. @param existing the supplier for the existing value @param additional the additional elements to merge @return the merged result
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/AggregateBinder.java
83
[ "existing", "additional" ]
T
true
1
6.48
spring-projects/spring-boot
79,428
javadoc
false
_is_method_overridden
def _is_method_overridden(self, method_name: str) -> bool: """Checks if a method is overridden in the NamedTuple subclass. Args: method_name (str): The name of the method to check. Returns: bool: True if the method is overridden in the subclass, False otherwise. ...
Checks if a method is overridden in the NamedTuple subclass. Args: method_name (str): The name of the method to check. Returns: bool: True if the method is overridden in the subclass, False otherwise. Raises: ValueError: If the NamedTuple class does not inherit from both Tuple and Object.
python
torch/_dynamo/variables/lists.py
1,467
[ "self", "method_name" ]
bool
true
3
8.08
pytorch/pytorch
96,034
google
false
produce_sbom_for_application_via_cdxgen_server
def produce_sbom_for_application_via_cdxgen_server( job: SbomApplicationJob, output: Output | None, github_token: str | None, port_map: dict[str, int] | None = None, ) -> tuple[int, str]: """ Produces SBOM for application using cdxgen server. :param job: Job to run :param output: Output ...
Produces SBOM for application using cdxgen server. :param job: Job to run :param output: Output to use :param github_token: GitHub token to use for downloading files` :param port_map map of process name to port - making sure that one process talks to one server in case parallel processing is used :return: tuple wi...
python
dev/breeze/src/airflow_breeze/utils/cdxgen.py
520
[ "job", "output", "github_token", "port_map" ]
tuple[int, str]
true
3
7.76
apache/airflow
43,597
sphinx
false
_value_with_fmt
def _value_with_fmt( self, val ) -> tuple[ int | float | bool | str | datetime.datetime | datetime.date, str | None ]: """ Convert numpy types to Python types for the Excel writers. Parameters ---------- val : object Value to be written into c...
Convert numpy types to Python types for the Excel writers. Parameters ---------- val : object Value to be written into cells Returns ------- Tuple with the first element being the converted value and the second being an optional format
python
pandas/io/excel/_base.py
1,328
[ "self", "val" ]
tuple[ int | float | bool | str | datetime.datetime | datetime.date, str | None ]
true
10
6.72
pandas-dev/pandas
47,362
numpy
false
_from_dataframe
def _from_dataframe(df: DataFrameXchg, allow_copy: bool = True) -> pd.DataFrame: """ Build a ``pd.DataFrame`` from the DataFrame interchange object. Parameters ---------- df : DataFrameXchg Object supporting the interchange protocol, i.e. `__dataframe__` method. allow_copy : bool, defau...
Build a ``pd.DataFrame`` from the DataFrame interchange object. Parameters ---------- df : DataFrameXchg Object supporting the interchange protocol, i.e. `__dataframe__` method. allow_copy : bool, default: True Whether to allow copying the memory to perform the conversion (if false then zero-copy approach ...
python
pandas/core/interchange/from_dataframe.py
139
[ "df", "allow_copy" ]
pd.DataFrame
true
8
6.4
pandas-dev/pandas
47,362
numpy
false
perform_krb181_workaround
def perform_krb181_workaround(principal: str): """ Workaround for Kerberos 1.8.1. :param principal: principal name :return: None """ cmdv: list[str] = [ conf.get_mandatory_value("kerberos", "kinit_path"), "-c", conf.get_mandatory_value("kerberos", "ccache"), "-R"...
Workaround for Kerberos 1.8.1. :param principal: principal name :return: None
python
airflow-core/src/airflow/security/kerberos.py
138
[ "principal" ]
true
3
7.92
apache/airflow
43,597
sphinx
false
cloneWith
function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); }
This method is like `_.clone` except that it accepts `customizer` which is invoked to produce the cloned value. If `customizer` returns `undefined`, cloning is handled by the method instead. The `customizer` is invoked with up to four arguments; (value [, index|key, object, stack]). @static @memberOf _ @since 4.0.0 @ca...
javascript
lodash.js
11,171
[ "value", "customizer" ]
false
2
6.96
lodash/lodash
61,490
jsdoc
false
resetPositionsIfNeeded
CompletableFuture<Void> resetPositionsIfNeeded() { Map<TopicPartition, AutoOffsetResetStrategy> partitionAutoOffsetResetStrategyMap; try { partitionAutoOffsetResetStrategyMap = offsetFetcherUtils.getOffsetResetStrategyForPartitions(); } catch (Exception e) { CompletableF...
Reset offsets for all assigned partitions that require it. Offsets will be reset with timestamps according to the reset strategy defined for each partition. This will generate ListOffsets requests for the partitions and timestamps, and enqueue them to be sent on the next call to {@link #poll(long)}. <p/> When a respons...
java
clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java
475
[]
true
3
6.72
apache/kafka
31,560
javadoc
false
bindDataObject
private @Nullable Object bindDataObject(ConfigurationPropertyName name, Bindable<?> target, BindHandler handler, Context context, boolean allowRecursiveBinding) { if (isUnbindableBean(name, target, context)) { return null; } Class<?> type = target.getType().resolve(Object.class); BindMethod bindMethod = t...
Bind the specified target {@link Bindable} using this binder's {@link ConfigurationPropertySource property sources} or create a new instance using the type of the {@link Bindable} if the result of the binding is {@code null}. @param name the configuration property name to bind @param target the target bindable @param h...
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java
495
[ "name", "target", "handler", "context", "allowRecursiveBinding" ]
Object
true
4
7.92
spring-projects/spring-boot
79,428
javadoc
false
toString
public String toString(int indentSpaces) throws JSONException { JSONStringer stringer = new JSONStringer(indentSpaces); writeTo(stringer); return stringer.toString(); }
Encodes this array as a human-readable JSON string for debugging, such as: <pre> [ 94043, 90210 ]</pre> @param indentSpaces the number of spaces to indent for each level of nesting. @return a human-readable JSON string of this array @throws JSONException if processing of json failed
java
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONArray.java
644
[ "indentSpaces" ]
String
true
1
6.56
spring-projects/spring-boot
79,428
javadoc
false
codes
def codes(self) -> Series: """ Return Series of codes as well as the index. See Also -------- Series.cat.categories : Return the categories of this categorical. Series.cat.as_ordered : Set the Categorical to be ordered. Series.cat.as_unordered : Set the Categoric...
Return Series of codes as well as the index. See Also -------- Series.cat.categories : Return the categories of this categorical. Series.cat.as_ordered : Set the Categorical to be ordered. Series.cat.as_unordered : Set the Categorical to be unordered. Examples -------- >>> raw_cate = pd.Categorical(["a", "b", None, "...
python
pandas/core/arrays/categorical.py
2,996
[ "self" ]
Series
true
1
7.12
pandas-dev/pandas
47,362
unknown
false
values
@Override public Collection<@Nullable V> values() { return super.values(); }
Returns an unmodifiable collection of all values, which may contain duplicates. Changes to the table will update the returned collection. <p>The returned collection's iterator traverses the values of the first row key, the values of the second row key, and so on. @return collection of values
java
android/guava/src/com/google/common/collect/ArrayTable.java
776
[]
true
1
6.96
google/guava
51,352
javadoc
false
size
public int size() { return this.lookupIndexes.length; }
Returns the number of entries in the ZIP file. @return the number of entries
java
loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/zip/ZipContent.java
175
[]
true
1
6.96
spring-projects/spring-boot
79,428
javadoc
false
_validate_list_of_stringables
def _validate_list_of_stringables(vals: Sequence[str | int | float]) -> bool: """ Check the values in the provided list can be converted to strings. :param vals: list to validate """ if ( vals is None or not isinstance(vals, (tuple, list)) or ...
Check the values in the provided list can be converted to strings. :param vals: list to validate
python
providers/alibaba/src/airflow/providers/alibaba/cloud/hooks/analyticdb_spark.py
300
[ "vals" ]
bool
true
4
7.04
apache/airflow
43,597
sphinx
false
getCanonicalName
public static String getCanonicalName(final Class<?> cls, final String valueIfNull) { if (cls == null) { return valueIfNull; } final String canonicalName = cls.getCanonicalName(); return canonicalName == null ? valueIfNull : canonicalName; }
Gets the canonical name for a {@link Class}. @param cls the class for which to get the canonical class name; may be null. @param valueIfNull the return value if null. @return the canonical name of the class, or {@code valueIfNull}. @since 3.7 @see Class#getCanonicalName()
java
src/main/java/org/apache/commons/lang3/ClassUtils.java
438
[ "cls", "valueIfNull" ]
String
true
3
8.08
apache/commons-lang
2,896
javadoc
false
bean
<T> T bean(Class<T> beanClass) throws BeansException;
Return the bean instance that uniquely matches the given type, if any. @param beanClass the type the bean must match; can be an interface or superclass @return an instance of the single bean matching the bean type @see BeanFactory#getBean(String)
java
spring-beans/src/main/java/org/springframework/beans/factory/BeanRegistry.java
230
[ "beanClass" ]
T
true
1
6.32
spring-projects/spring-framework
59,386
javadoc
false
castArray
function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; }
Casts `value` as an array if it's not one. @static @memberOf _ @since 4.4.0 @category Lang @param {*} value The value to inspect. @returns {Array} Returns the cast array. @example _.castArray(1); // => [1] _.castArray({ 'a': 1 }); // => [{ 'a': 1 }] _.castArray('abc'); // => ['abc'] _.castArray(null); // => [null] _.ca...
javascript
lodash.js
11,102
[]
false
3
8.72
lodash/lodash
61,490
jsdoc
false
describeConsumerGroups
default DescribeConsumerGroupsResult describeConsumerGroups(Collection<String> groupIds) { return describeConsumerGroups(groupIds, new DescribeConsumerGroupsOptions()); }
Describe some consumer groups in the cluster, with the default options. <p> This is a convenience method for {@link #describeConsumerGroups(Collection, DescribeConsumerGroupsOptions)} with default options. See the overload for more details. @param groupIds The IDs of the groups to describe. @return The DescribeConsumer...
java
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
876
[ "groupIds" ]
DescribeConsumerGroupsResult
true
1
6.32
apache/kafka
31,560
javadoc
false
enable_history_recording
def enable_history_recording() -> Generator[None, None, None]: "Turns on history recording in the CUDA Caching Allocator" enabled = torch._C._cuda_isHistoryEnabled() try: if not enabled: torch.cuda.memory._record_memory_history() yield finally: if not enabled: ...
"Turns on history recording in the CUDA Caching Allocator"
python
torch/_inductor/cudagraph_trees.py
168
[]
Generator[None, None, None]
true
3
6.24
pytorch/pytorch
96,034
unknown
false
isin
def isin(self, values: ArrayLike) -> npt.NDArray[np.bool_]: """ Check whether `values` are contained in Categorical. Return a boolean NumPy Array showing whether each element in the Categorical matches an element in the passed sequence of `values` exactly. Parameters ...
Check whether `values` are contained in Categorical. Return a boolean NumPy Array showing whether each element in the Categorical matches an element in the passed sequence of `values` exactly. Parameters ---------- values : np.ndarray or ExtensionArray The sequence of values to test. Passing in a single string wi...
python
pandas/core/arrays/categorical.py
2,695
[ "self", "values" ]
npt.NDArray[np.bool_]
true
1
7.12
pandas-dev/pandas
47,362
numpy
false
matchesPattern
public static void matchesPattern(final CharSequence input, final String pattern, final String message, final Object... values) { // TODO when breaking BC, consider returning input if (!Pattern.matches(pattern, input)) { throw new IllegalArgumentException(getMessage(message, values)); ...
Validate that the specified argument character sequence matches the specified regular expression pattern; otherwise throwing an exception with the specified message. <pre>Validate.matchesPattern("hi", "[a-z]*", "%s does not match %s", "hi" "[a-z]*");</pre> <p>The syntax of the pattern is the one used in the {@link Patt...
java
src/main/java/org/apache/commons/lang3/Validate.java
637
[ "input", "pattern", "message" ]
void
true
2
6.56
apache/commons-lang
2,896
javadoc
false
getDouble
public double getDouble(String name) throws JSONException { Object object = get(name); Double result = JSON.toDouble(object); if (result == null) { throw JSON.typeMismatch(name, object, "double"); } return result; }
Returns the value mapped by {@code name} if it exists and is a double or can be coerced to a double. @param name the name of the property @return the value @throws JSONException if the mapping doesn't exist or cannot be coerced to a double.
java
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java
435
[ "name" ]
true
2
8.24
spring-projects/spring-boot
79,428
javadoc
false
whenTrue
public Source<T> whenTrue() { return when(Boolean.TRUE::equals); }
Return a filtered version of the source that will only map values that are {@code true}. @return a new filtered source instance
java
core/spring-boot/src/main/java/org/springframework/boot/context/properties/PropertyMapper.java
216
[]
true
1
6.8
spring-projects/spring-boot
79,428
javadoc
false
cumprod
def cumprod(a, axis=None, dtype=None, out=None): """ Return the cumulative product of elements along a given axis. Parameters ---------- a : array_like Input array. axis : int, optional Axis along which the cumulative product is computed. By default the input is flatten...
Return the cumulative product of elements along a given axis. Parameters ---------- a : array_like Input array. axis : int, optional Axis along which the cumulative product is computed. By default the input is flattened. dtype : dtype, optional Type of the returned array, as well as of the accumulator...
python
numpy/_core/fromnumeric.py
3,413
[ "a", "axis", "dtype", "out" ]
false
1
6.24
numpy/numpy
31,054
numpy
false
formatSplitTime
public String formatSplitTime() { return DurationFormatUtils.formatDurationHMS(getSplitDuration().toMillis()); }
Formats the split time with {@link DurationFormatUtils#formatDurationHMS}. @return the split time formatted by {@link DurationFormatUtils#formatDurationHMS}. @since 3.10
java
src/main/java/org/apache/commons/lang3/time/StopWatch.java
329
[]
String
true
1
6.16
apache/commons-lang
2,896
javadoc
false
step
def step(self) -> int: """ The value of the `step` parameter (``1`` if this was not supplied). The ``step`` parameter determines the increment (or decrement in the case of negative values) between consecutive elements in the ``RangeIndex``. See Also -------- Ran...
The value of the `step` parameter (``1`` if this was not supplied). The ``step`` parameter determines the increment (or decrement in the case of negative values) between consecutive elements in the ``RangeIndex``. See Also -------- RangeIndex : Immutable index implementing a range-based index. RangeIndex.stop : Retur...
python
pandas/core/indexes/range.py
372
[ "self" ]
int
true
1
7.28
pandas-dev/pandas
47,362
unknown
false