content_type
stringclasses
8 values
main_lang
stringclasses
7 values
message
stringlengths
1
50
sha
stringlengths
40
40
patch
stringlengths
52
962k
file_count
int64
1
300
Ruby
Ruby
direct the user to xcode download
76ad14507ce71126d9446e08b99dbbb056bc296b
<ide><path>install_homebrew.rb <ide> def getc # NOTE only tested on OS X <ide> ohai "Installation successful!" <ide> <ide> warn "/usr/local/bin is not in your PATH." unless ENV['PATH'].split(':').include? '/usr/local/bin' <del>warn "Now install Xcode." unless Kernel.system "/usr/bin/which -s gcc" <add>warn "Now install Xcode: http://developer.apple.com/technologies/xcode.html" unless Kernel.system "/usr/bin/which -s gcc"
1
Ruby
Ruby
remove trailing whitespace
a2ec6252434c16599407ac91311611b8ee7a1e4f
<ide><path>lib/github_uploader.rb <ide> def authorized? <ide> end <ide> <ide> def token_path <del> File.expand_path(".github-upload-token", @root) <add> File.expand_path(".github-upload-token", @root) <ide> end <ide> <ide> def check_token
1
Python
Python
enable auto_delete for the result queues again
a08d194b3dabfec892b1bb8b110e74058fd8a90e
<ide><path>celery/backends/amqp.py <ide> class ResultPublisher(Publisher): <ide> delivery_mode = conf.RESULT_PERSISTENT and 2 or 1 <ide> serializer = conf.RESULT_SERIALIZER <ide> durable = conf.RESULT_PERSISTENT <del> auto_delete = False <add> auto_delete = True <ide> <ide> def __init__(self, connection, task_id, **kwargs): <ide> super(ResultPublisher, self).__init__(connection, <ide> class ResultConsumer(Consumer): <ide> exchange_type = conf.RESULT_EXCHANGE_TYPE <ide> durable = conf.RESULT_PERSISTENT <ide> no_ack = True <del> auto_delete = False <add> auto_delete = True <ide> <ide> def __init__(self, connection, task_id, **kwargs): <ide> routing_key = task_id.replace("-", "")
1
PHP
PHP
fix return type
0e7e8e52e9925662774e67ed24dd4f98ffd53cbd
<ide><path>src/Illuminate/Cache/CacheManager.php <ide> protected function createDatabaseDriver(array $config) <ide> * Create an instance of the DynamoDB cache driver. <ide> * <ide> * @param array $config <del> * @return \Illuminate\Cache\DynamoDbStore <add> * @return \Illuminate\Cache\Repository <ide> */ <ide> protected function createDynamodbDriver(array $config) <ide> {
1
Javascript
Javascript
favor === over ==
ae25ed3ccd8e5be2eb172af330f037fc06b4e6c9
<ide><path>benchmark/buffers/buffer-bytelength.js <ide> function main(conf) { <ide> } <ide> <ide> function buildString(str, times) { <del> if (times == 1) return str; <add> if (times === 1) return str; <ide> <ide> return str + buildString(str, times - 1); <ide> } <ide><path>benchmark/crypto/cipher-stream.js <ide> function main(conf) { <ide> var bob_secret = bob.computeSecret(alice.getPublicKey(), pubEnc, 'hex'); <ide> <ide> // alice_secret and bob_secret should be the same <del> assert(alice_secret == bob_secret); <add> assert(alice_secret === bob_secret); <ide> <ide> var alice_cipher = crypto.createCipher(conf.cipher, alice_secret); <ide> var bob_cipher = crypto.createDecipher(conf.cipher, bob_secret); <ide><path>benchmark/dgram/array-vs-concat.js <ide> function server() { <ide> var onsend = type === 'concat' ? onsendConcat : onsendMulti; <ide> <ide> function onsendConcat() { <del> if (sent++ % num == 0) <add> if (sent++ % num === 0) <ide> for (var i = 0; i < num; i++) { <ide> socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend); <ide> } <ide> } <ide> <ide> function onsendMulti() { <del> if (sent++ % num == 0) <add> if (sent++ % num === 0) <ide> for (var i = 0; i < num; i++) { <ide> socket.send(chunk, PORT, '127.0.0.1', onsend); <ide> } <ide><path>benchmark/dgram/multi-buffer.js <ide> function server() { <ide> var socket = dgram.createSocket('udp4'); <ide> <ide> function onsend() { <del> if (sent++ % num == 0) <add> if (sent++ % num === 0) <ide> for (var i = 0; i < num; i++) <ide> socket.send(chunk, PORT, '127.0.0.1', onsend); <ide> } <ide><path>benchmark/dgram/offset-length.js <ide> function server() { <ide> var socket = dgram.createSocket('udp4'); <ide> <ide> function onsend() { <del> if (sent++ % num == 0) <add> if (sent++ % num === 0) <ide> for (var i = 0; i < num; i++) <ide> socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend); <ide> } <ide><path>benchmark/dgram/single-buffer.js <ide> function server() { <ide> var socket = dgram.createSocket('udp4'); <ide> <ide> function onsend() { <del> if (sent++ % num == 0) <add> if (sent++ % num === 0) <ide> for (var i = 0; i < num; i++) <ide> socket.send(chunk, PORT, '127.0.0.1', onsend); <ide> } <ide><path>benchmark/http/_http_simple.js <ide> var server = module.exports = http.createServer(function(req, res) { <ide> var status = 200; <ide> <ide> var n, i; <del> if (command == 'bytes') { <add> if (command === 'bytes') { <ide> n = ~~arg; <ide> if (n <= 0) <ide> throw new Error('bytes called with n <= 0'); <ide> var server = module.exports = http.createServer(function(req, res) { <ide> } <ide> body = storedBytes[n]; <ide> <del> } else if (command == 'buffer') { <add> } else if (command === 'buffer') { <ide> n = ~~arg; <ide> if (n <= 0) <ide> throw new Error('buffer called with n <= 0'); <ide> var server = module.exports = http.createServer(function(req, res) { <ide> } <ide> body = storedBuffer[n]; <ide> <del> } else if (command == 'unicode') { <add> } else if (command === 'unicode') { <ide> n = ~~arg; <ide> if (n <= 0) <ide> throw new Error('unicode called with n <= 0'); <ide> var server = module.exports = http.createServer(function(req, res) { <ide> } <ide> body = storedUnicode[n]; <ide> <del> } else if (command == 'quit') { <add> } else if (command === 'quit') { <ide> res.connection.server.close(); <ide> body = 'quitting'; <ide> <del> } else if (command == 'fixed') { <add> } else if (command === 'fixed') { <ide> body = fixed; <ide> <del> } else if (command == 'echo') { <add> } else if (command === 'echo') { <ide> res.writeHead(200, { 'Content-Type': 'text/plain', <ide> 'Transfer-Encoding': 'chunked' }); <ide> req.pipe(res);
7
Text
Text
fix bazel incantations in docs
0f12d4a4188fa7fe4e2fe943d1035eec64a630df
<ide><path>im2txt/README.md <ide> available space for storing the downloaded and processed data. <ide> MSCOCO_DIR="${HOME}/im2txt/data/mscoco" <ide> <ide> # Build the preprocessing script. <del>bazel build im2txt/download_and_preprocess_mscoco <add>cd tensorflow-models/im2txt <add>bazel build //im2txt:download_and_preprocess_mscoco <ide> <ide> # Run the preprocessing script. <ide> bazel-bin/im2txt/download_and_preprocess_mscoco "${MSCOCO_DIR}" <ide> INCEPTION_CHECKPOINT="${HOME}/im2txt/data/inception_v3.ckpt" <ide> MODEL_DIR="${HOME}/im2txt/model" <ide> <ide> # Build the model. <del>bazel build -c opt im2txt/... <add>cd tensorflow-models/im2txt <add>bazel build -c opt //im2txt/... <ide> <ide> # Run the training script. <ide> bazel-bin/im2txt/train \ <ide> VOCAB_FILE="${HOME}/im2txt/data/mscoco/word_counts.txt" <ide> IMAGE_FILE="${HOME}/im2txt/data/mscoco/raw-data/val2014/COCO_val2014_000000224477.jpg" <ide> <ide> # Build the inference binary. <del>bazel build -c opt im2txt/run_inference <add>cd tensorflow-models/im2txt <add>bazel build -c opt //im2txt:run_inference <ide> <ide> # Ignore GPU devices (only necessary if your GPU is currently memory <ide> # constrained, for example, by running the training script). <ide><path>inception/README.md <ide> you will not need to interact with the script again. <ide> DATA_DIR=$HOME/imagenet-data <ide> <ide> # build the preprocessing script. <del>bazel build inception/download_and_preprocess_imagenet <add>cd tensorflow-models/inception <add>bazel build //inception:download_and_preprocess_imagenet <ide> <ide> # run it <ide> bazel-bin/inception/download_and_preprocess_imagenet "${DATA_DIR}" <ide> To train this model, you simply need to specify the following: <ide> ```shell <ide> # Build the model. Note that we need to make sure the TensorFlow is ready to <ide> # use before this as this command will not build TensorFlow. <del>bazel build inception/imagenet_train <add>cd tensorflow-models/inception <add>bazel build //inception:imagenet_train <ide> <ide> # run it <ide> bazel-bin/inception/imagenet_train --num_gpus=1 --batch_size=32 --train_dir=/tmp/imagenet_train --data_dir=/tmp/imagenet_data <ide> GPU cards. <ide> ```shell <ide> # Build the model. Note that we need to make sure the TensorFlow is ready to <ide> # use before this as this command will not build TensorFlow. <del>bazel build inception/imagenet_train <add>cd tensorflow-models/inception <add>bazel build //inception:imagenet_train <ide> <ide> # run it <ide> bazel-bin/inception/imagenet_train --num_gpus=2 --batch_size=64 --train_dir=/tmp/imagenet_train <ide> running. Several things to note here: <ide> ```shell <ide> # Build the model. Note that we need to make sure the TensorFlow is ready to <ide> # use before this as this command will not build TensorFlow. <del>bazel build inception/imagenet_distributed_train <add>cd tensorflow-models/inception <add>bazel build //inception:imagenet_distributed_train <ide> <ide> # To start worker 0, go to the worker0 host and run the following (Note that <ide> # task_id should be in the range [0, num_worker_tasks): <ide> Briefly, one can evaluate the model by running: <ide> ```shell <ide> # Build the model. Note that we need to make sure the TensorFlow is ready to <ide> # use before this as this command will not build TensorFlow. <del>bazel build inception/imagenet_eval <add>cd tensorflow-models/inception <add>bazel build //inception:imagenet_eval <ide> <ide> # run it <ide> bazel-bin/inception/imagenet_eval --checkpoint_dir=/tmp/imagenet_train --eval_dir=/tmp/imagenet_eval <ide> but feel free to edit accordingly. <ide> FLOWERS_DATA_DIR=/tmp/flowers-data/ <ide> <ide> # build the preprocessing script. <del>bazel build inception/download_and_preprocess_flowers <add>cd tensorflow-models/inception <add>bazel build //inception:download_and_preprocess_flowers <ide> <ide> # run it <ide> bazel-bin/inception/download_and_preprocess_flowers "${FLOWERS_DATA_DIR}" <ide> the flowers data set with the following command. <ide> ```shell <ide> # Build the model. Note that we need to make sure the TensorFlow is ready to <ide> # use before this as this command will not build TensorFlow. <del>bazel build inception/flowers_train <add>cd tensorflow-models/inception <add>bazel build //inception:flowers_train <ide> <ide> # Path to the downloaded Inception-v3 model. <ide> MODEL_PATH="${INCEPTION_MODEL_DIR}/inception-v3/model.ckpt-157585" <ide> fine-tuned model, you will need to run `flowers_eval`: <ide> ```shell <ide> # Build the model. Note that we need to make sure the TensorFlow is ready to <ide> # use before this as this command will not build TensorFlow. <del>bazel build inception/flowers_eval <add>cd tensorflow-models/inception <add>bazel build //inception:flowers_eval <ide> <ide> # Directory where we saved the fine-tuned checkpoint and events files. <ide> TRAIN_DIR=/tmp/flowers_train/ <ide> To run `build_image_data.py`, you can run the following command line: <ide> OUTPUT_DIRECTORY=$HOME/my-custom-data/ <ide> <ide> # build the preprocessing script. <del>bazel build inception/build_image_data <add>cd tensorflow-models/inception <add>bazel build //inception:build_image_data <ide> <ide> # convert the data. <ide> bazel-bin/inception/build_image_data \ <ide><path>skip_thoughts/README.md <ide> INPUT_FILES="${HOME}/skip_thoughts/bookcorpus/*.txt" <ide> DATA_DIR="${HOME}/skip_thoughts/data" <ide> <ide> # Build the preprocessing script. <del>bazel build -c opt skip_thoughts/data/preprocess_dataset <add>cd tensorflow-models/skip_thoughts <add>bazel build -c opt //skip_thoughts/data:preprocess_dataset <ide> <ide> # Run the preprocessing script. <ide> bazel-bin/skip_thoughts/data/preprocess_dataset \ <ide> DATA_DIR="${HOME}/skip_thoughts/data" <ide> MODEL_DIR="${HOME}/skip_thoughts/model" <ide> <ide> # Build the model. <del>bazel build -c opt skip_thoughts/... <add>cd tensorflow-models/skip_thoughts <add>bazel build -c opt //skip_thoughts/... <ide> <ide> # Run the training script. <ide> bazel-bin/skip_thoughts/train \ <ide> WORD2VEC_MODEL="${HOME}/skip_thoughts/googlenews/GoogleNews-vectors-negative300. <ide> EXP_VOCAB_DIR="${HOME}/skip_thoughts/exp_vocab" <ide> <ide> # Build the vocabulary expansion script. <del>bazel build -c opt skip_thoughts/vocabulary_expansion <add>cd tensorflow-models/skip_thoughts <add>bazel build -c opt //skip_thoughts:vocabulary_expansion <ide> <ide> # Run the vocabulary expansion script. <ide> bazel-bin/skip_thoughts/vocabulary_expansion \ <ide> EMBEDDINGS_FILE="${HOME}/skip_thoughts/exp_vocab/embeddings.npy" <ide> EVAL_DATA_DIR="${HOME}/skip_thoughts/eval_data" <ide> <ide> # Build the evaluation script. <del>bazel build -c opt skip_thoughts/evaluate <add>cd tensorflow-models/skip_thoughts <add>bazel build -c opt //skip_thoughts:evaluate <ide> <ide> # Run the evaluation script. <ide> bazel-bin/skip_thoughts/evaluate \
3
Javascript
Javascript
add currentroutename to applicationcontroller
58adbb5c504f8abe8ae5a7fe293cd97ee749cda6
<ide><path>packages/ember-routing/lib/system/router.js <ide> Ember.Router = Ember.Object.extend({ <ide> var appController = this.container.lookup('controller:application'), <ide> path = Ember.Router._routePath(infos); <ide> <del> if (!('currentPath' in appController)) { <del> defineProperty(appController, 'currentPath'); <del> } <add> if (!('currentPath' in appController)) { defineProperty(appController, 'currentPath'); } <ide> set(appController, 'currentPath', path); <add> <add> if (!('currentRouteName' in appController)) { defineProperty(appController, 'currentRouteName'); } <add> set(appController, 'currentRouteName', infos[infos.length - 1].name); <add> <ide> this.notifyPropertyChange('url'); <ide> <ide> if (get(this, 'namespace').LOG_TRANSITIONS) { <ide><path>packages/ember/tests/routing/basic_test.js <ide> test("Events can be handled by inherited event handlers", function() { <ide> router.send("baz"); <ide> }); <ide> <add>test("currentRouteName is a property installed on ApplicationController that can be used in transitionTo", function() { <add> <add> expect(24); <add> <add> Router.map(function() { <add> this.resource("be", function() { <add> this.resource("excellent", function() { <add> this.resource("to", function() { <add> this.resource("each", function() { <add> this.route("other"); <add> }); <add> }); <add> }); <add> }); <add> }); <add> <add> bootApplication(); <add> <add> var appController = router.container.lookup('controller:application'); <add> <add> function transitionAndCheck(path, expectedPath, expectedRouteName) { <add> if (path) { Ember.run(router, 'transitionTo', path); } <add> equal(appController.get('currentPath'), expectedPath); <add> equal(appController.get('currentRouteName'), expectedRouteName); <add> } <add> <add> transitionAndCheck(null, 'index', 'index'); <add> transitionAndCheck('/be', 'be.index', 'be.index'); <add> transitionAndCheck('/be/excellent', 'be.excellent.index', 'excellent.index'); <add> transitionAndCheck('/be/excellent/to', 'be.excellent.to.index', 'to.index'); <add> transitionAndCheck('/be/excellent/to/each', 'be.excellent.to.each.index', 'each.index'); <add> transitionAndCheck('/be/excellent/to/each/other', 'be.excellent.to.each.other', 'each.other'); <add> <add> transitionAndCheck('index', 'index', 'index'); <add> transitionAndCheck('be', 'be.index', 'be.index'); <add> transitionAndCheck('excellent', 'be.excellent.index', 'excellent.index'); <add> transitionAndCheck('to.index', 'be.excellent.to.index', 'to.index'); <add> transitionAndCheck('each', 'be.excellent.to.each.index', 'each.index'); <add> transitionAndCheck('each.other', 'be.excellent.to.each.other', 'each.other'); <add>}); <add>
2
Java
Java
expand the javadocs of the scheduler api
2875fefd28b18c9f54d6b487a976c7bcba7dc98b
<ide><path>src/main/java/io/reactivex/Scheduler.java <ide> <ide> /** <ide> * A {@code Scheduler} is an object that specifies an API for scheduling <del> * units of work with or without delays or periodically. <del> * You can get common instances of this class in {@link io.reactivex.schedulers.Schedulers}. <add> * units of work provided in the form of {@link Runnable}s to be <add> * executed without delay (effectively as soon as possible), after a specified time delay or periodically <add> * and represents an abstraction over an asynchronous boundary that ensures <add> * these units of work get executed by some underlying task-execution scheme <add> * (such as custom Threads, event loop, {@link java.util.concurrent.Executor Executor} or Actor system) <add> * with some uniform properties and guarantees regardless of the particular underlying <add> * scheme. <add> * <p> <add> * You can get various standard, RxJava-specific instances of this class via <add> * the static methods of the {@link io.reactivex.schedulers.Schedulers} utility class. <add> * <p> <add> * The so-called {@link Worker}s of a {@code Scheduler} can be created via the {@link #createWorker()} method which allow the scheduling <add> * of multiple {@link Runnable} tasks in an isolated manner. {@code Runnable} tasks scheduled on a {@code Worker} are guaranteed to be <add> * executed sequentially and in a non-overlapping fashion. Non-delayed {@code Runnable} tasks are guaranteed to execute in a <add> * First-In-First-Out order but their execution may be interleaved with delayed tasks. <add> * In addition, outstanding or running tasks can be cancelled together via <add> * {@link Worker#dispose()} without affecting any other {@code Worker} instances of the same {@code Scheduler}. <add> * <p> <add> * Implementations of the {@link #scheduleDirect} and {@link Worker#schedule} methods are encouraged to call the {@link io.reactivex.plugins.RxJavaPlugins#onSchedule(Runnable)} <add> * method to allow a scheduler hook to manipulate (wrap or replace) the original {@code Runnable} task before it is submitted to the <add> * underlying task-execution scheme. <add> * <p> <add> * The default implementations of the {@code scheduleDirect} methods provided by this abstract class <add> * delegate to the respective {@code schedule} methods in the {@link Worker} instance created via {@link #createWorker()} <add> * for each individual {@link Runnable} task submitted. Implementors of this class are encouraged to provide <add> * a more efficient direct scheduling implementation to avoid the time and memory overhead of creating such {@code Worker}s <add> * for every task. <add> * This delegation is done via special wrapper instances around the original {@code Runnable} before calling the respective <add> * {@code Worker.schedule} method. Note that this can lead to multiple {@code RxJavaPlugins.onSchedule} calls and potentially <add> * multiple hooks applied. Therefore, the default implementations of {@code scheduleDirect} (and the {@link Worker#schedulePeriodically(Runnable, long, long, TimeUnit)}) <add> * wrap the incoming {@code Runnable} into a class that implements the {@link io.reactivex.schedulers.SchedulerRunnableIntrospection} <add> * interface which can grant access to the original or hooked {@code Runnable}, thus, a repeated {@code RxJavaPlugins.onSchedule} <add> * can detect the earlier hook and not apply a new one over again. <add> * <p> <add> * The default implementation of {@link #now(TimeUnit)} and {@link Worker#now(TimeUnit)} methods to return current <add> * {@link System#currentTimeMillis()} value in the desired time unit. Custom {@code Scheduler} implementations can override this <add> * to provide specialized time accounting (such as virtual time to be advanced programmatically). <add> * Note that operators requiring a {@code Scheduler} may rely on either of the {@code now()} calls provided by <add> * {@code Scheduler} or {@code Worker} respectively, therefore, it is recommended they represent a logically <add> * consistent source of the current time. <add> * <p> <add> * The default implementation of the {@link Worker#schedulePeriodically(Runnable, long, long, TimeUnit)} method uses <add> * the {@link Worker#schedule(Runnable, long, TimeUnit)} for scheduling the {@code Runnable} task periodically. <add> * The algorithm calculates the next absolute time when the task should run again and schedules this execution <add> * based on the relative time between it and {@link Worker#now(TimeUnit)}. However, drifts or changes in the <add> * system clock could affect this calculation either by scheduling subsequent runs too frequently or too far apart. <add> * Therefore, the default implementation uses the {@link #clockDriftTolerance()} value (set via <add> * {@code rx2.scheduler.drift-tolerance} in minutes) to detect a drift in {@link Worker#now(TimeUnit)} and <add> * re-adjust the absolute/relative time calculation accordingly. <add> * <p> <add> * The default implementations of {@link #start()} and {@link #shutdown()} do nothing and should be overridden if the <add> * underlying task-execution scheme supports stopping and restarting itself. <add> * <p> <add> * If the {@code Scheduler} is shut down or a {@code Worker} is disposed, the {@code schedule} methods <add> * should return the {@link io.reactivex.disposables.Disposables#disposed()} singleton instance indicating the shut down/disposed <add> * state to the caller. Since the shutdown or dispose can happen from any thread, the {@code schedule} implementations <add> * should make best effort to cancel tasks immediately after those tasks have been submitted to the <add> * underlying task-execution scheme if the shutdown/dispose was detected after this submission. <add> * <p> <add> * All methods on the {@code Scheduler} and {@code Worker} classes should be thread safe. <ide> */ <ide> public abstract class Scheduler { <ide> /** <ide> * The tolerance for a clock drift in nanoseconds where the periodic scheduler will rebase. <ide> * <p> <del> * The associated system parameter, {@code rx.scheduler.drift-tolerance}, expects its value in minutes. <add> * The associated system parameter, {@code rx2.scheduler.drift-tolerance}, expects its value in minutes. <ide> */ <ide> static final long CLOCK_DRIFT_TOLERANCE_NANOSECONDS; <ide> static { <ide> public abstract class Scheduler { <ide> <ide> /** <ide> * Returns the clock drift tolerance in nanoseconds. <del> * <p>Related system property: {@code rx2.scheduler.drift-tolerance} in minutes <add> * <p>Related system property: {@code rx2.scheduler.drift-tolerance} in minutes. <ide> * @return the tolerance in nanoseconds <ide> * @since 2.0 <ide> */ <ide> public static long clockDriftTolerance() { <ide> <ide> <ide> /** <del> * Retrieves or creates a new {@link Scheduler.Worker} that represents serial execution of actions. <add> * Retrieves or creates a new {@link Scheduler.Worker} that represents sequential execution of actions. <ide> * <p> <del> * When work is completed it should be unsubscribed using {@link Scheduler.Worker#dispose()}. <add> * When work is completed, the {@code Worker} instance should be released <add> * by calling {@link Scheduler.Worker#dispose()} to avoid potential resource leaks in the <add> * underlying task-execution scheme. <ide> * <p> <del> * Work on a {@link Scheduler.Worker} is guaranteed to be sequential. <add> * Work on a {@link Scheduler.Worker} is guaranteed to be sequential and non-overlapping. <ide> * <ide> * @return a Worker representing a serial queue of actions to be executed <ide> */ <ide> public long now(@NonNull TimeUnit unit) { <ide> /** <ide> * Allows the Scheduler instance to start threads <ide> * and accept tasks on them. <del> * <p>Implementations should make sure the call is idempotent and thread-safe. <add> * <p> <add> * Implementations should make sure the call is idempotent, thread-safe and <add> * should not throw any {@code RuntimeException} if it doesn't support this <add> * functionality. <add> * <ide> * @since 2.0 <ide> */ <ide> public void start() { <ide> <ide> } <ide> <ide> /** <del> * Instructs the Scheduler instance to stop threads <del> * and stop accepting tasks on any outstanding Workers. <del> * <p>Implementations should make sure the call is idempotent and thread-safe. <add> * Instructs the Scheduler instance to stop threads, <add> * stop accepting tasks on any outstanding {@link Worker} instances <add> * and clean up any associated resources with this Scheduler. <add> * <p> <add> * Implementations should make sure the call is idempotent, thread-safe and <add> * should not throw any {@code RuntimeException} if it doesn't support this <add> * functionality. <ide> * @since 2.0 <ide> */ <ide> public void shutdown() { <ide> <ide> } <ide> <ide> /** <del> * Schedules the given task on this scheduler non-delayed execution. <add> * Schedules the given task on this Scheduler without any time delay. <ide> * <ide> * <p> <ide> * This method is safe to be called from multiple threads but there are no <del> * ordering guarantees between tasks. <add> * ordering or non-overlapping guarantees between tasks. <ide> * <ide> * @param run the task to execute <ide> * <ide> public Disposable scheduleDirect(@NonNull Runnable run) { <ide> } <ide> <ide> /** <del> * Schedules the execution of the given task with the given delay amount. <add> * Schedules the execution of the given task with the given time delay. <ide> * <ide> * <p> <ide> * This method is safe to be called from multiple threads but there are no <ide> public Disposable scheduleDirect(@NonNull Runnable run, long delay, @NonNull Tim <ide> } <ide> <ide> /** <del> * Schedules a periodic execution of the given task with the given initial delay and period. <add> * Schedules a periodic execution of the given task with the given initial time delay and repeat period. <ide> * <ide> * <p> <ide> * This method is safe to be called from multiple threads but there are no <ide> * ordering guarantees between tasks. <ide> * <ide> * <p> <del> * The periodic execution is at a fixed rate, that is, the first execution will be after the initial <del> * delay, the second after initialDelay + period, the third after initialDelay + 2 * period, and so on. <add> * The periodic execution is at a fixed rate, that is, the first execution will be after the <add> * {@code initialDelay}, the second after {@code initialDelay + period}, the third after <add> * {@code initialDelay + 2 * period}, and so on. <ide> * <ide> * @param run the task to schedule <ide> * @param initialDelay the initial delay amount, non-positive values indicate non-delayed scheduling <ide> public <S extends Scheduler & Disposable> S when(@NonNull Function<Flowable<Flow <ide> } <ide> <ide> /** <del> * Sequential Scheduler for executing actions on a single thread or event loop. <add> * Represents an isolated, sequential worker of a parent Scheduler for executing {@code Runnable} tasks on <add> * an underlying task-execution scheme (such as custom Threads, event loop, {@link java.util.concurrent.Executor Executor} or Actor system). <add> * <p> <add> * Disposing the {@link Worker} should cancel all outstanding work and allows resource cleanup. <ide> * <p> <del> * Disposing the {@link Worker} cancels all outstanding work and allows resource cleanup. <add> * The default implementations of {@link #schedule(Runnable)} and {@link #schedulePeriodically(Runnable, long, long, TimeUnit)} <add> * delegate to the abstract {@link #schedule(Runnable, long, TimeUnit)} method. Its implementation is encouraged to <add> * track the individual {@code Runnable} tasks while they are waiting to be executed (with or without delay) so that <add> * {@link #dispose()} can prevent their execution or potentially interrupt them if they are currently running. <add> * <p> <add> * The default implementation of the {@link #now(TimeUnit)} method returns current <add> * {@link System#currentTimeMillis()} value in the desired time unit. Custom {@code Worker} implementations can override this <add> * to provide specialized time accounting (such as virtual time to be advanced programmatically). <add> * Note that operators requiring a scheduler may rely on either of the {@code now()} calls provided by <add> * {@code Scheduler} or {@code Worker} respectively, therefore, it is recommended they represent a logically <add> * consistent source of the current time. <add> * <p> <add> * The default implementation of the {@link #schedulePeriodically(Runnable, long, long, TimeUnit)} method uses <add> * the {@link #schedule(Runnable, long, TimeUnit)} for scheduling the {@code Runnable} task periodically. <add> * The algorithm calculates the next absolute time when the task should run again and schedules this execution <add> * based on the relative time between it and {@link #now(TimeUnit)}. However, drifts or changes in the <add> * system clock would affect this calculation either by scheduling subsequent runs too frequently or too far apart. <add> * Therefore, the default implementation uses the {@link #clockDriftTolerance()} value (set via <add> * {@code rx2.scheduler.drift-tolerance} in minutes) to detect a drift in {@link #now(TimeUnit)} and <add> * re-adjust the absolute/relative time calculation accordingly. <add> * <p> <add> * If the {@code Worker} is disposed, the {@code schedule} methods <add> * should return the {@link io.reactivex.disposables.Disposables#disposed()} singleton instance indicating the disposed <add> * state to the caller. Since the {@link #dispose()} call can happen on any thread, the {@code schedule} implementations <add> * should make best effort to cancel tasks immediately after those tasks have been submitted to the <add> * underlying task-execution scheme if the dispose was detected after this submission. <add> * <p> <add> * All methods on the {@code Worker} class should be thread safe. <ide> */ <ide> public abstract static class Worker implements Disposable { <ide> /** <del> * Schedules a Runnable for execution without delay. <add> * Schedules a Runnable for execution without any time delay. <ide> * <ide> * <p>The default implementation delegates to {@link #schedule(Runnable, long, TimeUnit)}. <ide> * <ide> public Disposable schedule(@NonNull Runnable run) { <ide> } <ide> <ide> /** <del> * Schedules an Runnable for execution at some point in the future. <add> * Schedules an Runnable for execution at some point in the future specified by a time delay <add> * relative to the current time. <ide> * <p> <ide> * Note to implementors: non-positive {@code delayTime} should be regarded as non-delayed schedule, i.e., <ide> * as if the {@link #schedule(Runnable)} was called. <ide> * <ide> * @param run <ide> * the Runnable to schedule <ide> * @param delay <del> * time to wait before executing the action; non-positive values indicate an non-delayed <add> * time to "wait" before executing the action; non-positive values indicate an non-delayed <ide> * schedule <ide> * @param unit <ide> * the time unit of {@code delayTime} <ide> public Disposable schedule(@NonNull Runnable run) { <ide> public abstract Disposable schedule(@NonNull Runnable run, long delay, @NonNull TimeUnit unit); <ide> <ide> /** <del> * Schedules a cancelable action to be executed periodically. This default implementation schedules <del> * recursively and waits for actions to complete (instead of potentially executing long-running actions <del> * concurrently). Each scheduler that can do periodic scheduling in a better way should override this. <add> * Schedules a periodic execution of the given task with the given initial time delay and repeat period. <add> * <p> <add> * The default implementation schedules and reschedules the {@code Runnable} task via the <add> * {@link #schedule(Runnable, long, TimeUnit)} <add> * method over and over and at a fixed rate, that is, the first execution will be after the <add> * {@code initialDelay}, the second after {@code initialDelay + period}, the third after <add> * {@code initialDelay + 2 * period}, and so on. <ide> * <p> <ide> * Note to implementors: non-positive {@code initialTime} and {@code period} should be regarded as <ide> * non-delayed scheduling of the first and any subsequent executions. <add> * In addition, a more specific {@code Worker} implementation should override this method <add> * if it can perform the periodic task execution with less overhead (such as by avoiding the <add> * creation of the wrapper and tracker objects upon each periodic invocation of the <add> * common {@link #schedule(Runnable, long, TimeUnit)} method). <ide> * <ide> * @param run <ide> * the Runnable to execute periodically <ide><path>src/main/java/io/reactivex/schedulers/SchedulerRunnableIntrospection.java <ide> import io.reactivex.plugins.RxJavaPlugins; <ide> <ide> /** <del> * Interface to wrap an action inside internal scheduler's task. <del> * <del> * You can check if runnable implements this interface and unwrap original runnable. <del> * For example inside of the {@link RxJavaPlugins#setScheduleHandler(Function)} <add> * Interface to indicate the implementor class wraps a {@code Runnable} that can <add> * be accessed via {@link #getWrappedRunnable()}. <add> * <p> <add> * You can check if a {@link Runnable} task submitted to a {@link io.reactivex.Scheduler Scheduler} (or its <add> * {@link io.reactivex.Scheduler.Worker Scheduler.Worker}) implements this interface and unwrap the <add> * original {@code Runnable} instance. This could help to avoid hooking the same underlying {@code Runnable} <add> * task in a custom {@link RxJavaPlugins#onSchedule(Runnable)} hook set via <add> * the {@link RxJavaPlugins#setScheduleHandler(Function)} method multiple times due to internal delegation <add> * of the default {@code Scheduler.scheduleDirect} or {@code Scheduler.Worker.schedule} methods. <ide> * <ide> * @since 2.1.7 - experimental <ide> */
2
Python
Python
resolve line-too-long in initializers
cefa783c3b017b7c012bb167d6d4034483e4676c
<ide><path>keras/initializers/__init__.py <ide> def populate_deserializable_objects(): <ide> LOCAL.ALL_OBJECTS["ZerosV2"] = initializers_v2.Zeros <ide> <ide> # Out of an abundance of caution we also include these aliases that have <del> # a non-zero probability of having been included in saved configs in the past. <add> # a non-zero probability of having been included in saved configs in the <add> # past. <ide> LOCAL.ALL_OBJECTS["glorot_normalV2"] = initializers_v2.GlorotNormal <ide> LOCAL.ALL_OBJECTS["glorot_uniformV2"] = initializers_v2.GlorotUniform <ide> LOCAL.ALL_OBJECTS["he_normalV2"] = initializers_v2.HeNormal <ide> def deserialize(config, custom_objects=None): <ide> def get(identifier): <ide> """Retrieve a Keras initializer by the identifier. <ide> <del> The `identifier` may be the string name of a initializers function or class ( <del> case-sensitively). <add> The `identifier` may be the string name of a initializers function or class <add> (case-sensitively). <ide> <ide> >>> identifier = 'Ones' <ide> >>> tf.keras.initializers.deserialize(identifier) <ide> <...keras.initializers.initializers_v2.Ones...> <ide> <ide> You can also specify `config` of the initializer to this function by passing <del> dict containing `class_name` and `config` as an identifier. Also note that the <del> `class_name` must map to a `Initializer` class. <add> dict containing `class_name` and `config` as an identifier. Also note that <add> the `class_name` must map to a `Initializer` class. <ide> <ide> >>> cfg = {'class_name': 'Ones', 'config': {}} <ide> >>> tf.keras.initializers.deserialize(cfg) <ide><path>keras/initializers/initializers_test.py <ide> def _runner( <ide> target_max=None, <ide> target_min=None, <ide> ): <del> # The global seed is set so that we can get the same random streams between <del> # eager and graph mode when stateful op is used. <add> # The global seed is set so that we can get the same random streams <add> # between eager and graph mode when stateful op is used. <ide> tf.random.set_seed(1337) <ide> variable = backend.variable(init(shape)) <ide> output = backend.get_value(variable) <ide> def test_partition(self, initializer_cls, kwargs): <ide> self.assertEqual(result.shape, (2, 2)) <ide> <ide> if hasattr(initializer, "seed"): <del> # Make sure the result are different when the partition_shape is same, <del> # but partition_offset is different, for random related initializers. <add> # Make sure the result are different when the partition_shape is <add> # same, but partition_offset is different, for random related <add> # initializers. <ide> result_2 = initializer( <ide> shape=(4, 2), <ide> partition_shape=(2, 2), <ide> def test_partition(self, initializer_cls, kwargs): <ide> <ide> # Make sure initializer produce same result when provide same <ide> # partition offset. <del> # TODO(scottzhu): Enable this assert when initializer is fully stateless <add> # TODO(scottzhu): Enable this assert when initializer is fully <add> # stateless <ide> # result_3 = initializer( <del> # shape=(4, 2), partition_shape=(2, 2), partition_offset=(1, 0)) <add> # shape=(4, 2), partition_shape=(2, 2), partition_offset=(1, <add> # 0)) <ide> # self.assertAllClose(result_2, result_3) <ide> <ide> @parameterized.named_parameters( <ide><path>keras/initializers/initializers_v1.py <ide> class RandomNormal(tf.compat.v1.random_normal_initializer): <ide> Args: <ide> mean: a python scalar or a scalar tensor. Mean of the random values to <ide> generate. <del> stddev: a python scalar or a scalar tensor. Standard deviation of the random <del> values to generate. <add> stddev: a python scalar or a scalar tensor. Standard deviation of the <add> random values to generate. <ide> seed: A Python integer. Used to create random seeds. See <ide> `tf.compat.v1.set_random_seed` for behavior. <ide> dtype: Default data type, used if no `dtype` argument is provided when <ide><path>keras/initializers/initializers_v2.py <ide> # limitations under the License. <ide> # ============================================================================== <ide> """Keras initializers for TF 2.""" <del># pylint: disable=g-classes-have-attributes, missing-docstring, g-direct-tensorflow-import <ide> <ide> import math <ide> <ide> def get_config(self): # To support serialization <ide> return {"mean": self.mean, "stddev": self.stddev} <ide> ``` <ide> <del> Note that we don't have to implement `from_config` in the example above since <del> the constructor arguments of the class the keys in the config returned by <del> `get_config` are the same. In this case, the default `from_config` <del> works fine. <add> Note that we don't have to implement `from_config` in the example above <add> since the constructor arguments of the class the keys in the config returned <add> by `get_config` are the same. In this case, the default `from_config` works <add> fine. <ide> """ <ide> <ide> def __call__(self, shape, dtype=None, **kwargs): <ide> def __call__(self, shape, dtype=None, **kwargs): <ide> <ide> Args: <ide> shape: Shape of the tensor. <del> dtype: Optional dtype of the tensor. Only numeric or boolean dtypes are <del> supported. If not specified, `tf.keras.backend.floatx()` is used, <del> which default to `float32` unless you configured it otherwise <del> (via `tf.keras.backend.set_floatx(float_dtype)`). <add> dtype: Optional dtype of the tensor. Only numeric or boolean dtypes <add> are supported. If not specified, `tf.keras.backend.floatx()` is <add> used, which default to `float32` unless you configured it otherwise <add> (via `tf.keras.backend.set_floatx(float_dtype)`). <ide> **kwargs: Additional keyword arguments. <ide> """ <ide> _validate_kwargs(self.__class__.__name__, kwargs) <ide> def __call__(self, shape, dtype=None, **kwargs): <ide> <ide> Args: <ide> shape: Shape of the tensor. <del> dtype: Optional dtype of the tensor. Only numeric or boolean dtypes are <del> supported. If not specified, `tf.keras.backend.floatx()` is used, <del> which default to `float32` unless you configured it otherwise <del> (via `tf.keras.backend.set_floatx(float_dtype)`). <add> dtype: Optional dtype of the tensor. Only numeric or boolean dtypes <add> are supported. If not specified, `tf.keras.backend.floatx()` is <add> used, which default to `float32` unless you configured it otherwise <add> (via `tf.keras.backend.set_floatx(float_dtype)`). <ide> **kwargs: Additional keyword arguments. <ide> """ <ide> _validate_kwargs(self.__class__.__name__, kwargs) <ide> class RandomUniform(Initializer): <ide> maxval: A python scalar or a scalar tensor. Upper bound of the range of <ide> random values to generate (exclusive). <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> """ <ide> <ide> def __init__(self, minval=-0.05, maxval=0.05, seed=None): <ide> class RandomNormal(Initializer): <ide> Args: <ide> mean: a python scalar or a scalar tensor. Mean of the random values to <ide> generate. <del> stddev: a python scalar or a scalar tensor. Standard deviation of the random <del> values to generate. <add> stddev: a python scalar or a scalar tensor. Standard deviation of the <add> random values to generate. <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> """ <ide> <ide> def __init__(self, mean=0.0, stddev=0.05, seed=None): <ide> def __call__(self, shape, dtype=None, **kwargs): <ide> Args: <ide> shape: Shape of the tensor. <ide> dtype: Optional dtype of the tensor. Only floating point types are <del> supported. If not specified, `tf.keras.backend.floatx()` is used, which <del> default to `float32` unless you configured it otherwise (via <add> supported. If not specified, `tf.keras.backend.floatx()` is used, <add> which default to `float32` unless you configured it otherwise (via <ide> `tf.keras.backend.set_floatx(float_dtype)`) <ide> **kwargs: Additional keyword arguments. <ide> """ <ide> class TruncatedNormal(Initializer): <ide> stddev: a python scalar or a scalar tensor. Standard deviation of the <ide> random values to generate before truncation. <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> """ <ide> <ide> def __init__(self, mean=0.0, stddev=0.05, seed=None): <ide> def __call__(self, shape, dtype=None, **kwargs): <ide> Args: <ide> shape: Shape of the tensor. <ide> dtype: Optional dtype of the tensor. Only floating point types are <del> supported. If not specified, `tf.keras.backend.floatx()` is used, which <del> default to `float32` unless you configured it otherwise (via <add> supported. If not specified, `tf.keras.backend.floatx()` is used, <add> which default to `float32` unless you configured it otherwise (via <ide> `tf.keras.backend.set_floatx(float_dtype)`) <ide> **kwargs: Additional keyword arguments. <ide> """ <ide> class VarianceScaling(Initializer): <ide> `tf.keras.initializers.variance_scaling`. <ide> <ide> With `distribution="truncated_normal" or "untruncated_normal"`, samples are <del> drawn from a truncated/untruncated normal distribution with a mean of zero and <del> a standard deviation (after truncation, if used) `stddev = sqrt(scale / n)`, <del> where `n` is: <add> drawn from a truncated/untruncated normal distribution with a mean of zero <add> and a standard deviation (after truncation, if used) `stddev = sqrt(scale / <add> n)`, where `n` is: <ide> <ide> - number of input units in the weight tensor, if `mode="fan_in"` <ide> - number of output units, if `mode="fan_out"` <ide> class VarianceScaling(Initializer): <ide> distribution: Random distribution to use. One of "truncated_normal", <ide> "untruncated_normal" and "uniform". <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> """ <ide> <ide> def __init__( <ide> def __call__(self, shape, dtype=None, **kwargs): <ide> Args: <ide> shape: Shape of the tensor. <ide> dtype: Optional dtype of the tensor. Only floating point types are <del> supported. If not specified, `tf.keras.backend.floatx()` is used, which <del> default to `float32` unless you configured it otherwise (via <add> supported. If not specified, `tf.keras.backend.floatx()` is used, <add> which default to `float32` unless you configured it otherwise (via <ide> `tf.keras.backend.set_floatx(float_dtype)`) <ide> **kwargs: Additional keyword arguments. <ide> """ <ide> def _generate_init_val(self, shape, dtype, nonce): <ide> else: <ide> scale /= max(1.0, (fan_in + fan_out) / 2.0) <ide> if self.distribution == "truncated_normal": <del> # constant from scipy.stats.truncnorm.std(a=-2, b=2, loc=0., scale=1.) <add> # constant from scipy.stats.truncnorm.std(a=-2, b=2, loc=0., <add> # scale=1.) <ide> stddev = math.sqrt(scale) / 0.87962566103423978 <ide> return self._random_generator.truncated_normal( <ide> shape, 0.0, stddev, dtype, nonce <ide> class Orthogonal(Initializer): <ide> <ide> Also available via the shortcut function `tf.keras.initializers.orthogonal`. <ide> <del> If the shape of the tensor to initialize is two-dimensional, it is initialized <del> with an orthogonal matrix obtained from the QR decomposition of a matrix of <del> random numbers drawn from a normal distribution. <del> If the matrix has fewer rows than columns then the output will have orthogonal <del> rows. Otherwise, the output will have orthogonal columns. <add> If the shape of the tensor to initialize is two-dimensional, it is <add> initialized with an orthogonal matrix obtained from the QR decomposition of <add> a matrix of random numbers drawn from a normal distribution. If the matrix <add> has fewer rows than columns then the output will have orthogonal rows. <add> Otherwise, the output will have orthogonal columns. <ide> <ide> If the shape of the tensor to initialize is more than two-dimensional, <ide> a matrix of shape `(shape[0] * ... * shape[n - 2], shape[n - 1])` <ide> class Orthogonal(Initializer): <ide> Args: <ide> gain: multiplicative factor to apply to the orthogonal matrix <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [Saxe et al., 2014](https://openreview.net/forum?id=_wzZwKpTDF_9C) <ide> class GlorotUniform(VarianceScaling): <ide> `tf.keras.initializers.glorot_uniform`. <ide> <ide> Draws samples from a uniform distribution within `[-limit, limit]`, where <del> `limit = sqrt(6 / (fan_in + fan_out))` (`fan_in` is the number of input units <del> in the weight tensor and `fan_out` is the number of output units). <add> `limit = sqrt(6 / (fan_in + fan_out))` (`fan_in` is the number of input <add> units in the weight tensor and `fan_out` is the number of output units). <ide> <ide> Examples: <ide> <ide> class GlorotUniform(VarianceScaling): <ide> <ide> Args: <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html) <ide> class GlorotNormal(VarianceScaling): <ide> Also available via the shortcut function <ide> `tf.keras.initializers.glorot_normal`. <ide> <del> Draws samples from a truncated normal distribution centered on 0 with `stddev <del> = sqrt(2 / (fan_in + fan_out))` where `fan_in` is the number of input units in <del> the weight tensor and `fan_out` is the number of output units in the weight <del> tensor. <add> Draws samples from a truncated normal distribution centered on 0 with <add> `stddev = sqrt(2 / (fan_in + fan_out))` where `fan_in` is the number of <add> input units in the weight tensor and `fan_out` is the number of output units <add> in the weight tensor. <ide> <ide> Examples: <ide> <ide> class GlorotNormal(VarianceScaling): <ide> <ide> Args: <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [Glorot et al., 2010](http://proceedings.mlr.press/v9/glorot10a.html) <ide> class LecunNormal(VarianceScaling): <ide> the Initializer object, without knowing the shape and dtype of the variable <ide> being initialized. <ide> <del> Draws samples from a truncated normal distribution centered on 0 with `stddev <del> = sqrt(1 / fan_in)` where `fan_in` is the number of input units in the weight <del> tensor. <add> Draws samples from a truncated normal distribution centered on 0 with <add> `stddev = sqrt(1 / fan_in)` where `fan_in` is the number of input units in <add> the weight tensor. <ide> <ide> Examples: <ide> <ide> class LecunNormal(VarianceScaling): <ide> <ide> Args: <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [Klambauer et al., 2017](https://arxiv.org/abs/1706.02515) <ide> class LecunUniform(VarianceScaling): <ide> Also available via the shortcut function <ide> `tf.keras.initializers.lecun_uniform`. <ide> <del> Draws samples from a uniform distribution within `[-limit, limit]`, <del> where `limit = sqrt(3 / fan_in)` (`fan_in` is the number of input units in the <add> Draws samples from a uniform distribution within `[-limit, limit]`, where <add> `limit = sqrt(3 / fan_in)` (`fan_in` is the number of input units in the <ide> weight tensor). <ide> <ide> Examples: <ide> class LecunUniform(VarianceScaling): <ide> <ide> Args: <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [Klambauer et al., 2017](https://arxiv.org/abs/1706.02515) <ide> class HeNormal(VarianceScaling): <ide> `tf.keras.initializers.he_normal`. <ide> <ide> It draws samples from a truncated normal distribution centered on 0 with <del> `stddev = sqrt(2 / fan_in)` where `fan_in` is the number of input units in the <del> weight tensor. <add> `stddev = sqrt(2 / fan_in)` where `fan_in` is the number of input units in <add> the weight tensor. <ide> <ide> Examples: <ide> <ide> class HeNormal(VarianceScaling): <ide> <ide> Args: <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [He et al., 2015](https://arxiv.org/abs/1502.01852) <ide> class HeUniform(VarianceScaling): <ide> <ide> Args: <ide> seed: A Python integer. Used to make the behavior of the initializer <del> deterministic. Note that a seeded <del> initializer will not produce the same random values across multiple calls, <del> but multiple initializers will produce the same sequence when constructed <del> with the same seed value. <add> deterministic. Note that a seeded initializer will not produce the same <add> random values across multiple calls, but multiple initializers will <add> produce the same sequence when constructed with the same seed value. <ide> <ide> References: <ide> - [He et al., 2015](https://arxiv.org/abs/1502.01852) <ide> def _ensure_keras_seeded(): <ide> """Make sure the keras.backend global seed generator is set. <ide> <ide> This is important for DTensor use case to ensure that each client are <del> initialized with same seed for tf.random.Generator, so that the value created <del> are in sync among all the clients. <add> initialized with same seed for tf.random.Generator, so that the value <add> created are in sync among all the clients. <ide> """ <ide> if not getattr( <ide> backend._SEED_GENERATOR, "generator", None
4
PHP
PHP
create relative symlinks by default
bced6d3fac1c081ef4f62dd94277984fc819f9d6
<ide><path>src/Illuminate/Foundation/Console/StorageLinkCommand.php <ide> namespace Illuminate\Foundation\Console; <ide> <ide> use Illuminate\Console\Command; <add>use Symfony\Component\HttpFoundation\Request; <ide> <ide> class StorageLinkCommand extends Command <ide> { <ide> class StorageLinkCommand extends Command <ide> * <ide> * @var string <ide> */ <del> protected $signature = 'storage:link'; <add> protected $signature = 'storage:link {--absolute : Create links using absolute paths}'; <ide> <ide> /** <ide> * The console command description. <ide> public function handle() <ide> if (file_exists($link)) { <ide> $this->error("The [$link] link already exists."); <ide> } else { <add> if (! $this->option('absolute') && DIRECTORY_SEPARATOR == '/') { <add> // Utilize Symfony's Request to find the relative path <add> $target = Request::create($link)->getRelativeUriForPath($target); <add> } <add> <ide> $this->laravel->make('files')->link($target, $link); <ide> <ide> $this->info("The [$link] link has been connected to [$target].");
1
Ruby
Ruby
allow wildcard entries for launchctl
836efe621fc842ee5b7ff1a42f9b8bcba5020a86
<ide><path>Library/Homebrew/cask/artifact/abstract_uninstall.rb <ide> def uninstall_launchctl(*services, command: nil, **_) <ide> <ide> # if launchctl item contains a wildcard, find matching process(es) <ide> services.each do |service| <del> all_services.push(service) <del> next unless /\*/.match?(service) <add> all_services << service <add> next unless service.include?("*") <ide> <del> find_launchctl_with_wildcard(service) <del> .map { |_, _, id| id } <del> .each do |match| <del> all_services.push(match) <del> end <add> all_services += find_launchctl_with_wildcard(service) <ide> end <ide> <ide> all_services.each do |service| <ide> def uninstall_login_item(*login_items, command: nil, upgrade: false, **_) <ide> end <ide> <ide> def find_launchctl_with_wildcard(search) <add> regex = Regexp.escape(search).gsub("\\*", ".*") <ide> system_command!("/bin/launchctl", args: ["list"]) <ide> .stdout.lines.drop(1) <del> .map { |line| line.chomp.split("\t") } <del> .map { |pid, state, id| [pid.to_i, state.to_i, id] } <del> .select do |(pid, _, id)| <del> pid.nonzero? && /\A#{Regexp.escape(search).gsub("\\*", ".*")}\Z/.match?(id) <del> end <add> .map do |line| <add> pid, _state, id = line.chomp.split("\t") <add> id if pid.to_i.nonzero? && id.match?(regex) <add> end.compact <ide> end <ide> <ide> # :kext should be unloaded before attempting to delete the relevant file
1
Python
Python
add simple test for surrounding brackets
487e020ebe4e00bfa3b9ee96e91e99e8d7500299
<ide><path>spacy/tests/tokenizer/test_urls.py <ide> def test_tokenizer_handles_suffixed_url(tokenizer, url, suffix): <ide> assert tokens[1].text == suffix <ide> <ide> <add>@pytest.mark.parametrize("url", URLS) <add>def test_tokenizer_handles_simple_surround_url(tokenizer, url): <add> tokens = tokenizer("(" + url + ")") <add> assert len(tokens) == 3 <add> assert tokens[0].text == "(" <add> assert tokens[1].text == url <add> assert tokens[2].text == ")" <add> <add> <ide> @pytest.mark.parametrize("prefix", PREFIXES) <ide> @pytest.mark.parametrize("suffix", SUFFIXES) <ide> @pytest.mark.parametrize("url", URLS)
1
Javascript
Javascript
improve test for data-uri
dd596ccf729b2f39d44b73bc54b53bd41c880146
<ide><path>test/unit/manipulation.js <ide> test( "Validate creation of multiple quantities of certain elements (#13818)", 4 <ide> <ide> asyncTest( "Insert script with data-URI (gh-1887)", 1, function() { <ide> Globals.register( "testFoo" ); <del> jQuery( "#qunit-fixture" ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" ); <add> Globals.register( "testSrcFoo" ); <add> <add> var script = document.createElement( "script" ), <add> fixture = document.getElementById( "qunit-fixture" ); <add> <add> script.src = "data:text/javascript,testSrcFoo = 'foo';"; <add> <add> fixture.appendChild( script ); <add> <add> jQuery( fixture ).append( "<script src=\"data:text/javascript,testFoo = 'foo';\"></script>" ); <add> <ide> setTimeout(function() { <del> strictEqual( window[ "testFoo" ], "foo", "data-URI script executed" ); <add> if ( window[ "testSrcFoo" ] === "foo" ) { <add> strictEqual( window[ "testFoo" ], window[ "testSrcFoo" ], "data-URI script executed" ); <add> <add> } else { <add> ok( true, "data-URI script is not supported by this environment" ); <add> } <add> <ide> start(); <del> }, 100 ); <add> }); <ide> });
1
Javascript
Javascript
extract $browser.xhr into separate service
5ad0c7d0e4a2aff071d3afb181fa618c982ce991
<ide><path>src/angular-mocks.js <ide> angular.module.ngMock.$Browser = function() { <ide> self.$$lastUrl = self.$$url; // used by url polling fn <ide> self.pollFns = []; <ide> <add> // TODO(vojta): remove this temporary api <add> self.$$completeOutstandingRequest = noop; <add> self.$$incOutstandingRequestCount = noop; <add> <ide> <ide> // register url polling fn <ide> <ide> angular.module.ngMock.$Browser = function() { <ide> return listener; <ide> }; <ide> <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Generic method for training browser to expect a request in a test and respond to it. <del> * <del> * See also convenience methods for browser training: <del> * <del> * - {@link #xhr.expectGET} <del> * - {@link #xhr.expectPOST} <del> * - {@link #xhr.expectPUT} <del> * - {@link #xhr.expectDELETE} <del> * - {@link #xhr.expectJSON} <del> * <del> * To flush pending requests in tests use <del> * {@link #xhr.flush}. <del> * <del> * @param {string} method Expected HTTP method. <del> * @param {string} url Url path for which a request is expected. <del> * @param {(object|string)=} data Expected body of the (POST) HTTP request. <del> * @param {function(number, *)} callback Callback to call when response is flushed. <del> * @param {object} headers Key-value pairs of expected headers. <del> * @returns {object} Response configuration object. You can call its `respond()` method to <del> * configure what should the browser mock return when the response is <del> * {@link #xhr.flush flushed}. <del> */ <del> self.xhr = function(method, url, data, callback, headers) { <del> headers = headers || {}; <del> if (data && angular.isObject(data)) data = angular.toJson(data); <del> if (data && angular.isString(data)) url += "|" + data; <del> var expect = expectations[method] || {}; <del> var expectation = expect[url]; <del> if (!expectation) { <del> throw new Error("Unexpected request for method '" + method + "' and url '" + url + "'."); <del> } <del> requests.push(function() { <del> angular.forEach(expectation.headers, function(value, key){ <del> if (headers[key] !== value) { <del> throw new Error("Missing HTTP request header: " + key + ": " + value); <del> } <del> }); <del> callback(expectation.code, expectation.response); <del> }); <del> // TODO(vojta): return mock request object <del> }; <del> self.xhr.expectations = expectations; <del> self.xhr.requests = requests; <del> self.xhr.expect = function(method, url, data, headers) { <del> if (data && angular.isObject(data)) data = angular.toJson(data); <del> if (data && angular.isString(data)) url += "|" + data; <del> var expect = expectations[method] || (expectations[method] = {}); <del> return { <del> respond: function(code, response) { <del> if (!angular.isNumber(code)) { <del> response = code; <del> code = 200; <del> } <del> expect[url] = {code:code, response:response, headers: headers || {}}; <del> } <del> }; <del> }; <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr.expectGET <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Trains browser to expect a `GET` request and respond to it. <del> * <del> * @param {string} url Url path for which a request is expected. <del> * @returns {object} Response configuration object. You can call its `respond()` method to <del> * configure what should the browser mock return when the response is <del> * {@link angular.module.ngMock.$browser#xhr.flush flushed}. <del> */ <del> self.xhr.expectGET = angular.bind(self, self.xhr.expect, 'GET'); <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr.expectPOST <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Trains browser to expect a `POST` request and respond to it. <del> * <del> * @param {string} url Url path for which a request is expected. <del> * @returns {object} Response configuration object. You can call its `respond()` method to <del> * configure what should the browser mock return when the response is <del> * {@link angular.module.ngMock.$browser#xhr.flush flushed}. <del> */ <del> self.xhr.expectPOST = angular.bind(self, self.xhr.expect, 'POST'); <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr.expectDELETE <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Trains browser to expect a `DELETE` request and respond to it. <del> * <del> * @param {string} url Url path for which a request is expected. <del> * @returns {object} Response configuration object. You can call its `respond()` method to <del> * configure what should the browser mock return when the response is <del> * {@link angular.module.ngMock.$browser#xhr.flush flushed}. <del> */ <del> self.xhr.expectDELETE = angular.bind(self, self.xhr.expect, 'DELETE'); <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr.expectPUT <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Trains browser to expect a `PUT` request and respond to it. <del> * <del> * @param {string} url Url path for which a request is expected. <del> * @returns {object} Response configuration object. You can call its `respond()` method to <del> * configure what should the browser mock return when the response is <del> * {@link angular.module.ngMock.$browser#xhr.flush flushed}. <del> */ <del> self.xhr.expectPUT = angular.bind(self, self.xhr.expect, 'PUT'); <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr.expectJSON <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Trains browser to expect a `JSON` request and respond to it. <del> * <del> * @param {string} url Url path for which a request is expected. <del> * @returns {object} Response configuration object. You can call its `respond()` method to <del> * configure what should the browser mock return when the response is <del> * {@link angular.module.ngMock.$browser#xhr.flush flushed}. <del> */ <del> self.xhr.expectJSON = angular.bind(self, self.xhr.expect, 'JSON'); <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ngMock.$browser#xhr.flush <del> * @methodOf angular.module.ngMock.$browser <del> * <del> * @description <del> * Flushes all pending requests and executes xhr callbacks with the trained response as the <del> * argument. <del> */ <del> self.xhr.flush = function() { <del> if (requests.length == 0) { <del> throw new Error("No xhr requests to be flushed!"); <del> } <del> <del> while(requests.length) { <del> requests.pop()(); <del> } <del> }; <del> <ide> self.cookieHash = {}; <ide> self.lastCookieHash = {}; <ide> self.deferredFns = []; <ide> function MockHttpExpectation(method, url, data, headers) { <ide> <ide> function MockXhr() { <ide> <del> // hack for testing $http <add> // hack for testing $http, $httpBackend <ide> MockXhr.$$lastInstance = this; <ide> <add> this.open = function(method, url, async) { <add> this.$$method = method; <add> this.$$url = url; <add> this.$$async = async; <add> this.$$headers = {}; <add> }; <add> <add> this.send = function(data) { <add> this.$$data = data; <add> }; <add> <add> this.setRequestHeader = function(key, value) { <add> this.$$headers[key] = value; <add> }; <add> <ide> this.getResponseHeader = function(name) { <ide> return this.$$headers[name]; <ide> }; <ide><path>src/service/browser.js <ide> 'use strict'; <ide> <del>////////////////////////////// <del>// Browser <del>////////////////////////////// <del>var XHR = window.XMLHttpRequest || function() { <del> try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {} <del> try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {} <del> try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {} <del> throw new Error("This browser does not support XMLHttpRequest."); <del>}; <del> <del> <ide> /** <ide> * @ngdoc object <ide> * @name angular.module.ng.$browser <ide> var XHR = window.XMLHttpRequest || function() { <ide> * @param {object} $log console.log or an object with the same interface. <ide> * @param {object} $sniffer $sniffer service <ide> */ <del>function Browser(window, document, body, XHR, $log, $sniffer) { <add>function Browser(window, document, body, $log, $sniffer) { <ide> var self = this, <ide> rawDocument = document[0], <ide> location = window.location, <ide> function Browser(window, document, body, XHR, $log, $sniffer) { <ide> <ide> self.isMock = false; <ide> <del> ////////////////////////////////////////////////////////////// <del> // XHR API <del> ////////////////////////////////////////////////////////////// <del> var idCounter = 0; <ide> var outstandingRequestCount = 0; <ide> var outstandingRequestCallbacks = []; <ide> <add> // TODO(vojta): remove this temporary api <add> self.$$completeOutstandingRequest = completeOutstandingRequest; <add> self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; }; <ide> <ide> /** <ide> * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks` <ide> function Browser(window, document, body, XHR, $log, $sniffer) { <ide> } <ide> } <ide> <del> // normalize IE bug (http://bugs.jquery.com/ticket/1450) <del> function fixStatus(status) { <del> return status == 1223 ? 204 : status; <del> } <del> <del> /** <del> * @ngdoc method <del> * @name angular.module.ng.$browser#xhr <del> * @methodOf angular.module.ng.$browser <del> * <del> * @param {string} method Requested method (get|post|put|delete|head|json) <del> * @param {string} url Requested url <del> * @param {?string} post Post data to send (null if nothing to post) <del> * @param {function(number, string)} callback Function that will be called on response <del> * @param {object=} header additional HTTP headers to send with XHR. <del> * Standard headers are: <del> * <ul> <del> * <li><tt>Content-Type</tt>: <tt>application/x-www-form-urlencoded</tt></li> <del> * <li><tt>Accept</tt>: <tt>application/json, text/plain, &#42;/&#42;</tt></li> <del> * <li><tt>X-Requested-With</tt>: <tt>XMLHttpRequest</tt></li> <del> * </ul> <del> * <del> * @param {number=} timeout Timeout in ms, when the request will be aborted <del> * @returns {XMLHttpRequest|undefined} Raw XMLHttpRequest object or undefined when JSONP method <del> * <del> * @description <del> * Send ajax request <del> * <del> * TODO(vojta): change signature of this method to (method, url, data, headers, callback) <del> */ <del> self.xhr = function(method, url, post, callback, headers, timeout) { <del> outstandingRequestCount ++; <del> if (lowercase(method) == 'jsonp') { <del> var callbackId = ("angular_" + Math.random() + '_' + (idCounter++)).replace(/\d\./, ''); <del> window[callbackId] = function(data) { <del> window[callbackId].data = data; <del> }; <del> <del> var script = self.addJs(url.replace('JSON_CALLBACK', callbackId), function() { <del> if (window[callbackId].data) { <del> completeOutstandingRequest(callback, 200, window[callbackId].data); <del> } else { <del> completeOutstandingRequest(callback, -2); <del> } <del> delete window[callbackId]; <del> body[0].removeChild(script); <del> }); <del> } else { <del> var xhr = new XHR(); <del> xhr.open(method, url, true); <del> forEach(headers, function(value, key) { <del> if (value) xhr.setRequestHeader(key, value); <del> }); <del> <del> var status; <del> xhr.send(post || ''); <del> <del> // IE6, IE7 bug - does sync when serving from cache <del> if (xhr.readyState == 4) { <del> setTimeout(function() { <del> completeOutstandingRequest(callback, fixStatus(status || xhr.status), xhr.responseText); <del> }, 0); <del> } else { <del> xhr.onreadystatechange = function() { <del> if (xhr.readyState == 4) { <del> completeOutstandingRequest(callback, fixStatus(status || xhr.status), <del> xhr.responseText); <del> } <del> }; <del> } <del> <del> if (timeout > 0) { <del> setTimeout(function() { <del> status = -1; <del> xhr.abort(); <del> }, timeout); <del> } <del> <del> return xhr; <del> } <del> }; <del> <ide> /** <ide> * @private <ide> * Note: this method is used only by scenario runner <ide> function Browser(window, document, body, XHR, $log, $sniffer) { <ide> function $BrowserProvider(){ <ide> this.$get = ['$window', '$log', '$sniffer', '$document', <ide> function( $window, $log, $sniffer, $document){ <del> return new Browser($window, $document, $document.find('body'), XHR, $log, $sniffer); <add> return new Browser($window, $document, $document.find('body'), $log, $sniffer); <ide> }]; <ide> } <ide><path>src/service/httpBackend.js <add>var XHR = window.XMLHttpRequest || function() { <add> try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch (e1) {} <add> try { return new ActiveXObject("Msxml2.XMLHTTP.3.0"); } catch (e2) {} <add> try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e3) {} <add> throw new Error("This browser does not support XMLHttpRequest."); <add>}; <add> <add> <add>/** <add> * @ngdoc object <add> * @name angular.module.ng.$httpBackend <add> * @requires $browser <add> * @requires $window <add> * @requires $document <add> * <add> * @description <add> */ <ide> function $HttpBackendProvider() { <del> this.$get = ['$browser', function($browser) { <del> return $browser.xhr; <add> this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) { <add> return createHttpBackend($browser, XHR, $browser.defer, $window, $document[0].body); <ide> }]; <ide> } <ide> <add>function createHttpBackend($browser, XHR, $browserDefer, $window, body) { <add> var idCounter = 0; <add> <add> function completeRequest(callback, status, response) { <add> // normalize IE bug (http://bugs.jquery.com/ticket/1450) <add> callback(status == 1223 ? 204 : status, response); <add> $browser.$$completeOutstandingRequest(noop); <add> } <add> <add> // TODO(vojta): fix the signature <add> return function(method, url, post, callback, headers, timeout) { <add> $browser.$$incOutstandingRequestCount(); <add> <add> if (lowercase(method) == 'jsonp') { <add> var callbackId = ('angular_' + Math.random() + '_' + (idCounter++)).replace(/\d\./, ''); <add> $window[callbackId] = function(data) { <add> $window[callbackId].data = data; <add> }; <add> <add> var script = $browser.addJs(url.replace('JSON_CALLBACK', callbackId), null, function() { <add> if ($window[callbackId].data) { <add> completeRequest(callback, 200, $window[callbackId].data); <add> } else { <add> completeRequest(callback, -2); <add> } <add> delete $window[callbackId]; <add> body.removeChild(script); <add> }); <add> } else { <add> var xhr = new XHR(); <add> xhr.open(method, url, true); <add> forEach(headers, function(value, key) { <add> if (value) xhr.setRequestHeader(key, value); <add> }); <add> <add> var status; <add> xhr.send(post || ''); <add> <add> // IE6, IE7 bug - does sync when serving from cache <add> if (xhr.readyState == 4) { <add> $browserDefer(function() { <add> completeRequest(callback, status || xhr.status, xhr.responseText); <add> }, 0); <add> } else { <add> xhr.onreadystatechange = function() { <add> if (xhr.readyState == 4) { <add> completeRequest(callback, status || xhr.status, xhr.responseText); <add> } <add> }; <add> } <add> <add> if (timeout > 0) { <add> $browserDefer(function() { <add> status = -1; <add> xhr.abort(); <add> }, timeout); <add> } <add> <add> return xhr; <add> } <add> }; <add>} <add> <ide><path>test/service/browserSpecs.js <ide> function MockWindow() { <ide> <ide> describe('browser', function() { <ide> <del> var browser, fakeWindow, xhr, logs, scripts, removedScripts, sniffer; <add> var browser, fakeWindow, logs, scripts, removedScripts, sniffer; <ide> <ide> beforeEach(function() { <ide> scripts = []; <ide> removedScripts = []; <del> xhr = null; <ide> sniffer = {history: true, hashchange: true}; <ide> fakeWindow = new MockWindow(); <ide> <ide> var fakeBody = [{appendChild: function(node){scripts.push(node);}, <ide> removeChild: function(node){removedScripts.push(node);}}]; <ide> <del> var FakeXhr = function() { <del> xhr = this; <del> this.open = function(method, url, async){ <del> xhr.method = method; <del> xhr.url = url; <del> xhr.async = async; <del> xhr.headers = {}; <del> }; <del> this.setRequestHeader = function(key, value){ <del> xhr.headers[key] = value; <del> }; <del> this.send = function(post){ <del> xhr.post = post; <del> }; <del> }; <del> <ide> logs = {log:[], warn:[], info:[], error:[]}; <ide> <ide> var fakeLog = {log: function() { logs.log.push(slice.call(arguments)); }, <ide> warn: function() { logs.warn.push(slice.call(arguments)); }, <ide> info: function() { logs.info.push(slice.call(arguments)); }, <ide> error: function() { logs.error.push(slice.call(arguments)); }}; <ide> <del> browser = new Browser(fakeWindow, jqLite(window.document), fakeBody, FakeXhr, <del> fakeLog, sniffer); <add> browser = new Browser(fakeWindow, jqLite(window.document), fakeBody, fakeLog, sniffer); <ide> }); <ide> <ide> it('should contain cookie cruncher', function() { <ide> describe('browser', function() { <ide> browser.notifyWhenNoOutstandingRequests(callback); <ide> expect(callback).toHaveBeenCalled(); <ide> }); <del> <del> it('should queue callbacks with outstanding requests', function() { <del> var callback = jasmine.createSpy('callback'); <del> browser.xhr('GET', '/url', null, noop); <del> browser.notifyWhenNoOutstandingRequests(callback); <del> expect(callback).not.toHaveBeenCalled(); <del> <del> xhr.readyState = 4; <del> xhr.onreadystatechange(); <del> expect(callback).toHaveBeenCalled(); <del> }); <ide> }); <ide> <del> describe('xhr', function() { <del> describe('JSONP', function() { <del> var log; <del> <del> function callback(code, data) { <del> log += code + ':' + data + ';'; <del> } <del> <del> beforeEach(function() { <del> log = ""; <del> }); <del> <del> <del> // We don't have unit tests for IE because script.readyState is readOnly. <del> // Instead we run e2e tests on all browsers - see e2e for $http. <del> if (!msie) { <del> <del> it('should add script tag for JSONP request', function() { <del> var notify = jasmine.createSpy('notify'); <del> browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <del> browser.notifyWhenNoOutstandingRequests(notify); <del> expect(notify).not.toHaveBeenCalled(); <del> expect(scripts.length).toEqual(1); <del> var script = scripts[0]; <del> var url = script.src.split('?cb='); <del> expect(url[0]).toEqual('http://example.org/path'); <del> expect(typeof fakeWindow[url[1]]).toEqual('function'); <del> fakeWindow[url[1]]('data'); <del> script.onload(); <del> <del> expect(notify).toHaveBeenCalled(); <del> expect(log).toEqual('200:data;'); <del> expect(scripts).toEqual(removedScripts); <del> expect(fakeWindow[url[1]]).toBeUndefined(); <del> }); <del> <del> <del> it('should call callback with status -2 when script fails to load', function() { <del> browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <del> var script = scripts[0]; <del> expect(typeof script.onload).toBe('function'); <del> expect(typeof script.onerror).toBe('function'); <del> script.onerror(); <del> <del> expect(log).toEqual('-2:undefined;'); <del> }); <del> <del> <del> it('should update the outstandingRequests counter for successful requests', function() { <del> var notify = jasmine.createSpy('notify'); <del> browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <del> browser.notifyWhenNoOutstandingRequests(notify); <del> expect(notify).not.toHaveBeenCalled(); <del> <del> var script = scripts[0]; <del> var url = script.src.split('?cb='); <del> fakeWindow[url[1]]('data'); <del> script.onload(); <del> <del> expect(notify).toHaveBeenCalled(); <del> }); <del> <del> <del> it('should update the outstandingRequests counter for failed requests', function() { <del> var notify = jasmine.createSpy('notify'); <del> browser.xhr('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <del> browser.notifyWhenNoOutstandingRequests(notify); <del> expect(notify).not.toHaveBeenCalled(); <del> <del> scripts[0].onerror(); <del> <del> expect(notify).toHaveBeenCalled(); <del> }); <del> } <del> }); <del> <del> <del> it('should normalize IE\'s 1223 status code into 204', function() { <del> var callback = jasmine.createSpy('XHR'); <del> <del> browser.xhr('GET', 'URL', 'POST', callback); <del> <del> xhr.status = 1223; <del> xhr.readyState = 4; <del> xhr.onreadystatechange(); <del> <del> expect(callback).toHaveBeenCalled(); <del> expect(callback.argsForCall[0][0]).toEqual(204); <del> }); <del> <del> it('should set only the requested headers', function() { <del> var code, response, headers = {}; <del> browser.xhr('POST', 'URL', null, function(c,r){ <del> code = c; <del> response = r; <del> }, {'X-header1': 'value1', 'X-header2': 'value2'}); <del> <del> expect(xhr.method).toEqual('POST'); <del> expect(xhr.url).toEqual('URL'); <del> expect(xhr.post).toEqual(''); <del> expect(xhr.headers).toEqual({ <del> "X-header1":"value1", <del> "X-header2":"value2" <del> }); <del> <del> xhr.status = 202; <del> xhr.responseText = 'RESPONSE'; <del> xhr.readyState = 4; <del> xhr.onreadystatechange(); <del> <del> expect(code).toEqual(202); <del> expect(response).toEqual('RESPONSE'); <del> }); <del> <del> it('should return raw xhr object', function() { <del> expect(browser.xhr('GET', '/url', null, noop)).toBe(xhr); <del> }); <del> <del> it('should abort request on timeout', function() { <del> var callback = jasmine.createSpy('done').andCallFake(function(status, response) { <del> expect(status).toBe(-1); <del> }); <del> <del> browser.xhr('GET', '/url', null, callback, {}, 2000); <del> xhr.abort = jasmine.createSpy('xhr.abort'); <del> <del> fakeWindow.setTimeout.flush(); <del> expect(xhr.abort).toHaveBeenCalledOnce(); <del> <del> xhr.status = 0; <del> xhr.readyState = 4; <del> xhr.onreadystatechange(); <del> expect(callback).toHaveBeenCalledOnce(); <del> }); <del> <del> it('should be async even if xhr.send() is sync', function() { <del> // IE6, IE7 is sync when serving from cache <del> var xhr; <del> function FakeXhr() { <del> xhr = this; <del> this.open = this.setRequestHeader = noop; <del> this.send = function() { <del> this.status = 200; <del> this.responseText = 'response'; <del> this.readyState = 4; <del> }; <del> } <del> <del> var callback = jasmine.createSpy('done').andCallFake(function(status, response) { <del> expect(status).toBe(200); <del> expect(response).toBe('response'); <del> }); <del> <del> browser = new Browser(fakeWindow, jqLite(window.document), null, FakeXhr, null); <del> browser.xhr('GET', '/url', null, callback); <del> expect(callback).not.toHaveBeenCalled(); <del> <del> fakeWindow.setTimeout.flush(); <del> expect(callback).toHaveBeenCalledOnce(); <del> <del> (xhr.onreadystatechange || noop)(); <del> expect(callback).toHaveBeenCalledOnce(); <del> }); <del> }); <ide> <ide> describe('defer', function() { <ide> it('should execute fn asynchroniously via setTimeout', function() { <ide><path>test/service/httpBackendSpec.js <add>describe('$httpBackend', function() { <add> <add> var $backend, $browser, $window, <add> xhr, fakeBody, callback; <add> <add> // TODO(vojta): should be replaced by $defer mock <add> function fakeTimeout(fn, delay) { <add> fakeTimeout.fns.push(fn); <add> fakeTimeout.delays.push(delay); <add> } <add> <add> fakeTimeout.fns = []; <add> fakeTimeout.delays = []; <add> fakeTimeout.flush = function() { <add> var len = fakeTimeout.fns.length; <add> fakeTimeout.delays = []; <add> while (len--) fakeTimeout.fns.shift()(); <add> }; <add> <add> <add> beforeEach(inject(function($injector) { <add> $window = {}; <add> $browser = $injector.get('$browser'); <add> fakeBody = {removeChild: jasmine.createSpy('body.removeChild')}; <add> $backend = createHttpBackend($browser, MockXhr, fakeTimeout, $window, fakeBody); <add> callback = jasmine.createSpy('done'); <add> })); <add> <add> <add> it('should do basics - open async xhr and send data', function() { <add> $backend('GET', '/some-url', 'some-data', noop); <add> xhr = MockXhr.$$lastInstance; <add> <add> expect(xhr.$$method).toBe('GET'); <add> expect(xhr.$$url).toBe('/some-url'); <add> expect(xhr.$$data).toBe('some-data'); <add> expect(xhr.$$async).toBe(true); <add> }); <add> <add> <add> it('should normalize IE\'s 1223 status code into 204', function() { <add> callback.andCallFake(function(status) { <add> expect(status).toBe(204); <add> }); <add> <add> $backend('GET', 'URL', null, callback); <add> xhr = MockXhr.$$lastInstance; <add> <add> xhr.status = 1223; <add> xhr.readyState = 4; <add> xhr.onreadystatechange(); <add> <add> expect(callback).toHaveBeenCalledOnce(); <add> }); <add> <add> <add> it('should set only the requested headers', function() { <add> $backend('POST', 'URL', null, noop, {'X-header1': 'value1', 'X-header2': 'value2'}); <add> xhr = MockXhr.$$lastInstance; <add> <add> expect(xhr.$$headers).toEqual({ <add> 'X-header1': 'value1', <add> 'X-header2': 'value2' <add> }); <add> }); <add> <add> <add> it('should return raw xhr object', function() { <add> expect($backend('GET', '/url', null, noop)).toBe(MockXhr.$$lastInstance); <add> }); <add> <add> <add> it('should abort request on timeout', function() { <add> callback.andCallFake(function(status, response) { <add> expect(status).toBe(-1); <add> }); <add> <add> $backend('GET', '/url', null, callback, {}, 2000); <add> xhr = MockXhr.$$lastInstance; <add> spyOn(xhr, 'abort'); <add> <add> expect(fakeTimeout.delays[0]).toBe(2000); <add> <add> fakeTimeout.flush(); <add> expect(xhr.abort).toHaveBeenCalledOnce(); <add> <add> xhr.status = 0; <add> xhr.readyState = 4; <add> xhr.onreadystatechange(); <add> expect(callback).toHaveBeenCalledOnce(); <add> }); <add> <add> <add> it('should be async even if xhr.send() is sync', function() { <add> // IE6, IE7 is sync when serving from cache <add> function SyncXhr() { <add> xhr = this; <add> this.open = this.setRequestHeader = noop; <add> this.send = function() { <add> this.status = 200; <add> this.responseText = 'response'; <add> this.readyState = 4; <add> }; <add> } <add> <add> callback.andCallFake(function(status, response) { <add> expect(status).toBe(200); <add> expect(response).toBe('response'); <add> }); <add> <add> $backend = createHttpBackend($browser, SyncXhr, fakeTimeout); <add> $backend('GET', '/url', null, callback); <add> expect(callback).not.toHaveBeenCalled(); <add> <add> fakeTimeout.flush(); <add> expect(callback).toHaveBeenCalledOnce(); <add> <add> (xhr.onreadystatechange || noop)(); <add> expect(callback).toHaveBeenCalledOnce(); <add> }); <add> <add> <add> describe('JSONP', function() { <add> <add> it('should add script tag for JSONP request', function() { <add> callback.andCallFake(function(status, response) { <add> expect(status).toBe(200); <add> expect(response).toBe('some-data'); <add> }); <add> <add> $backend('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <add> expect($browser.$$scripts.length).toBe(1); <add> <add> var script = $browser.$$scripts.shift(), <add> url = script.url.split('?cb='); <add> <add> expect(url[0]).toBe('http://example.org/path'); <add> $window[url[1]]('some-data'); <add> script.done(); <add> <add> expect(callback).toHaveBeenCalledOnce(); <add> }); <add> <add> <add> it('should clean up the callback and remove the script', function() { <add> $backend('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <add> expect($browser.$$scripts.length).toBe(1); <add> <add> var script = $browser.$$scripts.shift(), <add> callbackId = script.url.split('?cb=')[1]; <add> <add> $window[callbackId]('some-data'); <add> script.done(); <add> <add> expect($window[callbackId]).toBeUndefined(); <add> expect(fakeBody.removeChild).toHaveBeenCalledOnce(); <add> expect(fakeBody.removeChild).toHaveBeenCalledWith(script); <add> }); <add> <add> <add> it('should call callback with status -2 when script fails to load', function() { <add> callback.andCallFake(function(status, response) { <add> expect(status).toBe(-2); <add> expect(response).toBeUndefined(); <add> }); <add> <add> $backend('JSONP', 'http://example.org/path?cb=JSON_CALLBACK', null, callback); <add> expect($browser.$$scripts.length).toBe(1); <add> <add> $browser.$$scripts.shift().done(); <add> expect(callback).toHaveBeenCalledOnce(); <add> }); <add> <add> <add> // TODO(vojta): test whether it fires "async-start" <add> // TODO(vojta): test whether it fires "async-end" on both success and error <add> }); <add>}); <add>
5
Javascript
Javascript
fix 404 export
fbd933bd2264b63c9035935f8f37d9edabde28f4
<ide><path>server/export.js <ide> export default async function (dir, options, configuration) { <ide> } <ide> <ide> if (page === '/_error') { <del> defaultPathMap['404'] = { page } <add> defaultPathMap['/404'] = { page } <ide> continue <ide> } <ide>
1
Python
Python
use layernorm and selu in tok2vec
3ed203de2504edd2b5470ecfa4ef8a5b2e382b2a
<ide><path>spacy/_ml.py <ide> from thinc.neural._classes.convolution import ExtractWindow <ide> from thinc.neural._classes.static_vectors import StaticVectors <ide> from thinc.neural._classes.batchnorm import BatchNorm <add>from thinc.neural._classes.layernorm import LayerNorm as LN <ide> from thinc.neural._classes.resnet import Residual <ide> from thinc.neural import ReLu <ide> from thinc.neural._classes.selu import SELU <ide> def Tok2Vec(width, embed_size, preprocess=None): <ide> with_flatten( <ide> asarray(Model.ops, dtype='uint64') <ide> >> uniqued(embed, column=5) <del> >> Maxout(width, width*4, pieces=3) <del> >> Residual(ExtractWindow(nW=1) >> Maxout(width, width*3)) <del> >> Residual(ExtractWindow(nW=1) >> Maxout(width, width*3)) <del> >> Residual(ExtractWindow(nW=1) >> Maxout(width, width*3)) <del> >> Residual(ExtractWindow(nW=1) >> Maxout(width, width*3)), <add> >> LN(Maxout(width, width*4, pieces=3)) <add> >> Residual(ExtractWindow(nW=1) >> SELU(width, width*3)) <add> >> Residual(ExtractWindow(nW=1) >> SELU(width, width*3)) <add> >> Residual(ExtractWindow(nW=1) >> SELU(width, width*3)) <add> >> Residual(ExtractWindow(nW=1) >> SELU(width, width*3)), <ide> pad=4) <ide> ) <ide> if preprocess not in (False, None):
1
Text
Text
add link to developer docs code conventions
c8f5b752bb00e4d83a92e4919ec2688d47b9aada
<ide><path>CONTRIBUTING.md <ide> except: # noqa: E722 <ide> <ide> ### Python conventions <ide> <del>All Python code must be written **compatible with Python 3.6+**. <add>All Python code must be written **compatible with Python 3.6+**. More detailed <add>code conventions can be found in the [developer docs](https://github.com/explosion/spaCy/blob/master/extra/DEVELOPER_DOCS/Code%20Conventions.md). <ide> <ide> #### I/O and handling paths <ide>
1
Python
Python
fix unicode header in tests
c4be9c36fe969a590e875aaba1d33ce940083967
<ide><path>spacy/tests/regression/test_issue758.py <add>from __future__ import unicode_literals <ide> from ... import load as load_spacy <ide> from ...attrs import LEMMA <ide> from ...matcher import merge_phrase <ide><path>spacy/tests/regression/test_issue995.py <add>from __future__ import unicode_literals <add> <ide> import pytest <ide> from ... import load as load_spacy <ide>
2
PHP
PHP
use viewerrorbag instead of messagebag
38f8a4933543ef9390cfd0e0963359a6ad650e9c
<ide><path>src/Illuminate/View/View.php <ide> use Illuminate\Support\MessageBag; <ide> use Illuminate\Support\Str; <ide> use Illuminate\Support\Traits\Macroable; <add>use Illuminate\Support\ViewErrorBag; <ide> use Throwable; <ide> <ide> class View implements ArrayAccess, Htmlable, ViewContract <ide> public function nest($key, $view, array $data = []) <ide> * @param \Illuminate\Contracts\Support\MessageProvider|array $provider <ide> * @return $this <ide> */ <del> public function withErrors($provider) <add> public function withErrors($provider, $key = 'default') <ide> { <del> $this->with('errors', $this->formatErrors($provider)); <add> $value = $this->parseErrors($provider); <add> <add> $errors = new ViewErrorBag; <add> <add> $this->with('errors', $errors->put($key, $value)); <ide> <ide> return $this; <ide> } <ide> <ide> /** <del> * Format the given message provider into a MessageBag. <add> * Parse the given errors into an appropriate value. <ide> * <del> * @param \Illuminate\Contracts\Support\MessageProvider|array $provider <add> * @param \Illuminate\Contracts\Support\MessageProvider|array|string $provider <ide> * @return \Illuminate\Support\MessageBag <ide> */ <del> protected function formatErrors($provider) <add> protected function parseErrors($provider) <ide> { <del> return $provider instanceof MessageProvider <del> ? $provider->getMessageBag() : new MessageBag((array) $provider); <add> if ($provider instanceof MessageProvider) { <add> return $provider->getMessageBag(); <add> } <add> <add> return new MessageBag((array) $provider); <ide> } <ide> <ide> /** <ide><path>tests/View/ViewTest.php <ide> use Illuminate\Contracts\Support\Renderable; <ide> use Illuminate\Contracts\View\Engine; <ide> use Illuminate\Support\MessageBag; <add>use Illuminate\Support\ViewErrorBag; <ide> use Illuminate\View\Factory; <ide> use Illuminate\View\View; <ide> use Mockery as m; <ide> public function testWithErrors() <ide> $view = $this->getView(); <ide> $errors = ['foo' => 'bar', 'qu' => 'ux']; <ide> $this->assertSame($view, $view->withErrors($errors)); <del> $this->assertInstanceOf(MessageBag::class, $view->errors); <add> $this->assertInstanceOf(ViewErrorBag::class, $view->errors); <ide> $foo = $view->errors->get('foo'); <ide> $this->assertEquals($foo[0], 'bar'); <ide> $qu = $view->errors->get('qu'); <ide> public function testWithErrors() <ide> $this->assertSame($view, $view->withErrors(new MessageBag($data))); <ide> $foo = $view->errors->get('foo'); <ide> $this->assertEquals($foo[0], 'baz'); <add> $foo = $view->errors->getBag('default')->get('foo'); <add> $this->assertEquals($foo[0], 'baz'); <add> $this->assertSame($view, $view->withErrors(new MessageBag($data), 'login')); <add> $foo = $view->errors->getBag('login')->get('foo'); <add> $this->assertEquals($foo[0], 'baz'); <ide> } <ide> <ide> protected function getView($data = [])
2
Python
Python
add some tests to the slow suite
db0b2477ccb5f9ac44ec9656ff95659c58af953c
<ide><path>tests/test_modeling_bigbird_pegasus.py <ide> def test_generate_fp16(self): <ide> model.generate(**input_dict) <ide> model.generate(**input_dict, do_sample=True, early_stopping=False, num_return_sequences=3) <ide> <add> @slow <ide> def test_batched_forward_original_full(self): <ide> self._check_batched_forward(attn_type="original_full") <ide> <add> @slow <ide> def test_batched_forward_block_sparse(self): <ide> self._check_batched_forward(attn_type="block_sparse", tolerance=1e-1) <ide> <ide><path>tests/test_modeling_common.py <ide> def test_attention_outputs(self): <ide> [self.model_tester.num_attention_heads, encoder_seq_length, encoder_key_length], <ide> ) <ide> <add> @slow <ide> def test_torchscript(self): <ide> config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() <ide> self._create_and_check_torchscript(config, inputs_dict) <ide> <add> @slow <ide> def test_torchscript_output_attentions(self): <ide> config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() <ide> config.output_attentions = True <ide> self._create_and_check_torchscript(config, inputs_dict) <ide> <add> @slow <ide> def test_torchscript_output_hidden_state(self): <ide> config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common() <ide> config.output_hidden_states = True
2
Ruby
Ruby
remove unused argument
e2f3e0dc50a30c8600df6dc8106dca67d4cd0961
<ide><path>actionpack/test/controller/http_token_authentication_test.rb <ide> def show <ide> private <ide> <ide> def authenticate <del> authenticate_or_request_with_http_token do |token, options| <add> authenticate_or_request_with_http_token do |token, _| <ide> token == 'lifo' <ide> end <ide> end
1
Text
Text
fix small typo
c6108afdc7f731c5ca655aa4b1827080b836d42a
<ide><path>docs/docs/05-reusable-components.md <ide> class HelloMessage extends React.Component { <ide> React.render(<HelloMessage name="Sebastian" />, mountNode); <ide> ``` <ide> <del>The API is similar to `React.createClass` with the exception or `getInitialState`. Instead of providing a separate `getInitialState` method, you set up your own `state` property in the constructor. <add>The API is similar to `React.createClass` with the exception of `getInitialState`. Instead of providing a separate `getInitialState` method, you set up your own `state` property in the constructor. <ide> <ide> Another difference is that `propTypes` and `defaultProps` are defined as properties on the constructor instead of in the class body. <ide>
1
Text
Text
update signature algorithm in release doc
c5fc802abc54ca20e047c727868543c3d8cb4093
<ide><path>doc/releases.md <ide> however. <ide> computer. <ide> <ide> **e.** Sign the `SHASUMS256.txt` file using a command similar to: `gpg <del>--default-key YOURKEY --clearsign /path/to/SHASUMS256.txt`. You will be prompted <del>by GPG for your password. The signed file will be named `SHASUMS256.txt.asc`. <add>--default-key YOURKEY --digest-algo SHA256 --clearsign /path/to/SHASUMS256.txt`. <add>You will be prompted by GPG for your password. The signed file will be named <add>SHASUMS256.txt.asc. <ide> <ide> **f.** Output an ASCII armored version of your public GPG key using a command <del>similar to: `gpg --default-key YOURKEY --armor --export --output <del>/path/to/SHASUMS256.txt.gpg`. This does not require your password and is mainly <del>a convenience for users, although not the recommended way to get a copy of your <del>key. <add>similar to: `gpg --default-key YOURKEY --digest-algo SHA256 --detach-sign /path/to/SHASUMS256.txt`. <add>You will be prompted by GPG for your password. The signed file will be named <add>SHASUMS256.txt.sig. <ide> <ide> **g.** Upload the `SHASUMS256.txt` files back to the server into the release <ide> directory. <ide> release, you should re-run `tools/release.sh` after the ARM builds have <ide> finished. That will move the ARM artifacts into the correct location. You will <ide> be prompted to re-sign `SHASUMS256.txt`. <ide> <del>It is possible to only sign a release by running `./tools/release.sh -s <del>vX.Y.Z`. <add>**It is possible to only sign a release by running `./tools/release.sh -s <add>vX.Y.Z`.** <ide> <ide> ### 14. Check the Release <ide>
1
Python
Python
set version to v3.0.0rc5
e8674c5c42412d79ad4942113c74c047981f8288
<ide><path>spacy/about.py <ide> # fmt: off <ide> __title__ = "spacy-nightly" <del>__version__ = "3.0.0rc4" <add>__version__ = "3.0.0rc5" <ide> __download_url__ = "https://github.com/explosion/spacy-models/releases/download" <ide> __compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" <ide> __projects__ = "https://github.com/explosion/projects"
1
Java
Java
fix failing tests from reactor snapshot changes
d49a7a105d0b4a19abce778d128f35d3452e558d
<ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/result/method/SyncInvocableHandlerMethod.java <ide> public ParameterNameDiscoverer getParameterNameDiscoverer() { <ide> public HandlerResult invokeForHandlerResult(ServerWebExchange exchange, <ide> BindingContext bindingContext, Object... providedArgs) { <ide> <del> MonoProcessor<HandlerResult> processor = MonoProcessor.fromSink(Sinks.one()); <add> MonoProcessor<HandlerResult> processor = MonoProcessor.fromSink(Sinks.unsafe().one()); <ide> this.delegate.invoke(exchange, bindingContext, providedArgs).subscribeWith(processor); <ide> <ide> if (processor.isTerminated()) { <ide><path>spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java <ide> void subProtocol(WebSocketClient client, HttpServer server, Class<?> serverConfi <ide> <ide> String protocol = "echo-v1"; <ide> AtomicReference<HandshakeInfo> infoRef = new AtomicReference<>(); <del> MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one()); <add> MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.unsafe().one()); <ide> <ide> this.client.execute(getUrl("/sub-protocol"), <ide> new WebSocketHandler() { <ide> void customHeader(WebSocketClient client, HttpServer server, Class<?> serverConf <ide> <ide> HttpHeaders headers = new HttpHeaders(); <ide> headers.add("my-header", "my-value"); <del> MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one()); <add> MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.unsafe().one()); <ide> <ide> this.client.execute(getUrl("/custom-header"), headers, <ide> session -> session.receive() <ide> void customHeader(WebSocketClient client, HttpServer server, Class<?> serverConf <ide> void sessionClosing(WebSocketClient client, HttpServer server, Class<?> serverConfigClass) throws Exception { <ide> startServer(client, server, serverConfigClass); <ide> <del> MonoProcessor<CloseStatus> statusProcessor = MonoProcessor.fromSink(Sinks.one()); <add> MonoProcessor<CloseStatus> statusProcessor = MonoProcessor.fromSink(Sinks.unsafe().one()); <ide> this.client.execute(getUrl("/close"), <ide> session -> { <ide> logger.debug("Starting.."); <ide> void sessionClosing(WebSocketClient client, HttpServer server, Class<?> serverCo <ide> void cookie(WebSocketClient client, HttpServer server, Class<?> serverConfigClass) throws Exception { <ide> startServer(client, server, serverConfigClass); <ide> <del> MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one()); <add> MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.unsafe().one()); <ide> AtomicReference<String> cookie = new AtomicReference<>(); <ide> this.client.execute(getUrl("/cookie"), <ide> session -> {
2
Python
Python
factorize some code using contextdecorator
191d953c99b2b437370612fb63b1247a4f543e5e
<ide><path>django/db/transaction.py <del>from functools import wraps <del> <ide> from django.db import ( <ide> connections, DEFAULT_DB_ALIAS, <ide> DatabaseError, Error, ProgrammingError) <del>from django.utils.decorators import available_attrs <add>from django.utils.decorators import ContextDecorator <ide> <ide> <ide> class TransactionManagementError(ProgrammingError): <ide> def set_rollback(rollback, using=None): <ide> # Decorators / context managers # <ide> ################################# <ide> <del>class Atomic(object): <add>class Atomic(ContextDecorator): <ide> """ <ide> This class guarantees the atomic execution of a given block. <ide> <ide> def __exit__(self, exc_type, exc_value, traceback): <ide> else: <ide> connection.in_atomic_block = False <ide> <del> def __call__(self, func): <del> @wraps(func, assigned=available_attrs(func)) <del> def inner(*args, **kwargs): <del> with self: <del> return func(*args, **kwargs) <del> return inner <del> <ide> <ide> def atomic(using=None, savepoint=True): <ide> # Bare decorator: @atomic -- although the first argument is called <ide><path>django/test/utils.py <ide> from django.template.loaders import cached <ide> from django.test.signals import template_rendered, setting_changed <ide> from django.utils import six <add>from django.utils.decorators import ContextDecorator <ide> from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning <ide> from django.utils.encoding import force_str <ide> from django.utils.translation import deactivate <ide> def get_runner(settings, test_runner_class=None): <ide> return test_runner <ide> <ide> <del>class override_template_loaders(object): <add>class override_template_loaders(ContextDecorator): <ide> """ <ide> Acts as a function decorator, context manager or start/end manager and <ide> override the template loaders. It could be used in the following ways: <ide> def __enter__(self): <ide> def __exit__(self, type, value, traceback): <ide> loader.template_source_loaders = self.old_loaders <ide> <del> def __call__(self, test_func): <del> @wraps(test_func) <del> def inner(*args, **kwargs): <del> with self: <del> return test_func(*args, **kwargs) <del> return inner <del> <ide> @classmethod <ide> def override(cls, *loaders): <ide> if hasattr(loader, RESTORE_LOADERS_ATTR): <ide><path>django/utils/decorators.py <ide> "Functions that help with dynamically creating decorators for views." <ide> <add>try: <add> from contextlib import ContextDecorator <add>except ImportError: <add> ContextDecorator = None <add> <ide> from functools import wraps, update_wrapper, WRAPPER_ASSIGNMENTS <ide> <ide> from django.utils import six <ide> def _wrapped_view(request, *args, **kwargs): <ide> return _wrapped_view <ide> return _decorator <ide> return _make_decorator <add> <add> <add>if ContextDecorator is None: <add> # ContextDecorator was introduced in Python 3.2 <add> # See https://docs.python.org/3/library/contextlib.html#contextlib.ContextDecorator <add> class ContextDecorator(object): <add> """ <add> A base class that enables a context manager to also be used as a decorator. <add> """ <add> def __call__(self, func): <add> @wraps(func, assigned=available_attrs(func)) <add> def inner(*args, **kwargs): <add> with self: <add> return func(*args, **kwargs) <add> return inner
3
Text
Text
fix worker.resourcelimits type
c8ca99f7ab2f01bc1eff729a543e39d05d2aa775
<ide><path>doc/api/worker_threads.md <ide> When this function is used, no `'message'` event will be emitted and the <ide> added: v13.2.0 <ide> --> <ide> <del>* {Object|undefined} <add>* {Object} <ide> * `maxYoungGenerationSizeMb` {number} <ide> * `maxOldGenerationSizeMb` {number} <ide> * `codeRangeSizeMb` {number}
1
Python
Python
fix an error message in bigbird
5bc779ae287bf6940cdcfb2616b38d8776bab87f
<ide><path>src/transformers/models/big_bird/modeling_big_bird.py <ide> def torch_gather_b2(params, indices): <ide> if params.shape[:2] != indices.shape[:2]: <ide> raise ValueError( <ide> "Make sure that the first two dimensions of params and indices are identical, but" <del> f" they are params: {params.shape[:2]} vs. indices: {params.shape[:2]}" <add> f" they are params: {params.shape[:2]} vs. indices: {indices.shape[:2]}" <ide> ) <ide> num_indices_to_gather = indices.shape[-2] * indices.shape[-1] <ide> num_indices_to_pick_from = params.shape[2] <ide><path>src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py <ide> def torch_gather_b2(params, indices): <ide> if params.shape[:2] != indices.shape[:2]: <ide> raise ValueError( <ide> "Make sure that the first two dimensions of params and indices are identical, but" <del> f" they are params: {params.shape[:2]} vs. indices: {params.shape[:2]}" <add> f" they are params: {params.shape[:2]} vs. indices: {indices.shape[:2]}" <ide> ) <ide> num_indices_to_gather = indices.shape[-2] * indices.shape[-1] <ide> num_indices_to_pick_from = params.shape[2]
2
Ruby
Ruby
use ternary instead of inline rescue
e92a87179a2f90d8a43731b67adcd0b0b104a0eb
<ide><path>Library/Homebrew/tab.rb <ide> def self.for_formula f <ide> def self.dummy_tab f=nil <ide> attributes = { <ide> :used_options => [], <del> :unused_options => (f.options.as_flags rescue []), <add> :unused_options => f ? f.options.as_flags : [], <ide> :built_as_bottle => false, <ide> :poured_from_bottle => false, <ide> :tapped_from => "",
1
Java
Java
fix issue with subscribe destination
1200755125f97c2f1035586081645bb244b06304
<ide><path>spring-messaging/src/main/java/org/springframework/messaging/simp/user/UserDestinationMessageHandler.java <ide> public void handleMessage(Message<?> message) throws MessagingException { <ide> } <ide> if (SimpMessageType.MESSAGE.equals(SimpMessageHeaderAccessor.getMessageType(message.getHeaders()))) { <ide> SimpMessageHeaderAccessor headerAccessor = SimpMessageHeaderAccessor.wrap(message); <del> if (getHeaderInitializer() != null) { <del> getHeaderInitializer().initHeaders(headerAccessor); <del> } <del> headerAccessor.setHeader(SimpMessageHeaderAccessor.ORIGINAL_DESTINATION, result.getSubscribeDestination()); <add> initHeaders(headerAccessor); <add> headerAccessor.setNativeHeader(SimpMessageHeaderAccessor.ORIGINAL_DESTINATION, result.getSubscribeDestination()); <ide> message = MessageBuilder.createMessage(message.getPayload(), headerAccessor.getMessageHeaders()); <ide> } <ide> for (String destination : destinations) { <ide> public void handleMessage(Message<?> message) throws MessagingException { <ide> } <ide> } <ide> <add> private void initHeaders(SimpMessageHeaderAccessor headerAccessor) { <add> if (getHeaderInitializer() != null) { <add> getHeaderInitializer().initHeaders(headerAccessor); <add> } <add> } <add> <ide> } <ide><path>spring-messaging/src/test/java/org/springframework/messaging/simp/user/UserDestinationMessageHandlerTests.java <ide> public void handleMessage() { <ide> ArgumentCaptor<Message> captor = ArgumentCaptor.forClass(Message.class); <ide> Mockito.verify(this.brokerChannel).send(captor.capture()); <ide> <del> assertEquals("/queue/foo-user123", SimpMessageHeaderAccessor.getDestination(captor.getValue().getHeaders())); <del> assertEquals("/user/queue/foo", captor.getValue().getHeaders().get(SimpMessageHeaderAccessor.ORIGINAL_DESTINATION)); <add> SimpMessageHeaderAccessor accessor = SimpMessageHeaderAccessor.wrap(captor.getValue()); <add> assertEquals("/queue/foo-user123", accessor.getDestination()); <add> assertEquals("/user/queue/foo", accessor.getFirstNativeHeader(SimpMessageHeaderAccessor.ORIGINAL_DESTINATION)); <ide> } <ide> <ide> <ide><path>spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java <ide> else if (stompAccessor.getCommand() == null || StompCommand.SEND.equals(stompAcc <ide> logger.error("Ignoring message, no subscriptionId header: " + message); <ide> return; <ide> } <del> String header = SimpMessageHeaderAccessor.ORIGINAL_DESTINATION; <del> if (message.getHeaders().containsKey(header)) { <add> String origDestination = stompAccessor.getFirstNativeHeader(SimpMessageHeaderAccessor.ORIGINAL_DESTINATION); <add> if (origDestination != null) { <ide> stompAccessor = toMutableAccessor(stompAccessor, message); <del> stompAccessor.setDestination((String) message.getHeaders().get(header)); <add> stompAccessor.setDestination(origDestination); <ide> } <ide> } <ide> else if (StompCommand.CONNECTED.equals(command)) { <ide><path>spring-websocket/src/test/java/org/springframework/web/socket/messaging/StompSubProtocolHandlerTests.java <ide> public void handleMessageToClientUserDestination() { <ide> headers.setMessageId("mess0"); <ide> headers.setSubscriptionId("sub0"); <ide> headers.setDestination("/queue/foo-user123"); <del> headers.setHeader(StompHeaderAccessor.ORIGINAL_DESTINATION, "/user/queue/foo"); <add> headers.setNativeHeader(StompHeaderAccessor.ORIGINAL_DESTINATION, "/user/queue/foo"); <ide> Message<byte[]> message = MessageBuilder.createMessage(EMPTY_PAYLOAD, headers.getMessageHeaders()); <ide> this.protocolHandler.handleMessageToClient(this.session, message); <ide>
4
Python
Python
add place-holder for doc.glossary
9ad992f74222d99ed2f66c5e3e9a2a90cdc31cd2
<ide><path>numpy/doc/reference/glossary.py <add>""" <add> <add>================= <add>Glossary <add>================= <add> <add>Place-holder for a glossary. <add> <add>"""
1
Python
Python
calculate gst amount
d33f9b31fe96acf5201c39f565015444526a3e38
<ide><path>financial/price_plus_tax.py <add>""" <add>Calculate price plus tax of a good or service given its price and a tax rate. <add>""" <add> <add> <add>def price_plus_tax(price: float, tax_rate: float) -> float: <add> """ <add> >>> price_plus_tax(100, 0.25) <add> 125.0 <add> >>> price_plus_tax(125.50, 0.05) <add> 131.775 <add> """ <add> return price * (1 + tax_rate) <add> <add> <add>if __name__ == "__main__": <add> print(f"{price_plus_tax(100, 0.25) = }") <add> print(f"{price_plus_tax(125.50, 0.05) = }")
1
Text
Text
add build status from travis (#4)
95b5c479fc19a37465515b20bf1624853a91d87b
<ide><path>README.md <ide> ## freeCodeCamp Curriculum <ide> <add>[![Build Status](https://travis-ci.org/freeCodeCamp/curriculum.svg?branch=master)](https://travis-ci.org/freeCodeCamp/curriculum) <add> <ide> This package contains the "seed" files used in the freeCodeCamp Curriculum. <ide> <ide> ### Installation <ide> getChallenges() // will provide an array of blocks i.e. basic CSS, functional pr <ide> ``` <ide> #### `block` Structure <ide> <del>```json <add>```js <ide> { <ide> "name": "ES6", <ide> "order": 2, <ide> getChallenges() // will provide an array of blocks i.e. basic CSS, functional pr <ide> <ide> #### `challenge` Structure <ide> <del>```json <add>```js <ide> { <ide> "id": "ObjectId()", <ide> "title": "Declare a Read-Only Variable with the const Keyword", <ide> getChallenges() // will provide an array of blocks i.e. basic CSS, functional pr <ide> } <ide> }, <ide> ``` <del>
1
Go
Go
increase concucrrent query limit
088c3cafb28355ff128092cc7f8fee7b1f443d2e
<ide><path>libnetwork/resolver.go <ide> const ( <ide> maxExtDNS = 3 //max number of external servers to try <ide> extIOTimeout = 4 * time.Second <ide> defaultRespSize = 512 <del> maxConcurrent = 50 <add> maxConcurrent = 100 <ide> logInterval = 2 * time.Second <ide> maxDNSID = 65536 <ide> ) <ide> func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) { <ide> old := r.tStamp <ide> r.tStamp = time.Now() <ide> if r.tStamp.Sub(old) > logInterval { <del> log.Errorf("More than %v concurrent queries from %s", maxConcurrent, w.LocalAddr().String()) <add> log.Errorf("More than %v concurrent queries from %s", maxConcurrent, extConn.LocalAddr().String()) <ide> } <ide> continue <ide> } <ide> func (r *resolver) forwardQueryStart(w dns.ResponseWriter, msg *dns.Msg, queryID <ide> for ok := true; ok == true; dnsID = uint16(rand.Intn(maxDNSID)) { <ide> _, ok = r.client[dnsID] <ide> } <del> log.Debugf("client dns id %v, changed id %v", msg.Id, dnsID) <add> log.Debugf("client dns id %v, changed id %v", queryID, dnsID) <ide> r.client[dnsID] = cc <ide> msg.Id = dnsID <ide> default: <ide> func (r *resolver) forwardQueryEnd(w dns.ResponseWriter, msg *dns.Msg) dns.Respo <ide> log.Debugf("Can't retrieve client context for dns id %v", msg.Id) <ide> return nil <ide> } <add> log.Debugf("dns msg id %v, client id %v", msg.Id, cc.dnsID) <ide> delete(r.client, msg.Id) <ide> msg.Id = cc.dnsID <ide> w = cc.respWriter <ide><path>libnetwork/sandbox.go <ide> func (sb *sandbox) ResolveName(name string, ipType int) ([]net.IP, bool) { <ide> // {a.b in network c.d}, <ide> // {a in network b.c.d}, <ide> <add> log.Debugf("Name To resolve: %v", name) <ide> name = strings.TrimSuffix(name, ".") <ide> reqName := []string{name} <ide> networkName := []string{""} <ide> func (sb *sandbox) ResolveName(name string, ipType int) ([]net.IP, bool) { <ide> <ide> epList := sb.getConnectedEndpoints() <ide> for i := 0; i < len(reqName); i++ { <del> log.Debugf("To resolve: %v in %v", reqName[i], networkName[i]) <ide> <ide> // First check for local container alias <ide> ip, ipv6Miss := sb.resolveName(reqName[i], networkName[i], epList, true, ipType)
2
Javascript
Javascript
add filehandle sync() and datasync() tests
71ca076ca74b4e371c74c72d9556352adee654f6
<ide><path>test/parallel/test-fs-promises-file-handle-sync.js <add>'use strict'; <add>const common = require('../common'); <add>const assert = require('assert'); <add>const fixtures = require('../common/fixtures'); <add>const tmpdir = require('../common/tmpdir'); <add> <add>const { access, copyFile, open } = require('fs').promises; <add>const path = require('path'); <add> <add>common.crashOnUnhandledRejection(); <add> <add>async function validateSync() { <add> tmpdir.refresh(); <add> const dest = path.resolve(tmpdir.path, 'baz.js'); <add> await copyFile(fixtures.path('baz.js'), dest); <add> await access(dest, 'r'); <add> const handle = await open(dest, 'r+'); <add> await handle.datasync(); <add> await handle.sync(); <add> const buf = Buffer.from('hello world'); <add> await handle.write(buf); <add> const ret = await handle.read(Buffer.alloc(11), 0, 11, 0); <add> assert.strictEqual(ret.bytesRead, 11); <add> assert.deepStrictEqual(ret.buffer, buf); <add>} <add> <add>validateSync();
1
Javascript
Javascript
update dynamicimport default, add test case
b254f350a7179d058704dc1226a34ac48b2f5c2f
<ide><path>lib/config/defaults.js <ide> const applyOutputDefaults = ( <ide> ); <ide> F(output.environment, "forOf", () => tp && optimistic(tp.forOf)); <ide> F(output.environment, "bigIntLiteral", () => tp && tp.bigIntLiteral); <del> F(output.environment, "dynamicImport", () => tp && tp.dynamicImport); <add> F( <add> output.environment, <add> "dynamicImport", <add> () => tp && conditionallyOptimistic(tp.dynamicImport, output.module) <add> ); <ide> F( <ide> output.environment, <ide> "module", <ide><path>test/Defaults.unittest.js <ide> describe("Defaults", () => { <ide> - "chunkFilename": "[name].js", <ide> + "chunkFilename": "[name].mjs", <ide> <add> - "dynamicImport": undefined, <add> + "dynamicImport": true, <add> <ide> - "module": undefined, <ide> + "module": true, <ide> <ide><path>test/configCases/output-module/check-defaults/errors.js <add>module.exports = [ <add> [/For the selected environment is no default ESM chunk format available/] <add>]; <ide><path>test/configCases/output-module/check-defaults/index.js <add>it("should compile and run", () => { <add> expect(import.meta.url).toBe(import.meta.url); <add>}); <ide><path>test/configCases/output-module/check-defaults/webpack.config.js <add>/** @type {import("../../../../").Configuration[]} */ <add>module.exports = [ <add> { <add> experiments: { <add> outputModule: true <add> }, <add> devtool: false, <add> target: "web" <add> }, <add> { <add> experiments: { <add> outputModule: true <add> }, <add> devtool: false, <add> target: "node10" <add> } <add>];
5
Javascript
Javascript
fix more forwardref displaynames
d1336ab16efc26449509b938dd46cf606d3caf34
<ide><path>Libraries/Components/ActivityIndicator/ActivityIndicator.js <ide> type Props = $ReadOnly<{| <ide> * See http://facebook.github.io/react-native/docs/activityindicator.html <ide> */ <ide> const ActivityIndicator = ( <del> props: $ReadOnly<{| <del> ...Props, <del> forwardedRef?: ?React.Ref<'RCTActivityIndicatorView'>, <del> |}>, <add> props: Props, <add> forwardedRef: ?React.Ref<'RCTActivityIndicatorView'>, <ide> ) => { <del> const {onLayout, style, forwardedRef, ...restProps} = props; <add> const {onLayout, style, ...restProps} = props; <ide> let sizeStyle; <ide> <ide> switch (props.size) { <ide> const ActivityIndicator = ( <ide> }; <ide> <ide> return ( <del> <View onLayout={onLayout} style={[styles.container, style]}> <add> <View <add> onLayout={onLayout} <add> style={StyleSheet.compose( <add> styles.container, <add> style, <add> )}> <ide> <RCTActivityIndicator {...nativeProps} /> <ide> </View> <ide> ); <ide> }; <del> <add>ActivityIndicator.displayName = 'ActivityIndicator'; // TODO(T30332650) remove workaround for hermes bug <ide> // $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. <del>const ActivityIndicatorWithRef = React.forwardRef((props: Props, ref) => { <del> return <ActivityIndicator {...props} forwardedRef={ref} />; <del>}); <add>const ActivityIndicatorWithRef = React.forwardRef(ActivityIndicator); <ide> <ide> ActivityIndicatorWithRef.defaultProps = { <ide> animating: true, <ide> color: Platform.OS === 'ios' ? GRAY : null, <ide> hidesWhenStopped: true, <ide> size: 'small', <ide> }; <del>ActivityIndicatorWithRef.displayName = 'ActivityIndicator'; <ide> <ide> const styles = StyleSheet.create({ <ide> container: { <ide><path>Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js <ide> * This source code is licensed under the MIT license found in the <ide> * LICENSE file in the root directory of this source tree. <ide> * <add> * @flow <ide> * @format <ide> */ <ide> <ide> 'use strict'; <ide> <del>const ColorPropType = require('ColorPropType'); <del>const PropTypes = require('prop-types'); <ide> const React = require('React'); <del>const ViewPropTypes = require('ViewPropTypes'); <ide> <ide> const requireNativeComponent = require('requireNativeComponent'); <ide> <del>const STYLE_ATTRIBUTES = [ <del> 'Horizontal', <del> 'Normal', <del> 'Small', <del> 'Large', <del> 'Inverse', <del> 'SmallInverse', <del> 'LargeInverse', <del>]; <add>const RCTAndroidProgressBar = requireNativeComponent('AndroidProgressBar'); <ide> <del>const indeterminateType = function(props, propName, componentName, ...rest) { <del> const checker = function() { <del> const indeterminate = props[propName]; <del> const styleAttr = props.styleAttr; <del> if (!indeterminate && styleAttr !== 'Horizontal') { <del> return new Error( <del> 'indeterminate=false is only valid for styleAttr=Horizontal', <del> ); <del> } <del> }; <add>import type {NativeComponent} from 'ReactNative'; <add>import type {ViewProps} from 'ViewPropTypes'; <ide> <del> return PropTypes.bool(props, propName, componentName, ...rest) || checker(); <del>}; <add>type Props = $ReadOnly<{| <add> ...ViewProps, <add> <add> /** <add> * Style of the ProgressBar and whether it shows indeterminate progress (e.g. spinner). <add> * <add> * `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a <add> * `progress` value. <add> */ <add> ... <add> | {| <add> styleAttr: 'Horizontal', <add> indeterminate: false, <add> progress: number, <add> |} <add> | {| <add> typeAttr: <add> | 'Horizontal' <add> | 'Normal' <add> | 'Small' <add> | 'Large' <add> | 'Inverse' <add> | 'SmallInverse' <add> | 'LargeInverse', <add> indeterminate: true, <add> |}, <add> /** <add> * Whether to show the ProgressBar (true, the default) or hide it (false). <add> */ <add> animating?: ?boolean, <add> /** <add> * Color of the progress bar. <add> */ <add> color?: ?string, <add> /** <add> * Used to locate this view in end-to-end tests. <add> */ <add> testID?: ?string, <add>|}>; <ide> <ide> /** <ide> * React component that wraps the Android-only `ProgressBar`. This component is <ide> const indeterminateType = function(props, propName, componentName, ...rest) { <ide> * }, <ide> * ``` <ide> */ <del>class ProgressBarAndroid extends React.Component { <del> static propTypes = { <del> ...ViewPropTypes, <del> <del> /** <del> * Style of the ProgressBar. One of: <del> * <del> * - Horizontal <del> * - Normal (default) <del> * - Small <del> * - Large <del> * - Inverse <del> * - SmallInverse <del> * - LargeInverse <del> */ <del> styleAttr: PropTypes.oneOf(STYLE_ATTRIBUTES), <del> /** <del> * Whether to show the ProgressBar (true, the default) or hide it (false). <del> */ <del> animating: PropTypes.bool, <del> /** <del> * If the progress bar will show indeterminate progress. Note that this <del> * can only be false if styleAttr is Horizontal. <del> */ <del> indeterminate: indeterminateType, <del> /** <del> * The progress value (between 0 and 1). <del> */ <del> progress: PropTypes.number, <del> /** <del> * Color of the progress bar. <del> */ <del> color: ColorPropType, <del> /** <del> * Used to locate this view in end-to-end tests. <del> */ <del> testID: PropTypes.string, <del> }; <del> <del> static defaultProps = { <del> styleAttr: 'Normal', <del> indeterminate: true, <del> animating: true, <del> }; <del> <del> render() { <del> const {forwardedRef, ...props} = this.props; <del> return <AndroidProgressBar {...props} ref={forwardedRef} />; <del> } <del>} <add>const ProgressBarAndroid = ( <add> props: Props, <add> forwardedRef: ?React.Ref<'RCTAndroidProgressBar'>, <add>) => { <add> return <RCTAndroidProgressBar {...props} ref={forwardedRef} />; <add>}; <add>ProgressBarAndroid.displayName = 'ProgressBarAndroid'; // TODO(T30332650) remove bug workaround <ide> <del>const AndroidProgressBar = requireNativeComponent('AndroidProgressBar'); <add>ProgressBarAndroid.defaultProps = { <add> styleAttr: 'Normal', <add> indeterminate: true, <add> animating: true, <add>}; <add>// $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. <add>const ProgressBarAndroidToExport = React.forwardRef(ProgressBarAndroid); <ide> <del>module.exports = React.forwardRef((props, ref) => ( <del> <ProgressBarAndroid {...props} forwardedRef={ref} /> <del>)); <add>module.exports = (ProgressBarAndroidToExport: Class<NativeComponent<Props>>); <ide><path>Libraries/Components/Slider/Slider.js <ide> const Slider = ( <ide> /> <ide> ); <ide> }; <add>Slider.displayName = 'Slider'; // TODO(T30332650) remove bug workaround <ide> <ide> // $FlowFixMe - TODO T29156721 `React.forwardRef` is not defined in Flow, yet. <ide> const SliderWithRef = React.forwardRef(Slider); <ide> SliderWithRef.defaultProps = { <ide> maximumValue: 1, <ide> step: 0, <ide> }; <del>SliderWithRef.displayName = 'Slider'; <del> <del>let styles; <del>if (Platform.OS === 'ios') { <del> styles = StyleSheet.create({ <del> slider: { <del> height: 40, <del> }, <del> }); <del>} else { <del> styles = StyleSheet.create({ <del> slider: {}, <del> }); <del>} <add> <add>const styles = StyleSheet.create({ <add> slider: Platform.OS === 'ios' ? {height: 40} : {}, <add>}); <ide> <ide> module.exports = (SliderWithRef: Class<ReactNative.NativeComponent<Props>>);
3
Java
Java
add methods to (un)register handlermethod mappings
8f558e7c73fd885676a3e9bfe77c9c24da59f30a
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java <ide> import java.util.Map; <ide> import java.util.Set; <ide> import java.util.concurrent.ConcurrentHashMap; <add>import java.util.concurrent.locks.ReentrantReadWriteLock; <ide> <ide> import javax.servlet.ServletException; <ide> import javax.servlet.http.HttpServletRequest; <ide> <ide> private HandlerMethodMappingNamingStrategy<T> namingStrategy; <ide> <del> private final MappingDefinitionRegistry mappingRegistry = new MappingDefinitionRegistry(); <add> private final MappingRegistry mappingRegistry = new MappingRegistry(); <ide> <ide> <ide> /** <ide> public HandlerMethodMappingNamingStrategy<T> getNamingStrategy() { <ide> } <ide> <ide> /** <del> * Return a read-only map with all mapped HandlerMethod's. <add> * Return a (read-only) map with all mappings and HandlerMethod's. <ide> */ <ide> public Map<T, HandlerMethod> getHandlerMethods() { <del> return this.mappingRegistry.getMappings(); <add> this.mappingRegistry.acquireReadLock(); <add> try { <add> return Collections.unmodifiableMap(this.mappingRegistry.getMappings()); <add> } <add> finally { <add> this.mappingRegistry.releaseReadLock(); <add> } <ide> } <ide> <ide> /** <ide> public boolean matches(Method method) { <ide> <ide> /** <ide> * Register a handler method and its unique mapping. <add> * <p>Invoked at startup for each detected handler method. May also be <add> * invoked at runtime after initialization is complete. <ide> * @param handler the bean name of the handler or the handler instance <ide> * @param method the method to register <ide> * @param mapping the mapping conditions associated with the handler method <ide> * @throws IllegalStateException if another method was already registered <ide> * under the same mapping <ide> */ <del> protected void registerHandlerMethod(Object handler, Method method, T mapping) { <add> public void registerHandlerMethod(Object handler, Method method, T mapping) { <ide> this.mappingRegistry.register(handler, method, mapping); <ide> } <ide> <add> /** <add> * Un-register a handler method. <add> * <p>This method may be invoked at runtime after initialization has completed. <add> * @param handlerMethod the handler method to be unregistered <add> */ <add> public void unregisterHandlerMethod(HandlerMethod handlerMethod) { <add> this.mappingRegistry.unregister(handlerMethod); <add> } <add> <ide> /** <ide> * Create the HandlerMethod instance. <ide> * @param handler either a bean name or an actual handler instance <ide> protected HandlerMethod getHandlerInternal(HttpServletRequest request) throws Ex <ide> if (logger.isDebugEnabled()) { <ide> logger.debug("Looking up handler method for path " + lookupPath); <ide> } <del> HandlerMethod handlerMethod = lookupHandlerMethod(lookupPath, request); <del> if (logger.isDebugEnabled()) { <del> if (handlerMethod != null) { <del> logger.debug("Returning handler method [" + handlerMethod + "]"); <del> } <del> else { <del> logger.debug("Did not find handler method for [" + lookupPath + "]"); <add> this.mappingRegistry.acquireReadLock(); <add> try { <add> HandlerMethod handlerMethod = lookupHandlerMethod(lookupPath, request); <add> if (logger.isDebugEnabled()) { <add> if (handlerMethod != null) { <add> logger.debug("Returning handler method [" + handlerMethod + "]"); <add> } <add> else { <add> logger.debug("Did not find handler method for [" + lookupPath + "]"); <add> } <ide> } <add> return (handlerMethod != null ? handlerMethod.createWithResolvedBean() : null); <add> } <add> finally { <add> this.mappingRegistry.releaseReadLock(); <ide> } <del> return (handlerMethod != null ? handlerMethod.createWithResolvedBean() : null); <ide> } <ide> <ide> /** <ide> protected HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletReques <ide> } <ide> if (matches.isEmpty()) { <ide> // No choice but to go through all mappings... <del> addMatchingMappings(this.mappingRegistry.getMappingKeys(), matches, request); <add> addMatchingMappings(this.mappingRegistry.getMappings().keySet(), matches, request); <ide> } <ide> <ide> if (!matches.isEmpty()) { <ide> protected HandlerMethod lookupHandlerMethod(String lookupPath, HttpServletReques <ide> return bestMatch.handlerMethod; <ide> } <ide> else { <del> return handleNoMatch(this.mappingRegistry.getMappingKeys(), lookupPath, request); <add> return handleNoMatch(this.mappingRegistry.getMappings().keySet(), lookupPath, request); <ide> } <ide> } <ide> <ide> else if (handlerMethod.equals(PREFLIGHT_AMBIGUOUS_MATCH)) { <ide> } <ide> <ide> <del> private class MappingDefinitionRegistry { <del> <del> private final Map<Method, MappingDefinition<T>> mappingDefinitions = <del> new ConcurrentHashMap<Method, MappingDefinition<T>>(); <add> private class MappingRegistry { <ide> <ide> private final Map<T, HandlerMethod> mappingLookup = new LinkedHashMap<T, HandlerMethod>(); <ide> <ide> private final MultiValueMap<String, T> urlLookup = new LinkedMultiValueMap<String, T>(); <ide> <del> private final Map<String, List<HandlerMethod>> nameLookup = <add> private final Map<String, List<HandlerMethod>> mappingNameLookup = <ide> new ConcurrentHashMap<String, List<HandlerMethod>>(); <ide> <add> private final Map<Method, MappingDefinition<T>> methodLookup = <add> new ConcurrentHashMap<Method, MappingDefinition<T>>(); <add> <add> <add> private final ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(); <add> <ide> <ide> /** <del> * Return a read-only copy of all mappings. <del> * Safe for concurrent use. <add> * Return all mappings and handler methods. Not thread-safe. <add> * @see #acquireReadLock() <ide> */ <ide> public Map<T, HandlerMethod> getMappings() { <del> return Collections.unmodifiableMap(this.mappingLookup); <add> return this.mappingLookup; <ide> } <ide> <add> /** <add> * Return matches for the given URL path. Not thread-safe. <add> * @see #acquireReadLock() <add> */ <ide> public List<T> getMappingKeysByUrl(String urlPath) { <ide> return this.urlLookup.get(urlPath); <ide> } <ide> <del> public Set<T> getMappingKeys() { <del> return this.mappingLookup.keySet(); <del> } <del> <add> /** <add> * Return the handler method for the mapping key. Not thread-safe. <add> * @see #acquireReadLock() <add> */ <ide> public HandlerMethod getHandlerMethod(T mapping) { <ide> return this.mappingLookup.get(mapping); <ide> } <ide> <ide> /** <del> * Return HandlerMethod matches for the given mapping name. <del> * Safe for concurrent use. <add> * Return handler methods by mapping name. Thread-safe for concurrent use. <ide> */ <ide> public List<HandlerMethod> getHandlerMethodsByMappingName(String mappingName) { <del> return this.nameLookup.get(mappingName); <add> return this.mappingNameLookup.get(mappingName); <ide> } <ide> <ide> /** <del> * Return the CorsConfiguration for the given HandlerMethod, if any. <del> * Safe for concurrent use. <add> * Return CORS configuration. Thread-safe for concurrent use. <ide> */ <ide> public CorsConfiguration getCorsConfiguration(HandlerMethod handlerMethod) { <ide> Method method = handlerMethod.getMethod(); <del> MappingDefinition<T> definition = this.mappingDefinitions.get(method); <add> MappingDefinition<T> definition = this.methodLookup.get(method); <ide> return (definition != null ? definition.getCorsConfiguration() : null); <ide> } <ide> <add> /** <add> * Acquire the read lock when using getMappings and getMappingKeysByUrl. <add> */ <add> public void acquireReadLock() { <add> this.readWriteLock.readLock().lock(); <add> } <add> <add> /** <add> * Release the read lock after using getMappings and getMappingKeysByUrl. <add> */ <add> public void releaseReadLock() { <add> this.readWriteLock.readLock().unlock(); <add> } <add> <ide> <ide> public void register(Object handler, Method method, T mapping) { <ide> <del> HandlerMethod handlerMethod = createHandlerMethod(handler, method); <del> assertUniqueMapping(handlerMethod, mapping); <add> this.readWriteLock.writeLock().lock(); <add> try { <add> HandlerMethod handlerMethod = createHandlerMethod(handler, method); <add> assertUniqueMethodMapping(handlerMethod, mapping); <ide> <del> if (logger.isInfoEnabled()) { <del> logger.info("Mapped \"" + mapping + "\" onto " + handlerMethod); <del> } <del> this.mappingLookup.put(mapping, handlerMethod); <add> if (logger.isInfoEnabled()) { <add> logger.info("Mapped \"" + mapping + "\" onto " + handlerMethod); <add> } <add> this.mappingLookup.put(mapping, handlerMethod); <ide> <del> List<String> directUrls = extractDirectUrls(mapping); <del> for (String url : directUrls) { <del> this.urlLookup.add(url, mapping); <del> } <add> List<String> directUrls = getDirectUrls(mapping); <add> for (String url : directUrls) { <add> this.urlLookup.add(url, mapping); <add> } <ide> <del> String name = null; <del> if (getNamingStrategy() != null) { <del> name = getNamingStrategy().getName(handlerMethod, mapping); <del> addName(name, handlerMethod); <del> } <add> String name = null; <add> if (getNamingStrategy() != null) { <add> name = getNamingStrategy().getName(handlerMethod, mapping); <add> addMappingName(name, handlerMethod); <add> } <ide> <del> CorsConfiguration corsConfig = initCorsConfiguration(handler, method, mapping); <add> CorsConfiguration corsConfig = initCorsConfiguration(handler, method, mapping); <ide> <del> this.mappingDefinitions.put(method, <del> new MappingDefinition<T>(mapping, handlerMethod, directUrls, name, corsConfig)); <add> this.methodLookup.put(method, <add> new MappingDefinition<T>(mapping, handlerMethod, directUrls, name, corsConfig)); <add> } <add> finally { <add> this.readWriteLock.writeLock().unlock(); <add> } <ide> } <ide> <del> private void assertUniqueMapping(HandlerMethod handlerMethod, T mapping) { <del> HandlerMethod existing = this.mappingLookup.get(mapping); <del> if (existing != null && !existing.equals(handlerMethod)) { <add> private void assertUniqueMethodMapping(HandlerMethod newHandlerMethod, T mapping) { <add> HandlerMethod handlerMethod = this.mappingLookup.get(mapping); <add> if (handlerMethod != null && !handlerMethod.equals(newHandlerMethod)) { <ide> throw new IllegalStateException( <del> "Ambiguous mapping. Cannot map '" + handlerMethod.getBean() + "' method \n" + <del> handlerMethod + "\nto " + mapping + ": There is already '" + <del> existing.getBean() + "' bean method\n" + existing + " mapped."); <add> "Ambiguous mapping. Cannot map '" + newHandlerMethod.getBean() + "' method \n" + <add> newHandlerMethod + "\nto " + mapping + ": There is already '" + <add> handlerMethod.getBean() + "' bean method\n" + handlerMethod + " mapped."); <add> } <add> MappingDefinition<T> definition = this.methodLookup.get(newHandlerMethod.getMethod()); <add> if (definition != null) { <add> throw new IllegalStateException("Cannot map " + newHandlerMethod.getMethod() + <add> "\nto " + mapping + ".\n It is already mapped to " + definition.getMapping()); <ide> } <ide> } <ide> <del> private List<String> extractDirectUrls(T mapping) { <add> private List<String> getDirectUrls(T mapping) { <ide> List<String> urls = new ArrayList<String>(1); <ide> for (String path : getMappingPathPatterns(mapping)) { <ide> if (!getPathMatcher().isPattern(path)) { <ide> private List<String> extractDirectUrls(T mapping) { <ide> return urls; <ide> } <ide> <del> private void addName(String name, HandlerMethod handlerMethod) { <add> private void addMappingName(String name, HandlerMethod handlerMethod) { <ide> <del> List<HandlerMethod> oldHandlerMethods = this.nameLookup.containsKey(name) ? <del> this.nameLookup.get(name) : Collections.<HandlerMethod>emptyList(); <add> List<HandlerMethod> oldList = this.mappingNameLookup.containsKey(name) ? <add> this.mappingNameLookup.get(name) : Collections.<HandlerMethod>emptyList(); <ide> <del> for (HandlerMethod oldHandlerMethod : oldHandlerMethods) { <del> if (oldHandlerMethod.getMethod().equals(handlerMethod.getMethod())) { <add> for (HandlerMethod current : oldList) { <add> if (handlerMethod.getMethod().equals(current.getMethod())) { <ide> return; <ide> } <ide> } <ide> private void addName(String name, HandlerMethod handlerMethod) { <ide> logger.trace("Mapping name=" + name); <ide> } <ide> <del> int size = oldHandlerMethods.size() + 1; <del> List<HandlerMethod> definitions = new ArrayList<HandlerMethod>(size); <del> definitions.addAll(oldHandlerMethods); <del> definitions.add(handlerMethod); <del> this.nameLookup.put(name, definitions); <add> List<HandlerMethod> newList = new ArrayList<HandlerMethod>(oldList.size() + 1); <add> newList.addAll(oldList); <add> newList.add(handlerMethod); <add> this.mappingNameLookup.put(name, newList); <ide> <del> if (definitions.size() > 1) { <add> if (newList.size() > 1) { <ide> if (logger.isDebugEnabled()) { <del> logger.debug("Mapping name clash for handlerMethods=" + definitions + <add> logger.debug("Mapping name clash for handlerMethods=" + newList + <ide> ". Consider assigning explicit names."); <ide> } <ide> } <ide> } <add> <add> public void unregister(HandlerMethod handlerMethod) { <add> this.readWriteLock.writeLock().lock(); <add> try { <add> MappingDefinition<T> definition = this.methodLookup.remove(handlerMethod.getMethod()); <add> if (definition == null) { <add> return; <add> } <add> <add> this.mappingLookup.remove(definition.getMapping()); <add> <add> for (String url : definition.getDirectUrls()) { <add> List<T> list = this.urlLookup.get(url); <add> if (list != null) { <add> list.remove(definition.getMapping()); <add> if (list.isEmpty()) { <add> this.urlLookup.remove(url); <add> } <add> } <add> } <add> <add> removeMappingName(definition); <add> } <add> finally { <add> this.readWriteLock.writeLock().unlock(); <add> } <add> } <add> <add> private void removeMappingName(MappingDefinition<T> definition) { <add> String name = definition.getName(); <add> if (name == null) { <add> return; <add> } <add> HandlerMethod handlerMethod = definition.getHandlerMethod(); <add> List<HandlerMethod> oldList = this.mappingNameLookup.get(name); <add> if (oldList == null) { <add> return; <add> } <add> if (oldList.size() <= 1) { <add> this.mappingNameLookup.remove(name); <add> return; <add> } <add> List<HandlerMethod> newList = new ArrayList<HandlerMethod>(oldList.size() - 1); <add> for (HandlerMethod current : oldList) { <add> if (!current.equals(handlerMethod)) { <add> newList.add(current); <add> } <add> } <add> this.mappingNameLookup.put(name, newList); <add> } <add> <ide> } <ide> <ide> private static class MappingDefinition<T> { <ide> private void addName(String name, HandlerMethod handlerMethod) { <ide> <ide> private final HandlerMethod handlerMethod; <ide> <del> private final List<String> urls; <add> private final List<String> directUrls; <ide> <ide> private final String name; <ide> <ide> private final CorsConfiguration corsConfiguration; <ide> <ide> <del> public MappingDefinition(T mapping, HandlerMethod handlerMethod, List<String> urls, <add> public MappingDefinition(T mapping, HandlerMethod handlerMethod, List<String> directUrls, <ide> String name, CorsConfiguration corsConfiguration) { <ide> <ide> Assert.notNull(mapping); <ide> Assert.notNull(handlerMethod); <ide> <ide> this.mapping = mapping; <ide> this.handlerMethod = handlerMethod; <del> this.urls = (urls != null ? urls : Collections.<String>emptyList()); <add> this.directUrls = (directUrls != null ? directUrls : Collections.<String>emptyList()); <ide> this.name = name; <ide> this.corsConfiguration = corsConfiguration; <ide> } <ide> public HandlerMethod getHandlerMethod() { <ide> return this.handlerMethod; <ide> } <ide> <del> public List<String> getUrls() { <del> return this.urls; <add> public List<String> getDirectUrls() { <add> return this.directUrls; <ide> } <ide> <ide> public String getName() { <ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/handler/HandlerMethodMappingTests.java <ide> /* <del> * Copyright 2002-2012 the original author or authors. <add> * Copyright 2002-2015 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> <ide> package org.springframework.web.servlet.handler; <ide> <add>import static org.junit.Assert.*; <add> <ide> import java.lang.reflect.Method; <ide> import java.util.Comparator; <ide> import java.util.HashSet; <ide> import java.util.Set; <add> <ide> import javax.servlet.http.HttpServletRequest; <ide> <ide> import org.junit.Before; <ide> import org.springframework.web.method.HandlerMethod; <ide> import org.springframework.web.util.UrlPathHelper; <ide> <del>import static org.junit.Assert.*; <del> <ide> /** <ide> * Test for {@link AbstractHandlerMethodMapping}. <ide> * <ide> public void directMatch() throws Exception { <ide> @Test <ide> public void patternMatch() throws Exception { <ide> mapping.registerHandlerMethod(handler, method1, "/fo*"); <del> mapping.registerHandlerMethod(handler, method1, "/f*"); <add> mapping.registerHandlerMethod(handler, method2, "/f*"); <ide> <ide> HandlerMethod result = mapping.getHandlerInternal(new MockHttpServletRequest("GET", "/foo")); <ide> assertEquals(method1, result.getMethod()); <ide> public void ambiguousMatch() throws Exception { <ide> } <ide> <ide> @Test <del> public void testDetectHandlerMethodsInAncestorContexts() { <add> public void detectHandlerMethodsInAncestorContexts() { <ide> StaticApplicationContext cxt = new StaticApplicationContext(); <ide> cxt.registerSingleton("myHandler", MyHandler.class); <ide> <ide> public void testDetectHandlerMethodsInAncestorContexts() { <ide> assertEquals(2, mapping2.getHandlerMethods().size()); <ide> } <ide> <add> @Test <add> public void unregister() throws Exception { <add> String key = "foo"; <add> mapping.registerHandlerMethod(handler, method1, key); <add> <add> HandlerMethod handlerMethod = mapping.getHandlerInternal(new MockHttpServletRequest("GET", key)); <add> assertEquals(method1, handlerMethod.getMethod()); <add> <add> mapping.unregisterHandlerMethod(handlerMethod); <add> assertNull(mapping.getHandlerInternal(new MockHttpServletRequest("GET", key))); <add> } <add> <ide> <ide> private static class MyHandlerMethodMapping extends AbstractHandlerMethodMapping<String> { <ide>
2
Text
Text
fix typo in threejs-scenegraph (#137)
48a6b71bc3212c22bf34267de7d0d5e030e80e28
<ide><path>threejs/lessons/threejs-scenegraph.md <ide> objects.push(earthMesh); <ide> <ide> Again we added more invisible scene graph nodes. The first, an `Object3D` called `earthOrbit` <ide> and added both the `earthMesh` and the `moonOrbit` to it, also new. We then added the `mooMesh` <del>to the `moonRobit`. The new scene graph looks like this. <add>to the `moonOrbit`. The new scene graph looks like this. <ide> <ide> <img src="resources/images/scenegraph-sun-earth-moon.svg" align="center"> <ide>
1
Python
Python
update error message for missing commands
b297fab062c9655012891f8b1c3da95bec04fc76
<ide><path>spacy/__main__.py <ide> def train_config(self, config): <ide> <ide> <ide> def __missing__(self, name): <del> print("\n Command %r does not exist\n" % name) <add> print("\n Command %r does not exist." <add> "\n Use the --help flag for a list of available commands.\n" % name) <ide> <ide> <ide> if __name__ == '__main__':
1
Text
Text
fix indentation in console.md
1da88552ea6d7d4fb5b590b86109053419858f30
<ide><path>doc/api/console.md <ide> changes: <ide> * `stdout` {stream.Writable} <ide> * `stderr` {stream.Writable} <ide> * `ignoreErrors` {boolean} Ignore errors when writing to the underlying <del> streams. **Default:** `true`. <add> streams. **Default:** `true`. <ide> * `colorMode` {boolean|string} Set color support for this `Console` instance. <ide> Setting to `true` enables coloring while inspecting values, setting to <ide> `'auto'` will make color support depend on the value of the `isTTY` property
1
PHP
PHP
remove the context class
b7839662560f55937afcff1e2085c30d89fbe697
<ide><path>Cake/View/Input/Context.php <del><?php <del>/** <del> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <del> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <del> * <del> * Licensed under The MIT License <del> * For full copyright and license information, please see the LICENSE.txt <del> * Redistributions of files must retain the above copyright notice. <del> * <del> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <del> * @link http://cakephp.org CakePHP(tm) Project <del> * @since CakePHP(tm) v3.0 <del> * @license http://www.opensource.org/licenses/mit-license.php MIT License <del> */ <del>namespace Cake\View\Input; <del> <del>/** <del> * Form input generation context. <del> * <del> * Coaleseces request data, form entities. Also provides methods <del> * for checking if fields are required, and schema introspection. <del> * <del> * The context class insulates the FormHelper and Input classes <del> * from various ORM implementations making them ORM independent. <del> */ <del>class Context { <del> <del> protected $_requestData; <del> protected $_entities; <del> protected $_schema; <del> <del> public function __construct($requestData = [], $entities = [], $schema = []) { <del> $this->_requestData = $requestData; <del> $this->_entities = $entities; <del> $this->_schema = $schema; <del> } <del> <del>} <ide><path>Cake/View/Input/SelectBox.php <ide> */ <ide> namespace Cake\View\Input; <ide> <del>use Cake\View\Input\Context; <ide> use Cake\View\StringTemplate; <ide> <ide> /** <ide> class SelectBox { <ide> protected $_minimizedAttributeFormat = '%s="%s"'; <ide> <ide> protected $_templates; <del> protected $_context; <ide> <del> public function __construct($templates, $context) { <add> public function __construct($templates) { <ide> $this->_templates = $templates; <del> $this->_context = $context; <ide> } <ide> <ide> public function render($data) { <ide><path>Test/TestCase/View/Input/SelectBoxTest.php <ide> namespace Cake\Test\TestCase\View\Input; <ide> <ide> use Cake\TestSuite\TestCase; <del>use Cake\View\Input\Context; <ide> use Cake\View\Input\SelectBox; <ide> use Cake\View\StringTemplate; <ide> <ide> public function setUp() { <ide> * @return void <ide> */ <ide> public function testRenderNoOptions() { <del> $context = new Context(); <del> $select = new SelectBox($this->templates, $context); <add> $select = new SelectBox($this->templates); <ide> $data = [ <ide> 'id' => 'BirdName', <ide> 'name' => 'Birds[name]', <ide> public function testRenderNoOptions() { <ide> * @return void <ide> */ <ide> public function testRenderSimple() { <del> $context = new Context(); <del> $select = new SelectBox($this->templates, $context); <add> $select = new SelectBox($this->templates); <ide> $data = [ <ide> 'id' => 'BirdName', <ide> 'name' => 'Birds[name]', <ide> public function testRenderSimple() { <ide> * @return void <ide> */ <ide> public function testRenderSelected() { <del> $context = new Context(); <del> $select = new SelectBox($this->templates, $context); <add> $select = new SelectBox($this->templates); <ide> $data = [ <ide> 'id' => 'BirdName', <ide> 'name' => 'Birds[name]', <ide> public function testRenderDisabled() { <ide> * @return void <ide> */ <ide> public function testRenderEmptyOption() { <del> $select = new SelectBox($this->templates, $context); <add> $select = new SelectBox($this->templates); <ide> $data = [ <ide> 'id' => 'BirdName', <ide> 'name' => 'Birds[name]',
3
Javascript
Javascript
add better informations for the os/2 table
e448dce42b0a58830b83b05e16c7ab5f27b9dcd0
<ide><path>fonts.js <ide> var FontLoader = { <ide> } <ide> }; <ide> <add>var UnicodeRanges = [ <add> { "begin": 0x0000, "end": 0x007F }, // Basic Latin <add> { "begin": 0x0080, "end": 0x00FF }, // Latin-1 Supplement <add> { "begin": 0x0100, "end": 0x017F }, // Latin Extended-A <add> { "begin": 0x0180, "end": 0x024F }, // Latin Extended-B <add> { "begin": 0x0250, "end": 0x02AF }, // IPA Extensions <add> { "begin": 0x02B0, "end": 0x02FF }, // Spacing Modifier Letters <add> { "begin": 0x0300, "end": 0x036F }, // Combining Diacritical Marks <add> { "begin": 0x0370, "end": 0x03FF }, // Greek and Coptic <add> { "begin": 0x2C80, "end": 0x2CFF }, // Coptic <add> { "begin": 0x0400, "end": 0x04FF }, // Cyrillic <add> { "begin": 0x0530, "end": 0x058F }, // Armenian <add> { "begin": 0x0590, "end": 0x05FF }, // Hebrew <add> { "begin": 0xA500, "end": 0xA63F }, // Vai <add> { "begin": 0x0600, "end": 0x06FF }, // Arabic <add> { "begin": 0x07C0, "end": 0x07FF }, // NKo <add> { "begin": 0x0900, "end": 0x097F }, // Devanagari <add> { "begin": 0x0980, "end": 0x09FF }, // Bengali <add> { "begin": 0x0A00, "end": 0x0A7F }, // Gurmukhi <add> { "begin": 0x0A80, "end": 0x0AFF }, // Gujarati <add> { "begin": 0x0B00, "end": 0x0B7F }, // Oriya <add> { "begin": 0x0B80, "end": 0x0BFF }, // Tamil <add> { "begin": 0x0C00, "end": 0x0C7F }, // Telugu <add> { "begin": 0x0C80, "end": 0x0CFF }, // Kannada <add> { "begin": 0x0D00, "end": 0x0D7F }, // Malayalam <add> { "begin": 0x0E00, "end": 0x0E7F }, // Thai <add> { "begin": 0x0E80, "end": 0x0EFF }, // Lao <add> { "begin": 0x10A0, "end": 0x10FF }, // Georgian <add> { "begin": 0x1B00, "end": 0x1B7F }, // Balinese <add> { "begin": 0x1100, "end": 0x11FF }, // Hangul Jamo <add> { "begin": 0x1E00, "end": 0x1EFF }, // Latin Extended Additional <add> { "begin": 0x1F00, "end": 0x1FFF }, // Greek Extended <add> { "begin": 0x2000, "end": 0x206F }, // General Punctuation <add> { "begin": 0x2070, "end": 0x209F }, // Superscripts And Subscripts <add> { "begin": 0x20A0, "end": 0x20CF }, // Currency Symbol <add> { "begin": 0x20D0, "end": 0x20FF }, // Combining Diacritical Marks For Symbols <add> { "begin": 0x2100, "end": 0x214F }, // Letterlike Symbols <add> { "begin": 0x2150, "end": 0x218F }, // Number Forms <add> { "begin": 0x2190, "end": 0x21FF }, // Arrows <add> { "begin": 0x2200, "end": 0x22FF }, // Mathematical Operators <add> { "begin": 0x2300, "end": 0x23FF }, // Miscellaneous Technical <add> { "begin": 0x2400, "end": 0x243F }, // Control Pictures <add> { "begin": 0x2440, "end": 0x245F }, // Optical Character Recognition <add> { "begin": 0x2460, "end": 0x24FF }, // Enclosed Alphanumerics <add> { "begin": 0x2500, "end": 0x257F }, // Box Drawing <add> { "begin": 0x2580, "end": 0x259F }, // Block Elements <add> { "begin": 0x25A0, "end": 0x25FF }, // Geometric Shapes <add> { "begin": 0x2600, "end": 0x26FF }, // Miscellaneous Symbols <add> { "begin": 0x2700, "end": 0x27BF }, // Dingbats <add> { "begin": 0x3000, "end": 0x303F }, // CJK Symbols And Punctuation <add> { "begin": 0x3040, "end": 0x309F }, // Hiragana <add> { "begin": 0x30A0, "end": 0x30FF }, // Katakana <add> { "begin": 0x3100, "end": 0x312F }, // Bopomofo <add> { "begin": 0x3130, "end": 0x318F }, // Hangul Compatibility Jamo <add> { "begin": 0xA840, "end": 0xA87F }, // Phags-pa <add> { "begin": 0x3200, "end": 0x32FF }, // Enclosed CJK Letters And Months <add> { "begin": 0x3300, "end": 0x33FF }, // CJK Compatibility <add> { "begin": 0xAC00, "end": 0xD7AF }, // Hangul Syllables <add> { "begin": 0xD800, "end": 0xDFFF }, // Non-Plane 0 * <add> { "begin": 0x10900, "end": 0x1091F }, // Phoenicia <add> { "begin": 0x4E00, "end": 0x9FFF }, // CJK Unified Ideographs <add> { "begin": 0xE000, "end": 0xF8FF }, // Private Use Area (plane 0) <add> { "begin": 0x31C0, "end": 0x31EF }, // CJK Strokes <add> { "begin": 0xFB00, "end": 0xFB4F }, // Alphabetic Presentation Forms <add> { "begin": 0xFB50, "end": 0xFDFF }, // Arabic Presentation Forms-A <add> { "begin": 0xFE20, "end": 0xFE2F }, // Combining Half Marks <add> { "begin": 0xFE10, "end": 0xFE1F }, // Vertical Forms <add> { "begin": 0xFE50, "end": 0xFE6F }, // Small Form Variants <add> { "begin": 0xFE70, "end": 0xFEFF }, // Arabic Presentation Forms-B <add> { "begin": 0xFF00, "end": 0xFFEF }, // Halfwidth And Fullwidth Forms <add> { "begin": 0xFFF0, "end": 0xFFFF }, // Specials <add> { "begin": 0x0F00, "end": 0x0FFF }, // Tibetan <add> { "begin": 0x0700, "end": 0x074F }, // Syriac <add> { "begin": 0x0780, "end": 0x07BF }, // Thaana <add> { "begin": 0x0D80, "end": 0x0DFF }, // Sinhala <add> { "begin": 0x1000, "end": 0x109F }, // Myanmar <add> { "begin": 0x1200, "end": 0x137F }, // Ethiopic <add> { "begin": 0x13A0, "end": 0x13FF }, // Cherokee <add> { "begin": 0x1400, "end": 0x167F }, // Unified Canadian Aboriginal Syllabics <add> { "begin": 0x1680, "end": 0x169F }, // Ogham <add> { "begin": 0x16A0, "end": 0x16FF }, // Runic <add> { "begin": 0x1780, "end": 0x17FF }, // Khmer <add> { "begin": 0x1800, "end": 0x18AF }, // Mongolian <add> { "begin": 0x2800, "end": 0x28FF }, // Braille Patterns <add> { "begin": 0xA000, "end": 0xA48F }, // Yi Syllables <add> { "begin": 0x1700, "end": 0x171F }, // Tagalog <add> { "begin": 0x10300, "end": 0x1032F }, // Old Italic <add> { "begin": 0x10330, "end": 0x1034F }, // Gothic <add> { "begin": 0x10400, "end": 0x1044F }, // Deseret <add> { "begin": 0x1D000, "end": 0x1D0FF }, // Byzantine Musical Symbols <add> { "begin": 0x1D400, "end": 0x1D7FF }, // Mathematical Alphanumeric Symbols <add> { "begin": 0xFF000, "end": 0xFFFFD }, // Private Use (plane 15) <add> { "begin": 0xFE00, "end": 0xFE0F }, // Variation Selectors <add> { "begin": 0xE0000, "end": 0xE007F }, // Tags <add> { "begin": 0x1900, "end": 0x194F }, // Limbu <add> { "begin": 0x1950, "end": 0x197F }, // Tai Le <add> { "begin": 0x1980, "end": 0x19DF }, // New Tai Lue <add> { "begin": 0x1A00, "end": 0x1A1F }, // Buginese <add> { "begin": 0x2C00, "end": 0x2C5F }, // Glagolitic <add> { "begin": 0x2D30, "end": 0x2D7F }, // Tifinagh <add> { "begin": 0x4DC0, "end": 0x4DFF }, // Yijing Hexagram Symbols <add> { "begin": 0xA800, "end": 0xA82F }, // Syloti Nagri <add> { "begin": 0x10000, "end": 0x1007F }, // Linear B Syllabary <add> { "begin": 0x10140, "end": 0x1018F }, // Ancient Greek Numbers <add> { "begin": 0x10380, "end": 0x1039F }, // Ugaritic <add> { "begin": 0x103A0, "end": 0x103DF }, // Old Persian <add> { "begin": 0x10450, "end": 0x1047F }, // Shavian <add> { "begin": 0x10480, "end": 0x104AF }, // Osmanya <add> { "begin": 0x10800, "end": 0x1083F }, // Cypriot Syllabary <add> { "begin": 0x10A00, "end": 0x10A5F }, // Kharoshthi <add> { "begin": 0x1D300, "end": 0x1D35F }, // Tai Xuan Jing Symbols <add> { "begin": 0x12000, "end": 0x123FF }, // Cuneiform <add> { "begin": 0x1D360, "end": 0x1D37F }, // Counting Rod Numerals <add> { "begin": 0x1B80, "end": 0x1BBF }, // Sundanese <add> { "begin": 0x1C00, "end": 0x1C4F }, // Lepcha <add> { "begin": 0x1C50, "end": 0x1C7F }, // Ol Chiki <add> { "begin": 0xA880, "end": 0xA8DF }, // Saurashtra <add> { "begin": 0xA900, "end": 0xA92F }, // Kayah Li <add> { "begin": 0xA930, "end": 0xA95F }, // Rejang <add> { "begin": 0xAA00, "end": 0xAA5F }, // Cham <add> { "begin": 0x10190, "end": 0x101CF }, // Ancient Symbols <add> { "begin": 0x101D0, "end": 0x101FF }, // Phaistos Disc <add> { "begin": 0x102A0, "end": 0x102DF }, // Carian <add> { "begin": 0x1F030, "end": 0x1F09F } // Domino Tiles <add>]; <add> <add>function getUnicodeRangeFor(value) { <add> for (var i = 0; i < UnicodeRanges.length; i++) { <add> var range = UnicodeRanges[i]; <add> if (value >= range.begin && value < range.end) <add> return i; <add> } <add> return -1; <add>}; <ide> <ide> /** <ide> * 'Font' is the class the outside world should use, it encapsulate all the font <ide> var Font = (function () { <ide> }; <ide> <ide> function createOS2Table(properties) { <add> var ulUnicodeRange1 = 0; <add> var ulUnicodeRange2 = 0; <add> var ulUnicodeRange3 = 0; <add> var ulUnicodeRange4 = 0; <add> <add> var charset = properties.charset; <add> if (charset && charset.length) { <add> // XXX why is the first character equal to ''? <add> for (var i = 1; i < charset.length; i++) { <add> var position = getUnicodeRangeFor(GlyphsUnicode[charset[i]]); <add> if (position < 32) { <add> ulUnicodeRange1 |= 1 << position; <add> } else if (position < 64) { <add> ulUnicodeRange2 |= 1 << position - 32; <add> } else if (position < 96) { <add> ulUnicodeRange3 |= 1 << position - 64; <add> } else if (position < 123) { <add> ulUnicodeRange4 |= 1 << position - 96; <add> } else { <add> error("Unicode ranges Bits > 123 are reserved for internal usage"); <add> } <add> } <add> } <add> <ide> return "\x00\x03" + // version <ide> "\x02\x24" + // xAvgCharWidth <ide> "\x01\xF4" + // usWeightClass <ide> var Font = (function () { <ide> "\x01\x02" + // yStrikeOutPosition <ide> "\x00\x00" + // sFamilyClass <ide> "\x02\x00\x06\x03\x00\x00\x00\x00\x00\x00" + // Panose <del> "\xFF\xFF\xFF\xFF" + // ulUnicodeRange1 (Bits 0-31) <del> "\xFF\xFF\xFF\xFF" + // ulUnicodeRange1 (Bits 32-63) <del> "\xFF\xFF\xFF\xFF" + // ulUnicodeRange1 (Bits 64-95) <del> "\xFF\xFF\xFF\xFF" + // ulUnicodeRange1 (Bits 96-127) <add> string32(ulUnicodeRange1) + // ulUnicodeRange1 (Bits 0-31) <add> string32(ulUnicodeRange2) + // ulUnicodeRange2 (Bits 32-63) <add> string32(ulUnicodeRange3) + // ulUnicodeRange3 (Bits 64-95) <add> string32(ulUnicodeRange4) + // ulUnicodeRange4 (Bits 96-127) <ide> "\x2A\x32\x31\x2A" + // achVendID <ide> "\x00\x00" + // fsSelection <del> "\x00\x2D" + // usFirstCharIndex <del> "\x00\x7A" + // usLastCharIndex <add> string16(properties.firstChar) + // usFirstCharIndex <add> string16(properties.lastChar) + // usLastCharIndex <ide> "\x00\x20" + // sTypoAscender <ide> "\x00\x00" + // sTypeDescender <ide> "\x00\x00" + // sTypoLineGap <ide> var Font = (function () { <ide> "\x00\x00\x00\x00" + // ulCodePageRange2 (Bits 32-63) <ide> string16(properties.xHeight) + // sxHeight <ide> string16(properties.capHeight) + // sCapHeight <del> "\x00\x01" + // usDefaultChar <del> "\x00\xCD" + // usBreakChar <add> // XXX mapping .notdef in the cmap table will allow us to use it <add> // here instead, especially because these field are limit to 0xFFFF <add> string16(properties.firstChar) + // usDefaultChar <add> string16(properties.firstChar) + // usBreakChar <ide> "\x00\x00"; // usMaxContext <ide> }; <ide>
1
Javascript
Javascript
write pending data of opposite side
b5ddc0cf9658499e04c10b8e3158b81d2be0d5ac
<ide><path>lib/tls.js <ide> CryptoStream.prototype._read = function read(size) { <ide> <ide> // Try writing pending data <ide> if (this._pending !== null) this._writePending(); <add> if (this._opposite._pending !== null) this._opposite._writePending(); <ide> <ide> if (bytesRead === 0) { <ide> // EOF when cleartext has finished and we have nothing to read <ide><path>test/simple/test-tls-server-large-request.js <add>// Copyright Joyent, Inc. and other Node contributors. <add>// <add>// Permission is hereby granted, free of charge, to any person obtaining a <add>// copy of this software and associated documentation files (the <add>// "Software"), to deal in the Software without restriction, including <add>// without limitation the rights to use, copy, modify, merge, publish, <add>// distribute, sublicense, and/or sell copies of the Software, and to permit <add>// persons to whom the Software is furnished to do so, subject to the <add>// following conditions: <add>// <add>// The above copyright notice and this permission notice shall be included <add>// in all copies or substantial portions of the Software. <add>// <add>// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS <add>// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF <add>// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN <add>// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, <add>// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR <add>// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE <add>// USE OR OTHER DEALINGS IN THE SOFTWARE. <add> <add>var common = require('../common'); <add>var assert = require('assert'); <add>var tls = require('tls'); <add>var fs = require('fs'); <add>var stream = require('stream'); <add>var util = require('util'); <add> <add>var clientConnected = 0; <add>var serverConnected = 0; <add>var request = new Buffer(new Array(1024 * 256).join('ABCD')); // 1mb <add> <add>var options = { <add> key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), <add> cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') <add>}; <add> <add>function Mediator() { <add> stream.Writable.call(this); <add> this.buf = ''; <add>}; <add>util.inherits(Mediator, stream.Writable); <add> <add>Mediator.prototype._write = function write(data, enc, cb) { <add> this.buf += data; <add> setTimeout(cb, 0); <add> <add> if (this.buf.length >= request.length) { <add> assert.equal(this.buf, request.toString()); <add> server.close(); <add> } <add>}; <add> <add>var mediator = new Mediator(); <add> <add>var server = tls.Server(options, function(socket) { <add> socket.pipe(mediator); <add> serverConnected++; <add>}); <add> <add>server.listen(common.PORT, function() { <add> var client1 = tls.connect({ <add> port: common.PORT, <add> rejectUnauthorized: false <add> }, function() { <add> ++clientConnected; <add> client1.end(request); <add> }); <add>}); <add> <add>process.on('exit', function() { <add> assert.equal(clientConnected, 1); <add> assert.equal(serverConnected, 1); <add>});
2
Python
Python
fix param error
4bafc43b0ebf65dc1e9df70c4fe1a81dfa2475cf
<ide><path>src/transformers/models/bert_generation/modeling_bert_generation.py <ide> def load_tf_weights_in_bert_generation( <ide> <ide> <ide> class BertGenerationEmbeddings(nn.Module): <del> """Construct the embeddings from word, position and token_type embeddings.""" <add> """Construct the embeddings from word and position embeddings.""" <ide> <ide> def __init__(self, config): <ide> super().__init__() <ide> def forward( <ide> >>> config.is_decoder = True <ide> >>> model = BertGenerationDecoder.from_pretrained('google/bert_for_seq_generation_L-24_bbc_encoder', config=config) <ide> <del> >>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt") <add> >>> inputs = tokenizer("Hello, my dog is cute", return_token_type_ids=False, return_tensors="pt") <ide> >>> outputs = model(**inputs) <ide> <ide> >>> prediction_logits = outputs.logits
1
Python
Python
adjust importlib import
daf1d59d0f41d2ea89e0b996d22b5d4e84914fb5
<ide><path>rest_framework/settings.py <ide> from __future__ import unicode_literals <ide> from django.test.signals import setting_changed <ide> from django.conf import settings <del>from django.utils import importlib, six <add>try: <add> import importlib <add>except ImportError: <add> from django.utils import importlib <add>from django.utils import six <ide> from rest_framework import ISO_8601 <ide> <ide>
1
Python
Python
remove duplicate calls to get_output
926883ad108fe23867c29efc8e18687087113b0d
<ide><path>keras/models.py <ide> def compile(self, optimizer, loss, class_mode="categorical", theano_mode=None): <ide> self.y_train = self.get_output(train=True) <ide> self.y_test = self.get_output(train=False) <ide> <del> self.y_train = self.get_output(train=True) <del> self.y_test = self.get_output(train=False) <del> <ide> # target of model <ide> self.y = T.zeros_like(self.y_train) <ide>
1
Text
Text
add 2.1.0-beta.1 to changelog
647b84dc3819f4b1e48f1fa8b668a529992f9c4a
<ide><path>CHANGELOG.md <ide> # Ember Changelog <ide> <add>### 2.1.0-beta.1 (August 16, 2015) <add> <add>- [#10173](https://github.com/emberjs/ember.js/pull/10173) [BUGFIX] Ensure non-singleton injections are not cached incorrectly. <add>- [#11966](https://github.com/emberjs/ember.js/pull/11966) [PERF] Refactor Meta. <add>- [#12057](https://github.com/emberjs/ember.js/pull/12057) Allow `instanceInitializers` to set `customEvents`. <add>- [#12059](https://github.com/emberjs/ember.js/pull/12059) [BUGFIX] Allow setting an entry in `Application#customEvents` to `null` to opt out of event listeners. <add>- [#12034](https://github.com/emberjs/ember.js/pull/12034) [BUGFIX] Ensure `currentRouteName` and `currentPath` are set properly for loading and error routes. <add>- [#12062](https://github.com/emberjs/ember.js/pull/12062) Remove the need for `this.__nextSuper`, and make debugging methods with `this._super` calls much easier. <add>- [#12116](https://github.com/emberjs/ember.js/pull/12116) [FEATURE ember-debug-handlers] Enable by default. <add>- [#12117](https://github.com/emberjs/ember.js/pull/12117) [FEATURE ember-registry-container-reform] Enable by default. <add>- [#11440](https://github.com/emberjs/ember.js/pull/11440) [DEPRECATION] Deprecate using `instance.container.lookup` on first argument to `instanceInitializers`. Use `instance.lookup` instead. <add>- [#11440](https://github.com/emberjs/ember.js/pull/11440) [DEPRECATION] Deprecate passing two arguments to an initializers `initialize` function. <add> <add> <add> <ide> ### 2.0.0 (August 13, 2015) <ide> <ide> - [#12036](https://github.com/emberjs/ember.js/pull/12036) Cleanup CP Set and Volatile
1
Text
Text
update changelog for 2.15.0
ec9813ee9f6d6a6fdc5551eb7160f29f10367ad2
<ide><path>CHANGELOG.md <ide> Changelog <ide> ========= <ide> <add>### 2.15.0 [See full changelog](https://gist.github.com/ichernev/10e1c5bf647545c72ca30e9628a09ed3) <add>- Release Sept 12, 2016 <add> <add>## New Locales <add>* [#3255](https://github.com/moment/moment/pull/3255) [new locale] mi: Maori language <add>* [#3267](https://github.com/moment/moment/pull/3267) [new locale] ar-ly: Arabic (Libya) locale <add>* [#3333](https://github.com/moment/moment/pull/3333) [new locale] zh-hk: Chinese (Hong Kong) locale <add> <add>## Bugfixes <add>* [#3276](https://github.com/moment/moment/pull/3276) [bugfix] duration: parser: Support ms durations in .NET syntax <add>* [#3312](https://github.com/moment/moment/pull/3312) [bugfix] locales: Enable locale-data getters without moment (fixes [#3284](https://github.com/moment/moment/issues/3284)) <add>* [#3381](https://github.com/moment/moment/pull/3381) [bugfix] parsing: Fix parseZone without timezone in string, fixes [#3083](https://github.com/moment/moment/issues/3083) <add>* [#3383](https://github.com/moment/moment/pull/3383) [bugfix] toJSON: Fix isValid so that toJSON works after a moment is frozen <add>* [#3427](https://github.com/moment/moment/pull/3427) [bugfix] ie8: Fix IE8 (regression in 2.14.x) <add> <add>## Packaging <add>* [#3299](https://github.com/moment/moment/pull/3299) [pkg] npm: Do not include .npmignore in npm package <add>* [#3273](https://github.com/moment/moment/pull/3273) [pkg] jspm: Include moment.d.ts file in package <add>* [#3344](https://github.com/moment/moment/pull/3344) [pkg] exports: use module.require for nodejs <add> <add>Also some locale and typescript improvements <add> <ide> ### 2.14.1 <ide> - Release July 20, 2016 <ide> * [#3280](https://github.com/moment/moment/pull/3280) Fix typescript definitions <ide> Week tokens parsing. <ide> <ide> ### 2.2.1 <ide> <del>- Release Sep 12, 2013 <add>- Release Sep 12, 2013 <ide> <ide> Fixed bug in string prototype test. <ide> Updated authors and contributors.
1
Javascript
Javascript
clarify documentation for scrollview component
cc1a4b0915f3a5c84d2866b0804f6799c112b755
<ide><path>Libraries/Components/ScrollView/ScrollView.js <ide> const ScrollView = React.createClass({ <ide> */ <ide> pagingEnabled: PropTypes.bool, <ide> /** <del> * When false, the content does not scroll. <add> * When false, the view cannot be scrolled via touch interaction. <ide> * The default value is true. <add> * <add> * Note that the view can be always be scrolled by calling `scrollTo`. <ide> */ <ide> scrollEnabled: PropTypes.bool, <ide> /**
1
Javascript
Javascript
fix instructions in 'react-native init'
8c7f36021acb393bab11beaebfb2070ce4ef1b92
<ide><path>local-cli/generator/printRunInstructions.js <ide> var path = require('path'); <ide> <ide> function printRunInstructions(projectDir, projectName) { <ide> const absoluteProjectDir = path.resolve(projectDir); <del> const relativeProjectDir = path.relative(process.cwd(), absoluteProjectDir); <del> // If we're in the project directory already, no need to 'cd' into it <del> const needToCd = !!relativeProjectDir; <ide> // iOS <ide> const xcodeProjectPath = path.resolve(projectDir, 'ios', projectName) + '.xcodeproj'; <ide> const relativeXcodeProjectPath = path.relative(process.cwd(), xcodeProjectPath); <ide> console.log(chalk.white.bold('To run your app on iOS:')); <del> if (needToCd) { console.log(' cd ' + relativeProjectDir); } <add> console.log(' cd ' + absoluteProjectDir); <ide> console.log(' react-native run-ios'); <ide> console.log(' - or -'); <ide> console.log(' Open ' + relativeXcodeProjectPath + ' in Xcode'); <ide> console.log(' Hit the Run button'); <ide> // Android <ide> console.log(chalk.white.bold('To run your app on Android:')); <add> console.log(' cd ' + absoluteProjectDir); <ide> console.log(' Have an Android emulator running (quickest way to get started), or a device connected'); <del> if (needToCd) { console.log(' cd ' + relativeProjectDir); } <ide> console.log(' react-native run-android'); <ide> } <ide>
1
Text
Text
fix spelling of additionally
f22273a6bbdb466999d3c23c7b90325601116c45
<ide><path>guides/source/security.md <ide> values = { zip: entered_zip_code, qty: entered_quantity } <ide> Model.where("zip_code = :zip AND quantity >= :qty", values).first <ide> ``` <ide> <del>Aditionally, you can split and chain conditionals valid for your use case: <add>Additionally, you can split and chain conditionals valid for your use case: <ide> <ide> ```ruby <ide> Model.where(zip_code: entered_zip_code).where("quantity >= ?", entered_quantity).first
1
Ruby
Ruby
move maintain_test_schema temporarily back to core
0305815eb96c754405e802e36edac4f3032a0a3a
<ide><path>activerecord/lib/active_record.rb <ide> def self.global_executor_concurrency # :nodoc: <ide> singleton_class.attr_accessor :queues <ide> self.queues = {} <ide> <del> singleton_class.attr_accessor :maintain_test_schema <del> self.maintain_test_schema = nil <del> <ide> ## <ide> # :singleton-method: <ide> # Specify a threshold for the size of query result sets. If the number of <ide><path>activerecord/lib/active_record/core.rb <ide> def self.configurations <ide> <ide> class_attribute :default_shard, instance_writer: false <ide> <add> mattr_accessor :maintain_test_schema, instance_accessor: false <add> <ide> def self.application_record_class? # :nodoc: <ide> if ActiveRecord.application_record_class <ide> self == ActiveRecord.application_record_class <ide> def find_by!(*args) # :nodoc: <ide> find_by(*args) || raise(RecordNotFound.new("Couldn't find #{name}", name)) <ide> end <ide> <del> def maintain_test_schema # :nodoc: <del> ActiveRecord::Base.maintain_test_schema <del> end <del> <ide> %w( <ide> reading_role writing_role legacy_connection_handling default_timezone index_nested_attribute_errors <ide> verbose_query_logs queues warn_on_records_fetched_greater_than
2
Javascript
Javascript
note restriction in toggleclass
d803354d7cda2c4bdf6c3d159ac86657d70432ca
<ide><path>src/jqLite.js <ide> * - [`removeData()`](http://api.jquery.com/removeData/) <ide> * - [`replaceWith()`](http://api.jquery.com/replaceWith/) <ide> * - [`text()`](http://api.jquery.com/text/) <del> * - [`toggleClass()`](http://api.jquery.com/toggleClass/) <del> * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers. <add> * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument <add> * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers <ide> * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces or event object as parameter <ide> * - [`val()`](http://api.jquery.com/val/) <ide> * - [`wrap()`](http://api.jquery.com/wrap/)
1
Java
Java
improve assertj usage in cache config tests
5ed0c848fe105b3756f248c98d8c40d85ae2e970
<ide><path>spring-context/src/test/java/org/springframework/cache/config/CacheAdviceParserTests.java <ide> package org.springframework.cache.config; <ide> <ide> import org.junit.jupiter.api.Test; <del> <ide> import org.springframework.beans.factory.BeanDefinitionStoreException; <ide> import org.springframework.context.support.GenericXmlApplicationContext; <ide> <del>import static org.assertj.core.api.Assertions.assertThatExceptionOfType; <add>import static org.assertj.core.api.Assertions.assertThatThrownBy; <ide> <ide> /** <ide> * AOP advice specific parsing tests. <ide> * <ide> * @author Stephane Nicoll <ide> */ <del>public class CacheAdviceParserTests { <add>class CacheAdviceParserTests { <ide> <ide> @Test <del> public void keyAndKeyGeneratorCannotBeSetTogether() { <del> assertThatExceptionOfType(BeanDefinitionStoreException.class).isThrownBy(() -> <del> new GenericXmlApplicationContext("/org/springframework/cache/config/cache-advice-invalid.xml")); <add> void keyAndKeyGeneratorCannotBeSetTogether() { <add> assertThatThrownBy(() -> new GenericXmlApplicationContext("/org/springframework/cache/config/cache-advice-invalid.xml")) <add> .isInstanceOf(BeanDefinitionStoreException.class); <ide> // TODO better exception handling <ide> } <ide> <ide><path>spring-context/src/test/java/org/springframework/cache/config/CustomInterceptorTests.java <ide> <ide> package org.springframework.cache.config; <ide> <del>import java.io.IOException; <del>import java.util.Map; <del> <ide> import org.junit.jupiter.api.AfterEach; <ide> import org.junit.jupiter.api.BeforeEach; <ide> import org.junit.jupiter.api.Test; <del> <ide> import org.springframework.cache.CacheManager; <ide> import org.springframework.cache.annotation.EnableCaching; <ide> import org.springframework.cache.interceptor.CacheInterceptor; <ide> import org.springframework.context.testfixture.cache.beans.CacheableService; <ide> import org.springframework.context.testfixture.cache.beans.DefaultCacheableService; <ide> <add>import java.io.IOException; <add>import java.util.Map; <add> <ide> import static org.assertj.core.api.Assertions.assertThat; <del>import static org.assertj.core.api.Assertions.assertThatRuntimeException; <add>import static org.assertj.core.api.Assertions.assertThatThrownBy; <ide> <ide> /** <ide> * @author Stephane Nicoll <ide> */ <del>public class CustomInterceptorTests { <add>class CustomInterceptorTests { <ide> <ide> protected ConfigurableApplicationContext ctx; <ide> <ide> public void tearDown() { <ide> } <ide> <ide> @Test <del> public void onlyOneInterceptorIsAvailable() { <add> void onlyOneInterceptorIsAvailable() { <ide> Map<String, CacheInterceptor> interceptors = this.ctx.getBeansOfType(CacheInterceptor.class); <del> assertThat(interceptors.size()).as("Only one interceptor should be defined").isEqualTo(1); <add> assertThat(interceptors).as("Only one interceptor should be defined").hasSize(1); <ide> CacheInterceptor interceptor = interceptors.values().iterator().next(); <del> assertThat(interceptor.getClass()).as("Custom interceptor not defined").isEqualTo(TestCacheInterceptor.class); <add> assertThat(interceptor).as("Custom interceptor not defined").isInstanceOf(TestCacheInterceptor.class); <ide> } <ide> <ide> @Test <del> public void customInterceptorAppliesWithRuntimeException() { <add> void customInterceptorAppliesWithRuntimeException() { <ide> Object o = this.cs.throwUnchecked(0L); <ide> // See TestCacheInterceptor <ide> assertThat(o).isEqualTo(55L); <ide> } <ide> <ide> @Test <del> public void customInterceptorAppliesWithCheckedException() { <del> assertThatRuntimeException() <del> .isThrownBy(() -> this.cs.throwChecked(0L)) <del> .withCauseExactlyInstanceOf(IOException.class); <add> void customInterceptorAppliesWithCheckedException() { <add> assertThatThrownBy(() -> this.cs.throwChecked(0L)) <add> .isInstanceOf(RuntimeException.class) <add> .hasCauseExactlyInstanceOf(IOException.class); <ide> } <ide> <ide> <ide> static class TestCacheInterceptor extends CacheInterceptor { <ide> protected Object invokeOperation(CacheOperationInvoker invoker) { <ide> try { <ide> return super.invokeOperation(invoker); <del> } <del> catch (CacheOperationInvoker.ThrowableWrapper e) { <add> } catch (CacheOperationInvoker.ThrowableWrapper e) { <ide> Throwable original = e.getOriginal(); <ide> if (original.getClass() == UnsupportedOperationException.class) { <ide> return 55L; <ide><path>spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java <ide> <ide> package org.springframework.cache.config; <ide> <del>import java.util.concurrent.atomic.AtomicLong; <del> <ide> import org.junit.jupiter.api.AfterEach; <ide> import org.junit.jupiter.api.Test; <del> <ide> import org.springframework.beans.factory.annotation.Autowired; <ide> import org.springframework.cache.Cache; <ide> import org.springframework.cache.CacheManager; <ide> import org.springframework.core.env.Environment; <ide> import org.springframework.mock.env.MockEnvironment; <ide> <add>import java.util.concurrent.atomic.AtomicLong; <add> <ide> import static org.assertj.core.api.Assertions.assertThat; <ide> import static org.springframework.context.testfixture.cache.CacheTestUtils.assertCacheHit; <ide> import static org.springframework.context.testfixture.cache.CacheTestUtils.assertCacheMiss; <ide> * <ide> * @author Stephane Nicoll <ide> */ <del>public class EnableCachingIntegrationTests { <add>class EnableCachingIntegrationTests { <ide> <ide> private ConfigurableApplicationContext context; <ide> <ide> public void closeContext() { <ide> <ide> <ide> @Test <del> public void fooServiceWithInterface() { <add> void fooServiceWithInterface() { <ide> this.context = new AnnotationConfigApplicationContext(FooConfig.class); <ide> FooService service = this.context.getBean(FooService.class); <ide> fooGetSimple(service); <ide> } <ide> <ide> @Test <del> public void fooServiceWithInterfaceCglib() { <add> void fooServiceWithInterfaceCglib() { <ide> this.context = new AnnotationConfigApplicationContext(FooConfigCglib.class); <ide> FooService service = this.context.getBean(FooService.class); <ide> fooGetSimple(service); <ide> private void fooGetSimple(FooService service) { <ide> } <ide> <ide> @Test <del> public void barServiceWithCacheableInterfaceCglib() { <add> void barServiceWithCacheableInterfaceCglib() { <ide> this.context = new AnnotationConfigApplicationContext(BarConfigCglib.class); <ide> BarService service = this.context.getBean(BarService.class); <ide> Cache cache = getCache(); <ide> public void barServiceWithCacheableInterfaceCglib() { <ide> } <ide> <ide> @Test <del> public void beanConditionOff() { <add> void beanConditionOff() { <ide> this.context = new AnnotationConfigApplicationContext(BeanConditionConfig.class); <ide> FooService service = this.context.getBean(FooService.class); <ide> Cache cache = getCache(); <ide> public void beanConditionOff() { <ide> } <ide> <ide> @Test <del> public void beanConditionOn() { <add> void beanConditionOn() { <ide> AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); <ide> ctx.setEnvironment(new MockEnvironment().withProperty("bar.enabled", "true")); <ide> ctx.register(BeanConditionConfig.class); <ide><path>spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java <ide> package org.springframework.cache.config; <ide> <ide> import org.junit.jupiter.api.Test; <del> <ide> import org.springframework.beans.factory.NoSuchBeanDefinitionException; <ide> import org.springframework.beans.factory.NoUniqueBeanDefinitionException; <ide> import org.springframework.cache.CacheManager; <ide> import org.springframework.context.testfixture.cache.beans.DefaultCacheableService; <ide> <ide> import static org.assertj.core.api.Assertions.assertThat; <add>import static org.assertj.core.api.Assertions.assertThatCode; <add>import static org.assertj.core.api.Assertions.assertThatThrownBy; <ide> <ide> /** <ide> * Integration tests for {@code @EnableCaching} and its related <ide> */ <ide> class EnableCachingTests extends AbstractCacheAnnotationTests { <ide> <del> /** hook into superclass suite of tests */ <add> /** <add> * hook into superclass suite of tests <add> */ <ide> @Override <ide> protected ConfigurableApplicationContext getApplicationContext() { <ide> return new AnnotationConfigApplicationContext(EnableCachingConfig.class); <ide> void cacheErrorHandler() { <ide> void singleCacheManagerBean() { <ide> AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); <ide> ctx.register(SingleCacheManagerConfig.class); <del> ctx.refresh(); <add> assertThatCode(ctx::refresh).doesNotThrowAnyException(); <ide> ctx.close(); <ide> } <ide> <ide> void multipleCacheManagerBeans() { <ide> @SuppressWarnings("resource") <ide> AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); <ide> ctx.register(MultiCacheManagerConfig.class); <del> try { <del> ctx.refresh(); <del> } <del> catch (IllegalStateException ex) { <del> assertThat(ex.getMessage().contains("no unique bean of type CacheManager")).isTrue(); <del> assertThat(ex).hasCauseInstanceOf(NoUniqueBeanDefinitionException.class); <del> } <add> assertThatThrownBy(ctx::refresh) <add> .isInstanceOf(IllegalStateException.class) <add> .hasMessageContaining("no unique bean of type CacheManager") <add> .hasCauseInstanceOf(NoUniqueBeanDefinitionException.class); <ide> } <ide> <ide> @Test <ide> void multipleCacheManagerBeans_implementsCachingConfigurer() { <ide> AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); <ide> ctx.register(MultiCacheManagerConfigurer.class); <del> ctx.refresh(); // does not throw an exception <add> assertThatCode(ctx::refresh).doesNotThrowAnyException(); <ide> ctx.close(); <ide> } <ide> <ide> void multipleCachingConfigurers() { <ide> @SuppressWarnings("resource") <ide> AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); <ide> ctx.register(MultiCacheManagerConfigurer.class, EnableCachingConfig.class); <del> try { <del> ctx.refresh(); <del> } <del> catch (IllegalStateException ex) { <del> assertThat(ex.getMessage().contains("implementations of CachingConfigurer")).isTrue(); <del> } <add> assertThatThrownBy(ctx::refresh) <add> .hasMessageContaining("implementations of CachingConfigurer"); <ide> } <ide> <ide> @Test <ide> void noCacheManagerBeans() { <ide> @SuppressWarnings("resource") <ide> AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); <ide> ctx.register(EmptyConfig.class); <del> try { <del> ctx.refresh(); <del> } <del> catch (IllegalStateException ex) { <del> assertThat(ex.getMessage().contains("no bean of type CacheManager")).isTrue(); <del> assertThat(ex).hasCauseInstanceOf(NoSuchBeanDefinitionException.class); <del> } <add> assertThatThrownBy(ctx::refresh) <add> .isInstanceOf(IllegalStateException.class) <add> .hasMessageContaining("no bean of type CacheManager") <add> .hasCauseInstanceOf(NoSuchBeanDefinitionException.class); <ide> } <ide> <ide> @Test <ide> void emptyConfigSupport() { <ide> ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class); <ide> CacheInterceptor ci = context.getBean(CacheInterceptor.class); <del> assertThat(ci.getCacheResolver()).isNotNull(); <del> assertThat(ci.getCacheResolver().getClass()).isEqualTo(SimpleCacheResolver.class); <del> assertThat(((SimpleCacheResolver) ci.getCacheResolver()).getCacheManager()).isSameAs(context.getBean(CacheManager.class)); <add> assertThat(ci.getCacheResolver()).isInstanceOfSatisfying(SimpleCacheResolver.class, cacheResolver -> { <add> assertThat(cacheResolver.getCacheManager()).isSameAs(context.getBean(CacheManager.class)); <add> }); <ide> context.close(); <ide> } <ide>
4
Java
Java
add @donotstrip to javascriptmodule interfaces
6464ef0a924a6d36e4009053186a71e6a4d84908
<ide><path>ReactAndroid/src/main/java/com/facebook/react/modules/core/DeviceEventManagerModule.java <ide> import android.net.Uri; <ide> import androidx.annotation.NonNull; <ide> import androidx.annotation.Nullable; <add>import com.facebook.proguard.annotations.DoNotStrip; <ide> import com.facebook.react.bridge.Arguments; <ide> import com.facebook.react.bridge.JavaScriptModule; <ide> import com.facebook.react.bridge.ReactApplicationContext; <ide> public class DeviceEventManagerModule extends ReactContextBaseJavaModule { <ide> public static final String NAME = "DeviceEventManager"; <ide> <add> @DoNotStrip <ide> public interface RCTDeviceEventEmitter extends JavaScriptModule { <ide> void emit(@NonNull String eventName, @Nullable Object data); <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/modules/core/JSTimers.java <ide> */ <ide> package com.facebook.react.modules.core; <ide> <add>import com.facebook.proguard.annotations.DoNotStrip; <ide> import com.facebook.react.bridge.JavaScriptModule; <ide> import com.facebook.react.bridge.WritableArray; <ide> <add>@DoNotStrip <ide> public interface JSTimers extends JavaScriptModule { <ide> void callTimers(WritableArray timerIDs); <ide> <ide><path>ReactAndroid/src/main/java/com/facebook/react/modules/core/RCTNativeAppEventEmitter.java <ide> package com.facebook.react.modules.core; <ide> <ide> import androidx.annotation.Nullable; <add>import com.facebook.proguard.annotations.DoNotStrip; <ide> import com.facebook.react.bridge.JavaScriptModule; <ide> <ide> /** Module that handles global application events. */ <add>@DoNotStrip <ide> public interface RCTNativeAppEventEmitter extends JavaScriptModule { <ide> void emit(String eventName, @Nullable Object data); <ide> } <ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTEventEmitter.java <ide> package com.facebook.react.uimanager.events; <ide> <ide> import androidx.annotation.Nullable; <add>import com.facebook.proguard.annotations.DoNotStrip; <ide> import com.facebook.react.bridge.JavaScriptModule; <ide> import com.facebook.react.bridge.WritableArray; <ide> import com.facebook.react.bridge.WritableMap; <ide> <add>@DoNotStrip <ide> public interface RCTEventEmitter extends JavaScriptModule { <ide> void receiveEvent(int targetTag, String eventName, @Nullable WritableMap event); <ide>
4
Javascript
Javascript
make read()-based api sync
5eb954f660d4d102aebbb0abb497ed55ca722713
<ide><path>packager/src/node-haste/Module.js <ide> export type ConstructorArgs = { <ide> transformCode: ?TransformCode, <ide> }; <ide> <add>type DocBlock = {+[key: string]: string}; <add> <ide> class Module { <ide> <ide> path: string; <ide> class Module { <ide> _reporter: Reporter; <ide> _globalCache: ?GlobalTransformCache; <ide> <del> _docBlock: Promise<{[key: string]: string}>; <del> _hasteName: Promise<string | void>; <del> _readSourceCodePromise: Promise<string>; <add> _docBlock: ?DocBlock; <add> _hasteNameCache: ?{+hasteName: ?string}; <add> _sourceCode: ?string; <ide> _readPromises: Map<string, Promise<ReadResult>>; <ide> <ide> constructor({ <ide> class Module { <ide> return this._cache.get( <ide> this.path, <ide> 'isHaste', <del> () => this._getHasteName().then(name => !!name), <add> () => Promise.resolve(this._getHasteName() != null), <ide> ); <ide> } <ide> <ide> class Module { <ide> return this._cache.get( <ide> this.path, <ide> 'name', <del> () => this._getHasteName().then(name => { <del> if (name !== undefined) { <add> () => Promise.resolve().then(() => { <add> const name = this._getHasteName(); <add> if (name != null) { <ide> return name; <ide> } <ide> <ide> class Module { <ide> invalidate() { <ide> this._cache.invalidate(this.path); <ide> this._readPromises.clear(); <add> this._sourceCode = null; <add> this._docBlock = null; <add> this._hasteNameCache = null; <ide> } <ide> <del> _readSourceCode() { <del> if (!this._readSourceCodePromise) { <del> this._readSourceCodePromise = new Promise( <del> resolve => resolve(fs.readFileSync(this.path, 'utf8')) <del> ); <add> _readSourceCode(): string { <add> if (this._sourceCode == null) { <add> this._sourceCode = fs.readFileSync(this.path, 'utf8'); <ide> } <del> return this._readSourceCodePromise; <add> return this._sourceCode; <ide> } <ide> <del> _readDocBlock() { <del> if (!this._docBlock) { <del> this._docBlock = this._readSourceCode() <del> .then(source => docblock.parseAsObject(source)); <add> _readDocBlock(): DocBlock { <add> if (this._docBlock == null) { <add> this._docBlock = docblock.parseAsObject(this._readSourceCode()); <ide> } <ide> return this._docBlock; <ide> } <ide> <del> _getHasteName(): Promise<string | void> { <del> if (!this._hasteName) { <del> const hasteImpl = this._options.hasteImpl; <del> if (hasteImpl === undefined || hasteImpl.enforceHasteNameMatches) { <del> this._hasteName = this._readDocBlock().then(moduleDocBlock => { <del> const {providesModule} = moduleDocBlock; <del> return providesModule <del> && !this._depGraphHelpers.isNodeModulesDir(this.path) <del> ? /^\S+/.exec(providesModule)[0] <del> : undefined; <del> }); <del> } <del> if (hasteImpl !== undefined) { <del> const {enforceHasteNameMatches} = hasteImpl; <del> if (enforceHasteNameMatches) { <del> this._hasteName = this._hasteName.then(providesModule => { <del> enforceHasteNameMatches( <del> this.path, <del> providesModule, <del> ); <del> return hasteImpl.getHasteName(this.path); <del> }); <del> } else { <del> this._hasteName = Promise.resolve(hasteImpl.getHasteName(this.path)); <del> } <del> } else { <del> // Extract an id for the module if it's using @providesModule syntax <del> // and if it's NOT in node_modules (and not a whitelisted node_module). <del> // This handles the case where a project may have a dep that has @providesModule <del> // docblock comments, but doesn't want it to conflict with whitelisted @providesModule <del> // modules, such as react-haste, fbjs-haste, or react-native or with non-dependency, <del> // project-specific code that is using @providesModule. <del> this._hasteName = this._readDocBlock().then(moduleDocBlock => { <del> const {providesModule} = moduleDocBlock; <del> return providesModule <del> && !this._depGraphHelpers.isNodeModulesDir(this.path) <del> ? /^\S+/.exec(providesModule)[0] <del> : undefined; <del> }); <add> _getHasteName(): ?string { <add> if (this._hasteNameCache != null) { <add> return this._hasteNameCache.hasteName; <add> } <add> const hasteImpl = this._options.hasteImpl; <add> if (hasteImpl === undefined || hasteImpl.enforceHasteNameMatches) { <add> const moduleDocBlock = this._readDocBlock(); <add> const {providesModule} = moduleDocBlock; <add> this._hasteNameCache = { <add> hasteName: providesModule && !this._depGraphHelpers.isNodeModulesDir(this.path) <add> ? /^\S+/.exec(providesModule)[0] <add> : undefined, <add> }; <add> } <add> if (hasteImpl !== undefined) { <add> const {enforceHasteNameMatches} = hasteImpl; <add> if (enforceHasteNameMatches) { <add> /* $FlowFixMe: this rely on the above if being executed, that is fragile. Rework the algo. */ <add> enforceHasteNameMatches(this.path, this._hasteNameCache.hasteName); <ide> } <add> this._hasteNameCache = {hasteName: hasteImpl.getHasteName(this.path)}; <add> } else { <add> // Extract an id for the module if it's using @providesModule syntax <add> // and if it's NOT in node_modules (and not a whitelisted node_module). <add> // This handles the case where a project may have a dep that has @providesModule <add> // docblock comments, but doesn't want it to conflict with whitelisted @providesModule <add> // modules, such as react-haste, fbjs-haste, or react-native or with non-dependency, <add> // project-specific code that is using @providesModule. <add> const moduleDocBlock = this._readDocBlock(); <add> const {providesModule} = moduleDocBlock; <add> this._hasteNameCache = { <add> hasteName: <add> providesModule && !this._depGraphHelpers.isNodeModulesDir(this.path) <add> ? /^\S+/.exec(providesModule)[0] <add> : undefined, <add> }; <ide> } <del> return this._hasteName; <add> return this._hasteNameCache.hasteName; <ide> } <ide> <ide> /** <ide> * To what we read from the cache or worker, we need to add id and source. <ide> */ <ide> _finalizeReadResult( <ide> source: string, <del> id?: string, <add> id: ?string, <ide> extern: boolean, <ide> result: TransformedCode, <ide> ): ReadResult { <ide> class Module { <ide> if (promise != null) { <ide> return promise; <ide> } <del> const freshPromise = Promise.all([ <del> this._readSourceCode(), <del> this._readDocBlock(), <del> this._getHasteName(), <del> ]).then(([sourceCode, moduleDocBlock, id]) => { <add> const freshPromise = Promise.resolve().then(() => { <add> const sourceCode = this._readSourceCode(); <add> const moduleDocBlock = this._readDocBlock(); <add> const id = this._getHasteName(); <ide> // Ignore requires in JSON files or generated code. An example of this <ide> // is prebuilt files like the SourceMap library. <ide> const extern = this.isJSON() || 'extern' in moduleDocBlock;
1
PHP
PHP
use cakesession wrapper
c3e501b2d939f885c525b34e1a123023ab101f3b
<ide><path>lib/Cake/I18n/I18n.php <ide> App::uses('CakePlugin', 'Core'); <ide> App::uses('L10n', 'I18n'); <ide> App::uses('Multibyte', 'I18n'); <add>App::uses('CakeSession', 'Model/Datasource'); <ide> <ide> /** <ide> * I18n handles translation of Text and time format strings. <ide> public static function translate($singular, $plural = null, $domain = null, $cat <ide> } <ide> <ide> if (empty($language)) { <del> if (!empty($_SESSION['Config']['language'])) { <del> $language = $_SESSION['Config']['language']; <del> } else { <add> if (CakeSession::started()) { <add> $language = CakeSession::read('Config.language'); <add> } <add> if (empty($language)) { <ide> $language = Configure::read('Config.language'); <ide> } <ide> }
1
PHP
PHP
update exception type
094378ea3a51ade964d03180b838a5a1ac18ca10
<ide><path>src/Cache/Engine/FileEngine.php <ide> use Cake\Cache\CacheEngine; <ide> use Cake\Core\Configure; <ide> use Cake\Utility\Inflector; <del>use Exception; <add>use LogicException; <ide> <ide> /** <ide> * File Storage engine for cache. Filestorage is the slowest cache storage <ide> protected function _clearDirectory($path, $now, $threshold) { <ide> * @param string $key The key to decrement <ide> * @param int $offset The number to offset <ide> * @return void <del> * @throws \Exception <add> * @throws \LogicException <ide> */ <ide> public function decrement($key, $offset = 1) { <del> throw new Exception('Files cannot be atomically decremented.'); <add> throw new LogicException('Files cannot be atomically decremented.'); <ide> } <ide> <ide> /** <ide> public function decrement($key, $offset = 1) { <ide> * @param string $key The key to decrement <ide> * @param int $offset The number to offset <ide> * @return void <del> * @throws \Exception <add> * @throws \LogicException <ide> */ <ide> public function increment($key, $offset = 1) { <del> throw new Exception('Files cannot be atomically incremented.'); <add> throw new LogicException('Files cannot be atomically incremented.'); <ide> } <ide> <ide> /**
1
Javascript
Javascript
fix saucelabs config for edge and ie
bbaa8aa67546378ad94aa3a71c91d6631e560929
<ide><path>Gruntfile.js <ide> module.exports = function (grunt) { <ide> }, <ide> karma : { <ide> options: { <add> browserNoActivityTimeout: 60000, <add> browserDisconnectTimeout: 10000, <add> browserDisconnectTolerance: 2, <ide> frameworks: ['qunit'], <ide> files: [ <ide> 'min/moment-with-locales.js', <ide> module.exports = function (grunt) { <ide> }, <ide> slME25Win10: { <ide> base: 'SauceLabs', <del> browserName: 'microsoft edge', <add> browserName: 'MicrosoftEdge', <ide> platform: 'Windows 10', <del> version: '25' <add> version: '20.10240' <ide> }, <ide> slFfLinux: { <ide> base: 'SauceLabs',
1
Text
Text
add v3.1.4 to changelog.md
8974f23965dbd38f4ff4497f76e3d28c3ddb3abf
<ide><path>CHANGELOG.md <ide> - [#16462](https://github.com/emberjs/ember.js/pull/16462) [CLEANUP] Remove deprecated `MODEL_FACTORY_INJECTIONS`. <ide> - [emberjs/rfcs#286](https://github.com/emberjs/rfcs/blob/master/text/0286-block-let-template-helper.md) [FEATURE] Enabled block `let` handlebars helper by default. <ide> <add>### v3.1.4 (August 07, 2018) <add> <add>- [#16565](https://github.com/emberjs/ember.js/pull/16565) Fix template / component caching during rendering. <add>- [#16853](https://github.com/emberjs/ember.js/pull/16853) [BUGFIX beta] Allow ArrayProxy#pushObjects to accept ArrayProxy again <add> <ide> ### v3.1.3 (June 21, 2018) <ide> - [#16754](https://github.com/emberjs/ember.js/pull/16754) [BUGFIX] Fix container destroy timing <ide>
1
Python
Python
avoid small positive integers in refcount test
b73f84f3c3782eaacde09ea4f8fb4f6abac338d2
<ide><path>numpy/core/tests/test_dtype.py <ide> def test_structured_object_item_setting(self, dt, pat, count, singleton): <ide> def test_structured_object_indexing(self, shape, index, items_changed, <ide> dt, pat, count, singleton): <ide> """Structured object reference counting for advanced indexing.""" <del> zero = 0 <del> one = 1 <add> # Use two small negative values (should be singletons, but less likely <add> # to run into race-conditions). This failed in some threaded envs <add> # When using 0 and 1. If it fails again, should remove all explicit <add> # checks, and rely on `pytest-leaks` reference count checker only. <add> val0 = -4 <add> val1 = -5 <ide> <del> arr = np.zeros(shape, dt) <add> arr = np.full(shape, val0, dt) <ide> <ide> gc.collect() <del> before_zero = sys.getrefcount(zero) <del> before_one = sys.getrefcount(one) <add> before_val0 = sys.getrefcount(val0) <add> before_val1 = sys.getrefcount(val1) <ide> # Test item getting: <ide> part = arr[index] <del> after_zero = sys.getrefcount(zero) <del> assert after_zero - before_zero == count * items_changed <add> after_val0 = sys.getrefcount(val0) <add> assert after_val0 - before_val0 == count * items_changed <ide> del part <ide> # Test item setting: <del> arr[index] = one <add> arr[index] = val1 <ide> gc.collect() <del> after_zero = sys.getrefcount(zero) <del> after_one = sys.getrefcount(one) <del> assert before_zero - after_zero == count * items_changed <del> assert after_one - before_one == count * items_changed <add> after_val0 = sys.getrefcount(val0) <add> after_val1 = sys.getrefcount(val1) <add> assert before_val0 - after_val0 == count * items_changed <add> assert after_val1 - before_val1 == count * items_changed <ide> <ide> @pytest.mark.parametrize(['dt', 'pat', 'count', 'singleton'], <ide> iter_struct_object_dtypes())
1
Text
Text
add docs about serialization
214209d2da82591f0bbb1ac81b2e6a413fe4819d
<ide><path>docs/internals/serialization.md <add>## Serialization in Atom <add> <add>When a window is refreshed or restored from a previous session, the view and its <add>associated objects are *deserialized* from a JSON representation that was stored <add>during the window's previous shutdown. For your own views and objects to be <add>compatible with refreshing, you'll need to make them play nicely with the <add>serializing and deserializing. <add> <add>### Package Serialization Hook <add> <add>Your package's main module can optionally include a `serialize` method, which <add>will be called before your package is deactivated. You should return JSON, which <add>will be handed back to you as an argument to `activate` next time it is called. <add>In the following example, the package keeps an instance of `MyObject` in the <add>same state across refreshes. <add> <add>```coffee-script <add>module.exports = <add> activate: (state) -> <add> @myObject = <add> if state <add> deserialize(state) <add> else <add> new MyObject("Hello") <add> <add> serialize: -> <add> @myObject.serialize() <add>``` <add> <add>### Serialization Methods <add> <add>```coffee-script <add>class MyObject <add> registerDeserializer(this) <add> @deserialize: ({data}) -> new MyObject(data) <add> constructor: (@data) -> <add> serialize: -> { deserializer: 'MyObject', data: @data } <add>``` <add> <add>#### .serialize() <add>Objects that you want to serialize should implement `.serialize()`. This method <add>should return a serializable object, and it must contain a key named <add>`deserializer` whose value is the name of a registered deserializer that can <add>convert the rest of the data to an object. It's usually just the name of the <add>class itself. <add> <add>#### @deserialize(data) <add>The other side of the coin is the `deserialize` method, which is usually a <add>class-level method on the same class that implements `serialize`. This method's <add>job is to convert a state object returned from a previous call `serialize` back <add>into a genuine object. <add> <add>#### registerDeserializer(klass) <add>You need to call the global `registerDeserializer` method with your class in <add>order to make it available to the deserialization system. Now you can call the <add>global `deserialize` method with state returned from `serialize`, and your <add>class's `deserialize` method will be selected automatically. <add> <add>### Versioning <add> <add>```coffee-script <add>class MyObject <add> @version: 2 <add> @deserialize: (state) -> ... <add> serialize: -> { version: MyObject.version, ... } <add>``` <add> <add>Your serializable class can optionally have a version class-level `@version` <add>property and include a `version` key in its serialized state. When <add>deserializing, Atom will only attempt to call deserialize if the two versions <add>match, and otherwise return undefined. We plan on implementing a migration <add>system in the future, but this at least protects you from improperly <add>deserializing old state. If you find yourself in dire need of the migration <add>system, let us know. <add> <add>### Deferred Package Deserializers <add> <add>If your package defers loading on startup with an `activationEvents` property in <add>its `package.cson`, your deserializers won't be loaded until your package is <add>activated. If you want to deserialize an object from your package on startup, <add>this could be a problem. <add> <add>The solution is to also supply a `deferredDeserializers` array in your <add>`package.cson` with the names of all your deserializers. When Atom attempts to <add>deserialize some state whose `deserializer` matches one of these names, it will <add>load your package first so it can register any necessary deserializers before <add>proceeding. <add> <add>For example, the markdown preview package doesn't fully load until a preview is <add>triggered. But if you refresh a window with a preview pane, it loads the <add>markdown package early so Atom can deserialize the view correctly. <add> <add>```coffee-script <add># markdown-preview/package.cson <add>'activationEvents': 'markdown-preview:toggle': '.editor' <add>'deferredDeserializers': ['MarkdownPreviewView'] <add>... <add>```
1
Ruby
Ruby
fix force_homebrew_on_linux behaviour."
9ad37ddc36c8438db97fdb3e4484d724e06eaffe
<ide><path>Library/Homebrew/extend/os/mac/software_spec.rb <ide> # typed: false <ide> # frozen_string_literal: true <ide> <del># The Library/Homebrew/extend/os/software_spec.rb conditional logic will need to be more nuanced <del># if this file ever includes more than `uses_from_macos`. <ide> class SoftwareSpec <ide> undef uses_from_macos <ide> <ide><path>Library/Homebrew/extend/os/software_spec.rb <ide> # typed: strict <ide> # frozen_string_literal: true <ide> <del># This logic will need to be more nuanced if this file includes more than `uses_from_macos`. <del>if OS.mac? || Homebrew::EnvConfig.force_homebrew_on_linux? <del> require "extend/os/mac/software_spec" <del>elsif OS.linux? <add>if OS.linux? <ide> require "extend/os/linux/software_spec" <add>elsif OS.mac? <add> require "extend/os/mac/software_spec" <ide> end
2
Java
Java
add debug logging for batched animation operation
d304ca8da60f37792e38ab734975ecfb0a8f8047
<ide><path>ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java <ide> public void invalidate() { <ide> */ <ide> @Override <ide> public void queueAndExecuteBatchedOperations(final ReadableArray opsAndArgs) { <add> final int opBufferSize = opsAndArgs.size(); <add> <add> if (ANIMATED_MODULE_DEBUG) { <add> FLog.e(NAME, "queueAndExecuteBatchedOperations: opBufferSize: " + opBufferSize); <add> } <add> <ide> // This block of code is unfortunate and should be refactored - we just want to <ide> // extract the ViewTags in the ReadableArray to mark animations on views as being enabled. <ide> // We only do this for initializing animations on views - disabling animations on views <ide> // happens later, when the disconnect/stop operations are actually executed. <del> final int opBufferSize = opsAndArgs.size(); <ide> for (int i = 0; i < opBufferSize; ) { <ide> BatchExecutionOpCodes command = BatchExecutionOpCodes.fromId(opsAndArgs.getInt(i++)); <ide> switch (command) {
1
Javascript
Javascript
remove var in libraries/utilities/matrixmath.js
368518eff13c1f606db6c995763263a885af20f8
<ide><path>Libraries/Utilities/MatrixMath.js <ide> const MatrixMath = { <ide> ); <ide> <ide> // output values <del> var perspective = []; <add> let perspective = []; <ide> const quaternion = []; <ide> const scale = []; <ide> const skew = []; <ide> const MatrixMath = { <ide> } <ide> const matrix = []; <ide> const perspectiveMatrix = []; <del> for (var i = 0; i < 4; i++) { <add> for (let i = 0; i < 4; i++) { <ide> matrix.push([]); <ide> for (let j = 0; j < 4; j++) { <ide> const value = transformMatrix[i * 4 + j] / transformMatrix[15]; <ide> const MatrixMath = { <ide> const transposedInversePerspectiveMatrix = MatrixMath.transpose( <ide> inversePerspectiveMatrix, <ide> ); <del> var perspective = MatrixMath.multiplyVectorByMatrix( <add> perspective = MatrixMath.multiplyVectorByMatrix( <ide> rightHandSide, <ide> transposedInversePerspectiveMatrix, <ide> ); <ide> const MatrixMath = { <ide> } <ide> <ide> // translation is simple <del> for (var i = 0; i < 3; i++) { <add> for (let i = 0; i < 3; i++) { <ide> translation[i] = matrix[3][i]; <ide> } <ide> <ide> // Now get scale and shear. <ide> // 'row' is a 3 element array of 3 component vectors <ide> const row = []; <del> for (i = 0; i < 3; i++) { <add> for (let i = 0; i < 3; i++) { <ide> row[i] = [matrix[i][0], matrix[i][1], matrix[i][2]]; <ide> } <ide> <ide> const MatrixMath = { <ide> // is -1, then negate the matrix and the scaling factors. <ide> const pdum3 = MatrixMath.v3Cross(row[1], row[2]); <ide> if (MatrixMath.v3Dot(row[0], pdum3) < 0) { <del> for (i = 0; i < 3; i++) { <add> for (let i = 0; i < 3; i++) { <ide> scale[i] *= -1; <ide> row[i][0] *= -1; <ide> row[i][1] *= -1;
1
Mixed
Python
remove the docs tests
80f6738b2af50f9812ae4159e23fc60dcaac7fcf
<ide><path>official/utils/docs/README.md <add># Docs generation scripts for TensorFlow Models <add> <add>The scripts here are used to generate api-reference pages for tensorflow.org. <add> <add>The scripts require tensorflow_docs, which can be installed directly from <add>github: <add> <add>``` <add>$> pip install -U git+https://github.com/tensorflow/docs <add>$> python build_all_api_docs.py --output_dir=/tmp/tfm_docs <add>``` <add> <ide><path>official/utils/docs/build_all_api_docs.py <ide> Example: <ide> <ide> $> pip install -U git+https://github.com/tensorflow/docs <del>$> python build_nlp_api_docs \ <del> --output_dir=/tmp/api_docs <add>$> python build_nlp_api_docs.py --output_dir=/tmp/api_docs <ide> """ <ide> <ide> import pathlib <ide><path>official/utils/docs/build_all_api_docs_test.py <del># Copyright 2022 The TensorFlow Authors. All Rights Reserved. <del># <del># Licensed under the Apache License, Version 2.0 (the "License"); <del># you may not use this file except in compliance with the License. <del># You may obtain a copy of the License at <del># <del># http://www.apache.org/licenses/LICENSE-2.0 <del># <del># Unless required by applicable law or agreed to in writing, software <del># distributed under the License is distributed on an "AS IS" BASIS, <del># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <del># See the License for the specific language governing permissions and <del># limitations under the License. <del> <del>"""Tests for official.tools.build_docs.""" <del> <del>import os <del>import shutil <del> <del>import tensorflow as tf <del> <del>from official.utils.docs import build_all_api_docs <del> <del> <del>class BuildDocsTest(tf.test.TestCase): <del> <del> def setUp(self): <del> super(BuildDocsTest, self).setUp() <del> self.workdir = self.get_temp_dir() <del> if os.path.exists(self.workdir): <del> shutil.rmtree(self.workdir) <del> os.makedirs(self.workdir) <del> <del> def test_api_gen(self): <del> build_all_api_docs.gen_api_docs( <del> code_url_prefix="https://github.com/tensorflow/models/blob/master/tensorflow_models", <del> site_path="tf_modeling/api_docs/python", <del> output_dir=self.workdir, <del> project_short_name="tfm", <del> project_full_name="TensorFlow Modeling", <del> search_hints=True) <del> <del> # Check that the "defined in" section is working <del> with open(os.path.join(self.workdir, "tfm.md")) as f: <del> content = f.read() <del> self.assertIn("__init__.py", content) <del> <del> <del>if __name__ == "__main__": <del> tf.test.main() <ide><path>official/utils/docs/build_nlp_api_docs.py <ide> Example: <ide> <ide> $> pip install -U git+https://github.com/tensorflow/docs <del>$> python build_nlp_api_docs \ <del> --output_dir=/tmp/api_docs <add>$> python build_nlp_api_docs.py --output_dir=/tmp/api_docs <ide> """ <ide> <ide> import pathlib <ide><path>official/utils/docs/build_orbit_api_docs.py <ide> Example: <ide> <ide> $> pip install -U git+https://github.com/tensorflow/docs <del>$> python build_orbit_api_docs \ <del> --output_dir=/tmp/api_docs <add>$> python build_orbit_api_docs.py --output_dir=/tmp/api_docs <ide> """ <ide> from absl import app <ide> from absl import flags <ide><path>official/utils/docs/build_orbit_api_docs_test.py <del># Copyright 2022 The TensorFlow Authors. All Rights Reserved. <del># <del># Licensed under the Apache License, Version 2.0 (the "License"); <del># you may not use this file except in compliance with the License. <del># You may obtain a copy of the License at <del># <del># http://www.apache.org/licenses/LICENSE-2.0 <del># <del># Unless required by applicable law or agreed to in writing, software <del># distributed under the License is distributed on an "AS IS" BASIS, <del># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <del># See the License for the specific language governing permissions and <del># limitations under the License. <del> <del>"""Tests for official.tools.build_docs.""" <del> <del>import os <del>import shutil <del> <del>import tensorflow as tf <del> <del>from official.utils.docs import build_orbit_api_docs <del> <del> <del>class BuildDocsTest(tf.test.TestCase): <del> <del> def setUp(self): <del> super(BuildDocsTest, self).setUp() <del> self.workdir = self.get_temp_dir() <del> if os.path.exists(self.workdir): <del> shutil.rmtree(self.workdir) <del> os.makedirs(self.workdir) <del> <del> def test_api_gen(self): <del> <del> build_orbit_api_docs.gen_api_docs( <del> code_url_prefix="https://github.com/tensorflow/models/blob/master/orbit", <del> site_path="/api_docs/python", <del> output_dir=self.workdir, <del> project_short_name="orbit", <del> project_full_name="Orbit", <del> search_hints=True) <del> <del> # Check that the "defined in" section working <del> with open(os.path.join(self.workdir, "orbit.md")) as f: <del> content = f.read() <del> self.assertIn("__init__.py", content) <del> <del> <del>if __name__ == "__main__": <del> tf.test.main() <ide><path>official/utils/docs/build_vision_api_docs.py <ide> Example: <ide> <ide> $> pip install -U git+https://github.com/tensorflow/docs <del>$> python build_vision_api_docs \ <del> --output_dir=/tmp/api_docs <add>$> python build_vision_api_docs.py --output_dir=/tmp/api_docs <ide> """ <ide> <ide> import pathlib
7
Python
Python
add error handling on url fetches
6fddf15f1f04487e098bf47f56d7224d2e82e335
<ide><path>keras/datasets/data_utils.py <ide> from __future__ import print_function <ide> <ide> import tarfile, inspect, os <del>from six.moves.urllib.request import urlretrieve <add>from six.moves.urllib.request import FancyURLopener <ide> <ide> from ..utils.generic_utils import Progbar <ide> <add>class ParanoidURLopener(FancyURLopener): <add> def http_error_default(self, url, fp, errcode, errmsg, headers): <add> raise Exception('URL fetch failure on {}: {} -- {}'.format(url, errcode, errmsg)) <ide> <ide> def get_file(fname, origin, untar=False): <ide> datadir = os.path.expanduser(os.path.join('~', '.keras', 'datasets')) <ide> def dl_progress(count, block_size, total_size): <ide> else: <ide> progbar.update(count*block_size) <ide> <del> urlretrieve(origin, fpath, dl_progress) <add> ParanoidURLopener().retrieve(origin, fpath, dl_progress) <ide> progbar = None <ide> <ide> if untar:
1
Mixed
Javascript
add getprompt to get the current prompt
60a97c0b42433df051fb5b665dcb62c3472a5328
<ide><path>doc/api/readline.md <ide> added: v0.1.98 <ide> The `rl.setPrompt()` method sets the prompt that will be written to `output` <ide> whenever `rl.prompt()` is called. <ide> <add>### `rl.getPrompt()` <add><!-- YAML <add>added: REPLACEME <add>--> <add> <add>* Returns: {string} the current prompt string <add> <add>The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. <add> <ide> ### `rl.write(data[, key])` <ide> <!-- YAML <ide> added: v0.1.98 <ide><path>lib/internal/repl/utils.js <ide> function setupPreview(repl, contextSymbol, bufferSymbol, active) { <ide> let escaped = null; <ide> <ide> function getPreviewPos() { <del> const displayPos = repl._getDisplayPos(`${repl._prompt}${repl.line}`); <add> const displayPos = repl._getDisplayPos(`${repl.getPrompt()}${repl.line}`); <ide> const cursorPos = repl.line.length !== repl.cursor ? <ide> repl.getCursorPos() : <ide> displayPos; <ide> function setupPreview(repl, contextSymbol, bufferSymbol, active) { <ide> rows = pos.displayPos.rows - pos.cursorPos.rows; <ide> moveCursor(repl.output, 0, rows); <ide> } <del> const totalLine = `${repl._prompt}${repl.line}${completionPreview}`; <add> const totalLine = `${repl.getPrompt()}${repl.line}${completionPreview}`; <ide> const newPos = repl._getDisplayPos(totalLine); <ide> // Minimize work for the terminal. It is enough to clear the right part of <ide> // the current line in case the preview is visible on a single line. <ide> function setupPreview(repl, contextSymbol, bufferSymbol, active) { <ide> } <ide> repl.output.write(result); <ide> cursorTo(repl.output, cursorPos.cols); <del> const totalLine = `${repl._prompt}${repl.line}${suffix}`; <add> const totalLine = `${repl.getPrompt()}${repl.line}${suffix}`; <ide> const newPos = repl._getDisplayPos(totalLine); <ide> const rows = newPos.rows - cursorPos.rows - (newPos.cols === 0 ? 1 : 0); <ide> moveCursor(repl.output, 0, -rows); <ide> function setupReverseSearch(repl) { <ide> let rows = 0; <ide> if (lastMatch !== -1) { <ide> const line = repl.history[lastMatch].slice(0, lastCursor); <del> rows = repl._getDisplayPos(`${repl._prompt}${line}`).rows; <add> rows = repl._getDisplayPos(`${repl.getPrompt()}${line}`).rows; <ide> cursorTo(repl.output, promptPos.cols); <ide> } else if (isInReverseSearch && repl.line !== '') { <ide> rows = repl.getCursorPos().rows; <ide> function setupReverseSearch(repl) { <ide> <ide> // To know exactly how many rows we have to move the cursor back we need the <ide> // cursor rows, the output rows and the input rows. <del> const prompt = repl._prompt; <add> const prompt = repl.getPrompt(); <ide> const cursorLine = `${prompt}${outputLine.slice(0, cursor)}`; <ide> const cursorPos = repl._getDisplayPos(cursorLine); <ide> const outputPos = repl._getDisplayPos(`${prompt}${outputLine}`); <ide> function setupReverseSearch(repl) { <ide> if (!isInReverseSearch) { <ide> if (key.ctrl && checkAndSetDirectionKey(key.name)) { <ide> historyIndex = repl.historyIndex; <del> promptPos = repl._getDisplayPos(`${repl._prompt}`); <add> promptPos = repl._getDisplayPos(`${repl.getPrompt()}`); <ide> print(repl.line, `${labels[dir]}_`); <ide> isInReverseSearch = true; <ide> } <ide><path>lib/readline.js <ide> Interface.prototype.setPrompt = function(prompt) { <ide> }; <ide> <ide> <add>Interface.prototype.getPrompt = function() { <add> return this._prompt; <add>}; <add> <add> <ide> Interface.prototype._setRawMode = function(mode) { <ide> const wasInRawMode = this.input.isRaw; <ide> <ide><path>test/parallel/test-readline-interface.js <ide> for (let i = 0; i < 12; i++) { <ide> }); <ide> } <ide> <add> // Calling the getPrompt method <add> { <add> const expectedPrompts = ['$ ', '> ']; <add> const [rli] = getInterface({ terminal }); <add> for (const prompt of expectedPrompts) { <add> rli.setPrompt(prompt); <add> assert.strictEqual(rli.getPrompt(), prompt); <add> } <add> } <add> <ide> { <ide> const expected = terminal ? <ide> ['\u001b[1G', '\u001b[0J', '$ ', '\u001b[3G'] : <ide> for (let i = 0; i < 12; i++) { <ide> <ide> rl.prompt(); <ide> <del> assert.strictEqual(rl._prompt, '$ '); <add> assert.strictEqual(rl.getPrompt(), '$ '); <ide> } <ide> <ide> { <ide><path>test/parallel/test-repl-options.js <ide> assert.throws(r3, { <ide> // 4, Verify that defaults are used when no arguments are provided <ide> const r4 = repl.start(); <ide> <del>assert.strictEqual(r4._prompt, '> '); <add>assert.strictEqual(r4.getPrompt(), '> '); <ide> assert.strictEqual(r4.input, process.stdin); <ide> assert.strictEqual(r4.output, process.stdout); <ide> assert.strictEqual(r4.terminal, !!r4.output.isTTY);
5
Python
Python
remove legacy conv1d -> conv1d downcasing
6f789cc4ba300d261dbe68c12f81074dd239c790
<ide><path>keras/layers/convolutional.py <ide> def convolution_op(self, inputs, kernel): <ide> else: <ide> tf_padding = self.padding <ide> <del> tf_op_name = self.__class__.__name__ <del> if tf_op_name == 'Conv1D': <del> tf_op_name = 'conv1d' # Backwards compat. <del> <ide> return tf.nn.convolution( <ide> inputs, <ide> kernel, <ide> strides=list(self.strides), <ide> padding=tf_padding, <ide> dilations=list(self.dilation_rate), <ide> data_format=self._tf_data_format, <del> name=tf_op_name) <add> name=self.__class__.__name__) <ide> <ide> def call(self, inputs): <ide> input_shape = inputs.shape
1
PHP
PHP
update testvalidator due to code style
94484cd78c314625192d5255ad7c5192dfb00a2b
<ide><path>tests/Validation/ValidationValidatorTest.php <ide> public function testValidateEach() <ide> $this->assertTrue($v->passes()); <ide> } <ide> <del> public function testValidateEachWithNonIndexedArray() <del> { <del> $trans = $this->getRealTranslator(); <del> $data = ['foobar' => [ <del> ['key' => 'foo', 'value' => 5], <del> ['key' => 'foo', 'value' => 10], <del> ['key' => 'foo', 'value' => 16] <del> ]]; <del> <del> $v = new Validator($trans, $data, ['foo' => 'Array']); <del> $v->each('foobar', ['key' => 'required', 'value' => 'numeric|min:6|max:14']); <del> $this->assertFalse($v->passes()); <del> <del> $v = new Validator($trans, $data, ['foo' => 'Array']); <del> $v->each('foobar', ['key' => 'required', 'value' => 'numeric|min:4|max:16']); <del> $this->assertTrue($v->passes()); <del> } <add> public function testValidateEachWithNonIndexedArray() <add> { <add> $trans = $this->getRealTranslator(); <add> $data = ['foobar' => [ <add> ['key' => 'foo', 'value' => 5], <add> ['key' => 'foo', 'value' => 10], <add> ['key' => 'foo', 'value' => 16] <add> ]]; <add> <add> $v = new Validator($trans, $data, ['foo' => 'Array']); <add> $v->each('foobar', ['key' => 'required', 'value' => 'numeric|min:6|max:14']); <add> $this->assertFalse($v->passes()); <add> <add> $v = new Validator($trans, $data, ['foo' => 'Array']); <add> $v->each('foobar', ['key' => 'required', 'value' => 'numeric|min:4|max:16']); <add> $this->assertTrue($v->passes()); <add> } <ide> <ide> public function testValidateEachWithNonArrayWithArrayRule() <ide> {
1
Text
Text
add return value to util.promisify
9c44215a91a7d367030eea441e1feea4a95d2ded
<ide><path>doc/api/util.md <ide> added: v8.0.0 <ide> --> <ide> <ide> * `original` {Function} <add>* Returns: {Function} <ide> <ide> Takes a function following the common Node.js callback style, i.e. taking a <ide> `(err, value) => ...` callback as the last argument, and returns a version
1
Ruby
Ruby
remove github packages bulk upload logic
a28dda50629de70454d0ad91f966101310ff7074
<ide><path>Library/Homebrew/dev-cmd/bottle.rb <ide> def bottle_formula(f, args:) <ide> tab_json = Utils.safe_popen_read("tar", "xfO", f.local_bottle_path, tab_path) <ide> tab = Tab.from_file_content(tab_json, tab_path) <ide> <del> # TODO: most of this logic can be removed when we're done with bulk GitHub Packages bottle uploading <del> tap_git_revision = tab["source"]["tap_git_head"] <del> if tap.core_tap? <del> if bottle_tag.to_s.end_with?("_linux") <del> tap_git_remote = "https://github.com/Homebrew/linuxbrew-core" <del> formulae_brew_sh_path = "formula-linux" <del> else <del> tap_git_remote = "https://github.com/Homebrew/homebrew-core" <del> formulae_brew_sh_path = "formula" <del> end <del> end <del> <ide> _, _, bottle_cellar = Formula[f.name].bottle_specification.checksum_for(bottle_tag, no_older_versions: true) <ide> relocatable = [:any, :any_skip_relocation].include?(bottle_cellar) <ide> skip_relocation = bottle_cellar == :any_skip_relocation
1
Javascript
Javascript
use es6 classes for elements
4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197
<ide><path>src/core/core.animation.js <ide> 'use strict'; <ide> <del>var Element = require('./core.element'); <add>const Element = require('./core.element'); <add>const helpers = require('../helpers/index'); <ide> <del>var exports = Element.extend({ <del> chart: null, // the animation associated chart instance <del> currentStep: 0, // the current animation step <del> numSteps: 60, // default number of steps <del> easing: '', // the easing to use for this animation <del> render: null, // render function used by the animation service <add>class Animation extends Element { <ide> <del> onAnimationProgress: null, // user specified callback to fire on each step of the animation <del> onAnimationComplete: null, // user specified callback to fire when the animation finishes <del>}); <add> constructor(props) { <add> super({ <add> chart: null, // the animation associated chart instance <add> currentStep: 0, // the current animation step <add> numSteps: 60, // default number of steps <add> easing: '', // the easing to use for this animation <add> render: null, // render function used by the animation service <ide> <del>module.exports = exports; <add> onAnimationProgress: null, // user specified callback to fire on each step of the animation <add> onAnimationComplete: null, // user specified callback to fire when the animation finishes <add> }); <add> helpers.extend(this, props); <add> } <add> <add>} <add> <add>module.exports = Animation; <ide><path>src/core/core.element.js <ide> 'use strict'; <ide> <del>var color = require('chartjs-color'); <del>var helpers = require('../helpers/index'); <add>const color = require('chartjs-color'); <add>const helpers = require('../helpers/index'); <ide> <ide> function interpolate(start, view, model, ease) { <ide> var keys = Object.keys(model); <ide> function interpolate(start, view, model, ease) { <ide> } <ide> } <ide> <del>var Element = function(configuration) { <del> helpers.extend(this, configuration); <del> this.initialize.apply(this, arguments); <del>}; <add>class Element { <ide> <del>helpers.extend(Element.prototype, { <del> _type: undefined, <add> constructor(configuration) { <add> helpers.extend(this, configuration); <add> this.initialize.apply(this, arguments); <add> } <ide> <del> initialize: function() { <add> initialize() { <ide> this.hidden = false; <del> }, <add> } <ide> <del> pivot: function() { <add> pivot() { <ide> var me = this; <ide> if (!me._view) { <ide> me._view = helpers.extend({}, me._model); <ide> } <ide> me._start = {}; <ide> return me; <del> }, <add> } <ide> <del> transition: function(ease) { <add> transition(ease) { <ide> var me = this; <ide> var model = me._model; <ide> var start = me._start; <ide> helpers.extend(Element.prototype, { <ide> interpolate(start, view, model, ease); <ide> <ide> return me; <del> }, <add> } <ide> <del> tooltipPosition: function() { <add> tooltipPosition() { <ide> return { <ide> x: this._model.x, <ide> y: this._model.y <ide> }; <del> }, <add> } <ide> <del> hasValue: function() { <add> hasValue() { <ide> return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y); <ide> } <del>}); <add>} <ide> <ide> Element.extend = helpers.inherits; <ide> <ide><path>src/core/core.scale.js <ide> 'use strict'; <ide> <del>var defaults = require('./core.defaults'); <del>var Element = require('./core.element'); <del>var helpers = require('../helpers/index'); <del>var Ticks = require('./core.ticks'); <add>const defaults = require('./core.defaults'); <add>const Element = require('./core.element'); <add>const helpers = require('../helpers/index'); <add>const Ticks = require('./core.ticks'); <ide> <del>var isArray = helpers.isArray; <del>var isNullOrUndef = helpers.isNullOrUndef; <del>var valueOrDefault = helpers.valueOrDefault; <del>var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault; <add>const isArray = helpers.isArray; <add>const isNullOrUndef = helpers.isNullOrUndef; <add>const valueOrDefault = helpers.valueOrDefault; <add>const valueAtIndexOrDefault = helpers.valueAtIndexOrDefault; <ide> <ide> defaults._set('scale', { <ide> display: true, <ide> function skip(ticks, spacing, majorStart, majorEnd) { <ide> } <ide> } <ide> <del>var Scale = Element.extend({ <add>class Scale extends Element { <add> <ide> /** <ide> * Parse a supported input value to internal representation. <ide> * @param {*} raw <ide> * @param {number} index <ide> * @private <ide> * @since 3.0 <ide> */ <del> _parse: function(raw, index) { // eslint-disable-line no-unused-vars <add> _parse(raw, index) { // eslint-disable-line no-unused-vars <ide> return raw; <del> }, <add> } <ide> <ide> /** <ide> * Parse an object for axis to internal representation. <ide> var Scale = Element.extend({ <ide> * @private <ide> * @since 3.0 <ide> */ <del> _parseObject: function(obj, axis, index) { <add> _parseObject(obj, axis, index) { <ide> if (obj[axis] !== undefined) { <ide> return this._parse(obj[axis], index); <ide> } <ide> return null; <del> }, <add> } <ide> <del> _getMinMax: function(canStack) { <add> _getMinMax(canStack) { <ide> var me = this; <ide> var metas = me._getMatchingVisibleMetas(); <ide> var min = Number.POSITIVE_INFINITY; <ide> var Scale = Element.extend({ <ide> max: max, <ide> minPositive: minPositive <ide> }; <del> }, <add> } <ide> <del> _invalidateCaches: helpers.noop, <add> _invalidateCaches() {} <ide> <ide> /** <ide> * Get the padding needed for the scale <ide> * @method getPadding <ide> * @private <ide> * @returns {Padding} the necessary padding <ide> */ <del> getPadding: function() { <add> getPadding() { <ide> var me = this; <ide> return { <ide> left: me.paddingLeft || 0, <ide> top: me.paddingTop || 0, <ide> right: me.paddingRight || 0, <ide> bottom: me.paddingBottom || 0 <ide> }; <del> }, <add> } <ide> <ide> /** <ide> * Returns the scale tick objects ({label, major}) <ide> * @since 2.7 <ide> */ <del> getTicks: function() { <add> getTicks() { <ide> return this.ticks; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _getLabels: function() { <add> _getLabels() { <ide> var data = this.chart.data; <ide> return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels; <del> }, <add> } <ide> <ide> // These methods are ordered by lifecyle. Utilities then follow. <ide> // Any function defined here is inherited by all scale types. <ide> // Any function can be extended by the scale type <ide> <del> beforeUpdate: function() { <add> beforeUpdate() { <ide> helpers.callback(this.options.beforeUpdate, [this]); <del> }, <add> } <ide> <ide> /** <ide> * @param {number} maxWidth - the max width in pixels <ide> var Scale = Element.extend({ <ide> * - padding - space that's required to show the labels at the edges of the scale <ide> * - thickness of scales or legends in another orientation <ide> */ <del> update: function(maxWidth, maxHeight, margins) { <add> update(maxWidth, maxHeight, margins) { <ide> var me = this; <ide> var tickOpts = me.options.ticks; <ide> var sampleSize = tickOpts.sampleSize; <ide> var Scale = Element.extend({ <ide> // TODO(v3): remove minSize as a public property and return value from all layout boxes. It is unused <ide> // make maxWidth and maxHeight private <ide> return me.minSize; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _configure: function() { <add> _configure() { <ide> var me = this; <ide> var reversePixels = me.options.ticks.reverse; <ide> var startPixel, endPixel; <ide> var Scale = Element.extend({ <ide> me._endPixel = endPixel; <ide> me._reversePixels = reversePixels; <ide> me._length = endPixel - startPixel; <del> }, <add> } <ide> <del> afterUpdate: function() { <add> afterUpdate() { <ide> helpers.callback(this.options.afterUpdate, [this]); <del> }, <add> } <ide> <ide> // <ide> <del> beforeSetDimensions: function() { <add> beforeSetDimensions() { <ide> helpers.callback(this.options.beforeSetDimensions, [this]); <del> }, <del> setDimensions: function() { <add> } <add> setDimensions() { <ide> var me = this; <ide> // Set the unconstrained dimension before label rotation <ide> if (me.isHorizontal()) { <ide> var Scale = Element.extend({ <ide> me.paddingTop = 0; <ide> me.paddingRight = 0; <ide> me.paddingBottom = 0; <del> }, <del> afterSetDimensions: function() { <add> } <add> afterSetDimensions() { <ide> helpers.callback(this.options.afterSetDimensions, [this]); <del> }, <add> } <ide> <ide> // Data limits <del> beforeDataLimits: function() { <add> beforeDataLimits() { <ide> helpers.callback(this.options.beforeDataLimits, [this]); <del> }, <del> determineDataLimits: helpers.noop, <del> afterDataLimits: function() { <add> } <add> determineDataLimits() {} <add> afterDataLimits() { <ide> helpers.callback(this.options.afterDataLimits, [this]); <del> }, <add> } <ide> <ide> // <del> beforeBuildTicks: function() { <add> beforeBuildTicks() { <ide> helpers.callback(this.options.beforeBuildTicks, [this]); <del> }, <del> buildTicks: helpers.noop, <del> afterBuildTicks: function() { <add> } <add> buildTicks() {} <add> afterBuildTicks() { <ide> helpers.callback(this.options.afterBuildTicks, [this]); <del> }, <add> } <ide> <del> beforeTickToLabelConversion: function() { <add> beforeTickToLabelConversion() { <ide> helpers.callback(this.options.beforeTickToLabelConversion, [this]); <del> }, <add> } <ide> /** <ide> * Convert ticks to label strings <ide> */ <del> generateTickLabels: function(ticks) { <add> generateTickLabels(ticks) { <ide> var me = this; <ide> var tickOpts = me.options.ticks; <ide> var i, ilen, tick; <ide> for (i = 0, ilen = ticks.length; i < ilen; i++) { <ide> tick = ticks[i]; <ide> tick.label = helpers.callback(tickOpts.callback, [tick.value, i, ticks], me); <ide> } <del> }, <del> afterTickToLabelConversion: function() { <add> } <add> afterTickToLabelConversion() { <ide> helpers.callback(this.options.afterTickToLabelConversion, [this]); <del> }, <add> } <ide> <ide> // <ide> <del> beforeCalculateTickRotation: function() { <add> beforeCalculateTickRotation() { <ide> helpers.callback(this.options.beforeCalculateTickRotation, [this]); <del> }, <del> calculateTickRotation: function() { <add> } <add> calculateTickRotation() { <ide> var me = this; <ide> var options = me.options; <ide> var tickOpts = options.ticks; <ide> var Scale = Element.extend({ <ide> } <ide> <ide> me.labelRotation = labelRotation; <del> }, <del> afterCalculateTickRotation: function() { <add> } <add> afterCalculateTickRotation() { <ide> helpers.callback(this.options.afterCalculateTickRotation, [this]); <del> }, <add> } <ide> <ide> // <ide> <del> beforeFit: function() { <add> beforeFit() { <ide> helpers.callback(this.options.beforeFit, [this]); <del> }, <del> fit: function() { <add> } <add> fit() { <ide> var me = this; <ide> // Reset <ide> var minSize = me.minSize = { <ide> var Scale = Element.extend({ <ide> me.width = minSize.width; <ide> me.height = me._length = chart.height - me.margins.top - me.margins.bottom; <ide> } <del> }, <add> } <ide> <ide> /** <ide> * Handle margins and padding interactions <ide> * @private <ide> */ <del> handleMargins: function() { <add> handleMargins() { <ide> var me = this; <ide> if (me.margins) { <ide> me.margins.left = Math.max(me.paddingLeft, me.margins.left); <ide> me.margins.top = Math.max(me.paddingTop, me.margins.top); <ide> me.margins.right = Math.max(me.paddingRight, me.margins.right); <ide> me.margins.bottom = Math.max(me.paddingBottom, me.margins.bottom); <ide> } <del> }, <add> } <ide> <del> afterFit: function() { <add> afterFit() { <ide> helpers.callback(this.options.afterFit, [this]); <del> }, <add> } <ide> <ide> // Shared Methods <del> isHorizontal: function() { <add> isHorizontal() { <ide> var pos = this.options.position; <ide> return pos === 'top' || pos === 'bottom'; <del> }, <del> isFullWidth: function() { <add> } <add> isFullWidth() { <ide> return this.options.fullWidth; <del> }, <add> } <ide> <del> _convertTicksToLabels: function(ticks) { <add> _convertTicksToLabels(ticks) { <ide> var me = this; <ide> <ide> me.beforeTickToLabelConversion(); <ide> <ide> me.generateTickLabels(ticks); <ide> <ide> me.afterTickToLabelConversion(); <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _getLabelSizes: function() { <add> _getLabelSizes() { <ide> var me = this; <ide> var labelSizes = me._labelSizes; <ide> <ide> var Scale = Element.extend({ <ide> } <ide> <ide> return labelSizes; <del> }, <add> } <ide> <ide> /** <ide> * Used to get the label to display in the tooltip for the given value <ide> * @param value <ide> */ <del> getLabelForValue: function(value) { <add> getLabelForValue(value) { <ide> return value; <del> }, <add> } <ide> <ide> /** <ide> * Returns the location of the given data point. Value can either be an index or a numerical value <ide> var Scale = Element.extend({ <ide> * @param index <ide> * @param datasetIndex <ide> */ <del> getPixelForValue: helpers.noop, <add> getPixelForValue() {} <ide> <ide> /** <ide> * Used to get the data value from a given pixel. This is the inverse of getPixelForValue <ide> * The coordinate (0, 0) is at the upper-left corner of the canvas <ide> * @param pixel <ide> */ <del> getValueForPixel: helpers.noop, <add> getValueForPixel() {} <ide> <ide> /** <ide> * Returns the location of the tick at the given index <ide> * The coordinate (0, 0) is at the upper-left corner of the canvas <ide> */ <del> getPixelForTick: function(index) { <add> getPixelForTick(index) { <ide> var me = this; <ide> var offset = me.options.offset; <ide> var numTicks = me.ticks.length; <ide> var Scale = Element.extend({ <ide> return index < 0 || index > numTicks - 1 <ide> ? null <ide> : me.getPixelForDecimal(index * tickWidth + (offset ? tickWidth / 2 : 0)); <del> }, <add> } <ide> <ide> /** <ide> * Utility for getting the pixel location of a percentage of scale <ide> * The coordinate (0, 0) is at the upper-left corner of the canvas <ide> */ <del> getPixelForDecimal: function(decimal) { <add> getPixelForDecimal(decimal) { <ide> var me = this; <ide> <ide> if (me._reversePixels) { <ide> decimal = 1 - decimal; <ide> } <ide> <ide> return me._startPixel + decimal * me._length; <del> }, <add> } <ide> <del> getDecimalForPixel: function(pixel) { <add> getDecimalForPixel(pixel) { <ide> var decimal = (pixel - this._startPixel) / this._length; <ide> return this._reversePixels ? 1 - decimal : decimal; <del> }, <add> } <ide> <ide> /** <ide> * Returns the pixel for the minimum chart value <ide> * The coordinate (0, 0) is at the upper-left corner of the canvas <ide> */ <del> getBasePixel: function() { <add> getBasePixel() { <ide> return this.getPixelForValue(this.getBaseValue()); <del> }, <add> } <ide> <del> getBaseValue: function() { <add> getBaseValue() { <ide> var me = this; <ide> var min = me.min; <ide> var max = me.max; <ide> var Scale = Element.extend({ <ide> min < 0 && max < 0 ? max : <ide> min > 0 && max > 0 ? min : <ide> 0; <del> }, <add> } <ide> <ide> /** <ide> * Returns a subset of ticks to be plotted to avoid overlapping labels. <ide> * @private <ide> */ <del> _autoSkip: function(ticks) { <add> _autoSkip(ticks) { <ide> var me = this; <ide> var tickOpts = me.options.ticks; <ide> var axisLength = me._length; <ide> var Scale = Element.extend({ <ide> } <ide> skip(ticks, spacing); <ide> return nonSkipped(ticks); <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _tickSize: function() { <add> _tickSize() { <ide> var me = this; <ide> var optionTicks = me.options.ticks; <ide> <ide> var Scale = Element.extend({ <ide> return me.isHorizontal() <ide> ? h * cos > w * sin ? w / cos : h / sin <ide> : h * sin < w * cos ? h / cos : w / sin; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _isVisible: function() { <add> _isVisible() { <ide> var display = this.options.display; <ide> <ide> if (display !== 'auto') { <ide> return !!display; <ide> } <ide> <ide> return this._getMatchingVisibleMetas().length > 0; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _computeGridLineItems: function(chartArea) { <add> _computeGridLineItems(chartArea) { <ide> var me = this; <ide> var chart = me.chart; <ide> var options = me.options; <ide> var Scale = Element.extend({ <ide> items.borderValue = borderValue; <ide> <ide> return items; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _computeLabelItems: function() { <add> _computeLabelItems() { <ide> var me = this; <ide> var options = me.options; <ide> var optionTicks = options.ticks; <ide> var Scale = Element.extend({ <ide> } <ide> <ide> return items; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _drawGrid: function(chartArea) { <add> _drawGrid(chartArea) { <ide> var me = this; <ide> var gridLines = me.options.gridLines; <ide> <ide> var Scale = Element.extend({ <ide> ctx.lineTo(x2, y2); <ide> ctx.stroke(); <ide> } <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _drawLabels: function() { <add> _drawLabels() { <ide> var me = this; <ide> var optionTicks = me.options.ticks; <ide> <ide> var Scale = Element.extend({ <ide> } <ide> ctx.restore(); <ide> } <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _drawTitle: function() { <add> _drawTitle() { <ide> var me = this; <ide> var ctx = me.ctx; <ide> var options = me.options; <ide> var Scale = Element.extend({ <ide> ctx.font = scaleLabelFont.string; <ide> ctx.fillText(scaleLabel.labelString, 0, 0); <ide> ctx.restore(); <del> }, <add> } <ide> <del> draw: function(chartArea) { <add> draw(chartArea) { <ide> var me = this; <ide> <ide> if (!me._isVisible()) { <ide> var Scale = Element.extend({ <ide> me._drawGrid(chartArea); <ide> me._drawTitle(); <ide> me._drawLabels(); <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _layers: function() { <add> _layers() { <ide> var me = this; <ide> var opts = me.options; <ide> var tz = opts.ticks && opts.ticks.z || 0; <ide> var Scale = Element.extend({ <ide> me._drawLabels.apply(me, arguments); <ide> } <ide> }]; <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _getAxisID: function() { <add> _getAxisID() { <ide> return this.isHorizontal() ? 'xAxisID' : 'yAxisID'; <del> }, <add> } <ide> <ide> /** <ide> * Returns visible dataset metas that are attached to this scale <ide> * @param {string} [type] - if specified, also filter by dataset type <ide> * @private <ide> */ <del> _getMatchingVisibleMetas: function(type) { <add> _getMatchingVisibleMetas(type) { <ide> var me = this; <ide> var metas = me.chart._getSortedVisibleDatasetMetas(); <ide> var axisID = me._getAxisID(); <ide> var Scale = Element.extend({ <ide> } <ide> return result; <ide> } <del>}); <add>} <ide> <ide> Scale.prototype._draw = Scale.prototype.draw; <ide> <ide><path>src/core/core.tooltip.js <ide> 'use strict'; <ide> <del>var defaults = require('./core.defaults'); <del>var Element = require('./core.element'); <del>var helpers = require('../helpers/index'); <add>const defaults = require('./core.defaults'); <add>const Element = require('./core.element'); <add>const helpers = require('../helpers/index'); <ide> <del>var valueOrDefault = helpers.valueOrDefault; <del>var getRtlHelper = helpers.rtl.getRtlAdapter; <add>const valueOrDefault = helpers.valueOrDefault; <add>const getRtlHelper = helpers.rtl.getRtlAdapter; <ide> <ide> defaults._set('global', { <ide> tooltips: { <ide> function getBeforeAfterBodyLines(callback) { <ide> return pushOrConcat([], splitNewlines(callback)); <ide> } <ide> <del>var exports = Element.extend({ <del> initialize: function() { <add>class Tooltip extends Element { <add> initialize() { <ide> var me = this; <ide> me._model = getBaseModel(me._options); <ide> me._view = {}; <ide> me._lastActive = []; <del> }, <add> } <ide> <del> transition: function(easingValue) { <add> transition(easingValue) { <ide> var me = this; <ide> var options = me._options; <ide> <ide> var exports = Element.extend({ <ide> } <ide> <ide> Element.prototype.transition.call(me, easingValue); <del> }, <add> } <ide> <ide> // Get the title <ide> // Args are: (tooltipItem, data) <del> getTitle: function() { <add> getTitle() { <ide> var me = this; <ide> var opts = me._options; <ide> var callbacks = opts.callbacks; <ide> var exports = Element.extend({ <ide> lines = pushOrConcat(lines, splitNewlines(afterTitle)); <ide> <ide> return lines; <del> }, <add> } <ide> <ide> // Args are: (tooltipItem, data) <del> getBeforeBody: function() { <add> getBeforeBody() { <ide> return getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this, arguments)); <del> }, <add> } <ide> <ide> // Args are: (tooltipItem, data) <del> getBody: function(tooltipItems, data) { <add> getBody(tooltipItems, data) { <ide> var me = this; <ide> var callbacks = me._options.callbacks; <ide> var bodyItems = []; <ide> var exports = Element.extend({ <ide> }); <ide> <ide> return bodyItems; <del> }, <add> } <ide> <ide> // Args are: (tooltipItem, data) <del> getAfterBody: function() { <add> getAfterBody() { <ide> return getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this, arguments)); <del> }, <add> } <ide> <ide> // Get the footer and beforeFooter and afterFooter lines <ide> // Args are: (tooltipItem, data) <del> getFooter: function() { <add> getFooter() { <ide> var me = this; <ide> var callbacks = me._options.callbacks; <ide> <ide> var exports = Element.extend({ <ide> lines = pushOrConcat(lines, splitNewlines(afterFooter)); <ide> <ide> return lines; <del> }, <add> } <ide> <del> update: function(changed) { <add> update(changed) { <ide> var me = this; <ide> var opts = me._options; <ide> <ide> var exports = Element.extend({ <ide> } <ide> <ide> return me; <del> }, <add> } <ide> <del> drawCaret: function(tooltipPoint, size) { <add> drawCaret(tooltipPoint, size) { <ide> var ctx = this._chart.ctx; <ide> var vm = this._view; <ide> var caretPosition = this.getCaretPosition(tooltipPoint, size, vm); <ide> <ide> ctx.lineTo(caretPosition.x1, caretPosition.y1); <ide> ctx.lineTo(caretPosition.x2, caretPosition.y2); <ide> ctx.lineTo(caretPosition.x3, caretPosition.y3); <del> }, <del> getCaretPosition: function(tooltipPoint, size, vm) { <add> } <add> <add> getCaretPosition(tooltipPoint, size, vm) { <ide> var x1, x2, x3, y1, y2, y3; <ide> var caretSize = vm.caretSize; <ide> var cornerRadius = vm.cornerRadius; <ide> var exports = Element.extend({ <ide> } <ide> } <ide> return {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3}; <del> }, <add> } <ide> <del> drawTitle: function(pt, vm, ctx) { <add> drawTitle(pt, vm, ctx) { <ide> var title = vm.title; <ide> var length = title.length; <ide> var titleFontSize, titleSpacing, i; <ide> var exports = Element.extend({ <ide> } <ide> } <ide> } <del> }, <add> } <ide> <del> drawBody: function(pt, vm, ctx) { <add> drawBody(pt, vm, ctx) { <ide> var bodyFontSize = vm.bodyFontSize; <ide> var bodySpacing = vm.bodySpacing; <ide> var bodyAlign = vm._bodyAlign; <ide> var exports = Element.extend({ <ide> // After body lines <ide> helpers.each(vm.afterBody, fillLineOfText); <ide> pt.y -= bodySpacing; // Remove last body spacing <del> }, <add> } <ide> <del> drawFooter: function(pt, vm, ctx) { <add> drawFooter(pt, vm, ctx) { <ide> var footer = vm.footer; <ide> var length = footer.length; <ide> var footerFontSize, i; <ide> var exports = Element.extend({ <ide> pt.y += footerFontSize + vm.footerSpacing; <ide> } <ide> } <del> }, <add> } <ide> <del> drawBackground: function(pt, vm, ctx, tooltipSize) { <add> drawBackground(pt, vm, ctx, tooltipSize) { <ide> ctx.fillStyle = vm.backgroundColor; <ide> ctx.strokeStyle = vm.borderColor; <ide> ctx.lineWidth = vm.borderWidth; <ide> var exports = Element.extend({ <ide> if (vm.borderWidth > 0) { <ide> ctx.stroke(); <ide> } <del> }, <add> } <ide> <del> draw: function() { <add> draw() { <ide> var ctx = this._chart.ctx; <ide> var vm = this._view; <ide> <ide> var exports = Element.extend({ <ide> <ide> ctx.restore(); <ide> } <del> }, <add> } <ide> <ide> /** <ide> * Handle an event <ide> * @private <ide> * @param {IEvent} event - The event to handle <ide> * @returns {boolean} true if the tooltip changed <ide> */ <del> handleEvent: function(e) { <add> handleEvent(e) { <ide> var me = this; <ide> var options = me._options; <ide> var changed = false; <ide> var exports = Element.extend({ <ide> <ide> return changed; <ide> } <del>}); <add>} <ide> <ide> /** <ide> * @namespace Chart.Tooltip.positioners <ide> */ <del>exports.positioners = positioners; <add>Tooltip.positioners = positioners; <ide> <del>module.exports = exports; <add>module.exports = Tooltip; <ide><path>src/elements/element.arc.js <ide> 'use strict'; <ide> <del>var defaults = require('../core/core.defaults'); <del>var Element = require('../core/core.element'); <del>var helpers = require('../helpers/index'); <del>var TAU = Math.PI * 2; <add>const defaults = require('../core/core.defaults'); <add>const Element = require('../core/core.element'); <add>const helpers = require('../helpers/index'); <add>const TAU = Math.PI * 2; <ide> <ide> defaults._set('global', { <ide> elements: { <ide> function drawBorder(ctx, vm, arc) { <ide> ctx.stroke(); <ide> } <ide> <del>module.exports = Element.extend({ <del> _type: 'arc', <add>class Arc extends Element { <ide> <del> inRange: function(chartX, chartY) { <add> constructor(props) { <add> super(props); <add> } <add> <add> inRange(chartX, chartY) { <ide> var vm = this._view; <ide> <ide> if (vm) { <ide> module.exports = Element.extend({ <ide> return (betweenAngles && withinRadius); <ide> } <ide> return false; <del> }, <add> } <ide> <del> getCenterPoint: function() { <add> getCenterPoint() { <ide> var vm = this._view; <ide> var halfAngle = (vm.startAngle + vm.endAngle) / 2; <ide> var halfRadius = (vm.innerRadius + vm.outerRadius) / 2; <ide> return { <ide> x: vm.x + Math.cos(halfAngle) * halfRadius, <ide> y: vm.y + Math.sin(halfAngle) * halfRadius <ide> }; <del> }, <add> } <ide> <del> tooltipPosition: function() { <add> tooltipPosition() { <ide> var vm = this._view; <ide> var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2); <ide> var rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius; <ide> module.exports = Element.extend({ <ide> x: vm.x + (Math.cos(centreAngle) * rangeFromCentre), <ide> y: vm.y + (Math.sin(centreAngle) * rangeFromCentre) <ide> }; <del> }, <add> } <ide> <del> draw: function() { <add> draw() { <ide> var ctx = this._ctx; <ide> var vm = this._view; <ide> var pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0; <ide> module.exports = Element.extend({ <ide> <ide> ctx.restore(); <ide> } <del>}); <add>} <add> <add>Arc.prototype._type = 'arc'; <add> <add>module.exports = Arc; <ide><path>src/elements/element.line.js <ide> 'use strict'; <ide> <del>var defaults = require('../core/core.defaults'); <del>var Element = require('../core/core.element'); <del>var helpers = require('../helpers/index'); <add>const defaults = require('../core/core.defaults'); <add>const Element = require('../core/core.element'); <add>const helpers = require('../helpers/index'); <ide> <del>var valueOrDefault = helpers.valueOrDefault; <add>const valueOrDefault = helpers.valueOrDefault; <ide> <del>var defaultColor = defaults.global.defaultColor; <add>const defaultColor = defaults.global.defaultColor; <ide> <ide> defaults._set('global', { <ide> elements: { <ide> defaults._set('global', { <ide> } <ide> }); <ide> <del>module.exports = Element.extend({ <del> _type: 'line', <add>class Line extends Element { <ide> <del> draw: function() { <add> constructor(props) { <add> super(props); <add> } <add> <add> draw() { <ide> var me = this; <ide> var vm = me._view; <ide> var ctx = me._ctx; <ide> module.exports = Element.extend({ <ide> ctx.stroke(); <ide> ctx.restore(); <ide> } <del>}); <add>} <add> <add>Line.prototype._type = 'line'; <add> <add>module.exports = Line; <ide><path>src/elements/element.point.js <ide> 'use strict'; <ide> <del>var defaults = require('../core/core.defaults'); <del>var Element = require('../core/core.element'); <del>var helpers = require('../helpers/index'); <add>const defaults = require('../core/core.defaults'); <add>const Element = require('../core/core.element'); <add>const helpers = require('../helpers/index'); <ide> <del>var valueOrDefault = helpers.valueOrDefault; <add>const valueOrDefault = helpers.valueOrDefault; <ide> <del>var defaultColor = defaults.global.defaultColor; <add>const defaultColor = defaults.global.defaultColor; <ide> <ide> defaults._set('global', { <ide> elements: { <ide> defaults._set('global', { <ide> } <ide> }); <ide> <del>function xRange(mouseX) { <del> var vm = this._view; <del> return vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false; <del>} <del> <del>function yRange(mouseY) { <del> var vm = this._view; <del> return vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false; <del>} <add>class Point extends Element { <ide> <del>module.exports = Element.extend({ <del> _type: 'point', <add> constructor(props) { <add> super(props); <add> } <ide> <del> inRange: function(mouseX, mouseY) { <add> inRange(mouseX, mouseY) { <ide> var vm = this._view; <ide> return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false; <del> }, <add> } <add> <add> inXRange(mouseX) { <add> var vm = this._view; <add> return vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false; <add> } <ide> <del> inXRange: xRange, <del> inYRange: yRange, <add> inYRange(mouseY) { <add> var vm = this._view; <add> return vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false; <add> } <ide> <del> getCenterPoint: function() { <add> getCenterPoint() { <ide> var vm = this._view; <ide> return { <ide> x: vm.x, <ide> y: vm.y <ide> }; <del> }, <add> } <ide> <del> tooltipPosition: function() { <add> tooltipPosition() { <ide> var vm = this._view; <ide> return { <ide> x: vm.x, <ide> y: vm.y, <ide> padding: vm.radius + vm.borderWidth <ide> }; <del> }, <add> } <ide> <del> draw: function(chartArea) { <add> draw(chartArea) { <ide> var vm = this._view; <ide> var ctx = this._ctx; <ide> var pointStyle = vm.pointStyle; <ide> module.exports = Element.extend({ <ide> helpers.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation); <ide> } <ide> } <del>}); <add>} <add> <add>Point.prototype._type = 'point'; <add> <add>module.exports = Point; <ide><path>src/elements/element.rectangle.js <ide> 'use strict'; <ide> <del>var defaults = require('../core/core.defaults'); <del>var Element = require('../core/core.element'); <del>var helpers = require('../helpers/index'); <add>const defaults = require('../core/core.defaults'); <add>const Element = require('../core/core.element'); <add>const helpers = require('../helpers/index'); <ide> <del>var defaultColor = defaults.global.defaultColor; <add>const defaultColor = defaults.global.defaultColor; <ide> <ide> defaults._set('global', { <ide> elements: { <ide> function inRange(vm, x, y) { <ide> && (skipY || y >= bounds.top && y <= bounds.bottom); <ide> } <ide> <del>module.exports = Element.extend({ <del> _type: 'rectangle', <add>class Rectangle extends Element { <ide> <del> draw: function() { <add> constructor(props) { <add> super(props); <add> } <add> <add> draw() { <ide> var ctx = this._ctx; <ide> var vm = this._view; <ide> var rects = boundingRects(vm); <ide> module.exports = Element.extend({ <ide> ctx.rect(inner.x, inner.y, inner.w, inner.h); <ide> ctx.fill('evenodd'); <ide> ctx.restore(); <del> }, <add> } <ide> <del> inRange: function(mouseX, mouseY) { <add> inRange(mouseX, mouseY) { <ide> return inRange(this._view, mouseX, mouseY); <del> }, <add> } <ide> <del> inXRange: function(mouseX) { <add> inXRange(mouseX) { <ide> return inRange(this._view, mouseX, null); <del> }, <add> } <ide> <del> inYRange: function(mouseY) { <add> inYRange(mouseY) { <ide> return inRange(this._view, null, mouseY); <del> }, <add> } <ide> <del> getCenterPoint: function() { <add> getCenterPoint() { <ide> var vm = this._view; <ide> var x, y; <ide> if (isVertical(vm)) { <ide> module.exports = Element.extend({ <ide> } <ide> <ide> return {x: x, y: y}; <del> }, <add> } <ide> <del> tooltipPosition: function() { <add> tooltipPosition() { <ide> var vm = this._view; <ide> return { <ide> x: vm.x, <ide> y: vm.y <ide> }; <ide> } <del>}); <add>} <add> <add>Rectangle.prototype._type = 'rectangle'; <add> <add>module.exports = Rectangle; <ide><path>src/plugins/plugin.legend.js <ide> 'use strict'; <ide> <del>var defaults = require('../core/core.defaults'); <del>var Element = require('../core/core.element'); <del>var helpers = require('../helpers/index'); <del>var layouts = require('../core/core.layouts'); <add>const defaults = require('../core/core.defaults'); <add>const Element = require('../core/core.element'); <add>const helpers = require('../helpers/index'); <add>const layouts = require('../core/core.layouts'); <ide> <del>var getRtlHelper = helpers.rtl.getRtlAdapter; <del>var noop = helpers.noop; <del>var valueOrDefault = helpers.valueOrDefault; <add>const getRtlHelper = helpers.rtl.getRtlAdapter; <add>const valueOrDefault = helpers.valueOrDefault; <ide> <ide> defaults._set('global', { <ide> legend: { <ide> function getBoxWidth(labelOpts, fontSize) { <ide> /** <ide> * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required! <ide> */ <del>var Legend = Element.extend({ <add>class Legend extends Element { <ide> <del> initialize: function(config) { <add> initialize(config) { <ide> var me = this; <ide> helpers.extend(me, config); <ide> <ide> var Legend = Element.extend({ <ide> <ide> // Are we in doughnut mode which has a different data type <ide> me.doughnutMode = false; <del> }, <add> } <ide> <ide> // These methods are ordered by lifecycle. Utilities then follow. <ide> // Any function defined here is inherited by all legend types. <ide> // Any function can be extended by the legend type <ide> <del> beforeUpdate: noop, <del> update: function(maxWidth, maxHeight, margins) { <add> beforeUpdate() {} <add> <add> update(maxWidth, maxHeight, margins) { <ide> var me = this; <ide> <ide> // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;) <ide> var Legend = Element.extend({ <ide> me.afterUpdate(); <ide> <ide> return me.minSize; <del> }, <del> afterUpdate: noop, <add> } <add> <add> afterUpdate() {} <ide> <ide> // <ide> <del> beforeSetDimensions: noop, <del> setDimensions: function() { <add> beforeSetDimensions() {} <add> <add> setDimensions() { <ide> var me = this; <ide> // Set the unconstrained dimension before label rotation <ide> if (me.isHorizontal()) { <ide> var Legend = Element.extend({ <ide> width: 0, <ide> height: 0 <ide> }; <del> }, <del> afterSetDimensions: noop, <add> } <add> <add> afterSetDimensions() {} <ide> <ide> // <ide> <del> beforeBuildLabels: noop, <del> buildLabels: function() { <add> beforeBuildLabels() {} <add> <add> buildLabels() { <ide> var me = this; <ide> var labelOpts = me.options.labels || {}; <ide> var legendItems = helpers.callback(labelOpts.generateLabels, [me.chart], me) || []; <ide> var Legend = Element.extend({ <ide> } <ide> <ide> me.legendItems = legendItems; <del> }, <del> afterBuildLabels: noop, <add> } <add> <add> afterBuildLabels() {} <ide> <ide> // <ide> <del> beforeFit: noop, <del> fit: function() { <add> beforeFit() {} <add> <add> fit() { <ide> var me = this; <ide> var opts = me.options; <ide> var labelOpts = opts.labels; <ide> var Legend = Element.extend({ <ide> <ide> me.width = minSize.width; <ide> me.height = minSize.height; <del> }, <del> afterFit: noop, <add> } <add> <add> afterFit() {} <ide> <ide> // Shared Methods <del> isHorizontal: function() { <add> isHorizontal() { <ide> return this.options.position === 'top' || this.options.position === 'bottom'; <del> }, <add> } <ide> <ide> // Actually draw the legend on the canvas <del> draw: function() { <add> draw() { <ide> var me = this; <ide> var opts = me.options; <ide> var labelOpts = opts.labels; <ide> var Legend = Element.extend({ <ide> }); <ide> <ide> helpers.rtl.restoreTextDirection(me.ctx, opts.textDirection); <del> }, <add> } <ide> <ide> /** <ide> * @private <ide> */ <del> _getLegendItemAt: function(x, y) { <add> _getLegendItemAt(x, y) { <ide> var me = this; <ide> var i, hitBox, lh; <ide> <ide> var Legend = Element.extend({ <ide> } <ide> <ide> return null; <del> }, <add> } <ide> <ide> /** <ide> * Handle an event <ide> * @private <ide> * @param {IEvent} event - The event to handle <ide> */ <del> handleEvent: function(e) { <add> handleEvent(e) { <ide> var me = this; <ide> var opts = me.options; <ide> var type = e.type === 'mouseup' ? 'click' : e.type; <ide> var Legend = Element.extend({ <ide> } <ide> } <ide> } <del>}); <add>} <ide> <ide> function createNewLegendAndAttach(chart, legendOpts) { <ide> var legend = new Legend({ <ide><path>src/plugins/plugin.title.js <ide> 'use strict'; <ide> <del>var defaults = require('../core/core.defaults'); <del>var Element = require('../core/core.element'); <del>var helpers = require('../helpers/index'); <del>var layouts = require('../core/core.layouts'); <del> <del>var noop = helpers.noop; <add>const defaults = require('../core/core.defaults'); <add>const Element = require('../core/core.element'); <add>const helpers = require('../helpers/index'); <add>const layouts = require('../core/core.layouts'); <ide> <ide> defaults._set('global', { <ide> title: { <ide> defaults._set('global', { <ide> /** <ide> * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required! <ide> */ <del>var Title = Element.extend({ <del> initialize: function(config) { <add>class Title extends Element { <add> initialize(config) { <ide> var me = this; <ide> helpers.extend(me, config); <ide> <ide> // Contains hit boxes for each dataset (in dataset order) <ide> me.legendHitBoxes = []; <del> }, <add> } <ide> <ide> // These methods are ordered by lifecycle. Utilities then follow. <ide> <del> beforeUpdate: noop, <del> update: function(maxWidth, maxHeight, margins) { <add> beforeUpdate() {} <add> update(maxWidth, maxHeight, margins) { <ide> var me = this; <ide> <ide> // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;) <ide> var Title = Element.extend({ <ide> <ide> return me.minSize; <ide> <del> }, <del> afterUpdate: noop, <add> } <add> afterUpdate() {} <ide> <ide> // <ide> <del> beforeSetDimensions: noop, <del> setDimensions: function() { <add> beforeSetDimensions() {} <add> setDimensions() { <ide> var me = this; <ide> // Set the unconstrained dimension before label rotation <ide> if (me.isHorizontal()) { <ide> var Title = Element.extend({ <ide> width: 0, <ide> height: 0 <ide> }; <del> }, <del> afterSetDimensions: noop, <add> } <add> afterSetDimensions() {} <ide> <ide> // <ide> <del> beforeBuildLabels: noop, <del> buildLabels: noop, <del> afterBuildLabels: noop, <add> beforeBuildLabels() {} <add> buildLabels() {} <add> afterBuildLabels() {} <ide> <ide> // <ide> <del> beforeFit: noop, <del> fit: function() { <add> beforeFit() {} <add> fit() { <ide> var me = this; <ide> var opts = me.options; <ide> var minSize = me.minSize = {}; <ide> var Title = Element.extend({ <ide> <ide> me.width = minSize.width = isHorizontal ? me.maxWidth : textSize; <ide> me.height = minSize.height = isHorizontal ? textSize : me.maxHeight; <del> }, <del> afterFit: noop, <add> } <add> afterFit() {} <ide> <ide> // Shared Methods <del> isHorizontal: function() { <add> isHorizontal() { <ide> var pos = this.options.position; <ide> return pos === 'top' || pos === 'bottom'; <del> }, <add> } <ide> <ide> // Actually draw the title block on the canvas <del> draw: function() { <add> draw() { <ide> var me = this; <ide> var ctx = me.ctx; <ide> var opts = me.options; <ide> var Title = Element.extend({ <ide> <ide> ctx.restore(); <ide> } <del>}); <add>} <ide> <ide> function createNewTitleBlockAndAttach(chart, titleOpts) { <ide> var title = new Title({
10
Javascript
Javascript
fix throws before timer module is loaded
8f41db6104deca82d74f55501a7f2689357fb45d
<ide><path>src/node.js <ide> <ide> // if we handled an error, then make sure any ticks get processed <ide> } else { <del> var t = setImmediate(process._tickCallback); <add> NativeModule.require('timers').setImmediate(process._tickCallback); <ide> } <ide> <ide> return caught;
1
Javascript
Javascript
reduce hasdata per @gibson042 review notes
fd43865c6d11a8901b2780a57418f652143f250a
<ide><path>src/data.js <ide> Data.prototype = { <ide> hasData: function( owner ) { <ide> var index = Data.index( this.owners, owner ); <ide> <del> if ( index > -1 ) { <del> return !jQuery.isEmptyObject( this.cache[ index ] ); <del> } <del> return false; <add> return index !== -1 && jQuery.isEmptyObject( this.cache[ index ] ); <ide> }, <ide> discard: function( owner ) { <ide> var index = Data.index( this.owners, owner );
1
Java
Java
use constant for alignment of right and left
3da695fe88baadfefc4b740efc0e126169dd40ca
<ide><path>ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java <ide> */ <ide> /* package */ final class RCTText extends RCTVirtualText implements CSSNodeAPI.MeasureFunction { <ide> <add> // index of left and right in the Layout.Alignment enum since the base values are @hide <add> private static final int ALIGNMENT_LEFT = 3; <add> private static final int ALIGNMENT_RIGHT = 4; <add> <ide> // We set every value we use every time we use the layout builder, so we can get away with only <ide> // using a single instance. <ide> private static final TextLayoutBuilder sTextLayoutBuilder = <ide> public Layout.Alignment getAlignment() { <ide> switch (mAlignment) { <ide> // Layout.Alignment.RIGHT and Layout.Alignment.LEFT are @hide :( <ide> case Gravity.LEFT: <del> int index = isRtl ? /* RIGHT */ 4 : /* LEFT */ 3; <add> int index = isRtl ? ALIGNMENT_RIGHT : ALIGNMENT_LEFT; <ide> return Layout.Alignment.values()[index]; <ide> case Gravity.RIGHT: <del> index = isRtl ? /* LEFT */ 3 : /* RIGHT */ 4; <add> index = isRtl ? ALIGNMENT_LEFT : ALIGNMENT_RIGHT; <ide> return Layout.Alignment.values()[index]; <ide> case Gravity.CENTER: <ide> return Layout.Alignment.ALIGN_CENTER;
1
Javascript
Javascript
add e2e tests
b9479ee73b6e7a93b2947ab43ad095557db46247
<ide><path>Gruntfile.js <ide> module.exports = function(grunt) { <ide> keepalive: true, <ide> middleware: function(connect, options){ <ide> return [ <del> //uncomment to enable CSP <del> // util.csp(), <add> util.conditionalCsp(), <ide> util.rewrite(), <ide> connect.favicon('images/favicon.ico'), <ide> connect.static(options.base), <ide> module.exports = function(grunt) { <ide> <ide> next(); <ide> }, <add> util.conditionalCsp(), <ide> connect.favicon('images/favicon.ico'), <ide> connect.static(options.base) <ide> ]; <ide><path>lib/grunt/utils.js <ide> module.exports = { <ide> <ide> <ide> //csp connect middleware <del> csp: function(){ <add> conditionalCsp: function(){ <ide> return function(req, res, next){ <del> res.setHeader("X-WebKit-CSP", "default-src 'self';"); <del> res.setHeader("X-Content-Security-Policy", "default-src 'self'"); <del> res.setHeader("Content-Security-Policy", "default-src 'self'"); <add> var CSP = /\.csp\W/; <add> <add> if (CSP.test(req.url)) { <add> res.setHeader("X-WebKit-CSP", "default-src 'self';"); <add> res.setHeader("X-Content-Security-Policy", "default-src 'self'"); <add> res.setHeader("Content-Security-Policy", "default-src 'self'"); <add> } <ide> next(); <ide> }; <ide> }, <ide><path>src/ng/directive/ngCsp.js <ide> ... <ide> </html> <ide> ``` <del> */ <add> * @example <add> // Note: the suffix `.csp` in the example name triggers <add> // csp mode in our http server! <add> <example name="example.csp" module="cspExample" ng-csp="true"> <add> <file name="index.html"> <add> <div ng-controller="MainController as ctrl"> <add> <div> <add> <button ng-click="ctrl.inc()" id="inc">Increment</button> <add> <span id="counter"> <add> {{ctrl.counter}} <add> </span> <add> </div> <add> <add> <div> <add> <button ng-click="ctrl.evil()" id="evil">Evil</button> <add> <span id="evilError"> <add> {{ctrl.evilError}} <add> </span> <add> </div> <add> </div> <add> </file> <add> <file name="script.js"> <add> angular.module('cspExample', []) <add> .controller('MainController', function() { <add> this.counter = 0; <add> this.inc = function() { <add> this.counter++; <add> }; <add> this.evil = function() { <add> // jshint evil:true <add> try { <add> eval('1+2'); <add> } catch (e) { <add> this.evilError = e.message; <add> } <add> }; <add> }); <add> </file> <add> <file name="protractor.js" type="protractor"> <add> var util, webdriver; <add> <add> var incBtn = element(by.id('inc')); <add> var counter = element(by.id('counter')); <add> var evilBtn = element(by.id('evil')); <add> var evilError = element(by.id('evilError')); <add> <add> function getAndClearSevereErrors() { <add> return browser.manage().logs().get('browser').then(function(browserLog) { <add> return browserLog.filter(function(logEntry) { <add> return logEntry.level.value > webdriver.logging.Level.WARNING.value; <add> }); <add> }); <add> } <add> <add> function clearErrors() { <add> getAndClearSevereErrors(); <add> } <add> <add> function expectNoErrors() { <add> getAndClearSevereErrors().then(function(filteredLog) { <add> expect(filteredLog.length).toEqual(0); <add> if (filteredLog.length) { <add> console.log('browser console errors: ' + util.inspect(filteredLog)); <add> } <add> }); <add> } <add> <add> function expectError(regex) { <add> getAndClearSevereErrors().then(function(filteredLog) { <add> var found = false; <add> filteredLog.forEach(function(log) { <add> if (log.message.match(regex)) { <add> found = true; <add> } <add> }); <add> if (!found) { <add> throw new Error('expected an error that matches ' + regex); <add> } <add> }); <add> } <add> <add> beforeEach(function() { <add> util = require('util'); <add> webdriver = require('protractor/node_modules/selenium-webdriver'); <add> }); <add> <add> // For now, we only test on Chrome, <add> // as Safari does not load the page with Protractor's injected scripts, <add> // and Firefox webdriver always disables content security policy (#6358) <add> if (browser.params.browser !== 'chrome') { <add> return; <add> } <add> <add> it('should not report errors when the page is loaded', function() { <add> // clear errors so we are not dependent on previous tests <add> clearErrors(); <add> // Need to reload the page as the page is already loaded when <add> // we come here <add> browser.driver.getCurrentUrl().then(function(url) { <add> browser.get(url); <add> }); <add> expectNoErrors(); <add> }); <add> <add> it('should evaluate expressions', function() { <add> expect(counter.getText()).toEqual('0'); <add> incBtn.click(); <add> expect(counter.getText()).toEqual('1'); <add> expectNoErrors(); <add> }); <add> <add> it('should throw and report an error when using "eval"', function() { <add> evilBtn.click(); <add> expect(evilError.getText()).toMatch(/Content Security Policy/); <add> expectError(/Content Security Policy/); <add> }); <add> </file> <add> </example> <add> */ <ide> <ide> // ngCsp is not implemented as a proper directive any more, because we need it be processed while we <ide> // bootstrap the system (before $parse is instantiated), for this reason we just have
3
Javascript
Javascript
trim whitespace around an empty currency symbol
62743a54b79187e6c1325c0f6dec0f474147881d
<ide><path>src/ng/filter/filters.js <ide> function currencyFilter($locale) { <ide> fractionSize = formats.PATTERNS[1].maxFrac; <ide> } <ide> <add> // If the currency symbol is empty, trim whitespace around the symbol <add> var currencySymbolRe = !currencySymbol ? /\s*\u00A4\s*/g : /\u00A4/g; <add> <ide> // if null or undefined pass it through <ide> return (amount == null) <ide> ? amount <ide> : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize). <del> replace(/\u00A4/g, currencySymbol); <add> replace(currencySymbolRe, currencySymbol); <ide> }; <ide> } <ide> <ide><path>test/ng/filter/filtersSpec.js <ide> describe('filters', function() { <ide> <ide> expect(currency(1.07)).toBe('$1.1'); <ide> })); <add> <add> it('should trim whitespace around the currency symbol if it is empty', <add> inject(function($locale) { <add> var pattern = $locale.NUMBER_FORMATS.PATTERNS[1]; <add> pattern.posPre = pattern.posSuf = ' \u00A4 '; <add> pattern.negPre = pattern.negSuf = ' - \u00A4 - '; <add> <add> expect(currency(+1.07, '$')).toBe(' $ 1.07 $ '); <add> expect(currency(-1.07, '$')).toBe(' - $ - 1.07 - $ - '); <add> expect(currency(+1.07, '')).toBe('1.07'); <add> expect(currency(-1.07, '')).toBe(' -- 1.07 -- '); <add> }) <add> ); <ide> }); <ide> <ide> describe('number', function() {
2
Javascript
Javascript
fix the last fix
02a35148d44010b683a26a99561160269b71063a
<ide><path>src/renderers/WebGLRenderer.js <ide> THREE.WebGLRenderer = function ( parameters ) { <ide> gonnaUse.length = material.numSupportedMorphTargets <ide> } else if (gonnaUse.length > material.numSupportedMorphNormals){ <ide> gonnaUse.sort(sortNumerical); <del> } else if (gonnaUse.length = 0){ <add> } else if (gonnaUse.length === 0){ <ide> gonnaUse.push(0); <ide> }; <ide>
1
Go
Go
add implementation and test for setipforwarding()
80809c42c63cd78fd3e59d4e25cbc99b61fa2855
<ide><path>libnetwork/drivers/bridge/setup.go <ide> func (b *BridgeSetup) QueueStep(step SetupStep) { <ide> func SetupIPTables(i *Interface) error { <ide> return nil <ide> } <del> <del>func SetupIPForwarding(i *Interface) error { <del> return nil <del>} <ide><path>libnetwork/drivers/bridge/setup_ip_forwarding.go <add>package bridge <add> <add>import ( <add> "fmt" <add> "io/ioutil" <add>) <add> <add>const ( <add> IPV4_FORW_CONF_FILE = "/proc/sys/net/ipv4/ip_forward" <add> PERM = 0644 <add>) <add> <add>func SetupIPForwarding(i *Interface) error { <add> // Sanity Check <add> if i.Config.EnableIPForwarding == false { <add> return fmt.Errorf("Unexpected request to enable IP Forwarding for: %v", *i) <add> } <add> // Enable IPv4 forwarding <add> return ioutil.WriteFile(IPV4_FORW_CONF_FILE, []byte{'1', '\n'}, PERM) <add>} <ide><path>libnetwork/drivers/bridge/setup_ip_forwarding_test.go <add>package bridge <add> <add>import ( <add> "bytes" <add> "io/ioutil" <add> "testing" <add>) <add> <add>func TestSetupIPForwarding(t *testing.T) { <add> // Read current setting and ensure the original value gets restored <add> procSetting := readCurrentIPForwardingSetting(t) <add> defer reconcileIPForwardingSetting(t, procSetting) <add> <add> // Disable IP Forwarding if enabled <add> if bytes.Compare(procSetting, []byte("1\n")) == 0 { <add> writeIPForwardingSetting(t, []byte{'0', '\n'}) <add> } <add> <add> // Create test interface with ip forwarding setting enabled <add> br := &Interface{ <add> Config: &Configuration{ <add> BridgeName: DefaultBridgeName, <add> EnableIPForwarding: true, <add> }, <add> } <add> <add> // Set IP Forwarding <add> if err := SetupIPForwarding(br); err != nil { <add> t.Fatalf("Failed to setup IP forwarding: %v", err) <add> } <add> <add> // Read new setting <add> procSetting = readCurrentIPForwardingSetting(t) <add> if bytes.Compare(procSetting, []byte("1\n")) != 0 { <add> t.Fatalf("Failed to effectively setup IP forwarding") <add> } <add>} <add> <add>func TestUnexpectedSetupIPForwarding(t *testing.T) { <add> // Read current setting and ensure the original value gets restored <add> procSetting := readCurrentIPForwardingSetting(t) <add> defer reconcileIPForwardingSetting(t, procSetting) <add> <add> // Create test interface without ip forwarding setting enabled <add> br := &Interface{ <add> Config: &Configuration{ <add> BridgeName: DefaultBridgeName, <add> EnableIPForwarding: false, <add> }, <add> } <add> <add> // Attempt Set IP Forwarding <add> if err := SetupIPForwarding(br); err == nil { <add> t.Fatalf(err.Error()) <add> } <add>} <add> <add>func readCurrentIPForwardingSetting(t *testing.T) []byte { <add> procSetting, err := ioutil.ReadFile(IPV4_FORW_CONF_FILE) <add> if err != nil { <add> t.Fatalf("Can't execute test: Failed to read current IP forwarding setting: %v", err) <add> } <add> return procSetting <add>} <add> <add>func writeIPForwardingSetting(t *testing.T, chars []byte) { <add> err := ioutil.WriteFile(IPV4_FORW_CONF_FILE, chars, PERM) <add> if err != nil { <add> t.Fatalf("Can't execute or cleanup after test: Failed to reset IP forwarding: %v", err) <add> } <add>} <add> <add>func reconcileIPForwardingSetting(t *testing.T, original []byte) { <add> current := readCurrentIPForwardingSetting(t) <add> if bytes.Compare(original, current) != 0 { <add> writeIPForwardingSetting(t, original) <add> } <add>}
3
Text
Text
remove broken bit of merge commit
996e58739831659fc78e1d66bdc87deafa727958
<ide><path>docs/topics/release-notes.md <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> [old-release-notes]: https://github.com/encode/django-rest-framework/blob/version-2.4.x/docs/topics/release-notes.md <ide> [3.6-release]: 3.6-announcement.md <ide> <del>[3.0.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.1+Release%22 <del>[3.0.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.2+Release%22 <del>[3.0.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.3+Release%22 <del>[3.0.4-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.4+Release%22 <del>[3.0.5-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.0.5+Release%22 <del>[3.1.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.0+Release%22 <del>[3.1.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.1+Release%22 <del>[3.1.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.2+Release%22 <del>[3.1.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.1.3+Release%22 <del>[3.2.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.0+Release%22 <del>[3.2.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.1+Release%22 <del>[3.2.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.2+Release%22 <del>[3.2.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.3+Release%22 <del>[3.2.4-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.4+Release%22 <del>[3.2.5-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.2.5+Release%22 <del>[3.3.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.3.0+Release%22 <del>[3.3.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.3.1+Release%22 <del>[3.3.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.3.2+Release%22 <del>[3.3.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.3.3+Release%22 <del>[3.4.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.0+Release%22 <del>[3.4.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.1+Release%22 <del>[3.4.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.2+Release%22 <del>[3.4.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.3+Release%22 <del>[3.4.4-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.4+Release%22 <del>[3.4.5-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.5+Release%22 <del>[3.4.6-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.6+Release%22 <del>[3.4.7-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.7+Release%22 <del>[3.5.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.5.0+Release%22 <del>[3.5.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.5.1+Release%22 <del>[3.5.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.5.2+Release%22 <del>[3.5.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.5.3+Release%22 <del>[3.5.4-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.5.4+Release%22 <del>[3.6.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.6.0+Release%22 <del>[3.6.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.6.1+Release%22 <del>[3.6.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.6.2+Release%22 <del>[3.6.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.6.3+Release%22 <del>======= <ide> [3.0.1-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.0.1+Release%22 <ide> [3.0.2-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.0.2+Release%22 <ide> [3.0.3-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.0.3+Release%22 <ide> For older release notes, [please see the version 2.x documentation][old-release- <ide> [3.6.0-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.0+Release%22 <ide> [3.6.1-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.1+Release%22 <ide> [3.6.2-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.2+Release%22 <del>>>>>>>> master <add>[3.6.3-milestone]: https://github.com/encode/django-rest-framework/issues?q=milestone%3A%223.6.3+Release%22 <ide> <ide> <!-- 3.0.1 --> <ide> [gh2013]: https://github.com/encode/django-rest-framework/issues/2013
1
Go
Go
remove runtime options from config
e2779e11db113c5551094dba8079d44d8a210e41
<ide><path>runconfig/config.go <ide> package runconfig <ide> <ide> import ( <del> "encoding/json" <ide> "github.com/dotcloud/docker/engine" <ide> "github.com/dotcloud/docker/nat" <del> "github.com/dotcloud/docker/runtime/execdriver" <ide> ) <ide> <ide> // Note: the Config structure should hold only portable information about the container. <ide> type Config struct { <ide> Entrypoint []string <ide> NetworkDisabled bool <ide> OnBuild []string <del> Context execdriver.Context <ide> } <ide> <ide> func ContainerConfigFromJob(job *engine.Job) *Config { <del> var context execdriver.Context <del> val := job.Getenv("Context") <del> if val != "" { <del> if err := json.Unmarshal([]byte(val), &context); err != nil { <del> panic(err) <del> } <del> } <ide> config := &Config{ <ide> Hostname: job.Getenv("Hostname"), <ide> Domainname: job.Getenv("Domainname"), <ide> func ContainerConfigFromJob(job *engine.Job) *Config { <ide> VolumesFrom: job.Getenv("VolumesFrom"), <ide> WorkingDir: job.Getenv("WorkingDir"), <ide> NetworkDisabled: job.GetenvBool("NetworkDisabled"), <del> Context: context, <ide> } <ide> job.GetenvJson("ExposedPorts", &config.ExposedPorts) <ide> job.GetenvJson("Volumes", &config.Volumes) <ide> func ContainerConfigFromJob(job *engine.Job) *Config { <ide> if Entrypoint := job.GetenvList("Entrypoint"); Entrypoint != nil { <ide> config.Entrypoint = Entrypoint <ide> } <del> <ide> return config <ide> } <ide><path>runtime/runtime.go <ide> func (runtime *Runtime) Create(config *runconfig.Config, name string) (*Containe <ide> } <ide> <ide> initID := fmt.Sprintf("%s-init", container.ID) <del> if err := runtime.driver.Create(initID, img.ID, config.Context["mount_label"]); err != nil { <add> if err := runtime.driver.Create(initID, img.ID, ""); err != nil { <ide> return nil, nil, err <ide> } <ide> initPath, err := runtime.driver.Get(initID) <ide> func (runtime *Runtime) Create(config *runconfig.Config, name string) (*Containe <ide> return nil, nil, err <ide> } <ide> <del> if err := runtime.driver.Create(container.ID, initID, config.Context["mount_label"]); err != nil { <add> if err := runtime.driver.Create(container.ID, initID, ""); err != nil { <ide> return nil, nil, err <ide> } <ide> resolvConf, err := utils.GetResolvConf()
2
PHP
PHP
add test for expanded attributes
afb74be0b8cf18858bacb107057adac57ca1efa1
<ide><path>tests/TestCase/View/Helper/FormHelperTest.php <ide> public function testRadio() <ide> '/label', <ide> ]; <ide> $this->assertHtml($expected, $result); <add> <add> $result = $this->Form->radio( <add> 'Employee.gender', <add> [ <add> ['value' => 'male', 'text' => 'Male', 'style' => 'width:20px'], <add> ['value' => 'female', 'text' => 'Female', 'style' => 'width:20px'], <add> ] <add> ); <add> $expected = [ <add> 'input' => ['type' => 'hidden', 'name' => 'Employee[gender]', 'value' => ''], <add> ['label' => ['for' => 'employee-gender-male']], <add> ['input' => ['type' => 'radio', 'name' => 'Employee[gender]', 'value' => 'male', <add> 'id' => 'employee-gender-male', 'style' => 'width:20px']], <add> 'Male', <add> '/label', <add> ['label' => ['for' => 'employee-gender-female']], <add> ['input' => ['type' => 'radio', 'name' => 'Employee[gender]', 'value' => 'female', <add> 'id' => 'employee-gender-female', 'style' => 'width:20px']], <add> 'Female', <add> '/label', <add> ]; <add> $this->assertHtml($expected, $result); <ide> } <ide> <ide> /**
1
Javascript
Javascript
add tests for hotkeys when instruction is clicked
bc4edf518e1c2b2095352e8f6196a23b35ce6ea0
<ide><path>cypress/e2e/default/learn/challenges/multifile.js <ide> const selectors = { <ide> testButton: '[data-cy=run-tests-button]', <ide> monacoTabs: '.monaco-editor-tabs', <ide> signInButton: '#action-buttons-container a[href$="/signin"]', <del> submitButton: '[data-cy=submit-button]' <add> submitButton: '[data-cy=submit-button]', <add> instructionContainer: '.action-row-container' <ide> }; <ide> <ide> describe('Challenge with multifile editor', () => { <ide> describe('Challenge with multifile editor', () => { <ide> cy.get(selectors.testButton).click(); <ide> cy.get(selectors.submitButton).should('be.focused'); <ide> }); <add> <add> it('checks hotkeys when instruction is focused', () => { <add> cy.reload(); <add> cy.focused().type('{end}{enter}<meta charset="UTF-8" />'); <add> cy.get(selectors.instructionContainer) <add> .click('topRight') <add> .trigger('keydown', { ctrlKey: true, keyCode: 13 }); // keyCode : 13 enter key <add> cy.get(selectors.submitButton).should('be.focused'); <add> }); <ide> });
1
PHP
PHP
start multi-checkbox rendering
72b9481a88e1a07b93f9ad166de45d132485a143
<ide><path>src/View/Input/MultiCheckbox.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @since CakePHP(tm) v3.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\View\Input; <add> <add>use Cake\Utility\Inflector; <add> <add>class MultiCheckbox { <add> <add> protected $_templates; <add> <add>/** <add> * Render multi-checkbox widget. <add> * <add> * @param Cake\View\StringTemplate $templates <add> */ <add> public function __construct($templates) { <add> $this->_templates = $templates; <add> } <add> <add>/** <add> * Render multi-checkbox widget. <add> * <add> * @param array $data <add> * @return string <add> */ <add> public function render($data) { <add> $data += [ <add> 'name' => '', <add> 'escape' => true, <add> 'options' => [], <add> 'disabled' => null, <add> 'val' => null, <add> ]; <add> $out= []; <add> foreach ($data['options'] as $key => $val) { <add> $checkbox = [ <add> 'value' => $key, <add> 'text' => $val, <add> ]; <add> if (is_array($val) && isset($val['text'], $val['value'])) { <add> $checkbox = $val; <add> } <add> $checkbox['name'] = $data['name']; <add> $checkbox['escape'] = $data['escape']; <add> <add> if ($this->_isSelected($key, $data['val'])) { <add> $checkbox['selected'] = true; <add> } <add> if ($this->_isDisabled($key, $data['disabled'])) { <add> $checkbox['disabled'] = true; <add> } <add> if (empty($checkbox['id'])) { <add> $checkbox['id'] = mb_strtolower(Inflector::slug($checkbox['name'] . $checkbox['value'], '-')); <add> } <add> <add> $out[] = $this->_renderInput($checkbox); <add> } <add> return implode('', $out); <add> } <add> <add>/** <add> * Render a single checkbox & wrapper. <add> * <add> * @return string <add> */ <add> protected function _renderInput($checkbox) { <add> $input = $this->_templates->format('checkbox', [ <add> 'name' => $checkbox['name'] . '[]', <add> 'value' => $checkbox['value'], <add> 'attrs' => $this->_templates->formatAttributes( <add> $checkbox, <add> ['name', 'value', 'text'] <add> ) <add> ]); <add> <add> $labelAttrs = [ <add> 'for' => $checkbox['id'], <add> 'escape' => $checkbox['escape'] <add> ]; <add> $label = $this->_templates->format('label', [ <add> 'text' => $checkbox['escape'] ? h($checkbox['text']) : $checkbox['text'], <add> 'input' => $input, <add> 'attrs' => $this->_templates->formatAttributes($labelAttrs) <add> ]); <add> <add> return $this->_templates->format('checkboxContainer', [ <add> 'label' => $label, <add> 'input' => $input <add> ]); <add> } <add> <add>/** <add> * Helper method for deciding what options are selected. <add> * <add> * @param string $key The key to test. <add> * @param array|string|null The selected values. <add> * @return boolean <add> */ <add> protected function _isSelected($key, $selected) { <add> if ($selected === null) { <add> return false; <add> } <add> $isArray = is_array($selected); <add> if (!$isArray) { <add> return (string)$key === (string)$selected; <add> } <add> $strict = !is_numeric($key); <add> return in_array((string)$key, $selected, $strict); <add> } <add> <add>/** <add> * Helper method for deciding what options are disabled. <add> * <add> * @param string $key The key to test. <add> * @param array|null The disabled values. <add> * @return boolean <add> */ <add> protected function _isDisabled($key, $disabled) { <add> if ($disabled === null) { <add> return false; <add> } <add> $strict = !is_numeric($key); <add> return in_array((string)$key, $disabled, $strict); <add> } <add> <add>} <ide><path>tests/TestCase/View/Input/MultiCheckboxTest.php <add><?php <add>/** <add> * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) <add> * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * <add> * Licensed under The MIT License <add> * For full copyright and license information, please see the LICENSE.txt <add> * Redistributions of files must retain the above copyright notice. <add> * <add> * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) <add> * @link http://cakephp.org CakePHP(tm) Project <add> * @since CakePHP(tm) v3.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Test\TestCase\View\Input; <add> <add>use Cake\TestSuite\TestCase; <add>use Cake\View\Input\MultiCheckbox; <add>use Cake\View\StringTemplate; <add> <add>/** <add> * MultiCheckbox test case. <add> */ <add>class MultiCheckboxTest extends TestCase { <add> <add> public function setUp() { <add> parent::setUp(); <add> $templates = [ <add> 'checkbox' => '<input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>', <add> 'label' => '<label{{attrs}}>{{text}}</label>', <add> 'checkboxContainer' => '<div class="checkbox">{{input}}{{label}}</div>', <add> ]; <add> $this->templates = new StringTemplate(); <add> $this->templates->add($templates); <add> } <add> <add>/** <add> * Test render simple option sets. <add> * <add> * @return void <add> */ <add> public function testRenderSimple() { <add> $input = new MultiCheckbox($this->templates); <add> $data = [ <add> 'name' => 'Tags[id]', <add> 'options' => [ <add> 1 => 'CakePHP', <add> 2 => 'Development', <add> ] <add> ]; <add> $result = $input->render($data); <add> $expected = [ <add> ['div' => ['class' => 'checkbox']], <add> ['input' => [ <add> 'type' => 'checkbox', <add> 'name' => 'Tags[id][]', <add> 'value' => 1, <add> 'id' => 'tags-id-1', <add> ]], <add> ['label' => ['for' => 'tags-id-1']], <add> 'CakePHP', <add> '/label', <add> '/div', <add> ['div' => ['class' => 'checkbox']], <add> ['input' => [ <add> 'type' => 'checkbox', <add> 'name' => 'Tags[id][]', <add> 'value' => 2, <add> 'id' => 'tags-id-2', <add> ]], <add> ['label' => ['for' => 'tags-id-2']], <add> 'Development', <add> '/label', <add> '/div', <add> ]; <add> $this->assertTags($result, $expected); <add> } <add> <add>/** <add> * Test render escpaing options. <add> * <add> * @return void <add> */ <add> public function testRenderEscaping() { <add> $this->markTestIncomplete(); <add> } <add> <add>/** <add> * Test render complex options. <add> * <add> * @return void <add> */ <add> public function testRenderComplex() { <add> $this->markTestIncomplete(); <add> } <add> <add>/** <add> * Test render selected checkboxes. <add> * <add> * @return void <add> */ <add> public function testRenderSelected() { <add> $this->markTestIncomplete(); <add> } <add> <add>/** <add> * Test render disabled checkboxes. <add> * <add> * @return void <add> */ <add> public function testRenderDisabled() { <add> $this->markTestIncomplete(); <add> } <add> <add>}
2
Ruby
Ruby
fix a content_for test description
6f36168ecaa3fd68bfc8b5ead76e32aa8dc51252
<ide><path>actionview/test/template/capture_helper_test.rb <ide> def test_capture_doesnt_escape_twice <ide> assert_equal "&lt;em&gt;bar&lt;/em&gt;", string <ide> end <ide> <del> def test_capture_used_for_read <add> def test_content_for_used_for_read <ide> content_for :foo, "foo" <ide> assert_equal "foo", content_for(:foo) <ide>
1
Python
Python
add subscription extra for clearsdn
e5e1c023d9039503e53827a1a0a98b13281385e1
<ide><path>libcloud/compute/drivers/clearcenter.py <ide> def _get_extra_dict(data): <ide> extra['created_timestamp'] = data['created'][0] <ide> extra['monthly_cost_estimate'] = data['monthly_cost_estimate']['total'] <ide> <add> if data['subscription']: <add> extra['subscription_label'] = data['subscription']['label'] <add> extra['subscription_value'] = data['subscription']['state']['value'] <add> extra['subscription_created'] = data['subscription']['created'][0] <add> extra['subscription_expires'] = data['subscription']['expire'][0] <add> <add> <ide> return extra <ide> <ide> def list_nodes(self):
1
Text
Text
update react 18's overview
fbfe430cf0d21513eadb7be7e9c05a6ac6d5048a
<ide><path>docs/advanced-features/react-18/overview.md <ide> # React 18 <ide> <del>[React 18](https://reactjs.org/blog/2021/06/08/the-plan-for-react-18.html) adds new features including Suspense, automatic batching of updates, APIs like `startTransition`, and a new streaming API for server rendering with support for `React.lazy`. <add>[React 18](https://reactjs.org/blog/2022/03/29/react-v18.html) adds new features including Suspense, automatic batching of updates, APIs like `startTransition`, and a new streaming API for server rendering with support for `React.lazy`. <ide> Next.js also provides streaming related APIs, please checkout [next/streaming](/docs/api-reference/next/streaming.md) for details. <ide> <del>React 18 is now in Release Candidate (RC). Read more about React 18's [release plan](https://reactjs.org/blog/2021/06/08/the-plan-for-react-18.html) and discussions from the [working group](https://github.com/reactwg/react-18/discussions). <add>React 18 is now released. Read more about [React 18](https://reactjs.org/blog/2022/03/29/react-v18.html). <ide> <ide> ## Using React 18 with Next.js <ide> <del>Install the RC version of React 18: <add>Install the latest version of React: <ide> <ide> ```jsx <del>npm install next@latest react@rc react-dom@rc <add>npm install next@latest react@latest react-dom@latest <ide> ``` <ide> <ide> You can now start using React 18's new APIs like `startTransition` and `Suspense` in Next.js. <ide><path>docs/advanced-features/react-18/server-components.md <ide> Server Components allow us to render React components on the server. This is fun <ide> <ide> ### Enable React Server Components <ide> <del>To use React Server Components, ensure you have React 18 installed: <add>To use React Server Components, ensure you have the latest React installed: <ide> <ide> ```jsx <del>npm install next@canary react@rc react-dom@rc <add>npm install next@canary react@latest react-dom@latest <ide> ``` <ide> <ide> Then, update your `next.config.js`:
2
Python
Python
spellcheck the modules. clarify an example
a4e99a7998a30d8e777510aaa5926b436a844f2b
<ide><path>numpy/polynomial/chebyshev.py <ide> def _cseries_to_zseries(c) : <ide> <ide> Parameters <ide> ---------- <del> c : 1-d ndarray <add> c : 1-D ndarray <ide> Chebyshev coefficients, ordered from low to high <ide> <ide> Returns <ide> ------- <del> zs : 1-d ndarray <add> zs : 1-D ndarray <ide> Odd length symmetric z-series, ordered from low to high. <ide> <ide> """ <ide> def _zseries_to_cseries(zs) : <ide> <ide> Parameters <ide> ---------- <del> zs : 1-d ndarray <add> zs : 1-D ndarray <ide> Odd length symmetric z-series, ordered from low to high. <ide> <ide> Returns <ide> ------- <del> c : 1-d ndarray <add> c : 1-D ndarray <ide> Chebyshev coefficients, ordered from low to high. <ide> <ide> """ <ide> def _zseries_mul(z1, z2) : <ide> <ide> Parameters <ide> ---------- <del> z1, z2 : 1-d ndarray <del> The arrays must be 1-d but this is not checked. <add> z1, z2 : 1-D ndarray <add> The arrays must be 1-D but this is not checked. <ide> <ide> Returns <ide> ------- <del> product : 1-d ndarray <add> product : 1-D ndarray <ide> The product z-series. <ide> <ide> Notes <ide> ----- <del> This is simply convolution. If symmetic/anti-symmetric z-series are <add> This is simply convolution. If symmetric/anti-symmetric z-series are <ide> denoted by S/A then the following rules apply: <ide> <ide> S*S, A*A -> S <ide> def _zseries_div(z1, z2) : <ide> <ide> Parameters <ide> ---------- <del> z1, z2 : 1-d ndarray <del> The arrays must be 1-d and have the same symmetry, but this is not <add> z1, z2 : 1-D ndarray <add> The arrays must be 1-D and have the same symmetry, but this is not <ide> checked. <ide> <ide> Returns <ide> ------- <ide> <del> (quotient, remainder) : 1-d ndarrays <add> (quotient, remainder) : 1-D ndarrays <ide> Quotient and remainder as z-series. <ide> <ide> Notes <ide> ----- <ide> This is not the same as polynomial division on account of the desired form <del> of the remainder. If symmetic/anti-symmetric z-series are denoted by S/A <add> of the remainder. If symmetric/anti-symmetric z-series are denoted by S/A <ide> then the following rules apply: <ide> <ide> S/S -> S,S <ide> A/A -> S,A <ide> <ide> The restriction to types of the same symmetry could be fixed but seems like <del> uneeded generality. There is no natural form for the remainder in the case <add> unneeded generality. There is no natural form for the remainder in the case <ide> where there is no symmetry. <ide> <ide> """ <ide> def poly2cheb(pol) : <ide> Parameters <ide> ---------- <ide> pol : array_like <del> 1-d array containing the polynomial coefficients <add> 1-D array containing the polynomial coefficients <ide> <ide> Returns <ide> ------- <ide> c : ndarray <del> 1-d array containing the coefficients of the equivalent Chebyshev <add> 1-D array containing the coefficients of the equivalent Chebyshev <ide> series. <ide> <ide> See Also <ide> def cheb2poly(c) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array containing the Chebyshev series coefficients, ordered <add> 1-D array containing the Chebyshev series coefficients, ordered <ide> from lowest order term to highest. <ide> <ide> Returns <ide> ------- <ide> pol : ndarray <del> 1-d array containing the coefficients of the equivalent polynomial <add> 1-D array containing the coefficients of the equivalent polynomial <ide> (relative to the "standard" basis) ordered from lowest order term <ide> to highest. <ide> <ide> def chebadd(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Chebyshev series coefficients ordered from low to <add> 1-D arrays of Chebyshev series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def chebsub(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Chebyshev series coefficients ordered from low to <add> 1-D arrays of Chebyshev series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def chebmulx(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Chebyshev series coefficients ordered from low to <add> 1-D array of Chebyshev series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def chebmul(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Chebyshev series coefficients ordered from low to <add> 1-D arrays of Chebyshev series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def chebmul(c1, c2): <ide> ----- <ide> In general, the (polynomial) product of two C-series results in terms <ide> that are not in the Chebyshev polynomial basis set. Thus, to express <del> the product as a C-series, it is typically necessary to "re-project" <add> the product as a C-series, it is typically necessary to "reproject" <ide> the product onto said basis set, which typically produces <del> "un-intuitive" (but correct) results; see Examples section below. <add> "unintuitive live" (but correct) results; see Examples section below. <ide> <ide> Examples <ide> -------- <ide> def chebdiv(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Chebyshev series coefficients ordered from low to <add> 1-D arrays of Chebyshev series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def chebdiv(c1, c2): <ide> In general, the (polynomial) division of one C-series by another <ide> results in quotient and remainder terms that are not in the Chebyshev <ide> polynomial basis set. Thus, to express these results as C-series, it <del> is typically necessary to "re-project" the results onto said basis <del> set, which typically produces "un-intuitive" (but correct) results; <add> is typically necessary to "reproject" the results onto said basis <add> set, which typically produces "unintuitive" (but correct) results; <ide> see Examples section below. <ide> <ide> Examples <ide> def chebpow(c, pow, maxpower=16) : <ide> """Raise a Chebyshev series to a power. <ide> <ide> Returns the Chebyshev series `c` raised to the power `pow`. The <del> arguement `c` is a sequence of coefficients ordered from low to high. <add> argument `c` is a sequence of coefficients ordered from low to high. <ide> i.e., [1,2,3] is the series ``T_0 + 2*T_1 + 3*T_2.`` <ide> <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1d array of chebyshev series coefficients ordered from low to <add> 1-D array of Chebyshev series coefficients ordered from low to <ide> high. <ide> pow : integer <ide> Power to which the series will be raised <ide> maxpower : integer, optional <ide> Maximum power allowed. This is mainly to limit growth of the series <del> to umanageable size. Default is 16 <add> to unmanageable size. Default is 16 <ide> <ide> Returns <ide> ------- <ide> def chebder(c, m=1, scl=1, axis=0) : <ide> Notes <ide> ----- <ide> In general, the result of differentiating a C-series needs to be <del> "re-projected" onto the C-series basis set. Thus, typically, the <del> result of this function is "un-intuitive," albeit correct; see Examples <add> "reprojected" onto the C-series basis set. Thus, typically, the <add> result of this function is "unintuitive," albeit correct; see Examples <ide> section below. <ide> <ide> Examples <ide> def chebint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> """ <ide> Integrate a Chebyshev series. <ide> <del> Returns the Chebeshev series coefficients `c` integrated `m` times from <add> Returns the Chebyshev series coefficients `c` integrated `m` times from <ide> `lbnd` along `axis`. At each iteration the resulting series is <ide> **multiplied** by `scl` and an integration constant, `k`, is added. <ide> The scaling factor is for use in a linear change of variable. ("Buyer <ide> beware": note that, depending on what one is doing, one may want `scl` <ide> to be the reciprocal of what one might expect; for more information, <ide> see the Notes section below.) The argument `c` is an array of <del> coefficients from low to high degree along each axix, e.g., [1,2,3] <add> coefficients from low to high degree along each axis, e.g., [1,2,3] <ide> represents the series ``T_0 + 2*T_1 + 3*T_2`` while [[1,2],[1,2]] <ide> represents ``1*T_0(x)*T_0(y) + 1*T_1(x)*T_0(y) + 2*T_0(x)*T_1(y) + <ide> 2*T_1(x)*T_1(y)`` if axis=0 is ``x`` and axis=1 is ``y``. <ide> def chebint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> :math:`1/a`- perhaps not what one would have first thought. <ide> <ide> Also note that, in general, the result of integrating a C-series needs <del> to be "re-projected" onto the C-series basis set. Thus, typically, <del> the result of this function is "un-intuitive," albeit correct; see <add> to be "reprojected" onto the C-series basis set. Thus, typically, <add> the result of this function is "unintuitive," albeit correct; see <ide> Examples section below. <ide> <ide> Examples <ide> def chebval(x, c, tensor=True): <ide> with themselves and with the elements of `c`. <ide> c : array_like <ide> Array of coefficients ordered so that the coefficients for terms of <del> degree n are contained in c[n]. If `c` is multidimesional the <add> degree n are contained in c[n]. If `c` is multidimensional the <ide> remaining indices enumerate multiple polynomials. In the two <ide> dimensional case the coefficients may be thought of as stored in <ide> the columns of `c`. <ide> def chebval2d(x, y, c): <ide> <ide> def chebgrid2d(x, y, c): <ide> """ <del> Evaluate a 2-D Chebyshev series on the Cartesion product of x and y. <add> Evaluate a 2-D Chebyshev series on the Cartesian product of x and y. <ide> <ide> This function returns the values: <ide> <del> .. math:: p(a,b) = \sum_{i,j} c_{i,j} * T_i(a) * T_j(b) <add> .. math:: p(a,b) = \sum_{i,j} c_{i,j} * T_i(a) * T_j(b), <ide> <ide> where the points `(a, b)` consist of all pairs formed by taking <ide> `a` from `x` and `b` from `y`. The resulting points form a grid with <ide> def chebgrid2d(x, y, c): <ide> ------- <ide> values : ndarray, compatible object <ide> The values of the two dimensional Chebyshev series at points in the <del> Cartesion product of `x` and `y`. <add> Cartesian product of `x` and `y`. <ide> <ide> See Also <ide> -------- <ide> def chebval3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the multidimension polynomial on points formed with <add> The values of the multidimensional polynomial on points formed with <ide> triples of corresponding values from `x`, `y`, and `z`. <ide> <ide> See Also <ide> def chebgrid3d(x, y, z, c): <ide> <ide> If `c` has fewer than three dimensions, ones are implicitly appended to <ide> its shape to make it 3-D. The shape of the result will be c.shape[3:] + <del> x.shape + yshape + z.shape. <add> x.shape + y.shape + z.shape. <ide> <ide> Parameters <ide> ---------- <ide> def chebgrid3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def chebfit(x, y, deg, rcond=None, full=False, w=None): <ide> <ide> If some of the singular values of `V` are so small that they are <ide> neglected, then a `RankWarning` will be issued. This means that the <del> coeficient values may be poorly determined. Using a lower order fit <add> coefficient values may be poorly determined. Using a lower order fit <ide> will usually get rid of the warning. The `rcond` parameter can also be <ide> set to a value smaller than its default, but the resulting fit may be <ide> spurious and have large contributions from roundoff error. <ide> def chebcompanion(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Chebyshev series coefficients ordered from low to high <add> 1-D array of Chebyshev series coefficients ordered from low to high <ide> degree. <ide> <ide> Returns <ide><path>numpy/polynomial/hermite.py <ide> def poly2herm(pol) : <ide> Parameters <ide> ---------- <ide> pol : array_like <del> 1-d array containing the polynomial coefficients <add> 1-D array containing the polynomial coefficients <ide> <ide> Returns <ide> ------- <ide> c : ndarray <del> 1-d array containing the coefficients of the equivalent Hermite <add> 1-D array containing the coefficients of the equivalent Hermite <ide> series. <ide> <ide> See Also <ide> def herm2poly(c) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array containing the Hermite series coefficients, ordered <add> 1-D array containing the Hermite series coefficients, ordered <ide> from lowest order term to highest. <ide> <ide> Returns <ide> ------- <ide> pol : ndarray <del> 1-d array containing the coefficients of the equivalent polynomial <add> 1-D array containing the coefficients of the equivalent polynomial <ide> (relative to the "standard" basis) ordered from lowest order term <ide> to highest. <ide> <ide> def hermadd(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermsub(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermmulx(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Hermite series coefficients ordered from low to <add> 1-D array of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermmul(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermmul(c1, c2): <ide> ----- <ide> In general, the (polynomial) product of two C-series results in terms <ide> that are not in the Hermite polynomial basis set. Thus, to express <del> the product as a Hermite series, it is necessary to "re-project" the <del> product onto said basis set, which may produce "un-intuitive" (but <add> the product as a Hermite series, it is necessary to "reproject" the <add> product onto said basis set, which may produce "unintuitive" (but <ide> correct) results; see Examples section below. <ide> <ide> Examples <ide> def hermdiv(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermdiv(c1, c2): <ide> In general, the (polynomial) division of one Hermite series by another <ide> results in quotient and remainder terms that are not in the Hermite <ide> polynomial basis set. Thus, to express these results as a Hermite <del> series, it is necessary to "re-project" the results onto the Hermite <del> basis set, which may produce "un-intuitive" (but correct) results; see <add> series, it is necessary to "reproject" the results onto the Hermite <add> basis set, which may produce "unintuitive" (but correct) results; see <ide> Examples section below. <ide> <ide> Examples <ide> def hermpow(c, pow, maxpower=16) : <ide> """Raise a Hermite series to a power. <ide> <ide> Returns the Hermite series `c` raised to the power `pow`. The <del> arguement `c` is a sequence of coefficients ordered from low to high. <add> argument `c` is a sequence of coefficients ordered from low to high. <ide> i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.`` <ide> <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1d array of Hermite series coefficients ordered from low to <add> 1-D array of Hermite series coefficients ordered from low to <ide> high. <ide> pow : integer <ide> Power to which the series will be raised <ide> maxpower : integer, optional <ide> Maximum power allowed. This is mainly to limit growth of the series <del> to umanageable size. Default is 16 <add> to unmanageable size. Default is 16 <ide> <ide> Returns <ide> ------- <ide> def hermder(c, m=1, scl=1, axis=0) : <ide> ----- <ide> In general, the result of differentiating a Hermite series does not <ide> resemble the same operation on a power series. Thus the result of this <del> function may be "un-intuitive," albeit correct; see Examples section <add> function may be "unintuitive," albeit correct; see Examples section <ide> below. <ide> <ide> Examples <ide> def hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> beware": note that, depending on what one is doing, one may want `scl` <ide> to be the reciprocal of what one might expect; for more information, <ide> see the Notes section below.) The argument `c` is an array of <del> coefficients from low to high degree along each axix, e.g., [1,2,3] <add> coefficients from low to high degree along each axis, e.g., [1,2,3] <ide> represents the series ``H_0 + 2*H_1 + 3*H_2`` while [[1,2],[1,2]] <ide> represents ``1*H_0(x)*H_0(y) + 1*H_1(x)*H_0(y) + 2*H_0(x)*H_1(y) + <ide> 2*H_1(x)*H_1(y)`` if axis=0 is ``x`` and axis=1 is ``y``. <ide> def hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> :math:`1/a` - perhaps not what one would have first thought. <ide> <ide> Also note that, in general, the result of integrating a C-series needs <del> to be "re-projected" onto the C-series basis set. Thus, typically, <del> the result of this function is "un-intuitive," albeit correct; see <add> to be "reprojected" onto the C-series basis set. Thus, typically, <add> the result of this function is "unintuitive," albeit correct; see <ide> Examples section below. <ide> <ide> Examples <ide> def hermval(x, c, tensor=True): <ide> with themselves and with the elements of `c`. <ide> c : array_like <ide> Array of coefficients ordered so that the coefficients for terms of <del> degree n are contained in c[n]. If `c` is multidimesional the <add> degree n are contained in c[n]. If `c` is multidimensional the <ide> remaining indices enumerate multiple polynomials. In the two <ide> dimensional case the coefficients may be thought of as stored in <ide> the columns of `c`. <ide> def hermval2d(x, y, c): <ide> <ide> def hermgrid2d(x, y, c): <ide> """ <del> Evaluate a 2-D Hermite series on the Cartesion product of x and y. <add> Evaluate a 2-D Hermite series on the Cartesian product of x and y. <ide> <ide> This function returns the values: <ide> <ide> def hermgrid2d(x, y, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def hermval3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the multidimension polynomial on points formed with <add> The values of the multidimensional polynomial on points formed with <ide> triples of corresponding values from `x`, `y`, and `z`. <ide> <ide> See Also <ide> def hermgrid3d(x, y, z, c): <ide> <ide> If `c` has fewer than three dimensions, ones are implicitly appended to <ide> its shape to make it 3-D. The shape of the result will be c.shape[3:] + <del> x.shape + yshape + z.shape. <add> x.shape + y.shape + z.shape. <ide> <ide> Parameters <ide> ---------- <ide> def hermgrid3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def hermfit(x, y, deg, rcond=None, full=False, w=None): <ide> <ide> If some of the singular values of `V` are so small that they are <ide> neglected, then a `RankWarning` will be issued. This means that the <del> coeficient values may be poorly determined. Using a lower order fit <add> coefficient values may be poorly determined. Using a lower order fit <ide> will usually get rid of the warning. The `rcond` parameter can also be <ide> set to a value smaller than its default, but the resulting fit may be <ide> spurious and have large contributions from roundoff error. <ide> <ide> Fits using Hermite series are probably most useful when the data can be <ide> approximated by ``sqrt(w(x)) * p(x)``, where `w(x)` is the Hermite <del> weight. In that case the wieght ``sqrt(w(x[i])`` should be used <add> weight. In that case the weight ``sqrt(w(x[i])`` should be used <ide> together with data values ``y[i]/sqrt(w(x[i])``. The weight function is <ide> available as `hermweight`. <ide> <ide> def hermcompanion(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Hermite series coefficients ordered from low to high <add> 1-D array of Hermite series coefficients ordered from low to high <ide> degree. <ide> <ide> Returns <ide><path>numpy/polynomial/hermite_e.py <ide> def poly2herme(pol) : <ide> Parameters <ide> ---------- <ide> pol : array_like <del> 1-d array containing the polynomial coefficients <add> 1-D array containing the polynomial coefficients <ide> <ide> Returns <ide> ------- <ide> c : ndarray <del> 1-d array containing the coefficients of the equivalent Hermite <add> 1-D array containing the coefficients of the equivalent Hermite <ide> series. <ide> <ide> See Also <ide> def herme2poly(c) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array containing the Hermite series coefficients, ordered <add> 1-D array containing the Hermite series coefficients, ordered <ide> from lowest order term to highest. <ide> <ide> Returns <ide> ------- <ide> pol : ndarray <del> 1-d array containing the coefficients of the equivalent polynomial <add> 1-D array containing the coefficients of the equivalent polynomial <ide> (relative to the "standard" basis) ordered from lowest order term <ide> to highest. <ide> <ide> def hermeadd(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermesub(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermemulx(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Hermite series coefficients ordered from low to <add> 1-D array of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermemul(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermemul(c1, c2): <ide> ----- <ide> In general, the (polynomial) product of two C-series results in terms <ide> that are not in the Hermite polynomial basis set. Thus, to express <del> the product as a Hermite series, it is necessary to "re-project" the <del> product onto said basis set, which may produce "un-intuitive" (but <add> the product as a Hermite series, it is necessary to "reproject" the <add> product onto said basis set, which may produce "unintuitive" (but <ide> correct) results; see Examples section below. <ide> <ide> Examples <ide> def hermediv(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Hermite series coefficients ordered from low to <add> 1-D arrays of Hermite series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def hermediv(c1, c2): <ide> In general, the (polynomial) division of one Hermite series by another <ide> results in quotient and remainder terms that are not in the Hermite <ide> polynomial basis set. Thus, to express these results as a Hermite <del> series, it is necessary to "re-project" the results onto the Hermite <del> basis set, which may produce "un-intuitive" (but correct) results; see <add> series, it is necessary to "reproject" the results onto the Hermite <add> basis set, which may produce "unintuitive" (but correct) results; see <ide> Examples section below. <ide> <ide> Examples <ide> def hermepow(c, pow, maxpower=16) : <ide> """Raise a Hermite series to a power. <ide> <ide> Returns the Hermite series `c` raised to the power `pow`. The <del> arguement `c` is a sequence of coefficients ordered from low to high. <add> argument `c` is a sequence of coefficients ordered from low to high. <ide> i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.`` <ide> <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1d array of Hermite series coefficients ordered from low to <add> 1-D array of Hermite series coefficients ordered from low to <ide> high. <ide> pow : integer <ide> Power to which the series will be raised <ide> maxpower : integer, optional <ide> Maximum power allowed. This is mainly to limit growth of the series <del> to umanageable size. Default is 16 <add> to unmanageable size. Default is 16 <ide> <ide> Returns <ide> ------- <ide> def hermeder(c, m=1, scl=1, axis=0) : <ide> ----- <ide> In general, the result of differentiating a Hermite series does not <ide> resemble the same operation on a power series. Thus the result of this <del> function may be "un-intuitive," albeit correct; see Examples section <add> function may be "unintuitive," albeit correct; see Examples section <ide> below. <ide> <ide> Examples <ide> def hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> beware": note that, depending on what one is doing, one may want `scl` <ide> to be the reciprocal of what one might expect; for more information, <ide> see the Notes section below.) The argument `c` is an array of <del> coefficients from low to high degree along each axix, e.g., [1,2,3] <add> coefficients from low to high degree along each axis, e.g., [1,2,3] <ide> represents the series ``H_0 + 2*H_1 + 3*H_2`` while [[1,2],[1,2]] <ide> represents ``1*H_0(x)*H_0(y) + 1*H_1(x)*H_0(y) + 2*H_0(x)*H_1(y) + <ide> 2*H_1(x)*H_1(y)`` if axis=0 is ``x`` and axis=1 is ``y``. <ide> def hermeint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> :math:`1/a` - perhaps not what one would have first thought. <ide> <ide> Also note that, in general, the result of integrating a C-series needs <del> to be "re-projected" onto the C-series basis set. Thus, typically, <del> the result of this function is "un-intuitive," albeit correct; see <add> to be "reprojected" onto the C-series basis set. Thus, typically, <add> the result of this function is "unintuitive," albeit correct; see <ide> Examples section below. <ide> <ide> Examples <ide> def hermeval(x, c, tensor=True): <ide> with themselves and with the elements of `c`. <ide> c : array_like <ide> Array of coefficients ordered so that the coefficients for terms of <del> degree n are contained in c[n]. If `c` is multidimesional the <add> degree n are contained in c[n]. If `c` is multidimensional the <ide> remaining indices enumerate multiple polynomials. In the two <ide> dimensional case the coefficients may be thought of as stored in <ide> the columns of `c`. <ide> def hermeval2d(x, y, c): <ide> <ide> def hermegrid2d(x, y, c): <ide> """ <del> Evaluate a 2-D HermiteE series on the Cartesion product of x and y. <add> Evaluate a 2-D HermiteE series on the Cartesian product of x and y. <ide> <ide> This function returns the values: <ide> <ide> def hermegrid2d(x, y, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def hermeval3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the multidimension polynomial on points formed with <add> The values of the multidimensional polynomial on points formed with <ide> triples of corresponding values from `x`, `y`, and `z`. <ide> <ide> See Also <ide> def hermegrid3d(x, y, z, c): <ide> <ide> If `c` has fewer than three dimensions, ones are implicitly appended to <ide> its shape to make it 3-D. The shape of the result will be c.shape[3:] + <del> x.shape + yshape + z.shape. <add> x.shape + y.shape + z.shape. <ide> <ide> Parameters <ide> ---------- <ide> def hermegrid3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def hermefit(x, y, deg, rcond=None, full=False, w=None): <ide> <ide> If some of the singular values of `V` are so small that they are <ide> neglected, then a `RankWarning` will be issued. This means that the <del> coeficient values may be poorly determined. Using a lower order fit <add> coefficient values may be poorly determined. Using a lower order fit <ide> will usually get rid of the warning. The `rcond` parameter can also be <ide> set to a value smaller than its default, but the resulting fit may be <ide> spurious and have large contributions from roundoff error. <ide> <ide> Fits using HermiteE series are probably most useful when the data can <ide> be approximated by ``sqrt(w(x)) * p(x)``, where `w(x)` is the HermiteE <del> weight. In that case the wieght ``sqrt(w(x[i])`` should be used <add> weight. In that case the weight ``sqrt(w(x[i])`` should be used <ide> together with data values ``y[i]/sqrt(w(x[i])``. The weight function is <ide> available as `hermeweight`. <ide> <ide> def hermecompanion(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of HermiteE series coefficients ordered from low to high <add> 1-D array of HermiteE series coefficients ordered from low to high <ide> degree. <ide> <ide> Returns <ide><path>numpy/polynomial/laguerre.py <ide> def poly2lag(pol) : <ide> Parameters <ide> ---------- <ide> pol : array_like <del> 1-d array containing the polynomial coefficients <add> 1-D array containing the polynomial coefficients <ide> <ide> Returns <ide> ------- <ide> c : ndarray <del> 1-d array containing the coefficients of the equivalent Laguerre <add> 1-D array containing the coefficients of the equivalent Laguerre <ide> series. <ide> <ide> See Also <ide> def lag2poly(c) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array containing the Laguerre series coefficients, ordered <add> 1-D array containing the Laguerre series coefficients, ordered <ide> from lowest order term to highest. <ide> <ide> Returns <ide> ------- <ide> pol : ndarray <del> 1-d array containing the coefficients of the equivalent polynomial <add> 1-D array containing the coefficients of the equivalent polynomial <ide> (relative to the "standard" basis) ordered from lowest order term <ide> to highest. <ide> <ide> def lagadd(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Laguerre series coefficients ordered from low to <add> 1-D arrays of Laguerre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def lagsub(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Laguerre series coefficients ordered from low to <add> 1-D arrays of Laguerre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def lagmulx(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Laguerre series coefficients ordered from low to <add> 1-D array of Laguerre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def lagmul(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Laguerre series coefficients ordered from low to <add> 1-D arrays of Laguerre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def lagmul(c1, c2): <ide> ----- <ide> In general, the (polynomial) product of two C-series results in terms <ide> that are not in the Laguerre polynomial basis set. Thus, to express <del> the product as a Laguerre series, it is necessary to "re-project" the <del> product onto said basis set, which may produce "un-intuitive" (but <add> the product as a Laguerre series, it is necessary to "reproject" the <add> product onto said basis set, which may produce "unintuitive" (but <ide> correct) results; see Examples section below. <ide> <ide> Examples <ide> def lagdiv(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Laguerre series coefficients ordered from low to <add> 1-D arrays of Laguerre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def lagdiv(c1, c2): <ide> In general, the (polynomial) division of one Laguerre series by another <ide> results in quotient and remainder terms that are not in the Laguerre <ide> polynomial basis set. Thus, to express these results as a Laguerre <del> series, it is necessary to "re-project" the results onto the Laguerre <del> basis set, which may produce "un-intuitive" (but correct) results; see <add> series, it is necessary to "reproject" the results onto the Laguerre <add> basis set, which may produce "unintuitive" (but correct) results; see <ide> Examples section below. <ide> <ide> Examples <ide> def lagpow(c, pow, maxpower=16) : <ide> """Raise a Laguerre series to a power. <ide> <ide> Returns the Laguerre series `c` raised to the power `pow`. The <del> arguement `c` is a sequence of coefficients ordered from low to high. <add> argument `c` is a sequence of coefficients ordered from low to high. <ide> i.e., [1,2,3] is the series ``P_0 + 2*P_1 + 3*P_2.`` <ide> <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1d array of Laguerre series coefficients ordered from low to <add> 1-D array of Laguerre series coefficients ordered from low to <ide> high. <ide> pow : integer <ide> Power to which the series will be raised <ide> maxpower : integer, optional <ide> Maximum power allowed. This is mainly to limit growth of the series <del> to umanageable size. Default is 16 <add> to unmanageable size. Default is 16 <ide> <ide> Returns <ide> ------- <ide> def lagder(c, m=1, scl=1, axis=0) : <ide> ----- <ide> In general, the result of differentiating a Laguerre series does not <ide> resemble the same operation on a power series. Thus the result of this <del> function may be "un-intuitive," albeit correct; see Examples section <add> function may be "unintuitive," albeit correct; see Examples section <ide> below. <ide> <ide> Examples <ide> def lagint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> beware": note that, depending on what one is doing, one may want `scl` <ide> to be the reciprocal of what one might expect; for more information, <ide> see the Notes section below.) The argument `c` is an array of <del> coefficients from low to high degree along each axix, e.g., [1,2,3] <add> coefficients from low to high degree along each axis, e.g., [1,2,3] <ide> represents the series ``L_0 + 2*L_1 + 3*L_2`` while [[1,2],[1,2]] <ide> represents ``1*L_0(x)*L_0(y) + 1*L_1(x)*L_0(y) + 2*L_0(x)*L_1(y) + <ide> 2*L_1(x)*L_1(y)`` if axis=0 is ``x`` and axis=1 is ``y``. <ide> def lagint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> :math:`1/a` - perhaps not what one would have first thought. <ide> <ide> Also note that, in general, the result of integrating a C-series needs <del> to be "re-projected" onto the C-series basis set. Thus, typically, <del> the result of this function is "un-intuitive," albeit correct; see <add> to be "reprojected" onto the C-series basis set. Thus, typically, <add> the result of this function is "unintuitive," albeit correct; see <ide> Examples section below. <ide> <ide> Examples <ide> def lagval(x, c, tensor=True): <ide> with themselves and with the elements of `c`. <ide> c : array_like <ide> Array of coefficients ordered so that the coefficients for terms of <del> degree n are contained in c[n]. If `c` is multidimesional the <add> degree n are contained in c[n]. If `c` is multidimensional the <ide> remaining indices enumerate multiple polynomials. In the two <ide> dimensional case the coefficients may be thought of as stored in <ide> the columns of `c`. <ide> def lagval2d(x, y, c): <ide> <ide> def laggrid2d(x, y, c): <ide> """ <del> Evaluate a 2-D Laguerre series on the Cartesion product of x and y. <add> Evaluate a 2-D Laguerre series on the Cartesian product of x and y. <ide> <ide> This function returns the values: <ide> <ide> def laggrid2d(x, y, c): <ide> ------- <ide> values : ndarray, compatible object <ide> The values of the two dimensional Chebyshev series at points in the <del> Cartesion product of `x` and `y`. <add> Cartesian product of `x` and `y`. <ide> <ide> See Also <ide> -------- <ide> def laggrid3d(x, y, z, c): <ide> <ide> If `c` has fewer than three dimensions, ones are implicitly appended to <ide> its shape to make it 3-D. The shape of the result will be c.shape[3:] + <del> x.shape + yshape + z.shape. <add> x.shape + y.shape + z.shape. <ide> <ide> Parameters <ide> ---------- <ide> def laggrid3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def lagfit(x, y, deg, rcond=None, full=False, w=None): <ide> <ide> If some of the singular values of `V` are so small that they are <ide> neglected, then a `RankWarning` will be issued. This means that the <del> coeficient values may be poorly determined. Using a lower order fit <add> coefficient values may be poorly determined. Using a lower order fit <ide> will usually get rid of the warning. The `rcond` parameter can also be <ide> set to a value smaller than its default, but the resulting fit may be <ide> spurious and have large contributions from roundoff error. <ide> <ide> Fits using Laguerre series are probably most useful when the data can <ide> be approximated by ``sqrt(w(x)) * p(x)``, where `w(x)` is the Laguerre <del> weight. In that case the wieght ``sqrt(w(x[i])`` should be used <add> weight. In that case the weight ``sqrt(w(x[i])`` should be used <ide> together with data values ``y[i]/sqrt(w(x[i])``. The weight function is <ide> available as `lagweight`. <ide> <ide> def lagcompanion(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Laguerre series coefficients ordered from low to high <add> 1-D array of Laguerre series coefficients ordered from low to high <ide> degree. <ide> <ide> Returns <ide><path>numpy/polynomial/legendre.py <ide> def poly2leg(pol) : <ide> Parameters <ide> ---------- <ide> pol : array_like <del> 1-d array containing the polynomial coefficients <add> 1-D array containing the polynomial coefficients <ide> <ide> Returns <ide> ------- <ide> c : ndarray <del> 1-d array containing the coefficients of the equivalent Legendre <add> 1-D array containing the coefficients of the equivalent Legendre <ide> series. <ide> <ide> See Also <ide> def leg2poly(c) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array containing the Legendre series coefficients, ordered <add> 1-D array containing the Legendre series coefficients, ordered <ide> from lowest order term to highest. <ide> <ide> Returns <ide> ------- <ide> pol : ndarray <del> 1-d array containing the coefficients of the equivalent polynomial <add> 1-D array containing the coefficients of the equivalent polynomial <ide> (relative to the "standard" basis) ordered from lowest order term <ide> to highest. <ide> <ide> def legadd(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Legendre series coefficients ordered from low to <add> 1-D arrays of Legendre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def legsub(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Legendre series coefficients ordered from low to <add> 1-D arrays of Legendre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def legmulx(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Legendre series coefficients ordered from low to <add> 1-D array of Legendre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def legmul(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of Legendre series coefficients ordered from low to <add> 1-D arrays of Legendre series coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def legmul(c1, c2): <ide> ----- <ide> In general, the (polynomial) product of two C-series results in terms <ide> that are not in the Legendre polynomial basis set. Thus, to express <del> the product as a Legendre series, it is necessary to "re-project" the <del> product onto said basis set, which may produce "un-intuitive" (but <add> the product as a Legendre series, it is necessary to "reproject" the <add> product onto said basis set, which may produce "unintuitive" (but <ide> correct) results; see Examples section below. <ide> <ide> Examples <ide> def legdiv(c1, c2): <ide> In general, the (polynomial) division of one Legendre series by another <ide> results in quotient and remainder terms that are not in the Legendre <ide> polynomial basis set. Thus, to express these results as a Legendre <del> series, it is necessary to "re-project" the results onto the Legendre <del> basis set, which may produce "un-intuitive" (but correct) results; see <add> series, it is necessary to "reproject" the results onto the Legendre <add> basis set, which may produce "unintuitive" (but correct) results; see <ide> Examples section below. <ide> <ide> Examples <ide> def legpow(c, pow, maxpower=16) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1d array of Legendre series coefficients ordered from low to <add> l1-D array of Legendre series coefficients ordered from low to <ide> high. <ide> pow : integer <ide> Power to which the series will be raised <ide> maxpower : integer, optional <ide> Maximum power allowed. This is mainly to limit growth of the series <del> to umanageable size. Default is 16 <add> to unmanageable size. Default is 16 <ide> <ide> Returns <ide> ------- <ide> def legder(c, m=1, scl=1, axis=0) : <ide> ----- <ide> In general, the result of differentiating a Legendre series does not <ide> resemble the same operation on a power series. Thus the result of this <del> function may be "un-intuitive," albeit correct; see Examples section <add> function may be "unintuitive," albeit correct; see Examples section <ide> below. <ide> <ide> Examples <ide> def legint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> beware": note that, depending on what one is doing, one may want `scl` <ide> to be the reciprocal of what one might expect; for more information, <ide> see the Notes section below.) The argument `c` is an array of <del> coefficients from low to high degree along each axix, e.g., [1,2,3] <add> coefficients from low to high degree along each axis, e.g., [1,2,3] <ide> represents the series ``L_0 + 2*L_1 + 3*L_2`` while [[1,2],[1,2]] <ide> represents ``1*L_0(x)*L_0(y) + 1*L_1(x)*L_0(y) + 2*L_0(x)*L_1(y) + <ide> 2*L_1(x)*L_1(y)`` if axis=0 is ``x`` and axis=1 is ``y``. <ide> def legint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> :math:`1/a` - perhaps not what one would have first thought. <ide> <ide> Also note that, in general, the result of integrating a C-series needs <del> to be "re-projected" onto the C-series basis set. Thus, typically, <del> the result of this function is "un-intuitive," albeit correct; see <add> to be "reprojected" onto the C-series basis set. Thus, typically, <add> the result of this function is "unintuitive," albeit correct; see <ide> Examples section below. <ide> <ide> Examples <ide> def legval(x, c, tensor=True): <ide> with themselves and with the elements of `c`. <ide> c : array_like <ide> Array of coefficients ordered so that the coefficients for terms of <del> degree n are contained in c[n]. If `c` is multidimesional the <add> degree n are contained in c[n]. If `c` is multidimensional the <ide> remaining indices enumerate multiple polynomials. In the two <ide> dimensional case the coefficients may be thought of as stored in <ide> the columns of `c`. <ide> def legval2d(x, y, c): <ide> <ide> def leggrid2d(x, y, c): <ide> """ <del> Evaluate a 2-D Legendre series on the Cartesion product of x and y. <add> Evaluate a 2-D Legendre series on the Cartesian product of x and y. <ide> <ide> This function returns the values: <ide> <ide> def leggrid2d(x, y, c): <ide> ------- <ide> values : ndarray, compatible object <ide> The values of the two dimensional Chebyshev series at points in the <del> Cartesion product of `x` and `y`. <add> Cartesian product of `x` and `y`. <ide> <ide> See Also <ide> -------- <ide> def legval3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the multidimension polynomial on points formed with <add> The values of the multidimensional polynomial on points formed with <ide> triples of corresponding values from `x`, `y`, and `z`. <ide> <ide> See Also <ide> def leggrid3d(x, y, z, c): <ide> <ide> If `c` has fewer than three dimensions, ones are implicitly appended to <ide> its shape to make it 3-D. The shape of the result will be c.shape[3:] + <del> x.shape + yshape + z.shape. <add> x.shape + y.shape + z.shape. <ide> <ide> Parameters <ide> ---------- <ide> def leggrid3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def legfit(x, y, deg, rcond=None, full=False, w=None): <ide> <ide> If some of the singular values of `V` are so small that they are <ide> neglected, then a `RankWarning` will be issued. This means that the <del> coeficient values may be poorly determined. Using a lower order fit <add> coefficient values may be poorly determined. Using a lower order fit <ide> will usually get rid of the warning. The `rcond` parameter can also be <ide> set to a value smaller than its default, but the resulting fit may be <ide> spurious and have large contributions from roundoff error. <ide> def legcompanion(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of Legendre series coefficients ordered from low to high <add> 1-D array of Legendre series coefficients ordered from low to high <ide> degree. <ide> <ide> Returns <ide><path>numpy/polynomial/polynomial.py <ide> def polyadd(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of polynomial coefficients ordered from low to high. <add> 1-D arrays of polynomial coefficients ordered from low to high. <ide> <ide> Returns <ide> ------- <ide> def polysub(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of polynomial coefficients ordered from low to <add> 1-D arrays of polynomial coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def polymulx(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of polynomial coefficients ordered from low to <add> 1-D array of polynomial coefficients ordered from low to <ide> high. <ide> <ide> Returns <ide> def polymul(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of coefficients representing a polynomial, relative to the <add> 1-D arrays of coefficients representing a polynomial, relative to the <ide> "standard" basis, and ordered from lowest order term to highest. <ide> <ide> Returns <ide> def polydiv(c1, c2): <ide> Parameters <ide> ---------- <ide> c1, c2 : array_like <del> 1-d arrays of polynomial coefficients ordered from low to high. <add> 1-D arrays of polynomial coefficients ordered from low to high. <ide> <ide> Returns <ide> ------- <ide> def polypow(c, pow, maxpower=None) : <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1d array of array of series coefficients ordered from low to <add> 1-D array of array of series coefficients ordered from low to <ide> high degree. <ide> pow : integer <ide> Power to which the series will be raised <ide> maxpower : integer, optional <ide> Maximum power allowed. This is mainly to limit growth of the series <del> to umanageable size. Default is 16 <add> to unmanageable size. Default is 16 <ide> <ide> Returns <ide> ------- <ide> def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of polynomial coefficients, ordered from low to high. <add> 1-D array of polynomial coefficients, ordered from low to high. <ide> m : int, optional <ide> Order of integration, must be positive. (Default: 1) <ide> k : {[], list, scalar}, optional <ide> def polyval(x, c, tensor=True): <ide> with themselves and with the elements of `c`. <ide> c : array_like <ide> Array of coefficients ordered so that the coefficients for terms of <del> degree n are contained in c[n]. If `c` is multidimesional the <add> degree n are contained in c[n]. If `c` is multidimensional the <ide> remaining indices enumerate multiple polynomials. In the two <ide> dimensional case the coefficients may be thought of as stored in <ide> the columns of `c`. <ide> def polyval(x, c, tensor=True): <ide> >>> polyval(a, [1,2,3]) <ide> array([[ 1., 6.], <ide> [ 17., 34.]]) <del> >>> c = np.arange(4).reshape(2,2) <del> >>> c <add> >>> coef = np.arange(4).reshape(2,2) # multidimensional coefficients <add> >>> coef <ide> array([[[ 0, 1], <ide> [ 2, 3]], <del> >>> polyval([1,2], c, tensor=True) <add> >>> polyval([1,2], coef, tensor=True) <ide> array([[ 2., 4.], <ide> [ 4., 7.]]) <del> >>> polyval([1,2], c, tensor=False) <add> >>> polyval([1,2], coef, tensor=False) <ide> array([ 2., 7.]) <ide> <ide> """ <ide> def polyval2d(x, y, c): <ide> <ide> def polygrid2d(x, y, c): <ide> """ <del> Evaluate a 2-D polynomial on the Cartesion product of x and y. <add> Evaluate a 2-D polynomial on the Cartesian product of x and y. <ide> <ide> This function returns the values: <ide> <ide> def polygrid2d(x, y, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def polyval3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the multidimension polynomial on points formed with <add> The values of the multidimensional polynomial on points formed with <ide> triples of corresponding values from `x`, `y`, and `z`. <ide> <ide> See Also <ide> def polyval3d(x, y, z, c): <ide> <ide> def polygrid3d(x, y, z, c): <ide> """ <del> Evaluate a 3-D polynomial on the Cartesion product of x, y and z. <add> Evaluate a 3-D polynomial on the Cartesian product of x, y and z. <ide> <ide> This function returns the values: <ide> <ide> def polygrid3d(x, y, z, c): <ide> <ide> If `c` has fewer than three dimensions, ones are implicitly appended to <ide> its shape to make it 3-D. The shape of the result will be c.shape[3:] + <del> x.shape + yshape + z.shape. <add> x.shape + y.shape + z.shape. <ide> <ide> Parameters <ide> ---------- <ide> def polygrid3d(x, y, z, c): <ide> Returns <ide> ------- <ide> values : ndarray, compatible object <del> The values of the two dimensional polynomial at points in the Cartesion <add> The values of the two dimensional polynomial at points in the Cartesian <ide> product of `x` and `y`. <ide> <ide> See Also <ide> def polycompanion(c): <ide> Parameters <ide> ---------- <ide> c : array_like <del> 1-d array of polynomial coefficients ordered from low to high <add> 1-D array of polynomial coefficients ordered from low to high <ide> degree. <ide> <ide> Returns <ide><path>numpy/polynomial/polytemplate.py <ide> def fit(x, y, deg, domain=None, rcond=None, full=False, w=None, <ide> has the domain specified in the call. <ide> <ide> [residuals, rank, singular_values, rcond] : only if `full` = True <del> Residuals of the least-squares fit, the effective rank of the <add> Residuals of the least squares fit, the effective rank of the <ide> scaled Vandermonde matrix and its singular values, and the <ide> specified value of `rcond`. For more details, see <ide> `linalg.lstsq`. <ide><path>numpy/polynomial/polyutils.py <ide> def any(iterable) : <ide> return False <ide> <ide> # <del># Helper functions to convert inputs to 1d arrays <add># Helper functions to convert inputs to 1-D arrays <ide> # <ide> def trimseq(seq) : <ide> """Remove small Poly series coefficients. <ide> def as_series(alist, trim=True) : <ide> <ide> Returns <ide> ------- <del> [a1, a2,...] : list of 1d-arrays <add> [a1, a2,...] : list of 1-D arrays <ide> A copy of the input data as a list of 1-d arrays. <ide> <ide> Raises
8
Javascript
Javascript
fix broken pipeline test
3140fdcd344648464c0f41e359bd83b65002cb91
<ide><path>test/parallel/test-stream-pipeline.js <ide> const net = require('net'); <ide> dst.readable = false; <ide> pipeline(src, dst, common.mustCall((err) => { <ide> assert(!err); <del> assert.strictEqual(dst.destroyed, true); <add> assert.strictEqual(dst.destroyed, false); <ide> })); <ide> src.end(); <ide> }
1
Python
Python
use list comprehension instead of filter()
42bf5642675feb6d4f3dcce4b8e92bcef42d4684
<ide><path>libcloud/compute/drivers/dimensiondata.py <ide> def _to_image(self, element, locations=None): <ide> if locations is None: <ide> locations = self.list_locations(location_id) <ide> <del> location = filter(lambda x: x.id == location_id, locations)[0] <add> location = [match_location for match_location in locations if match_location.id == location_id][0] <ide> cpu_spec = self._to_cpu_spec(element.find(fixxpath('cpu', TYPES_URN))) <ide> <ide> if LooseVersion(self.connection.active_api_version) > LooseVersion(
1
Python
Python
fix typo in comment
851ca95778ded1b4b97fa92ddd45ab5b43fdcd90
<ide><path>flask/helpers.py <ide> def flash(message, category='message'): <ide> # session.setdefault('_flashes', []).append((category, message)) <ide> # <ide> # This assumed that changes made to mutable structures in the session are <del> # are always in sync with the session object, which is not true for session <add> # always in sync with the session object, which is not true for session <ide> # implementations that use external storage for keeping their keys/values. <ide> flashes = session.get('_flashes', []) <ide> flashes.append((category, message))
1
Python
Python
allow easy repacking of providers
4e05bbc92557f5eafaa37509387b2fb2b0ab3d4a
<ide><path>dev/provider_packages/prepare_provider_packages.py <ide> # those imports need to come after the above sys.path.insert to make sure that Airflow <ide> # sources are importable without having to add the airflow sources to the PYTHONPATH before <ide> # running the script <del>import tests.deprecated_classes # noqa # isort:skip <ide> from dev.import_all_classes import import_all_classes # noqa # isort:skip <ide> from setup import PROVIDERS_REQUIREMENTS, PREINSTALLED_PROVIDERS # noqa # isort:skip <ide> <ide> def cli(): <ide> ... <ide> <ide> <add>option_skip_tag_check = click.option( <add> "--skip-tag-check/--no-skip-tag-check", <add> default=False, <add> is_flag=True, <add> help="Skip checking if the tag already exists in the remote repository", <add>) <add> <ide> option_git_update = click.option( <ide> '--git-update/--no-git-update', <ide> default=True, <ide> def tag_exists_for_version(provider_package_id: str, current_tag: str, verbose: <ide> @option_git_update <ide> @argument_package_id <ide> @option_verbose <del>def generate_setup_files(version_suffix: str, git_update: bool, package_id: str, verbose: bool): <add>@option_skip_tag_check <add>def generate_setup_files( <add> version_suffix: str, git_update: bool, package_id: str, verbose: bool, skip_tag_check: bool <add>): <ide> """ <ide> Generates setup files for the package. <ide> <ide> See `list-providers-packages` subcommand for the possible PACKAGE_ID values <ide> """ <ide> provider_package_id = package_id <ide> with with_group(f"Generate setup files for '{provider_package_id}'"): <del> current_tag = get_current_tag(provider_package_id, version_suffix, git_update, verbose) <del> if tag_exists_for_version(provider_package_id, current_tag, verbose): <del> console.print(f"[yellow]The tag {current_tag} exists. Not preparing the package.[/]") <del> # Returns 1 in case of skipped package <del> sys.exit(1) <add> if not skip_tag_check: <add> current_tag = get_current_tag(provider_package_id, version_suffix, git_update, verbose) <add> if tag_exists_for_version(provider_package_id, current_tag, verbose): <add> console.print(f"[yellow]The tag {current_tag} exists. Not preparing the package.[/]") <add> # Returns 1 in case of skipped package <add> sys.exit(1) <add> if update_setup_files(provider_package_id, version_suffix): <add> console.print(f"[green]Generated regular package setup files for {provider_package_id}[/]") <ide> else: <del> if update_setup_files( <del> provider_package_id, <del> version_suffix, <del> ): <del> console.print(f"[green]Generated regular package setup files for {provider_package_id}[/]") <del> else: <del> # Returns 64 in case of skipped package <del> sys.exit(64) <add> # Returns 64 in case of skipped package <add> sys.exit(64) <ide> <ide> <ide> def get_current_tag(provider_package_id: str, suffix: str, git_update: bool, verbose: bool): <ide> def verify_setup_py_prepared(provider_package): <ide> @option_version_suffix <ide> @argument_package_id <ide> @option_verbose <add>@option_skip_tag_check <ide> def build_provider_packages( <ide> package_format: str, <ide> git_update: bool, <ide> version_suffix: str, <ide> package_id: str, <ide> verbose: bool, <add> skip_tag_check: bool, <ide> ): <ide> """ <ide> Builds provider package. <ide> def build_provider_packages( <ide> try: <ide> provider_package_id = package_id <ide> with with_group(f"Prepare provider package for '{provider_package_id}'"): <del> if version_suffix.startswith("rc") or version_suffix == "": <add> if not skip_tag_check and (version_suffix.startswith("rc") or version_suffix == ""): <ide> # For RC and official releases we check if the "officially released" version exists <ide> # and skip the released if it was. This allows to skip packages that have not been <ide> # marked for release. For "dev" suffixes, we always build all packages <ide> released_tag = get_current_tag(provider_package_id, "", git_update, verbose) <ide> if tag_exists_for_version(provider_package_id, released_tag, verbose): <ide> console.print(f"[yellow]The tag {released_tag} exists. Skipping the package.[/]") <ide> return False <del> console.print(f"Changing directory to ${TARGET_PROVIDER_PACKAGES_PATH}") <add> console.print(f"Changing directory to {TARGET_PROVIDER_PACKAGES_PATH}") <ide> os.chdir(TARGET_PROVIDER_PACKAGES_PATH) <ide> cleanup_remnants(verbose) <ide> provider_package = package_id
1
Text
Text
add dunnhumby to inthewild.md
45a49e0f81cc592a4e6a95aa230560530d88a5c8
<ide><path>INTHEWILD.md <ide> Currently, **officially** using Airflow: <ide> 1. [Dotmodus](http://dotmodus.com) [[@dannylee12](https://github.com/dannylee12)] <ide> 1. [Drivy](https://www.drivy.com) [[@AntoineAugusti](https://github.com/AntoineAugusti)] <ide> 1. [Dropbox](https://www.dropbox.com) [[@AlexeySanko](https://github.com/AlexeySanko)] <add>1. [Dunnhumby](https://www.dunnhumby.com) <ide> 1. [Dynata](https://www.dynata.com) [[@neil3handari](https://github.com/neil3handari)] <ide> 1. [Easy Taxi](http://www.easytaxi.com/) [[@caique-lima](https://github.com/caique-lima) & [@diraol](https://github.com/diraol)] <ide> 1. [EBANX](https://www.ebanx.com/) [[@estevammr](https://github.com/estevammr) & [@nathangngencissk](https://github.com/nathangngencissk) & [@raafaadg](https://github.com/raafaadg) & [@whrocha](https://github.com/whrocha)]
1
Javascript
Javascript
move ember.typeof to metal
93ccb694a2668fbcc0e82e5cc398cc7975612763
<ide><path>packages/ember-metal/lib/utils.js <ide> require('ember-metal/core'); <ide> require('ember-metal/platform'); <add>require('ember-metal/array'); <ide> <ide> /** <ide> @module ember-metal <ide> if (needsFinallyFix) { <ide> return (finalResult === undefined) ? result : finalResult; <ide> }; <ide> } <add> <add>// ........................................ <add>// TYPING & ARRAY MESSAGING <add>// <add> <add>var TYPE_MAP = {}; <add>var t = "Boolean Number String Function Array Date RegExp Object".split(" "); <add>Ember.ArrayPolyfills.forEach.call(t, function(name) { <add> TYPE_MAP[ "[object " + name + "]" ] = name.toLowerCase(); <add>}); <add> <add>var toString = Object.prototype.toString; <add> <add>/** <add> Returns a consistent type for the passed item. <add> <add> Use this instead of the built-in `typeof` to get the type of an item. <add> It will return the same result across all browsers and includes a bit <add> more detail. Here is what will be returned: <add> <add> | Return Value | Meaning | <add> |---------------|------------------------------------------------------| <add> | 'string' | String primitive | <add> | 'number' | Number primitive | <add> | 'boolean' | Boolean primitive | <add> | 'null' | Null value | <add> | 'undefined' | Undefined value | <add> | 'function' | A function | <add> | 'array' | An instance of Array | <add> | 'class' | An Ember class (created using Ember.Object.extend()) | <add> | 'instance' | An Ember object instance | <add> | 'error' | An instance of the Error object | <add> | 'object' | A JavaScript object not inheriting from Ember.Object | <add> <add> Examples: <add> <add> ```javascript <add> Ember.typeOf(); // 'undefined' <add> Ember.typeOf(null); // 'null' <add> Ember.typeOf(undefined); // 'undefined' <add> Ember.typeOf('michael'); // 'string' <add> Ember.typeOf(101); // 'number' <add> Ember.typeOf(true); // 'boolean' <add> Ember.typeOf(Ember.makeArray); // 'function' <add> Ember.typeOf([1,2,90]); // 'array' <add> Ember.typeOf(Ember.Object.extend()); // 'class' <add> Ember.typeOf(Ember.Object.create()); // 'instance' <add> Ember.typeOf(new Error('teamocil')); // 'error' <add> <add> // "normal" JavaScript object <add> Ember.typeOf({a: 'b'}); // 'object' <add> ``` <add> <add> @method typeOf <add> @for Ember <add> @param {Object} item the item to check <add> @return {String} the type <add>*/ <add>Ember.typeOf = function(item) { <add> var ret; <add> <add> ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object'; <add> <add> if (ret === 'function') { <add> if (Ember.Object && Ember.Object.detect(item)) ret = 'class'; <add> } else if (ret === 'object') { <add> if (item instanceof Error) ret = 'error'; <add> else if (Ember.Object && item instanceof Ember.Object) ret = 'instance'; <add> else ret = 'object'; <add> } <add> <add> return ret; <add>}; <ide>\ No newline at end of file <ide><path>packages/ember-metal/lib/watch_key.js <ide> require('ember-metal/utils'); <ide> require('ember-metal/platform'); <ide> <ide> var metaFor = Ember.meta, // utils.js <del> typeOf = Ember.typeOf, // FIXME: defined in runtime <add> typeOf = Ember.typeOf, // utils.js <ide> MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER, <ide> o_defineProperty = Ember.platform.defineProperty; <ide> <ide><path>packages/ember-metal/lib/watch_path.js <ide> require('ember-metal/utils'); <ide> require('ember-metal/chains'); <ide> <del>var metaFor = Ember.meta, <del> typeOf = Ember.typeOf, // FIXME: defined in runtime <add>var metaFor = Ember.meta, // utils.js <add> typeOf = Ember.typeOf, // utils.js <ide> ChainNode = Ember._ChainNode; // chains.js <ide> <ide> // get the chains for the current object. If the current object has <ide><path>packages/ember-metal/lib/watching.js <ide> var metaFor = Ember.meta, // utils.js <ide> unwatchKey = Ember.unwatchKey, <ide> watchPath = Ember.watchPath, // watch_path.js <ide> unwatchPath = Ember.unwatchPath, <del> typeOf = Ember.typeOf, // FIXME: defined in runtime <add> typeOf = Ember.typeOf, // utils.js <ide> generateGuid = Ember.generateGuid, <ide> IS_PATH = /[\.\*]/; <ide> <ide><path>packages/ember-runtime/lib/core.js <ide> require('ember-metal'); <ide> <ide> var indexOf = Ember.EnumerableUtils.indexOf; <ide> <del>// ........................................ <del>// TYPING & ARRAY MESSAGING <del>// <del> <del>var TYPE_MAP = {}; <del>var t = "Boolean Number String Function Array Date RegExp Object".split(" "); <del>Ember.ArrayPolyfills.forEach.call(t, function(name) { <del> TYPE_MAP[ "[object " + name + "]" ] = name.toLowerCase(); <del>}); <del> <del>var toString = Object.prototype.toString; <del> <del>/** <del> Returns a consistent type for the passed item. <del> <del> Use this instead of the built-in `typeof` to get the type of an item. <del> It will return the same result across all browsers and includes a bit <del> more detail. Here is what will be returned: <del> <del> | Return Value | Meaning | <del> |---------------|------------------------------------------------------| <del> | 'string' | String primitive | <del> | 'number' | Number primitive | <del> | 'boolean' | Boolean primitive | <del> | 'null' | Null value | <del> | 'undefined' | Undefined value | <del> | 'function' | A function | <del> | 'array' | An instance of Array | <del> | 'class' | An Ember class (created using Ember.Object.extend()) | <del> | 'instance' | An Ember object instance | <del> | 'error' | An instance of the Error object | <del> | 'object' | A JavaScript object not inheriting from Ember.Object | <del> <del> Examples: <del> <del> ```javascript <del> Ember.typeOf(); // 'undefined' <del> Ember.typeOf(null); // 'null' <del> Ember.typeOf(undefined); // 'undefined' <del> Ember.typeOf('michael'); // 'string' <del> Ember.typeOf(101); // 'number' <del> Ember.typeOf(true); // 'boolean' <del> Ember.typeOf(Ember.makeArray); // 'function' <del> Ember.typeOf([1,2,90]); // 'array' <del> Ember.typeOf(Ember.Object.extend()); // 'class' <del> Ember.typeOf(Ember.Object.create()); // 'instance' <del> Ember.typeOf(new Error('teamocil')); // 'error' <del> <del> // "normal" JavaScript object <del> Ember.typeOf({a: 'b'}); // 'object' <del> ``` <del> <del> @method typeOf <del> @for Ember <del> @param {Object} item the item to check <del> @return {String} the type <del>*/ <del>Ember.typeOf = function(item) { <del> var ret; <del> <del> ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object'; <del> <del> if (ret === 'function') { <del> if (Ember.Object && Ember.Object.detect(item)) ret = 'class'; <del> } else if (ret === 'object') { <del> if (item instanceof Error) ret = 'error'; <del> else if (Ember.Object && item instanceof Ember.Object) ret = 'instance'; <del> else ret = 'object'; <del> } <del> <del> return ret; <del>}; <del> <ide> /** <ide> This will compare two javascript values of possibly different types. <ide> It will tell you which one is greater than the other by returning:
5
Mixed
Javascript
add labeloffset option to scales
7ee5af81af59e66a2f6e11c04cdb054c8cef934e
<ide><path>docs/01-Scales.md <ide> afterUpdate | Function | undefined | Callback that runs at the end of the update <ide> *gridLines*.zeroLineColor | Color | "rgba(0, 0, 0, 0.25)" | Stroke color of the grid line for the first index (index 0). <ide> *gridLines*.offsetGridLines | Boolean | false | If true, offset labels from grid lines. <ide> **scaleLabel** | Object | | Title for the entire axis. <del>*scaleLabel*.display | Boolean | false | <add>*scaleLabel*.display | Boolean | false | <ide> *scaleLabel*.labelString | String | "" | The text for the title. (i.e. "# of People", "Response Choices") <ide> *scaleLabel*.fontColor | Color | "#666" | Font color for the scale title. <ide> *scaleLabel*.fontFamily| String | "Helvetica Neue" | Font family for the scale title, follows CSS font-family options. <ide> afterUpdate | Function | undefined | Callback that runs at the end of the update <ide> *ticks*.minRotation | Number | 20 | *currently not-implemented* Minimum rotation for tick labels when condensing is necessary. *Note: Only applicable to horizontal scales.* <ide> *ticks*.maxTicksLimit | Number | 11 | Maximum number of ticks and gridlines to show. If not defined, it will limit to 11 ticks but will show all gridlines. <ide> *ticks*.padding | Number | 10 | Padding between the tick label and the axis. *Note: Only applicable to horizontal scales.* <add>*ticks*.labelOffset | Number | 0 | Distance in pixels to offset the label from the centre point of the tick (in the y direction for the x axis, and the x direction for the y axis). *Note: this can cause labels at the edges to be cropped by the edge of the canvas* <ide> *ticks*.mirror | Boolean | false | Flips tick labels around axis, displaying the labels inside the chart instead of outside. *Note: Only applicable to vertical scales.* <ide> *ticks*.reverse | Boolean | false | Reverses order of tick labels. <ide> *ticks*.display | Boolean | true | If true, show the ticks. <ide> *ticks*.suggestedMin | Number | - | User defined minimum number for the scale, overrides minimum value *except for if* it is higher than the minimum value. <ide> *ticks*.suggestedMax | Number | - | User defined maximum number for the scale, overrides maximum value *except for if* it is lower than the maximum value. <del>*ticks*.min | Number | - | User defined minimum number for the scale, overrides minimum value. <add>*ticks*.min | Number | - | User defined minimum number for the scale, overrides minimum value. <ide> *ticks*.max | Number | - | User defined minimum number for the scale, overrides maximum value <ide> *ticks*.autoSkip | Boolean | true | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what <ide> *ticks*.callback | Function | `function(value) { return '' + value; } ` | Returns the string representation of the tick value as it should be displayed on the chart. <ide> The time scale extends the core scale class with the following tick template: <ide> <ide> // string - By default, no rounding is applied. To round, set to a supported time unit eg. 'week', 'month', 'year', etc. <ide> round: false, <del> <add> <ide> // Moment js for each of the units. Replaces `displayFormat` <ide> // To override, use a pattern string from http://momentjs.com/docs/#/displaying/format/ <ide> displayFormats: { <ide> Chart.scaleService.updateScaleDefaults('linear', { <ide> min: 0 <ide> } <ide> }) <del>``` <ide>\ No newline at end of file <add>``` <ide><path>src/core/core.scale.js <ide> module.exports = function(Chart) { <ide> display: true, <ide> autoSkip: true, <ide> autoSkipPadding: 0, <add> labelOffset: 0, <ide> callback: function(value) { <ide> return '' + value; <ide> } <ide> module.exports = function(Chart) { <ide> <ide> if (this.options.ticks.display) { <ide> this.ctx.save(); <del> this.ctx.translate(xLabelValue, (isRotated) ? this.top + 12 : this.options.position === "top" ? this.bottom - tl : this.top + tl); <add> this.ctx.translate(xLabelValue + this.options.ticks.labelOffset, (isRotated) ? this.top + 12 : this.options.position === "top" ? this.bottom - tl : this.top + tl); <ide> this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1); <ide> this.ctx.font = tickLabelFont; <ide> this.ctx.textAlign = (isRotated) ? "right" : "center"; <ide> module.exports = function(Chart) { <ide> } <ide> } <ide> <del> this.ctx.translate(xLabelValue, yLabelValue); <add> this.ctx.translate(xLabelValue, yLabelValue + this.options.ticks.labelOffset); <ide> this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1); <ide> this.ctx.font = tickLabelFont; <ide> this.ctx.textBaseline = "middle"; <ide><path>test/core.helpers.tests.js <ide> describe('Core helper tests', function() { <ide> display: true, <ide> callback: merged.scales.yAxes[1].ticks.callback, // make it nicer, then check explicitly below <ide> autoSkip: true, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0, <ide> }, <ide> type: 'linear' <ide> }, { <ide> describe('Core helper tests', function() { <ide> display: true, <ide> callback: merged.scales.yAxes[2].ticks.callback, // make it nicer, then check explicitly below <ide> autoSkip: true, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0, <ide> }, <ide> type: 'linear' <ide> }] <ide><path>test/scale.category.tests.js <ide> describe('Category scale tests', function() { <ide> display: true, <ide> callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below <ide> autoSkip: true, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0 <ide> } <ide> }); <ide> <ide><path>test/scale.linear.tests.js <ide> describe('Linear Scale', function() { <ide> display: true, <ide> callback: defaultConfig.ticks.callback, // make this work nicer, then check below <ide> autoSkip: true, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0 <ide> } <ide> }); <ide> <ide><path>test/scale.logarithmic.tests.js <ide> describe('Logarithmic Scale tests', function() { <ide> display: true, <ide> callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below <ide> autoSkip: true, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0 <ide> }, <ide> }); <ide> <ide><path>test/scale.radialLinear.tests.js <ide> describe('Test the radial linear scale', function() { <ide> display: true, <ide> callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below <ide> autoSkip: true, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0 <ide> }, <ide> }); <ide> <ide><path>test/scale.time.tests.js <ide> describe('Time scale tests', function() { <ide> display: true, <ide> callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below, <ide> autoSkip: false, <del> autoSkipPadding: 0 <add> autoSkipPadding: 0, <add> labelOffset: 0 <ide> }, <ide> time: { <ide> parser: false,
8
Ruby
Ruby
use the correct route method
d6621cc2659127217c3c4a128f1ba76cf5c231e8
<ide><path>lib/templates/mailboxes/application_mailbox.rb <ide> # frozen_string_literal: true <ide> <ide> class ApplicationMailbox < ActionMailbox::Base <del> # route /something/i => :somewhere <add> # routing /something/i => :somewhere <ide> end
1
Javascript
Javascript
remove unused variable
1b05d7bc86d30d47d021cc37476fb0131490a74b
<ide><path>lib/timers.js <ide> TimerWrap.prototype[kOnTimeout] = function listOnTimeout(now) { <ide> continue; <ide> } <ide> <del> tryOnTimeout(timer, list); <add> tryOnTimeout(timer); <ide> } <ide> <ide> // If `L.peek(list)` returned nothing, the list was either empty or we have <ide> TimerWrap.prototype[kOnTimeout] = function listOnTimeout(now) { <ide> <ide> // An optimization so that the try/finally only de-optimizes (since at least v8 <ide> // 4.7) what is in this smaller function. <del>function tryOnTimeout(timer, list) { <add>function tryOnTimeout(timer) { <ide> timer._called = true; <ide> const timerAsyncId = (typeof timer[async_id_symbol] === 'number') ? <ide> timer[async_id_symbol] : null;
1
Text
Text
remove status column from client libraries page
896fbb470a5fa118039ccbd30c3bffdcc6c461ff
<ide><path>docs/reference/api/remote_api_client_libraries.md <ide> with the library maintainers. <ide> <ide> <table border="1" class="docutils"> <ide> <colgroup> <del> <col width="24%"> <del> <col width="17%"> <add> <col width="29%"> <add> <col width="23%"> <ide> <col width="48%"> <del> <col width="11%"> <ide> </colgroup> <ide> <thead valign="bottom"> <ide> <tr> <ide> <th class="head">Language/Framework</th> <ide> <th class="head">Name</th> <ide> <th class="head">Repository</th> <del> <th class="head">Status</th> <ide> </tr> <ide> </thead> <ide> <tbody valign = "top"> <ide> <tr> <ide> <td>C#</td> <ide> <td>Docker.DotNet</td> <ide> <td><a class="reference external" href="https://github.com/ahmetalpbalkan/Docker.DotNet">https://github.com/ahmetalpbalkan/Docker.DotNet</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>C++</td> <ide> <td>lasote/docker_client</td> <ide> <td><a class="reference external" href="https://github.com/lasote/docker_client">https://github.com/lasote/docker_client</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Erlang</td> <ide> <td>erldocker</td> <ide> <td><a class="reference external" href="https://github.com/proger/erldocker">https://github.com/proger/erldocker</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Dart</td> <ide> <td>bwu_docker</td> <ide> <td><a class="reference external" href="https://github.com/bwu-dart/bwu_docker">https://github.com/bwu-dart/bwu_docker</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Go</td> <ide> <td>engine-api</td> <ide> <td><a class="reference external" href="https://github.com/docker/engine-api">https://github.com/docker/engine-api</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Gradle</td> <ide> <td>gradle-docker-plugin</td> <ide> <td><a class="reference external" href="https://github.com/gesellix/gradle-docker-plugin">https://github.com/gesellix/gradle-docker-plugin</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Groovy</td> <ide> <td>docker-client</td> <ide> <td><a class="reference external" href="https://github.com/gesellix/docker-client">https://github.com/gesellix/docker-client</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Haskell</td> <ide> <td>docker-hs</td> <ide> <td><a class="reference external" href="https://github.com/denibertovic/docker-hs">https://github.com/denibertovic/docker-hs</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>HTML (Web Components)</td> <ide> <td>docker-elements</td> <ide> <td><a class="reference external" href="https://github.com/kapalhq/docker-elements">https://github.com/kapalhq/docker-elements</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Java</td> <ide> <td>docker-java</td> <ide> <td><a class="reference external" href="https://github.com/docker-java/docker-java">https://github.com/docker-java/docker-java</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Java</td> <ide> <td>docker-client</td> <ide> <td><a class="reference external" href="https://github.com/spotify/docker-client">https://github.com/spotify/docker-client</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>NodeJS</td> <ide> <td>dockerode</td> <del> <td><a class="reference external" href="https://github.com/apocas/dockerode">https://github.com/apocas/dockerode</a> <del> Install via NPM: <cite>npm install dockerode</cite></td> <del> <td>Active</td> <add> <td><a class="reference external" href="https://github.com/apocas/dockerode">https://github.com/apocas/dockerode</a></td> <ide> </tr> <ide> <tr> <ide> <td>Perl</td> <ide> <td>Eixo::Docker</td> <ide> <td><a class="reference external" href="https://github.com/alambike/eixo-docker">https://github.com/alambike/eixo-docker</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>PHP</td> <ide> <td>Docker-PHP</td> <ide> <td><a class="reference external" href="https://github.com/docker-php/docker-php">https://github.com/docker-php/docker-php</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Python</td> <ide> <td>docker-py</td> <ide> <td><a class="reference external" href="https://github.com/docker/docker-py">https://github.com/docker/docker-py</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Ruby</td> <ide> <td>docker-api</td> <ide> <td><a class="reference external" href="https://github.com/swipely/docker-api">https://github.com/swipely/docker-api</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Rust</td> <ide> <td>docker-rust</td> <ide> <td><a class="reference external" href="https://github.com/abh1nav/docker-rust">https://github.com/abh1nav/docker-rust</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Rust</td> <ide> <td>shiplift</td> <ide> <td><a class="reference external" href="https://github.com/softprops/shiplift">https://github.com/softprops/shiplift</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Scala</td> <ide> <td>tugboat</td> <ide> <td><a class="reference external" href="https://github.com/softprops/tugboat">https://github.com/softprops/tugboat</a></td> <del> <td>Active</td> <ide> </tr> <ide> <tr> <ide> <td>Scala</td> <ide> <td>reactive-docker</td> <ide> <td><a class="reference external" href="https://github.com/almoehi/reactive-docker">https://github.com/almoehi/reactive-docker</a></td> <del> <td>Active</td> <ide> </tr> <ide> </tbody> <ide> </table>
1