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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
finish | inline cl_int finish(void)
{
cl_int error;
CommandQueue queue = CommandQueue::getDefault(&error);
if (error != CL_SUCCESS) {
return error;
}
return queue.finish();
} | Blocking copy operation between iterators and a buffer. | cpp | 3rdparty/include/opencl/1.2/CL/cl.hpp | 6,547 | [] | true | 2 | 6.4 | opencv/opencv | 85,374 | doxygen | false | |
create | public static URL create(File file, String nestedEntryName) {
return create(file, nestedEntryName, null);
} | Create a new jar URL.
@param file the jar file
@param nestedEntryName the nested entry name or {@code null}
@return a jar file URL | java | loader/spring-boot-loader/src/main/java/org/springframework/boot/loader/net/protocol/jar/JarUrl.java | 60 | [
"file",
"nestedEntryName"
] | URL | true | 1 | 6.48 | spring-projects/spring-boot | 79,428 | javadoc | false |
initializeFrozenIntrinsics | function initializeFrozenIntrinsics() {
if (getOptionValue('--frozen-intrinsics')) {
emitExperimentalWarning('Frozen intristics');
require('internal/freeze_intrinsics')();
}
} | Patch the process object with legacy properties and normalizations.
Replace `process.argv[0]` with `process.execPath`, preserving the original `argv[0]` value as `process.argv0`.
Replace `process.argv[1]` with the resolved absolute file path of the entry point, if found.
@param {boolean} expandArgv1 - Whether to replac... | javascript | lib/internal/process/pre_execution.js | 689 | [] | false | 2 | 6.8 | nodejs/node | 114,839 | jsdoc | false | |
getBeanFactory | @Override
public final ConfigurableListableBeanFactory getBeanFactory() {
DefaultListableBeanFactory beanFactory = this.beanFactory;
if (beanFactory == null) {
throw new IllegalStateException("BeanFactory not initialized or already closed - " +
"call 'refresh' before accessing beans via the ApplicationCont... | Determine whether this context currently holds a bean factory,
i.e. has been refreshed at least once and not been closed yet. | java | spring-context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java | 163 | [] | ConfigurableListableBeanFactory | true | 2 | 7.04 | spring-projects/spring-framework | 59,386 | javadoc | false |
customOmitClone | function customOmitClone(value) {
return isPlainObject(value) ? undefined : value;
} | Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
objects.
@private
@param {*} value The value to inspect.
@param {string} key The key of the property to inspect.
@returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. | javascript | lodash.js | 5,697 | [
"value"
] | false | 2 | 6 | lodash/lodash | 61,490 | jsdoc | false | |
slice_replace | def slice_replace(self, start=None, stop=None, repl=None):
"""
Replace a positional slice of a string with another value.
This function allows replacing specific parts of a string in a Series
or Index by specifying start and stop positions. It is useful for
modifying substrings ... | Replace a positional slice of a string with another value.
This function allows replacing specific parts of a string in a Series
or Index by specifying start and stop positions. It is useful for
modifying substrings in a controlled way, such as updating sections of
text based on their positions or patterns.
Parameter... | python | pandas/core/strings/accessor.py | 2,040 | [
"self",
"start",
"stop",
"repl"
] | false | 1 | 6.4 | pandas-dev/pandas | 47,362 | numpy | false | |
sendPrefetches | private void sendPrefetches(Timer timer) {
try {
applicationEventHandler.add(new CreateFetchRequestsEvent(calculateDeadlineMs(timer)));
} catch (Throwable t) {
// Any unexpected errors will be logged for troubleshooting, but not thrown.
log.warn("An unexpected error o... | This method signals the background thread to {@link CreateFetchRequestsEvent create fetch requests} for the
pre-fetch case, i.e. right before {@link #poll(Duration)} exits. In the pre-fetch case, the application thread
will not wait for confirmation of the request creation before continuing.
<p/>
At the point this meth... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java | 1,995 | [
"timer"
] | void | true | 2 | 6.88 | apache/kafka | 31,560 | javadoc | false |
_shared_cache_lockfile | def _shared_cache_lockfile(self) -> Path:
"""Get the lock file path for the shared memoizer cache.
Returns:
The path to the lock file for the shared cache.
"""
return Path(cache_dir()) / "memoizer_cache.lock" | Get the lock file path for the shared memoizer cache.
Returns:
The path to the lock file for the shared cache. | python | torch/_inductor/runtime/caching/interfaces.py | 280 | [
"self"
] | Path | true | 1 | 6.4 | pytorch/pytorch | 96,034 | unknown | false |
spawnSync | function spawnSync(file, args, options) {
options = {
__proto__: null,
maxBuffer: MAX_BUFFER,
...normalizeSpawnArguments(file, args, options),
};
debug('spawnSync', options);
// Validate the timeout, if present.
validateTimeout(options.timeout);
// Validate maxBuffer, if present.
validateMa... | Spawns a new process synchronously using the given `file`.
@param {string} file
@param {string[]} [args]
@param {{
cwd?: string | URL;
input?: string | Buffer | TypedArray | DataView;
argv0?: string;
stdio?: string | Array;
env?: Record<string, string>;
uid?: number;
gid?: number;
timeout?: number;
ki... | javascript | lib/child_process.js | 866 | [
"file",
"args",
"options"
] | false | 9 | 6.96 | nodejs/node | 114,839 | jsdoc | false | |
_setitem_single_column | def _setitem_single_column(self, loc: int, value, plane_indexer) -> None:
"""
Parameters
----------
loc : int
Indexer for column position
plane_indexer : int, slice, listlike[int]
The indexer we use for setitem along axis=0.
"""
pi = plane... | Parameters
----------
loc : int
Indexer for column position
plane_indexer : int, slice, listlike[int]
The indexer we use for setitem along axis=0. | python | pandas/core/indexing.py | 2,122 | [
"self",
"loc",
"value",
"plane_indexer"
] | None | true | 10 | 6.48 | pandas-dev/pandas | 47,362 | numpy | false |
get_slice_bound | def get_slice_bound(
self,
label: Hashable | Sequence[Hashable],
side: Literal["left", "right"],
) -> int:
"""
For an ordered MultiIndex, compute slice bound
that corresponds to given label.
Returns leftmost (one-past-the-rightmost if `side=='right') position... | For an ordered MultiIndex, compute slice bound
that corresponds to given label.
Returns leftmost (one-past-the-rightmost if `side=='right') position
of given label.
Parameters
----------
label : object or tuple of objects
side : {'left', 'right'}
Returns
-------
int
Index of label.
Notes
-----
This method only ... | python | pandas/core/indexes/multi.py | 3,083 | [
"self",
"label",
"side"
] | int | true | 2 | 8.32 | pandas-dev/pandas | 47,362 | numpy | false |
closeWhileHandlingException | public static void closeWhileHandlingException(Releasable... releasables) {
for (final Releasable releasable : releasables) {
try {
close(releasable);
} catch (RuntimeException e) {
// ignored
}
}
} | Release the provided {@link Releasable}s, ignoring exceptions. | java | libs/core/src/main/java/org/elasticsearch/core/Releasables.java | 80 | [] | void | true | 2 | 6.56 | elastic/elasticsearch | 75,680 | javadoc | false |
hasSignedLibrary | private boolean hasSignedLibrary(Map<String, Library> writtenLibraries) throws IOException {
for (Library library : writtenLibraries.values()) {
if (!(library instanceof JarModeLibrary) && FileUtils.isSignedJarFile(library.getFile())) {
return true;
}
}
return false;
} | Create a new {@link Repackager} instance.
@param source the source archive file to package | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java | 63 | [
"writtenLibraries"
] | true | 3 | 6.88 | spring-projects/spring-boot | 79,428 | javadoc | false | |
intersection | public static ClassFilter intersection(ClassFilter[] classFilters) {
Assert.notEmpty(classFilters, "ClassFilter array must not be empty");
return new IntersectionClassFilter(classFilters);
} | Match all classes that <i>all</i> of the given ClassFilters match.
@param classFilters the ClassFilters to match
@return a distinct ClassFilter that matches all classes that both
of the given ClassFilter match | java | spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java | 85 | [
"classFilters"
] | ClassFilter | true | 1 | 6.48 | spring-projects/spring-framework | 59,386 | javadoc | false |
ensureOpenForRecordBatchWrite | private void ensureOpenForRecordBatchWrite() {
if (isClosed())
throw new IllegalStateException("Tried to write record batch header, but MemoryRecordsBuilder is closed");
if (aborted)
throw new IllegalStateException("Tried to write record batch header, but MemoryRecordsBuilder is ... | Append the record at the next consecutive offset. If no records have been appended yet, use the base
offset of this builder.
@param record The record to add | java | clients/src/main/java/org/apache/kafka/common/record/MemoryRecordsBuilder.java | 809 | [] | void | true | 3 | 7.04 | apache/kafka | 31,560 | javadoc | false |
below | public static JavaUnicodeEscaper below(final int codePoint) {
return outsideOf(codePoint, Integer.MAX_VALUE);
} | Constructs a {@link JavaUnicodeEscaper} below the specified value (exclusive).
@param codePoint
below which to escape.
@return the newly created {@link UnicodeEscaper} instance. | java | src/main/java/org/apache/commons/lang3/text/translate/JavaUnicodeEscaper.java | 48 | [
"codePoint"
] | JavaUnicodeEscaper | true | 1 | 6.16 | apache/commons-lang | 2,896 | javadoc | false |
alias | @Nullable String alias(); | The alias used when setting entries in the {@link KeyStore}.
@return the alias | java | core/spring-boot/src/main/java/org/springframework/boot/ssl/pem/PemSslStore.java | 51 | [] | String | true | 1 | 6.48 | spring-projects/spring-boot | 79,428 | javadoc | false |
usingExtractedPairs | public <E, N, V> Member<T> usingExtractedPairs(BiConsumer<T, Consumer<E>> elements,
Function<E, N> nameExtractor, Function<E, V> valueExtractor) {
Assert.notNull(elements, "'elements' must not be null");
Assert.notNull(nameExtractor, "'nameExtractor' must not be null");
Assert.notNull(valueExtractor, "'val... | Add JSON name/value pairs by extracting values from a series of elements.
Typically used with a {@link Iterable#forEach(Consumer)} call, for example:
<pre class="code">
members.add(Event::getTags).usingExtractedPairs(Iterable::forEach, Tag::getName, Tag::getValue);
</pre>
<p>
When used with a named member, the pairs wi... | java | core/spring-boot/src/main/java/org/springframework/boot/json/JsonWriter.java | 541 | [
"elements",
"nameExtractor",
"valueExtractor"
] | true | 1 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false | |
SocketAddress | SocketAddress(const char* host, uint16_t port, bool allowNameLookup = false) {
// Initialize the address family first,
// since setFromHostPort() and setFromIpPort() will check it.
if (allowNameLookup) {
setFromHostPort(host, port);
} else {
setFromIpPort(host, port);
}
} | Construct a SocketAddress from a hostname and port.
Note: If the host parameter is not a numeric IP address, hostname
resolution will be performed, which can be quite slow.
Raises std::system_error on error.
@param host The IP address (or hostname, if allowNameLookup is true)
@param port The port (in host byte order)
@... | cpp | folly/SocketAddress.h | 65 | [
"port"
] | true | 3 | 6.88 | facebook/folly | 30,157 | doxygen | false | |
rebuildHashTable | static @Nullable Object[] rebuildHashTable(int newTableSize, Object[] elements, int n) {
@Nullable Object[] hashTable = new @Nullable Object[newTableSize];
int mask = hashTable.length - 1;
for (int i = 0; i < n; i++) {
// requireNonNull is safe because we ensure that the first n elements have ... | Builds a new open-addressed hash table from the first n objects in elements. | java | guava/src/com/google/common/collect/ImmutableSet.java | 830 | [
"newTableSize",
"elements",
"n"
] | true | 4 | 6 | google/guava | 51,352 | javadoc | false | |
clientInstanceId | @Override
public Uuid clientInstanceId(Duration timeout) {
if (clientTelemetryReporter.isEmpty()) {
throw new IllegalStateException("Telemetry is not enabled. Set config `" + ConsumerConfig.ENABLE_METRICS_PUSH_CONFIG + "` to `true`.");
}
return ClientTelemetryUtils.fetchClientIn... | This method sends a commit event to the EventHandler and waits for
the event to finish.
@param timeout max wait time for the blocking operation. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java | 1,751 | [
"timeout"
] | Uuid | true | 2 | 6.72 | apache/kafka | 31,560 | javadoc | false |
getVars | private static List<ConfigVariable> getVars(String value, Pattern pattern) {
List<ConfigVariable> configVars = new ArrayList<>();
Matcher matcher = pattern.matcher(value);
while (matcher.find()) {
configVars.add(new ConfigVariable(matcher));
}
return configVars;
} | Transforms the given configuration data by using the {@link ConfigProvider} instances to
look up values to replace the variables in the pattern.
@param configs the configuration values to be transformed
@return an instance of {@link ConfigTransformerResult} | java | clients/src/main/java/org/apache/kafka/common/config/ConfigTransformer.java | 124 | [
"value",
"pattern"
] | true | 2 | 7.28 | apache/kafka | 31,560 | javadoc | false | |
make_flex_doc | def make_flex_doc(op_name: str, typ: str) -> str:
"""
Make the appropriate substitutions for the given operation and class-typ
into either _flex_doc_SERIES or _flex_doc_FRAME to return the docstring
to attach to a generated method.
Parameters
----------
op_name : str {'__add__', '__sub__', ... | Make the appropriate substitutions for the given operation and class-typ
into either _flex_doc_SERIES or _flex_doc_FRAME to return the docstring
to attach to a generated method.
Parameters
----------
op_name : str {'__add__', '__sub__', ... '__eq__', '__ne__', ...}
typ : str {series, 'dataframe']}
Returns
-------
doc... | python | pandas/core/ops/docstrings.py | 8 | [
"op_name",
"typ"
] | str | true | 12 | 6.64 | pandas-dev/pandas | 47,362 | numpy | false |
listTopics | ListTopicsResult listTopics(ListTopicsOptions options); | List the topics available in the cluster.
@param options The options to use when listing the topics.
@return The ListTopicsResult. | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 284 | [
"options"
] | ListTopicsResult | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false |
canRetry | synchronized boolean canRetry(ProduceResponse.PartitionResponse response, ProducerBatch batch) {
Errors error = response.error;
// An UNKNOWN_PRODUCER_ID means that we have lost the producer state on the broker. Depending on the log start
// offset, we may want to retry these, as described for ... | Returns the first inflight sequence for a given partition. This is the base sequence of an inflight batch with
the lowest sequence number.
@return the lowest inflight sequence if the transaction manager is tracking inflight requests for this partition.
If there are no inflight requests being tracked for this pa... | java | clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java | 1,017 | [
"response",
"batch"
] | true | 14 | 6.8 | apache/kafka | 31,560 | javadoc | false | |
na_value_for_dtype | def na_value_for_dtype(dtype: DtypeObj, compat: bool = True):
"""
Return a dtype compat na value
Parameters
----------
dtype : string / dtype
compat : bool, default True
Returns
-------
np.dtype or a pandas dtype
Examples
--------
>>> na_value_for_dtype(np.dtype("int64... | Return a dtype compat na value
Parameters
----------
dtype : string / dtype
compat : bool, default True
Returns
-------
np.dtype or a pandas dtype
Examples
--------
>>> na_value_for_dtype(np.dtype("int64"))
0
>>> na_value_for_dtype(np.dtype("int64"), compat=False)
nan
>>> na_value_for_dtype(np.dtype("float64"))
nan
... | python | pandas/core/dtypes/missing.py | 603 | [
"dtype",
"compat"
] | true | 8 | 7.36 | pandas-dev/pandas | 47,362 | numpy | false | |
install_gcc_via_conda | def install_gcc_via_conda() -> str:
"""On older systems, this is a quick way to get a modern compiler"""
prefix = os.path.join(cache_dir(), "gcc")
cxx_path = os.path.join(prefix, "bin", "g++")
if not os.path.exists(cxx_path):
log.info("Downloading GCC via conda")
conda = os.environ.get("... | On older systems, this is a quick way to get a modern compiler | python | torch/_inductor/cpp_builder.py | 108 | [] | str | true | 4 | 6.56 | pytorch/pytorch | 96,034 | unknown | false |
validate_docs_version | def validate_docs_version() -> None:
"""
Validate the versions of documentation packages in the specified directory.
This script checks the versions of documentation packages in the published directory
when we publish and add back-references to the documentation. the directory is expected to be structu... | Validate the versions of documentation packages in the specified directory.
This script checks the versions of documentation packages in the published directory
when we publish and add back-references to the documentation. the directory is expected to be structured like:
docs-archive/
apache-airflow/
... | python | dev/breeze/src/airflow_breeze/utils/docs_version_validation.py | 39 | [] | None | true | 8 | 6.24 | apache/airflow | 43,597 | unknown | false |
getBeans | private static Map<String, Object> getBeans(ListableBeanFactory beanFactory, @Nullable String qualifier) {
Map<String, Object> beans = new LinkedHashMap<>();
beans.putAll(getBeans(beanFactory, Printer.class, qualifier));
beans.putAll(getBeans(beanFactory, Parser.class, qualifier));
beans.putAll(getBeans(beanFac... | Add {@link Printer}, {@link Parser}, {@link Formatter}, {@link Converter},
{@link ConverterFactory}, {@link GenericConverter}, and beans from the specified
bean factory.
@param registry the service to register beans with
@param beanFactory the bean factory to get the beans from
@param qualifier the qualifier required o... | java | core/spring-boot/src/main/java/org/springframework/boot/convert/ApplicationConversionService.java | 333 | [
"beanFactory",
"qualifier"
] | true | 1 | 6.56 | spring-projects/spring-boot | 79,428 | javadoc | false | |
names | public JSONArray names() {
return this.nameValuePairs.isEmpty() ? null : new JSONArray(new ArrayList<>(this.nameValuePairs.keySet()));
} | Returns an array containing the string names in this object. This method returns
null if this object contains no mappings.
@return the array | java | cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java | 688 | [] | JSONArray | true | 2 | 8.16 | spring-projects/spring-boot | 79,428 | javadoc | false |
size | public int size() {
return bitSet.size();
} | Returns the number of bits of space actually in use by this {@link BitSet} to represent bit values. The maximum
element in the set is the size - 1st element.
@return the number of bits currently in this bit set. | java | src/main/java/org/apache/commons/lang3/util/FluentBitSet.java | 509 | [] | true | 1 | 6.8 | apache/commons-lang | 2,896 | javadoc | false | |
asSupplier | public static <T> Supplier<T> asSupplier(final FailableSupplier<T, ?> supplier) {
return () -> get(supplier);
} | Converts the given {@link FailableSupplier} into a standard {@link Supplier}.
@param <T> the type supplied by the suppliers
@param supplier a {@link FailableSupplier}
@return a standard {@link Supplier} | java | src/main/java/org/apache/commons/lang3/function/Failable.java | 383 | [
"supplier"
] | true | 1 | 6 | apache/commons-lang | 2,896 | javadoc | false | |
openBufferedStream | public InputStream openBufferedStream() throws IOException {
InputStream in = openStream();
return (in instanceof BufferedInputStream)
? (BufferedInputStream) in
: new BufferedInputStream(in);
} | Opens a new buffered {@link InputStream} for reading from this source. The returned stream is
not required to be a {@link BufferedInputStream} in order to allow implementations to simply
delegate to {@link #openStream()} when the stream returned by that method does not benefit from
additional buffering (for example, a ... | java | android/guava/src/com/google/common/io/ByteSource.java | 118 | [] | InputStream | true | 2 | 6.72 | google/guava | 51,352 | javadoc | false |
copyCustomPrologue | function copyCustomPrologue(source: readonly Statement[], target: Statement[], statementOffset: number | undefined, visitor?: (node: Node) => VisitResult<Node>, filter: (node: Statement) => boolean = returnTrue): number | undefined {
const numStatements = source.length;
while (statementOffset !== unde... | Copies only the custom prologue-directives into target statement-array.
@param source origin statements array
@param target result statements array
@param statementOffset The offset at which to begin the copy.
@param visitor Optional callback used to visit any custom prologue directives. | typescript | src/compiler/factory/nodeFactory.ts | 6,924 | [
"source",
"target",
"statementOffset",
"visitor?",
"filter"
] | true | 7 | 6.24 | microsoft/TypeScript | 107,154 | jsdoc | false | |
toString | @Override
public String toString() {
if (!hasTransaction()) {
return "";
}
return producerId + ":" + epoch;
} | Returns a serialized string representation of this transaction state.
The format is "producerId:epoch" for an initialized state, or an empty string
for an uninitialized state (where producerId and epoch are both -1).
@return a serialized string representation | java | clients/src/main/java/org/apache/kafka/clients/producer/PreparedTxnState.java | 105 | [] | String | true | 2 | 7.28 | apache/kafka | 31,560 | javadoc | false |
hexRingSize | public static int hexRingSize(long h3) {
return H3Index.H3_is_pentagon(h3) ? 5 : 6;
} | Returns the number of neighbor indexes.
@param h3 Origin index
@return the number of neighbor indexes from the origin | java | libs/h3/src/main/java/org/elasticsearch/h3/H3.java | 379 | [
"h3"
] | true | 2 | 8 | elastic/elasticsearch | 75,680 | javadoc | false | |
byBrokerId | public KafkaFuture<Map<Integer, KafkaFuture<Collection<TransactionListing>>>> byBrokerId() {
KafkaFutureImpl<Map<Integer, KafkaFuture<Collection<TransactionListing>>>> result = new KafkaFutureImpl<>();
future.whenComplete((brokerFutures, exception) -> {
if (brokerFutures != null) {
... | Get a future which returns a map containing the underlying listing future for each broker
in the cluster. This is useful, for example, if a partial listing of transactions is
sufficient, or if you want more granular error details.
@return A future containing a map of futures by broker which complete individually when
... | java | clients/src/main/java/org/apache/kafka/clients/admin/ListTransactionsResult.java | 68 | [] | true | 2 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
removeRaftVoter | @Override
public RemoveRaftVoterResult removeRaftVoter(
int voterId,
Uuid voterDirectoryId,
RemoveRaftVoterOptions options
) {
NodeProvider provider = new LeastLoadedBrokerOrActiveKController();
final KafkaFutureImpl<Void> future = new KafkaFutureImpl<>();
final ... | Forcefully terminates an ongoing transaction for a given transactional ID.
<p>
This API is intended for well-formed but long-running transactions that are known to the
transaction coordinator. It is primarily designed for supporting 2PC (two-phase commit) workflows,
where a coordinator may need to unilaterally terminat... | java | clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java | 5,013 | [
"voterId",
"voterDirectoryId",
"options"
] | RemoveRaftVoterResult | true | 2 | 7.44 | apache/kafka | 31,560 | javadoc | false |
start_go_pipeline | def start_go_pipeline(
self,
variables: dict,
go_file: str,
process_line_callback: Callable[[str], None] | None = None,
should_init_module: bool = False,
) -> None:
"""
Start Apache Beam Go pipeline with a source file.
:param variables: Variables pass... | Start Apache Beam Go pipeline with a source file.
:param variables: Variables passed to the job.
:param go_file: Path to the Go file with your beam pipeline.
:param process_line_callback: (optional) Callback that can be used to process each line of
the stdout and stderr file descriptors.
:param should_init_module:... | python | providers/apache/beam/src/airflow/providers/apache/beam/hooks/beam.py | 352 | [
"self",
"variables",
"go_file",
"process_line_callback",
"should_init_module"
] | None | true | 4 | 8.08 | apache/airflow | 43,597 | sphinx | false |
resolveArgumentValue | private ValueHolder resolveArgumentValue(BeanDefinitionValueResolver resolver, ValueHolder valueHolder) {
if (valueHolder.isConverted()) {
return valueHolder;
}
Object value = resolver.resolveValueIfNecessary("constructor argument", valueHolder.getValue());
ValueHolder resolvedHolder = new ValueHolder(value,... | Resolve arguments for the specified registered bean.
@param registeredBean the registered bean
@return the resolved constructor or factory method arguments | java | spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanInstanceSupplier.java | 318 | [
"resolver",
"valueHolder"
] | ValueHolder | true | 2 | 7.28 | spring-projects/spring-framework | 59,386 | javadoc | false |
lookupTopicId | private TopicIdPartition lookupTopicId(Uuid topicId, int partitionIndex) {
String topicName = metadata.topicNames().get(topicId);
if (topicName == null) {
topicName = topicNamesMap.remove(new IdAndPartition(topicId, partitionIndex));
}
if (topicName == null) {
log... | The method checks whether the leader for a topicIdPartition has changed.
@param nodeId The previous leader for the partition.
@param topicIdPartition The TopicIdPartition to check.
@return Returns true if leader information is available and leader has changed.
If the leader information is not available or if the leader... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java | 1,112 | [
"topicId",
"partitionIndex"
] | TopicIdPartition | true | 3 | 7.92 | apache/kafka | 31,560 | javadoc | false |
removeFrom | FileTime removeFrom(FileTime time) {
return FileTime.fromMillis(removeFrom(time.toMillis()));
} | Remove the default offset from the given time.
@param time the time to remove the default offset from
@return the time with the default offset removed | java | loader/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/DefaultTimeZoneOffset.java | 45 | [
"time"
] | FileTime | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false |
accept | public static <T> void accept(final Consumer<T> consumer, final T object) {
if (consumer != null) {
consumer.accept(object);
}
} | Applies the given {@link Consumer} action to the object if the consumer is not {@code null}. Otherwise, does nothing.
@param consumer the consumer to consume.
@param object the object to be consumed.
@param <T> the type of the argument the consumer accepts.
@since 3.15.0 | java | src/main/java/org/apache/commons/lang3/function/Consumers.java | 42 | [
"consumer",
"object"
] | void | true | 2 | 6.88 | apache/commons-lang | 2,896 | javadoc | false |
partitionEndOffset | public synchronized Long partitionEndOffset(TopicPartition tp, IsolationLevel isolationLevel) {
TopicPartitionState topicPartitionState = assignedState(tp);
if (isolationLevel == IsolationLevel.READ_COMMITTED) {
return topicPartitionState.lastStableOffset;
} else {
return... | Attempt to complete validation with the end offset returned from the OffsetForLeaderEpoch request.
@return Log truncation details if detected and no reset policy is defined. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java | 651 | [
"tp",
"isolationLevel"
] | Long | true | 2 | 6.4 | apache/kafka | 31,560 | javadoc | false |
copy | @CanIgnoreReturnValue
public static long copy(Readable from, Appendable to) throws IOException {
// The most common case is that from is a Reader (like InputStreamReader or StringReader) so
// take advantage of that.
if (from instanceof Reader) {
// optimize for common output types which are optimiz... | Copies all characters between the {@link Readable} and {@link Appendable} objects. Does not
close or flush either object.
@param from the object to read from
@param to the object to write to
@return the number of characters copied
@throws IOException if an I/O error occurs | java | android/guava/src/com/google/common/io/CharStreams.java | 65 | [
"from",
"to"
] | true | 4 | 8.4 | google/guava | 51,352 | javadoc | false | |
findMethodWithMinimalParameters | public static @Nullable Method findMethodWithMinimalParameters(Method[] methods, String methodName)
throws IllegalArgumentException {
Method targetMethod = null;
int numMethodsFoundWithCurrentMinimumArgs = 0;
for (Method method : methods) {
if (method.getName().equals(methodName)) {
int numParams = met... | Find a method with the given method name and minimal parameters (best case: none)
in the given list of methods.
@param methods the methods to check
@param methodName the name of the method to find
@return the Method object, or {@code null} if not found
@throws IllegalArgumentException if methods of the given name were ... | java | spring-beans/src/main/java/org/springframework/beans/BeanUtils.java | 401 | [
"methods",
"methodName"
] | Method | true | 8 | 7.92 | spring-projects/spring-framework | 59,386 | javadoc | false |
automaticConfigProvidersFilter | private Predicate<String> automaticConfigProvidersFilter() {
String systemProperty = System.getProperty(AUTOMATIC_CONFIG_PROVIDERS_PROPERTY);
if (systemProperty == null) {
return ignored -> true;
} else {
return Arrays.stream(systemProperty.split(","))
... | Instantiates given list of config providers and fetches the actual values of config variables from the config providers.
returns a map of config key and resolved values.
@param configProviderProps The map of config provider configs
@param originals The map of raw configs.
@return map of resolved config variab... | java | clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java | 567 | [] | true | 2 | 7.92 | apache/kafka | 31,560 | javadoc | false | |
getSymlinkCache | function getSymlinkCache(): SymlinkCache {
if (host.getSymlinkCache) {
return host.getSymlinkCache();
}
if (!symlinks) {
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
}
if (files && !symlinks.hasProcessedResolutions()) {
... | Get the referenced project if the file is input file from that reference project | typescript | src/compiler/program.ts | 4,751 | [] | true | 5 | 6.56 | microsoft/TypeScript | 107,154 | jsdoc | false | |
_get_hooks_with_mocked_fab | def _get_hooks_with_mocked_fab() -> tuple[
MutableMapping[str, HookInfo | None], dict[str, ConnectionFormWidgetInfo], dict[str, dict]
]:
"""Get hooks with all details w/o FAB needing to be installed."""
from unittest import mock
from airflow.providers_manager import ProvidersManager... | Get hooks with all details w/o FAB needing to be installed. | python | airflow-core/src/airflow/api_fastapi/core_api/services/ui/connections.py | 119 | [] | tuple[
MutableMapping[str, HookInfo | None], dict[str, ConnectionFormWidgetInfo], dict[str, dict]
] | true | 3 | 6.96 | apache/airflow | 43,597 | unknown | false |
collectFetch | public Fetch<K, V> collectFetch(final FetchBuffer fetchBuffer) {
final Fetch<K, V> fetch = Fetch.empty();
final Queue<CompletedFetch> pausedCompletedFetches = new ArrayDeque<>();
int recordsRemaining = fetchConfig.maxPollRecords;
try {
while (recordsRemaining > 0) {
... | Return the fetched {@link ConsumerRecord records}, empty the {@link FetchBuffer record buffer}, and
update the consumed position.
</p>
NOTE: returning an {@link Fetch#empty() empty} fetch guarantees the consumed position is not updated.
@param fetchBuffer {@link FetchBuffer} from which to retrieve the {@link ConsumerRe... | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchCollector.java | 92 | [
"fetchBuffer"
] | true | 12 | 7.6 | apache/kafka | 31,560 | javadoc | false | |
leggauss | def leggauss(deg):
"""
Gauss-Legendre quadrature.
Computes the sample points and weights for Gauss-Legendre quadrature.
These sample points and weights will correctly integrate polynomials of
degree :math:`2*deg - 1` or less over the interval :math:`[-1, 1]` with
the weight function :math:`f(x)... | Gauss-Legendre quadrature.
Computes the sample points and weights for Gauss-Legendre quadrature.
These sample points and weights will correctly integrate polynomials of
degree :math:`2*deg - 1` or less over the interval :math:`[-1, 1]` with
the weight function :math:`f(x) = 1`.
Parameters
----------
deg : int
Num... | python | numpy/polynomial/legendre.py | 1,470 | [
"deg"
] | false | 2 | 6.24 | numpy/numpy | 31,054 | numpy | false | |
hashCode | @Override
public int hashCode() {
int normalizedScale = normalizeScale(index(), scale);
int scaleAdjustment = normalizedScale - scale;
long normalizedIndex = adjustScale(index(), scale, scaleAdjustment);
int result = normalizedScale;
result = 31 * result + Long.hashCode(norm... | Collapses all buckets from the given iterator whose lower boundaries are smaller than the zero threshold.
The iterator is advanced to point at the first, non-collapsed bucket.
@param buckets The iterator whose buckets may be collapsed.
@return A potentially updated {@link ZeroBucket} with the collapsed buckets' counts ... | java | libs/exponential-histogram/src/main/java/org/elasticsearch/exponentialhistogram/ZeroBucket.java | 279 | [] | true | 1 | 6.72 | elastic/elasticsearch | 75,680 | javadoc | false | |
refresh_from_db | def refresh_from_db(
self, session: Session = NEW_SESSION, lock_for_update: bool = False, keep_local_changes: bool = False
) -> None:
"""
Refresh the task instance from the database based on the primary key.
:param session: SQLAlchemy ORM Session
:param lock_for_update: if T... | Refresh the task instance from the database based on the primary key.
:param session: SQLAlchemy ORM Session
:param lock_for_update: if True, indicates that the database should
lock the TaskInstance (issuing a FOR UPDATE clause) until the
session is committed.
:param keep_local_changes: Force all attributes to... | python | airflow-core/src/airflow/models/taskinstance.py | 670 | [
"self",
"session",
"lock_for_update",
"keep_local_changes"
] | None | true | 13 | 6.72 | apache/airflow | 43,597 | sphinx | false |
compareModuleSpecifierRelativity | function compareModuleSpecifierRelativity(a: ImportFixWithModuleSpecifier, b: ImportFixWithModuleSpecifier, preferences: UserPreferences): Comparison {
if (preferences.importModuleSpecifierPreference === "non-relative" || preferences.importModuleSpecifierPreference === "project-relative") {
return compare... | @returns `Comparison.LessThan` if `a` is better than `b`. | typescript | src/services/codefixes/importFixes.ts | 1,442 | [
"a",
"b",
"preferences"
] | true | 3 | 6.4 | microsoft/TypeScript | 107,154 | jsdoc | false | |
getFormattedExceptionMessage | @Override
public String getFormattedExceptionMessage(final String baseMessage) {
final StringBuilder buffer = new StringBuilder(256);
if (baseMessage != null) {
buffer.append(baseMessage);
}
if (!contextValues.isEmpty()) {
if (buffer.length() > 0) {
... | Builds the message containing the contextual information.
@param baseMessage the base exception message <strong>without</strong> context information appended
@return the exception message <strong>with</strong> context information appended, never null | java | src/main/java/org/apache/commons/lang3/exception/DefaultExceptionContext.java | 104 | [
"baseMessage"
] | String | true | 5 | 7.12 | apache/commons-lang | 2,896 | javadoc | false |
iterator | @Override
public Iterator<E> iterator() {
return new QueueIterator();
} | Returns an iterator over the elements contained in this collection, <i>in no particular
order</i>.
<p>The iterator is <i>fail-fast</i>: If the MinMaxPriorityQueue is modified at any time after
the iterator is created, in any way except through the iterator's own remove method, the
iterator will generally throw a {@link... | java | android/guava/src/com/google/common/collect/MinMaxPriorityQueue.java | 899 | [] | true | 1 | 6.16 | google/guava | 51,352 | javadoc | false | |
fit | def fit(self, X, y=None):
"""Fit the imputer on X.
Parameters
----------
X : array-like shape of (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number of features.
y : Ignored
Not used, ... | Fit the imputer on X.
Parameters
----------
X : array-like shape of (n_samples, n_features)
Input data, where `n_samples` is the number of samples and
`n_features` is the number of features.
y : Ignored
Not used, present here for API consistency by convention.
Returns
-------
self : object
The fitted... | python | sklearn/impute/_knn.py | 214 | [
"self",
"X",
"y"
] | false | 3 | 6.08 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
getMissingCache | @Override
protected @Nullable Cache getMissingCache(String name) {
CacheManager cacheManager = getCacheManager();
Assert.state(cacheManager != null, "No CacheManager set");
// Check the JCache cache again (in case the cache was added at runtime)
javax.cache.Cache<Object, Object> jcache = cacheManager.getCache... | Return whether this cache manager accepts and converts {@code null} values
for all of its caches. | java | spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java | 120 | [
"name"
] | Cache | true | 2 | 6 | spring-projects/spring-framework | 59,386 | javadoc | false |
readStaticField | public static Object readStaticField(final Class<?> cls, final String fieldName, final boolean forceAccess) throws IllegalAccessException {
final Field field = getField(cls, fieldName, forceAccess);
Validate.notNull(field, "Cannot locate field '%s' on %s", fieldName, cls);
// already forced acce... | Reads the named {@code static} {@link Field}. Superclasses will be considered.
@param cls
the {@link Class} to reflect, must not be {@code null}.
@param fieldName
the field name to obtain.
@param forceAccess
whether to break scope restrictions using the
{@link AccessibleObjec... | java | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | 498 | [
"cls",
"fieldName",
"forceAccess"
] | Object | true | 1 | 6.56 | apache/commons-lang | 2,896 | javadoc | false |
createAcls | CreateAclsResult createAcls(Collection<AclBinding> acls, CreateAclsOptions options); | Creates access control lists (ACLs) which are bound to specific resources.
<p>
This operation is not transactional so it may succeed for some ACLs while fail for others.
<p>
If you attempt to add an ACL that duplicates an existing ACL, no error will be raised, but
no changes will be made.
<p>
This operation is supporte... | java | clients/src/main/java/org/apache/kafka/clients/admin/Admin.java | 411 | [
"acls",
"options"
] | CreateAclsResult | true | 1 | 6.48 | apache/kafka | 31,560 | javadoc | false |
copySortDefinition | protected SortDefinition copySortDefinition(SortDefinition sort) {
return new MutableSortDefinition(sort);
} | Create a deep copy of the given sort definition,
for use as state holder to compare a modified sort definition against.
<p>Default implementation creates a MutableSortDefinition instance.
Can be overridden in subclasses, in particular in case of custom
extensions to the SortDefinition interface. Is allowed to return
nu... | java | spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java | 328 | [
"sort"
] | SortDefinition | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
wait_for_db_snapshot_state | def wait_for_db_snapshot_state(
self, snapshot_id: str, target_state: str, check_interval: int = 30, max_attempts: int = 40
) -> None:
"""
Poll DB Snapshots until target_state is reached; raise AirflowException after max_attempts.
.. seealso::
- :external+boto3:py:meth:`... | Poll DB Snapshots until target_state is reached; raise AirflowException after max_attempts.
.. seealso::
- :external+boto3:py:meth:`RDS.Client.describe_db_snapshots`
:param snapshot_id: The ID of the target DB instance snapshot
:param target_state: Wait until this state is reached
:param check_interval: The amoun... | python | providers/amazon/src/airflow/providers/amazon/aws/hooks/rds.py | 70 | [
"self",
"snapshot_id",
"target_state",
"check_interval",
"max_attempts"
] | None | true | 3 | 6.24 | apache/airflow | 43,597 | sphinx | false |
addAdvisorInternal | private void addAdvisorInternal(int pos, Advisor advisor) throws AopConfigException {
Assert.notNull(advisor, "Advisor must not be null");
if (isFrozen()) {
throw new AopConfigException("Cannot add advisor: Configuration is frozen.");
}
if (pos > this.advisors.size()) {
throw new IllegalArgumentException(... | Add all the given advisors to this proxy configuration.
@param advisors the advisors to register | java | spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java | 403 | [
"pos",
"advisor"
] | void | true | 3 | 6.72 | spring-projects/spring-framework | 59,386 | javadoc | false |
childRouteName | function childRouteName(child: AngularRoute): string {
if (child.component) {
return child.component.name;
} else if (child.loadChildren || child.loadComponent) {
return `${child.path} [Lazy]`;
} else {
return 'no-name-route';
}
} | Get the display name for a function or class.
@param fn - The function or class to get the name from
@param defaultName - Optional name to check against. If the function name matches this value,
'[Function]' is returned instead
@returns The formatted name: class name, function name with '()', or '[Function]' for anonym... | typescript | devtools/projects/ng-devtools-backend/src/lib/router-tree.ts | 219 | [
"child"
] | true | 6 | 7.92 | angular/angular | 99,544 | jsdoc | false | |
get_device_list | def get_device_list() -> Sequence[Optional[int]]:
"""
Gather the list of devices to be used in the pool.
"""
if not config.autotune_multi_device:
# Don't use multiple devices
return [None]
gpu_type = get_gpu_type()
device_interface = get_interface... | Gather the list of devices to be used in the pool. | python | torch/_inductor/autotune_process.py | 280 | [] | Sequence[Optional[int]] | true | 3 | 7.04 | pytorch/pytorch | 96,034 | unknown | false |
geoAzimuthRads | double geoAzimuthRads(double lat, double lon) {
// algorithm from the original H3 library
final double cosLat = FastMath.cos(lat);
return FastMath.atan2(
cosLat * FastMath.sin(lon - this.lon),
FastMath.cos(this.lat) * FastMath.sin(lat) - FastMath.sin(this.lat) * cosLat * ... | Determines the azimuth to the provided LatLng in radians.
@param lat The latitude in radians.
@param lon The longitude in radians.
@return The azimuth in radians. | java | libs/h3/src/main/java/org/elasticsearch/h3/LatLng.java | 74 | [
"lat",
"lon"
] | true | 1 | 6.88 | elastic/elasticsearch | 75,680 | javadoc | false | |
put | def put(a, ind, v, mode='raise'):
"""
Replaces specified elements of an array with given values.
The indexing works on the flattened target array. `put` is roughly
equivalent to:
::
a.flat[ind] = v
Parameters
----------
a : ndarray
Target array.
ind : array_like
... | Replaces specified elements of an array with given values.
The indexing works on the flattened target array. `put` is roughly
equivalent to:
::
a.flat[ind] = v
Parameters
----------
a : ndarray
Target array.
ind : array_like
Target indices, interpreted as integers.
v : array_like
Values to place in ... | python | numpy/_core/fromnumeric.py | 489 | [
"a",
"ind",
"v",
"mode"
] | false | 1 | 6.48 | numpy/numpy | 31,054 | numpy | false | |
acquireAndEnsureOpen | private void acquireAndEnsureOpen() {
acquire();
if (this.closed) {
release();
throw new IllegalStateException("This consumer has already been closed.");
}
} | Acquire the light lock and ensure that the consumer hasn't been closed.
@throws IllegalStateException If the consumer has been closed | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java | 2,073 | [] | void | true | 2 | 6.56 | apache/kafka | 31,560 | javadoc | false |
read | @Override
public int read() throws IOException {
while (in != null) {
int result = in.read();
if (result != -1) {
return result;
}
advance();
}
return -1;
} | Closes the current input stream and opens the next one, if any. | java | android/guava/src/com/google/common/io/MultiInputStream.java | 82 | [] | true | 3 | 7.04 | google/guava | 51,352 | javadoc | false | |
directives | function directives(node: TSESTree.Program | TSESTree.BlockStatement): TSESTree.Node[] {
return takeWhile(looksLikeDirective, node.body);
} | @param node a Program or BlockStatement node
@returns the leading sequence of directive nodes in the given node's body | typescript | .eslint-plugin-local/code-no-unused-expressions.ts | 91 | [
"node"
] | true | 1 | 6 | microsoft/vscode | 179,840 | jsdoc | false | |
topicPartition | public TopicPartition topicPartition() {
return topicPartition;
} | @return Topic partition representing this instance. | java | clients/src/main/java/org/apache/kafka/common/TopicIdPartition.java | 77 | [] | TopicPartition | true | 1 | 6.32 | apache/kafka | 31,560 | javadoc | false |
getMethodsListWithAnnotation | public static List<Method> getMethodsListWithAnnotation(final Class<?> cls, final Class<? extends Annotation> annotationCls, final boolean searchSupers,
final boolean ignoreAccess) {
Objects.requireNonNull(cls, "cls");
Objects.requireNonNull(annotationCls, "annotationCls");
final Lis... | Gets all methods of the given class that are annotated with the given annotation.
@param cls the {@link Class} to query.
@param annotationCls the {@link Annotation} that must be present on a method to be matched.
@param searchSupers determines if a lookup in the entire inheritance hierarchy of the given clas... | java | src/main/java/org/apache/commons/lang3/reflect/MethodUtils.java | 447 | [
"cls",
"annotationCls",
"searchSupers",
"ignoreAccess"
] | true | 3 | 7.92 | apache/commons-lang | 2,896 | javadoc | false | |
split | public ConfigDataLocation[] split(String delimiter) {
Assert.state(!this.value.isEmpty(), "Unable to split empty locations");
String[] values = StringUtils.delimitedListToStringArray(toString(), delimiter);
ConfigDataLocation[] result = new ConfigDataLocation[values.length];
for (int i = 0; i < values.length; i... | Return an array of {@link ConfigDataLocation} elements built by splitting this
{@link ConfigDataLocation} around the specified delimiter.
@param delimiter the delimiter to split on
@return the split locations
@since 2.4.7 | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataLocation.java | 119 | [
"delimiter"
] | true | 2 | 7.44 | spring-projects/spring-boot | 79,428 | javadoc | false | |
overlaps | def overlaps(self, other):
"""
Check elementwise if an Interval overlaps the values in the IntervalArray.
Two intervals overlap if they share a common point, including closed
endpoints. Intervals that only have an open endpoint in common do not
overlap.
Parameters
... | Check elementwise if an Interval overlaps the values in the IntervalArray.
Two intervals overlap if they share a common point, including closed
endpoints. Intervals that only have an open endpoint in common do not
overlap.
Parameters
----------
other : IntervalArray
Interval to check against for an overlap.
Retu... | python | pandas/core/arrays/interval.py | 1,511 | [
"self",
"other"
] | false | 7 | 7.2 | pandas-dev/pandas | 47,362 | numpy | false | |
visitExportAssignment | function visitExportAssignment(node: ExportAssignment): VisitResult<Statement | undefined> {
// Elide the export assignment if it does not reference a value.
return compilerOptions.verbatimModuleSyntax || resolver.isValueAliasDeclaration(node)
? visitEachChild(node, visitor, context)
... | Visits an export assignment, eliding it if it does not contain a clause that resolves
to a value.
@param node The export assignment node. | typescript | src/compiler/transformers/ts.ts | 2,325 | [
"node"
] | true | 3 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
convertPropertyValue | protected String convertPropertyValue(String originalValue) {
return originalValue;
} | Convert the given property value from the properties source to the value
which should be applied.
<p>The default implementation simply returns the original value.
Can be overridden in subclasses, for example to detect
encrypted values and decrypt them accordingly.
@param originalValue the original value from the proper... | java | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.java | 140 | [
"originalValue"
] | String | true | 1 | 6.16 | spring-projects/spring-framework | 59,386 | javadoc | false |
transitionToStale | private void transitionToStale() {
transitionTo(MemberState.STALE);
final CompletableFuture<Void> onAllTasksLostCallbackExecuted = requestOnAllTasksLostCallbackInvocation();
staleMemberAssignmentRelease = onAllTasksLostCallbackExecuted.whenComplete((result, error) -> {
if (error != ... | Transition to STALE to release assignments because the member has left the group due to
expired poll timer. This will trigger the onAllTasksLost callback. Once the callback
completes, the member will remain stale until the poll timer is reset by an application
poll event. See {@link #maybeRejoinStaleMember()}. | java | clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsMembershipManager.java | 462 | [] | void | true | 2 | 6.72 | apache/kafka | 31,560 | javadoc | false |
unique | def unique(self) -> ArrayLike:
"""
Return unique values of Series object.
Uniques are returned in order of appearance. Hash table-based unique,
therefore does NOT sort.
Returns
-------
ndarray or ExtensionArray
The unique values returned as a NumPy a... | Return unique values of Series object.
Uniques are returned in order of appearance. Hash table-based unique,
therefore does NOT sort.
Returns
-------
ndarray or ExtensionArray
The unique values returned as a NumPy array. See Notes.
See Also
--------
Series.drop_duplicates : Return Series with duplicate values re... | python | pandas/core/series.py | 2,155 | [
"self"
] | ArrayLike | true | 1 | 6.72 | pandas-dev/pandas | 47,362 | unknown | false |
toString | @Override
public String toString() {
return this.options.toString();
} | Returns if the given option is contained in this set.
@param option the option to check
@return {@code true} of the option is present | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigData.java | 218 | [] | String | true | 1 | 6.96 | spring-projects/spring-boot | 79,428 | javadoc | false |
_compute_interactions | def _compute_interactions(self, node):
r"""Compute features allowed by interactions to be inherited by child nodes.
Example: Assume constraints [{0, 1}, {1, 2}].
1 <- Both constraint groups could be applied from now on
/ \
1 2 <- Left split still fulfills both co... | r"""Compute features allowed by interactions to be inherited by child nodes.
Example: Assume constraints [{0, 1}, {1, 2}].
1 <- Both constraint groups could be applied from now on
/ \
1 2 <- Left split still fulfills both constraint groups.
/ \ / \ Right split at feature 2 has only group {1, 2} fr... | python | sklearn/ensemble/_hist_gradient_boosting/grower.py | 654 | [
"self",
"node"
] | false | 3 | 6.24 | scikit-learn/scikit-learn | 64,340 | google | false | |
records | Iterable<Record> records(); | Get an iterator over the records in this log. Note that this generally requires decompression,
and should therefore be used with care.
@return The record iterator | java | clients/src/main/java/org/apache/kafka/common/record/Records.java | 92 | [] | true | 1 | 6.64 | apache/kafka | 31,560 | javadoc | false | |
canApply | public static boolean canApply(Pointcut pc, Class<?> targetClass) {
return canApply(pc, targetClass, false);
} | Can the given pointcut apply at all on the given class?
<p>This is an important test as it can be used to optimize
out a pointcut for a class.
@param pc the static or dynamic pointcut to check
@param targetClass the class to test
@return whether the pointcut can apply on any method | java | spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java | 225 | [
"pc",
"targetClass"
] | true | 1 | 6.64 | spring-projects/spring-framework | 59,386 | javadoc | false | |
all_estimators | def all_estimators(type_filter=None):
"""Get a list of all estimators from `sklearn`.
This function crawls the module and gets all classes that inherit
from BaseEstimator. Classes that are defined in test-modules are not
included.
Parameters
----------
type_filter : {"classifier", "regress... | Get a list of all estimators from `sklearn`.
This function crawls the module and gets all classes that inherit
from BaseEstimator. Classes that are defined in test-modules are not
included.
Parameters
----------
type_filter : {"classifier", "regressor", "cluster", "transformer"} \
or list of such str, default... | python | sklearn/utils/discovery.py | 22 | [
"type_filter"
] | false | 13 | 6.8 | scikit-learn/scikit-learn | 64,340 | numpy | false | |
beforeSingletonCreation | protected void beforeSingletonCreation(String beanName) {
if (!this.inCreationCheckExclusions.contains(beanName) && !this.singletonsCurrentlyInCreation.add(beanName)) {
throw new BeanCurrentlyInCreationException(beanName);
}
} | Callback before singleton creation.
<p>The default implementation registers the singleton as currently in creation.
@param beanName the name of the singleton about to be created
@see #isSingletonCurrentlyInCreation | java | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java | 539 | [
"beanName"
] | void | true | 3 | 6.08 | spring-projects/spring-framework | 59,386 | javadoc | false |
validate_and_load_priority_weight_strategy | def validate_and_load_priority_weight_strategy(
priority_weight_strategy: str | PriorityWeightStrategy | None,
) -> PriorityWeightStrategy:
"""
Validate and load a priority weight strategy.
Returns the priority weight strategy if it is valid, otherwise raises an exception.
:param priority_weight_s... | Validate and load a priority weight strategy.
Returns the priority weight strategy if it is valid, otherwise raises an exception.
:param priority_weight_strategy: The priority weight strategy to validate and load.
:meta private: | python | airflow-core/src/airflow/task/priority_strategy.py | 130 | [
"priority_weight_strategy"
] | PriorityWeightStrategy | true | 6 | 6.56 | apache/airflow | 43,597 | sphinx | false |
map | public static MappedByteBuffer map(File file) throws IOException {
checkNotNull(file);
return map(file, MapMode.READ_ONLY);
} | Fully maps a file read-only in to memory as per {@link
FileChannel#map(java.nio.channels.FileChannel.MapMode, long, long)}.
<p>Files are mapped from offset 0 to its length.
<p>This only works for files ≤ {@link Integer#MAX_VALUE} bytes.
@param file the file to map
@return a read-only buffer reflecting {@code file}
@thr... | java | android/guava/src/com/google/common/io/Files.java | 645 | [
"file"
] | MappedByteBuffer | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false |
_get_git_log_command | def _get_git_log_command(
folder_paths: list[Path] | None = None, from_commit: str | None = None, to_commit: str | None = None
) -> list[str]:
"""Get git command to run for the current repo from the current folder.
The current directory should always be the package folder.
:param folder_paths: list of... | Get git command to run for the current repo from the current folder.
The current directory should always be the package folder.
:param folder_paths: list of folder paths to check for changes
:param from_commit: if present - base commit from which to start the log from
:param to_commit: if present - final commit which... | python | dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py | 254 | [
"folder_paths",
"from_commit",
"to_commit"
] | list[str] | true | 6 | 8.24 | apache/airflow | 43,597 | sphinx | false |
bigIntegerValue | public BigInteger bigIntegerValue() {
BigInteger bigInt = BigInteger.valueOf(value & UNSIGNED_MASK);
if (value < 0) {
bigInt = bigInt.setBit(Long.SIZE - 1);
}
return bigInt;
} | Returns the value of this {@code UnsignedLong} as a {@link BigInteger}. | java | android/guava/src/com/google/common/primitives/UnsignedLong.java | 223 | [] | BigInteger | true | 2 | 6.56 | google/guava | 51,352 | javadoc | false |
onEmitNode | function onEmitNode(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void {
if (node.kind === SyntaxKind.SourceFile) {
const id = getOriginalNodeId(node);
currentSourceFile = node as SourceFile;
moduleInfo = moduleInfoMap[id];
... | Hook for node emit notifications.
@param hint A hint as to the intended usage of the node.
@param node The node to emit.
@param emitCallback A callback used to emit the node in the printer. | typescript | src/compiler/transformers/module/system.ts | 1,769 | [
"hint",
"node",
"emitCallback"
] | true | 4 | 6.88 | microsoft/TypeScript | 107,154 | jsdoc | false | |
iscomplex | def iscomplex(x):
"""
Returns a bool array, where True if input element is complex.
What is tested is whether the input has a non-zero imaginary part, not if
the input type is complex.
Parameters
----------
x : array_like
Input array.
Returns
-------
out : ndarray of b... | Returns a bool array, where True if input element is complex.
What is tested is whether the input has a non-zero imaginary part, not if
the input type is complex.
Parameters
----------
x : array_like
Input array.
Returns
-------
out : ndarray of bools
Output array.
See Also
--------
isreal
iscomplexobj : Re... | python | numpy/lib/_type_check_impl.py | 176 | [
"x"
] | false | 2 | 7.68 | numpy/numpy | 31,054 | numpy | false | |
lastIndexOf | public static int lastIndexOf(byte[] array, byte target) {
return lastIndexOf(array, target, 0, array.length);
} | Returns the index of the last appearance of the value {@code target} in {@code array}.
@param array an array of {@code byte} values, possibly empty
@param target a primitive {@code byte} value
@return the greatest index {@code i} for which {@code array[i] == target}, or {@code -1} if no
such index exists. | java | android/guava/src/com/google/common/primitives/Bytes.java | 143 | [
"array",
"target"
] | true | 1 | 6.48 | google/guava | 51,352 | javadoc | false | |
nop | @SuppressWarnings("unchecked")
static <E extends Throwable> FailableLongToIntFunction<E> nop() {
return NOP;
} | Gets the NOP singleton.
@param <E> The kind of thrown exception or error.
@return The NOP singleton. | java | src/main/java/org/apache/commons/lang3/function/FailableLongToIntFunction.java | 41 | [] | true | 1 | 6.96 | apache/commons-lang | 2,896 | javadoc | false | |
toString | @Override
public String toString() {
return "ReplicaInfo(" +
"size=" + size +
", offsetLag=" + offsetLag +
", isFuture=" + isFuture +
')';
} | Whether this replica has been created by a AlterReplicaLogDirsRequest
but not yet replaced the current replica on the broker.
@return true if this log is created by AlterReplicaLogDirsRequest and will replace the current log
of the replica at some time in the future. | java | clients/src/main/java/org/apache/kafka/clients/admin/ReplicaInfo.java | 63 | [] | String | true | 1 | 6.56 | apache/kafka | 31,560 | javadoc | false |
maybeMarkRequiredField | private static void maybeMarkRequiredField(String currentFieldName, List<String[]> requiredFields) {
Iterator<String[]> iter = requiredFields.iterator();
while (iter.hasNext()) {
String[] requiredFieldNames = iter.next();
for (String field : requiredFieldNames) {
... | Parses a Value from the given {@link XContentParser}
@param parser the parser to build a value from
@param value the value to fill from the parser
@param context a context that is passed along to all declared field parsers
@return the parsed value
@throws IOException if an IOException occurs. | java | libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java | 370 | [
"currentFieldName",
"requiredFields"
] | void | true | 3 | 7.6 | elastic/elasticsearch | 75,680 | javadoc | false |
matches | private static int[] matches(final CharSequence first, final CharSequence second) {
final CharSequence max;
final CharSequence min;
if (first.length() > second.length()) {
max = first;
min = second;
} else {
max = second;
min = first;
... | Converts a String to lower case as per {@link String#toLowerCase(Locale)}.
<p>
A {@code null} input String returns {@code null}.
</p>
<pre>
StringUtils.lowerCase(null, Locale.ENGLISH) = null
StringUtils.lowerCase("", Locale.ENGLISH) = ""
StringUtils.lowerCase("aBc", Locale.ENGLISH) = "abc"
</pre>
@param str the ... | java | src/main/java/org/apache/commons/lang3/StringUtils.java | 5,251 | [
"first",
"second"
] | true | 14 | 7.68 | apache/commons-lang | 2,896 | javadoc | false | |
toString | @Override
public String toString() {
StringBuilder builder = new StringBuilder();
buildToString("", builder);
return builder.toString();
} | Create a new {@link ConfigDataEnvironmentContributor} instance where an existing
child is replaced.
@param existing the existing node that should be replaced
@param replacement the replacement node that should be used instead
@return a new {@link ConfigDataEnvironmentContributor} instance | java | core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironmentContributor.java | 359 | [] | String | true | 1 | 6.08 | spring-projects/spring-boot | 79,428 | javadoc | false |
addAdvisor | @Override
public void addAdvisor(Advisor advisor) {
int pos = this.advisors.size();
addAdvisor(pos, advisor);
} | Remove a proxied interface.
<p>Does nothing if the given interface isn't proxied.
@param ifc the interface to remove from the proxy
@return {@code true} if the interface was removed; {@code false}
if the interface was not found and hence could not be removed | java | spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java | 301 | [
"advisor"
] | void | true | 1 | 7.04 | spring-projects/spring-framework | 59,386 | javadoc | false |
getAndIncrement | public byte getAndIncrement() {
final byte last = value;
value++;
return last;
} | Increments this instance's value by 1; this method returns the value associated with the instance
immediately prior to the increment operation. This method is not thread safe.
@return the value associated with the instance before it was incremented.
@since 3.5 | java | src/main/java/org/apache/commons/lang3/mutable/MutableByte.java | 258 | [] | true | 1 | 6.88 | apache/commons-lang | 2,896 | javadoc | false | |
getDeclareParentsAdvisor | private @Nullable Advisor getDeclareParentsAdvisor(Field introductionField) {
DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class);
if (declareParents == null) {
// Not an introduction field
return null;
}
if (DeclareParents.class == declareParents.defaultImpl()) {
thr... | Build a {@link org.springframework.aop.aspectj.DeclareParentsAdvisor}
for the given introduction field.
<p>Resulting Advisors will need to be evaluated for targets.
@param introductionField the field to introspect
@return the Advisor instance, or {@code null} if not an Advisor | java | spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java | 184 | [
"introductionField"
] | Advisor | true | 3 | 7.6 | spring-projects/spring-framework | 59,386 | javadoc | false |
fromLittleEndianByteArray | public static InetAddress fromLittleEndianByteArray(byte[] addr) throws UnknownHostException {
byte[] reversed = new byte[addr.length];
for (int i = 0; i < addr.length; i++) {
reversed[i] = addr[addr.length - i - 1];
}
return InetAddress.getByAddress(reversed);
} | Returns an address from a <b>little-endian ordered</b> byte array (the opposite of what {@link
InetAddress#getByAddress} expects).
<p>IPv4 address byte array must be 4 bytes long and IPv6 byte array must be 16 bytes long.
@param addr the raw IP address in little-endian byte order
@return an InetAddress object created f... | java | android/guava/src/com/google/common/net/InetAddresses.java | 1,162 | [
"addr"
] | InetAddress | true | 2 | 7.76 | google/guava | 51,352 | javadoc | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.