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
Javascript
Javascript
remove color reset in error message
57f4b67316d901efe8fe3a267fbb037c5ac2ffb8
<ide><path>lib/EnvironmentPlugin.js <ide> EnvironmentPlugin.prototype.apply = function(compiler) { <ide> if(value === undefined) { <ide> compiler.plugin("this-compilation", function(compilation) { <ide> var error = new Error( <del> 'EnvironmentPlugin - ' + key + ' environment variable is undefined. \033[0m\n\n' + <add> 'EnvironmentPlugin - ' + key + ' environment variable is undefined. \n\n' + <ide> 'You can pass an object with default values to suppress this warning. \n' + <ide> 'See http://webpack.github.io/docs/list-of-plugins.html#environmentplugin for example.' <ide> );
1
Ruby
Ruby
add support for npm 7
35a7e336bef8b972495ef135571feceb46c3c57c
<ide><path>Library/Homebrew/language/node.rb <ide> def self.std_npm_install_args(libexec) <ide> <ide> pack = pack_for_installation <ide> <add> # npm 7 requires that these dirs exist before install <add> (libexec/"lib").mkpath <add> <ide> # npm install args for global style module format installed into libexec <ide> args = %W[ <ide> -ddd <ide><path>Library/Homebrew/test/language/node_spec.rb <ide> end <ide> <ide> describe "#std_npm_install_args" do <del> npm_install_arg = "libexec" <add> npm_install_arg = Pathname("libexec") <ide> npm_pack_cmd = "npm pack --ignore-scripts" <ide> <ide> it "raises error with non zero exitstatus" do
2
Javascript
Javascript
fix backwards compat shim for custom ast plugins
eeecb9b2c88fb5ec7943bae52950c1e2fa439b42
<ide><path>packages/ember-template-compiler/lib/index.js <ide> export { default as precompile } from './system/precompile'; <ide> export { default as compile } from './system/compile'; <ide> export { <ide> default as compileOptions, <del> registerPlugin <add> registerPlugin, <add> unregisterPlugin <ide> } from './system/compile-options'; <ide> export { default as defaultPlugins } from './plugins'; <ide> <ide><path>packages/ember-template-compiler/lib/system/compile-options.js <ide> export default function compileOptions(_options) { <ide> options.plugins = { ast: [...USER_PLUGINS, ...PLUGINS] }; <ide> } else { <ide> let potententialPugins = [...USER_PLUGINS, ...PLUGINS]; <add> let providedPlugins = options.plugins.ast.map(plugin => wrapLegacyPluginIfNeeded(plugin)); <ide> let pluginsToAdd = potententialPugins.filter((plugin) => { <ide> return options.plugins.ast.indexOf(plugin) === -1; <ide> }); <del> options.plugins.ast = options.plugins.ast.slice().concat(pluginsToAdd); <add> options.plugins.ast = providedPlugins.concat(pluginsToAdd); <ide> } <ide> <ide> return options; <ide> } <ide> <del>export function registerPlugin(type, _plugin) { <del> if (type !== 'ast') { <del> throw new Error(`Attempting to register ${_plugin} as "${type}" which is not a valid Glimmer plugin type.`); <del> } <del> <del> let plugin; <add>function wrapLegacyPluginIfNeeded(_plugin) { <add> let plugin = _plugin; <ide> if (_plugin.prototype && _plugin.prototype.transform) { <ide> plugin = (env) => { <ide> return { <ide> name: _plugin.constructor && _plugin.constructor.name, <ide> <del> visitors: { <add> visitor: { <ide> Program(node) { <ide> let plugin = new _plugin(env); <ide> <ide> export function registerPlugin(type, _plugin) { <ide> return plugin.transform(node); <ide> } <ide> } <del> }; <add> }; <ide> }; <del> } else { <del> plugin = _plugin; <ide> } <ide> <add> return plugin; <add>} <add> <add>export function registerPlugin(type, _plugin) { <add> if (type !== 'ast') { <add> throw new Error(`Attempting to register ${_plugin} as "${type}" which is not a valid Glimmer plugin type.`); <add> } <add> <add> let plugin = wrapLegacyPluginIfNeeded(_plugin); <add> <ide> USER_PLUGINS = [plugin, ...USER_PLUGINS]; <ide> } <ide> <del>export function removePlugin(type, PluginClass) { <add>export function unregisterPlugin(type, PluginClass) { <ide> if (type !== 'ast') { <ide> throw new Error(`Attempting to unregister ${PluginClass} as "${type}" which is not a valid Glimmer plugin type.`); <ide> } <ide><path>packages/ember-template-compiler/tests/system/compile_options_test.js <del>import { compileOptions } from '../../index'; <del>import { defaultPlugins } from '../../index'; <del>import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; <add>import { compile, compileOptions, defaultPlugins, registerPlugin, unregisterPlugin } from '../../index'; <add>import { moduleFor, AbstractTestCase, RenderingTestCase } from 'internal-test-helpers'; <ide> <ide> moduleFor('ember-template-compiler: default compile options', class extends AbstractTestCase { <ide> ['@test default options are a new copy'](assert) { <ide> moduleFor('ember-template-compiler: default compile options', class extends Abst <ide> } <ide> } <ide> }); <add> <add>class CustomTransform { <add> constructor(options) { <add> this.options = options; <add> this.syntax = null; <add> } <add> <add> transform(ast) { <add> let walker = new this.syntax.Walker(); <add> <add> walker.visit(ast, node => { <add> if (node.type !== 'ElementNode') { <add> return; <add> } <add> <add> for (var i = 0; i < node.attributes.length; i++) { <add> let attribute = node.attributes[i]; <add> <add> if (attribute.name === 'data-test') { <add> node.attributes.splice(i, 1); <add> } <add> } <add> }); <add> <add> return ast; <add> } <add>} <add> <add>moduleFor('ember-template-compiler: registerPlugin with a custom plugins', class extends RenderingTestCase { <add> beforeEach() { <add> registerPlugin('ast', CustomTransform); <add> } <add> <add> afterEach() { <add> unregisterPlugin('ast', CustomTransform); <add> } <add> <add> ['@test custom plugins can be used']() { <add> this.render('<div data-test="foo" data-blah="derp" class="hahaha"></div>'); <add> this.assertElement(this.firstChild, { <add> tagName: 'div', <add> attrs: { class: 'hahaha', 'data-blah': 'derp' }, <add> content: '' <add> }); <add> } <add>}); <add> <add>moduleFor('ember-template-compiler: custom plugins passed to compile', class extends RenderingTestCase { <add> // override so that we can provide custom AST plugins to compile <add> compile(templateString) { <add> return compile(templateString, { <add> plugins: { <add> ast: [CustomTransform] <add> } <add> }); <add> } <add> <add> ['@test custom plugins can be used']() { <add> this.render('<div data-test="foo" data-blah="derp" class="hahaha"></div>'); <add> this.assertElement(this.firstChild, { <add> tagName: 'div', <add> attrs: { class: 'hahaha', 'data-blah': 'derp' }, <add> content: '' <add> }); <add> } <add>});
3
Javascript
Javascript
add stages for cache plugins
39c75ee6a979ee8993f7ad64484136d0b858b4f2
<ide><path>lib/Cache.js <ide> class Cache { <ide> } <ide> } <ide> <add>Cache.STAGE_MEMORY = -10; <add>Cache.STAGE_DEFAULT = 0; <add>Cache.STAGE_DISK = 10; <add>Cache.STAGE_NETWORK = 20; <add> <ide> module.exports = Cache; <ide><path>lib/cache/BackgroundFileCachePlugin.js <ide> <ide> "use strict"; <ide> <add>const Cache = require("../Cache"); <add> <ide> /** @typedef {import("../Compiler")} Compiler */ <ide> <ide> class BackgroundFileCachePlugin { <ide> class BackgroundFileCachePlugin { <ide> const pending = new Set(); <ide> <ide> compiler.cache.hooks.store.tap( <del> "BackgroundFileCachePlugin", <add> { name: "BackgroundFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> (identifier, etag, data) => { <ide> const promise = strategy.store(identifier, etag, data); <ide> pending.add(promise); <ide> class BackgroundFileCachePlugin { <ide> ); <ide> <ide> compiler.cache.hooks.get.tapPromise( <del> "BackgroundFileCachePlugin", <add> { name: "BackgroundFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> (identifier, etag, gotHandlers) => { <ide> return strategy.restore(identifier, etag).then(cacheEntry => { <ide> if (cacheEntry === undefined) { <ide> class BackgroundFileCachePlugin { <ide> let storing = Promise.resolve(); <ide> <ide> compiler.cache.hooks.shutdown.tapPromise( <del> "BackgroundFileCachePlugin", <add> { name: "BackgroundFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> () => { <ide> return (storing = storing.then(() => { <ide> const promise = Promise.all(Array.from(pending)).then(() => <ide> class BackgroundFileCachePlugin { <ide> } <ide> ); <ide> <del> compiler.cache.hooks.beginIdle.tap("BackgroundFileCachePlugin", () => { <del> storing = storing.then(() => { <del> const promise = Promise.all(Array.from(pending)).then(() => <del> strategy.afterAllStored() <del> ); <del> pending.clear(); <del> return promise; <del> }); <del> }); <add> compiler.cache.hooks.beginIdle.tap( <add> { name: "BackgroundFileCachePlugin", stage: Cache.STAGE_DISK }, <add> () => { <add> storing = storing.then(() => { <add> const promise = Promise.all(Array.from(pending)).then(() => <add> strategy.afterAllStored() <add> ); <add> pending.clear(); <add> return promise; <add> }); <add> } <add> ); <ide> } <ide> } <ide> <ide><path>lib/cache/IdleFileCachePlugin.js <ide> <ide> "use strict"; <ide> <add>const Cache = require("../Cache"); <add> <ide> /** @typedef {import("../Compiler")} Compiler */ <ide> <ide> class IdleFileCachePlugin { <ide> class IdleFileCachePlugin { <ide> const pendingIdleTasks = new Map(); <ide> <ide> compiler.cache.hooks.store.tap( <del> "IdleFileCachePlugin", <add> { name: "IdleFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> (identifier, etag, data) => { <ide> pendingIdleTasks.set(identifier, () => <ide> strategy.store(identifier, etag, data) <ide> class IdleFileCachePlugin { <ide> ); <ide> <ide> compiler.cache.hooks.get.tapPromise( <del> "IdleFileCachePlugin", <add> { name: "IdleFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> (identifier, etag, gotHandlers) => { <ide> return strategy.restore(identifier, etag).then(cacheEntry => { <ide> if (cacheEntry === undefined) { <ide> class IdleFileCachePlugin { <ide> } <ide> ); <ide> <del> compiler.cache.hooks.shutdown.tapPromise("IdleFileCachePlugin", () => { <del> if (idleTimer) { <del> clearTimeout(idleTimer); <del> idleTimer = undefined; <add> compiler.cache.hooks.shutdown.tapPromise( <add> { name: "IdleFileCachePlugin", stage: Cache.STAGE_DISK }, <add> () => { <add> if (idleTimer) { <add> clearTimeout(idleTimer); <add> idleTimer = undefined; <add> } <add> isIdle = false; <add> const promises = Array.from(pendingIdleTasks.values()).map(fn => fn()); <add> pendingIdleTasks.clear(); <add> if (currentIdlePromise !== undefined) promises.push(currentIdlePromise); <add> let promise = Promise.all(promises); <add> return promise.then(() => strategy.afterAllStored()); <ide> } <del> isIdle = false; <del> const promises = Array.from(pendingIdleTasks.values()).map(fn => fn()); <del> pendingIdleTasks.clear(); <del> if (currentIdlePromise !== undefined) promises.push(currentIdlePromise); <del> let promise = Promise.all(promises); <del> return promise.then(() => strategy.afterAllStored()); <del> }); <add> ); <ide> <ide> let currentIdlePromise; <ide> let isIdle = false; <ide> class IdleFileCachePlugin { <ide> } <ide> }; <ide> let idleTimer = undefined; <del> compiler.cache.hooks.beginIdle.tap("IdleFileCachePlugin", () => { <del> idleTimer = setTimeout( <del> () => { <add> compiler.cache.hooks.beginIdle.tap( <add> { name: "IdleFileCachePlugin", stage: Cache.STAGE_DISK }, <add> () => { <add> idleTimer = setTimeout( <add> () => { <add> idleTimer = undefined; <add> isIdle = true; <add> resolvedPromise.then(processIdleTasks); <add> }, <add> isInitialStore ? idleTimeoutForInitialStore : idleTimeout <add> ); <add> idleTimer.unref(); <add> } <add> ); <add> compiler.cache.hooks.endIdle.tap( <add> { name: "IdleFileCachePlugin", stage: Cache.STAGE_DISK }, <add> () => { <add> if (idleTimer) { <add> clearTimeout(idleTimer); <ide> idleTimer = undefined; <del> isIdle = true; <del> resolvedPromise.then(processIdleTasks); <del> }, <del> isInitialStore ? idleTimeoutForInitialStore : idleTimeout <del> ); <del> idleTimer.unref(); <del> }); <del> compiler.cache.hooks.endIdle.tap("IdleFileCachePlugin", () => { <del> if (idleTimer) { <del> clearTimeout(idleTimer); <del> idleTimer = undefined; <add> } <add> isIdle = false; <ide> } <del> isIdle = false; <del> }); <add> ); <ide> } <ide> } <ide> <ide><path>lib/cache/InstantFileCachePlugin.js <ide> <ide> "use strict"; <ide> <add>const Cache = require("../Cache"); <add> <ide> /** @typedef {import("../Compiler")} Compiler */ <ide> <ide> class InstantFileCachePlugin { <ide> class InstantFileCachePlugin { <ide> const strategy = this.strategy; <ide> <ide> compiler.cache.hooks.store.tapPromise( <del> "InstantFileCachePlugin", <add> { name: "InstantFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> (identifier, etag, data) => { <ide> return strategy.store(identifier, etag, data); <ide> } <ide> ); <ide> <ide> compiler.cache.hooks.get.tapPromise( <del> "InstantFileCachePlugin", <add> { name: "InstantFileCachePlugin", stage: Cache.STAGE_DISK }, <ide> (identifier, etag, gotHandlers) => { <ide> return strategy.restore(identifier, etag).then(cacheEntry => { <ide> if (cacheEntry === undefined) { <ide> class InstantFileCachePlugin { <ide> <ide> let storing = Promise.resolve(); <ide> <del> compiler.cache.hooks.shutdown.tapPromise("InstantFileCachePlugin", () => { <del> return (storing = storing.then(() => strategy.afterAllStored())); <del> }); <add> compiler.cache.hooks.shutdown.tapPromise( <add> { name: "InstantFileCachePlugin", stage: Cache.STAGE_DISK }, <add> () => { <add> return (storing = storing.then(() => strategy.afterAllStored())); <add> } <add> ); <ide> <del> compiler.cache.hooks.beginIdle.tap("InstantFileCachePlugin", () => { <del> storing = storing.then(() => strategy.afterAllStored()); <del> }); <add> compiler.cache.hooks.beginIdle.tap( <add> { name: "InstantFileCachePlugin", stage: Cache.STAGE_DISK }, <add> () => { <add> storing = storing.then(() => strategy.afterAllStored()); <add> } <add> ); <ide> } <ide> } <ide> <ide><path>lib/cache/MemoryCachePlugin.js <ide> <ide> "use strict"; <ide> <add>const Cache = require("../Cache"); <add> <ide> /** @typedef {import("webpack-sources").Source} Source */ <ide> /** @typedef {import("../Compiler")} Compiler */ <ide> /** @typedef {import("../Module")} Module */ <ide> class MemoryCachePlugin { <ide> /** @type {Map<string, { etag: string, data: any }>} */ <ide> const cache = new Map(); <ide> compiler.cache.hooks.store.tap( <del> "MemoryCachePlugin", <add> { name: "MemoryCachePlugin", stage: Cache.STAGE_MEMORY }, <ide> (identifier, etag, data) => { <ide> cache.set(identifier, { etag, data }); <ide> } <ide> ); <ide> compiler.cache.hooks.get.tap( <del> "MemoryCachePlugin", <add> { name: "MemoryCachePlugin", stage: Cache.STAGE_MEMORY }, <ide> (identifier, etag, gotHandlers) => { <ide> const cacheEntry = cache.get(identifier); <ide> if (cacheEntry !== undefined && cacheEntry.etag === etag) { <ide><path>lib/index.js <ide> const exportPlugins = (obj, mappings) => { <ide> exportPlugins(exports, { <ide> AutomaticPrefetchPlugin: () => require("./AutomaticPrefetchPlugin"), <ide> BannerPlugin: () => require("./BannerPlugin"), <add> Cache: () => require("./Cache"), <ide> ContextExclusionPlugin: () => require("./ContextExclusionPlugin"), <ide> ContextReplacementPlugin: () => require("./ContextReplacementPlugin"), <ide> DefinePlugin: () => require("./DefinePlugin"),
6
Go
Go
fix journald compile error
5452954d89160985d4d896f4241f1838b4114413
<ide><path>daemon/logger/journald/journald_unsupported.go <ide> // +build !linux <ide> <ide> package journald <add> <add>type journald struct { <add>}
1
PHP
PHP
fix bug in array_pluck helper
cf29450b996515637534a3a8dee6577214c654f1
<ide><path>laravel/helpers.php <ide> function array_divide($array) <ide> */ <ide> function array_pluck($array, $key) <ide> { <del> return array_map(function($v) <add> return array_map(function($v) use ($key) <ide> { <ide> return is_object($v) ? $v->$key : $v[$key]; <ide>
1
Text
Text
add french translation
ff5d39ea9ebef3a6712fba62e65d7375e3568df0
<ide><path>threejs/lessons/fr/threejs-shadows.md <add>Title: Les ombres dans Three.js <add>Description: Les ombres dans Three.js <add>TOC: Shadows <add> <add>Cet article fait partie d'une série consacrée à Three.js. <add>Le premier article s'intitule [Principes de base](threejs-fundamentals.html). <add>Si vous ne l'avez pas encore lu, vous voudriez peut-être commencer par là. <add>L'[article précédent qui s'intéressait caméras](threejs-cameras.html) est à lire ainsi que [celui à propos des lumières](threejs-lights.html) avant d'entamer cet article-ci. <add> <add>Les ombres peuvent être un sujet compliqué. Il existe différentes solutions et toutes ont des compromis, y compris les solutions disponibles dans Three.js. <add> <add>Three.js, par défaut, utilise des *shadow maps*. Comment ça marche ? *pour chaque lumière qui projette des ombres, tous les objets marqués pour projeter des ombres sont rendus du point de vue de la lumière*. **RELISEZ ENCORE UNE FOIS** pour que ça soit bien clair pour vous. <add> <add>En d'autres termes, si vous avez 20 objets et 5 lumières, et que les 20 objets projettent des ombres et que les 5 lumières projettent des ombres, toute votre scène sera dessinée 6 fois. Les 20 objets seront dessinés pour la lumière #1, puis les 20 objets seront dessinés pour la lumière #2, puis #3, et ainsi de suite. Enfin la scène sera dessinée en utilisant les données des 5 premiers rendus. <add> <add>C'est pire, si vous avez une 'pointLight' projetant des ombres, la scène devra être dessinée 6 fois juste pour cette lumière ! <add> <add>Pour ces raisons, il est courant de trouver d'autres solutions que d'avoir un tas de lumières générant toutes des ombres. Une solution courante consiste à avoir plusieurs lumières mais une seule lumière directionnelle générant des ombres. <add> <add>Une autre solution consiste à utiliser des lightmaps et/ou des maps d'occlusion ambiante pour pré-calculer les effets de l'éclairage hors ligne. Cela se traduit par un éclairage statique ou des soupçons d'éclairage statique, mais au moins c'est rapide. Nous verrons cela dans un autre article. <add> <add>Une autre solution consiste à utiliser de fausses ombres. Créez un plan, placez une texture en niveaux de gris dans le plan qui se rapproche d'une ombre, dessinez-la au-dessus du sol sous votre objet. <add> <add>Par exemple, utilisons cette texture comme une fausse ombre. <add> <add><div class="threejs_center"><img src="../resources/images/roundshadow.png"></div> <add> <add>Utilisons une partie du code de [l'article précédent](threejs-cameras.html). <add> <add>Réglons la couleur de fond sur blanc. <add> <add>```js <add>const scene = new THREE.Scene(); <add>+scene.background = new THREE.Color('white'); <add>``` <add> <add>Ensuite, nous allons configurer le même sol en damier, mais cette fois, nous utilisons un [`MeshBasicMaterial`](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial) car nous n'avons pas besoin d'éclairage pour le sol. <add> <add>```js <add>+const loader = new THREE.TextureLoader(); <add> <add>{ <add> const planeSize = 40; <add> <add>- const loader = new THREE.TextureLoader(); <add> const texture = loader.load('resources/images/checker.png'); <add> texture.wrapS = THREE.RepeatWrapping; <add> texture.wrapT = THREE.RepeatWrapping; <add> texture.magFilter = THREE.NearestFilter; <add> const repeats = planeSize / 2; <add> texture.repeat.set(repeats, repeats); <add> <add> const planeGeo = new THREE.PlaneGeometry(planeSize, planeSize); <add> const planeMat = new THREE.MeshBasicMaterial({ <add> map: texture, <add> side: THREE.DoubleSide, <add> }); <add>+ planeMat.color.setRGB(1.5, 1.5, 1.5); <add> const mesh = new THREE.Mesh(planeGeo, planeMat); <add> mesh.rotation.x = Math.PI * -.5; <add> scene.add(mesh); <add>} <add>``` <add> <add>Notez que nous définissons la couleur sur `1.5, 1.5, 1.5`. Cela multipliera les couleurs de la texture du damier par 1,5, 1,5, 1,5. Puisque les couleurs de la texture sont 0x808080 et 0xC0C0C0, c'est-à-dire gris moyen et gris clair, les multiplier par 1,5 nous donnera un damier blanc et gris clair. <add> <add>Chargeons la texture de l'ombre <add> <add>```js <add>const shadowTexture = loader.load('resources/images/roundshadow.png'); <add>``` <add> <add>et créons un tableau pour mémoriser chaque sphère et les objets associés. <add> <add>```js <add>const sphereShadowBases = []; <add>``` <add> <add>Ensuite, créons une sphère. <add> <add>```js <add>const sphereRadius = 1; <add>const sphereWidthDivisions = 32; <add>const sphereHeightDivisions = 16; <add>const sphereGeo = new THREE.SphereGeometry(sphereRadius, sphereWidthDivisions, sphereHeightDivisions); <add>``` <add> <add>Et un plan pour simuler l'ombre. <add> <add>```js <add>const planeSize = 1; <add>const shadowGeo = new THREE.PlaneGeometry(planeSize, planeSize); <add>``` <add> <add>Maintenant, nous allons faire un tas de sphères. Pour chaque sphère, nous allons créer une `base` `THREE.Object3D` et nous allons créer à la fois le maillage du plan d'ombre et le maillage de la sphère enfants de la base. De cette façon, si nous déplaçons la base, la sphère et l'ombre bougeront. Nous devons placer l'ombre légèrement au-dessus du sol pour éviter les combats en Z. Nous définissons également `depthWrite` sur false pour que les ombres ne se gâchent pas. Nous reviendrons sur ces deux problèmes dans un [autre article](threejs-transparency.html). L'ombre est un `MeshBasicMaterial` car elle n'a pas besoin d'éclairage. <add> <add>Nous donnons à chaque sphère une teinte différente, puis nous enregistrons la base, le maillage de la sphère, le maillage de l'ombre et la position y initiale de chaque sphère. <add> <add>```js <add>const numSpheres = 15; <add>for (let i = 0; i < numSpheres; ++i) { <add> // créer une base pour l'ombre et la sphère <add> // donc ils bougent ensemble. <add> const base = new THREE.Object3D(); <add> scene.add(base); <add> <add> // ajoute l'ombre à la base <add> // remarque : nous fabriquons un nouveau matériau pour chaque sphère <add> // afin que nous puissions définir la transparence matérielle de cette sphère <add> // séparément. <add> const shadowMat = new THREE.MeshBasicMaterial({ <add> map: shadowTexture, <add> transparent: true, // pour que nous puissions voir le sol <add> depthWrite: false, // donc nous n'avons pas à trier <add> }); <add> const shadowMesh = new THREE.Mesh(shadowGeo, shadowMat); <add> shadowMesh.position.y = 0.001; // donc nous sommes légèrement au-dessus du sol <add> shadowMesh.rotation.x = Math.PI * -.5; <add> const shadowSize = sphereRadius * 4; <add> shadowMesh.scale.set(shadowSize, shadowSize, shadowSize); <add> base.add(shadowMesh); <add> <add> // ajouter la sphère à la base <add> const u = i / numSpheres; // passe de 0 à 1 au fur et à mesure que nous itérons les sphères. <add> const sphereMat = new THREE.MeshPhongMaterial(); <add> sphereMat.color.setHSL(u, 1, .75); <add> const sphereMesh = new THREE.Mesh(sphereGeo, sphereMat); <add> sphereMesh.position.set(0, sphereRadius + 2, 0); <add> base.add(sphereMesh); <add> <add> // rappelez-vous tous les 3 plus la position y <add> sphereShadowBases.push({base, sphereMesh, shadowMesh, y: sphereMesh.position.y}); <add>} <add>``` <add> <add>Nous avons installé 2 lumières. L'un est un [`HemisphereLight`](https://threejs.org/docs/#api/en/lights/HemisphereLight) avec une intensité réglée sur 2 pour vraiment illuminer les choses. <add> <add>```js <add>{ <add> const skyColor = 0xB1E1FF; // bleu <add> const groundColor = 0xB97A20; // orange brun <add> const intensity = 2; <add> const light = new THREE.HemisphereLight(skyColor, groundColor, intensity); <add> scene.add(light); <add>} <add>``` <add> <add>L'autre est un `DirectionalLight` donc les sphères ont une définition <add> <add>```js <add>{ <add> const color = 0xFFFFFF; <add> const intensity = 1; <add> const light = new THREE.DirectionalLight(color, intensity); <add> light.position.set(0, 10, 5); <add> light.target.position.set(-5, 0, 0); <add> scene.add(light); <add> scene.add(light.target); <add>} <add>``` <add> <add>Il rendrait tel quel mais animons les sphères. Pour chaque sphère, ombre, jeu de base, nous déplaçons la base dans le plan xz, nous déplaçons la sphère de haut en bas en utilisant [`Math.abs(Math.sin(time))`](https://threejs.org/docs/#api/en/math/Math.abs(Math.sin(time))) qui nous donne une animation rebondissante. Et, nous avons également défini l'opacité du matériau d'ombre de sorte qu'à mesure que chaque sphère monte, son ombre s'estompe. <add> <add>```js <add>function render(time) { <add> time *= 0.001; // convertir en secondes <add> <add> ... <add> <add> sphereShadowBases.forEach((sphereShadowBase, ndx) => { <add> const {base, sphereMesh, shadowMesh, y} = sphereShadowBase; <add> <add> // u est une valeur qui va de 0 à 1 au fur et à mesure que l'on itère les sphères <add> const u = ndx / sphereShadowBases.length; <add> <add> // calculer une position pour la base. Cela va bouger <add> // à la fois la sphère et son ombre <add> const speed = time * .2; <add> const angle = speed + u * Math.PI * 2 * (ndx % 1 ? 1 : -1); <add> const radius = Math.sin(speed - ndx) * 10; <add> base.position.set(Math.cos(angle) * radius, 0, Math.sin(angle) * radius); <add> <add> // yOff est une valeur allant de 0 à 1 <add> const yOff = Math.abs(Math.sin(time * 2 + ndx)); <add> // déplace la sphère de haut en bas <add> sphereMesh.position.y = y + THREE.MathUtils.lerp(-2, 2, yOff); <add> // estompe l'ombre au fur et à mesure que la sphère monte <add> shadowMesh.material.opacity = THREE.MathUtils.lerp(1, .25, yOff); <add> }); <add> <add> ... <add>``` <add> <add>Et voici 15 balles rebondissantes. <add> <add>{{{example url="../threejs-shadows-fake.html" }}} <add> <add>Dans certaines applications, il est courant d'utiliser une ombre ronde ou ovale pour tout, mais bien sûr, vous pouvez également utiliser différentes textures d'ombre de forme. Vous pouvez également donner à l'ombre un bord plus dur. Un bon exemple d'utilisation de ce type d'ombre est [Animal Crossing Pocket Camp](https://www.google.com/search?tbm=isch&q=animal+crossing+pocket+camp+screenshots) où vous pouvez voir que chaque personnage a une simple ombre ronde. C'est efficace et pas cher. [Monument Valley](https://www.google.com/search?q=monument+valley+screenshots&tbm=isch) semble également utiliser ce type d'ombre pour le personnage principal. <add> <add>Donc, en passant aux cartes d'ombre, il y a 3 lumières qui peuvent projeter des ombres. Le `DirectionalLight`, le `PointLight` et le `SpotLight`. <add> <add>Commençons avec la `DirectionalLight` avec l'aide de [l'article sur les lumières](threejs-lights.html). <add> <add>La première chose à faire est d'activer les ombres dans le renderer (moteur de rendu). <add> <add>```js <add>const renderer = new THREE.WebGLRenderer({canvas}); <add>+renderer.shadowMap.enabled = true; <add>``` <add> <add>Ensuite, nous devons également dire à la lumière de projeter une ombre. <add> <add>```js <add>const light = new THREE.DirectionalLight(color, intensity); <add>+light.castShadow = true; <add>``` <add> <add>Nous devons également aller sur chaque maillage de la scène et décider s'il doit à la fois projeter des ombres et/ou recevoir des ombres. <add> <add>Faisons en sorte que le 'plane' (le sol) ne reçoive que des ombres car nous ne nous soucions pas vraiment de ce qui se passe en dessous. <add> <add>```js <add>const mesh = new THREE.Mesh(planeGeo, planeMat); <add>mesh.receiveShadow = true; <add>``` <add> <add>Pour le cube et la sphère faisons en sorte qu'ils reçoivent et projettent des ombres. <add> <add>```js <add>const mesh = new THREE.Mesh(cubeGeo, cubeMat); <add>mesh.castShadow = true; <add>mesh.receiveShadow = true; <add> <add>... <add> <add>const mesh = new THREE.Mesh(sphereGeo, sphereMat); <add>mesh.castShadow = true; <add>mesh.receiveShadow = true; <add>``` <add> <add>Et puis nous l'exécutons. <add> <add>{{{example url="../threejs-shadows-directional-light.html" }}} <add> <add>Que s'est-il passé? Pourquoi des parties des ombres manquent-elles ? <add> <add>C'est parce que les shadow maps sont créées en rendant la scène du point de vue de la lumière. C'est comme si il y avait une caméra dans la [`DirectionalLight`](https://threejs.org/docs/#api/en/lights/DirectionalLight) qui regardait sa cible. Tout comme [la caméra de l'article précédent](threejs-cameras.html), la 'caméra de la lumière' définit une zone à l'intérieur de laquelle les ombres sont projetées. Dans l'exemple ci-dessus, cette zone est trop petite. <add> <add>Afin de bien visualiser cette zone, ajoutons un `CameraHelper` à la scène. <add> <add>```js <add>const cameraHelper = new THREE.CameraHelper(light.shadow.camera); <add>scene.add(cameraHelper); <add>``` <add> <add>Maintenant, on peut voir cette zone où les ombres sont projetés. <add> <add>{{{example url="../threejs-shadows-directional-light-with-camera-helper.html" }}} <add> <add>Ajustez la valeur x cible dans les deux sens et il devrait être assez clair que seul ce qui se trouve à l'intérieur de la boîte de la caméra d'ombre de la lumière est l'endroit où les ombres sont dessinées. <add> <add>Nous pouvons ajuster la taille de cette boîte en ajustant la caméra d'ombre de la lumière. <add> <add>Ajoutons quelques paramètres à dat.GUI pour ajuster les ombres. Étant donné qu'une [`DirectionalLight`](https://threejs.org/docs/#api/en/lights/DirectionalLight) représente la lumière allant dans une direction parallèle, la [`DirectionalLight`](https://threejs.org/docs/#api/en/lights/DirectionalLight) utilise une [`OrthographicCamera`](https://threejs.org/docs/#api/en/cameras/OrthographicCamera) pour sa caméra d'ombre. Nous avons expliqué le fonctionnement d'une caméra orthographique dans [l'article précédent sur les caméras](threejs-cameras.html). <add> <add>Pour rappel, une `OrthographicCamera` définit son *frustum* par ses propriètès `left`, `right`, `top`, `bottom`, `near`, `far` et `zoom`. <add> <add>Créons à nouveau un helper pour dat.GUI. Appelons-le `DimensionGUIHelper` <add>et passons-lui un objet et 2 propriétés. Il dispose d'une propriété que dat.GUI peut ajuster et en réponse définit les deux propriétés, une positive et une négative. <add>Nous pouvons l'utiliser pour définir `left` et `right` en tant que `width` et `up`, `down` en tant que `height`. <add> <add>```js <add>class DimensionGUIHelper { <add> constructor(obj, minProp, maxProp) { <add> this.obj = obj; <add> this.minProp = minProp; <add> this.maxProp = maxProp; <add> } <add> get value() { <add> return this.obj[this.maxProp] * 2; <add> } <add> set value(v) { <add> this.obj[this.maxProp] = v / 2; <add> this.obj[this.minProp] = v / -2; <add> } <add>} <add>``` <add> <add>Utilisons aussi le `MinMaxGUIHelper` que nous avons créé dans [l'article sur les caméra](threejs-cameras.html) pour paramètrer `near` et `far`. <add> <add>```js <add>const gui = new GUI(); <add>gui.addColor(new ColorGUIHelper(light, 'color'), 'value').name('color'); <add>gui.add(light, 'intensity', 0, 2, 0.01); <add>+{ <add>+ const folder = gui.addFolder('Shadow Camera'); <add>+ folder.open(); <add>+ folder.add(new DimensionGUIHelper(light.shadow.camera, 'left', 'right'), 'value', 1, 100) <add>+ .name('width') <add>+ .onChange(updateCamera); <add>+ folder.add(new DimensionGUIHelper(light.shadow.camera, 'bottom', 'top'), 'value', 1, 100) <add>+ .name('height') <add>+ .onChange(updateCamera); <add>+ const minMaxGUIHelper = new MinMaxGUIHelper(light.shadow.camera, 'near', 'far', 0.1); <add>+ folder.add(minMaxGUIHelper, 'min', 0.1, 50, 0.1).name('near').onChange(updateCamera); <add>+ folder.add(minMaxGUIHelper, 'max', 0.1, 50, 0.1).name('far').onChange(updateCamera); <add>+ folder.add(light.shadow.camera, 'zoom', 0.01, 1.5, 0.01).onChange(updateCamera); <add>+} <add>``` <add> <add>Disons à dat.GUI d'appeler la fonction `updateCamera` à chaque changement. <add>Écrivons cette fonction pour mettre à jour la lumière et son helper, la caméra d'ombre de la lumière et son helper. <add> <add>```js <add>function updateCamera() { <add> // mettre à jour le MatrixWorld de la cible de lumière car il est requis par le helper <add> light.target.updateMatrixWorld(); <add> helper.update(); <add> // mettre à jour la matrice de projection de la caméra d'ombre de la lumière <add> light.shadow.camera.updateProjectionMatrix(); <add> // et maintenant mettre à jour l'assistant de caméra que nous utilisons pour afficher la caméra d'ombre de la lumière <add> cameraHelper.update(); <add>} <add>updateCamera(); <add>``` <add> <add>Et maintenant que nous avons accès aux propriètès de la caméra d'ombre, jouons avec. <add> <add>{{{example url="../threejs-shadows-directional-light-with-camera-gui.html" }}} <add> <add>Réglez `width` et `height` sur 30 et vous verrez que les ombres sont correctement projetées. <add> <add>Mais cela soulève la question, pourquoi ne pas simplement définir `width` et `height` avec des chiffres plus grands ? Réglez la largeur et la hauteur sur 100 et vous pourriez voir quelque chose comme ceci. <add> <add><div class="threejs_center"><img src="resources/images/low-res-shadow-map.png" style="width: 369px"></div> <add> <add>Que se passe-t-il avec ces ombres basse résolution ?! <add> <add>Ce problème est lié à un autre paramètres des ombres. Les textures d'ombre sont des textures dans lesquelles les ombres sont dessinées. Ces textures ont une taille. La zone de la caméra d'ombre que nous avons définie ci-dessus est étirée sur cette taille. Cela signifie que plus la zone que vous définissez est grande, plus vos ombres seront en blocs. <add> <add>Vous pouvez définir la résolution de la texture de l'ombre en définissant `light.shadow.mapSize.width` et `light.shadow.mapSize.height`. Ils sont par défaut à 512x512. Plus vous les agrandissez, plus ils prennent de mémoire et plus ils sont lents à s'afficher, vous voulez donc les définir aussi petits que possible tout en faisant fonctionner votre scène. La même chose est vraie avec la zone d'ombre. Plus petite signifie des ombres plus belles, alors réduisez la zone autant que possible tout en couvrant votre scène. Sachez que la machine de chaque utilisateur a une taille de texture maximale autorisée qui est disponible sur le renderer en tant que [`renderer.capabilities.maxTextureSize`](WebGLRenderer.capabilities). <add> <add><!-- <add>Ok but what about `near` and `far` I hear you thinking. Can we set `near` to 0.00001 and far to `100000000` <add>--> <add> <add>En passant à une `SpotLight` la caméra d'ombre devient une `PerspectiveCamera`. Contrairement à la caméra d'ombre de la `DirectionalLight` où nous pouvons régler manuellement la plupart de ses paramètres, celle de la `SpotLight`est auto-controlée. Le `fov` de la caméra d'ombre est directement connecté au réglage de l'`angle` de la `SpotLight`. <add>L'`aspect` est directement définit en fonction de la taille de la zone d'ombre. <add> <add>```js <add>-const light = new THREE.DirectionalLight(color, intensity); <add>+const light = new THREE.SpotLight(color, intensity); <add>``` <add> <add>Rajoutons les paramètres `penumbra` et `angle` vu dans [l'article sur les lumières](threejs-lights.html). <add> <add>{{{example url="../threejs-shadows-spot-light-with-camera-gui.html" }}} <add> <add><!-- <add>You can notice, just like the last example if we set the angle high <add>then the shadow map, the texture is spread over a very large area and <add>the resolution of our shadows gets really low. <add> <add>div class="threejs_center"><img src="resources/images/low-res-shadow-map-spotlight.png" style="width: 344px"></div> <add> <add>You can increase the size of the shadow map as mentioned above. You can <add>also blur the result <add> <add>{{{example url="../threejs-shadows-spot-light-with-shadow-radius" }}} <add>--> <add> <add> <add>Et enfin il y a les ombres avec un [`PointLight`](https://threejs.org/docs/#api/en/lights/PointLight). Étant donné qu'un [`PointLight`](https://threejs.org/docs/#api/en/lights/PointLight) brille dans toutes les directions, les seuls paramètres pertinents sont `near` et `far`. Sinon, l'ombre PointLight est effectivement constituée de 6 ombres [`SpotLight`](https://threejs.org/docs/#api/en/lights/SpotLight), chacune pointant vers la face d'un cube autour de la lumière. Cela signifie que les ombres [`PointLight`](https://threejs.org/docs/#api/en/lights/PointLight) sont beaucoup plus lentes car la scène entière doit être dessinée 6 fois, une pour chaque direction. <add> <add>Mettons un cadre autour de notre scène afin que nous puissions voir des ombres sur les murs et le plafond. Nous allons définir la propriété `side` du matériau sur `THREE.BackSide` afin de rendre l'intérieur de la boîte au lieu de l'extérieur. Comme le sol, nous ne le paramétrons pour recevoir des ombres. Nous allons également définir la position de la boîte de sorte que son fond soit légèrement en dessous du sol afin d'éviter un problème de z-fighting. <add> <add>```js <add>{ <add> const cubeSize = 30; <add> const cubeGeo = new THREE.BoxGeometry(cubeSize, cubeSize, cubeSize); <add> const cubeMat = new THREE.MeshPhongMaterial({ <add> color: '#CCC', <add> side: THREE.BackSide, <add> }); <add> const mesh = new THREE.Mesh(cubeGeo, cubeMat); <add> mesh.receiveShadow = true; <add> mesh.position.set(0, cubeSize / 2 - 0.1, 0); <add> scene.add(mesh); <add>} <add>``` <add> <add>Et bien sûr, il faut passer la lumière en `PointLight`. <add> <add>```js <add>-const light = new THREE.SpotLight(color, intensity); <add>+const light = new THREE.PointLight(color, intensity); <add> <add>.... <add> <add>// afin que nous puissions facilement voir où se trouve la spotLight <add>+const helper = new THREE.PointLightHelper(light); <add>+scene.add(helper); <add>``` <add> <add>{{{example url="../threejs-shadows-point-light.html" }}} <add> <add>Utilisez les paramètres position de dat.GUI pour déplacer la lumière et vous verrez les ombres se projeter sur tous les murs. Vous pouvez également ajuster les paramètres near et far et voir comment les autres ombres se comportent. <add> <add><!-- <add>self shadow, shadow acne <add>--> <add>
1
Javascript
Javascript
enforce explicit cwd()
23741470ca706776815f77c757e1dbddb706889e
<ide><path>local-cli/__mocks__/fs.js <ide> <ide> 'use strict'; <ide> <del>const fs = new (require('metro-memory-fs'))(); <add>const fs = new (require('metro-memory-fs'))({cwd: process.cwd}); <ide> <ide> function setMockFilesystem(object) { <ide> fs.reset();
1
Ruby
Ruby
remove unused `depthfirst` visitor
fc38ff6e4417295c870f419f7c164ab5a7dbc4a5
<ide><path>activerecord/lib/arel/nodes/node.rb <ide> module Nodes <ide> # Abstract base class for all AST nodes <ide> class Node <ide> include Arel::FactoryMethods <del> include Enumerable <ide> <ide> ### <ide> # Factory method to create a Nodes::Not node that has the recipient of <ide> def to_sql(engine = Table.engine) <ide> collector = engine.connection.visitor.accept self, collector <ide> collector.value <ide> end <del> <del> # Iterate through AST, nodes will be yielded depth-first <del> def each(&block) <del> return enum_for(:each) unless block_given? <del> <del> ::Arel::Visitors::DepthFirst.new(block).accept self <del> end <ide> end <ide> end <ide> end <ide><path>activerecord/lib/arel/visitors.rb <ide> # frozen_string_literal: true <ide> <ide> require "arel/visitors/visitor" <del>require "arel/visitors/depth_first" <ide> require "arel/visitors/to_sql" <ide> require "arel/visitors/sqlite" <ide> require "arel/visitors/postgresql" <ide><path>activerecord/lib/arel/visitors/depth_first.rb <del># frozen_string_literal: true <del> <del>module Arel # :nodoc: all <del> module Visitors <del> class DepthFirst < Arel::Visitors::Visitor <del> def initialize(block = nil) <del> @block = block || Proc.new <del> super() <del> end <del> <del> private <del> def visit(o, _ = nil) <del> super <del> @block.call o <del> end <del> <del> def unary(o) <del> visit o.expr <del> end <del> alias :visit_Arel_Nodes_Else :unary <del> alias :visit_Arel_Nodes_Group :unary <del> alias :visit_Arel_Nodes_Cube :unary <del> alias :visit_Arel_Nodes_RollUp :unary <del> alias :visit_Arel_Nodes_GroupingSet :unary <del> alias :visit_Arel_Nodes_GroupingElement :unary <del> alias :visit_Arel_Nodes_Grouping :unary <del> alias :visit_Arel_Nodes_Having :unary <del> alias :visit_Arel_Nodes_Lateral :unary <del> alias :visit_Arel_Nodes_Limit :unary <del> alias :visit_Arel_Nodes_Not :unary <del> alias :visit_Arel_Nodes_Offset :unary <del> alias :visit_Arel_Nodes_On :unary <del> alias :visit_Arel_Nodes_Ordering :unary <del> alias :visit_Arel_Nodes_Ascending :unary <del> alias :visit_Arel_Nodes_Descending :unary <del> alias :visit_Arel_Nodes_UnqualifiedColumn :unary <del> alias :visit_Arel_Nodes_OptimizerHints :unary <del> alias :visit_Arel_Nodes_ValuesList :unary <del> <del> def function(o) <del> visit o.expressions <del> visit o.alias <del> visit o.distinct <del> end <del> alias :visit_Arel_Nodes_Avg :function <del> alias :visit_Arel_Nodes_Exists :function <del> alias :visit_Arel_Nodes_Max :function <del> alias :visit_Arel_Nodes_Min :function <del> alias :visit_Arel_Nodes_Sum :function <del> <del> def visit_Arel_Nodes_NamedFunction(o) <del> visit o.name <del> visit o.expressions <del> visit o.distinct <del> visit o.alias <del> end <del> <del> def visit_Arel_Nodes_Count(o) <del> visit o.expressions <del> visit o.alias <del> visit o.distinct <del> end <del> <del> def visit_Arel_Nodes_Case(o) <del> visit o.case <del> visit o.conditions <del> visit o.default <del> end <del> <del> def nary(o) <del> o.children.each { |child| visit child } <del> end <del> alias :visit_Arel_Nodes_And :nary <del> <del> def binary(o) <del> visit o.left <del> visit o.right <del> end <del> alias :visit_Arel_Nodes_As :binary <del> alias :visit_Arel_Nodes_Assignment :binary <del> alias :visit_Arel_Nodes_Between :binary <del> alias :visit_Arel_Nodes_Concat :binary <del> alias :visit_Arel_Nodes_DeleteStatement :binary <del> alias :visit_Arel_Nodes_DoesNotMatch :binary <del> alias :visit_Arel_Nodes_Equality :binary <del> alias :visit_Arel_Nodes_FullOuterJoin :binary <del> alias :visit_Arel_Nodes_GreaterThan :binary <del> alias :visit_Arel_Nodes_GreaterThanOrEqual :binary <del> alias :visit_Arel_Nodes_In :binary <del> alias :visit_Arel_Nodes_InfixOperation :binary <del> alias :visit_Arel_Nodes_JoinSource :binary <del> alias :visit_Arel_Nodes_InnerJoin :binary <del> alias :visit_Arel_Nodes_LessThan :binary <del> alias :visit_Arel_Nodes_LessThanOrEqual :binary <del> alias :visit_Arel_Nodes_Matches :binary <del> alias :visit_Arel_Nodes_NotEqual :binary <del> alias :visit_Arel_Nodes_NotIn :binary <del> alias :visit_Arel_Nodes_NotRegexp :binary <del> alias :visit_Arel_Nodes_IsNotDistinctFrom :binary <del> alias :visit_Arel_Nodes_IsDistinctFrom :binary <del> alias :visit_Arel_Nodes_Or :binary <del> alias :visit_Arel_Nodes_OuterJoin :binary <del> alias :visit_Arel_Nodes_Regexp :binary <del> alias :visit_Arel_Nodes_RightOuterJoin :binary <del> alias :visit_Arel_Nodes_TableAlias :binary <del> alias :visit_Arel_Nodes_When :binary <del> <del> def visit_Arel_Nodes_StringJoin(o) <del> visit o.left <del> end <del> <del> def visit_Arel_Attribute(o) <del> visit o.relation <del> visit o.name <del> end <del> alias :visit_Arel_Attributes_Integer :visit_Arel_Attribute <del> alias :visit_Arel_Attributes_Float :visit_Arel_Attribute <del> alias :visit_Arel_Attributes_String :visit_Arel_Attribute <del> alias :visit_Arel_Attributes_Time :visit_Arel_Attribute <del> alias :visit_Arel_Attributes_Boolean :visit_Arel_Attribute <del> alias :visit_Arel_Attributes_Attribute :visit_Arel_Attribute <del> alias :visit_Arel_Attributes_Decimal :visit_Arel_Attribute <del> <del> def visit_Arel_Table(o) <del> visit o.name <del> end <del> <del> def terminal(o) <del> end <del> alias :visit_ActiveSupport_Multibyte_Chars :terminal <del> alias :visit_ActiveSupport_StringInquirer :terminal <del> alias :visit_Arel_Nodes_Lock :terminal <del> alias :visit_Arel_Nodes_Node :terminal <del> alias :visit_Arel_Nodes_SqlLiteral :terminal <del> alias :visit_Arel_Nodes_BindParam :terminal <del> alias :visit_Arel_Nodes_Window :terminal <del> alias :visit_Arel_Nodes_True :terminal <del> alias :visit_Arel_Nodes_False :terminal <del> alias :visit_BigDecimal :terminal <del> alias :visit_Class :terminal <del> alias :visit_Date :terminal <del> alias :visit_DateTime :terminal <del> alias :visit_FalseClass :terminal <del> alias :visit_Float :terminal <del> alias :visit_Integer :terminal <del> alias :visit_NilClass :terminal <del> alias :visit_String :terminal <del> alias :visit_Symbol :terminal <del> alias :visit_Time :terminal <del> alias :visit_TrueClass :terminal <del> <del> def visit_Arel_Nodes_InsertStatement(o) <del> visit o.relation <del> visit o.columns <del> visit o.values <del> end <del> <del> def visit_Arel_Nodes_SelectCore(o) <del> visit o.projections <del> visit o.source <del> visit o.wheres <del> visit o.groups <del> visit o.windows <del> visit o.havings <del> end <del> <del> def visit_Arel_Nodes_SelectStatement(o) <del> visit o.cores <del> visit o.orders <del> visit o.limit <del> visit o.lock <del> visit o.offset <del> end <del> <del> def visit_Arel_Nodes_UpdateStatement(o) <del> visit o.relation <del> visit o.values <del> visit o.wheres <del> visit o.orders <del> visit o.limit <del> end <del> <del> def visit_Arel_Nodes_Comment(o) <del> visit o.values <del> end <del> <del> def visit_Array(o) <del> o.each { |i| visit i } <del> end <del> alias :visit_Set :visit_Array <del> <del> def visit_Hash(o) <del> o.each { |k, v| visit(k); visit(v) } <del> end <del> <del> DISPATCH = dispatch_cache <del> <del> def get_dispatch_cache <del> DISPATCH <del> end <del> end <del> end <del>end <ide><path>activerecord/test/cases/arel/nodes/node_test.rb <ide> def test_all_nodes_are_nodes <ide> assert klass.ancestors.include?(Nodes::Node), klass.name <ide> end <ide> end <del> <del> def test_each <del> list = [] <del> node = Nodes::Node.new <del> node.each { |n| list << n } <del> assert_equal [node], list <del> end <del> <del> def test_generator <del> list = [] <del> node = Nodes::Node.new <del> node.each.each { |n| list << n } <del> assert_equal [node], list <del> end <del> <del> def test_enumerable <del> node = Nodes::Node.new <del> assert_kind_of Enumerable, node <del> end <ide> end <ide> end <ide><path>activerecord/test/cases/arel/select_manager_test.rb <ide> def test_join_sources <ide> mgr = table.from <ide> assert mgr.ast <ide> end <del> <del> it "should allow orders to work when the ast is grepped" do <del> table = Table.new :users <del> mgr = table.from <del> mgr.project Arel.sql "*" <del> mgr.from table <del> mgr.orders << Arel::Nodes::Ascending.new(Arel.sql("foo")) <del> mgr.ast.grep(Arel::Nodes::OuterJoin) <del> mgr.to_sql.must_be_like %{ SELECT * FROM "users" ORDER BY foo ASC } <del> end <ide> end <ide> <ide> describe "taken" do <ide><path>activerecord/test/cases/arel/visitors/depth_first_test.rb <del># frozen_string_literal: true <del> <del>require_relative "../helper" <del> <del>module Arel <del> module Visitors <del> class TestDepthFirst < Arel::Test <del> Collector = Struct.new(:calls) do <del> def call(object) <del> calls << object <del> end <del> end <del> <del> def setup <del> @collector = Collector.new [] <del> @visitor = Visitors::DepthFirst.new @collector <del> end <del> <del> def test_raises_with_object <del> assert_raises(TypeError) do <del> @visitor.accept(Object.new) <del> end <del> end <del> <del> <del> # unary ops <del> [ <del> Arel::Nodes::Not, <del> Arel::Nodes::Group, <del> Arel::Nodes::On, <del> Arel::Nodes::Grouping, <del> Arel::Nodes::Offset, <del> Arel::Nodes::Ordering, <del> Arel::Nodes::StringJoin, <del> Arel::Nodes::UnqualifiedColumn, <del> Arel::Nodes::ValuesList, <del> Arel::Nodes::Limit, <del> Arel::Nodes::Else, <del> ].each do |klass| <del> define_method("test_#{klass.name.gsub('::', '_')}") do <del> op = klass.new(:a) <del> @visitor.accept op <del> assert_equal [:a, op], @collector.calls <del> end <del> end <del> <del> # functions <del> [ <del> Arel::Nodes::Exists, <del> Arel::Nodes::Avg, <del> Arel::Nodes::Min, <del> Arel::Nodes::Max, <del> Arel::Nodes::Sum, <del> ].each do |klass| <del> define_method("test_#{klass.name.gsub('::', '_')}") do <del> func = klass.new(:a, "b") <del> @visitor.accept func <del> assert_equal [:a, "b", false, func], @collector.calls <del> end <del> end <del> <del> def test_named_function <del> func = Arel::Nodes::NamedFunction.new(:a, :b, "c") <del> @visitor.accept func <del> assert_equal [:a, :b, false, "c", func], @collector.calls <del> end <del> <del> def test_lock <del> lock = Nodes::Lock.new true <del> @visitor.accept lock <del> assert_equal [lock], @collector.calls <del> end <del> <del> def test_count <del> count = Nodes::Count.new :a, :b, "c" <del> @visitor.accept count <del> assert_equal [:a, "c", :b, count], @collector.calls <del> end <del> <del> def test_inner_join <del> join = Nodes::InnerJoin.new :a, :b <del> @visitor.accept join <del> assert_equal [:a, :b, join], @collector.calls <del> end <del> <del> def test_full_outer_join <del> join = Nodes::FullOuterJoin.new :a, :b <del> @visitor.accept join <del> assert_equal [:a, :b, join], @collector.calls <del> end <del> <del> def test_outer_join <del> join = Nodes::OuterJoin.new :a, :b <del> @visitor.accept join <del> assert_equal [:a, :b, join], @collector.calls <del> end <del> <del> def test_right_outer_join <del> join = Nodes::RightOuterJoin.new :a, :b <del> @visitor.accept join <del> assert_equal [:a, :b, join], @collector.calls <del> end <del> <del> def test_comment <del> comment = Nodes::Comment.new ["foo"] <del> @visitor.accept comment <del> assert_equal ["foo", ["foo"], comment], @collector.calls <del> end <del> <del> [ <del> Arel::Nodes::Assignment, <del> Arel::Nodes::Between, <del> Arel::Nodes::Concat, <del> Arel::Nodes::DoesNotMatch, <del> Arel::Nodes::Equality, <del> Arel::Nodes::GreaterThan, <del> Arel::Nodes::GreaterThanOrEqual, <del> Arel::Nodes::In, <del> Arel::Nodes::LessThan, <del> Arel::Nodes::LessThanOrEqual, <del> Arel::Nodes::Matches, <del> Arel::Nodes::NotEqual, <del> Arel::Nodes::NotIn, <del> Arel::Nodes::Or, <del> Arel::Nodes::TableAlias, <del> Arel::Nodes::As, <del> Arel::Nodes::DeleteStatement, <del> Arel::Nodes::JoinSource, <del> Arel::Nodes::When, <del> ].each do |klass| <del> define_method("test_#{klass.name.gsub('::', '_')}") do <del> binary = klass.new(:a, :b) <del> @visitor.accept binary <del> assert_equal [:a, :b, binary], @collector.calls <del> end <del> end <del> <del> def test_Arel_Nodes_InfixOperation <del> binary = Arel::Nodes::InfixOperation.new(:o, :a, :b) <del> @visitor.accept binary <del> assert_equal [:a, :b, binary], @collector.calls <del> end <del> <del> # N-ary <del> [ <del> Arel::Nodes::And, <del> ].each do |klass| <del> define_method("test_#{klass.name.gsub('::', '_')}") do <del> binary = klass.new([:a, :b, :c]) <del> @visitor.accept binary <del> assert_equal [:a, :b, :c, binary], @collector.calls <del> end <del> end <del> <del> [ <del> Arel::Attributes::Integer, <del> Arel::Attributes::Float, <del> Arel::Attributes::String, <del> Arel::Attributes::Time, <del> Arel::Attributes::Boolean, <del> Arel::Attributes::Attribute <del> ].each do |klass| <del> define_method("test_#{klass.name.gsub('::', '_')}") do <del> binary = klass.new(:a, :b) <del> @visitor.accept binary <del> assert_equal [:a, :b, binary], @collector.calls <del> end <del> end <del> <del> def test_table <del> relation = Arel::Table.new(:users) <del> @visitor.accept relation <del> assert_equal ["users", relation], @collector.calls <del> end <del> <del> def test_array <del> node = Nodes::Or.new(:a, :b) <del> list = [node] <del> @visitor.accept list <del> assert_equal [:a, :b, node, list], @collector.calls <del> end <del> <del> def test_set <del> node = Nodes::Or.new(:a, :b) <del> set = Set.new([node]) <del> @visitor.accept set <del> assert_equal [:a, :b, node, set], @collector.calls <del> end <del> <del> def test_hash <del> node = Nodes::Or.new(:a, :b) <del> hash = { node => node } <del> @visitor.accept hash <del> assert_equal [:a, :b, node, :a, :b, node, hash], @collector.calls <del> end <del> <del> def test_update_statement <del> stmt = Nodes::UpdateStatement.new <del> stmt.relation = :a <del> stmt.values << :b <del> stmt.wheres << :c <del> stmt.orders << :d <del> stmt.limit = :e <del> <del> @visitor.accept stmt <del> assert_equal [:a, :b, stmt.values, :c, stmt.wheres, :d, stmt.orders, <del> :e, stmt], @collector.calls <del> end <del> <del> def test_select_core <del> core = Nodes::SelectCore.new <del> core.projections << :a <del> core.froms = :b <del> core.wheres << :c <del> core.groups << :d <del> core.windows << :e <del> core.havings << :f <del> <del> @visitor.accept core <del> assert_equal [ <del> :a, core.projections, <del> :b, [], <del> core.source, <del> :c, core.wheres, <del> :d, core.groups, <del> :e, core.windows, <del> :f, core.havings, <del> core], @collector.calls <del> end <del> <del> def test_select_statement <del> ss = Nodes::SelectStatement.new <del> ss.cores.replace [:a] <del> ss.orders << :b <del> ss.limit = :c <del> ss.lock = :d <del> ss.offset = :e <del> <del> @visitor.accept ss <del> assert_equal [ <del> :a, ss.cores, <del> :b, ss.orders, <del> :c, <del> :d, <del> :e, <del> ss], @collector.calls <del> end <del> <del> def test_insert_statement <del> stmt = Nodes::InsertStatement.new <del> stmt.relation = :a <del> stmt.columns << :b <del> stmt.values = :c <del> <del> @visitor.accept stmt <del> assert_equal [:a, :b, stmt.columns, :c, stmt], @collector.calls <del> end <del> <del> def test_case <del> node = Arel::Nodes::Case.new <del> node.case = :a <del> node.conditions << :b <del> node.default = :c <del> <del> @visitor.accept node <del> assert_equal [:a, :b, node.conditions, :c, node], @collector.calls <del> end <del> <del> def test_node <del> node = Nodes::Node.new <del> @visitor.accept node <del> assert_equal [node], @collector.calls <del> end <del> end <del> end <del>end <ide><path>activerecord/test/cases/arel/visitors/dispatch_contamination_test.rb <ide> class DispatchContaminationTest < Arel::Spec <ide> node = Nodes::Union.new(Nodes::True.new, Nodes::False.new) <ide> assert_equal "( TRUE UNION FALSE )", node.to_sql <ide> <del> node.first # from Nodes::Node's Enumerable mixin <add> visitor = Class.new(Visitor) { <add> def visit_Arel_Nodes_Union(o); end <add> alias :visit_Arel_Nodes_True :visit_Arel_Nodes_Union <add> alias :visit_Arel_Nodes_False :visit_Arel_Nodes_Union <add> }.new <add> <add> visitor.accept(node) <ide> <ide> assert_equal "( TRUE UNION FALSE )", node.to_sql <ide> end
7
Text
Text
clarify combinereducers() usage
ec0b1a36e958584b7a11a5977734f04d05955c22
<ide><path>docs/api/combineReducers.md <ide> The resulting reducer calls every child reducer, and gather their results into a <ide> Consequently, the state object will look like this : <ide> <ide> ``` <del>state : { <add>{ <ide> reducer1: ... <ide> reducer2: ... <ide> } <ide> ``` <add> <add>You can control state key names by using different keys for the reducers in the passed object. For example, you may call `combineReducers({ todos: myTodosReducer, counter: myCounterReducer })` for the state shape to be `{ todos, counter }`. <add> <add>A popular convention is to name reducers after the state slices they manage, so you can use ES6 property shorthand notation: `combineReducers({ counter, todos })`. This is equivalent to writing `combineReducers({ counter: counter, todos: todos })`. <add> <ide> > ##### A Note for Flux Users <ide> <ide> > This function helps you organize your reducers to manage their own slices of state, similar to how you would have different Flux Stores to manage different state. With Redux, there is just one store, but `combineReducers` helps you keep the same logical division between reducers.
1
PHP
PHP
remove duplicate rows from simple pagination
29d0a968019bff40baccac21f6bde2f243cee083
<ide><path>src/Illuminate/Pagination/Paginator.php <ide> public function __construct(Factory $factory, array $items, $total, $perPage = n <ide> if (is_null($perPage)) <ide> { <ide> $this->perPage = (int) $total; <del> $this->items = array_slice($items, 0, $perPage); <del> $this->hasMore = count(array_slice($items, $this->perPage, 1)) > 0; <add> $this->items = array_slice($items, 0, $this->perPage); <add> $this->hasMore = count($items) > $this->perPage; <ide> } <ide> else <ide> { <ide><path>tests/Pagination/PaginationPaginatorTest.php <ide> public function testPaginationContextIsSetupCorrectly() <ide> $this->assertEquals(1, $p->getCurrentPage()); <ide> } <ide> <add> public function testSimplePagination() <add> { <add> $p = new Paginator($factory = m::mock('Illuminate\Pagination\Factory'), ['foo', 'bar', 'baz'], 2); <add> $factory->shouldReceive('getCurrentPage')->once()->andReturn(1); <add> $p->setupPaginationContext(); <add> <add> $this->assertEquals(2, $p->getLastPage()); <add> $this->assertEquals(1, $p->getCurrentPage()); <add> $this->assertEquals(['foo', 'bar'], $p->getItems()); <add> } <add> <add> <add> public function testSimplePaginationLastPage() <add> { <add> $p = new Paginator($factory = m::mock('Illuminate\Pagination\Factory'), ['foo', 'bar', 'baz'], 3); <add> $factory->shouldReceive('getCurrentPage')->once()->andReturn(1); <add> $p->setupPaginationContext(); <add> <add> $this->assertEquals(1, $p->getLastPage()); <add> $this->assertEquals(1, $p->getCurrentPage()); <add> $this->assertEquals(3, count($p->getItems())); <add> } <add> <ide> <ide> public function testPaginationContextIsSetupCorrectlyInCursorMode() <ide> {
2
Ruby
Ruby
report outdated count & suggest `brew upgrade`
0e732d3917c013bad3404015d939e8f0fad35913
<ide><path>Library/Homebrew/cmd/update-report.rb <ide> def update_report <ide> DescriptionCacheStore.new(db) <ide> .update_from_report!(hub) <ide> end <add> <add> unless args.preinstall? <add> outdated_formulae = Formula.installed.count(&:outdated?) <add> outdated_casks = Cask::Caskroom.casks.count(&:outdated?) <add> msg = "" <add> if outdated_formulae.positive? <add> msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{"formula".pluralize(outdated_formulae)}" <add> end <add> if outdated_casks.positive? <add> msg += " and " if msg.present? <add> msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{"cask".pluralize(outdated_casks)}" <add> end <add> if msg.present? <add> puts_stdout_or_stderr <add> puts_stdout_or_stderr <<~EOS <add> You have #{msg} installed. <add> You can update them with #{Tty.bold}brew upgrade#{Tty.reset}. <add> EOS <add> end <add> end <ide> end <del> puts if args.preinstall? <add> puts_stdout_or_stderr if args.preinstall? <ide> elsif !args.preinstall? && !ENV["HOMEBREW_UPDATE_FAILED"] <ide> puts_stdout_or_stderr "Already up-to-date." unless args.quiet? <ide> end <ide> def update_report <ide> <ide> return if new_repository_version.blank? <ide> <add> puts_stdout_or_stderr <ide> ohai_stdout_or_stderr "Homebrew was updated to version #{new_repository_version}" <ide> if new_repository_version.split(".").last == "0" <ide> puts_stdout_or_stderr <<~EOS <ide><path>Library/Homebrew/utils.rb <ide> def ohai_stdout_or_stderr(message, *sput) <ide> end <ide> <ide> def puts_stdout_or_stderr(*message) <add> message = "\n" if message.empty? <ide> if $stdout.tty? <ide> puts(message) <ide> else
2
Text
Text
remove old console note
1e84e69eac1d09e849e22e90570f18e2794e83a2
<ide><path>doc/api/console.md <ide> console.timeEnd('100-elements'); <ide> // prints 100-elements: 225.438ms <ide> ``` <ide> <del>*Note*: As of Node.js v6.0.0, `console.timeEnd()` deletes the timer to avoid <del>leaking it. On older versions, the timer persisted. This allowed <del>`console.timeEnd()` to be called multiple times for the same label. This <del>functionality was unintended and is no longer supported. <del> <ide> ### console.trace([message][, ...args]) <ide> <!-- YAML <ide> added: v0.1.104
1
Go
Go
implement docker diff for device-mapper
1c5dc26a7c0a0abb7bc59174768ec309f6c5fd4f
<ide><path>changes.go <ide> import ( <ide> "os" <ide> "path/filepath" <ide> "strings" <add> "syscall" <ide> ) <ide> <ide> type ChangeType int <ide> func (change *Change) String() string { <ide> return fmt.Sprintf("%s %s", kind, change.Path) <ide> } <ide> <del>func Changes(layers []string, rw string) ([]Change, error) { <add>func ChangesAUFS(layers []string, rw string) ([]Change, error) { <ide> var changes []Change <ide> err := filepath.Walk(rw, func(path string, f os.FileInfo, err error) error { <ide> if err != nil { <ide> func Changes(layers []string, rw string) ([]Change, error) { <ide> } <ide> return changes, nil <ide> } <add> <add>func ChangesDirs(newDir, oldDir string) ([]Change, error) { <add> var changes []Change <add> err := filepath.Walk(newDir, func(newPath string, f os.FileInfo, err error) error { <add> if err != nil { <add> return err <add> } <add> <add> var newStat syscall.Stat_t <add> err = syscall.Lstat(newPath, &newStat) <add> if err != nil { <add> return err <add> } <add> <add> // Rebase path <add> relPath, err := filepath.Rel(newDir, newPath) <add> if err != nil { <add> return err <add> } <add> relPath = filepath.Join("/", relPath) <add> <add> // Skip root <add> if relPath == "/" || relPath == "/.docker-id" { <add> return nil <add> } <add> <add> change := Change{ <add> Path: relPath, <add> } <add> <add> oldPath := filepath.Join(oldDir, relPath) <add> <add> var oldStat = &syscall.Stat_t{} <add> err = syscall.Lstat(oldPath, oldStat) <add> if err != nil { <add> if !os.IsNotExist(err) { <add> return err <add> } <add> oldStat = nil <add> } <add> <add> if oldStat == nil { <add> change.Kind = ChangeAdd <add> changes = append(changes, change) <add> } else { <add> if oldStat.Ino != newStat.Ino || <add> oldStat.Mode != newStat.Mode || <add> oldStat.Uid != newStat.Uid || <add> oldStat.Gid != newStat.Gid || <add> oldStat.Rdev != newStat.Rdev || <add> oldStat.Size != newStat.Size || <add> oldStat.Blocks != newStat.Blocks || <add> oldStat.Mtim != newStat.Mtim || <add> oldStat.Ctim != newStat.Ctim { <add> change.Kind = ChangeModify <add> changes = append(changes, change) <add> } <add> } <add> <add> return nil <add> }) <add> if err != nil { <add> return nil, err <add> } <add> err = filepath.Walk(oldDir, func(oldPath string, f os.FileInfo, err error) error { <add> if err != nil { <add> return err <add> } <add> <add> // Rebase path <add> relPath, err := filepath.Rel(oldDir, oldPath) <add> if err != nil { <add> return err <add> } <add> relPath = filepath.Join("/", relPath) <add> <add> // Skip root <add> if relPath == "/" { <add> return nil <add> } <add> <add> change := Change{ <add> Path: relPath, <add> } <add> <add> newPath := filepath.Join(newDir, relPath) <add> <add> var newStat = &syscall.Stat_t{} <add> err = syscall.Lstat(newPath, newStat) <add> if err != nil && os.IsNotExist(err) { <add> change.Kind = ChangeDelete <add> changes = append(changes, change) <add> } <add> <add> return nil <add> }) <add> if err != nil { <add> return nil, err <add> } <add> return changes, nil <add>} <ide><path>container.go <ide> func (container *Container) Mount() error { <ide> } <ide> <ide> func (container *Container) Changes() ([]Change, error) { <add> if err := container.EnsureMounted(); err != nil { <add> return nil, err <add> } <add> <ide> image, err := container.GetImage() <ide> if err != nil { <ide> return nil, err <ide> } <del> return image.Changes(container.rwPath()) <add> return image.Changes(container.runtime, container.RootfsPath(), container.rwPath(), container.ID) <ide> } <ide> <ide> func (container *Container) GetImage() (*Image, error) { <ide><path>image.go <ide> func (image *Image) Unmount(runtime *Runtime, root string, id string) error { <ide> return nil <ide> } <ide> <del>func (image *Image) Changes(rw string) ([]Change, error) { <del> layers, err := image.layers() <del> if err != nil { <del> return nil, err <add>func (image *Image) Changes(runtime *Runtime, root, rw, id string) ([]Change, error) { <add> switch runtime.GetMountMethod() { <add> case MountMethodAUFS: <add> layers, err := image.layers() <add> if err != nil { <add> return nil, err <add> } <add> return ChangesAUFS(layers, rw) <add> <add> case MountMethodDeviceMapper: <add> devices, err := runtime.GetDeviceSet() <add> if err != nil { <add> return nil, err <add> } <add> <add> if err := os.Mkdir(rw, 0755); err != nil && !os.IsExist(err) { <add> return nil, err <add> } <add> <add> // We re-use rw for the temporary mount of the base image as its <add> // not used by device-mapper otherwise <add> err = devices.MountDevice(image.ID, rw) <add> if err != nil { <add> return nil, err <add> } <add> <add> changes, err := ChangesDirs(root, rw) <add> _ = syscall.Unmount(rw, 0) <add> if err != nil { <add> return nil, err <add> } <add> return changes, nil <ide> } <del> return Changes(layers, rw) <add> <add> return nil, fmt.Errorf("No supported Changes implementation") <ide> } <ide> <ide> func (image *Image) ShortID() string {
3
Text
Text
add information about ctc quorum rules
96611d097a8b576d7950918e25f7b542b9a5440a
<ide><path>GOVERNANCE.md <ide> When an agenda item has appeared to reach a consensus, the moderator will ask <ide> "Does anyone object?" as a final call for dissent from the consensus. <ide> <ide> If an agenda item cannot reach a consensus, a CTC member can call for either a <del>closing vote or a vote to table the issue to the next meeting. The call for a <del>vote must be approved by a simple majority of the CTC or else the discussion <del>will continue. <add>closing vote or a vote to table the issue to the next meeting. All votes <add>(including votes to close or table) pass if and only if more than 50% of the CTC <add>members (excluding individuals who explicitly abstain) vote in favor. For <add>example, if there are 20 CTC members, and 5 of those members indicate that they <add>abstain, then 8 votes in favor are required for a resolution to pass.
1
Javascript
Javascript
remove redundant function
421eb682b993fa4b50b0e8ad15f18d7281bae557
<ide><path>examples/jsm/csm/Frustum.js <ide> import * as THREE from '../../../build/three.module.js'; <ide> import FrustumVertex from './FrustumVertex.js'; <del>import { toRad } from './Utils.js'; <ide> <ide> export default class Frustum { <ide> <ide> export default class Frustum { <ide> <ide> getViewSpaceVertices() { <ide> <del> this.nearPlaneY = this.near * Math.tan( toRad( this.fov / 2 ) ); <add> this.nearPlaneY = this.near * Math.tan( THREE.MathUtils.degToRad( this.fov / 2 ) ); <ide> this.nearPlaneX = this.aspect * this.nearPlaneY; <ide> <del> this.farPlaneY = this.far * Math.tan( toRad( this.fov / 2 ) ); <add> this.farPlaneY = this.far * Math.tan( THREE.MathUtils.degToRad( this.fov / 2 ) ); <ide> this.farPlaneX = this.aspect * this.farPlaneY; <ide> <ide> // 3 --- 0 vertices.near/far order <ide><path>examples/jsm/csm/Utils.js <del>export function toRad( degrees ) { <del> <del> return degrees * Math.PI / 180; <del> <del>}
2
Ruby
Ruby
remove unused variable
ba4bdc536b9241a374673a5a0e67feeff3532964
<ide><path>activesupport/lib/active_support/core_ext/uri.rb <ide> # frozen_string_literal: true <ide> <ide> require "uri" <del>str = "\xE6\x97\xA5" <ide> <ide> if RUBY_VERSION < "2.6.0" <ide> require "active_support/core_ext/module/redefine_method"
1
Text
Text
correct personal info
41a35e0ebfb3a895e93757c85611184371cca8f4
<ide><path>README.md <ide> For information about the governance of the Node.js project, see <ide> * [Qard](https://github.com/Qard) - <ide> **Stephen Belanger** &lt;admin@stephenbelanger.com&gt; (he/him) <ide> * [refack](https://github.com/refack) - <del>**Refael Ackermann** &lt;refack@gmail.com&gt; (he/him) <add>**Refael Ackermann (רפאל פלחי)** &lt;refack@gmail.com&gt; (he/him/הוא/אתה) <ide> * [richardlau](https://github.com/richardlau) - <ide> **Richard Lau** &lt;riclau@uk.ibm.com&gt; <ide> * [ronkorving](https://github.com/ronkorving) -
1
Python
Python
fix simplernn step function
c2534964b76015eb3d76261b025c7556b354764c
<ide><path>keras/layers/recurrent.py <ide> def step(self, x, states): <ide> assert len(states) == 1 <ide> prev_output = states[0] <ide> h = K.dot(x, self.W) + self.b <del> output = self.activation(h * K.dot(prev_output, self.U)) <add> output = self.activation(h + K.dot(prev_output, self.U)) <ide> return output, [output] <ide> <ide> def get_config(self):
1
Java
Java
prevent hitslop crash on android
c2a55baf80c99df84c3a3d99ec58696ab2141e27
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.java <ide> public void setHitSlop(final ReactViewGroup view, @Nullable ReadableMap hitSlop) <ide> view.setHitSlopRect(null); <ide> } else { <ide> view.setHitSlopRect(new Rect( <del> (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("left")), <del> (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("top")), <del> (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("right")), <del> (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("bottom")) <add> hitSlop.hasKey("left") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("left")) : 0, <add> hitSlop.hasKey("top") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("top")) : 0, <add> hitSlop.hasKey("right") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("right")) : 0, <add> hitSlop.hasKey("bottom") ? (int) PixelUtil.toPixelFromDIP(hitSlop.getDouble("bottom")) : 0 <ide> )); <ide> } <ide> }
1
Javascript
Javascript
add dataview test entry for whatwg
de9dc417fe1fc554c8cc34e51616668bfe012548
<ide><path>test/parallel/test-whatwg-readablestream.js <ide> class Source { <ide> isReadable(stream, false); <ide> })().then(common.mustCall()); <ide> } <add> <add>{ <add> const stream = new ReadableStream({ <add> type: 'bytes', <add> start(controller) { <add> controller.close(); <add> } <add> }); <add> <add> const buffer = new ArrayBuffer(1024); <add> const reader = stream.getReader({ mode: 'byob' }); <add> <add> reader.read(new DataView(buffer)) <add> .then(common.mustCall()); <add>}
1
Ruby
Ruby
support dalli 3.2.1
f8f438fcedee1a68610f57f33f0deae283a1c4c7
<ide><path>activesupport/test/cache/stores/mem_cache_store_test.rb <ide> def emulating_unavailability <ide> end <ide> <ide> def servers(cache = @cache) <del> client(cache).instance_variable_get(:@servers) <add> if client(cache).instance_variable_defined?(:@normalized_servers) <add> client(cache).instance_variable_get(:@normalized_servers) <add> else <add> client(cache).instance_variable_get(:@servers) <add> end <ide> end <ide> <ide> def client(cache = @cache)
1
Text
Text
fix filename reference for statstestcases.test.js
aaaa4c30cfd28f47418edcd55df3671c0468504c
<ide><path>test/README.md <ide> If you are trying to solve a bug which is reproducible when x and y properties a <ide> <ide> In addition to an `index.js`, these configCases require a `webpack.config.js` is located inside of your test suite. This will run this specific config through `webpack` just as you were building individually. They will use the same loading/bundling technique of your `it()` tests, however you now have a more specific config use cases that you can write even before you start coding. <ide> <del>#### statsCases (`Stats.test.js`) <add>#### statsCases (`StatsTestCases.test.js`) <ide> Stats cases are similar to configCases except specifically focusing on the `expected` output of your stats. Instead of writing to the console, however the output of stats will be written to disk. <ide> <ide> By default, the "expected" outcome is a pain to write by hand so instead when statsCases are run the following happens:
1
PHP
PHP
remove unneeded block
6ca2ecacea0f6f0ff8a4c2f0d39c1ddda4c17f3e
<ide><path>public/index.php <ide> use Illuminate\Contracts\Http\Kernel; <ide> use Illuminate\Http\Request; <ide> <del>/** <del> * Laravel - A PHP Framework For Web Artisans <del> * <del> * @package Laravel <del> * @author Taylor Otwell <taylor@laravel.com> <del> */ <del> <ide> define('LARAVEL_START', microtime(true)); <ide> <ide> /*
1
Javascript
Javascript
add tls write error regression test
785e5ba48cb57a05c9c0966a502d34ac03084561
<ide><path>test/common/tls.js <add>/* eslint-disable node-core/required-modules, node-core/crypto-check */ <add> <add>'use strict'; <add>const crypto = require('crypto'); <add>const net = require('net'); <add> <add>exports.ccs = Buffer.from('140303000101', 'hex'); <add> <add>class TestTLSSocket extends net.Socket { <add> constructor(server_cert) { <add> super(); <add> this.server_cert = server_cert; <add> this.version = Buffer.from('0303', 'hex'); <add> this.handshake_list = []; <add> // AES128-GCM-SHA256 <add> this.ciphers = Buffer.from('000002009c0', 'hex'); <add> this.pre_master_secret = <add> Buffer.concat([this.version, crypto.randomBytes(46)]); <add> this.master_secret = null; <add> this.write_seq = 0; <add> this.client_random = crypto.randomBytes(32); <add> <add> this.on('handshake', (msg) => { <add> this.handshake_list.push(msg); <add> }); <add> <add> this.on('server_random', (server_random) => { <add> this.master_secret = PRF12('sha256', this.pre_master_secret, <add> 'master secret', <add> Buffer.concat([this.client_random, <add> server_random]), <add> 48); <add> const key_block = PRF12('sha256', this.master_secret, <add> 'key expansion', <add> Buffer.concat([server_random, <add> this.client_random]), <add> 40); <add> this.client_writeKey = key_block.slice(0, 16); <add> this.client_writeIV = key_block.slice(32, 36); <add> }); <add> } <add> <add> createClientHello() { <add> const compressions = Buffer.from('0100', 'hex'); // null <add> const msg = addHandshakeHeader(0x01, Buffer.concat([ <add> this.version, this.client_random, this.ciphers, compressions <add> ])); <add> this.emit('handshake', msg); <add> return addRecordHeader(0x16, msg); <add> } <add> <add> createClientKeyExchange() { <add> const encrypted_pre_master_secret = crypto.publicEncrypt({ <add> key: this.server_cert, <add> padding: crypto.constants.RSA_PKCS1_PADDING <add> }, this.pre_master_secret); <add> const length = Buffer.alloc(2); <add> length.writeUIntBE(encrypted_pre_master_secret.length, 0, 2); <add> const msg = addHandshakeHeader(0x10, Buffer.concat([ <add> length, encrypted_pre_master_secret])); <add> this.emit('handshake', msg); <add> return addRecordHeader(0x16, msg); <add> } <add> <add> createFinished() { <add> const shasum = crypto.createHash('sha256'); <add> shasum.update(Buffer.concat(this.handshake_list)); <add> const message_hash = shasum.digest(); <add> const r = PRF12('sha256', this.master_secret, <add> 'client finished', message_hash, 12); <add> const msg = addHandshakeHeader(0x14, r); <add> this.emit('handshake', msg); <add> return addRecordHeader(0x16, msg); <add> } <add> <add> createIllegalHandshake() { <add> const illegal_handshake = Buffer.alloc(5); <add> return addRecordHeader(0x16, illegal_handshake); <add> } <add> <add> parseTLSFrame(buf) { <add> let offset = 0; <add> const record = buf.slice(offset, 5); <add> const type = record[0]; <add> const length = record.slice(3, 5).readUInt16BE(0); <add> offset += 5; <add> let remaining = buf.slice(offset, offset + length); <add> if (type === 0x16) { <add> do { <add> remaining = this.parseTLSHandshake(remaining); <add> } while (remaining.length > 0); <add> } <add> offset += length; <add> return buf.slice(offset); <add> } <add> <add> parseTLSHandshake(buf) { <add> let offset = 0; <add> const handshake_type = buf[offset]; <add> if (handshake_type === 0x02) { <add> const server_random = buf.slice(6, 6 + 32); <add> this.emit('server_random', server_random); <add> } <add> offset += 1; <add> const length = buf.readUIntBE(offset, 3); <add> offset += 3; <add> const handshake = buf.slice(0, offset + length); <add> this.emit('handshake', handshake); <add> offset += length; <add> const remaining = buf.slice(offset); <add> return remaining; <add> } <add> <add> encrypt(plain) { <add> const type = plain.slice(0, 1); <add> const version = plain.slice(1, 3); <add> const nonce = crypto.randomBytes(8); <add> const iv = Buffer.concat([this.client_writeIV.slice(0, 4), nonce]); <add> const bob = crypto.createCipheriv('aes-128-gcm', this.client_writeKey, iv); <add> const write_seq = Buffer.alloc(8); <add> write_seq.writeUInt32BE(this.write_seq++, 4); <add> const aad = Buffer.concat([write_seq, plain.slice(0, 5)]); <add> bob.setAAD(aad); <add> const encrypted1 = bob.update(plain.slice(5)); <add> const encrypted = Buffer.concat([encrypted1, bob.final()]); <add> const tag = bob.getAuthTag(); <add> const length = Buffer.alloc(2); <add> length.writeUInt16BE(nonce.length + encrypted.length + tag.length, 0); <add> return Buffer.concat([type, version, length, nonce, encrypted, tag]); <add> } <add>} <add> <add>function addRecordHeader(type, frame) { <add> const record_layer = Buffer.from('0003030000', 'hex'); <add> record_layer[0] = type; <add> record_layer.writeUInt16BE(frame.length, 3); <add> return Buffer.concat([record_layer, frame]); <add>} <add> <add>function addHandshakeHeader(type, msg) { <add> const handshake_header = Buffer.alloc(4); <add> handshake_header[0] = type; <add> handshake_header.writeUIntBE(msg.length, 1, 3); <add> return Buffer.concat([handshake_header, msg]); <add>} <add> <add>function PRF12(algo, secret, label, seed, size) { <add> const newSeed = Buffer.concat([Buffer.from(label, 'utf8'), seed]); <add> return P_hash(algo, secret, newSeed, size); <add>} <add> <add>function P_hash(algo, secret, seed, size) { <add> const result = Buffer.alloc(size); <add> let hmac = crypto.createHmac(algo, secret); <add> hmac.update(seed); <add> let a = hmac.digest(); <add> let j = 0; <add> while (j < size) { <add> hmac = crypto.createHmac(algo, secret); <add> hmac.update(a); <add> hmac.update(seed); <add> const b = hmac.digest(); <add> let todo = b.length; <add> if (j + todo > size) { <add> todo = size - j; <add> } <add> b.copy(result, j, 0, todo); <add> j += todo; <add> hmac = crypto.createHmac(algo, secret); <add> hmac.update(a); <add> a = hmac.digest(); <add> } <add> return result; <add>} <add> <add>exports.TestTLSSocket = TestTLSSocket; <ide><path>test/parallel/test-tls-write-error.js <add>'use strict'; <add>const common = require('../common'); <add>if (!common.hasCrypto) <add> common.skip('missing crypto'); <add> <add>const { TestTLSSocket, ccs } = require('../common/tls'); <add>const fixtures = require('../common/fixtures'); <add>const https = require('https'); <add> <add>// Regression test for an use-after-free bug in the TLS implementation that <add>// would occur when `SSL_write()` failed. <add>// Refs: https://github.com/nodejs-private/security/issues/189 <add> <add>const server_key = fixtures.readKey('agent1-key.pem'); <add>const server_cert = fixtures.readKey('agent1-cert.pem'); <add> <add>const opts = { <add> key: server_key, <add> cert: server_cert <add>}; <add> <add>const server = https.createServer(opts, (req, res) => { <add> res.write('hello'); <add>}).listen(0, common.mustCall(() => { <add> const client = new TestTLSSocket(server_cert); <add> <add> client.connect({ <add> host: 'localhost', <add> port: server.address().port <add> }, common.mustCall(() => { <add> const ch = client.createClientHello(); <add> client.write(ch); <add> })); <add> <add> client.once('data', common.mustCall((buf) => { <add> let remaining = buf; <add> do { <add> remaining = client.parseTLSFrame(remaining); <add> } while (remaining.length > 0); <add> <add> const cke = client.createClientKeyExchange(); <add> const finished = client.createFinished(); <add> const ill = client.createIllegalHandshake(); <add> const frames = Buffer.concat([ <add> cke, <add> ccs, <add> client.encrypt(finished), <add> client.encrypt(ill) <add> ]); <add> client.write(frames, common.mustCall(() => { <add> client.end(); <add> server.close(); <add> })); <add> })); <add>}));
2
Text
Text
update version requirements [ci skip]
0712efc6b3e44c9652b641d9ecccd8427631512b
<ide><path>README.md <ide> For detailed installation instructions, see the <ide> [documentation](https://spacy.io/usage). <ide> <ide> - **Operating system**: macOS / OS X · Linux · Windows (Cygwin, MinGW, Visual Studio) <del>- **Python version**: Python 2.7, 3.4+ (only 64 bit) <add>- **Python version**: Python 2.7, 3.5+ (only 64 bit) <ide> - **Package managers**: [pip] · [conda] (via `conda-forge`) <ide> <ide> [pip]: https://pypi.python.org/pypi/spacy <ide><path>website/docs/usage/index.md <ide> menu: <ide> - ['Changelog', 'changelog'] <ide> --- <ide> <del>spaCy is compatible with **64-bit CPython 2.7+/3.4+** and runs on <add>spaCy is compatible with **64-bit CPython 2.7+/3.5+** and runs on <ide> **Unix/Linux**, **macOS/OS X** and **Windows**. The latest spaCy releases are <ide> available over [pip](https://pypi.python.org/pypi/spacy) and <ide> [conda](https://anaconda.org/conda-forge/spacy).
2
Javascript
Javascript
make authentication work
7786e4fefbc4bc2f5f8301b8aaa89c8180ff8999
<ide><path>src/api.js <ide> * <ide> * @param {string|TypedAray} source Either a url to a PDF is located or a <ide> * typed array (Uint8Array) already populated with data. <add> * @param {Object} headers An object containing the http headers like this: <add> * { Authorization: "BASIC XXX" } <ide> * @return {Promise} A promise that is resolved with {PDFDocumentProxy} object. <ide> */ <ide> PDFJS.getDocument = function getDocument(source, headers) { <ide><path>src/core.js <ide> function getPdf(arg, callback) { <ide> <ide> var xhr = new XMLHttpRequest(); <ide> <add> xhr.open('GET', params.url); <ide> if(params.headers){ <del> //TODO: Code this, use xhr.setRequestHeader(key, value); <add> for(var property in params.headers){ <add> if(typeof(params.headers[property]) !== undefined){ <add> xhr.setRequestHeader(property, params.headers[property]); <add> } <add> } <ide> } <del> <del> xhr.open('GET', params.url); <ide> xhr.mozResponseType = xhr.responseType = 'arraybuffer'; <ide> var protocol = params.url.indexOf(':') < 0 ? window.location.protocol : <ide> params.url.substring(0, params.url.indexOf(':') + 1);
2
Javascript
Javascript
replace string concatenation with template
2f823340766b1df3fb1a7895b317c0545f02aeeb
<ide><path>test/parallel/test-assert.js <ide> try { <ide> code: 'ERR_INVALID_ARG_TYPE', <ide> type: TypeError, <ide> message: 'The "block" argument must be of type function. Received ' + <del> 'type ' + typeName(block) <add> `type ${typeName(block)}` <ide> })(e); <ide> } <ide>
1
PHP
PHP
start implementation of commandrunner
73a85be90dfeca181a735b7689c18fbafb22a4e3
<ide><path>src/Console/CommandRunner.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 3.5.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Console; <add> <add>use Cake\Console\CommandCollection; <add>use Cake\Http\BaseApplication; <add>use RuntimeException; <add> <add>/** <add> * Run CLI commands for the provided application. <add> */ <add>class CommandRunner <add>{ <add> protected $app, $root; <add> <add> /** <add> * Constructor <add> * <add> * @param \Cake\Http\BaseApplication $app The application to run CLI commands for. <add> * @param string $root The root command name to be removed from argv. <add> */ <add> public function __construct(BaseApplication $app, $root = 'cake') <add> { <add> $this->app = $app; <add> $this->root = $root; <add> } <add> <add> /** <add> * Run the command contained in $argv. <add> * <add> * @param array $argv The arguments from the CLI environment. <add> * @return int The exit code of the command. <add> * @throws \RuntimeException <add> */ <add> public function run(array $argv) <add> { <add> $this->app->bootstrap(); <add> <add> $commands = $this->app->console(new CommandCollection()); <add> if (!($commands instanceof CommandCollection)) { <add> $type = is_object($commands) ? get_class($commands) : gettype($commands); <add> throw new RuntimeException( <add> "The application's `console` method did not return a CommandCollection." . <add> " Got '{$type}' instead." <add> ); <add> } <add> if (empty($argv) || $argv[0] !== $this->root) { <add> $command = empty($argv) ? '' : " `{$argv[0]}`"; <add> throw new RuntimeException( <add> "Unknown root command{$command}. Was expecting `{$this->root}`." <add> ); <add> } <add> // Remove the root command <add> array_shift($argv); <add> <add> $shell = $this->getShell($commands, $argv); <add> } <add> <add> /** <add> * Get the shell instance for the argv list. <add> * <add> * @return \Cake\Console\Shell <add> */ <add> protected function getShell(CommandCollection $commands, array $argv) <add> { <add> $command = array_shift($argv); <add> if (!$commands->has($command)) { <add> throw new RuntimeException( <add> "Unknown command `{$this->root} {$command}`." . <add> " Run `{$this->root} --help` to get the list of valid commands." <add> ); <add> } <add> } <add>} <ide><path>src/Http/BaseApplication.php <ide> public function routes($routes) <ide> require $this->configDir . '/routes.php'; <ide> } <ide> <add> /** <add> * Define the console commands for an application. <add> * <add> * By default all commands in CakePHP, plugins and the application will be <add> * loaded using conventions based names. <add> * <add> * @param \Cake\Console\CommandCollection $commands The CommandCollection to add commands into. <add> * @return \Cake\Console\CommandCollection The updated collection. <add> */ <add> public function console($commands) <add> { <add> return $commands->addMany($commands->autoDiscover()); <add> } <add> <ide> /** <ide> * Invoke the application. <ide> * <ide><path>tests/TestCase/Console/CommandRunnerTest.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 3.5.0 <add> * @license http://www.opensource.org/licenses/mit-license.php MIT License <add> */ <add>namespace Cake\Test\Console; <add> <add>use Cake\Console\CommandCollection; <add>use Cake\Console\CommandRunner; <add>use Cake\Core\Configure; <add>use Cake\Http\BaseApplication; <add>use Cake\TestSuite\TestCase; <add> <add>/** <add> * Test case for the CommandCollection <add> */ <add>class CommandRunnerTest extends TestCase <add>{ <add> public function setUp() <add> { <add> parent::setUp(); <add> Configure::write('App.namespace', 'TestApp'); <add> $this->config = dirname(dirname(__DIR__)); <add> } <add> <add> /** <add> * Test that the console hook not returning a command collection <add> * raises an error. <add> * <add> * @expectedException \RuntimeException <add> * @expectedExceptionMessage The application's `console` method did not return a CommandCollection. <add> * @return void <add> */ <add> public function testRunConsoleHookFailure() <add> { <add> $app = $this->getMockBuilder(BaseApplication::class) <add> ->setMethods(['console', 'middleware', 'bootstrap']) <add> ->setConstructorArgs([$this->config]) <add> ->getMock(); <add> $runner = new CommandRunner($app); <add> $runner->run(['cake', '-h']); <add> } <add> <add> /** <add> * Test that running with empty argv fails <add> * <add> * @expectedException \RuntimeException <add> * @expectedExceptionMessage Unknown root command. Was expecting `cake` <add> * @return void <add> */ <add> public function testRunMissingRootCommand() <add> { <add> $app = $this->getMockBuilder(BaseApplication::class) <add> ->setMethods(['middleware', 'bootstrap']) <add> ->setConstructorArgs([$this->config]) <add> ->getMock(); <add> <add> $runner = new CommandRunner($app); <add> $runner->run([]); <add> } <add> <add> /** <add> * Test that running an unknown command raises an error. <add> * <add> * @expectedException \RuntimeException <add> * @expectedExceptionMessage Unknown root command `bad`. Was expecting `cake` <add> * @return void <add> */ <add> public function testRunInvalidRootCommand() <add> { <add> $app = $this->getMockBuilder(BaseApplication::class) <add> ->setMethods(['middleware', 'bootstrap']) <add> ->setConstructorArgs([$this->config]) <add> ->getMock(); <add> <add> $runner = new CommandRunner($app); <add> $runner->run(['bad', 'i18n']); <add> } <add> <add> /** <add> * Test that running an unknown command raises an error. <add> * <add> * @expectedException \RuntimeException <add> * @expectedExceptionMessage Unknown command `cake nope`. Run `cake --help` to get the list of valid commands. <add> * @return void <add> */ <add> public function testRunInvalidCommand() <add> { <add> $app = $this->getMockBuilder(BaseApplication::class) <add> ->setMethods(['middleware', 'bootstrap']) <add> ->setConstructorArgs([$this->config]) <add> ->getMock(); <add> <add> $runner = new CommandRunner($app); <add> $runner->run(['cake', 'nope', 'nope', 'nope']); <add> } <add> <add> /** <add> * Test using `cake --help` invokes the help command <add> * <add> * @return void <add> */ <add> public function testRunHelpLongOption() <add> { <add> $this->markTestIncomplete(); <add> } <add> <add> /** <add> * Test using `cake -h` invokes the help command <add> * <add> * @return void <add> */ <add> public function testRunHelpShortOption() <add> { <add> $this->markTestIncomplete(); <add> } <add> <add> /** <add> * Test using `cake --verson` invokes the version command <add> * <add> * @return void <add> */ <add> public function testRunVersionLongOption() <add> { <add> $this->markTestIncomplete(); <add> } <add> <add> /** <add> * Test using `cake -v` invokes the version command <add> * <add> * @return void <add> */ <add> public function testRunVersionShortOption() <add> { <add> $this->markTestIncomplete(); <add> } <add>}
3
Text
Text
fix typo in crypto.md
2dfd00081330603ba31f96b46c4aa83b31a8e518
<ide><path>doc/api/crypto.md <ide> added: v15.8.0 <ide> to the OpenSSL documentation for the [`BN_is_prime_ex`][] function `nchecks` <ide> options for more details. **Defaults**: `0` <ide> * `callback` {Function} <del> * `err` {Error} Set to an {Error} object if an error occured during check. <add> * `err` {Error} Set to an {Error} object if an error occurred during check. <ide> * `result` {boolean} `true` if the candidate is a prime with an error <ide> probability less than `0.25 ** options.checks`. <ide>
1
Text
Text
add section for non-interactive installation
9084cd21b167ee19f96cfb31911fb74f210584c9
<ide><path>docs/Installation.md <ide> chmod -R go-w "$(brew --prefix)/share/zsh" <ide> <ide> Create a Homebrew installation wherever you extract the tarball. Whichever `brew` command is called is where the packages will be installed. You can use this as you see fit, e.g. to have a system set of libs in the default prefix and tweaked formulae for development in `~/homebrew`. <ide> <add>### Unattended installation <add> <add>If you want a non-interactive run of the Homebrew installer that doesn't prompt for passwords (e.g. in automation scripts), prepend [`NONINTERACTIVE=1`](https://github.com/Homebrew/install/#install-homebrew-on-macos-or-linux) to the installation command. <add> <ide> ## Uninstallation <ide> <ide> Uninstallation is documented in the [FAQ](FAQ.md).
1
Text
Text
fix default value in guide [ci skip]
c59382b3b142c7225ce4ead04c0c85982120df8a
<ide><path>guides/source/configuring.md <ide> There are a few configuration options available in Active Support: <ide> <ide> * `config.active_support.test_order` sets the order that test cases are executed. Possible values are `:random` and `:sorted`. This option is set to `:random` in `config/environments/test.rb` in newly-generated applications. If you have an application that does not specify a `test_order`, it will default to `:sorted`, *until* Rails 5.0, when the default will become `:random`. <ide> <del>* `config.active_support.escape_html_entities_in_json` enables or disables the escaping of HTML entities in JSON serialization. Defaults to `false`. <add>* `config.active_support.escape_html_entities_in_json` enables or disables the escaping of HTML entities in JSON serialization. Defaults to `true`. <ide> <ide> * `config.active_support.use_standard_json_time_format` enables or disables serializing dates to ISO 8601 format. Defaults to `true`. <ide>
1
Text
Text
add plots to r guide
b1ef7ecfbfb17ebae424a62fa773ca0b677a097e
<ide><path>guide/english/r/plotting/index.md <add>--- <add>title: Plotting in R <add>--- <add>## Plotting <add> The base version of R allows us to make many types of plots! <add> The syntax for a simple scatterplot goes something like this: <add> ```r <add>plot(x, y) <add>``` <add>We create a graph using the plot() function and supply the two parameters, x and y, which are the two columns you want to plot in your dataset. <add> So in the mpg dataset that is available in the tidyverse library, if we wanted to make a scatterplot of the two variables 'cyl' and 'hwy': <add> ```r <add>library(tidyverse) <add>attach(mpg) <add>plot(cyl, hwy) <add>```
1
Java
Java
request toolbar layout after drawable loads
63c2ab3eb13c50e1cdd686b1f8913d569a7af53a
<ide><path>ReactAndroid/src/main/java/com/facebook/react/views/toolbar/ReactToolbar.java <ide> private class ActionIconControllerListener extends IconControllerListener { <ide> @Override <ide> protected void setDrawable(Drawable d) { <ide> mItem.setIcon(d); <add> ReactToolbar.this.requestLayout(); <ide> } <ide> } <ide>
1
Javascript
Javascript
remove unnecessary await
8711c5ca53b468d4a270bb4d627a3c813565b8b3
<ide><path>test/integration/profiling/test/index.test.js <ide> jest.setTimeout(1000 * 60 * 5) <ide> describe.skip('Profiling Usage', () => { <ide> beforeAll(async () => { <ide> // Delete file if it already exists <del> if (await fs.existsSync(profileEventsPath)) <del> await fs.unlink(profileEventsPath, () => { <add> if (fs.existsSync(profileEventsPath)) <add> fs.unlink(profileEventsPath, () => { <ide> console.log('Deleted Existing profile-events.json file') <ide> }) <ide>
1
Ruby
Ruby
get apps generated with working again
591eaf3b2c56ebb8a779c3ebbd1300a3f776f39a
<ide><path>railties/lib/rails/commands/server.rb <ide> :Port => 3000, <ide> :Host => "0.0.0.0", <ide> :environment => (ENV['RAILS_ENV'] || "development").dup, <del> :config => Rails.root + "/config.ru", <add> :config => "#{Rails.root}/config.ru", <ide> :detach => false, <ide> :debugger => false <ide> } <ide><path>railties/lib/rails/generators/rails/app/templates/config/boot.rb <ide> module Rails <ide> class << self <ide> def boot! <ide> unless booted? <del> preinitialize <del> pick_boot.run <add> root = File.expand_path('../..', __FILE__) <add> booter = File.exist?("#{root}/vendor/rails") ? VendorBoot : GemBoot <add> booter.new(root).run <ide> end <ide> end <ide> <ide> def booted? <ide> defined? Rails::Initializer <ide> end <del> <del> def pick_boot <del> (vendor_rails? ? VendorBoot : GemBoot).new <del> end <del> <del> def vendor_rails? <del> File.exist?("#{RAILS_ROOT}/vendor/rails") <del> end <del> <del> def preinitialize <del> load(preinitializer_path) if File.exist?(preinitializer_path) <del> end <del> <del> def preinitializer_path <del> "#{RAILS_ROOT}/config/preinitializer.rb" <del> end <ide> end <ide> <ide> class Boot <add> def initialize(root) <add> @root = root <add> end <add> <ide> def run <add> preinitialize <ide> set_load_paths <ide> load_initializer <ide> end <ide> <add> def preinitialize <add> path = "#{@root}/config/preinitializer.rb" <add> load(path) if File.exist?(path) <add> end <add> <ide> def set_load_paths <ide> %w( <ide> actionmailer/lib <ide> def set_load_paths <ide> end <ide> <ide> def framework_root_path <del> defined?(::RAILS_FRAMEWORK_ROOT) ? ::RAILS_FRAMEWORK_ROOT : "#{RAILS_ROOT}/vendor/rails" <add> defined?(::RAILS_FRAMEWORK_ROOT) ? ::RAILS_FRAMEWORK_ROOT : "#{@root}/vendor/rails" <ide> end <ide> end <ide> <ide> def install_gem_spec_stubs <ide> <ide> class GemBoot < Boot <ide> def load_initializer <del> self.class.load_rubygems <add> load_rubygems <ide> load_rails_gem <ide> require 'rails' <ide> end <ide> <ide> def load_rails_gem <del> if version = self.class.gem_version <add> if version = gem_version <ide> gem 'rails', version <ide> else <ide> gem 'rails' <ide> def load_rails_gem <ide> exit 1 <ide> end <ide> <del> class << self <del> def rubygems_version <del> Gem::RubyGemsVersion rescue nil <del> end <add> def rubygems_version <add> Gem::RubyGemsVersion rescue nil <add> end <ide> <del> def gem_version <del> if defined? RAILS_GEM_VERSION <del> RAILS_GEM_VERSION <del> elsif ENV.include?('RAILS_GEM_VERSION') <del> ENV['RAILS_GEM_VERSION'] <del> else <del> parse_gem_version(read_environment_rb) <del> end <add> def gem_version <add> if defined? RAILS_GEM_VERSION <add> RAILS_GEM_VERSION <add> elsif ENV.include?('RAILS_GEM_VERSION') <add> ENV['RAILS_GEM_VERSION'] <add> else <add> parse_gem_version(read_environment_rb) <ide> end <add> end <ide> <del> def load_rubygems <del> min_version = '1.3.2' <del> require 'rubygems' <del> unless rubygems_version >= min_version <del> $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) <del> exit 1 <del> end <del> <del> rescue LoadError <del> $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) <add> def load_rubygems <add> min_version = '1.3.2' <add> require 'rubygems' <add> unless rubygems_version >= min_version <add> $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) <ide> exit 1 <ide> end <ide> <del> def parse_gem_version(text) <del> $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ <del> end <add> rescue LoadError <add> $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) <add> exit 1 <add> end <ide> <del> private <del> def read_environment_rb <del> File.read("#{RAILS_ROOT}/config/environment.rb") <del> end <add> def parse_gem_version(text) <add> $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ <ide> end <add> <add> private <add> def read_environment_rb <add> File.read("#{@root}/config/environment.rb") <add> end <ide> end <ide> end <ide>
2
Python
Python
return ram and pricing as integers
72d32c3991a32f68d905da9f5a72748579abc1c3
<ide><path>libcloud/compute/drivers/maxihost.py <ide> import json <add>import re <ide> <ide> from libcloud.compute.base import Node, NodeDriver, NodeLocation <ide> from libcloud.compute.base import NodeSize, NodeImage <ide> def ex_stop_node(self, node): <ide> <ide> return res.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] <ide> <add> def destroy_node(self, node): <add> """ <add> Destroy a node. Currently just stop the node since <add> there is no API implementation for destroying a node <add> """ <add> params = {"type": "power_off"} <add> res = self.connection.request('/devices/%s/actions' % node.id, <add> params=params, method='PUT') <add> <add> return res.status in [httplib.OK, httplib.CREATED, httplib.ACCEPTED] <add> <ide> def reboot_node(self, node): <ide> """ <ide> Reboot a node. <ide> def _to_size(self, data): <ide> 'regions': data['regions'], <ide> 'pricing': data['pricing']} <ide> ram = data['specs']['memory']['total'] <del> return NodeSize(id=data['slug'], name=data['name'], ram=ram, <add> ram = re.sub("[^0-9]", "", ram) <add> return NodeSize(id=data['slug'], name=data['name'], ram=int(ram), <ide> disk=None, bandwidth=None, <del> price=data['pricing'], driver=self, extra=extra) <add> price=data['pricing']['usd_month'], <add> driver=self, extra=extra) <ide> <ide> def list_images(self): <ide> """
1
PHP
PHP
add integration test
12dad330ed505fa939eb50683bae795a7189246c
<ide><path>tests/Database/DatabaseSchemaBuilderIntegrationTest.php <add><?php <add> <add>use PHPUnit\Framework\TestCase; <add>use Illuminate\Database\Capsule\Manager as DB; <add> <add>class DatabaseSchemaBuilderIntegrationTest extends TestCase <add>{ <add> protected $db; <add> <add> /** <add> * Bootstrap database. <add> * <add> * @return void <add> */ <add> public function setUp() <add> { <add> $this->db = $db = new DB; <add> <add> $db->addConnection([ <add> 'driver' => 'sqlite', <add> 'database' => ':memory:', <add> ]); <add> <add> $db->setAsGlobal(); <add> <add> $container = new Illuminate\Container\Container; <add> $container->instance('db', $db->getDatabaseManager()); <add> Illuminate\Support\Facades\Facade::setFacadeApplication($container); <add> } <add> <add> public function tearDown() <add> { <add> Illuminate\Support\Facades\Facade::clearResolvedInstances(); <add> Illuminate\Support\Facades\Facade::setFacadeApplication(null); <add> } <add> <add> public function testDropAllTablesWorksWithForeignKeys() <add> { <add> $this->db->connection()->getSchemaBuilder()->create('table1', function ($table) { <add> $table->integer('id'); <add> $table->string('name'); <add> }); <add> <add> $this->db->connection()->getSchemaBuilder()->create('table2', function ($table) { <add> $table->integer('id'); <add> $table->string('user_id'); <add> $table->foreign('user_id')->references('id')->on('table1'); <add> }); <add> <add> $this->assertTrue($this->db->connection()->getSchemaBuilder()->hasTable('table1')); <add> $this->assertTrue($this->db->connection()->getSchemaBuilder()->hasTable('table2')); <add> <add> $this->db->connection()->getSchemaBuilder()->dropAllTables(); <add> <add> $this->assertFalse($this->db->connection()->getSchemaBuilder()->hasTable('table1')); <add> $this->assertFalse($this->db->connection()->getSchemaBuilder()->hasTable('table2')); <add> } <add>}
1
PHP
PHP
fix form tests
ab4fcbd01ea8a8dfdb10d02ab8e8c2fa44233d2e
<ide><path>tests/Html/FormBuilderTest.php <ide> public function testSelect() <ide> <ide> public function testFormCheckbox() <ide> { <add> $this->formBuilder->setSessionStore($session = m::mock('Illuminate\Session\Store')); <add> $session->shouldReceive('getOldInput')->with('foo')->andReturn(null); <add> $session->shouldReceive('getOldInput')->andReturn(array()); <add> $session->shouldReceive('hasOldInput')->andReturn(false); <add> <ide> $form1 = $this->formBuilder->input('checkbox', 'foo'); <ide> $form2 = $this->formBuilder->checkbox('foo'); <ide> $form3 = $this->formBuilder->checkbox('foo', 'foobar', true);
1
Text
Text
update the docs to reflect the nice \n handling
cfb232cff27da2dd46ec04a5bf6699ab1d1df91c
<ide><path>docs/sources/reference/commandline/cli.md <ide> Run a command in a new container <ide> <ide> Usage: docker run [OPTIONS] IMAGE[:TAG] [COMMAND] [ARG...] <ide> <del> -a, --attach=[]: Attach to stdin, stdout or stderr. <del> -c, --cpu-shares=0: CPU shares (relative weight) <del> --cidfile="": Write the container ID to the file <del> -d, --detach=false: Detached mode: Run container in the background, print new container id <del> --dns=[]: Set custom dns servers <del> --dns-search=[]: Set custom dns search domains <del> -e, --env=[]: Set environment variables <del> --entrypoint="": Overwrite the default entrypoint of the image <del> --env-file=[]: Read in a line delimited file of ENV variables <del> --expose=[]: Expose a port from the container without publishing it to your host <del> -h, --hostname="": Container host name <del> -i, --interactive=false: Keep stdin open even if not attached <del> --link=[]: Add link to another container (name:alias) <del> --lxc-conf=[]: (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1" <del> -m, --memory="": Memory limit (format: <number><optional unit>, where unit = b, k, m or g) <del> --name="": Assign a name to the container <del> --net="bridge": Set the Network mode for the container ('bridge': creates a new network stack for the container on the docker bridge, 'none': no networking for this container, 'container:<name|id>': reuses another container network stack), 'host': use the host network stack inside the container <del> -P, --publish-all=false: Publish all exposed ports to the host interfaces <del> -p, --publish=[]: Publish a container's port to the host (format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort) (use 'docker port' to see the actual mapping) <del> --privileged=false: Give extended privileges to this container <del> --rm=false: Automatically remove the container when it exits (incompatible with -d) <del> --sig-proxy=true: Proxify all received signal to the process (even in non-tty mode) <del> -t, --tty=false: Allocate a pseudo-tty <del> -u, --user="": Username or UID <del> -v, --volume=[]: Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container) <del> --volumes-from=[]: Mount volumes from the specified container(s) <del> -w, --workdir="": Working directory inside the container <add> -a, --attach=[] Attach to stdin, stdout or stderr. <add> -c, --cpu-shares=0 CPU shares (relative weight) <add> --cidfile="" Write the container ID to the file <add> -d, --detach=false Detached mode: Run container in the background, print new container id <add> --dns=[] Set custom dns servers <add> --dns-search=[] Set custom dns search domains <add> -e, --env=[] Set environment variables <add> --entrypoint="" Overwrite the default entrypoint of the image <add> --env-file=[] Read in a line delimited file of ENV variables <add> --expose=[] Expose a port from the container without publishing it to your host <add> -h, --hostname="" Container host name <add> -i, --interactive=false Keep stdin open even if not attached <add> --link=[] Add link to another container (name:alias) <add> --lxc-conf=[] (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1" <add> -m, --memory="" Memory limit (format: <number><optional unit>, where unit = b, k, m or g) <add> --name="" Assign a name to the container <add> --net="bridge" Set the Network mode for the container <add> 'bridge': creates a new network stack for the container on the docker bridge <add> 'none': no networking for this container <add> 'container:<name|id>': reuses another container network stack <add> 'host': use the host network stack inside the contaner <add> -p, --publish=[] Publish a container's port to the host <add> format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort <add> (use 'docker port' to see the actual mapping) <add> -P, --publish-all=false Publish all exposed ports to the host interfaces <add> --privileged=false Give extended privileges to this container <add> --rm=false Automatically remove the container when it exits (incompatible with -d) <add> --sig-proxy=true Proxify all received signal to the process (even in non-tty mode) <add> -t, --tty=false Allocate a pseudo-tty <add> -u, --user="" Username or UID <add> -v, --volume=[] Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container) <add> --volumes-from=[] Mount volumes from the specified container(s) <add> -w, --workdir="" Working directory inside the container <ide> <ide> The `docker run` command first `creates` a writeable container layer over the <ide> specified image, and then `starts` it using the specified command. That is, <ide><path>docs/sources/reference/run.md <ide> PID files): <ide> <ide> --dns=[] : Set custom dns servers for the container <ide> --net="bridge": Set the Network mode for the container ('bridge': creates a new network stack for the container on the docker bridge, 'none': no networking for this container, 'container:<name|id>': reuses another container network stack), 'host': use the host network stack inside the container <add> --net="bridge" Set the Network mode for the container <add> 'bridge': creates a new network stack for the container on the docker bridge <add> 'none': no networking for this container <add> 'container:<name|id>': reuses another container network stack <add> 'host': use the host network stack inside the contaner <ide> <ide> By default, all containers have networking enabled and they can make any <ide> outgoing connections. The operator can completely disable networking
2
Text
Text
update tutorial to use classname
6c1e8e8a668d30f02d423498b248541b938586e1
<ide><path>docs/docs/tutorial.md <ide> Let's build the `CommentBox` component, which is just a simple `<div>`: <ide> var CommentBox = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> Hello, world! I am a CommentBox. <ide> </div> <ide> ); <ide> Let's build skeletons for `CommentList` and `CommentForm` which will, again, be <ide> var CommentList = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="commentList"> <add> <div className="commentList"> <ide> Hello, world! I am a CommentList. <ide> </div> <ide> ); <ide> var CommentList = React.createClass({ <ide> var CommentForm = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="commentForm"> <add> <div className="commentForm"> <ide> Hello, world! I am a CommentForm. <ide> </div> <ide> ); <ide> Next, update the `CommentBox` component to use its new friends: <ide> var CommentBox = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList /> <ide> <CommentForm /> <ide> Let's create our third component, `Comment`. We will want to pass it the author <ide> var CommentList = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="commentList"> <add> <div className="commentList"> <ide> <Comment author="Pete Hunt">This is one comment</Comment> <ide> <Comment author="Jordan Walke">This is *another* comment</Comment> <ide> </div> <ide> Let's create the Comment component. It will read the data passed to it from the <ide> var Comment = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="comment"> <del> <h2 class="commentAuthor"> <add> <div className="comment"> <add> <h2 className="commentAuthor"> <ide> {this.props.author} <ide> </h2> <ide> {this.props.children} <ide> var converter = new Showdown.converter(); <ide> var Comment = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="comment"> <del> <h2 class="commentAuthor"> <add> <div className="comment"> <add> <h2 className="commentAuthor"> <ide> {this.props.author} <ide> </h2> <ide> {converter.makeHtml(this.props.children.toString())} <ide> var Comment = React.createClass({ <ide> render: function() { <ide> var rawMarkup = converter.makeHtml(this.props.children.toString()); <ide> return ( <del> <div class="comment"> <del> <h2 class="commentAuthor"> <add> <div className="comment"> <add> <h2 className="commentAuthor"> <ide> {this.props.author} <ide> </h2> <ide> <span dangerouslySetInnerHTML={{"{{"}}__html: rawMarkup}} /> <ide> We need to get this data into `CommentList` in a modular way. Modify `CommentBox <ide> var CommentBox = React.createClass({ <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.props.data} /> <ide> <CommentForm /> <ide> var CommentList = React.createClass({ <ide> return <Comment author={comment.author}>{comment.text}</Comment>; <ide> }); <ide> return ( <del> <div class="commentList"> <add> <div className="commentList"> <ide> {commentNodes} <ide> </div> <ide> ); <ide> var CommentBox = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.state.data} /> <ide> <CommentForm /> <ide> var CommentBox = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.state.data} /> <ide> <CommentForm /> <ide> var CommentBox = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.state.data} /> <ide> <CommentForm /> <ide> Now it's time to build the form. Our `CommentForm` component should ask the user <ide> var CommentForm = React.createClass({ <ide> render: function() { <ide> return ( <del> <form class="commentForm"> <add> <form className="commentForm"> <ide> <input type="text" placeholder="Your name" /> <ide> <input type="text" placeholder="Say something..." /> <ide> <input type="submit" /> <ide> var CommentForm = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <form class="commentForm" onSubmit={this.handleSubmit}> <add> <form className="commentForm" onSubmit={this.handleSubmit}> <ide> <input type="text" placeholder="Your name" ref="author" /> <ide> <input <ide> type="text" <ide> var CommentBox = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.state.data} /> <ide> <CommentForm <ide> var CommentForm = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <form class="commentForm" onSubmit={this.handleSubmit}> <add> <form className="commentForm" onSubmit={this.handleSubmit}> <ide> <input type="text" placeholder="Your name" ref="author" /> <ide> <input <ide> type="text" <ide> var CommentBox = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.state.data} /> <ide> <CommentForm <ide> var CommentBox = React.createClass({ <ide> }, <ide> render: function() { <ide> return ( <del> <div class="commentBox"> <add> <div className="commentBox"> <ide> <h1>Comments</h1> <ide> <CommentList data={this.state.data} /> <ide> <CommentForm
1
PHP
PHP
add docs for hasmany savestrategy
d187e539727bc5d8708d401aed08d2e1404d1b32
<ide><path>src/ORM/Table.php <ide> public function hasOne($associated, array $options = []) <ide> * When true records will be loaded and then deleted. <ide> * - conditions: array with a list of conditions to filter the join with <ide> * - sort: The order in which results for this association should be returned <add> * - saveStrategy: Either 'append' or 'replace'. When 'append' the current records <add> * are appended to any records in the database. When 'replace' associated records <add> * not in the current set will be removed. If the foreign key is a null able column <add> * or if `dependent` is true records will be orphaned. <ide> * - strategy: The strategy to be used for selecting results Either 'select' <ide> * or 'subquery'. If subquery is selected the query used to return results <ide> * in the source table will be used as conditions for getting rows in the
1
PHP
PHP
update authenticatesusers.php
a513aaa2da69d1d8619c10568b3c13e4e250c825
<ide><path>src/Illuminate/Foundation/Auth/AuthenticatesUsers.php <ide> public function login(Request $request) <ide> protected function validateLogin(Request $request) <ide> { <ide> $this->validate($request, [ <del> $this->username() => 'required', 'password' => 'required', <add> $this->username() => 'required|string', <add> 'password' => 'required|string', <ide> ]); <ide> } <ide>
1
Javascript
Javascript
fix bug of linter error
23dee756ca2382aae789cc4fc42dfdf9a28427c2
<ide><path>spec/context-menu-manager-spec.js <del>const ContextMenuManager = require("../src/context-menu-manager") <del> <del>describe("ContextMenuManager", function () { <del> let [contextMenu, parent, child, grandchild] = [] <del> <del> beforeEach(function () { <del> const {resourcePath} = atom.getLoadSettings() <del> contextMenu = new ContextMenuManager({keymapManager: atom.keymaps}) <del> contextMenu.initialize({resourcePath}) <del> <del> parent = document.createElement("div") <del> child = document.createElement("div") <del> grandchild = document.createElement("div") <del> parent.tabIndex = -1 <del> child.tabIndex = -1 <del> grandchild.tabIndex = -1 <del> parent.classList.add("parent") <del> child.classList.add("child") <del> grandchild.classList.add("grandchild") <del> child.appendChild(grandchild) <del> parent.appendChild(child) <del> <del> document.body.appendChild(parent) <del> }) <del> <del> afterEach(function () { <del> document.body.blur() <del> document.body.removeChild(parent) <del> }) <del> <del> describe("::add(itemsBySelector)", function () { <del> it("can add top-level menu items that can be removed with the returned disposable", function () { <add>const ContextMenuManager = require('../src/context-menu-manager'); <add> <add>describe('ContextMenuManager', function() { <add> let [contextMenu, parent, child, grandchild] = []; <add> <add> beforeEach(function() { <add> const { resourcePath } = atom.getLoadSettings(); <add> contextMenu = new ContextMenuManager({ keymapManager: atom.keymaps }); <add> contextMenu.initialize({ resourcePath }); <add> <add> parent = document.createElement('div'); <add> child = document.createElement('div'); <add> grandchild = document.createElement('div'); <add> parent.tabIndex = -1; <add> child.tabIndex = -1; <add> grandchild.tabIndex = -1; <add> parent.classList.add('parent'); <add> child.classList.add('child'); <add> grandchild.classList.add('grandchild'); <add> child.appendChild(grandchild); <add> parent.appendChild(child); <add> <add> document.body.appendChild(parent); <add> }); <add> <add> afterEach(function() { <add> document.body.blur(); <add> document.body.removeChild(parent); <add> }); <add> <add> describe('::add(itemsBySelector)', function() { <add> it('can add top-level menu items that can be removed with the returned disposable', function() { <ide> const disposable = contextMenu.add({ <del> ".parent": [{label: "A", command: "a"}], <del> ".child": [{label: "B", command: "b"}], <del> ".grandchild": [{label: "C", command: "c"}], <del> }) <add> '.parent': [{ label: 'A', command: 'a' }], <add> '.child': [{ label: 'B', command: 'b' }], <add> '.grandchild': [{ label: 'C', command: 'c' }] <add> }); <ide> <ide> expect(contextMenu.templateForElement(grandchild)).toEqual([ <del> {label: "C", id: "C", command: "c"}, <del> {label: "B", id: "B", command: "b"}, <del> {label: "A", id: "A", command: "a"}, <del> ]) <add> { label: 'C', id: 'C', command: 'c' }, <add> { label: 'B', id: 'B', command: 'b' }, <add> { label: 'A', id: 'A', command: 'a' } <add> ]); <ide> <del> disposable.dispose() <del> expect(contextMenu.templateForElement(grandchild)).toEqual([]) <del> }) <add> disposable.dispose(); <add> expect(contextMenu.templateForElement(grandchild)).toEqual([]); <add> }); <ide> <del> it("can add submenu items to existing menus that can be removed with the returned disposable", function () { <add> it('can add submenu items to existing menus that can be removed with the returned disposable', function() { <ide> const disposable1 = contextMenu.add({ <del> ".grandchild": [{label: "A", submenu: [{label: "B", command: "b"}]}], <del> }) <add> '.grandchild': [{ label: 'A', submenu: [{ label: 'B', command: 'b' }] }] <add> }); <ide> const disposable2 = contextMenu.add({ <del> ".grandchild": [{label: "A", submenu: [{label: "C", command: "c"}]}], <del> }) <add> '.grandchild': [{ label: 'A', submenu: [{ label: 'C', command: 'c' }] }] <add> }); <ide> <ide> expect(contextMenu.templateForElement(grandchild)).toEqual([ <ide> { <del> label: "A", <del> id: "A", <add> label: 'A', <add> id: 'A', <ide> submenu: [ <del> {label: "B", id: "B", command: "b"}, <del> {label: "C", id: "C", command: "c"}, <del> ], <del> }, <del> ]) <add> { label: 'B', id: 'B', command: 'b' }, <add> { label: 'C', id: 'C', command: 'c' } <add> ] <add> } <add> ]); <ide> <del> disposable2.dispose() <add> disposable2.dispose(); <ide> expect(contextMenu.templateForElement(grandchild)).toEqual([ <ide> { <del> label: "A", <del> id: "A", <del> submenu: [{label: "B", id: "B", command: "b"}], <del> }, <del> ]) <add> label: 'A', <add> id: 'A', <add> submenu: [{ label: 'B', id: 'B', command: 'b' }] <add> } <add> ]); <ide> <del> disposable1.dispose() <del> expect(contextMenu.templateForElement(grandchild)).toEqual([]) <del> }) <add> disposable1.dispose(); <add> expect(contextMenu.templateForElement(grandchild)).toEqual([]); <add> }); <ide> <del> it("favors the most specific / recently added item in the case of a duplicate label", function () { <del> grandchild.classList.add("foo") <add> it('favors the most specific / recently added item in the case of a duplicate label', function() { <add> grandchild.classList.add('foo'); <ide> <ide> const disposable1 = contextMenu.add({ <del> ".grandchild": [{label: "A", command: "a"}], <del> }) <add> '.grandchild': [{ label: 'A', command: 'a' }] <add> }); <ide> const disposable2 = contextMenu.add({ <del> ".grandchild.foo": [{label: "A", command: "b"}], <del> }) <add> '.grandchild.foo': [{ label: 'A', command: 'b' }] <add> }); <ide> const disposable3 = contextMenu.add({ <del> ".grandchild": [{label: "A", command: "c"}], <del> }) <add> '.grandchild': [{ label: 'A', command: 'c' }] <add> }); <ide> <ide> contextMenu.add({ <del> ".child": [{label: "A", command: "d"}], <del> }) <add> '.child': [{ label: 'A', command: 'd' }] <add> }); <ide> <del> expect(contextMenu.templateForElement(grandchild)).toEqual([{label: "A", id: "A", command: "b"}]) <add> expect(contextMenu.templateForElement(grandchild)).toEqual([ <add> { label: 'A', id: 'A', command: 'b' } <add> ]); <ide> <del> disposable2.dispose() <del> expect(contextMenu.templateForElement(grandchild)).toEqual([{label: "A", id: "A", command: "c"}]) <add> disposable2.dispose(); <add> expect(contextMenu.templateForElement(grandchild)).toEqual([ <add> { label: 'A', id: 'A', command: 'c' } <add> ]); <ide> <del> disposable3.dispose() <del> expect(contextMenu.templateForElement(grandchild)).toEqual([{label: "A", id: "A", command: "a"}]) <add> disposable3.dispose(); <add> expect(contextMenu.templateForElement(grandchild)).toEqual([ <add> { label: 'A', id: 'A', command: 'a' } <add> ]); <ide> <del> disposable1.dispose() <del> expect(contextMenu.templateForElement(grandchild)).toEqual([{label: "A", id: "A", command: "d"}]) <del> }) <add> disposable1.dispose(); <add> expect(contextMenu.templateForElement(grandchild)).toEqual([ <add> { label: 'A', id: 'A', command: 'd' } <add> ]); <add> }); <ide> <del> it("allows multiple separators, but not adjacent to each other", function () { <add> it('allows multiple separators, but not adjacent to each other', function() { <ide> contextMenu.add({ <del> ".grandchild": [ <del> {label: "A", command: "a"}, <del> {type: "separator"}, <del> {type: "separator"}, <del> {label: "B", command: "b"}, <del> {type: "separator"}, <del> {type: "separator"}, <del> {label: "C", command: "c"}, <del> ], <del> }) <add> '.grandchild': [ <add> { label: 'A', command: 'a' }, <add> { type: 'separator' }, <add> { type: 'separator' }, <add> { label: 'B', command: 'b' }, <add> { type: 'separator' }, <add> { type: 'separator' }, <add> { label: 'C', command: 'c' } <add> ] <add> }); <ide> <ide> expect(contextMenu.templateForElement(grandchild)).toEqual([ <del> {label: "A", id: "A", command: "a"}, <del> {type: "separator"}, <del> {label: "B", id: "B", command: "b"}, <del> {type: "separator"}, <del> {label: "C", id: "C", command: "c"}, <del> ]) <del> }) <del> <del> it("excludes items marked for display in devMode unless in dev mode", function () { <add> { label: 'A', id: 'A', command: 'a' }, <add> { type: 'separator' }, <add> { label: 'B', id: 'B', command: 'b' }, <add> { type: 'separator' }, <add> { label: 'C', id: 'C', command: 'c' } <add> ]); <add> }); <add> <add> it('excludes items marked for display in devMode unless in dev mode', function() { <ide> contextMenu.add({ <del> ".grandchild": [ <del> {label: "A", command: "a", devMode: true}, <del> {label: "B", command: "b", devMode: false}, <del> ], <del> }) <add> '.grandchild': [ <add> { label: 'A', command: 'a', devMode: true }, <add> { label: 'B', command: 'b', devMode: false } <add> ] <add> }); <ide> <del> expect(contextMenu.templateForElement(grandchild)).toEqual([{label: "B", id: "B", command: "b"}]) <add> expect(contextMenu.templateForElement(grandchild)).toEqual([ <add> { label: 'B', id: 'B', command: 'b' } <add> ]); <ide> <del> contextMenu.devMode = true <add> contextMenu.devMode = true; <ide> expect(contextMenu.templateForElement(grandchild)).toEqual([ <del> {label: "A", id: "A", command: "a"}, <del> {label: "B", id: "B", command: "b"}, <del> ]) <del> }) <add> { label: 'A', id: 'A', command: 'a' }, <add> { label: 'B', id: 'B', command: 'b' } <add> ]); <add> }); <ide> <del> it("allows items to be associated with `created` hooks which are invoked on template construction with the item and event", function () { <del> let createdEvent = null <add> it('allows items to be associated with `created` hooks which are invoked on template construction with the item and event', function() { <add> let createdEvent = null; <ide> <ide> const item = { <del> label: "A", <del> command: "a", <add> label: 'A', <add> command: 'a', <ide> created(event) { <del> this.command = "b" <del> createdEvent = event <del> }, <del> } <add> this.command = 'b'; <add> createdEvent = event; <add> } <add> }; <ide> <del> contextMenu.add({".grandchild": [item]}) <add> contextMenu.add({ '.grandchild': [item] }); <ide> <del> const dispatchedEvent = {target: grandchild} <del> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([{label: "A", id: "A", command: "b"}]) <del> expect(item.command).toBe("a") // doesn't modify original item template <del> expect(createdEvent).toBe(dispatchedEvent) <del> }) <add> const dispatchedEvent = { target: grandchild }; <add> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <add> { label: 'A', id: 'A', command: 'b' } <add> ]); <add> expect(item.command).toBe('a'); // doesn't modify original item template <add> expect(createdEvent).toBe(dispatchedEvent); <add> }); <ide> <del> it("allows items to be associated with `shouldDisplay` hooks which are invoked on construction to determine whether the item should be included", function () { <del> let shouldDisplayEvent = null <del> let shouldDisplay = true <add> it('allows items to be associated with `shouldDisplay` hooks which are invoked on construction to determine whether the item should be included', function() { <add> let shouldDisplayEvent = null; <add> let shouldDisplay = true; <ide> <ide> const item = { <del> label: "A", <del> command: "a", <add> label: 'A', <add> command: 'a', <ide> shouldDisplay(event) { <del> this.foo = "bar" <del> shouldDisplayEvent = event <del> return shouldDisplay <del> }, <del> } <del> contextMenu.add({".grandchild": [item]}) <del> <del> const dispatchedEvent = {target: grandchild} <del> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([{label: "A", id: "A", command: "a"}]) <del> expect(item.foo).toBeUndefined() // doesn't modify original item template <del> expect(shouldDisplayEvent).toBe(dispatchedEvent) <add> this.foo = 'bar'; <add> shouldDisplayEvent = event; <add> return shouldDisplay; <add> } <add> }; <add> contextMenu.add({ '.grandchild': [item] }); <add> <add> const dispatchedEvent = { target: grandchild }; <add> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <add> { label: 'A', id: 'A', command: 'a' } <add> ]); <add> expect(item.foo).toBeUndefined(); // doesn't modify original item template <add> expect(shouldDisplayEvent).toBe(dispatchedEvent); <ide> <del> shouldDisplay = false <del> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([]) <del> }) <add> shouldDisplay = false; <add> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([]); <add> }); <ide> <del> it("prunes a trailing separator", function () { <add> it('prunes a trailing separator', function() { <ide> contextMenu.add({ <del> ".grandchild": [ <del> {label: "A", command: "a"}, <del> {type: "separator"}, <del> {label: "B", command: "b"}, <del> {type: "separator"}, <del> ], <del> }) <del> <del> expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3) <del> }) <del> <del> it("prunes a leading separator", function () { <add> '.grandchild': [ <add> { label: 'A', command: 'a' }, <add> { type: 'separator' }, <add> { label: 'B', command: 'b' }, <add> { type: 'separator' } <add> ] <add> }); <add> <add> expect(contextMenu.templateForEvent({ target: grandchild }).length).toBe( <add> 3 <add> ); <add> }); <add> <add> it('prunes a leading separator', function() { <ide> contextMenu.add({ <del> ".grandchild": [ <del> {type: "separator"}, <del> {label: "A", command: "a"}, <del> {type: "separator"}, <del> {label: "B", command: "b"}, <del> ], <del> }) <del> <del> expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3) <del> }) <del> <del> it("prunes duplicate separators", function () { <add> '.grandchild': [ <add> { type: 'separator' }, <add> { label: 'A', command: 'a' }, <add> { type: 'separator' }, <add> { label: 'B', command: 'b' } <add> ] <add> }); <add> <add> expect(contextMenu.templateForEvent({ target: grandchild }).length).toBe( <add> 3 <add> ); <add> }); <add> <add> it('prunes duplicate separators', function() { <ide> contextMenu.add({ <del> ".grandchild": [ <del> {label: "A", command: "a"}, <del> {type: "separator"}, <del> {type: "separator"}, <del> {label: "B", command: "b"}, <del> ], <del> }) <del> <del> expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3) <del> }) <del> <del> it("prunes all redundant separators", function () { <add> '.grandchild': [ <add> { label: 'A', command: 'a' }, <add> { type: 'separator' }, <add> { type: 'separator' }, <add> { label: 'B', command: 'b' } <add> ] <add> }); <add> <add> expect(contextMenu.templateForEvent({ target: grandchild }).length).toBe( <add> 3 <add> ); <add> }); <add> <add> it('prunes all redundant separators', function() { <ide> contextMenu.add({ <del> ".grandchild": [ <del> {type: "separator"}, <del> {type: "separator"}, <del> {label: "A", command: "a"}, <del> {type: "separator"}, <del> {type: "separator"}, <del> {label: "B", command: "b"}, <del> {label: "C", command: "c"}, <del> {type: "separator"}, <del> {type: "separator"}, <del> ], <del> }) <del> <del> expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(4) <del> }) <del> <del> it("throws an error when the selector is invalid", function () { <del> let addError = null <add> '.grandchild': [ <add> { type: 'separator' }, <add> { type: 'separator' }, <add> { label: 'A', command: 'a' }, <add> { type: 'separator' }, <add> { type: 'separator' }, <add> { label: 'B', command: 'b' }, <add> { label: 'C', command: 'c' }, <add> { type: 'separator' }, <add> { type: 'separator' } <add> ] <add> }); <add> <add> expect(contextMenu.templateForEvent({ target: grandchild }).length).toBe( <add> 4 <add> ); <add> }); <add> <add> it('throws an error when the selector is invalid', function() { <add> let addError = null; <ide> try { <del> contextMenu.add({"<>": [{label: "A", command: "a"}]}) <add> contextMenu.add({ '<>': [{ label: 'A', command: 'a' }] }); <ide> } catch (error) { <del> addError = error <add> addError = error; <ide> } <del> expect(addError.message).toContain("<>") <del> }) <add> expect(addError.message).toContain('<>'); <add> }); <ide> <del> it("calls `created` hooks for submenu items", function () { <add> it('calls `created` hooks for submenu items', function() { <ide> const item = { <del> label: "A", <del> command: "B", <add> label: 'A', <add> command: 'B', <ide> submenu: [ <ide> { <del> label: "C", <add> label: 'C', <ide> created(event) { <del> this.label = "D" <del> }, <del> }, <del> ], <del> } <del> contextMenu.add({".grandchild": [item]}) <del> <del> const dispatchedEvent = {target: grandchild} <add> this.label = 'D'; <add> } <add> } <add> ] <add> }; <add> contextMenu.add({ '.grandchild': [item] }); <add> <add> const dispatchedEvent = { target: grandchild }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "A", <del> id: "A", <del> command: "B", <add> label: 'A', <add> id: 'A', <add> command: 'B', <ide> submenu: [ <ide> { <del> label: "D", <del> id: "D", <del> }, <del> ], <del> }, <del> ]) <del> }) <del> }) <del> <del> describe("::templateForEvent(target)", function () { <del> let [keymaps, item] = [] <del> <del> beforeEach(function () { <del> keymaps = atom.keymaps.add("source", { <del> ".child": { <del> "ctrl-a": "test:my-command", <del> "shift-b": "test:my-other-command", <del> }, <del> }) <add> label: 'D', <add> id: 'D' <add> } <add> ] <add> } <add> ]); <add> }); <add> }); <add> <add> describe('::templateForEvent(target)', function() { <add> let [keymaps, item] = []; <add> <add> beforeEach(function() { <add> keymaps = atom.keymaps.add('source', { <add> '.child': { <add> 'ctrl-a': 'test:my-command', <add> 'shift-b': 'test:my-other-command' <add> } <add> }); <ide> item = { <del> label: "My Command", <del> command: "test:my-command", <add> label: 'My Command', <add> command: 'test:my-command', <ide> submenu: [ <ide> { <del> label: "My Other Command", <del> command: "test:my-other-command", <del> }, <del> ], <del> } <del> contextMenu.add({".parent": [item]}) <del> }) <del> <del> afterEach(() => keymaps.dispose()) <del> <del> it("adds Electron-style accelerators to items that have keybindings", function () { <del> child.focus() <del> const dispatchedEvent = {target: child} <add> label: 'My Other Command', <add> command: 'test:my-other-command' <add> } <add> ] <add> }; <add> contextMenu.add({ '.parent': [item] }); <add> }); <add> <add> afterEach(() => keymaps.dispose()); <add> <add> it('adds Electron-style accelerators to items that have keybindings', function() { <add> child.focus(); <add> const dispatchedEvent = { target: child }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "My Command", <del> id: "My Command", <del> command: "test:my-command", <del> accelerator: "Ctrl+A", <add> label: 'My Command', <add> id: 'My Command', <add> command: 'test:my-command', <add> accelerator: 'Ctrl+A', <ide> submenu: [ <ide> { <del> label: "My Other Command", <del> id: "My Other Command", <del> command: "test:my-other-command", <del> accelerator: "Shift+B", <del> }, <del> ], <del> }, <del> ]) <del> }) <del> <del> it("adds accelerators when a parent node has key bindings for a given command", function () { <del> grandchild.focus() <del> const dispatchedEvent = {target: grandchild} <add> label: 'My Other Command', <add> id: 'My Other Command', <add> command: 'test:my-other-command', <add> accelerator: 'Shift+B' <add> } <add> ] <add> } <add> ]); <add> }); <add> <add> it('adds accelerators when a parent node has key bindings for a given command', function() { <add> grandchild.focus(); <add> const dispatchedEvent = { target: grandchild }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "My Command", <del> id: "My Command", <del> command: "test:my-command", <del> accelerator: "Ctrl+A", <add> label: 'My Command', <add> id: 'My Command', <add> command: 'test:my-command', <add> accelerator: 'Ctrl+A', <ide> submenu: [ <ide> { <del> label: "My Other Command", <del> id: "My Other Command", <del> command: "test:my-other-command", <del> accelerator: "Shift+B", <del> }, <del> ], <del> }, <del> ]) <del> }) <del> <del> it("does not add accelerators when a child node has key bindings for a given command", function () { <del> parent.focus() <del> const dispatchedEvent = {target: parent} <add> label: 'My Other Command', <add> id: 'My Other Command', <add> command: 'test:my-other-command', <add> accelerator: 'Shift+B' <add> } <add> ] <add> } <add> ]); <add> }); <add> <add> it('does not add accelerators when a child node has key bindings for a given command', function() { <add> parent.focus(); <add> const dispatchedEvent = { target: parent }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "My Command", <del> id: "My Command", <del> command: "test:my-command", <add> label: 'My Command', <add> id: 'My Command', <add> command: 'test:my-command', <ide> submenu: [ <ide> { <del> label: "My Other Command", <del> id: "My Other Command", <del> command: "test:my-other-command", <del> }, <del> ], <del> }, <del> ]) <del> }) <del> <del> it("adds accelerators based on focus, not context menu target", function () { <del> grandchild.focus() <del> const dispatchedEvent = {target: parent} <add> label: 'My Other Command', <add> id: 'My Other Command', <add> command: 'test:my-other-command' <add> } <add> ] <add> } <add> ]); <add> }); <add> <add> it('adds accelerators based on focus, not context menu target', function() { <add> grandchild.focus(); <add> const dispatchedEvent = { target: parent }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "My Command", <del> id: "My Command", <del> command: "test:my-command", <del> accelerator: "Ctrl+A", <add> label: 'My Command', <add> id: 'My Command', <add> command: 'test:my-command', <add> accelerator: 'Ctrl+A', <ide> submenu: [ <ide> { <del> label: "My Other Command", <del> id: "My Other Command", <del> command: "test:my-other-command", <del> accelerator: "Shift+B", <del> }, <del> ], <del> }, <del> ]) <del> }) <del> <del> it("does not add accelerators for multi-keystroke key bindings", function () { <del> atom.keymaps.add("source", { <del> ".child": { <del> "ctrl-a ctrl-b": "test:multi-keystroke-command", <del> }, <del> }) <del> contextMenu.clear() <add> label: 'My Other Command', <add> id: 'My Other Command', <add> command: 'test:my-other-command', <add> accelerator: 'Shift+B' <add> } <add> ] <add> } <add> ]); <add> }); <add> <add> it('does not add accelerators for multi-keystroke key bindings', function() { <add> atom.keymaps.add('source', { <add> '.child': { <add> 'ctrl-a ctrl-b': 'test:multi-keystroke-command' <add> } <add> }); <add> contextMenu.clear(); <ide> contextMenu.add({ <del> ".parent": [ <add> '.parent': [ <ide> { <del> label: "Multi-keystroke command", <del> command: "test:multi-keystroke-command", <del> }, <del> ], <del> }) <add> label: 'Multi-keystroke command', <add> command: 'test:multi-keystroke-command' <add> } <add> ] <add> }); <ide> <del> child.focus() <add> child.focus(); <ide> <del> const label = process.platform === "darwin" ? "⌃A ⌃B" : "Ctrl+A Ctrl+B" <del> expect(contextMenu.templateForEvent({target: child})).toEqual([ <add> const label = process.platform === 'darwin' ? '⌃A ⌃B' : 'Ctrl+A Ctrl+B'; <add> expect(contextMenu.templateForEvent({ target: child })).toEqual([ <ide> { <ide> label: `Multi-keystroke command [${label}]`, <ide> id: `Multi-keystroke command`, <del> command: "test:multi-keystroke-command", <del> }, <del> ]) <del> }) <del> }) <del> <del> describe("::templateForEvent(target) (sorting)", function () { <del> it("applies simple sorting rules", function () { <add> command: 'test:multi-keystroke-command' <add> } <add> ]); <add> }); <add> }); <add> <add> describe('::templateForEvent(target) (sorting)', function() { <add> it('applies simple sorting rules', function() { <ide> contextMenu.add({ <del> ".parent": [ <add> '.parent': [ <ide> { <del> label: "My Command", <del> command: "test:my-command", <del> after: ["test:my-other-command"], <add> label: 'My Command', <add> command: 'test:my-command', <add> after: ['test:my-other-command'] <ide> }, <ide> { <del> label: "My Other Command", <del> command: "test:my-other-command", <del> }, <del> ], <del> }) <del> const dispatchedEvent = {target: parent} <add> label: 'My Other Command', <add> command: 'test:my-other-command' <add> } <add> ] <add> }); <add> const dispatchedEvent = { target: parent }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "My Other Command", <del> id: "My Other Command", <del> command: "test:my-other-command", <add> label: 'My Other Command', <add> id: 'My Other Command', <add> command: 'test:my-other-command' <ide> }, <ide> { <del> label: "My Command", <del> id: "My Command", <del> command: "test:my-command", <del> after: ["test:my-other-command"], <del> }, <del> ]) <del> }) <del> <del> it("applies sorting rules recursively to submenus", function () { <add> label: 'My Command', <add> id: 'My Command', <add> command: 'test:my-command', <add> after: ['test:my-other-command'] <add> } <add> ]); <add> }); <add> <add> it('applies sorting rules recursively to submenus', function() { <ide> contextMenu.add({ <del> ".parent": [ <add> '.parent': [ <ide> { <del> label: "Parent", <add> label: 'Parent', <ide> submenu: [ <ide> { <del> label: "My Command", <del> command: "test:my-command", <del> after: ["test:my-other-command"], <add> label: 'My Command', <add> command: 'test:my-command', <add> after: ['test:my-other-command'] <ide> }, <ide> { <del> label: "My Other Command", <del> command: "test:my-other-command", <del> }, <del> ], <del> }, <del> ], <del> }) <del> const dispatchedEvent = {target: parent} <add> label: 'My Other Command', <add> command: 'test:my-other-command' <add> } <add> ] <add> } <add> ] <add> }); <add> const dispatchedEvent = { target: parent }; <ide> expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual([ <ide> { <del> label: "Parent", <add> label: 'Parent', <ide> id: `Parent`, <ide> submenu: [ <ide> { <del> label: "My Other Command", <del> id: "My Other Command", <del> command: "test:my-other-command", <add> label: 'My Other Command', <add> id: 'My Other Command', <add> command: 'test:my-other-command' <ide> }, <ide> { <del> label: "My Command", <del> id: "My Command", <del> command: "test:my-command", <del> after: ["test:my-other-command"], <del> }, <del> ], <del> }, <del> ]) <del> }) <del> }) <del>}) <add> label: 'My Command', <add> id: 'My Command', <add> command: 'test:my-command', <add> after: ['test:my-other-command'] <add> } <add> ] <add> } <add> ]); <add> }); <add> }); <add>}); <ide><path>spec/menu-manager-spec.js <del>const path = require("path") <del>const MenuManager = require("../src/menu-manager") <add>const path = require('path'); <add>const MenuManager = require('../src/menu-manager'); <ide> <del>describe("MenuManager", function () { <del> let menu = null <add>describe('MenuManager', function() { <add> let menu = null; <ide> <del> beforeEach(function () { <add> beforeEach(function() { <ide> menu = new MenuManager({ <ide> keymapManager: atom.keymaps, <del> packageManager: atom.packages, <del> }) <del> spyOn(menu, "sendToBrowserProcess") // Do not modify Atom's actual menus <del> menu.initialize({resourcePath: atom.getLoadSettings().resourcePath}) <del> }) <del> <del> describe("::add(items)", function () { <del> it("can add new menus that can be removed with the returned disposable", function () { <del> const disposable = menu.add([{label: "A", submenu: [{label: "B", command: "b"}]}]) <del> expect(menu.template).toEqual([{label: "A", id: "A", submenu: [{label: "B", id: "B", command: "b"}]}]) <del> disposable.dispose() <del> expect(menu.template).toEqual([]) <del> }) <del> <del> it("can add submenu items to existing menus that can be removed with the returned disposable", function () { <del> const disposable1 = menu.add([{label: "A", submenu: [{label: "B", command: "b"}]}]) <add> packageManager: atom.packages <add> }); <add> spyOn(menu, 'sendToBrowserProcess'); // Do not modify Atom's actual menus <add> menu.initialize({ resourcePath: atom.getLoadSettings().resourcePath }); <add> }); <add> <add> describe('::add(items)', function() { <add> it('can add new menus that can be removed with the returned disposable', function() { <add> const disposable = menu.add([ <add> { label: 'A', submenu: [{ label: 'B', command: 'b' }] } <add> ]); <add> expect(menu.template).toEqual([ <add> { <add> label: 'A', <add> id: 'A', <add> submenu: [{ label: 'B', id: 'B', command: 'b' }] <add> } <add> ]); <add> disposable.dispose(); <add> expect(menu.template).toEqual([]); <add> }); <add> <add> it('can add submenu items to existing menus that can be removed with the returned disposable', function() { <add> const disposable1 = menu.add([ <add> { label: 'A', submenu: [{ label: 'B', command: 'b' }] } <add> ]); <ide> const disposable2 = menu.add([ <ide> { <del> label: "A", <del> submenu: [{label: "C", submenu: [{label: "D", command: "d"}]}], <del> }, <del> ]) <add> label: 'A', <add> submenu: [{ label: 'C', submenu: [{ label: 'D', command: 'd' }] }] <add> } <add> ]); <ide> const disposable3 = menu.add([ <ide> { <del> label: "A", <del> submenu: [{label: "C", submenu: [{label: "E", command: "e"}]}], <del> }, <del> ]) <add> label: 'A', <add> submenu: [{ label: 'C', submenu: [{ label: 'E', command: 'e' }] }] <add> } <add> ]); <ide> <ide> expect(menu.template).toEqual([ <ide> { <del> label: "A", <del> id: "A", <add> label: 'A', <add> id: 'A', <ide> submenu: [ <del> {label: "B", id: "B", command: "b"}, <add> { label: 'B', id: 'B', command: 'b' }, <ide> { <del> label: "C", <del> id: "C", <add> label: 'C', <add> id: 'C', <ide> submenu: [ <del> {label: "D", id: "D", command: "d"}, <del> {label: "E", id: "E", command: "e"}, <del> ], <del> }, <del> ], <del> }, <del> ]) <del> <del> disposable3.dispose() <add> { label: 'D', id: 'D', command: 'd' }, <add> { label: 'E', id: 'E', command: 'e' } <add> ] <add> } <add> ] <add> } <add> ]); <add> <add> disposable3.dispose(); <ide> expect(menu.template).toEqual([ <ide> { <del> label: "A", <del> id: "A", <add> label: 'A', <add> id: 'A', <ide> submenu: [ <del> {label: "B", id: "B", command: "b"}, <del> {label: "C", id: "C", submenu: [{label: "D", id: "D", command: "d"}]}, <del> ], <del> }, <del> ]) <del> <del> disposable2.dispose() <del> expect(menu.template).toEqual([{label: "A", id: "A", submenu: [{label: "B", id: "B", command: "b"}]}]) <del> <del> disposable1.dispose() <del> expect(menu.template).toEqual([]) <del> }) <del> <del> it("does not add duplicate labels to the same menu", function () { <del> const originalItemCount = menu.template.length <del> menu.add([{label: "A", submenu: [{label: "B", command: "b"}]}]) <del> menu.add([{label: "A", submenu: [{label: "B", command: "b"}]}]) <add> { label: 'B', id: 'B', command: 'b' }, <add> { <add> label: 'C', <add> id: 'C', <add> submenu: [{ label: 'D', id: 'D', command: 'd' }] <add> } <add> ] <add> } <add> ]); <add> <add> disposable2.dispose(); <add> expect(menu.template).toEqual([ <add> { <add> label: 'A', <add> id: 'A', <add> submenu: [{ label: 'B', id: 'B', command: 'b' }] <add> } <add> ]); <add> <add> disposable1.dispose(); <add> expect(menu.template).toEqual([]); <add> }); <add> <add> it('does not add duplicate labels to the same menu', function() { <add> const originalItemCount = menu.template.length; <add> menu.add([{ label: 'A', submenu: [{ label: 'B', command: 'b' }] }]); <add> menu.add([{ label: 'A', submenu: [{ label: 'B', command: 'b' }] }]); <ide> expect(menu.template[originalItemCount]).toEqual({ <del> label: "A", <del> id: "A", <del> submenu: [{label: "B", id: "B", command: "b"}], <del> }) <del> }) <del> }) <del> <del> describe("::update()", function () { <del> const originalPlatform = process.platform <del> afterEach(() => Object.defineProperty(process, "platform", {value: originalPlatform})) <del> <del> it("sends the current menu template and associated key bindings to the browser process", function () { <del> menu.add([{label: "A", submenu: [{label: "B", command: "b"}]}]) <del> atom.keymaps.add("test", {"atom-workspace": {"ctrl-b": "b"}}) <del> menu.update() <del> advanceClock(1) <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["b"]).toEqual(["ctrl-b"]) <del> }) <del> <del> it("omits key bindings that are mapped to unset! in any context", function () { <add> label: 'A', <add> id: 'A', <add> submenu: [{ label: 'B', id: 'B', command: 'b' }] <add> }); <add> }); <add> }); <add> <add> describe('::update()', function() { <add> const originalPlatform = process.platform; <add> afterEach(() => <add> Object.defineProperty(process, 'platform', { value: originalPlatform }) <add> ); <add> <add> it('sends the current menu template and associated key bindings to the browser process', function() { <add> menu.add([{ label: 'A', submenu: [{ label: 'B', command: 'b' }] }]); <add> atom.keymaps.add('test', { 'atom-workspace': { 'ctrl-b': 'b' } }); <add> menu.update(); <add> advanceClock(1); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toEqual([ <add> 'ctrl-b' <add> ]); <add> }); <add> <add> it('omits key bindings that are mapped to unset! in any context', function() { <ide> // it would be nice to be smarter about omitting, but that would require a much <ide> // more dynamic interaction between the currently focused element and the menu <del> menu.add([{label: "A", submenu: [{label: "B", command: "b"}]}]) <del> atom.keymaps.add("test", {"atom-workspace": {"ctrl-b": "b"}}) <del> atom.keymaps.add("test", {"atom-text-editor": {"ctrl-b": "unset!"}}) <del> advanceClock(1) <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["b"]).toBeUndefined() <del> }) <del> <del> it("omits key bindings that could conflict with AltGraph characters on macOS", function () { <del> Object.defineProperty(process, "platform", {value: "darwin"}) <add> menu.add([{ label: 'A', submenu: [{ label: 'B', command: 'b' }] }]); <add> atom.keymaps.add('test', { 'atom-workspace': { 'ctrl-b': 'b' } }); <add> atom.keymaps.add('test', { 'atom-text-editor': { 'ctrl-b': 'unset!' } }); <add> advanceClock(1); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined(); <add> }); <add> <add> it('omits key bindings that could conflict with AltGraph characters on macOS', function() { <add> Object.defineProperty(process, 'platform', { value: 'darwin' }); <ide> menu.add([ <ide> { <del> label: "A", <add> label: 'A', <ide> submenu: [ <del> {label: "B", command: "b"}, <del> {label: "C", command: "c"}, <del> {label: "D", command: "d"}, <del> ], <del> }, <del> ]) <del> <del> atom.keymaps.add("test", { <del> "atom-workspace": { <del> "alt-b": "b", <del> "alt-shift-C": "c", <del> "alt-cmd-d": "d", <del> }, <del> }) <del> <del> advanceClock(1) <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["b"]).toBeUndefined() <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["c"]).toBeUndefined() <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["d"]).toEqual(["alt-cmd-d"]) <del> }) <del> <del> it("omits key bindings that could conflict with AltGraph characters on Windows", function () { <del> Object.defineProperty(process, "platform", {value: "win32"}) <add> { label: 'B', command: 'b' }, <add> { label: 'C', command: 'c' }, <add> { label: 'D', command: 'd' } <add> ] <add> } <add> ]); <add> <add> atom.keymaps.add('test', { <add> 'atom-workspace': { <add> 'alt-b': 'b', <add> 'alt-shift-C': 'c', <add> 'alt-cmd-d': 'd' <add> } <add> }); <add> <add> advanceClock(1); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined(); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['c']).toBeUndefined(); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['d']).toEqual([ <add> 'alt-cmd-d' <add> ]); <add> }); <add> <add> it('omits key bindings that could conflict with AltGraph characters on Windows', function() { <add> Object.defineProperty(process, 'platform', { value: 'win32' }); <ide> menu.add([ <ide> { <del> label: "A", <add> label: 'A', <ide> submenu: [ <del> {label: "B", command: "b"}, <del> {label: "C", command: "c"}, <del> {label: "D", command: "d"}, <del> ], <del> }, <del> ]) <del> <del> atom.keymaps.add("test", { <del> "atom-workspace": { <del> "ctrl-alt-b": "b", <del> "ctrl-alt-shift-C": "c", <del> "ctrl-alt-cmd-d": "d", <del> }, <del> }) <del> <del> advanceClock(1) <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["b"]).toBeUndefined() <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["c"]).toBeUndefined() <del> expect(menu.sendToBrowserProcess.argsForCall[0][1]["d"]).toEqual(["ctrl-alt-cmd-d"]) <del> }) <del> }) <del> <del> it("updates the application menu when a keymap is reloaded", function () { <del> spyOn(menu, "update") <del> const keymapPath = path.join(__dirname, "fixtures", "packages", "package-with-keymaps", "keymaps", "keymap-1.cson") <del> atom.keymaps.reloadKeymap(keymapPath) <del> expect(menu.update).toHaveBeenCalled() <del> }) <del>}) <add> { label: 'B', command: 'b' }, <add> { label: 'C', command: 'c' }, <add> { label: 'D', command: 'd' } <add> ] <add> } <add> ]); <add> <add> atom.keymaps.add('test', { <add> 'atom-workspace': { <add> 'ctrl-alt-b': 'b', <add> 'ctrl-alt-shift-C': 'c', <add> 'ctrl-alt-cmd-d': 'd' <add> } <add> }); <add> <add> advanceClock(1); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined(); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['c']).toBeUndefined(); <add> expect(menu.sendToBrowserProcess.argsForCall[0][1]['d']).toEqual([ <add> 'ctrl-alt-cmd-d' <add> ]); <add> }); <add> }); <add> <add> it('updates the application menu when a keymap is reloaded', function() { <add> spyOn(menu, 'update'); <add> const keymapPath = path.join( <add> __dirname, <add> 'fixtures', <add> 'packages', <add> 'package-with-keymaps', <add> 'keymaps', <add> 'keymap-1.cson' <add> ); <add> atom.keymaps.reloadKeymap(keymapPath); <add> expect(menu.update).toHaveBeenCalled(); <add> }); <add>});
2
PHP
PHP
add support for biginteger on sqlserver
d4ee62be617b3f567e5d85cb681fe77912e68844
<ide><path>lib/Cake/Model/Datasource/Database/Sqlserver.php <ide> class Sqlserver extends DboSource { <ide> */ <ide> public $columns = array( <ide> 'primary_key' => array('name' => 'IDENTITY (1, 1) NOT NULL'), <del> 'string' => array('name' => 'nvarchar', 'limit' => '255'), <del> 'text' => array('name' => 'nvarchar', 'limit' => 'MAX'), <del> 'integer' => array('name' => 'int', 'formatter' => 'intval'), <del> 'float' => array('name' => 'numeric', 'formatter' => 'floatval'), <del> 'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'), <add> 'string' => array('name' => 'nvarchar', 'limit' => '255'), <add> 'text' => array('name' => 'nvarchar', 'limit' => 'MAX'), <add> 'integer' => array('name' => 'int', 'formatter' => 'intval'), <add> 'biginteger' => array('name' => 'bigint'), <add> 'float' => array('name' => 'numeric', 'formatter' => 'floatval'), <add> 'datetime' => array('name' => 'datetime', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'), <ide> 'timestamp' => array('name' => 'timestamp', 'format' => 'Y-m-d H:i:s', 'formatter' => 'date'), <del> 'time' => array('name' => 'datetime', 'format' => 'H:i:s', 'formatter' => 'date'), <del> 'date' => array('name' => 'datetime', 'format' => 'Y-m-d', 'formatter' => 'date'), <del> 'binary' => array('name' => 'varbinary'), <del> 'boolean' => array('name' => 'bit') <add> 'time' => array('name' => 'datetime', 'format' => 'H:i:s', 'formatter' => 'date'), <add> 'date' => array('name' => 'datetime', 'format' => 'Y-m-d', 'formatter' => 'date'), <add> 'binary' => array('name' => 'varbinary'), <add> 'boolean' => array('name' => 'bit') <ide> ); <ide> <ide> /** <ide> public function column($real) { <ide> if ($col == 'bit') { <ide> return 'boolean'; <ide> } <add> if (strpos($col, 'bigint') !== false) { <add> return 'biginteger'; <add> } <ide> if (strpos($col, 'int') !== false) { <ide> return 'integer'; <ide> } <ide> public function insertMulti($table, $fields, $values) { <ide> */ <ide> public function buildColumn($column) { <ide> $result = parent::buildColumn($column); <del> $result = preg_replace('/(int|integer)\([0-9]+\)/i', '$1', $result); <add> $result = preg_replace('/(bigint|int|integer)\([0-9]+\)/i', '$1', $result); <ide> $result = preg_replace('/(bit)\([0-9]+\)/i', '$1', $result); <ide> if (strpos($result, 'DEFAULT NULL') !== false) { <ide> if (isset($column['default']) && $column['default'] === '') { <ide><path>lib/Cake/Test/Case/Model/Datasource/Database/SqlserverTest.php <ide> public function testBuildColumn() { <ide> $result = $this->db->buildColumn($column); <ide> $expected = "[checked] bit DEFAULT '1'"; <ide> $this->assertEquals($expected, $result); <add> <add> $column = array( <add> 'name' => 'huge', <add> 'type' => 'biginteger', <add> ); <add> $result = $this->db->buildColumn($column); <add> $expected = "[huge] bigint"; <add> $this->assertEquals($expected, $result); <ide> } <ide> <ide> /**
2
Javascript
Javascript
move trie utilities into their own file
f9cee72713d2d301dfbf1ac756a449b42fb3c5f4
<ide><path>dist/Immutable.dev.js <ide> var $Sequence = Sequence; <ide> return this.slice(0, -1); <ide> }, <ide> has: function(searchKey) { <del> return this.get(searchKey, __SENTINEL) !== __SENTINEL; <add> return this.get(searchKey, SENTINEL) !== SENTINEL; <ide> }, <ide> get: function(searchKey, notFoundValue) { <ide> return this.find((function(_, key) { <ide> var $Sequence = Sequence; <ide> contains: function(searchValue) { <ide> return this.find((function(value) { <ide> return is(value, searchValue); <del> }), null, __SENTINEL) !== __SENTINEL; <add> }), null, SENTINEL) !== SENTINEL; <ide> }, <ide> find: function(predicate, thisArg, notFoundValue) { <ide> var foundValue = notFoundValue; <ide> var $Sequence = Sequence; <ide> var groups = OrderedMap.empty().withMutations((function(map) { <ide> seq.forEach((function(value, key, collection) { <ide> var groupKey = mapper(value, key, collection); <del> var group = map.get(groupKey, __SENTINEL); <del> if (group === __SENTINEL) { <add> var group = map.get(groupKey, SENTINEL); <add> if (group === SENTINEL) { <ide> group = []; <ide> map.set(groupKey, group); <ide> } <ide> var $IndexedSequence = IndexedSequence; <ide> var groups = OrderedMap.empty().withMutations((function(map) { <ide> seq.forEach((function(value, index, collection) { <ide> var groupKey = mapper(value, index, collection); <del> var group = map.get(groupKey, __SENTINEL); <del> if (group === __SENTINEL) { <add> var group = map.get(groupKey, SENTINEL); <add> if (group === SENTINEL) { <ide> group = new Array(maintainIndices ? seq.length : 0); <ide> map.set(groupKey, group); <ide> } <ide> function makeIndexedSequence(parent) { <ide> return newSequence; <ide> } <ide> function getInDeepSequence(seq, keyPath, notFoundValue, pathOffset) { <del> var nested = seq.get ? seq.get(keyPath[pathOffset], __SENTINEL) : __SENTINEL; <del> if (nested === __SENTINEL) { <add> var nested = seq.get ? seq.get(keyPath[pathOffset], SENTINEL) : SENTINEL; <add> if (nested === SENTINEL) { <ide> return notFoundValue; <ide> } <ide> if (++pathOffset === keyPath.length) { <ide> function assertNotInfinite(length) { <ide> throw new Error('Cannot perform this action with an infinite sequence.'); <ide> } <ide> } <del>var __SENTINEL = {}; <ide> function is(first, second) { <ide> if (first === second) { <ide> return first !== 0 || second !== 0 || 1 / first === 1 / second; <ide> function _updateCursor(cursor, changeFn, changeKey) { <ide> cursor._onChange && cursor._onChange.call(undefined, newRootData, cursor._rootData, changeKey ? keyPath.concat(changeKey) : keyPath); <ide> return new Cursor(newRootData, cursor._keyPath, cursor._onChange); <ide> } <add>var SHIFT = 5; <add>var SIZE = 1 << SHIFT; <add>var MASK = SIZE - 1; <add>var SENTINEL = {}; <add>function OwnerID() {} <ide> var Map = function Map(sequence) { <ide> if (sequence && sequence.constructor === $Map) { <ide> return sequence; <ide> var $Map = Map; <ide> __deepEqual: function(other) { <ide> var self = this; <ide> return other.every((function(v, k) { <del> return is(self.get(k, __SENTINEL), v); <add> return is(self.get(k, SENTINEL), v); <ide> })); <ide> }, <ide> __iterate: function(fn, reverse) { <ide> return this._root ? this._root.iterate(this, fn, reverse) : 0; <ide> } <ide> }, { <ide> empty: function() { <del> return __EMPTY_MAP || (__EMPTY_MAP = $Map._make(0)); <add> return EMPTY_MAP || (EMPTY_MAP = $Map._make(0)); <ide> }, <ide> _make: function(length, root, ownerID) { <ide> var map = Object.create($Map.prototype); <ide> var $Map = Map; <ide> } <ide> }, Sequence); <ide> Map.from = Map; <del>var OwnerID = function OwnerID() {}; <del>($traceurRuntime.createClass)(OwnerID, {}, {}); <ide> var BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, keys, values) { <ide> this.ownerID = ownerID; <ide> this.bitmap = bitmap; <ide> function mergeIntoCollectionWith(collection, merger, seqs) { <ide> } <ide> return collection.withMutations((function(collection) { <ide> var mergeIntoMap = merger ? (function(value, key) { <del> var existing = collection.get(key, __SENTINEL); <del> collection.set(key, existing === __SENTINEL ? value : merger(existing, value)); <add> var existing = collection.get(key, SENTINEL); <add> collection.set(key, existing === SENTINEL ? value : merger(existing, value)); <ide> }) : (function(value, key) { <ide> collection.set(key, value); <ide> }); <ide> function mergeIntoCollectionWith(collection, merger, seqs) { <ide> } <ide> function updateInDeepMap(collection, keyPath, updater, pathOffset) { <ide> var key = keyPath[pathOffset]; <del> var nested = collection.get ? collection.get(key, __SENTINEL) : __SENTINEL; <del> if (nested === __SENTINEL) { <add> var nested = collection.get ? collection.get(key, SENTINEL) : SENTINEL; <add> if (nested === SENTINEL) { <ide> nested = Map.empty(); <ide> } <ide> if (!collection.set) { <ide> throw new Error('updateIn with invalid keyPath'); <ide> } <ide> return collection.set(key, ++pathOffset === keyPath.length ? updater(nested) : updateInDeepMap(nested, keyPath, updater, pathOffset)); <ide> } <del>var __BOOL_REF = {value: false}; <add>var BOOL_REF = {value: false}; <ide> function BoolRef(value) { <del> __BOOL_REF.value = value; <del> return __BOOL_REF; <add> BOOL_REF.value = value; <add> return BOOL_REF; <ide> } <ide> function hashValue(o) { <ide> if (!o) { <ide> var STRING_HASH_MAX_VAL = 0x100000000; <ide> var STRING_HASH_CACHE_MAX_SIZE = 255; <ide> var STRING_HASH_CACHE_SIZE = 0; <ide> var STRING_HASH_CACHE = {}; <del>var SHIFT = 5; <del>var SIZE = 1 << SHIFT; <del>var MASK = SIZE - 1; <del>var __SENTINEL = {}; <del>var __EMPTY_MAP; <add>var EMPTY_MAP; <ide> var Vector = function Vector() { <ide> for (var values = [], <ide> $__6 = 0; $__6 < arguments.length; $__6++) <ide> var $Vector = Vector; <ide> if (index >= this._size) { <ide> return undefinedValue; <ide> } <del> var node = _nodeFor(this, index); <add> var node = vectorNodeFor(this, index); <ide> var maskedIndex = index & MASK; <ide> return node && (undefinedValue === undefined || node.array.hasOwnProperty(maskedIndex)) ? node.array[maskedIndex] : undefinedValue; <ide> }, <ide> var $Vector = Vector; <ide> var tailOffset = getTailOffset(this._size); <ide> if (index >= this.length) { <ide> return this.withMutations((function(vect) { <del> return _setBounds(vect, 0, index + 1).set(index, value); <add> return setVectorBounds(vect, 0, index + 1).set(index, value); <ide> })); <ide> } <del> if (this.get(index, __SENTINEL) === value) { <add> if (this.get(index, SENTINEL) === value) { <ide> return this; <ide> } <ide> index = rawIndex(index, this._origin); <ide> var $Vector = Vector; <ide> this._tail = newTail; <ide> return this; <ide> } <del> return $Vector._make(this._origin, newSize, this._level, this._root, newTail); <add> return makeVector(this._origin, newSize, this._level, this._root, newTail); <ide> } <ide> var newRoot = this._root.ensureOwner(this.__ownerID); <ide> var node = newRoot; <ide> var $Vector = Vector; <ide> this._root = newRoot; <ide> return this; <ide> } <del> return $Vector._make(this._origin, this._size, this._level, newRoot, this._tail); <add> return makeVector(this._origin, this._size, this._level, newRoot, this._tail); <ide> }, <ide> delete: function(index) { <ide> if (!this.has(index)) { <ide> var $Vector = Vector; <ide> this._tail = newTail; <ide> return this; <ide> } <del> return $Vector._make(this._origin, this._size, this._level, this._root, newTail); <add> return makeVector(this._origin, this._size, this._level, this._root, newTail); <ide> } <ide> var newRoot = this._root.ensureOwner(this.__ownerID); <ide> var node = newRoot; <ide> var $Vector = Vector; <ide> this._root = newRoot; <ide> return this; <ide> } <del> return $Vector._make(this._origin, this._size, this._level, newRoot, this._tail); <add> return makeVector(this._origin, this._size, this._level, newRoot, this._tail); <ide> }, <ide> clear: function() { <ide> if (this.__ownerID) { <ide> this.length = this._origin = this._size = 0; <ide> this._level = SHIFT; <del> this._root = this._tail = __EMPTY_VNODE; <add> this._root = this._tail = EMPTY_VNODE; <ide> return this; <ide> } <ide> return $Vector.empty(); <ide> var $Vector = Vector; <ide> var values = arguments; <ide> var oldLength = this.length; <ide> return this.withMutations((function(vect) { <del> _setBounds(vect, 0, oldLength + values.length); <add> setVectorBounds(vect, 0, oldLength + values.length); <ide> for (var ii = 0; ii < values.length; ii++) { <ide> vect.set(oldLength + ii, values[ii]); <ide> } <ide> })); <ide> }, <ide> pop: function() { <del> return _setBounds(this, 0, -1); <add> return setVectorBounds(this, 0, -1); <ide> }, <ide> unshift: function() { <ide> var values = arguments; <ide> return this.withMutations((function(vect) { <del> _setBounds(vect, -values.length); <add> setVectorBounds(vect, -values.length); <ide> for (var ii = 0; ii < values.length; ii++) { <ide> vect.set(ii, values[ii]); <ide> } <ide> })); <ide> }, <ide> shift: function() { <del> return _setBounds(this, 1); <add> return setVectorBounds(this, 1); <ide> }, <ide> merge: function() { <ide> return mergeIntoVectorWith(this, null, arguments); <ide> var $Vector = Vector; <ide> return mergeIntoVectorWith(this, deepMerger(merger), seqs); <ide> }, <ide> setLength: function(length) { <del> return _setBounds(this, 0, length); <del> }, <del> __ensureOwner: function(ownerID) { <del> if (ownerID === this.__ownerID) { <del> return this; <del> } <del> if (!ownerID) { <del> this.__ownerID = ownerID; <del> return this; <del> } <del> return $Vector._make(this._origin, this._size, this._level, this._root, this._tail, ownerID); <add> return setVectorBounds(this, 0, length); <ide> }, <ide> slice: function(begin, end, maintainIndices) { <ide> var sliceSequence = $traceurRuntime.superCall(this, $Vector.prototype, "slice", [begin, end, maintainIndices]); <ide> if (!maintainIndices && sliceSequence !== this) { <ide> var vector = this; <ide> var length = vector.length; <ide> sliceSequence.toVector = (function() { <del> return _setBounds(vector, begin < 0 ? Math.max(0, length + begin) : length ? Math.min(length, begin) : begin, end == null ? length : end < 0 ? Math.max(0, length + end) : length ? Math.min(length, end) : end); <add> return setVectorBounds(vector, begin < 0 ? Math.max(0, length + begin) : length ? Math.min(length, begin) : begin, end == null ? length : end < 0 ? Math.max(0, length + end) : length ? Math.min(length, end) : end); <ide> }); <ide> } <ide> return sliceSequence; <ide> }, <del> __deepEquals: function(other) { <del> var iterator = this.iterator(); <del> return other.every((function(v, k) { <del> var entry = iterator.next().value; <del> return entry && k === entry[0] && is(v, entry[1]); <del> })); <del> }, <ide> iterator: function() { <ide> return new VectorIterator(this, this._origin, this._size, this._level, this._root, this._tail); <ide> }, <ide> var $Vector = Vector; <ide> didComplete = this._root.iterate(this._level, -this._origin, tailOffset - this._origin, eachFn, reverse) && this._tail.iterate(0, tailOffset - this._origin, this._size - this._origin, eachFn, reverse); <ide> } <ide> return (didComplete ? maxIndex : reverse ? maxIndex - lastIndex : lastIndex) + 1; <add> }, <add> __deepEquals: function(other) { <add> var iterator = this.iterator(); <add> return other.every((function(v, k) { <add> var entry = iterator.next().value; <add> return entry && k === entry[0] && is(v, entry[1]); <add> })); <add> }, <add> __ensureOwner: function(ownerID) { <add> if (ownerID === this.__ownerID) { <add> return this; <add> } <add> if (!ownerID) { <add> this.__ownerID = ownerID; <add> return this; <add> } <add> return makeVector(this._origin, this._size, this._level, this._root, this._tail, ownerID); <ide> } <ide> }, { <ide> empty: function() { <del> return __EMPTY_VECT || (__EMPTY_VECT = $Vector._make(0, 0, SHIFT, __EMPTY_VNODE, __EMPTY_VNODE)); <add> return EMPTY_VECT || (EMPTY_VECT = makeVector(0, 0, SHIFT, EMPTY_VNODE, EMPTY_VNODE)); <ide> }, <ide> from: function(sequence) { <ide> if (sequence && sequence.constructor === $Vector) { <ide> var $Vector = Vector; <ide> } <ide> var isArray = Array.isArray(sequence); <ide> if (sequence.length > 0 && sequence.length < SIZE) { <del> return $Vector._make(0, sequence.length, SHIFT, __EMPTY_VNODE, new VNode(isArray ? sequence.slice() : Sequence(sequence).toArray())); <add> return makeVector(0, sequence.length, SHIFT, EMPTY_VNODE, new VNode(isArray ? sequence.slice() : Sequence(sequence).toArray())); <ide> } <ide> if (!isArray) { <ide> sequence = Sequence(sequence); <ide> var $Vector = Vector; <ide> } <ide> } <ide> return $Vector.empty().merge(sequence); <del> }, <del> _make: function(origin, size, level, root, tail, ownerID) { <del> var vect = Object.create($Vector.prototype); <del> vect.length = size - origin; <del> vect._origin = origin; <del> vect._size = size; <del> vect._level = level; <del> vect._root = root; <del> vect._tail = tail; <del> vect.__ownerID = ownerID; <del> return vect; <ide> } <ide> }, IndexedSequence); <del>function _nodeFor(vector, rawIndex) { <add>var VectorPrototype = Vector.prototype; <add>VectorPrototype['@@iterator'] = VectorPrototype.__iterator__; <add>VectorPrototype.update = Map.prototype.update; <add>VectorPrototype.updateIn = Map.prototype.updateIn; <add>VectorPrototype.cursor = Map.prototype.cursor; <add>VectorPrototype.withMutations = Map.prototype.withMutations; <add>VectorPrototype.asMutable = Map.prototype.asMutable; <add>VectorPrototype.asImmutable = Map.prototype.asImmutable; <add>function makeVector(origin, size, level, root, tail, ownerID) { <add> var vect = Object.create(VectorPrototype); <add> vect.length = size - origin; <add> vect._origin = origin; <add> vect._size = size; <add> vect._level = level; <add> vect._root = root; <add> vect._tail = tail; <add> vect.__ownerID = ownerID; <add> return vect; <add>} <add>function vectorNodeFor(vector, rawIndex) { <ide> if (rawIndex >= getTailOffset(vector._size)) { <ide> return vector._tail; <ide> } <ide> function _nodeFor(vector, rawIndex) { <ide> return node; <ide> } <ide> } <del>function _setBounds(vector, begin, end) { <add>function setVectorBounds(vector, begin, end) { <ide> var owner = vector.__ownerID || new OwnerID(); <ide> var oldOrigin = vector._origin; <ide> var oldSize = vector._size; <ide> function _setBounds(vector, begin, end) { <ide> newLevel += SHIFT; <ide> } <ide> var oldTail = vector._tail; <del> var newTail = newTailOffset < oldTailOffset ? _nodeFor(vector, newSize - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; <add> var newTail = newTailOffset < oldTailOffset ? vectorNodeFor(vector, newSize - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; <ide> if (newTailOffset > oldTailOffset && newOrigin < oldSize && oldTail.array.length) { <ide> newRoot = newRoot.ensureOwner(owner); <ide> var node = newRoot; <ide> function _setBounds(vector, begin, end) { <ide> newOrigin -= newTailOffset; <ide> newSize -= newTailOffset; <ide> newLevel = SHIFT; <del> newRoot = __EMPTY_VNODE; <add> newRoot = EMPTY_VNODE; <ide> newTail = newTail.removeBefore(owner, 0, newOrigin); <ide> } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { <ide> var beginIndex, <ide> function _setBounds(vector, begin, end) { <ide> newOrigin -= offsetShift; <ide> newSize -= offsetShift; <ide> } <del> newRoot = newRoot || __EMPTY_VNODE; <add> newRoot = newRoot || EMPTY_VNODE; <ide> } <ide> if (vector.__ownerID) { <ide> vector.length = newSize - newOrigin; <ide> function _setBounds(vector, begin, end) { <ide> vector._tail = newTail; <ide> return vector; <ide> } <del> return Vector._make(newOrigin, newSize, newLevel, newRoot, newTail); <add> return makeVector(newOrigin, newSize, newLevel, newRoot, newTail); <ide> } <del>Vector.prototype['@@iterator'] = Vector.prototype.__iterator__; <del>Vector.prototype.update = Map.prototype.update; <del>Vector.prototype.updateIn = Map.prototype.updateIn; <del>Vector.prototype.cursor = Map.prototype.cursor; <del>Vector.prototype.withMutations = Map.prototype.withMutations; <del>Vector.prototype.asMutable = Map.prototype.asMutable; <del>Vector.prototype.asImmutable = Map.prototype.asImmutable; <del>var OwnerID = function OwnerID() {}; <del>($traceurRuntime.createClass)(OwnerID, {}, {}); <ide> var VNode = function VNode(array, ownerID) { <ide> this.array = array; <ide> this.ownerID = ownerID; <ide> function rawIndex(index, origin) { <ide> function getTailOffset(size) { <ide> return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); <ide> } <del>var SHIFT = 5; <del>var SIZE = 1 << SHIFT; <del>var MASK = SIZE - 1; <del>var __SENTINEL = {}; <del>var __EMPTY_VECT; <del>var __EMPTY_VNODE = new VNode([]); <add>var EMPTY_VECT; <add>var EMPTY_VNODE = new VNode([]); <ide> var Set = function Set() { <ide> for (var values = [], <ide> $__9 = 0; $__9 < arguments.length; $__9++) <ide><path>dist/Immutable.js <ide> * LICENSE file in the root directory of this source tree. An additional grant <ide> * of patent rights can be found in the PATENTS file in the same directory. <ide> */ <del>function t(){function t(t,e,r,n){var i;if(n){var s=n.prototype;i=J.create(s)}else i=t.prototype;return J.keys(e).forEach(function(t){i[t]=e[t]}),J.keys(r).forEach(function(e){t[e]=r[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,r,n){return J.getPrototypeOf(e)[r].apply(t,n)}function r(t,r,n){e(t,r,"constructor",n)}function n(){return Object.create(L.prototype)}function i(t){var e=Object.create(K.prototype);return e.__reversedIndices=t?t.__reversedIndices:!1,e}function s(t,e,r,n){var i=t.get?t.get(e[n],G):G;return i===G?r:++n===e.length?i:s(i,e,r,n)}function u(t,e,r){return(0===t||null!=r&&-r>=t)&&(null==e||null!=r&&e>=r)}function o(t,e){return 0>t?Math.max(0,e+t):e?Math.min(e,t):t}function a(t,e){return null==t?e:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function h(t){return t}function l(t,e){return[e,t]}function c(){return!0}function f(){return this}function _(t){return(t||0)+1}function p(t,e,r,n,i){var s=t.__makeSequence();return s.__iterateUncached=function(s,u,o){var a=0,h=t.__iterate(function(t,i,u){if(e.call(r,t,i,u)){if(s(t,n?i:a,u)===!1)return!1;a++}},u,o);return i?h:a},s}function v(t){return function(){return!t.apply(this,arguments)}}function g(t){return"string"==typeof t?JSON.stringify(t):t}function y(t,e){for(var r="";e;)1&e&&(r+=t),(e>>=1)&&(t+=t);return r}function m(t,e){return t>e?1:e>t?-1:0}function d(t){if(1/0===t)throw Error("Cannot perform this action with an infinite sequence.")}function w(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof L?t.equals(e):!1}function I(t,e,r){var n=t._rootData.updateIn(t._keyPath,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,n,t._rootData,r?i.concat(r):i),new Q(n,t._keyPath,t._onChange)}function k(t,e,r,n,i){var s=r>>>e&ce,u=[],o=[];return o[s]=i,null!=n&&(u[s]=n),new $(t,1<<s,u,o)}function O(t,e,r){for(var n=[],i=0;r.length>i;i++){var s=r[i];s&&n.push(Array.isArray(s)?L(s).fromEntries():L(s))}return b(t,e,n)}function D(t){return function(e,r){return e&&e.mergeDeepWith?e.mergeDeepWith(t,r):t?t(e,r):r}}function b(t,e,r){return 0===r.length?t:t.withMutations(function(t){for(var n=e?function(r,n){var i=t.get(n,G); <del>t.set(n,i===G?r:e(i,r))}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function M(t,e,r,n){var i=e[n],s=t.get?t.get(i,G):G;if(s===G&&(s=X.empty()),!t.set)throw Error("updateIn with invalid keyPath");return t.set(i,++n===e.length?r(s):M(s,e,r,n))}function S(t){return ie.value=t,ie}function x(t){if(!t)return 0;if(t===!0)return 1;if("function"==typeof t.hashCode)return t.hashCode();var e=typeof t;if("number"===e)return Math.floor(t)%2147483647;if("string"===e)return E(t);throw Error("Unable to hash")}function E(t){var e=ae[t];if(null==e){e=0;for(var r=0;t.length>r;r++)e=(31*e+t.charCodeAt(r))%se;oe===ue&&(oe=0,ae={}),oe++,ae[t]=e}return e}function C(t,e){if(e>=P(t._size))return t._tail;if(1<<t._level+he>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&ce],n-=he;return r}}function A(t,e,r){var n=t.__ownerID||new Z,i=t._origin,s=t._size,u=i+e,o=null==r?s:0>r?s+r:i+r;if(u===i&&o===s)return t;if(u>=o)return t.clear();for(var a=t._level,h=t._root,l=0;0>u+l;)h=new pe(h.array.length?[,h]:[],n),a+=he,l+=1<<a;l&&(u+=l,i+=l,o+=l,s+=l);for(var c=P(s),f=P(o);f>=1<<a+he;)h=new pe(h.array.length?[h]:[],n),a+=he;var _=t._tail,p=c>f?C(t,o-1):f>c?new pe([],n):_;if(f>c&&s>u&&_.array.length){h=h.ensureOwner(n);for(var v=h,g=a;g>he;g-=he){var y=c>>>g&ce;v=v.array[y]=v.array[y]?v.array[y].ensureOwner(n):new pe([],n)}v.array[c>>>he&ce]=_}if(s>o&&(p=p.removeAfter(n,0,o)),u>=f)u-=f,o-=f,a=he,h=me,p=p.removeBefore(n,0,u);else if(u>i||c>f){var m,d;l=0;do m=u>>>a&ce,d=f-1>>>a&ce,m===d&&(m&&(l+=(1<<a)*m),a-=he,h=h&&h.array[m]);while(h&&m===d);h&&u>i&&(h=h.removeBefore(n,a,u-l)),h&&c>f&&(h=h.removeAfter(n,a,f-l)),l&&(u-=l,o-=l),h=h||me}return t.__ownerID?(t.length=o-u,t._origin=u,t._size=o,t._level=a,t._root=h,t._tail=p,t):fe._make(u,o,a,h,p)}function q(t,e,r){for(var n=[],i=0;r.length>i;i++){var s=r[i];s&&n.push(s.forEach?s:L(s))}var u=Math.max.apply(null,n.map(function(t){return t.length||0}));return u>t.length&&(t=t.setLength(u)),b(t,e,n)}function j(t,e){if(0>t)throw Error("Index out of bounds");return t+e}function P(t){return le>t?0:t-1>>>he<<he <del>}function U(t,e){if(!t)throw Error(e)}function U(t,e){if(!t)throw Error(e)}function z(t,e){return e?R(e,t,"",{"":t}):W(t)}function R(t,e,r,n){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(n,r,L(e).map(function(r,n){return R(t,r,n,e)})):e}function W(t){if(t){if(Array.isArray(t))return L(t).map(W).toVector();if(t.constructor===Object)return L(t).map(W).toMap()}return t}var J=Object,B={};B.createClass=t,B.superCall=e,B.defaultSuperCall=r;var L=function(t){return V.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},V=L;B.createClass(L,{toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e},__toStringMapper:function(t,e){return e+": "+g(t)},toJS:function(){return this.map(function(t){return t instanceof V?t.toJS():t}).__toJS()},toArray:function(){d(this.length);var t=Array(this.length||0);return this.values().forEach(function(e,r){t[r]=e}),t},toObject:function(){d(this.length);var t={};return this.forEach(function(e,r){t[r]=e}),t},toVector:function(){return d(this.length),fe.from(this)},toMap:function(){return d(this.length),X.from(this)},toOrderedMap:function(){return d(this.length),ke.from(this)},toSet:function(){return d(this.length),de.from(this)},equals:function(t){if(this===t)return!0;if(!(t instanceof V))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0}return this.__deepEquals(t)},__deepEquals:function(t){var e=this.cacheResult().entries().toArray(),r=0;return t.every(function(t,n){var i=e[r++];return w(n,i[0])&&w(t,i[1])})},join:function(t){t=t||",";var e="",r=!0;return this.forEach(function(n){r?(r=!1,e+=n):e+=t+n}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(c)),this.length)},countBy:function(t){var e=this;return ke.empty().withMutations(function(r){e.forEach(function(e,n,i){r.update(t(e,n,i),_)})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e]; <del>var r=[this].concat(t.map(function(t){return V(t)})),n=this.__makeSequence();return n.length=r.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),n.__iterateUncached=function(t,e){for(var n,i=0,s=r.length-1,u=0;s>=u&&!n;u++){var o=r[e?s-u:u];i+=o.__iterate(function(e,r,i){return t(e,r,i)===!1?(n=!0,!1):void 0},e)}return i},n},reverse:function(){var t=this,e=t.__makeSequence();return e.length=t.length,e.__iterateUncached=function(e,r){return t.__iterate(e,!r)},e.reverse=function(){return t},e},keys:function(){return this.flip().values()},values:function(){var t=this,e=i(t);return e.length=t.length,e.values=f,e.__iterateUncached=function(e,r,n){if(n&&null==this.length)return this.cacheResult().__iterate(e,r,n);var i,s=0;return n?(s=this.length-1,i=function(t,r,n){return e(t,s--,n)!==!1}):i=function(t,r,n){return e(t,s++,n)!==!1},t.__iterate(i,r),n?this.length:s},e},entries:function(){var t=this;if(t._cache)return V(t._cache);var e=t.map(l).values();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,r){var n=e;return this.forEach(function(e,i,s){n=t.call(r,n,e,i,s)}),n},reduceRight:function(t,e,r){return this.reverse(!0).reduce(t,e,r)},every:function(t,e){var r=!0;return this.forEach(function(n,i,s){return t.call(e,n,i,s)?void 0:(r=!1,!1)}),r},some:function(t,e){return!this.every(v(t),e)},first:function(){return this.find(c)},last:function(){return this.findLast(c)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,G)!==G},get:function(t,e){return this.find(function(e,r){return w(r,t)},null,e)},getIn:function(t,e){return t&&0!==t.length?s(this,t,e,0):this},contains:function(t){return this.find(function(e){return w(e,t)},null,G)!==G},find:function(t,e,r){var n=r;return this.forEach(function(r,i,s){return t.call(e,r,i,s)?(n=r,!1):void 0}),n},findKey:function(t,e){var r;return this.forEach(function(n,i,s){return t.call(e,n,i,s)?(r=i,!1):void 0}),r},findLast:function(t,e,r){return this.reverse(!0).find(t,e,r) <del>},findLastKey:function(t,e){return this.reverse(!0).findKey(t,e)},flip:function(){var t=this,e=n();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,r){return t.__iterate(function(t,r,n){return e(r,t,n)!==!1},r)},e},map:function(t,e){var r=this,n=r.__makeSequence();return n.length=r.length,n.__iterateUncached=function(n,i){return r.__iterate(function(r,i,s){return n(t.call(e,r,i,s),i,s)!==!1},i)},n},mapKeys:function(t,e){var r=this,n=r.__makeSequence();return n.length=r.length,n.__iterateUncached=function(n,i){return r.__iterate(function(r,i,s){return n(r,t.call(e,i,r,s),s)!==!1},i)},n},filter:function(t,e){return p(this,t,e,!0,!1)},slice:function(t,e){if(u(t,e,this.length))return this;var r=o(t,this.length),n=a(e,this.length);if(r!==r||n!==n)return this.entries().slice(t,e).fromEntries();var i=0===r?this:this.skip(r);return null==n||n===this.length?i:i.take(n-r)},take:function(t){var e=0,r=this.takeWhile(function(){return e++<t});return r.length=this.length&&Math.min(this.length,t),r},takeLast:function(t,e){return this.reverse(e).take(t).reverse(e)},takeWhile:function(t,e){var r=this,n=r.__makeSequence();return n.__iterateUncached=function(n,i,s){if(i)return this.cacheResult().__iterate(n,i,s);var u=0;return r.__iterate(function(r,i,s){return t.call(e,r,i,s)&&n(r,i,s)!==!1?void u++:!1},i,s),u},n},takeUntil:function(t,e,r){return this.takeWhile(v(t),e,r)},skip:function(t,e){if(0===t)return this;var r=0,n=this.skipWhile(function(){return r++<t},null,e);return n.length=this.length&&Math.max(0,this.length-t),n},skipLast:function(t,e){return this.reverse(e).skip(t).reverse(e)},skipWhile:function(t,e){var r=this,n=r.__makeSequence();return n.__iterateUncached=function(n,i,s){if(i)return this.cacheResult().__iterate(n,i,s);var u=!0,o=0;return r.__iterate(function(r,i,s){if(!u||!(u=t.call(e,r,i,s))){if(n(r,i,s)===!1)return!1;o++}},i,s),o},n},skipUntil:function(t,e,r){return this.skipWhile(v(t),e,r)},groupBy:function(t){var e=this,r=ke.empty().withMutations(function(r){e.forEach(function(e,n,i){var s=t(e,n,i),u=r.get(s,G); <del>u===G&&(u=[],r.set(s,u)),u.push([n,e])})});return r.map(function(t){return V(t).fromEntries()})},sort:function(t,e){return this.sortBy(h,t,e)},sortBy:function(t,e){e=e||m;var r=this;return V(this.entries().entries().toArray().sort(function(n,i){return e(t(n[1][1],n[1][0],r),t(i[1][1],i[1][0],r))||n[0]-i[0]})).fromEntries().values().fromEntries()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(d(this.length),this._cache=this.entries().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e,r){if(!this._cache)return this.__iterateUncached(t,e,r);var n=this.length-1,i=this._cache,s=this;if(e)for(var u=i.length-1;u>=0;u--){var o=i[u];if(t(o[1],r?o[0]:n-o[0],s)===!1)break}else i.every(r?function(e){return t(e[1],n-e[0],s)!==!1}:function(e){return t(e[1],e[0],s)!==!1});return this.length},__makeSequence:function(){return n()}},{from:function(t){if(t instanceof V)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new N(t);t=[t]}return new F(t)}}),L.prototype.toJSON=L.prototype.toJS,L.prototype.inspect=L.prototype.toSource=function(){return""+this},L.prototype.__toJS=L.prototype.toObject;var K=function(){B.defaultSuperCall(this,H.prototype,arguments)},H=K;B.createClass(K,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){d(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,r){t[r]=e}),t},fromEntries:function(){var t=this,e=n();return e.length=t.length,e.entries=function(){return t},e.__iterateUncached=function(e,r,n){return t.__iterate(function(t,r,n){return e(t[1],t[0],n)},r,n)},e},join:function(t){t=t||",";var e="",r=0;return this.forEach(function(n,i){var s=i-r;r=i,e+=(1===s?t:y(t,s))+n}),this.length&&this.length-1>r&&(e+=y(t,this.length-1-r)),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var r=[this].concat(t).map(function(t){return L(t)}),n=this.__makeSequence();return n.length=r.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),n.__iterateUncached=function(t,e,n){if(n&&!this.length)return this.cacheResult().__iterate(t,e,n); <del>for(var i,s=0,u=n&&this.length-1,o=r.length-1,a=0;o>=a&&!i;a++){var h=r[e?o-a:a];h instanceof H||(h=h.values()),s+=h.__iterate(function(e,r,o){return r+=s,t(e,n?u-r:r,o)===!1?(i=!0,!1):void 0},e)}return s},n},reverse:function(t){var e=this,r=e.__makeSequence();return r.length=e.length,r.__reversedIndices=!!(t^e.__reversedIndices),r.__iterateUncached=function(r,n,i){return e.__iterate(r,!n,i^t)},r.reverse=function(r){return t===r?e:H.prototype.reverse.call(this,r)},r},values:function(){var t=B.superCall(this,H.prototype,"values",[]);return t.length=void 0,t},filter:function(t,e,r){var n=p(this,t,e,r,r);return r&&(n.length=this.length),n},indexOf:function(t){return this.findIndex(function(e){return w(e,t)})},lastIndexOf:function(t){return this.reverse(!0).indexOf(t)},findIndex:function(t,e){var r=this.findKey(t,e);return null==r?-1:r},findLastIndex:function(t,e){return this.reverse(!0).findIndex(t,e)},slice:function(t,e,r){var n=this;if(u(t,e,n.length))return n;var i=n.__makeSequence(),s=o(t,n.length),h=a(e,n.length);return i.length=n.length&&(r?n.length:h-s),i.__reversedIndices=n.__reversedIndices,i.__iterateUncached=function(i,u,l){if(u)return this.cacheResult().__iterate(i,u,l);var c=this.__reversedIndices^l;if(s!==s||h!==h||c&&null==n.length){var f=n.count();s=o(t,f),h=a(e,f)}var _=c?n.length-h:s,p=c?n.length-s:h,v=n.__iterate(function(t,e,n){return c?null!=p&&e>=p||e>=_&&i(t,r?e:e-_,n)!==!1:_>e||(null==p||p>e)&&i(t,r?e:e-_,n)!==!1},u,l);return null!=this.length?this.length:r?v:Math.max(0,v-_)},i},splice:function(t,e){for(var r=[],n=2;arguments.length>n;n++)r[n-2]=arguments[n];return 0===e&&0===r.length?this:this.slice(0,t).concat(r,this.slice(t+e))},takeWhile:function(t,e,r){var n=this,i=n.__makeSequence();return i.__iterateUncached=function(s,u,o){if(u)return this.cacheResult().__iterate(s,u,o);var a=0,h=!0,l=n.__iterate(function(r,n,i){return t.call(e,r,n,i)&&s(r,n,i)!==!1?void(a=n):(h=!1,!1)},u,o);return r?i.length:h?l:a+1},r&&(i.length=this.length),i},skipWhile:function(t,e,r){var n=this,i=n.__makeSequence(); <del>return r&&(i.length=this.length),i.__iterateUncached=function(i,s,u){if(s)return this.cacheResult().__iterate(i,s,u);var o=n.__reversedIndices^u,a=!0,h=0,l=n.__iterate(function(n,s,o){return a&&(a=t.call(e,n,s,o),a||(h=s)),a||i(n,u||r?s:s-h,o)!==!1},s,u);return r?l:o?h+1:l-h},i},groupBy:function(t,e,r){var n=this,i=ke.empty().withMutations(function(e){n.forEach(function(i,s,u){var o=t(i,s,u),a=e.get(o,G);a===G&&(a=Array(r?n.length:0),e.set(o,a)),r?a[s]=i:a.push(i)})});return i.map(function(t){return L(t)})},sortBy:function(t,e,r){var n=B.superCall(this,H.prototype,"sortBy",[t,e]);return r||(n=n.values()),n.length=this.length,n},__makeSequence:function(){return i(this)}},{},L),K.prototype.__toJS=K.prototype.toArray,K.prototype.__toStringMapper=g;var N=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};B.createClass(N,{toObject:function(){return this._object},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,s=0;i>=s;s++){var u=e?i-s:s;if(t(r[n[u]],n[u],r)===!1)break}return s}},{},L);var F=function(t){this._array=t,this.length=t.length};B.createClass(F,{toArray:function(){return this._array},__iterate:function(t,e,r){var n=this._array,i=n.length-1,s=-1;if(e){for(var u=i;u>=0;u--){if(n.hasOwnProperty(u)&&t(n[u],r?u:i-u,n)===!1)return s+1;s=u}return n.length}var o=n.every(function(e,u){return t(e,r?i-u:u,n)===!1?!1:(s=u,!0)});return o?n.length:s+1}},{},K),F.prototype.get=N.prototype.get,F.prototype.has=N.prototype.has;var G={},Q=function(t,e,r){this._rootData=t,this._keyPath=e,this._onChange=r},T=Q;B.createClass(Q,{get:function(t,e){var r=this._rootData.getIn(this._keyPath,X.empty());return t?r.get(t,e):r},set:function(t,e){return I(this,function(r){return r.set(t,e)},t)},"delete":function(t){return I(this,function(e){return e.delete(t)},t)},update:function(t,e){var r;return"function"==typeof t?(r=t,t=void 0):r=function(r){return r.update(t,e) <del>},I(this,r,t)},cursor:function(t){return t&&!Array.isArray(t)&&(t=[t]),t&&0!==t.length?new T(this._rootData,this._keyPath?this._keyPath.concat(t):t,this._onChange):this}},{});var X=function(t){return t&&t.constructor===Y?t:t&&0!==t.length?Y.empty().merge(t):Y.empty()},Y=X;B.createClass(X,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return null==t||null==this._root?e:this._root.get(0,x(t),t,e)},set:function(t,e){if(null==t)return this;var r,n=this.length;if(this._root){var i=S();r=this._root.set(this.__ownerID,0,x(t),t,e,i),i.value&&n++}else n++,r=k(this.__ownerID,0,x(t),t,e);return this.__ownerID?(this.length=n,this._root=r,this):r===this._root?this:Y._make(n,r)},"delete":function(t){if(null==t||null==this._root)return this;if(this.__ownerID){var e=S();return this._root=this._root.delete(this.__ownerID,0,x(t),t,e),e.value&&this.length--,this}var r=this._root.delete(this.__ownerID,0,x(t),t);return r?r===this._root?this:Y._make(this.length-1,r):Y.empty()},update:function(t,e){return this.set(t,e(this.get(t)))},clear:function(){return this.__ownerID?(this.length=0,this._root=null,this):Y.empty()},merge:function(){return O(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return O(this,t,e)},mergeDeep:function(){return O(this,D(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return O(this,D(t),e)},updateIn:function(t,e){return t&&0!==t.length?M(this,t,e,0):e(this)},cursor:function(t,e){return e||"function"!=typeof t||(e=t,t=null),t&&!Array.isArray(t)&&(t=[t]),new Q(this,t,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.__ensureOwner(this.__ownerID)},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new Z)},asImmutable:function(){return this.__ensureOwner()},__ensureOwner:function(t){return t===this.__ownerID?this:t?Y._make(this.length,this._root,t):(this.__ownerID=t,this)},__deepEqual:function(t){var e=this;return t.every(function(t,r){return w(e.get(r,G),t) <del>})},__iterate:function(t,e){return this._root?this._root.iterate(this,t,e):0}},{empty:function(){return ne||(ne=Y._make(0))},_make:function(t,e,r){var n=Object.create(Y.prototype);return n.length=t,n._root=e,n.__ownerID=r,n}},L),X.from=X;var Z=function(){};B.createClass(Z,{},{});var $=function(t,e,r,n){this.ownerID=t,this.bitmap=e,this.keys=r,this.values=n},te=$;B.createClass($,{get:function(t,e,r,n){var i=e>>>t&ce;if(0===(this.bitmap&1<<i))return n;var s=this.keys[i],u=this.values[i];return null==s?u.get(t+he,e,r,n):r===s?u:n},set:function(t,e,r,n,i,s){var u,o=r>>>e&ce,a=1<<o;if(0===(this.bitmap&a))return s&&(s.value=!0),u=this.ensureOwner(t),u.keys[o]=n,u.values[o]=i,u.bitmap|=a,u;var h,l=this.keys[o],c=this.values[o];if(null==l)return h=c.set(t,e+he,r,n,i,s),h===c?this:(u=this.ensureOwner(t),u.values[o]=h,u);if(n===l)return i===c?this:(u=this.ensureOwner(t),u.values[o]=i,u);var f=x(l);return h=r===f?new ee(t,r,[l,n],[c,i]):k(t,e+he,f,l,c).set(t,e+he,r,n,i),s&&(s.value=!0),u=this.ensureOwner(t),delete u.keys[o],u.values[o]=h,u},"delete":function(t,e,r,n,i){var s,u=r>>>e&ce,o=1<<u,a=this.keys[u];if(0===(this.bitmap&o)||null!=a&&n!==a)return this;if(null==a){var h=this.values[u],l=h.delete(t,e+he,r,n,i);if(l===h)return this;if(l)return s=this.ensureOwner(t),s.values[u]=l,s}else i&&(i.value=!0);return this.bitmap===o?null:(s=this.ensureOwner(t),delete s.keys[u],delete s.values[u],s.bitmap^=o,s)},ensureOwner:function(t){return t&&t===this.ownerID?this:new te(t,this.bitmap,this.keys.slice(),this.values.slice())},iterate:function(t,e,r){for(var n=this.values,i=this.keys,s=n.length,u=0;s>=u;u++){var o=r?s-u:u,a=i[o],h=n[o];if(null!=a){if(e(h,a,t)===!1)return!1}else if(h&&!h.iterate(t,e,r))return!1}return!0}},{});var ee=function(t,e,r,n){this.ownerID=t,this.collisionHash=e,this.keys=r,this.values=n},re=ee;B.createClass(ee,{get:function(t,e,r,n){var i=L(this.keys).indexOf(r);return-1===i?n:this.values[i]},set:function(t,e,r,n,i,s){if(r!==this.collisionHash)return s&&(s.value=!0),k(t,e,this.collisionHash,null,this).set(t,e,r,n,i); <del>var u=L(this.keys).indexOf(n);if(u>=0&&this.values[u]===i)return this;var o=this.ensureOwner(t);return-1===u?(o.keys.push(n),o.values.push(i),s&&(s.value=!0)):o.values[u]=i,o},"delete":function(t,e,r,n,i){var s=this.keys.indexOf(n);if(-1===s)return this;if(i&&(i.value=!0),this.values.length>1){var u=this.ensureOwner(t);return u.keys[s]=u.keys.pop(),u.values[s]=u.values.pop(),u}},ensureOwner:function(t){return t&&t===this.ownerID?this:new re(t,this.collisionHash,this.keys.slice(),this.values.slice())},iterate:function(t,e,r){for(var n=this.values,i=this.keys,s=n.length-1,u=0;s>=u;u++){var o=r?s-u:u;if(e(n[o],i[o],t)===!1)return!1}return!0}},{});var ne,ie={value:!1},se=4294967296,ue=255,oe=0,ae={},he=5,le=1<<he,ce=le-1,G={},fe=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return _e.from(t)},_e=fe;B.createClass(fe,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=j(t,this._origin),t>=this._size)return e;var r=C(this,t),n=t&ce;return r&&(void 0===e||r.array.hasOwnProperty(n))?r.array[n]:e},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){var r=P(this._size);if(t>=this.length)return this.withMutations(function(r){return A(r,0,t+1).set(t,e)});if(this.get(t,G)===e)return this;if(t=j(t,this._origin),t>=r){var n=this._tail.ensureOwner(this.__ownerID);n.array[t&ce]=e;var i=t>=this._size?t+1:this._size;return this.__ownerID?(this.length=i-this._origin,this._size=i,this._tail=n,this):_e._make(this._origin,i,this._level,this._root,n)}for(var s=this._root.ensureOwner(this.__ownerID),u=s,o=this._level;o>0;o-=he){var a=t>>>o&ce;u=u.array[a]=u.array[a]?u.array[a].ensureOwner(this.__ownerID):new pe([],this.__ownerID)}return u.array[t&ce]=e,this.__ownerID?(this._root=s,this):_e._make(this._origin,this._size,this._level,s,this._tail)},"delete":function(t){if(!this.has(t))return this;var e=P(this._size);if(t=j(t,this._origin),t>=e){var r=this._tail.ensureOwner(this.__ownerID);return delete r.array[t&ce],this.__ownerID?(this._tail=r,this):_e._make(this._origin,this._size,this._level,this._root,r) <del>}for(var n=this._root.ensureOwner(this.__ownerID),i=n,s=this._level;s>0;s-=he){var u=t>>>s&ce;i=i.array[u]=i.array[u].ensureOwner(this.__ownerID)}return delete i.array[t&ce],this.__ownerID?(this._root=n,this):_e._make(this._origin,this._size,this._level,n,this._tail)},clear:function(){return this.__ownerID?(this.length=this._origin=this._size=0,this._level=he,this._root=this._tail=me,this):_e.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(r){A(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return A(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){A(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return A(this,1)},merge:function(){return q(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return q(this,t,e)},mergeDeep:function(){return q(this,D(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return q(this,D(t),e)},setLength:function(t){return A(this,0,t)},__ensureOwner:function(t){return t===this.__ownerID?this:t?_e._make(this._origin,this._size,this._level,this._root,this._tail,t):(this.__ownerID=t,this)},slice:function(t,e,r){var n=B.superCall(this,_e.prototype,"slice",[t,e,r]);if(!r&&n!==this){var i=this,s=i.length;n.toVector=function(){return A(i,0>t?Math.max(0,s+t):s?Math.min(s,t):t,null==e?s:0>e?Math.max(0,s+e):s?Math.min(s,e):e)}}return n},__deepEquals:function(t){var e=this.iterator();return t.every(function(t,r){var n=e.next().value;return n&&r===n[0]&&w(t,n[1])})},iterator:function(){return new ge(this,this._origin,this._size,this._level,this._root,this._tail)},__iterate:function(t,e,r){var n=this,i=0,s=n.length-1;r^=e;var u,o=function(e,u){return t(e,r?s-u:u,n)===!1?!1:(i=u,!0)},a=P(this._size);return u=e?this._tail.iterate(0,a-this._origin,this._size-this._origin,o,e)&&this._root.iterate(this._level,-this._origin,a-this._origin,o,e):this._root.iterate(this._level,-this._origin,a-this._origin,o,e)&&this._tail.iterate(0,a-this._origin,this._size-this._origin,o,e),(u?s:e?s-i:i)+1 <del>}},{empty:function(){return ye||(ye=_e._make(0,0,he,me,me))},from:function(t){if(t&&t.constructor===_e)return t;if(!t||0===t.length)return _e.empty();var e=Array.isArray(t);return t.length>0&&le>t.length?_e._make(0,t.length,he,me,new pe(e?t.slice():L(t).toArray())):(e||(t=L(t),t instanceof K||(t=t.values())),_e.empty().merge(t))},_make:function(t,e,r,n,i,s){var u=Object.create(_e.prototype);return u.length=e-t,u._origin=t,u._size=e,u._level=r,u._root=n,u._tail=i,u.__ownerID=s,u}},K),fe.prototype["@@iterator"]=fe.prototype.__iterator__,fe.prototype.update=X.prototype.update,fe.prototype.updateIn=X.prototype.updateIn,fe.prototype.cursor=X.prototype.cursor,fe.prototype.withMutations=X.prototype.withMutations,fe.prototype.asMutable=X.prototype.asMutable,fe.prototype.asImmutable=X.prototype.asImmutable;var Z=function(){};B.createClass(Z,{},{});var pe=function(t,e){this.array=t,this.ownerID=e},ve=pe;B.createClass(pe,{ensureOwner:function(t){return t&&t===this.ownerID?this:new ve(this.array.slice(),t)},removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&ce;if(n>=this.array.length)return new ve([],t);var i,s=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-he,r),i===u&&s)return this}if(s&&!i)return this;var o=this.ensureOwner();if(!s)for(var a=0;n>a;a++)delete o.array[a];return i&&(o.array[n]=i),o},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&ce;if(n>=this.array.length)return this;var i,s=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-he,r),i===u&&s)return this}if(s&&!i)return this;var o=this.ensureOwner();return s||(o.array.length=n+1),i&&(o.array[n]=i),o},iterate:function(t,e,r,n,i){if(0===t){if(i){for(var s=this.array.length-1;s>=0;s--)if(this.array.hasOwnProperty(s)){var u=s+e;if(u>=0&&r>u&&n(this.array[s],u)===!1)return!1}return!0}return this.array.every(function(t,i){var s=i+e;return 0>s||s>=r||n(t,s)!==!1})}var o=1<<t,a=t-he;if(i){for(var h=this.array.length-1;h>=0;h--){var l=e+h*o;if(r>l&&l+o>0&&this.array.hasOwnProperty(h)&&!this.array[h].iterate(a,l,r,n,i))return!1 <del>}return!0}return this.array.every(function(t,s){var u=e+s*o;return u>=r||0>=u+o||t.iterate(a,u,r,n,i)})}},{});var ge=function(t,e,r,n,i,s){var u=P(r);this._stack={node:i.array,level:n,offset:-e,max:u-e,__prev:{node:s.array,level:0,offset:u-e,max:r-e}}};B.createClass(ge,{next:function(){var t=this._stack;t:for(;t;){if(0===t.level)for(t.rawIndex||(t.rawIndex=0);t.node.length>t.rawIndex;){var e=t.rawIndex+t.offset;if(e>=0&&t.max>e&&t.node.hasOwnProperty(t.rawIndex)){var r=t.node[t.rawIndex];return t.rawIndex++,{value:[e,r],done:!0}}t.rawIndex++}else{var n=1<<t.level;for(t.levelIndex||(t.levelIndex=0);t.node.length>t.levelIndex;){var i=t.offset+t.levelIndex*n;if(i+n>0&&t.max>i&&t.node.hasOwnProperty(t.levelIndex)){var s=t.node[t.levelIndex].array;t.levelIndex++,t=this._stack={node:s,level:t.level-he,offset:i,max:t.max,__prev:t};continue t}t.levelIndex++}}t=this._stack=this._stack.__prev}return{done:!0}}},{});var ye,he=5,le=1<<he,ce=le-1,G={},me=new pe([]),de=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return we.from(t)},we=de;B.createClass(de,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map?this._map.has(t):!1},get:function(t,e){return this.has(t)?t:e},add:function(t){if(null==t)return this;var e=this._map;return e||(e=X.empty().__ensureOwner(this.__ownerID)),e=e.set(t,null),this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:we._make(e)},"delete":function(t){if(null==t||null==this._map)return this;var e=this._map.delete(t);return 0===e.length?this.clear():this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:we._make(e)},clear:function(){return this.__ownerID?(this.length=0,this._map=null,this):we.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var r=0;t.length>r;r++){var n=t[r];n=n.forEach?n:L(n),n.forEach(function(t){return e.add(t)})}})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return L(t) <del>});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.delete(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return L(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.delete(r)})})},isSubset:function(t){return t=L(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=L(t),t.every(function(t){return e.contains(t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?we._make(e,t):(this.__ownerID=t,this._map=e,this)},__deepEquals:function(t){return!(this._map||t._map)||this._map.equals(t._map)},__iterate:function(t,e){var r=this;return this._map?this._map.__iterate(function(e,n){return t(n,n,r)},e):0}},{empty:function(){return Ie||(Ie=we._make())},from:function(t){return t&&t.constructor===we?t:t&&0!==t.length?we.empty().union(t):we.empty()},fromKeys:function(t){return we.from(L(t).flip())},_make:function(t,e){var r=Object.create(we.prototype);return r.length=t?t.length:0,r._map=t,r.__ownerID=e,r}},L),de.prototype.contains=de.prototype.has,de.prototype.withMutations=X.prototype.withMutations,de.prototype.asMutable=X.prototype.asMutable,de.prototype.asImmutable=X.prototype.asImmutable,de.prototype.__toJS=K.prototype.__toJS,de.prototype.__toStringMapper=K.prototype.__toStringMapper;var Ie,ke=function(t){return t&&t.constructor===Oe?t:t&&0!==t.length?Oe.empty().merge(t):Oe.empty()},Oe=ke;B.createClass(ke,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){if(null!=t&&this._map){var r=this._map.get(t);if(null!=r)return this._vector.get(r)[1]}return e},clear:function(){return this.__ownerID?(this.length=0,this._map=this._vector=null,this):Oe.empty()},set:function(t,e){if(null==t)return this;var r=this._map,n=this._vector;if(r){var i=r.get(t);null==i?(r=r.set(t,n.length),n=n.push([t,e])):n.get(i)[1]!==e&&(n=n.set(i,[t,e])) <del>}else n=fe.empty().__ensureOwner(this.__ownerID).set(0,[t,e]),r=X.empty().__ensureOwner(this.__ownerID).set(t,0);return this.__ownerID?(this.length=r.length,this._map=r,this._vector=n,this):n===this._vector?this:Oe._make(r,n)},"delete":function(t){if(null==t||null==this._map)return this;var e=this._map.get(t);if(null==e)return this;var r=this._map.delete(t),n=this._vector.delete(e);return 0===r.length?this.clear():this.__ownerID?(this.length=r.length,this._map=r,this._vector=n,this):r===this._map?this:Oe._make(r,n)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t),r=this._vector&&this._vector.__ensureOwner(t);return t?Oe._make(e,r,t):(this.__ownerID=t,this._map=e,this._vector=r,this)},__deepEqual:function(t){var e=this._vector.__iterator__();return t.every(function(t,r){var n=e.next();return n&&(n=n[1]),n&&w(r,n[0])&&w(t,n[1])})},__iterate:function(t,e){return this._vector?this._vector.fromEntries().__iterate(t,e):0}},{empty:function(){return De||(De=Oe._make())},_make:function(t,e,r){var n=Object.create(Oe.prototype);return n.length=t?t.length:0,n._map=t,n._vector=e,n.__ownerID=r,n}},X),ke.from=ke;var De,be=function(t,e){var r=function(t){this._map=X(t)};t=L(t),r.prototype=Object.create(Me.prototype),r.prototype.constructor=r,r.prototype._name=e,r.prototype._defaultValues=t;var n=Object.keys(t);return r.prototype.length=n.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(r.prototype,e,{get:function(){return this.get(e)},set:function(t){if(!this.__ownerID)throw Error("Cannot set on an immutable record.");this.set(e,t)}})}),r},Me=be;B.createClass(be,{toString:function(){return this.__toString((this._name||"Record")+" {","}")},has:function(t){return this._defaultValues.has(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues.get(t)):e},clear:function(){return this.__ownerID?(this._map.clear(),this):this._empty()},set:function(t,e){if(null==t||!this.has(t))return this;var r=this._map.set(t,e);return this.__ownerID||r===this._map?this:this._make(r) <del>},"delete":function(t){if(null==t||!this.has(t))return this;var e=this._map.delete(t);return this.__ownerID||e===this._map?this:this._make(e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?this._make(e,t):(this.__ownerID=t,this._map=e,this)},__iterate:function(t,e){var r=this;return this._defaultValues.map(function(t,e){return r.get(e)}).__iterate(t,e)},_empty:function(){Object.getPrototypeOf(this).constructor;return Me._empty||(Me._empty=this._make(X.empty()))},_make:function(t,e){var r=Object.create(Object.getPrototypeOf(this));return r._map=t,r.__ownerID=e,r}},{},L),be.prototype.__deepEqual=X.prototype.__deepEqual,be.prototype.merge=X.prototype.merge,be.prototype.mergeWith=X.prototype.mergeWith,be.prototype.mergeDeep=X.prototype.mergeDeep,be.prototype.mergeDeepWith=X.prototype.mergeDeepWith,be.prototype.update=X.prototype.update,be.prototype.updateIn=X.prototype.updateIn,be.prototype.cursor=X.prototype.cursor,be.prototype.withMutations=X.prototype.withMutations,be.prototype.asMutable=X.prototype.asMutable,be.prototype.asImmutable=X.prototype.asImmutable;var Se=function(t,e,r){return this instanceof xe?(U(0!==r,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&Ee?Ee:(r=null==r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.length=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new xe(t,e,r)},xe=Se;B.createClass(Se,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(t){return U(t>=0,"Index out of bounds"),this.length>t},get:function(t,e){return U(t>=0,"Index out of bounds"),1/0===this.length||this.length>t?this._start+t*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.length>e&&e===Math.floor(e)},slice:function(t,e,r){return u(t,e,this.length)?this:r?B.superCall(this,xe.prototype,"slice",[t,e,r]):(t=o(t,this.length),e=a(e,this.length),t>=e?Ee:new xe(this.get(t,this._end),this.get(e,this._end),this._step)) <del>},__deepEquals:function(t){return this._start===t._start&&this._end===t._end&&this._step===t._step},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.length>r)return r}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,t)},skip:function(t,e){return e?B.superCall(this,xe.prototype,"skip",[t]):this.slice(t)},__iterate:function(t,e,r){for(var n=e^r,i=this.length-1,s=this._step,u=e?this._start+i*s:this._start,o=0;i>=o&&t(u,n?i-o:o,this)!==!1;o++)u+=e?-s:s;return n?this.length:o}},{},K),Se.prototype.__toJS=Se.prototype.toArray,Se.prototype.first=fe.prototype.first,Se.prototype.last=fe.prototype.last;var Ee=Se(0,0),Ce=function(t,e){return 0===e&&qe?qe:this instanceof Ae?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new Ae(t,e)},Ae=Ce;B.createClass(Ce,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return U(t>=0,"Index out of bounds"),1/0===this.length||this.length>t?this._value:e},first:function(){return this._value},contains:function(t){return w(this._value,t)},__deepEquals:function(t){return w(this._value,t._value)},slice:function(t,e,r){if(r)return B.superCall(this,Ae.prototype,"slice",[t,e,r]);var n=this.length;return t=0>t?Math.max(0,n+t):Math.min(n,t),e=null==e?n:e>0?Math.min(n,e):Math.max(0,n+e),e>t?new Ae(this._value,e-t):qe},reverse:function(t){return t?B.superCall(this,Ae.prototype,"reverse",[t]):this},indexOf:function(t){return w(this._value,t)?0:-1},lastIndexOf:function(t){return w(this._value,t)?this.length:-1},__iterate:function(t,e,r){var n=e^r;U(!n||1/0>this.length,"Cannot access end of infinite range.");for(var i=this.length-1,s=0;i>=s&&t(this._value,n?i-s:s,this)!==!1;s++);return n?this.length:s}},{},K),Ce.prototype.last=Ce.prototype.first,Ce.prototype.has=Se.prototype.has,Ce.prototype.take=Se.prototype.take,Ce.prototype.skip=Se.prototype.skip,Ce.prototype.__toJS=Se.prototype.__toJS;var qe=new Ce(void 0,0),je={Sequence:L,Map:X,Vector:fe,Set:de,OrderedMap:ke,Record:be,Range:Se,Repeat:Ce,is:w,fromJS:z}; <del>return je}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t(); <ide>\ No newline at end of file <add>function t(){function t(t,e,r,n){var i;if(n){var s=n.prototype;i=L.create(s)}else i=t.prototype;return L.keys(e).forEach(function(t){i[t]=e[t]}),L.keys(r).forEach(function(e){t[e]=r[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,r,n){return L.getPrototypeOf(e)[r].apply(t,n)}function r(t,r,n){e(t,r,"constructor",n)}function n(){return Object.create(K.prototype)}function i(t){var e=Object.create(N.prototype);return e.__reversedIndices=t?t.__reversedIndices:!1,e}function s(t,e,r,n){var i=t.get?t.get(e[n],te):te;return i===te?r:++n===e.length?i:s(i,e,r,n)}function u(t,e,r){return(0===t||null!=r&&-r>=t)&&(null==e||null!=r&&e>=r)}function o(t,e){return 0>t?Math.max(0,e+t):e?Math.min(e,t):t}function a(t,e){return null==t?e:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function h(t){return t}function l(t,e){return[e,t]}function c(){return!0}function f(){return this}function _(t){return(t||0)+1}function p(t,e,r,n,i){var s=t.__makeSequence();return s.__iterateUncached=function(s,u,o){var a=0,h=t.__iterate(function(t,i,u){if(e.call(r,t,i,u)){if(s(t,n?i:a,u)===!1)return!1;a++}},u,o);return i?h:a},s}function v(t){return function(){return!t.apply(this,arguments)}}function g(t){return"string"==typeof t?JSON.stringify(t):t}function y(t,e){for(var r="";e;)1&e&&(r+=t),(e>>=1)&&(t+=t);return r}function m(t,e){return t>e?1:e>t?-1:0}function d(t){if(1/0===t)throw Error("Cannot perform this action with an infinite sequence.")}function w(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof K?t.equals(e):!1}function I(t,e,r){var n=t._rootData.updateIn(t._keyPath,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,n,t._rootData,r?i.concat(r):i),new T(n,t._keyPath,t._onChange)}function k(){}function O(t,e,r,n,i){var s=r>>>e&$,u=[],o=[];return o[s]=i,null!=n&&(u[s]=n),new ne(t,1<<s,u,o)}function D(t,e,r){for(var n=[],i=0;r.length>i;i++){var s=r[i];s&&n.push(Array.isArray(s)?K(s).fromEntries():K(s))}return M(t,e,n)}function b(t){return function(e,r){return e&&e.mergeDeepWith?e.mergeDeepWith(t,r):t?t(e,r):r}}function M(t,e,r){return 0===r.length?t:t.withMutations(function(t){for(var n=e?function(r,n){var i=t.get(n,te); <add>t.set(n,i===te?r:e(i,r))}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function S(t,e,r,n){var i=e[n],s=t.get?t.get(i,te):te;if(s===te&&(s=ee.empty()),!t.set)throw Error("updateIn with invalid keyPath");return t.set(i,++n===e.length?r(s):S(s,e,r,n))}function x(t){return ae.value=t,ae}function E(t){if(!t)return 0;if(t===!0)return 1;if("function"==typeof t.hashCode)return t.hashCode();var e=typeof t;if("number"===e)return Math.floor(t)%2147483647;if("string"===e)return C(t);throw Error("Unable to hash")}function C(t){var e=fe[t];if(null==e){e=0;for(var r=0;t.length>r;r++)e=(31*e+t.charCodeAt(r))%he;ce===le&&(ce=0,fe={}),ce++,fe[t]=e}return e}function A(t,e,r,n,i,s){var u=Object.create(ve);return u.length=e-t,u._origin=t,u._size=e,u._level=r,u._root=n,u._tail=i,u.__ownerID=s,u}function q(t,e){if(e>=z(t._size))return t._tail;if(1<<t._level+Y>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&$],n-=Y;return r}}function j(t,e,r){var n=t.__ownerID||new k,i=t._origin,s=t._size,u=i+e,o=null==r?s:0>r?s+r:i+r;if(u===i&&o===s)return t;if(u>=o)return t.clear();for(var a=t._level,h=t._root,l=0;0>u+l;)h=new ge(h.array.length?[,h]:[],n),a+=Y,l+=1<<a;l&&(u+=l,i+=l,o+=l,s+=l);for(var c=z(s),f=z(o);f>=1<<a+Y;)h=new ge(h.array.length?[h]:[],n),a+=Y;var _=t._tail,p=c>f?q(t,o-1):f>c?new ge([],n):_;if(f>c&&s>u&&_.array.length){h=h.ensureOwner(n);for(var v=h,g=a;g>Y;g-=Y){var y=c>>>g&$;v=v.array[y]=v.array[y]?v.array[y].ensureOwner(n):new ge([],n)}v.array[c>>>Y&$]=_}if(s>o&&(p=p.removeAfter(n,0,o)),u>=f)u-=f,o-=f,a=Y,h=we,p=p.removeBefore(n,0,u);else if(u>i||c>f){var m,d;l=0;do m=u>>>a&$,d=f-1>>>a&$,m===d&&(m&&(l+=(1<<a)*m),a-=Y,h=h&&h.array[m]);while(h&&m===d);h&&u>i&&(h=h.removeBefore(n,a,u-l)),h&&c>f&&(h=h.removeAfter(n,a,f-l)),l&&(u-=l,o-=l),h=h||we}return t.__ownerID?(t.length=o-u,t._origin=u,t._size=o,t._level=a,t._root=h,t._tail=p,t):A(u,o,a,h,p)}function P(t,e,r){for(var n=[],i=0;r.length>i;i++){var s=r[i];s&&n.push(s.forEach?s:K(s))}var u=Math.max.apply(null,n.map(function(t){return t.length||0}));return u>t.length&&(t=t.setLength(u)),M(t,e,n) <add>}function U(t,e){if(0>t)throw Error("Index out of bounds");return t+e}function z(t){return Z>t?0:t-1>>>Y<<Y}function R(t,e){if(!t)throw Error(e)}function R(t,e){if(!t)throw Error(e)}function W(t,e){return e?J(e,t,"",{"":t}):B(t)}function J(t,e,r,n){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(n,r,K(e).map(function(r,n){return J(t,r,n,e)})):e}function B(t){if(t){if(Array.isArray(t))return K(t).map(B).toVector();if(t.constructor===Object)return K(t).map(B).toMap()}return t}var L=Object,V={};V.createClass=t,V.superCall=e,V.defaultSuperCall=r;var K=function(t){return H.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},H=K;V.createClass(K,{toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e},__toStringMapper:function(t,e){return e+": "+g(t)},toJS:function(){return this.map(function(t){return t instanceof H?t.toJS():t}).__toJS()},toArray:function(){d(this.length);var t=Array(this.length||0);return this.values().forEach(function(e,r){t[r]=e}),t},toObject:function(){d(this.length);var t={};return this.forEach(function(e,r){t[r]=e}),t},toVector:function(){return d(this.length),_e.from(this)},toMap:function(){return d(this.length),ee.from(this)},toOrderedMap:function(){return d(this.length),De.from(this)},toSet:function(){return d(this.length),Ie.from(this)},equals:function(t){if(this===t)return!0;if(!(t instanceof H))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0}return this.__deepEquals(t)},__deepEquals:function(t){var e=this.cacheResult().entries().toArray(),r=0;return t.every(function(t,n){var i=e[r++];return w(n,i[0])&&w(t,i[1])})},join:function(t){t=t||",";var e="",r=!0;return this.forEach(function(n){r?(r=!1,e+=n):e+=t+n}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(c)),this.length)},countBy:function(t){var e=this;return De.empty().withMutations(function(r){e.forEach(function(e,n,i){r.update(t(e,n,i),_) <add>})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var r=[this].concat(t.map(function(t){return H(t)})),n=this.__makeSequence();return n.length=r.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),n.__iterateUncached=function(t,e){for(var n,i=0,s=r.length-1,u=0;s>=u&&!n;u++){var o=r[e?s-u:u];i+=o.__iterate(function(e,r,i){return t(e,r,i)===!1?(n=!0,!1):void 0},e)}return i},n},reverse:function(){var t=this,e=t.__makeSequence();return e.length=t.length,e.__iterateUncached=function(e,r){return t.__iterate(e,!r)},e.reverse=function(){return t},e},keys:function(){return this.flip().values()},values:function(){var t=this,e=i(t);return e.length=t.length,e.values=f,e.__iterateUncached=function(e,r,n){if(n&&null==this.length)return this.cacheResult().__iterate(e,r,n);var i,s=0;return n?(s=this.length-1,i=function(t,r,n){return e(t,s--,n)!==!1}):i=function(t,r,n){return e(t,s++,n)!==!1},t.__iterate(i,r),n?this.length:s},e},entries:function(){var t=this;if(t._cache)return H(t._cache);var e=t.map(l).values();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,r){var n=e;return this.forEach(function(e,i,s){n=t.call(r,n,e,i,s)}),n},reduceRight:function(t,e,r){return this.reverse(!0).reduce(t,e,r)},every:function(t,e){var r=!0;return this.forEach(function(n,i,s){return t.call(e,n,i,s)?void 0:(r=!1,!1)}),r},some:function(t,e){return!this.every(v(t),e)},first:function(){return this.find(c)},last:function(){return this.findLast(c)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,te)!==te},get:function(t,e){return this.find(function(e,r){return w(r,t)},null,e)},getIn:function(t,e){return t&&0!==t.length?s(this,t,e,0):this},contains:function(t){return this.find(function(e){return w(e,t)},null,te)!==te},find:function(t,e,r){var n=r;return this.forEach(function(r,i,s){return t.call(e,r,i,s)?(n=r,!1):void 0}),n},findKey:function(t,e){var r;return this.forEach(function(n,i,s){return t.call(e,n,i,s)?(r=i,!1):void 0 <add>}),r},findLast:function(t,e,r){return this.reverse(!0).find(t,e,r)},findLastKey:function(t,e){return this.reverse(!0).findKey(t,e)},flip:function(){var t=this,e=n();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,r){return t.__iterate(function(t,r,n){return e(r,t,n)!==!1},r)},e},map:function(t,e){var r=this,n=r.__makeSequence();return n.length=r.length,n.__iterateUncached=function(n,i){return r.__iterate(function(r,i,s){return n(t.call(e,r,i,s),i,s)!==!1},i)},n},mapKeys:function(t,e){var r=this,n=r.__makeSequence();return n.length=r.length,n.__iterateUncached=function(n,i){return r.__iterate(function(r,i,s){return n(r,t.call(e,i,r,s),s)!==!1},i)},n},filter:function(t,e){return p(this,t,e,!0,!1)},slice:function(t,e){if(u(t,e,this.length))return this;var r=o(t,this.length),n=a(e,this.length);if(r!==r||n!==n)return this.entries().slice(t,e).fromEntries();var i=0===r?this:this.skip(r);return null==n||n===this.length?i:i.take(n-r)},take:function(t){var e=0,r=this.takeWhile(function(){return e++<t});return r.length=this.length&&Math.min(this.length,t),r},takeLast:function(t,e){return this.reverse(e).take(t).reverse(e)},takeWhile:function(t,e){var r=this,n=r.__makeSequence();return n.__iterateUncached=function(n,i,s){if(i)return this.cacheResult().__iterate(n,i,s);var u=0;return r.__iterate(function(r,i,s){return t.call(e,r,i,s)&&n(r,i,s)!==!1?void u++:!1},i,s),u},n},takeUntil:function(t,e,r){return this.takeWhile(v(t),e,r)},skip:function(t,e){if(0===t)return this;var r=0,n=this.skipWhile(function(){return r++<t},null,e);return n.length=this.length&&Math.max(0,this.length-t),n},skipLast:function(t,e){return this.reverse(e).skip(t).reverse(e)},skipWhile:function(t,e){var r=this,n=r.__makeSequence();return n.__iterateUncached=function(n,i,s){if(i)return this.cacheResult().__iterate(n,i,s);var u=!0,o=0;return r.__iterate(function(r,i,s){if(!u||!(u=t.call(e,r,i,s))){if(n(r,i,s)===!1)return!1;o++}},i,s),o},n},skipUntil:function(t,e,r){return this.skipWhile(v(t),e,r)},groupBy:function(t){var e=this,r=De.empty().withMutations(function(r){e.forEach(function(e,n,i){var s=t(e,n,i),u=r.get(s,te); <add>u===te&&(u=[],r.set(s,u)),u.push([n,e])})});return r.map(function(t){return H(t).fromEntries()})},sort:function(t,e){return this.sortBy(h,t,e)},sortBy:function(t,e){e=e||m;var r=this;return H(this.entries().entries().toArray().sort(function(n,i){return e(t(n[1][1],n[1][0],r),t(i[1][1],i[1][0],r))||n[0]-i[0]})).fromEntries().values().fromEntries()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(d(this.length),this._cache=this.entries().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e,r){if(!this._cache)return this.__iterateUncached(t,e,r);var n=this.length-1,i=this._cache,s=this;if(e)for(var u=i.length-1;u>=0;u--){var o=i[u];if(t(o[1],r?o[0]:n-o[0],s)===!1)break}else i.every(r?function(e){return t(e[1],n-e[0],s)!==!1}:function(e){return t(e[1],e[0],s)!==!1});return this.length},__makeSequence:function(){return n()}},{from:function(t){if(t instanceof H)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new G(t);t=[t]}return new Q(t)}}),K.prototype.toJSON=K.prototype.toJS,K.prototype.inspect=K.prototype.toSource=function(){return""+this},K.prototype.__toJS=K.prototype.toObject;var N=function(){V.defaultSuperCall(this,F.prototype,arguments)},F=N;V.createClass(N,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){d(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,r){t[r]=e}),t},fromEntries:function(){var t=this,e=n();return e.length=t.length,e.entries=function(){return t},e.__iterateUncached=function(e,r,n){return t.__iterate(function(t,r,n){return e(t[1],t[0],n)},r,n)},e},join:function(t){t=t||",";var e="",r=0;return this.forEach(function(n,i){var s=i-r;r=i,e+=(1===s?t:y(t,s))+n}),this.length&&this.length-1>r&&(e+=y(t,this.length-1-r)),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var r=[this].concat(t).map(function(t){return K(t)}),n=this.__makeSequence();return n.length=r.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),n.__iterateUncached=function(t,e,n){if(n&&!this.length)return this.cacheResult().__iterate(t,e,n); <add>for(var i,s=0,u=n&&this.length-1,o=r.length-1,a=0;o>=a&&!i;a++){var h=r[e?o-a:a];h instanceof F||(h=h.values()),s+=h.__iterate(function(e,r,o){return r+=s,t(e,n?u-r:r,o)===!1?(i=!0,!1):void 0},e)}return s},n},reverse:function(t){var e=this,r=e.__makeSequence();return r.length=e.length,r.__reversedIndices=!!(t^e.__reversedIndices),r.__iterateUncached=function(r,n,i){return e.__iterate(r,!n,i^t)},r.reverse=function(r){return t===r?e:F.prototype.reverse.call(this,r)},r},values:function(){var t=V.superCall(this,F.prototype,"values",[]);return t.length=void 0,t},filter:function(t,e,r){var n=p(this,t,e,r,r);return r&&(n.length=this.length),n},indexOf:function(t){return this.findIndex(function(e){return w(e,t)})},lastIndexOf:function(t){return this.reverse(!0).indexOf(t)},findIndex:function(t,e){var r=this.findKey(t,e);return null==r?-1:r},findLastIndex:function(t,e){return this.reverse(!0).findIndex(t,e)},slice:function(t,e,r){var n=this;if(u(t,e,n.length))return n;var i=n.__makeSequence(),s=o(t,n.length),h=a(e,n.length);return i.length=n.length&&(r?n.length:h-s),i.__reversedIndices=n.__reversedIndices,i.__iterateUncached=function(i,u,l){if(u)return this.cacheResult().__iterate(i,u,l);var c=this.__reversedIndices^l;if(s!==s||h!==h||c&&null==n.length){var f=n.count();s=o(t,f),h=a(e,f)}var _=c?n.length-h:s,p=c?n.length-s:h,v=n.__iterate(function(t,e,n){return c?null!=p&&e>=p||e>=_&&i(t,r?e:e-_,n)!==!1:_>e||(null==p||p>e)&&i(t,r?e:e-_,n)!==!1},u,l);return null!=this.length?this.length:r?v:Math.max(0,v-_)},i},splice:function(t,e){for(var r=[],n=2;arguments.length>n;n++)r[n-2]=arguments[n];return 0===e&&0===r.length?this:this.slice(0,t).concat(r,this.slice(t+e))},takeWhile:function(t,e,r){var n=this,i=n.__makeSequence();return i.__iterateUncached=function(s,u,o){if(u)return this.cacheResult().__iterate(s,u,o);var a=0,h=!0,l=n.__iterate(function(r,n,i){return t.call(e,r,n,i)&&s(r,n,i)!==!1?void(a=n):(h=!1,!1)},u,o);return r?i.length:h?l:a+1},r&&(i.length=this.length),i},skipWhile:function(t,e,r){var n=this,i=n.__makeSequence(); <add>return r&&(i.length=this.length),i.__iterateUncached=function(i,s,u){if(s)return this.cacheResult().__iterate(i,s,u);var o=n.__reversedIndices^u,a=!0,h=0,l=n.__iterate(function(n,s,o){return a&&(a=t.call(e,n,s,o),a||(h=s)),a||i(n,u||r?s:s-h,o)!==!1},s,u);return r?l:o?h+1:l-h},i},groupBy:function(t,e,r){var n=this,i=De.empty().withMutations(function(e){n.forEach(function(i,s,u){var o=t(i,s,u),a=e.get(o,te);a===te&&(a=Array(r?n.length:0),e.set(o,a)),r?a[s]=i:a.push(i)})});return i.map(function(t){return K(t)})},sortBy:function(t,e,r){var n=V.superCall(this,F.prototype,"sortBy",[t,e]);return r||(n=n.values()),n.length=this.length,n},__makeSequence:function(){return i(this)}},{},K),N.prototype.__toJS=N.prototype.toArray,N.prototype.__toStringMapper=g;var G=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};V.createClass(G,{toObject:function(){return this._object},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,s=0;i>=s;s++){var u=e?i-s:s;if(t(r[n[u]],n[u],r)===!1)break}return s}},{},K);var Q=function(t){this._array=t,this.length=t.length};V.createClass(Q,{toArray:function(){return this._array},__iterate:function(t,e,r){var n=this._array,i=n.length-1,s=-1;if(e){for(var u=i;u>=0;u--){if(n.hasOwnProperty(u)&&t(n[u],r?u:i-u,n)===!1)return s+1;s=u}return n.length}var o=n.every(function(e,u){return t(e,r?i-u:u,n)===!1?!1:(s=u,!0)});return o?n.length:s+1}},{},N),Q.prototype.get=G.prototype.get,Q.prototype.has=G.prototype.has;var T=function(t,e,r){this._rootData=t,this._keyPath=e,this._onChange=r},X=T;V.createClass(T,{get:function(t,e){var r=this._rootData.getIn(this._keyPath,ee.empty());return t?r.get(t,e):r},set:function(t,e){return I(this,function(r){return r.set(t,e)},t)},"delete":function(t){return I(this,function(e){return e.delete(t)},t)},update:function(t,e){var r;return"function"==typeof t?(r=t,t=void 0):r=function(r){return r.update(t,e)},I(this,r,t) <add>},cursor:function(t){return t&&!Array.isArray(t)&&(t=[t]),t&&0!==t.length?new X(this._rootData,this._keyPath?this._keyPath.concat(t):t,this._onChange):this}},{});var Y=5,Z=1<<Y,$=Z-1,te={},ee=function(t){return t&&t.constructor===re?t:t&&0!==t.length?re.empty().merge(t):re.empty()},re=ee;V.createClass(ee,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return null==t||null==this._root?e:this._root.get(0,E(t),t,e)},set:function(t,e){if(null==t)return this;var r,n=this.length;if(this._root){var i=x();r=this._root.set(this.__ownerID,0,E(t),t,e,i),i.value&&n++}else n++,r=O(this.__ownerID,0,E(t),t,e);return this.__ownerID?(this.length=n,this._root=r,this):r===this._root?this:re._make(n,r)},"delete":function(t){if(null==t||null==this._root)return this;if(this.__ownerID){var e=x();return this._root=this._root.delete(this.__ownerID,0,E(t),t,e),e.value&&this.length--,this}var r=this._root.delete(this.__ownerID,0,E(t),t);return r?r===this._root?this:re._make(this.length-1,r):re.empty()},update:function(t,e){return this.set(t,e(this.get(t)))},clear:function(){return this.__ownerID?(this.length=0,this._root=null,this):re.empty()},merge:function(){return D(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return D(this,t,e)},mergeDeep:function(){return D(this,b(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return D(this,b(t),e)},updateIn:function(t,e){return t&&0!==t.length?S(this,t,e,0):e(this)},cursor:function(t,e){return e||"function"!=typeof t||(e=t,t=null),t&&!Array.isArray(t)&&(t=[t]),new T(this,t,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.__ensureOwner(this.__ownerID)},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new k)},asImmutable:function(){return this.__ensureOwner()},__ensureOwner:function(t){return t===this.__ownerID?this:t?re._make(this.length,this._root,t):(this.__ownerID=t,this)},__deepEqual:function(t){var e=this;return t.every(function(t,r){return w(e.get(r,te),t) <add>})},__iterate:function(t,e){return this._root?this._root.iterate(this,t,e):0}},{empty:function(){return oe||(oe=re._make(0))},_make:function(t,e,r){var n=Object.create(re.prototype);return n.length=t,n._root=e,n.__ownerID=r,n}},K),ee.from=ee;var ne=function(t,e,r,n){this.ownerID=t,this.bitmap=e,this.keys=r,this.values=n},ie=ne;V.createClass(ne,{get:function(t,e,r,n){var i=e>>>t&$;if(0===(this.bitmap&1<<i))return n;var s=this.keys[i],u=this.values[i];return null==s?u.get(t+Y,e,r,n):r===s?u:n},set:function(t,e,r,n,i,s){var u,o=r>>>e&$,a=1<<o;if(0===(this.bitmap&a))return s&&(s.value=!0),u=this.ensureOwner(t),u.keys[o]=n,u.values[o]=i,u.bitmap|=a,u;var h,l=this.keys[o],c=this.values[o];if(null==l)return h=c.set(t,e+Y,r,n,i,s),h===c?this:(u=this.ensureOwner(t),u.values[o]=h,u);if(n===l)return i===c?this:(u=this.ensureOwner(t),u.values[o]=i,u);var f=E(l);return h=r===f?new se(t,r,[l,n],[c,i]):O(t,e+Y,f,l,c).set(t,e+Y,r,n,i),s&&(s.value=!0),u=this.ensureOwner(t),delete u.keys[o],u.values[o]=h,u},"delete":function(t,e,r,n,i){var s,u=r>>>e&$,o=1<<u,a=this.keys[u];if(0===(this.bitmap&o)||null!=a&&n!==a)return this;if(null==a){var h=this.values[u],l=h.delete(t,e+Y,r,n,i);if(l===h)return this;if(l)return s=this.ensureOwner(t),s.values[u]=l,s}else i&&(i.value=!0);return this.bitmap===o?null:(s=this.ensureOwner(t),delete s.keys[u],delete s.values[u],s.bitmap^=o,s)},ensureOwner:function(t){return t&&t===this.ownerID?this:new ie(t,this.bitmap,this.keys.slice(),this.values.slice())},iterate:function(t,e,r){for(var n=this.values,i=this.keys,s=n.length,u=0;s>=u;u++){var o=r?s-u:u,a=i[o],h=n[o];if(null!=a){if(e(h,a,t)===!1)return!1}else if(h&&!h.iterate(t,e,r))return!1}return!0}},{});var se=function(t,e,r,n){this.ownerID=t,this.collisionHash=e,this.keys=r,this.values=n},ue=se;V.createClass(se,{get:function(t,e,r,n){var i=K(this.keys).indexOf(r);return-1===i?n:this.values[i]},set:function(t,e,r,n,i,s){if(r!==this.collisionHash)return s&&(s.value=!0),O(t,e,this.collisionHash,null,this).set(t,e,r,n,i);var u=K(this.keys).indexOf(n);if(u>=0&&this.values[u]===i)return this; <add>var o=this.ensureOwner(t);return-1===u?(o.keys.push(n),o.values.push(i),s&&(s.value=!0)):o.values[u]=i,o},"delete":function(t,e,r,n,i){var s=this.keys.indexOf(n);if(-1===s)return this;if(i&&(i.value=!0),this.values.length>1){var u=this.ensureOwner(t);return u.keys[s]=u.keys.pop(),u.values[s]=u.values.pop(),u}},ensureOwner:function(t){return t&&t===this.ownerID?this:new ue(t,this.collisionHash,this.keys.slice(),this.values.slice())},iterate:function(t,e,r){for(var n=this.values,i=this.keys,s=n.length-1,u=0;s>=u;u++){var o=r?s-u:u;if(e(n[o],i[o],t)===!1)return!1}return!0}},{});var oe,ae={value:!1},he=4294967296,le=255,ce=0,fe={},_e=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return pe.from(t)},pe=_e;V.createClass(_e,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=U(t,this._origin),t>=this._size)return e;var r=q(this,t),n=t&$;return r&&(void 0===e||r.array.hasOwnProperty(n))?r.array[n]:e},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){var r=z(this._size);if(t>=this.length)return this.withMutations(function(r){return j(r,0,t+1).set(t,e)});if(this.get(t,te)===e)return this;if(t=U(t,this._origin),t>=r){var n=this._tail.ensureOwner(this.__ownerID);n.array[t&$]=e;var i=t>=this._size?t+1:this._size;return this.__ownerID?(this.length=i-this._origin,this._size=i,this._tail=n,this):A(this._origin,i,this._level,this._root,n)}for(var s=this._root.ensureOwner(this.__ownerID),u=s,o=this._level;o>0;o-=Y){var a=t>>>o&$;u=u.array[a]=u.array[a]?u.array[a].ensureOwner(this.__ownerID):new ge([],this.__ownerID)}return u.array[t&$]=e,this.__ownerID?(this._root=s,this):A(this._origin,this._size,this._level,s,this._tail)},"delete":function(t){if(!this.has(t))return this;var e=z(this._size);if(t=U(t,this._origin),t>=e){var r=this._tail.ensureOwner(this.__ownerID);return delete r.array[t&$],this.__ownerID?(this._tail=r,this):A(this._origin,this._size,this._level,this._root,r)}for(var n=this._root.ensureOwner(this.__ownerID),i=n,s=this._level;s>0;s-=Y){var u=t>>>s&$; <add>i=i.array[u]=i.array[u].ensureOwner(this.__ownerID)}return delete i.array[t&$],this.__ownerID?(this._root=n,this):A(this._origin,this._size,this._level,n,this._tail)},clear:function(){return this.__ownerID?(this.length=this._origin=this._size=0,this._level=Y,this._root=this._tail=we,this):pe.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(r){j(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return j(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){j(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return j(this,1)},merge:function(){return P(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return P(this,t,e)},mergeDeep:function(){return P(this,b(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return P(this,b(t),e)},setLength:function(t){return j(this,0,t)},slice:function(t,e,r){var n=V.superCall(this,pe.prototype,"slice",[t,e,r]);if(!r&&n!==this){var i=this,s=i.length;n.toVector=function(){return j(i,0>t?Math.max(0,s+t):s?Math.min(s,t):t,null==e?s:0>e?Math.max(0,s+e):s?Math.min(s,e):e)}}return n},iterator:function(){return new me(this,this._origin,this._size,this._level,this._root,this._tail)},__iterate:function(t,e,r){var n=this,i=0,s=n.length-1;r^=e;var u,o=function(e,u){return t(e,r?s-u:u,n)===!1?!1:(i=u,!0)},a=z(this._size);return u=e?this._tail.iterate(0,a-this._origin,this._size-this._origin,o,e)&&this._root.iterate(this._level,-this._origin,a-this._origin,o,e):this._root.iterate(this._level,-this._origin,a-this._origin,o,e)&&this._tail.iterate(0,a-this._origin,this._size-this._origin,o,e),(u?s:e?s-i:i)+1},__deepEquals:function(t){var e=this.iterator();return t.every(function(t,r){var n=e.next().value;return n&&r===n[0]&&w(t,n[1])})},__ensureOwner:function(t){return t===this.__ownerID?this:t?A(this._origin,this._size,this._level,this._root,this._tail,t):(this.__ownerID=t,this) <add>}},{empty:function(){return de||(de=A(0,0,Y,we,we))},from:function(t){if(t&&t.constructor===pe)return t;if(!t||0===t.length)return pe.empty();var e=Array.isArray(t);return t.length>0&&Z>t.length?A(0,t.length,Y,we,new ge(e?t.slice():K(t).toArray())):(e||(t=K(t),t instanceof N||(t=t.values())),pe.empty().merge(t))}},N);var ve=_e.prototype;ve["@@iterator"]=ve.__iterator__,ve.update=ee.prototype.update,ve.updateIn=ee.prototype.updateIn,ve.cursor=ee.prototype.cursor,ve.withMutations=ee.prototype.withMutations,ve.asMutable=ee.prototype.asMutable,ve.asImmutable=ee.prototype.asImmutable;var ge=function(t,e){this.array=t,this.ownerID=e},ye=ge;V.createClass(ge,{ensureOwner:function(t){return t&&t===this.ownerID?this:new ye(this.array.slice(),t)},removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&$;if(n>=this.array.length)return new ye([],t);var i,s=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-Y,r),i===u&&s)return this}if(s&&!i)return this;var o=this.ensureOwner();if(!s)for(var a=0;n>a;a++)delete o.array[a];return i&&(o.array[n]=i),o},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&$;if(n>=this.array.length)return this;var i,s=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-Y,r),i===u&&s)return this}if(s&&!i)return this;var o=this.ensureOwner();return s||(o.array.length=n+1),i&&(o.array[n]=i),o},iterate:function(t,e,r,n,i){if(0===t){if(i){for(var s=this.array.length-1;s>=0;s--)if(this.array.hasOwnProperty(s)){var u=s+e;if(u>=0&&r>u&&n(this.array[s],u)===!1)return!1}return!0}return this.array.every(function(t,i){var s=i+e;return 0>s||s>=r||n(t,s)!==!1})}var o=1<<t,a=t-Y;if(i){for(var h=this.array.length-1;h>=0;h--){var l=e+h*o;if(r>l&&l+o>0&&this.array.hasOwnProperty(h)&&!this.array[h].iterate(a,l,r,n,i))return!1}return!0}return this.array.every(function(t,s){var u=e+s*o;return u>=r||0>=u+o||t.iterate(a,u,r,n,i)})}},{});var me=function(t,e,r,n,i,s){var u=z(r);this._stack={node:i.array,level:n,offset:-e,max:u-e,__prev:{node:s.array,level:0,offset:u-e,max:r-e}} <add>};V.createClass(me,{next:function(){var t=this._stack;t:for(;t;){if(0===t.level)for(t.rawIndex||(t.rawIndex=0);t.node.length>t.rawIndex;){var e=t.rawIndex+t.offset;if(e>=0&&t.max>e&&t.node.hasOwnProperty(t.rawIndex)){var r=t.node[t.rawIndex];return t.rawIndex++,{value:[e,r],done:!0}}t.rawIndex++}else{var n=1<<t.level;for(t.levelIndex||(t.levelIndex=0);t.node.length>t.levelIndex;){var i=t.offset+t.levelIndex*n;if(i+n>0&&t.max>i&&t.node.hasOwnProperty(t.levelIndex)){var s=t.node[t.levelIndex].array;t.levelIndex++,t=this._stack={node:s,level:t.level-Y,offset:i,max:t.max,__prev:t};continue t}t.levelIndex++}}t=this._stack=this._stack.__prev}return{done:!0}}},{});var de,we=new ge([]),Ie=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return ke.from(t)},ke=Ie;V.createClass(Ie,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map?this._map.has(t):!1},get:function(t,e){return this.has(t)?t:e},add:function(t){if(null==t)return this;var e=this._map;return e||(e=ee.empty().__ensureOwner(this.__ownerID)),e=e.set(t,null),this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:ke._make(e)},"delete":function(t){if(null==t||null==this._map)return this;var e=this._map.delete(t);return 0===e.length?this.clear():this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:ke._make(e)},clear:function(){return this.__ownerID?(this.length=0,this._map=null,this):ke.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var r=0;t.length>r;r++){var n=t[r];n=n.forEach?n:K(n),n.forEach(function(t){return e.add(t)})}})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return K(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.delete(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return K(t) <add>});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.delete(r)})})},isSubset:function(t){return t=K(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=K(t),t.every(function(t){return e.contains(t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?ke._make(e,t):(this.__ownerID=t,this._map=e,this)},__deepEquals:function(t){return!(this._map||t._map)||this._map.equals(t._map)},__iterate:function(t,e){var r=this;return this._map?this._map.__iterate(function(e,n){return t(n,n,r)},e):0}},{empty:function(){return Oe||(Oe=ke._make())},from:function(t){return t&&t.constructor===ke?t:t&&0!==t.length?ke.empty().union(t):ke.empty()},fromKeys:function(t){return ke.from(K(t).flip())},_make:function(t,e){var r=Object.create(ke.prototype);return r.length=t?t.length:0,r._map=t,r.__ownerID=e,r}},K),Ie.prototype.contains=Ie.prototype.has,Ie.prototype.withMutations=ee.prototype.withMutations,Ie.prototype.asMutable=ee.prototype.asMutable,Ie.prototype.asImmutable=ee.prototype.asImmutable,Ie.prototype.__toJS=N.prototype.__toJS,Ie.prototype.__toStringMapper=N.prototype.__toStringMapper;var Oe,De=function(t){return t&&t.constructor===be?t:t&&0!==t.length?be.empty().merge(t):be.empty()},be=De;V.createClass(De,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){if(null!=t&&this._map){var r=this._map.get(t);if(null!=r)return this._vector.get(r)[1]}return e},clear:function(){return this.__ownerID?(this.length=0,this._map=this._vector=null,this):be.empty()},set:function(t,e){if(null==t)return this;var r=this._map,n=this._vector;if(r){var i=r.get(t);null==i?(r=r.set(t,n.length),n=n.push([t,e])):n.get(i)[1]!==e&&(n=n.set(i,[t,e]))}else n=_e.empty().__ensureOwner(this.__ownerID).set(0,[t,e]),r=ee.empty().__ensureOwner(this.__ownerID).set(t,0);return this.__ownerID?(this.length=r.length,this._map=r,this._vector=n,this):n===this._vector?this:be._make(r,n) <add>},"delete":function(t){if(null==t||null==this._map)return this;var e=this._map.get(t);if(null==e)return this;var r=this._map.delete(t),n=this._vector.delete(e);return 0===r.length?this.clear():this.__ownerID?(this.length=r.length,this._map=r,this._vector=n,this):r===this._map?this:be._make(r,n)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t),r=this._vector&&this._vector.__ensureOwner(t);return t?be._make(e,r,t):(this.__ownerID=t,this._map=e,this._vector=r,this)},__deepEqual:function(t){var e=this._vector.__iterator__();return t.every(function(t,r){var n=e.next();return n&&(n=n[1]),n&&w(r,n[0])&&w(t,n[1])})},__iterate:function(t,e){return this._vector?this._vector.fromEntries().__iterate(t,e):0}},{empty:function(){return Me||(Me=be._make())},_make:function(t,e,r){var n=Object.create(be.prototype);return n.length=t?t.length:0,n._map=t,n._vector=e,n.__ownerID=r,n}},ee),De.from=De;var Me,Se=function(t,e){var r=function(t){this._map=ee(t)};t=K(t),r.prototype=Object.create(xe.prototype),r.prototype.constructor=r,r.prototype._name=e,r.prototype._defaultValues=t;var n=Object.keys(t);return r.prototype.length=n.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(r.prototype,e,{get:function(){return this.get(e)},set:function(t){if(!this.__ownerID)throw Error("Cannot set on an immutable record.");this.set(e,t)}})}),r},xe=Se;V.createClass(Se,{toString:function(){return this.__toString((this._name||"Record")+" {","}")},has:function(t){return this._defaultValues.has(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues.get(t)):e},clear:function(){return this.__ownerID?(this._map.clear(),this):this._empty()},set:function(t,e){if(null==t||!this.has(t))return this;var r=this._map.set(t,e);return this.__ownerID||r===this._map?this:this._make(r)},"delete":function(t){if(null==t||!this.has(t))return this;var e=this._map.delete(t);return this.__ownerID||e===this._map?this:this._make(e)},__ensureOwner:function(t){if(t===this.__ownerID)return this; <add>var e=this._map&&this._map.__ensureOwner(t);return t?this._make(e,t):(this.__ownerID=t,this._map=e,this)},__iterate:function(t,e){var r=this;return this._defaultValues.map(function(t,e){return r.get(e)}).__iterate(t,e)},_empty:function(){Object.getPrototypeOf(this).constructor;return xe._empty||(xe._empty=this._make(ee.empty()))},_make:function(t,e){var r=Object.create(Object.getPrototypeOf(this));return r._map=t,r.__ownerID=e,r}},{},K),Se.prototype.__deepEqual=ee.prototype.__deepEqual,Se.prototype.merge=ee.prototype.merge,Se.prototype.mergeWith=ee.prototype.mergeWith,Se.prototype.mergeDeep=ee.prototype.mergeDeep,Se.prototype.mergeDeepWith=ee.prototype.mergeDeepWith,Se.prototype.update=ee.prototype.update,Se.prototype.updateIn=ee.prototype.updateIn,Se.prototype.cursor=ee.prototype.cursor,Se.prototype.withMutations=ee.prototype.withMutations,Se.prototype.asMutable=ee.prototype.asMutable,Se.prototype.asImmutable=ee.prototype.asImmutable;var Ee=function(t,e,r){return this instanceof Ce?(R(0!==r,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&Ae?Ae:(r=null==r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.length=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new Ce(t,e,r)},Ce=Ee;V.createClass(Ee,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(t){return R(t>=0,"Index out of bounds"),this.length>t},get:function(t,e){return R(t>=0,"Index out of bounds"),1/0===this.length||this.length>t?this._start+t*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.length>e&&e===Math.floor(e)},slice:function(t,e,r){return u(t,e,this.length)?this:r?V.superCall(this,Ce.prototype,"slice",[t,e,r]):(t=o(t,this.length),e=a(e,this.length),t>=e?Ae:new Ce(this.get(t,this._end),this.get(e,this._end),this._step))},__deepEquals:function(t){return this._start===t._start&&this._end===t._end&&this._step===t._step},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step; <add>if(r>=0&&this.length>r)return r}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,t)},skip:function(t,e){return e?V.superCall(this,Ce.prototype,"skip",[t]):this.slice(t)},__iterate:function(t,e,r){for(var n=e^r,i=this.length-1,s=this._step,u=e?this._start+i*s:this._start,o=0;i>=o&&t(u,n?i-o:o,this)!==!1;o++)u+=e?-s:s;return n?this.length:o}},{},N),Ee.prototype.__toJS=Ee.prototype.toArray,Ee.prototype.first=_e.prototype.first,Ee.prototype.last=_e.prototype.last;var Ae=Ee(0,0),qe=function(t,e){return 0===e&&Pe?Pe:this instanceof je?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new je(t,e)},je=qe;V.createClass(qe,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return R(t>=0,"Index out of bounds"),1/0===this.length||this.length>t?this._value:e},first:function(){return this._value},contains:function(t){return w(this._value,t)},__deepEquals:function(t){return w(this._value,t._value)},slice:function(t,e,r){if(r)return V.superCall(this,je.prototype,"slice",[t,e,r]);var n=this.length;return t=0>t?Math.max(0,n+t):Math.min(n,t),e=null==e?n:e>0?Math.min(n,e):Math.max(0,n+e),e>t?new je(this._value,e-t):Pe},reverse:function(t){return t?V.superCall(this,je.prototype,"reverse",[t]):this},indexOf:function(t){return w(this._value,t)?0:-1},lastIndexOf:function(t){return w(this._value,t)?this.length:-1},__iterate:function(t,e,r){var n=e^r;R(!n||1/0>this.length,"Cannot access end of infinite range.");for(var i=this.length-1,s=0;i>=s&&t(this._value,n?i-s:s,this)!==!1;s++);return n?this.length:s}},{},N),qe.prototype.last=qe.prototype.first,qe.prototype.has=Ee.prototype.has,qe.prototype.take=Ee.prototype.take,qe.prototype.skip=Ee.prototype.skip,qe.prototype.__toJS=Ee.prototype.__toJS;var Pe=new qe(void 0,0),Ue={Sequence:K,Map:ee,Vector:_e,Set:Ie,OrderedMap:De,Record:Se,Range:Ee,Repeat:qe,is:w,fromJS:W};return Ue}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t(); <ide><path>src/Map.js <ide> import "Sequence" <ide> import "is" <ide> import "Cursor" <del>/* global Sequence, is, Cursor */ <add>import "TrieUtils" <add>/* global Sequence, is, Cursor, <add> SHIFT, MASK, SENTINEL, OwnerID */ <ide> /* exported Map */ <ide> <ide> <ide> class Map extends Sequence { <ide> } <ide> <ide> static empty() { <del> return __EMPTY_MAP || (__EMPTY_MAP = Map._make(0)); <add> return EMPTY_MAP || (EMPTY_MAP = Map._make(0)); <ide> } <ide> <ide> toString() { <ide> class Map extends Sequence { <ide> // Using Sentinel here ensures that a missing key is not interpretted as an <ide> // existing key set to be null. <ide> var self = this; <del> return other.every((v, k) => is(self.get(k, __SENTINEL), v)); <add> return other.every((v, k) => is(self.get(k, SENTINEL), v)); <ide> } <ide> <ide> __iterate(fn, reverse) { <ide> class Map extends Sequence { <ide> Map.from = Map; <ide> <ide> <del>class OwnerID { <del> constructor() {} <del>} <del> <del> <ide> class BitmapIndexedNode { <ide> <ide> constructor(ownerID, bitmap, keys, values) { <ide> function mergeIntoCollectionWith(collection, merger, seqs) { <ide> return collection.withMutations(collection => { <ide> var mergeIntoMap = merger ? <ide> (value, key) => { <del> var existing = collection.get(key, __SENTINEL); <add> var existing = collection.get(key, SENTINEL); <ide> collection.set( <del> key, existing === __SENTINEL ? value : merger(existing, value) <add> key, existing === SENTINEL ? value : merger(existing, value) <ide> ); <ide> } : <ide> (value, key) => { <ide> function mergeIntoCollectionWith(collection, merger, seqs) { <ide> <ide> function updateInDeepMap(collection, keyPath, updater, pathOffset) { <ide> var key = keyPath[pathOffset]; <del> var nested = collection.get ? collection.get(key, __SENTINEL) : __SENTINEL; <del> if (nested === __SENTINEL) { <add> var nested = collection.get ? collection.get(key, SENTINEL) : SENTINEL; <add> if (nested === SENTINEL) { <ide> nested = Map.empty(); <ide> } <ide> if (!collection.set) { <ide> function updateInDeepMap(collection, keyPath, updater, pathOffset) { <ide> ); <ide> } <ide> <del>var __BOOL_REF = {value: false}; <add>var BOOL_REF = {value: false}; <ide> function BoolRef(value) { <del> __BOOL_REF.value = value; <del> return __BOOL_REF; <add> BOOL_REF.value = value; <add> return BOOL_REF; <ide> } <ide> <ide> function hashValue(o) { <ide> var STRING_HASH_CACHE_MAX_SIZE = 255; <ide> var STRING_HASH_CACHE_SIZE = 0; <ide> var STRING_HASH_CACHE = {}; <ide> <del> <del>var SHIFT = 5; // Resulted in best performance after ______? <del>var SIZE = 1 << SHIFT; <del>var MASK = SIZE - 1; <del>var __SENTINEL = {}; <del>var __EMPTY_MAP; <add>var EMPTY_MAP; <ide><path>src/Sequence.js <ide> */ <ide> <ide> /* Sequence has implicit lazy dependencies */ <del>/* global is, Map, OrderedMap, Vector, Set */ <add>/* global is, Map, OrderedMap, Vector, Set, SENTINEL */ <ide> /* exported Sequence, IndexedSequence */ <ide> <ide> <ide> class Sequence { <ide> } <ide> <ide> has(searchKey) { <del> return this.get(searchKey, __SENTINEL) !== __SENTINEL; <add> return this.get(searchKey, SENTINEL) !== SENTINEL; <ide> } <ide> <ide> get(searchKey, notFoundValue) { <ide> class Sequence { <ide> } <ide> <ide> contains(searchValue) { <del> return this.find(value => is(value, searchValue), null, __SENTINEL) !== __SENTINEL; <add> return this.find(value => is(value, searchValue), null, SENTINEL) !== SENTINEL; <ide> } <ide> <ide> find(predicate, thisArg, notFoundValue) { <ide> class Sequence { <ide> var groups = OrderedMap.empty().withMutations(map => { <ide> seq.forEach((value, key, collection) => { <ide> var groupKey = mapper(value, key, collection); <del> var group = map.get(groupKey, __SENTINEL); <del> if (group === __SENTINEL) { <add> var group = map.get(groupKey, SENTINEL); <add> if (group === SENTINEL) { <ide> group = []; <ide> map.set(groupKey, group); <ide> } <ide> class IndexedSequence extends Sequence { <ide> var groups = OrderedMap.empty().withMutations(map => { <ide> seq.forEach((value, index, collection) => { <ide> var groupKey = mapper(value, index, collection); <del> var group = map.get(groupKey, __SENTINEL); <del> if (group === __SENTINEL) { <add> var group = map.get(groupKey, SENTINEL); <add> if (group === SENTINEL) { <ide> group = new Array(maintainIndices ? seq.length : 0); <ide> map.set(groupKey, group); <ide> } <ide> function makeIndexedSequence(parent) { <ide> } <ide> <ide> function getInDeepSequence(seq, keyPath, notFoundValue, pathOffset) { <del> var nested = seq.get ? seq.get(keyPath[pathOffset], __SENTINEL) : __SENTINEL; <del> if (nested === __SENTINEL) { <add> var nested = seq.get ? seq.get(keyPath[pathOffset], SENTINEL) : SENTINEL; <add> if (nested === SENTINEL) { <ide> return notFoundValue; <ide> } <ide> if (++pathOffset === keyPath.length) { <ide> function assertNotInfinite(length) { <ide> throw new Error('Cannot perform this action with an infinite sequence.'); <ide> } <ide> } <del> <del>var __SENTINEL = {}; <ide><path>src/TrieUtils.js <add>/** <add> * Copyright (c) 2014, Facebook, Inc. <add> * All rights reserved. <add> * <add> * This source code is licensed under the BSD-style license found in the <add> * LICENSE file in the root directory of this source tree. An additional grant <add> * of patent rights can be found in the PATENTS file in the same directory. <add> */ <add> <add>/* exported SHIFT, SIZE, MASK, SENTINEL, OwnerID */ <add> <add>var SHIFT = 5; // Resulted in best performance after ______? <add>var SIZE = 1 << SHIFT; <add>var MASK = SIZE - 1; <add>var SENTINEL = {}; <add>function OwnerID() {} <ide><path>src/Vector.js <ide> import "Sequence" <ide> import "Map" <ide> import "is" <del>/* global Sequence, IndexedSequence, Map, mergeIntoCollectionWith, deepMerger, is */ <add>import "TrieUtils" <add>/* global Sequence, IndexedSequence, Map, mergeIntoCollectionWith, deepMerger, is, <add> SHIFT, SIZE, MASK, SENTINEL, OwnerID */ <ide> /* exported Vector */ <ide> <ide> <ide> class Vector extends IndexedSequence { <ide> } <ide> <ide> static empty() { <del> return __EMPTY_VECT || (__EMPTY_VECT = <del> Vector._make(0, 0, SHIFT, __EMPTY_VNODE, __EMPTY_VNODE) <add> return EMPTY_VECT || (EMPTY_VECT = <add> makeVector(0, 0, SHIFT, EMPTY_VNODE, EMPTY_VNODE) <ide> ); <ide> } <ide> <ide> class Vector extends IndexedSequence { <ide> } <ide> var isArray = Array.isArray(sequence); <ide> if (sequence.length > 0 && sequence.length < SIZE) { <del> return Vector._make(0, sequence.length, SHIFT, __EMPTY_VNODE, new VNode( <add> return makeVector(0, sequence.length, SHIFT, EMPTY_VNODE, new VNode( <ide> isArray ? sequence.slice() : Sequence(sequence).toArray() <ide> )); <ide> } <ide> class Vector extends IndexedSequence { <ide> if (index >= this._size) { <ide> return undefinedValue; <ide> } <del> var node = _nodeFor(this, index); <add> var node = vectorNodeFor(this, index); <ide> var maskedIndex = index & MASK; <ide> return node && (undefinedValue === undefined || node.array.hasOwnProperty(maskedIndex)) ? <ide> node.array[maskedIndex] : undefinedValue; <ide> class Vector extends IndexedSequence { <ide> <ide> if (index >= this.length) { <ide> return this.withMutations(vect => <del> _setBounds(vect, 0, index + 1).set(index, value) <add> setVectorBounds(vect, 0, index + 1).set(index, value) <ide> ); <ide> } <ide> <del> if (this.get(index, __SENTINEL) === value) { <add> if (this.get(index, SENTINEL) === value) { <ide> return this; <ide> } <ide> <ide> class Vector extends IndexedSequence { <ide> this._tail = newTail; <ide> return this; <ide> } <del> return Vector._make(this._origin, newSize, this._level, this._root, newTail); <add> return makeVector(this._origin, newSize, this._level, this._root, newTail); <ide> } <ide> <ide> // Fits within existing tree. <ide> class Vector extends IndexedSequence { <ide> this._root = newRoot; <ide> return this; <ide> } <del> return Vector._make(this._origin, this._size, this._level, newRoot, this._tail); <add> return makeVector(this._origin, this._size, this._level, newRoot, this._tail); <ide> } <ide> <ide> delete(index) { <ide> class Vector extends IndexedSequence { <ide> this._tail = newTail; <ide> return this; <ide> } <del> return Vector._make(this._origin, this._size, this._level, this._root, newTail); <add> return makeVector(this._origin, this._size, this._level, this._root, newTail); <ide> } <ide> <ide> // Fits within existing tree. <ide> class Vector extends IndexedSequence { <ide> this._root = newRoot; <ide> return this; <ide> } <del> return Vector._make(this._origin, this._size, this._level, newRoot, this._tail); <add> return makeVector(this._origin, this._size, this._level, newRoot, this._tail); <ide> } <ide> <ide> clear() { <ide> if (this.__ownerID) { <ide> this.length = this._origin = this._size = 0; <ide> this._level = SHIFT; <del> this._root = this._tail = __EMPTY_VNODE; <add> this._root = this._tail = EMPTY_VNODE; <ide> return this; <ide> } <ide> return Vector.empty(); <ide> class Vector extends IndexedSequence { <ide> var values = arguments; <ide> var oldLength = this.length; <ide> return this.withMutations(vect => { <del> _setBounds(vect, 0, oldLength + values.length); <add> setVectorBounds(vect, 0, oldLength + values.length); <ide> for (var ii = 0; ii < values.length; ii++) { <ide> vect.set(oldLength + ii, values[ii]); <ide> } <ide> }); <ide> } <ide> <ide> pop() { <del> return _setBounds(this, 0, -1); <add> return setVectorBounds(this, 0, -1); <ide> } <ide> <ide> unshift(/*...values*/) { <ide> var values = arguments; <ide> return this.withMutations(vect => { <del> _setBounds(vect, -values.length); <add> setVectorBounds(vect, -values.length); <ide> for (var ii = 0; ii < values.length; ii++) { <ide> vect.set(ii, values[ii]); <ide> } <ide> }); <ide> } <ide> <ide> shift() { <del> return _setBounds(this, 1); <add> return setVectorBounds(this, 1); <ide> } <ide> <ide> // @pragma Composition <ide> class Vector extends IndexedSequence { <ide> } <ide> <ide> setLength(length) { <del> return _setBounds(this, 0, length); <del> } <del> <del> // @pragma Mutability <del> <del> __ensureOwner(ownerID) { <del> if (ownerID === this.__ownerID) { <del> return this; <del> } <del> if (!ownerID) { <del> this.__ownerID = ownerID; <del> return this; <del> } <del> return Vector._make(this._origin, this._size, this._level, this._root, this._tail, ownerID); <add> return setVectorBounds(this, 0, length); <ide> } <ide> <ide> // @pragma Iteration <ide> class Vector extends IndexedSequence { <ide> if (!maintainIndices && sliceSequence !== this) { <ide> var vector = this; <ide> var length = vector.length; <del> sliceSequence.toVector = () => _setBounds( <add> sliceSequence.toVector = () => setVectorBounds( <ide> vector, <ide> begin < 0 ? Math.max(0, length + begin) : length ? Math.min(length, begin) : begin, <ide> end == null ? length : end < 0 ? Math.max(0, length + end) : length ? Math.min(length, end) : end <ide> class Vector extends IndexedSequence { <ide> return sliceSequence; <ide> } <ide> <del> __deepEquals(other) { <del> var iterator = this.iterator(); <del> return other.every((v, k) => { <del> var entry = iterator.next().value; <del> return entry && k === entry[0] && is(v, entry[1]); <del> }); <del> } <del> <ide> iterator() { <ide> return new VectorIterator( <ide> this, this._origin, this._size, this._level, this._root, this._tail <ide> class Vector extends IndexedSequence { <ide> return (didComplete ? maxIndex : reverse ? maxIndex - lastIndex : lastIndex) + 1; <ide> } <ide> <del> // @pragma Private <add> __deepEquals(other) { <add> var iterator = this.iterator(); <add> return other.every((v, k) => { <add> var entry = iterator.next().value; <add> return entry && k === entry[0] && is(v, entry[1]); <add> }); <add> } <ide> <del> static _make(origin, size, level, root, tail, ownerID) { <del> var vect = Object.create(Vector.prototype); <del> vect.length = size - origin; <del> vect._origin = origin; <del> vect._size = size; <del> vect._level = level; <del> vect._root = root; <del> vect._tail = tail; <del> vect.__ownerID = ownerID; <del> return vect; <add> __ensureOwner(ownerID) { <add> if (ownerID === this.__ownerID) { <add> return this; <add> } <add> if (!ownerID) { <add> this.__ownerID = ownerID; <add> return this; <add> } <add> return makeVector(this._origin, this._size, this._level, this._root, this._tail, ownerID); <ide> } <ide> } <ide> <del>function _nodeFor(vector, rawIndex) { <add>var VectorPrototype = Vector.prototype; <add>VectorPrototype['@@iterator'] = VectorPrototype.__iterator__; <add>VectorPrototype.update = Map.prototype.update; <add>VectorPrototype.updateIn = Map.prototype.updateIn; <add>VectorPrototype.cursor = Map.prototype.cursor; <add>VectorPrototype.withMutations = Map.prototype.withMutations; <add>VectorPrototype.asMutable = Map.prototype.asMutable; <add>VectorPrototype.asImmutable = Map.prototype.asImmutable; <add> <add>function makeVector(origin, size, level, root, tail, ownerID) { <add> var vect = Object.create(VectorPrototype); <add> vect.length = size - origin; <add> vect._origin = origin; <add> vect._size = size; <add> vect._level = level; <add> vect._root = root; <add> vect._tail = tail; <add> vect.__ownerID = ownerID; <add> return vect; <add>} <add> <add>function vectorNodeFor(vector, rawIndex) { <ide> if (rawIndex >= getTailOffset(vector._size)) { <ide> return vector._tail; <ide> } <ide> function _nodeFor(vector, rawIndex) { <ide> } <ide> } <ide> <del>function _setBounds(vector, begin, end) { <add>function setVectorBounds(vector, begin, end) { <ide> var owner = vector.__ownerID || new OwnerID(); <ide> var oldOrigin = vector._origin; <ide> var oldSize = vector._size; <ide> function _setBounds(vector, begin, end) { <ide> // Locate or create the new tail. <ide> var oldTail = vector._tail; <ide> var newTail = newTailOffset < oldTailOffset ? <del> _nodeFor(vector, newSize - 1) : <add> vectorNodeFor(vector, newSize - 1) : <ide> newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; <ide> <ide> // Merge Tail into tree. <ide> function _setBounds(vector, begin, end) { <ide> newOrigin -= newTailOffset; <ide> newSize -= newTailOffset; <ide> newLevel = SHIFT; <del> newRoot = __EMPTY_VNODE; <add> newRoot = EMPTY_VNODE; <ide> newTail = newTail.removeBefore(owner, 0, newOrigin); <ide> <ide> // Otherwise, if the root has been trimmed, garbage collect. <ide> function _setBounds(vector, begin, end) { <ide> newSize -= offsetShift; <ide> } <ide> // Ensure root is not null. <del> newRoot = newRoot || __EMPTY_VNODE; <add> newRoot = newRoot || EMPTY_VNODE; <ide> } <ide> <ide> if (vector.__ownerID) { <ide> function _setBounds(vector, begin, end) { <ide> vector._tail = newTail; <ide> return vector; <ide> } <del> return Vector._make(newOrigin, newSize, newLevel, newRoot, newTail); <del>} <del> <del>Vector.prototype['@@iterator'] = Vector.prototype.__iterator__; <del>Vector.prototype.update = Map.prototype.update; <del>Vector.prototype.updateIn = Map.prototype.updateIn; <del>Vector.prototype.cursor = Map.prototype.cursor; <del>Vector.prototype.withMutations = Map.prototype.withMutations; <del>Vector.prototype.asMutable = Map.prototype.asMutable; <del>Vector.prototype.asImmutable = Map.prototype.asImmutable; <del> <del> <del>class OwnerID { <del> constructor() {} <add> return makeVector(newOrigin, newSize, newLevel, newRoot, newTail); <ide> } <ide> <del> <ide> class VNode { <ide> constructor(array, ownerID) { <ide> this.array = array; <ide> function getTailOffset(size) { <ide> return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); <ide> } <ide> <del> <del>var SHIFT = 5; // Resulted in best performance after ______? <del>var SIZE = 1 << SHIFT; <del>var MASK = SIZE - 1; <del>var __SENTINEL = {}; <del>var __EMPTY_VECT; <del>var __EMPTY_VNODE = new VNode([]); <add>var EMPTY_VECT; <add>var EMPTY_VNODE = new VNode([]);
6
Ruby
Ruby
use transform_values to build hash_rows
d495eaebb7a585ececb318f5af8e6a3c5b252863
<ide><path>activerecord/lib/active_record/result.rb <ide> def hash_rows <ide> # used as keys in ActiveRecord::Base's @attributes hash <ide> columns = @columns.map(&:-@) <ide> length = columns.length <add> template = nil <ide> <ide> @rows.map { |row| <del> # In the past we used Hash[columns.zip(row)] <del> # though elegant, the verbose way is much more efficient <del> # both time and memory wise cause it avoids a big array allocation <del> # this method is called a lot and needs to be micro optimised <del> hash = {} <del> <del> index = 0 <del> while index < length <del> hash[columns[index]] = row[index] <del> index += 1 <add> if template <add> # We use transform_values to build subsequent rows from the <add> # hash of the first row. This is faster because we avoid any <add> # reallocs and in Ruby 2.7+ avoid hashing entirely. <add> index = -1 <add> template.transform_values do <add> row[index += 1] <add> end <add> else <add> # In the past we used Hash[columns.zip(row)] <add> # though elegant, the verbose way is much more efficient <add> # both time and memory wise cause it avoids a big array allocation <add> # this method is called a lot and needs to be micro optimised <add> hash = {} <add> <add> index = 0 <add> while index < length <add> hash[columns[index]] = row[index] <add> index += 1 <add> end <add> <add> template = hash <ide> end <del> <del> hash <ide> } <ide> end <ide> end
1
Text
Text
fix broken links
09d79ea13cc66b5393b98e3201726cd42947f60d
<ide><path>docs/understanding/thinking-in-redux/Glossary.md <ide> A middleware is a higher-order function that composes a [dispatch function](#dis <ide> <ide> Middleware is composable using function composition. It is useful for logging actions, performing side effects like routing, or turning an asynchronous API call into a series of synchronous actions. <ide> <del>See [`applyMiddleware(...middlewares)`](./api/applyMiddleware.md) for a detailed look at middleware. <add>See [`applyMiddleware(...middlewares)`](../../api/applyMiddleware.md) for a detailed look at middleware. <ide> <ide> ## Store <ide> <ide><path>docs/usage/Troubleshooting.md <ide> return state.map((todo, index) => { <ide> <ide> Note that experimental language features are subject to change. <ide> <del>Also keep an eye out for nested state objects that need to be deeply copied. Both `_.extend` and `Object.assign` make a shallow copy of the state. See [Updating Nested Objects](./usage/structuring-reducers/ImmutableUpdatePatterns.md#updating-nested-objects) for suggestions on how to deal with nested state objects. <add>Also keep an eye out for nested state objects that need to be deeply copied. Both `_.extend` and `Object.assign` make a shallow copy of the state. See [Updating Nested Objects](./structuring-reducers/ImmutableUpdatePatterns.md#updating-nested-objects) for suggestions on how to deal with nested state objects. <ide> <ide> #### Don't forget to call [`dispatch(action)`](api/Store.md#dispatchaction) <ide>
2
Text
Text
remove discord community
4643fd78b27940d2a26ac4454cd54ccfcc435bf6
<ide><path>README.md <ide> resources: <ide> <ide> * [Questions tagged 'node.js' on StackOverflow][] <ide> * [#node.js channel on chat.freenode.net][] <del>* [Node.js Discord Community](https://discordapp.com/invite/v7rrPdE) <ide> * [Node.js Slack Community](https://node-js.slack.com/) <ide> * To register: [nodeslackers.com](http://www.nodeslackers.com/) <ide>
1
Ruby
Ruby
update xcode.latest_version for 4.5
5adea8c1e102dd1b19bdd79219da1c678c277a92
<ide><path>Library/Homebrew/macos/xcode.rb <ide> def latest_version <ide> when 10.6 then "3.2.6" <ide> else <ide> if MacOS.version >= 10.7 <del> "4.4.1" <add> "4.5" <ide> else <ide> raise "Mac OS X `#{MacOS.version}' is invalid" <ide> end
1
PHP
PHP
fix a bunch of various coding standards errors
452c42bfaa79c63b9aa19ca39fe7b64f92deac0d
<ide><path>Cake/ORM/Association/HasMany.php <ide> public function isOwningSide(Table $side) { <ide> * @return boolean|Entity false if $entity could not be saved, otherwise it returns <ide> * the saved entity <ide> * @see Table::save() <add> * @throws \InvalidArgumentException when the association data cannot be traversed. <ide> */ <ide> public function save(Entity $entity, $options = []) { <ide> $targetEntities = $entity->get($this->property()); <ide><path>Cake/Test/TestCase/Controller/ControllerTest.php <ide> class ControllerTestAppController extends Controller { <ide> * <ide> * @var string <ide> */ <del> public $modelClass = 'Post'; <add> public $modelClass = 'Posts'; <ide> <ide> /** <ide> * components property <ide> class TestController extends ControllerTestAppController { <ide> * <ide> * @var string <ide> */ <del> public $modelClass = 'Comment'; <add> public $modelClass = 'Comments'; <ide> <ide> /** <ide> * index method <ide><path>Cake/Test/TestCase/ORM/TableTest.php <ide> public function testSaveBelongsToWithValidationErrorInJointEntity() { <ide> $this->assertNull($entity->tags[1]->extraInfo); <ide> } <ide> <del> <ide> /** <ide> * Tests saving belongsToMany records with a validation error in a joint entity <ide> * and atomic set to false <ide><path>Cake/Utility/MergeVariablesTrait.php <ide> protected function _mergeVars($properties, $options = []) { <ide> */ <ide> protected function _mergeProperty($property, $parentClasses, $options) { <ide> $thisValue = $this->{$property}; <del> $isAssoc = false; <add> $isAssoc = false; <ide> if ( <ide> isset($options['associative']) && <ide> in_array($property, (array)$options['associative']) <ide><path>Cake/Utility/RepositoryAwareTrait.php <ide> trait RepositoryAwareTrait { <ide> <ide> /** <del> * This object's primary model class name, the Inflector::singularize()'ed version of <add> * This object's primary model class name, the Inflector::pluralized()'ed version of <ide> * the object's $name property. <ide> * <del> * Example: For a object named 'Comments', the modelClass would be 'Comment' <add> * Example: For a object named 'Comments', the modelClass would be 'Comments' <ide> * <ide> * @var string <ide> */ <ide> protected function _setModelClass($name) { <ide> * delegates to Cake\ORM\TableRegistry. <ide> * @return boolean True when single repository found and instance created. <ide> * @throws Cake\Error\MissingModelException if the model class cannot be found. <add> * @throws Cake\Error\Exception When using a type that has not been registered. <ide> */ <ide> public function repository($modelClass = null, $type = 'Table') { <del> if (isset($this->{$modelClass})) { <del> return $this->{$modelClass}; <del> } <del> <ide> if ($modelClass === null) { <ide> $modelClass = $this->modelClass; <ide> } <ide> <add> if (isset($this->{$modelClass})) { <add> return true; <add> } <add> <ide> list($plugin, $modelClass) = pluginSplit($modelClass, true); <ide> <ide> if (!isset($this->_repositoryFactories[$type])) {
5
Ruby
Ruby
remove lasgn since ast is mutated
4d5f9a07658f610c34851ceca2a0e25e5ad83503
<ide><path>activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb <ide> def join_target_table(relation, condition) <ide> conditions << process_conditions(options[:conditions], aliased_table_name) <ide> end <ide> <del> join = relation.join(target_table, join_type) <add> ands = relation.create_and(conditions) <ide> <del> join.on(*conditions) <add> join = relation.create_join( <add> relation.froms.first, <add> target_table, <add> relation.create_on(ands), <add> join_type) <add> <add> relation.from join <ide> end <ide> <ide> def join_has_and_belongs_to_many_to(relation) <ide><path>activerecord/lib/active_record/relation/query_methods.rb <ide> def build_joins(manager, joins) <ide> <ide> # FIXME: refactor this to build an AST <ide> join_dependency.join_associations.each do |association| <del> manager = association.join_to(manager) <add> association.join_to(manager) <ide> end <ide> <ide> return manager unless join_ast
2
PHP
PHP
add getnextrundate timezone argument
e5763e16cb9170140d2c26697e34bda57b56e62d
<ide><path>src/Illuminate/Console/Scheduling/Event.php <ide> public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = <ide> { <ide> return Carbon::instance(CronExpression::factory( <ide> $this->getExpression() <del> )->getNextRunDate($currentTime, $nth, $allowCurrentDate)); <add> )->getNextRunDate($currentTime, $nth, $allowCurrentDate, $this->timezone)); <ide> } <ide> <ide> /**
1
Ruby
Ruby
escape interpolation examples
1bb7dfcafd223fd02639d99d6e3a4472df05b8e5
<ide><path>Library/Homebrew/formula_cellar_checks.rb <ide> def check_manpages <ide> ['A top-level "man" directory was found.', <ide> <<-EOS.undent <ide> Homebrew requires that man pages live under share. <del> This can often be fixed by passing "--mandir=#{man}" to configure. <add> This can often be fixed by passing "--mandir=\#{man}" to configure. <ide> EOS <ide> ] <ide> end <ide> def check_infopages <ide> ['A top-level "info" directory was found.', <ide> <<-EOS.undent <ide> Homebrew suggests that info pages live under share. <del> This can often be fixed by passing "--infodir=#{info}" to configure. <add> This can often be fixed by passing "--infodir=\#{info}" to configure. <ide> EOS <ide> ] <ide> end
1
Text
Text
add v4.8.2 to changelog
0580eed5c18cdfcd239ccd475e04a1b4c222963c
<ide><path>CHANGELOG.md <ide> # Ember Changelog <ide> <add>### v4.8.2 (November 3, 2022) <add> <add>- [#20244](https://github.com/emberjs/ember.js/pull/20244) Add missing type for `getComponentTemplate` to preview types <add> <ide> ### v4.9.0-beta.3 (November 2, 2022) <ide> <ide> - [CVE pending](https://emberjs.com/blog/ember-4-8-1-released) Fix a prototype pollution vulnerability in `set` and `setProperties`
1
Javascript
Javascript
reduce memory usage by int8array
00b5ee6083bfbd8e3f63a574411300c5e5f42bd7
<ide><path>lib/internal/querystring.js <ide> <ide> const { <ide> Array, <add> Int8Array, <ide> } = primordials; <ide> <ide> const { ERR_INVALID_URI } = require('internal/errors').codes; <ide> const hexTable = new Array(256); <ide> for (let i = 0; i < 256; ++i) <ide> hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); <ide> <del>const isHexTable = [ <add>const isHexTable = new Int8Array([ <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32 - 47 <ide> const isHexTable = [ <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256 <del>]; <add>]); <ide> <ide> function encodeStr(str, noEscapeTable, hexTable) { <ide> const len = str.length; <ide><path>lib/internal/url.js <ide> <ide> const { <ide> Array, <add> Int8Array, <ide> Number, <ide> ObjectCreate, <ide> ObjectDefineProperties, <ide> function parseParams(qs) { <ide> <ide> // Adapted from querystring's implementation. <ide> // Ref: https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer <del>const noEscape = [ <add>const noEscape = new Int8Array([ <ide> /* <ide> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F <ide> */ <ide> const noEscape = [ <ide> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 0x50 - 0x5F <ide> 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F <ide> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 0x70 - 0x7F <del>]; <add>]); <ide> <ide> // Special version of hexTable that uses `+` for U+0020 SPACE. <ide> const paramHexTable = hexTable.slice(); <ide><path>lib/querystring.js <ide> const { <ide> Array, <ide> ArrayIsArray, <add> Int8Array, <ide> MathAbs, <ide> NumberIsFinite, <ide> ObjectCreate, <ide> const QueryString = module.exports = { <ide> decode: parse <ide> }; <ide> <del>const unhexTable = [ <add>const unhexTable = new Int8Array([ <ide> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 - 15 <ide> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16 - 31 <ide> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 32 - 47 <ide> const unhexTable = [ <ide> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, <ide> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, <ide> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // ... 255 <del>]; <add>]); <ide> // A safe fast alternative to decodeURIComponent <ide> function unescapeBuffer(s, decodeSpaces) { <ide> const out = Buffer.allocUnsafe(s.length); <ide> function qsUnescape(s, decodeSpaces) { <ide> // digits <ide> // alpha (uppercase) <ide> // alpha (lowercase) <del>const noEscape = [ <add>const noEscape = new Int8Array([ <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 <ide> 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, // 32 - 47 <ide> const noEscape = [ <ide> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 80 - 95 <ide> 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 <ide> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 // 112 - 127 <del>]; <add>]); <ide> // QueryString.escape() replaces encodeURIComponent() <ide> // https://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4 <ide> function qsEscape(str) { <ide><path>lib/url.js <ide> 'use strict'; <ide> <ide> const { <add> Int8Array, <ide> ObjectCreate, <ide> ObjectKeys, <ide> SafeSet, <ide> function urlFormat(urlObject, options) { <ide> // digits <ide> // alpha (uppercase) <ide> // alpha (lowercase) <del>const noEscapeAuth = [ <add>const noEscapeAuth = new Int8Array([ <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x00 - 0x0F <ide> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x10 - 0x1F <ide> 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, // 0x20 - 0x2F <ide> const noEscapeAuth = [ <ide> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 0x50 - 0x5F <ide> 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F <ide> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 // 0x70 - 0x7F <del>]; <add>]); <ide> <ide> Url.prototype.format = function format() { <ide> let auth = this.auth || '';
4
Python
Python
remove unused imports
37e0c9b5b852dffee11e41d1a9ee7a11be1f662e
<ide><path>numpy/lib/UserArray.py <ide> # class as this is not complete. <ide> <ide> from numpy.core import * <del>import string <ide> <ide> class UserArray(object): <ide> def __init__(self, data, dtype=None, copy=True): <ide><path>numpy/lib/function_base.py <ide> import numpy.core.numeric as _nx <ide> from numpy.core.numeric import ones, zeros, arange, concatenate, array, \ <ide> asarray, empty, empty_like, asanyarray <del>from numpy.core.numeric import ScalarType, dot, where, newaxis, isscalar <del>from numpy.core.umath import pi, multiply, add, arctan2, maximum, minimum, \ <del> frompyfunc, isnan, absolute, cos, less_equal, sqrt, sin, mod, exp <add>from numpy.core.numeric import ScalarType, dot, where, newaxis <add>from numpy.core.umath import pi, multiply, add, arctan2, \ <add> frompyfunc, isnan, cos, less_equal, sqrt, sin, mod, exp <ide> from numpy.core.oldnumeric import ravel, nonzero, choose, \ <del> sometrue, alltrue, reshape, any, all, typecodes, ArrayType, squeeze,\ <add> typecodes, ArrayType, squeeze,\ <ide> sort <ide> from type_check import ScalarType <ide> from shape_base import atleast_1d <ide><path>numpy/lib/index_tricks.py <ide> from numpy.core.numeric import asarray, ScalarType <ide> <ide> import function_base <del>import twodim_base as matrix_base <ide> import numpy.core.defmatrix as matrix <ide> makemat = matrix.matrix <ide> <ide> def ix_(*args): <ide> baseshape = [1]*nd <ide> for k in range(nd): <ide> new = _nx.array(args[k]) <del> if (new.ndim <> 1): <add> if (new.ndim != 1): <ide> raise ValueError, "Cross index must be 1 dimensional" <ide> baseshape[k] = len(new) <ide> new.shape = tuple(baseshape) <ide><path>numpy/lib/ufunclike.py <ide> __all__ = ['fix', 'isneginf', 'isposinf', 'log2'] <ide> <ide> import numpy.core.numeric as nx <del>from numpy.core.numeric import asarray, empty, empty_like, isinf, signbit, zeros <add>from numpy.core.numeric import asarray, empty, isinf, signbit <ide> import numpy.core.umath as umath <ide> <ide> def fix(x, y=None):
4
Text
Text
fix broken link in collaborator_guide.md
9de2adc04d2da7884c54e59a14f14b58b0a1e423
<ide><path>COLLABORATOR_GUIDE.md <ide> information regarding the change process: <ide> - Protects against the assumption that GitHub will be around forever. <ide> <ide> Review the commit message to ensure that it adheres to the guidelines <del>outlined in the [contributing](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit) guide. <add>outlined in the [contributing](./CONTRIBUTING.md#step-3-commit) guide. <ide> <ide> See the commit log for examples such as <ide> [this one](https://github.com/nodejs/node/commit/b636ba8186) if unsure <ide> Save the file and close the editor. You'll be asked to enter a new <ide> commit message for that commit. This is a good moment to fix incorrect <ide> commit logs, ensure that they are properly formatted, and add <ide> `Reviewed-By` lines. <del>* The commit message text must conform to the [commit message guidelines](../CONTRIBUTING.md#step-3-commit). <add>* The commit message text must conform to the <add>[commit message guidelines](./CONTRIBUTING.md#step-3-commit). <ide> <ide> Time to push it: <ide>
1
Java
Java
add methodreference support
c5c68a46622ec2688aed20cc8efde8c23aceb729
<ide><path>spring-core/src/main/java/org/springframework/aot/generate/MethodReference.java <add>/* <add> * Copyright 2002-2022 the original author or authors. <add> * <add> * Licensed under the Apache License, Version 2.0 (the "License"); <add> * you may not use this file except in compliance with the License. <add> * You may obtain a copy of the License at <add> * <add> * https://www.apache.org/licenses/LICENSE-2.0 <add> * <add> * Unless required by applicable law or agreed to in writing, software <add> * distributed under the License is distributed on an "AS IS" BASIS, <add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add> * See the License for the specific language governing permissions and <add> * limitations under the License. <add> */ <add> <add>package org.springframework.aot.generate; <add> <add>import org.springframework.javapoet.ClassName; <add>import org.springframework.javapoet.CodeBlock; <add>import org.springframework.lang.Nullable; <add>import org.springframework.util.Assert; <add> <add>/** <add> * A reference to a static or instance method. <add> * <add> * @author Phillip Webb <add> * @since 6.0 <add> */ <add>public final class MethodReference { <add> <add> private final Kind kind; <add> <add> private final ClassName declaringClass; <add> <add> private final String methodName; <add> <add> <add> private MethodReference(Kind kind, @Nullable ClassName declaringClass, <add> String methodName) { <add> this.kind = kind; <add> this.declaringClass = declaringClass; <add> this.methodName = methodName; <add> } <add> <add> <add> /** <add> * Create a new method reference that refers to the given instance method. <add> * @param methodName the method name <add> * @return a new {@link MethodReference} instance <add> */ <add> public static MethodReference of(String methodName) { <add> Assert.hasLength(methodName, "'methodName' must not be empty"); <add> return new MethodReference(Kind.INSTANCE, null, methodName); <add> } <add> <add> /** <add> * Create a new method reference that refers to the given instance method. <add> * @param declaringClass the declaring class <add> * @param methodName the method name <add> * @return a new {@link MethodReference} instance <add> */ <add> public static MethodReference of(Class<?> declaringClass, String methodName) { <add> Assert.notNull(declaringClass, "'declaringClass' must not be null"); <add> Assert.hasLength(methodName, "'methodName' must not be empty"); <add> return new MethodReference(Kind.INSTANCE, ClassName.get(declaringClass), <add> methodName); <add> } <add> <add> /** <add> * Create a new method reference that refers to the given instance method. <add> * @param declaringClass the declaring class <add> * @param methodName the method name <add> * @return a new {@link MethodReference} instance <add> */ <add> public static MethodReference of(ClassName declaringClass, String methodName) { <add> Assert.notNull(declaringClass, "'declaringClass' must not be null"); <add> Assert.hasLength(methodName, "'methodName' must not be empty"); <add> return new MethodReference(Kind.INSTANCE, declaringClass, methodName); <add> } <add> <add> /** <add> * Create a new method reference that refers to the given static method. <add> * @param declaringClass the declaring class <add> * @param methodName the method name <add> * @return a new {@link MethodReference} instance <add> */ <add> public static MethodReference ofStatic(Class<?> declaringClass, String methodName) { <add> Assert.notNull(declaringClass, "'declaringClass' must not be null"); <add> Assert.hasLength(methodName, "'methodName' must not be empty"); <add> return new MethodReference(Kind.STATIC, ClassName.get(declaringClass), <add> methodName); <add> } <add> <add> /** <add> * Create a new method reference that refers to the given static method. <add> * @param declaringClass the declaring class <add> * @param methodName the method name <add> * @return a new {@link MethodReference} instance <add> */ <add> public static MethodReference ofStatic(ClassName declaringClass, String methodName) { <add> Assert.notNull(declaringClass, "'declaringClass' must not be null"); <add> Assert.hasLength(methodName, "'methodName' must not be empty"); <add> return new MethodReference(Kind.STATIC, declaringClass, methodName); <add> } <add> <add> <add> /** <add> * Return the referenced declaring class. <add> * @return the declaring class <add> */ <add> public ClassName getDeclaringClass() { <add> return this.declaringClass; <add> } <add> <add> /** <add> * Return the referenced method name. <add> * @return the method name <add> */ <add> public String getMethodName() { <add> return this.methodName; <add> } <add> <add> /** <add> * Return this method reference as a {@link CodeBlock}. If the reference is <add> * to an instance method then {@code this::<method name>} will be returned. <add> * @return a code block for the method reference. <add> * @see #toCodeBlock(String) <add> */ <add> public CodeBlock toCodeBlock() { <add> return toCodeBlock(null); <add> } <add> <add> /** <add> * Return this method reference as a {@link CodeBlock}. If the reference is <add> * to an instance method and {@code instanceVariable} is {@code null} then <add> * {@code this::<method name>} will be returned. No {@code instanceVariable} <add> * can be specified for static method references. <add> * @param instanceVariable the instance variable or {@code null} <add> * @return a code block for the method reference. <add> * @see #toCodeBlock(String) <add> */ <add> public CodeBlock toCodeBlock(@Nullable String instanceVariable) { <add> return switch (this.kind) { <add> case INSTANCE -> toCodeBlockForInstance(instanceVariable); <add> case STATIC -> toCodeBlockForStatic(instanceVariable); <add> }; <add> } <add> <add> private CodeBlock toCodeBlockForInstance(String instanceVariable) { <add> instanceVariable = (instanceVariable != null) ? instanceVariable : "this"; <add> return CodeBlock.of("$L::$L", instanceVariable, this.methodName); <add> <add> } <add> <add> private CodeBlock toCodeBlockForStatic(@Nullable String instanceVariable) { <add> Assert.isTrue(instanceVariable == null, <add> "'instanceVariable' must be null for static method references"); <add> return CodeBlock.of("$T::$L", this.declaringClass, this.methodName); <add> } <add> <add> /** <add> * Return this method reference as an invocation {@link CodeBlock}. <add> * @param arguments the method arguments <add> * @return a code back to invoke the method <add> */ <add> public CodeBlock toInvokeCodeBlock(CodeBlock... arguments) { <add> return toInvokeCodeBlock(null, arguments); <add> } <add> <add> /** <add> * Return this method reference as an invocation {@link CodeBlock}. <add> * @param instanceVariable the instance variable or {@code null} <add> * @param arguments the method arguments <add> * @return a code back to invoke the method <add> */ <add> public CodeBlock toInvokeCodeBlock(@Nullable String instanceVariable, <add> CodeBlock... arguments) { <add> <add> return switch (this.kind) { <add> case INSTANCE -> toInvokeCodeBlockForInstance(instanceVariable, arguments); <add> case STATIC -> toInvokeCodeBlockForStatic(instanceVariable, arguments); <add> }; <add> } <add> <add> private CodeBlock toInvokeCodeBlockForInstance(@Nullable String instanceVariable, <add> CodeBlock[] arguments) { <add> <add> CodeBlock.Builder builder = CodeBlock.builder(); <add> if (instanceVariable != null) { <add> builder.add("$L.", instanceVariable); <add> } <add> else if (this.declaringClass != null) { <add> builder.add("new $T().", this.declaringClass); <add> } <add> builder.add("$L", this.methodName); <add> addArguments(builder, arguments); <add> return builder.build(); <add> } <add> <add> private CodeBlock toInvokeCodeBlockForStatic(@Nullable String instanceVariable, <add> CodeBlock[] arguments) { <add> <add> Assert.isTrue(instanceVariable == null, <add> "'instanceVariable' must be null for static method references"); <add> CodeBlock.Builder builder = CodeBlock.builder(); <add> builder.add("$T.$L", this.declaringClass, this.methodName); <add> addArguments(builder, arguments); <add> return builder.build(); <add> } <add> <add> private void addArguments(CodeBlock.Builder builder, CodeBlock[] arguments) { <add> builder.add("("); <add> for (int i = 0; i < arguments.length; i++) { <add> if (i != 0) { <add> builder.add(", "); <add> } <add> builder.add(arguments[i]); <add> } <add> builder.add(")"); <add> } <add> <add> @Override <add> public String toString() { <add> return switch (this.kind) { <add> case INSTANCE -> ((this.declaringClass != null) ? "<" + this.declaringClass + ">" <add> : "<instance>") + "::" + this.methodName; <add> case STATIC -> this.declaringClass + "::" + this.methodName; <add> }; <add> } <add> <add> <add> private enum Kind { <add> INSTANCE, STATIC <add> } <add> <add>} <ide><path>spring-core/src/test/java/org/springframework/aot/generate/MethodReferenceTests.java <add>/* <add> * Copyright 2002-2022 the original author or authors. <add> * <add> * Licensed under the Apache License, Version 2.0 (the "License"); <add> * you may not use this file except in compliance with the License. <add> * You may obtain a copy of the License at <add> * <add> * https://www.apache.org/licenses/LICENSE-2.0 <add> * <add> * Unless required by applicable law or agreed to in writing, software <add> * distributed under the License is distributed on an "AS IS" BASIS, <add> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add> * See the License for the specific language governing permissions and <add> * limitations under the License. <add> */ <add> <add>package org.springframework.aot.generate; <add> <add>import org.junit.jupiter.api.Test; <add> <add>import org.springframework.javapoet.ClassName; <add> <add>import static org.assertj.core.api.Assertions.assertThat; <add>import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; <add> <add>/** <add> * Tests for {@link MethodReference}. <add> * <add> * @author Phillip Webb <add> */ <add>class MethodReferenceTests { <add> <add> private static final String EXPECTED_STATIC = "org.springframework.aot.generate.MethodReferenceTests::someMethod"; <add> <add> private static final String EXPECTED_ANONYMOUS_INSTANCE = "<instance>::someMethod"; <add> <add> private static final String EXPECTED_DECLARED_INSTANCE = "<org.springframework.aot.generate.MethodReferenceTests>::someMethod"; <add> <add> <add> @Test <add> void ofWithStringWhenMethodNameIsNullThrowsException() { <add> String methodName = null; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.of(methodName)) <add> .withMessage("'methodName' must not be empty"); <add> } <add> <add> @Test <add> void ofWithStringCreatesMethodReference() { <add> String methodName = "someMethod"; <add> MethodReference reference = MethodReference.of(methodName); <add> assertThat(reference).hasToString(EXPECTED_ANONYMOUS_INSTANCE); <add> } <add> <add> @Test <add> void ofWithClassAndStringWhenDeclaringClassIsNullThrowsException() { <add> Class<?> declaringClass = null; <add> String methodName = "someMethod"; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.of(declaringClass, methodName)) <add> .withMessage("'declaringClass' must not be null"); <add> } <add> <add> @Test <add> void ofWithClassAndStringWhenMethodNameIsNullThrowsException() { <add> Class<?> declaringClass = MethodReferenceTests.class; <add> String methodName = null; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.of(declaringClass, methodName)) <add> .withMessage("'methodName' must not be empty"); <add> } <add> <add> @Test <add> void ofWithClassAndStringCreatesMethodReference() { <add> Class<?> declaringClass = MethodReferenceTests.class; <add> String methodName = "someMethod"; <add> MethodReference reference = MethodReference.of(declaringClass, methodName); <add> assertThat(reference).hasToString(EXPECTED_DECLARED_INSTANCE); <add> } <add> <add> @Test <add> void ofWithClassNameAndStringWhenDeclaringClassIsNullThrowsException() { <add> ClassName declaringClass = null; <add> String methodName = "someMethod"; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.of(declaringClass, methodName)) <add> .withMessage("'declaringClass' must not be null"); <add> } <add> <add> @Test <add> void ofWithClassNameAndStringWhenMethodNameIsNullThrowsException() { <add> ClassName declaringClass = ClassName.get(MethodReferenceTests.class); <add> String methodName = null; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.of(declaringClass, methodName)) <add> .withMessage("'methodName' must not be empty"); <add> } <add> <add> @Test <add> void ofWithClassNameAndStringCreateMethodReference() { <add> ClassName declaringClass = ClassName.get(MethodReferenceTests.class); <add> String methodName = "someMethod"; <add> MethodReference reference = MethodReference.of(declaringClass, methodName); <add> assertThat(reference).hasToString(EXPECTED_DECLARED_INSTANCE); <add> } <add> <add> @Test <add> void ofStaticWithClassAndStringWhenDeclaringClassIsNullThrowsException() { <add> Class<?> declaringClass = null; <add> String methodName = "someMethod"; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.ofStatic(declaringClass, methodName)) <add> .withMessage("'declaringClass' must not be null"); <add> } <add> <add> @Test <add> void ofStaticWithClassAndStringWhenMethodNameIsEmptyThrowsException() { <add> Class<?> declaringClass = MethodReferenceTests.class; <add> String methodName = null; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.ofStatic(declaringClass, methodName)) <add> .withMessage("'methodName' must not be empty"); <add> } <add> <add> @Test <add> void ofStaticWithClassAndStringCreatesMethodReference() { <add> Class<?> declaringClass = MethodReferenceTests.class; <add> String methodName = "someMethod"; <add> MethodReference reference = MethodReference.ofStatic(declaringClass, methodName); <add> assertThat(reference).hasToString(EXPECTED_STATIC); <add> } <add> <add> @Test <add> void ofStaticWithClassNameAndGeneratedMethodNameWhenDeclaringClassIsNullThrowsException() { <add> ClassName declaringClass = null; <add> String methodName = "someMethod"; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.ofStatic(declaringClass, methodName)) <add> .withMessage("'declaringClass' must not be null"); <add> } <add> <add> @Test <add> void ofStaticWithClassNameAndGeneratedMethodNameWhenMethodNameIsEmptyThrowsException() { <add> ClassName declaringClass = ClassName.get(MethodReferenceTests.class); <add> String methodName = null; <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> MethodReference.ofStatic(declaringClass, methodName)) <add> .withMessage("'methodName' must not be empty"); <add> } <add> <add> @Test <add> void ofStaticWithClassNameAndGeneratedMethodNameCreatesMethodReference() { <add> ClassName declaringClass = ClassName.get(MethodReferenceTests.class); <add> String methodName = "someMethod"; <add> MethodReference reference = MethodReference.ofStatic(declaringClass, methodName); <add> assertThat(reference).hasToString(EXPECTED_STATIC); <add> } <add> <add> @Test <add> void toCodeBlockWhenInstanceMethodReferenceAndInstanceVariableIsNull() { <add> MethodReference reference = MethodReference.of("someMethod"); <add> assertThat(reference.toCodeBlock(null)).hasToString("this::someMethod"); <add> } <add> <add> @Test <add> void toCodeBlockWhenInstanceMethodReferenceAndInstanceVariableIsNotNull() { <add> MethodReference reference = MethodReference.of("someMethod"); <add> assertThat(reference.toCodeBlock("myInstance")) <add> .hasToString("myInstance::someMethod"); <add> } <add> <add> @Test <add> void toCodeBlockWhenStaticMethodReferenceAndInstanceVariableIsNull() { <add> MethodReference reference = MethodReference.ofStatic(MethodReferenceTests.class, <add> "someMethod"); <add> assertThat(reference.toCodeBlock(null)).hasToString(EXPECTED_STATIC); <add> } <add> <add> @Test <add> void toCodeBlockWhenStaticMethodReferenceAndInstanceVariableIsNotNullThrowsException() { <add> MethodReference reference = MethodReference.ofStatic(MethodReferenceTests.class, <add> "someMethod"); <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> reference.toCodeBlock("myInstance")).withMessage( <add> "'instanceVariable' must be null for static method references"); <add> } <add> <add> @Test <add> void toInvokeCodeBlockWhenInstanceMethodReferenceAndInstanceVariableIsNull() { <add> MethodReference reference = MethodReference.of("someMethod"); <add> assertThat(reference.toInvokeCodeBlock()).hasToString("someMethod()"); <add> } <add> <add> @Test <add> void toInvokeCodeBlockWhenInstanceMethodReferenceAndInstanceVariableIsNullAndHasDecalredClass() { <add> MethodReference reference = MethodReference.of(MethodReferenceTests.class, <add> "someMethod"); <add> assertThat(reference.toInvokeCodeBlock()).hasToString( <add> "new org.springframework.aot.generate.MethodReferenceTests().someMethod()"); <add> } <add> <add> @Test <add> void toInvokeCodeBlockWhenInstanceMethodReferenceAndInstanceVariableIsNotNull() { <add> MethodReference reference = MethodReference.of("someMethod"); <add> assertThat(reference.toInvokeCodeBlock("myInstance")) <add> .hasToString("myInstance.someMethod()"); <add> } <add> <add> @Test <add> void toInvokeCodeBlockWhenStaticMethodReferenceAndInstanceVariableIsNull() { <add> MethodReference reference = MethodReference.ofStatic(MethodReferenceTests.class, <add> "someMethod"); <add> assertThat(reference.toInvokeCodeBlock()).hasToString( <add> "org.springframework.aot.generate.MethodReferenceTests.someMethod()"); <add> } <add> <add> @Test <add> void toInvokeCodeBlockWhenStaticMethodReferenceAndInstanceVariableIsNotNullThrowsException() { <add> MethodReference reference = MethodReference.ofStatic(MethodReferenceTests.class, <add> "someMethod"); <add> assertThatIllegalArgumentException() <add> .isThrownBy(() -> reference.toInvokeCodeBlock("myInstance")).withMessage( <add> "'instanceVariable' must be null for static method references"); <add> } <add> <add>}
2
Ruby
Ruby
remove obsolete empty line
76488216b78f83f3f76a052b1819f04bd0555bde
<ide><path>Library/Homebrew/cmd/test-bot.rb <ide> def run <ide> end <ide> <ide> verbose = ARGV.verbose? <del> puts if verbose && !ENV["TRAVIS"] <ide> @output = "" <ide> working_dir = Pathname.new(@command.first == "git" ? @repository : Dir.pwd) <ide> read, write = IO.pipe
1
Go
Go
remove unneeded check for binary-commits
750130d748add8eacdd31dc5e9706d8c5c6be56c
<ide><path>integration/system/info_linux_test.go <ide> func TestInfoBinaryCommits(t *testing.T) { <ide> assert.NilError(t, err) <ide> <ide> assert.Check(t, "N/A" != info.ContainerdCommit.ID) <del> assert.Check(t, is.Equal(testEnv.DaemonInfo.ContainerdCommit.Expected, info.ContainerdCommit.Expected)) <ide> assert.Check(t, is.Equal(info.ContainerdCommit.Expected, info.ContainerdCommit.ID)) <ide> <ide> assert.Check(t, "N/A" != info.InitCommit.ID) <del> assert.Check(t, is.Equal(testEnv.DaemonInfo.InitCommit.Expected, info.InitCommit.Expected)) <ide> assert.Check(t, is.Equal(info.InitCommit.Expected, info.InitCommit.ID)) <ide> <ide> assert.Check(t, "N/A" != info.RuncCommit.ID) <del> assert.Check(t, is.Equal(testEnv.DaemonInfo.RuncCommit.Expected, info.RuncCommit.Expected)) <ide> assert.Check(t, is.Equal(info.RuncCommit.Expected, info.RuncCommit.ID)) <ide> } <ide>
1
Javascript
Javascript
simplify iterator access
15480d5a80af602f1e4b12b7ea34f7ff793763b8
<ide><path>dist/Immutable.js <ide> var ITERATE_KEYS = 0; <ide> var ITERATE_VALUES = 1; <ide> var ITERATE_ENTRIES = 2; <ide> var FAUX_ITERATOR_SYMBOL = '@@iterator'; <del>var ITERATOR_SYMBOL = typeof Symbol !== 'undefined' ? Symbol.iterator : FAUX_ITERATOR_SYMBOL; <add>var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; <add>var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; <ide> var Iterator = function Iterator(next) { <ide> this.next = next; <ide> }; <ide> function getIterator(iterable) { <ide> return iteratorFn && iteratorFn.call(iterable); <ide> } <ide> function _iteratorFn(iterable) { <del> var iteratorFn = iterable && ((ITERATOR_SYMBOL && iterable[ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]); <add> var iteratorFn = iterable && ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]); <ide> if (typeof iteratorFn === 'function') { <ide> return iteratorFn; <ide> } <ide><path>dist/Immutable.min.js <ide> * of patent rights can be found in the PATENTS file in the same directory. <ide> */ <ide> function t(){function t(t,e,r,n){var i;if(n){var u=n.prototype;i=Ee.create(u)}else i=t.prototype;return Ee.keys(e).forEach(function(t){i[t]=e[t]}),Ee.keys(r).forEach(function(e){t[e]=r[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,r,n){return Ee.getPrototypeOf(e)[r].apply(t,n)}function r(t,r,n){e(t,r,"constructor",n)}function n(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t&&"function"==typeof t.equals?t.equals(e):!1}function i(t){return t.value=!1,t}function u(t){t&&(t.value=!0)}function a(){}function s(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t,e){if(!t)throw Error(e)}function h(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&Le;t=""+t,e="string"}return"string"===e?t.length>Fe?c(t):f(t):t.hashCode?h("function"==typeof t.hashCode?t.hashCode():t.hashCode):_(t)}function c(t){var e=Qe[t];return null==e&&(e=f(t),He===Ge&&(He=0,Qe={}),He++,Qe[t]=e),e}function f(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)&Le;return e}function _(t){var e=t[Te];if(e)return e;if(!Ve){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Te])return e;if(e=l(t))return e}if(!Ve||Object.isExtensible(t)){if(e=++Ne&Le,Ve)Object.defineProperty(t,Te,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(Be&&t.propertyIsEnumerable===Be)t.propertyIsEnumerable=function(){return Be.apply(this,arguments)},t.propertyIsEnumerable[Te]=e;else{if(!t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[Te]=e}return e}throw Error("Non-extensible objects are not allowed as keys.")}function l(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function v(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function g(){return{value:void 0,done:!0}}function p(t){return!!y(t)}function m(t){return t&&"function"==typeof t.next}function d(t){var e=y(t);return e&&e.call(t)}function y(t){var e=t&&(tr&&t[tr]||t[$e]); <del>return"function"==typeof e?e:void 0}function w(t){return null==t.length&&t.cacheResult(),o(1/0>t.length,"Cannot reverse infinite range."),t.length}function S(t,e,r){return(0===t||null!=r&&-r>=t)&&(null==e||null!=r&&e>=r)}function I(t,e){return b(t,e,0)}function q(t,e){return b(t,e,e)}function b(t,e,r){return null==t?r:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function x(t){return t}function k(t,e){return[e,t]}function M(){return!0}function D(t){return function(){return!t.apply(this,arguments)}}function O(t){return"string"==typeof t?JSON.stringify(t):t}function C(t,e){return t>e?1:e>t?-1:0}function A(t,e){return 0>e?(null==t.length&&t.cacheResult(),t.length+e):e}function E(t){o(1/0!==t,"Cannot perform this action with an infinite sequence.")}function j(t,e,r,n){var i=t._cache;if(i){for(var u=i.length-1,a=0;u>=a;a++){var s=i[r?u-a:a];if(e(s[1],n?s[0]:a,t)===!1)return a+1}return a}return t.__iterateUncached(e,r)}function R(t,e,r,n){var i=t._cache;if(i){var u=i.length-1,a=0;return new er(function(){var t=i[r?u-a:a];return a++>u?g():v(e,n?t[0]:a-1,t[1])})}return t.__iteratorUncached(e,r)}function U(t){var e=t.__makeSequence();return e.length=t.length,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.contains(e)},e.contains=function(e){return t.has(e)},e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Ze){var n=t.__iterator(e,r);return new er(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===Ye?Xe:Ye,r)},e}function P(t,e,r){var n=t.__makeSequence();return n.length=t.length,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,Ke);return u===Ke?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var u=this;return t.__iterate(function(t,i,a){return n(e.call(r,t,i,a),i,u)!==!1},i)},n.__iteratorUncached=function(n,i){var u=t.__iterator(Ze,i);return new er(function(){var i=u.next(); <del>if(i.done)return i;var a=i.value,s=a[0];return v(n,s,e.call(r,a[1],s,t),i)})},n}function W(t,e){var r=t.__makeSequence();return r.length=t.length,r.reverse=function(){return t},r.flip=function(){var e=t.flip.apply(this);return e.reverse=function(){return t.flip()},e},r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=function(){return t.cacheResult(),this.length=t.length,this},r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function K(t,e,r,n){var i=t.__makeSequence();return n&&(i.has=function(n){var i=t.get(n,Ke);return i!==Ke&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,Ke);return u!==Ke&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,u){var a=this,s=0;return t.__iterate(function(t,u,o){return e.call(r,t,u,o)?(s++,i(t,n?u:s-1,a)):void 0},u),s},i.__iteratorUncached=function(i,u){var a=t.__iterator(Ze,u),s=0;return new er(function(){for(;;){var u=a.next();if(u.done)return u;var o=u.value,h=o[0],c=o[1];if(e.call(r,c,h,t))return v(i,n?h:s++,c,u)}})},i}function z(t,e,r,n){var i={},u=[];return t.__iterate(function(a,s){var o=e.call(r,a,s,t),c=h(o),f=n?[s,a]:a;i.hasOwnProperty(c)?u[i[c]][1].push(f):(i[c]=u.length,u.push([o,[f]]))}),nr(u).fromEntrySeq().map(n?function(t){return nr(t).fromEntrySeq()}:function(t){return nr(t)})}function J(t,e){if(e>t.length)return t;0>e&&(e=0);var r=t.__makeSequence();return r.length=t.length&&Math.min(t.length,e),r.__iterateUncached=function(r,n){var i=this;if(0===e)return 0;if(n)return this.cacheResult().__iterate(r,n);var u=0;return t.__iterate(function(t,n){return++u&&r(t,n,i)!==!1&&e>u}),u},r.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=e&&t.__iterator(r,n),u=0;return new er(function(){return u++>e?g():i.next()})},r}function B(t,e,r){var n=t.__makeSequence();return n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i); <del>var a=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++a&&n(t,i,u)}),a},n.__iteratorUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterator(n,i);var a=t.__iterator(Ze,i),s=!0;return new er(function(){if(!s)return g();var t=a.next();if(t.done)return t;var i=t.value,o=i[0],h=i[1];return e.call(r,h,o,u)?n===Ze?t:v(n,o,h,t):(s=!1,g())})},n}function V(t,e,r){if(0>=e)return t;var n=t.__makeSequence();return n.length=t.length&&Math.max(0,t.length-e),n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var a=0,s=!0,o=0;return t.__iterate(function(t,i){return s&&(s=a++<e)?void 0:(o++,n(t,r?i:o-1,u))}),o},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var u=e&&t.__iterator(n,i),a=0,s=0;return new er(function(){for(;e>a;)a++,u.next();var t=u.next();return r||n===Ye?t:n===Xe?v(n,s++,null,t):v(n,s++,t.value[1],t)})},n}function L(t,e,r,n){var i=t.__makeSequence();return i.__iterateUncached=function(i,u){var a=this;if(u)return this.cacheResult().__iterate(i,u);var s=!0,o=0;return t.__iterate(function(t,u,h){return s&&(s=e.call(r,t,u,h))?void 0:(o++,i(t,n?u:o-1,a))}),o},i.__iteratorUncached=function(i,u){var a=this;if(u)return this.cacheResult().__iterator(i,u);var s=t.__iterator(Ze,u),o=!0,h=0;return new er(function(){var t,u,c;do{if(t=s.next(),t.done)return n||i===Ye?t:i===Xe?v(i,h++,null,t):v(i,h++,t.value[1],t);var f=t.value;u=f[0],c=f[1],o&&(o=e.call(r,c,u,a))}while(o);return i===Ze?t:v(i,u,c,t)})},i}function N(t,e,r){var n=[t].concat(e),i=nr(n);return r&&(i=i.toKeyedSeq()),i=i.flatMap(x),i.length=n.reduce(function(t,e){if(void 0!==t){var r=nr(e).length;if(null!=r)return t+r}},0),i}function T(t,e,r){var n=t.__makeSequence();return n.__iterateUncached=function(n,i){function u(t,o){var h=this;t.__iterate(function(t,i){return(!e||e>o)&&t instanceof nr?u(t,o+1):n(t,r?i:a++,h)===!1&&(s=!0),!s},i)}var a=0,s=!1;return u(t,0),a},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),a=[],s=0;return new er(function(){for(;u;){var t=u.next(); <del>if(t.done===!1){var o=t.value;if(n===Ze&&(o=o[1]),!((!e||e>a.length)&&o instanceof nr))return r?t:v(n,s++,o,t);a.push(u),u=o.__iterator(n,i)}else u=a.pop()}return g()})},n}function F(t,e){var r=t.__makeSequence();return r.length=t.length&&2*t.length-1,r.__iterateUncached=function(r,n){var i=this,u=0;return t.__iterate(function(t){return(!u||r(e,u++,i)!==!1)&&r(t,u++,i)!==!1},n),u},r.__iteratorUncached=function(r,n){var i,u=t.__iterator(Ye,n),a=0;return new er(function(){return(!i||a%2)&&(i=u.next(),i.done)?i:a%2?v(r,a++,e):v(r,a++,i.value,i)})},r}function G(t,e){return v(t,e[0],e[1])}function H(t,e){return{node:t,index:0,__prev:e}}function Q(t,e,r,n){var i=Object.create(dr);return i.length=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function X(t,e,r){var n=i(ze),u=i(Je),a=Y(t._root,t.__ownerID,0,h(e),e,r,n,u);if(!u.value)return t;var s=t.length+(n.value?r===Ke?-1:1:0);return t.__ownerID?(t.length=s,t._root=a,t.__hash=void 0,t.__altered=!0,t):a?Q(s,a):pr.empty()}function Y(t,e,r,n,i,a,s,o){return t?t.update(e,r,n,i,a,s,o):a===Ke?t:(u(o),u(s),new xr(e,n,[i,a]))}function Z(t){return t.constructor===xr||t.constructor===qr}function $(t,e,r,n,i){if(t.hash===n)return new qr(e,n,[t.entry,i]);var u,a=(0===r?t.hash:t.hash>>>r)&We,s=(0===r?n:n>>>r)&We,o=a===s?[$(t,e,r+Ue,n,i)]:(u=new xr(e,n,i),s>a?[t,u]:[u,t]);return new yr(e,1<<a|1<<s,o)}function te(t,e,r,n){for(var i=0,u=0,a=Array(r),s=0,o=1,h=e.length;h>s;s++,o<<=1){var c=e[s];null!=c&&s!==n&&(i|=o,a[u++]=c)}return new yr(t,i,a)}function ee(t,e,r,n,i){for(var u=0,a=Array(Pe),s=0;0!==r;s++,r>>>=1)a[s]=1&r?e[u++]:null;return a[n]=i,new Sr(t,u+1,a)}function re(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i];u instanceof nr||(u=nr(u),u instanceof ar&&(u=u.fromEntrySeq())),u&&n.push(u)}return ie(t,e,n)}function ne(t){return function(e,r){return e&&e.mergeDeepWith?e.mergeDeepWith(t,r):t?t(e,r):r}}function ie(t,e,r){return 0===r.length?t:t.withMutations(function(t){for(var n=e?function(r,n){var i=t.get(n,Ke);t.set(n,i===Ke?r:e(i,r))}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n) <del>})}function ue(t,e,r,n,i){var u=e.length;if(i===u)return n(t);o(t.set,"updateIn with invalid keyPath");var a=i===u-1?r:pr.empty(),s=e[i],h=t.get(s,a),c=ue(h,e,r,n,i+1);return c===h?t:t.set(s,c)}function ae(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function se(t,e,r,n){var i=n?t:s(t);return i[e]=r,i}function oe(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var u=Array(i),a=0,s=0;i>s;s++)s===e?(u[s]=r,a=-1):u[s]=t[s+a];return u}function he(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),u=0,a=0;n>a;a++)a===e&&(u=1),i[a]=t[a+u];return i}function ce(t,e,r,n,i,u){var a,s=t&&t.array;if(0===e){var o=0>r?-r:0,h=n-r;for(h>Pe&&(h=Pe),a=o;h>a;a++)if(i(s&&s[u?o+h-1-a:a])===!1)return!1}else{var c=1<<e,f=e-Ue;for(a=0;We>=a;a++){var _=u?We-a:a,l=r+(_<<e);if(n>l&&l+c>0){var v=s&&s[_];if(!ce(v,f,l,n,i,u))return!1}}}return!0}function fe(t,e,r,n,i){return{array:t,level:e,offset:r,max:n,rawMax:n-r>>e,index:0,__prev:i}}function _e(t,e,r,n,i,u,a){var s=Object.create(jr);return s.length=e-t,s._origin=t,s._size=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=u,s.__hash=a,s.__altered=!1,s}function le(t,e,r){if(e=A(t,e),e>=t.length||0>e)return r===Ke?t:t.withMutations(function(t){0>e?me(t,e).set(0,r):me(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,u=t._root,a=i(Je);return e>=ye(t._size)?n=ve(n,t.__ownerID,0,e,r,a):u=ve(u,t.__ownerID,t._level,e,r,a),a.value?t.__ownerID?(t._root=u,t._tail=n,t.__hash=void 0,t.__altered=!0,t):_e(t._origin,t._size,t._level,u,n):t}function ve(t,e,r,n,i,a){var s,o=i===Ke,h=n>>>r&We,c=t&&t.array.length>h;if(o&&!c)return t;if(r>0){var f=t&&t.array[h],_=ve(f,e,r-Ue,n,i,a);return _===f?t:(s=ge(t,e),s.array[h]=_,s)}return!o&&c&&t.array[h]===i?t:(u(a),s=ge(t,e),o&&h===s.array.length-1?s.array.pop():s.array[h]=o?void 0:i,s)}function ge(t,e){return e&&t&&e===t.ownerID?t:new Rr(t?t.array.slice():[],e)}function pe(t,e){if(e>=ye(t._size))return t._tail;if(1<<t._level+Ue>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&We],n-=Ue; <del>return r}}function me(t,e,r){var n=t.__ownerID||new a,i=t._origin,u=t._size,s=i+e,o=null==r?u:0>r?u+r:i+r;if(s===i&&o===u)return t;if(s>=o)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new Rr(c&&c.array.length?[null,c]:[],n),h+=Ue,f+=1<<h;f&&(s+=f,i+=f,o+=f,u+=f);for(var _=ye(u),l=ye(o);l>=1<<h+Ue;)c=new Rr(c&&c.array.length?[c]:[],n),h+=Ue;var v=t._tail,g=_>l?pe(t,o-1):l>_?new Rr([],n):v;if(v&&l>_&&u>s&&v.array.length){c=ge(c,n);for(var p=c,m=h;m>Ue;m-=Ue){var d=_>>>m&We;p=p.array[d]=ge(p.array[d],n)}p.array[_>>>Ue&We]=v}if(u>o&&(g=g&&g.removeAfter(n,0,o)),s>=l)s-=l,o-=l,h=Ue,c=null,g=g&&g.removeBefore(n,0,s);else if(s>i||_>l){var y,w;f=0;do y=s>>>h&We,w=l-1>>>h&We,y===w&&(y&&(f+=(1<<h)*y),h-=Ue,c=c&&c.array[y]);while(c&&y===w);c&&s>i&&(c=c&&c.removeBefore(n,h,s-f)),c&&_>l&&(c=c&&c.removeAfter(n,h,l-f)),f&&(s-=f,o-=f)}return t.__ownerID?(t.length=o-s,t._origin=s,t._size=o,t._level=h,t._root=c,t._tail=g,t.__hash=void 0,t.__altered=!0,t):_e(s,o,h,c,g)}function de(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i];u&&n.push(nr(u))}var a=Math.max.apply(null,n.map(function(t){return t.length||0}));return a>t.length&&(t=t.setLength(a)),ie(t,e,n)}function ye(t){return Pe>t?0:t-1>>>Ue<<Ue}function we(t,e,r,n){var i=Object.create(Jr);return i.length=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Se(t,e){var r=Object.create(Nr);return r.length=t?t.length:0,r._map=t,r.__ownerID=e,r}function Ie(t,e,r,n){var i=Object.create(Fr.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=r,i.__hash=n,i}function qe(t,e,r){var n=t._map,i=t._vector,u=n.get(e),a=void 0!==u,s=r===Ke;if(!a&&s||a&&r===i.get(u)[1])return t;a||(u=i.length);var o=s?n.remove(e):a?n:n.set(e,u),h=s?i.remove(u):i.set(u,[e,r]);return t.__ownerID?(t.length=o.length,t._map=o,t._vector=h,t.__hash=void 0,t):Ie(o,h)}function be(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function xe(t,e){return e?ke(e,t,"",{"":t}):Me(t)}function ke(t,e,r,n){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(n,r,nr(e).map(function(r,n){return ke(t,r,n,e) <del>})):e}function Me(t){if(t){if(Array.isArray(t))return nr(t).map(Me).toVector();if(t.constructor===Object)return nr(t).map(Me).toMap()}return t}function De(t,e,r,n){4>arguments.length&&(n=t.getIn(e));var i=n instanceof nr?n.length:null,u=n instanceof ar?on:an;return new u(t,e,r,i)}function Oe(t,e,r){return r instanceof nr?Ce(t,e,r):r}function Ce(t,e,r){return De(t._rootData,t._keyPath.concat(e),t._onChange,r)}function Ae(t,e,r){var n=t._rootData.updateIn(t._keyPath,r?pr.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,n,t._rootData,r?i.concat(r):i),De(n,t._keyPath,t._onChange)}var Ee=Object,je={};je.createClass=t,je.superCall=e,je.defaultSuperCall=r;var Re="delete",Ue=5,Pe=1<<Ue,We=Pe-1,Ke={},ze={value:!1},Je={value:!1},Be=Object.prototype.propertyIsEnumerable,Ve=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),Le=2147483647,Ne=0,Te="__immutablehash__";"undefined"!=typeof Symbol&&(Te=Symbol(Te));var Fe=16,Ge=255,He=0,Qe={},Xe=0,Ye=1,Ze=2,$e="@@iterator",tr="undefined"!=typeof Symbol?Symbol.iterator:$e,er=function(t){this.next=t};je.createClass(er,{toString:function(){return"[Iterator]"}},{});var rr=er.prototype;rr.inspect=rr.toSource=function(){return""+this},rr[tr]=function(){return this};var nr=function(t){return ir.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},ir=nr;je.createClass(nr,{toArray:function(){E(this.length);var t=Array(this.length||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toJS:function(){return this.map(function(t){return t instanceof ir?t.toJS():t}).__toJS()},toMap:function(){return E(this.length),pr.from(this)},toObject:function(){E(this.length);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return E(this.length),Fr.from(this)},toSet:function(){return E(this.length),Vr.from(this)},toStack:function(){return E(this.length),Kr.from(this)},toVector:function(){return E(this.length),Ar.from(this)},toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e <del>},__toStringMapper:function(t,e){return e+": "+O(t)},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return N(this,t,!0)},contains:function(t){return this.find(function(e){return n(e,t)},null,Ke)!==Ke},entries:function(){return this.__iterator(Ze)},every:function(t,e){var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return K(this,t,e,!0)},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},join:function(t){t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!=n?n:""}),e},keys:function(){return this.__iterator(Xe)},map:function(t,e){return P(this,t,e)},reduce:function(t,e,r){var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,a){i?(i=!1,n=e):n=t.call(r,n,e,u,a)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return W(this,!0)},slice:function(t,e){if(S(t,e,this.length))return this;var r=I(t,this.length),n=q(e,this.length);if(r!==r||n!==n)return this.cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return null==n||n===this.length?i:i.take(n-r)},some:function(t,e){return!this.every(D(t),e)},sort:function(t){return this.sortBy(x,t)},values:function(){return this.__iterator(Ye)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.__iterate(M)),this.length)},countBy:function(t,e){var r=this,n={},i=[];return this.__iterate(function(u,a){var s=t.call(e,u,a,r),o=h(s);n.hasOwnProperty(o)?i[n[o]][1]++:(n[o]=i.length,i.push([s,1]))}),ir(i).fromEntrySeq()},equals:function(t){if(this===t)return!0;if(!(t instanceof ir))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0}return null!=this.__hash&&null!=t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t) <del>},__deepEquals:function(t){var e=this.entries();return t.every(function(t,r){var i=e.next().value;return i&&n(i[0],r)&&n(i[1],t)})&&e.next().done},entrySeq:function(){var t=this;if(t._cache)return ir(t._cache);var e=t.toKeyedSeq().map(k).valueSeq();return e.fromEntries=function(){return t},e},findKey:function(t,e){var r;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?(r=i,!1):void 0}),r},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(M)},flatMap:function(t,e){return this.map(function(r,n,i){return ir(t.call(e,r,n,i))}).flatten(!0)},flatten:function(t){return T(this,t,!0)},flip:function(){return U(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)},null,e)},getIn:function(t,e){var r=this;if(t)for(var n=0;t.length>n;n++)if(r=r&&r.get?r.get(t[n],Ke):Ke,r===Ke)return e;return r},groupBy:function(t,e){return z(this,t,e,!0)},has:function(t){return this.get(t,Ke)!==Ke},keySeq:function(){return this.flip().valueSeq()},last:function(){return this.reverse().first()},mapEntries:function(t,e){var r=this;return this.entrySeq().map(function(n,i){return t.call(e,n,i,r)}).fromEntrySeq()},mapKeys:function(t,e){var r=this;return this.flip().map(function(n,i){return t.call(e,n,i,r)}).flip()},rest:function(){return this.slice(1)},skip:function(t){return V(this,t,!0)},skipLast:function(t){return this.reverse().skip(t).reverse()},skipWhile:function(t,e){return L(this,t,e,!0)},skipUntil:function(t,e){return this.skipWhile(D(t),e)},sortBy:function(t,e){e=e||C;var r=this;return ir(this.entrySeq().entrySeq().toArray().sort(function(n,i){return e(t(n[1][1],n[1][0],r),t(i[1][1],i[1][0],r))||n[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},take:function(t){return J(this,t)},takeLast:function(t){return this.reverse().take(t).reverse()},takeWhile:function(t,e){return B(this,t,e)},takeUntil:function(t,e){return this.takeWhile(D(t),e)},toKeyedSeq:function(){return this},valueSeq:function(){return new lr(this) <del>},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(E(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,r){return t+(h(e)^(e===r?0:h(r)))&Le},0))},__makeSequence:function(){return Object.create(ur)},__iterate:function(t,e){return j(this,t,e,!0)},__iterator:function(t,e){return R(this,t,e,!0)}},{from:function(t){if(t instanceof ir)return t;if(!Array.isArray(t)){if(m(t))return new hr(t);if(p(t))return new cr(t);if(t&&t.constructor===Object)return new fr(t);t=[t]}return new _r(t)}});var ur=nr.prototype;ur[tr]=ur.entries,ur.toJSON=ur.toJS,ur.__toJS=ur.toObject,ur.inspect=ur.toSource=function(){return""+this},ur.chain=ur.flatMap;var ar=function(){je.defaultSuperCall(this,sr.prototype,arguments)},sr=ar;je.createClass(ar,{toString:function(){return this.__toString("Seq [","]")},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return N(this,t,!1)},filter:function(t,e){return K(this,t,e,!1)},findIndex:function(t,e){var r=this.findKey(t,e);return null==r?-1:r},indexOf:function(t){return this.findIndex(function(e){return n(e,t)})},lastIndexOf:function(t){return this.toKeyedSeq().reverse().indexOf(t)},reverse:function(){return W(this,!1)},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=I(t,this.length);var n=this.slice(0,t);return 1===r?n:n.concat(s(arguments,2),this.slice(t+e))},findLastIndex:function(t,e){return this.toKeyedSeq().reverse().findIndex(t,e)},first:function(){return this.get(0)},flatten:function(t){return T(this,t,!1)},flip:function(){return U(this.toKeyedSeq())},fromEntrySeq:function(){return new gr(this)},get:function(t,e){return t=A(this,t),0>t||1/0===this.length||null!=this.length&&t>this.length?e:this.find(function(e,r){return r===t},null,e)},groupBy:function(t,e){return z(this,t,e,!1)},has:function(t){return t=A(this,t),t>=0&&(null!=this.length?1/0===this.length||this.length>t:-1!==this.indexOf(t)) <del>},interpose:function(t){return F(this,t)},last:function(){return this.get(-1)},skip:function(t){var e=this,r=V(e,t,!1);return r!==e&&(r.get=function(r,n){return r=A(this,r),r>=0?e.get(r+t,n):n}),r},skipWhile:function(t,e){return L(this,t,e,!1)},sortBy:function(t,e){e=e||C;var r=this;return nr(this.entrySeq().toArray().sort(function(n,i){return e(t(n[1],n[0],r),t(i[1],i[0],r))||n[0]-i[0]})).fromEntrySeq().valueSeq()},take:function(t){var e=this,r=J(e,t);return r!==e&&(r.get=function(r,n){return r=A(this,r),r>=0&&t>r?e.get(r,n):n}),r},toKeyedSeq:function(){return new vr(this)},valueSeq:function(){return this},__makeSequence:function(){return Object.create(or)},__iterate:function(t,e){return j(this,t,e,!1)},__iterator:function(t,e){return R(this,t,e,!1)}},{},nr);var or=ar.prototype;or[tr]=or.values,or.__toJS=or.toArray,or.__toStringMapper=O;var hr=function(t){this._iterator=t,this._iteratorCache=[]};je.createClass(hr,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var a=u.value;if(n[i]=a,t(a,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new er(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return v(t,i,n[i++])})}},{},ar);var cr=function(t){this._iterable=t,this.length=t.length||t.size};je.createClass(cr,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=d(r),i=0;if(m(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=d(r);if(!m(n))return new er(function(){return g()});var i=0;return new er(function(){var e=n.next();return e.done?e:v(t,i++,e.value)})}},{},ar);var fr=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};je.createClass(fr,{toObject:function(){return this._object <del>},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,u=0;i>=u;u++){var a=n[e?i-u:u];if(t(r[a],a,this)===!1)return u+1}return u},__iterator:function(t,e){var r=this._object,n=this._keys,i=n.length-1,u=0;return new er(function(){var a=n[e?i-u:u];return u++>i?g():v(t,a,r[a])})}},{},nr);var _r=function(t){this._array=t,this.length=t.length};je.createClass(_r,{toArray:function(){return this._array},get:function(t,e){return this.has(t)?this._array[A(this,t)]:e},__iterate:function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},__iterator:function(t,e){var r=this._array,n=r.length-1,i=0;return new er(function(){return i>n?g():v(t,i,r[e?n-i++:i++])})}},{},ar);var lr=function(t){this._seq=t,this.length=t.length};je.createClass(lr,{contains:function(t){return this._seq.contains(t)},cacheResult:function(){return this._seq.cacheResult(),this.length=this._seq.length,this},__iterate:function(t,e){var r=this,n=0;return this._seq.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._seq.__iterator(Ye,e),n=0;return new er(function(){var e=r.next();return e.done?e:v(t,n++,e.value,e)})}},{},ar);var vr=function(t){this._seq=t,this.length=t.length};je.createClass(vr,{get:function(t,e){return this._seq.get(t,e)},has:function(t){return this._seq.has(t)},valueSeq:function(){return this._seq},reverse:function(){var t=this,e=W(this,!0);return e.valueSeq=function(){return t._seq.reverse()},e},map:function(t,e){var r=this,n=P(this,t,e);return n.valueSeq=function(){return r._seq.map(t,e)},n},cacheResult:function(){return this._seq.cacheResult(),this.length=this._seq.length,this},__iterate:function(t,e){var r=this,n=e?w(this):0;return this._seq.__iterate(function(i){return t(i,e?--n:n++,r)},e)},__iterator:function(t,e){var r=this._seq.__iterator(Ye,e),n=e?w(this):0;return new er(function(){var i=r.next();return i.done?i:v(t,e?--n:n++,i.value,i) <del>})}},{},nr);var gr=function(t){this._seq=t,this.length=t.length};je.createClass(gr,{entrySeq:function(){return this._seq},cacheResult:function(){return this._seq.cacheResult(),this.length=this._seq.length,this},__iterate:function(t,e){var r=this;return this._seq.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){var r=this._seq.__iterator(Ye,e);return new er(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return t===Ze?e:v(t,n[0],n[1],e)}})}},{},nr);var pr=function(t){var e=mr.empty();return t?t.constructor===mr?t:e.merge(t):e},mr=pr;je.createClass(pr,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,h(t),t,e):e},set:function(t,e){return X(this,t,e)},remove:function(t){return X(this,t,Ke)},update:function(t,e,r){return 1===arguments.length?this.updateIn([],void 0,t):this.updateIn([t],e,r)},updateIn:function(t,e,r){return r||(r=e,e=void 0),ue(this,t,e,r,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):mr.empty()},merge:function(){return re(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return re(this,t,e)},mergeDeep:function(){return re(this,ne(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return re(this,ne(t),e)},cursor:function(t,e){var r=0===arguments.length||"function"==typeof t&&(e=t)?[]:Array.isArray(t)?t:[t];return De(this,r,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new a)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},__iterator:function(t,e){return new Mr(this,t,e)},__iterate:function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?Q(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this) <del>}},{empty:function(){return Dr||(Dr=Q(0))}},nr);var dr=pr.prototype;dr[Re]=dr.remove,pr.from=pr;var yr=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r},wr=yr;je.createClass(yr,{get:function(t,e,r,n){var i=1<<((0===t?e:e>>>t)&We),u=this.bitmap;return 0===(u&i)?n:this.nodes[ae(u&i-1)].get(t+Ue,e,r,n)},update:function(t,e,r,n,i,u,a){var s=(0===e?r:r>>>e)&We,o=1<<s,h=this.bitmap,c=0!==(h&o);if(!c&&i===Ke)return this;var f=ae(h&o-1),_=this.nodes,l=c?_[f]:null,v=Y(l,t,e+Ue,r,n,i,u,a);if(v===l)return this;if(!c&&v&&_.length>=Or)return ee(t,_,h,s,v);if(c&&!v&&2===_.length&&Z(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&Z(v))return v;var g=t&&t===this.ownerID,p=c?v?h:h^o:h|o,m=c?v?se(_,f,v,g):he(_,f,g):oe(_,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new wr(t,p,m)},iterate:function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++)if(r[e?i-n:n].iterate(t,e)===!1)return!1}},{});var Sr=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r},Ir=Sr;je.createClass(Sr,{get:function(t,e,r,n){var i=(0===t?e:e>>>t)&We,u=this.nodes[i];return u?u.get(t+Ue,e,r,n):n},update:function(t,e,r,n,i,u,a){var s=(0===e?r:r>>>e)&We,o=i===Ke,h=this.nodes,c=h[s];if(o&&!c)return this;var f=Y(c,t,e+Ue,r,n,i,u,a);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Cr>_))return te(t,h,_,s)}else _++;var l=t&&t===this.ownerID,v=se(h,s,f,l);return l?(this.count=_,this.nodes=v,this):new Ir(t,_,v)},iterate:function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var u=r[e?i-n:n];if(u&&u.iterate(t,e)===!1)return!1}}},{});var qr=function(t,e,r){this.ownerID=t,this.hash=e,this.entries=r},br=qr;je.createClass(qr,{get:function(t,e,r,i){for(var u=this.entries,a=0,s=u.length;s>a;a++)if(n(r,u[a][0]))return u[a][1];return i},update:function(t,e,r,i,a,o,h){var c=a===Ke;if(r!==this.hash)return c?this:(u(h),u(o),$(this,t,e,r,[i,a]));for(var f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(c&&!v)return this;if(u(h),(c||!v)&&u(o),c&&2===l)return new xr(t,this.hash,f[1^_]);var g=t&&t===this.ownerID,p=g?f:s(f);return v?c?_===l-1?p.pop():p[_]=p.pop():p[_]=[i,a]:p.push([i,a]),g?(this.entries=p,this):new br(t,this.hash,p) <del>},iterate:function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1}},{});var xr=function(t,e,r){this.ownerID=t,this.hash=e,this.entry=r},kr=xr;je.createClass(xr,{get:function(t,e,r,i){return n(r,this.entry[0])?this.entry[1]:i},update:function(t,e,r,i,a,s,o){var h=a===Ke,c=n(i,this.entry[0]);return(c?a===this.entry[1]:h)?this:(u(o),h?(u(s),null):c?t&&t===this.ownerID?(this.entry[1]=a,this):new kr(t,r,[i,a]):(u(s),$(this,t,e,r,[i,a])))},iterate:function(t){return t(this.entry)}},{});var Mr=function(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&H(t._root)};je.createClass(Mr,{next:function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return G(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return G(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var u=n.nodes[this._reverse?r-i:i];if(u){if(u.entry)return G(t,u.entry);e=this._stack=H(u,e)}continue}e=this._stack=this._stack.__prev}return g()}},{},er);var Dr,Or=Pe/2,Cr=Pe/4,Ar=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Er.from(t)},Er=Ar;je.createClass(Ar,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=A(this,t),0>t||t>=this.length)return e;t+=this._origin;var r=pe(this,t);return r&&r.array[t&We]},set:function(t,e){return le(this,t,e)},remove:function(t){return le(this,t,Ke)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=Ue,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Er.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(r){me(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return me(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){me(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return me(this,1)},merge:function(){return de(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r]; <del>return de(this,t,e)},mergeDeep:function(){return de(this,ne(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return de(this,ne(t),e)},setLength:function(t){return me(this,0,t)},slice:function(t,e){var r=je.superCall(this,Er.prototype,"slice",[t,e]);if(r!==this){var n=this,i=n.length;r.toVector=function(){return me(n,0>t?Math.max(0,i+t):i?Math.min(i,t):t,null==e?i:0>e?Math.max(0,i+e):i?Math.min(i,e):e)}}return r},__iterator:function(t,e){return new Pr(this,t,e)},__iterate:function(t,e){var r=this,n=0,i=function(e){return t(e,n++,r)},u=ye(this._size);return e?ce(this._tail,0,u-this._origin,this._size-this._origin,i,e)&&ce(this._root,this._level,-this._origin,u-this._origin,i,e):ce(this._root,this._level,-this._origin,u-this._origin,i,e)&&ce(this._tail,0,u-this._origin,this._size-this._origin,i,e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?_e(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return Wr||(Wr=_e(0,0,Ue))},from:function(t){if(!t||0===t.length)return Er.empty();if(t.constructor===Er)return t;var e=Array.isArray(t);return t.length>0&&Pe>t.length?_e(0,t.length,Ue,null,new Rr(e?s(t):nr(t).toArray())):(e||(t=nr(t).valueSeq()),Er.empty().merge(t))}},ar);var jr=Ar.prototype;jr[Re]=jr.remove,jr.update=dr.update,jr.updateIn=dr.updateIn,jr.cursor=dr.cursor,jr.withMutations=dr.withMutations,jr.asMutable=dr.asMutable,jr.asImmutable=dr.asImmutable,jr.wasAltered=dr.wasAltered;var Rr=function(t,e){this.array=t,this.ownerID=e},Ur=Rr;je.createClass(Rr,{removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&We;if(n>=this.array.length)return new Ur([],t);var i,u=0===n;if(e>0){var a=this.array[n];if(i=a&&a.removeBefore(t,e-Ue,r),i===a&&u)return this}if(u&&!i)return this;var s=ge(this,t);if(!u)for(var o=0;n>o;o++)s.array[o]=void 0;return i&&(s.array[n]=i),s},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&We; <del>if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var a=this.array[n];if(i=a&&a.removeAfter(t,e-Ue,r),i===a&&u)return this}if(u&&!i)return this;var s=ge(this,t);return u||s.array.pop(),i&&(s.array[n]=i),s}},{});var Pr=function(t,e,r){this._type=e,this._reverse=!!r,this._maxIndex=t.length-1;var n=ye(t._size),i=fe(t._root&&t._root.array,t._level,-t._origin,n-t._origin-1),u=fe(t._tail&&t._tail.array,0,n-t._origin,t._size-t._origin-1);this._stack=r?u:i,this._stack.__prev=r?i:u};je.createClass(Pr,{next:function(){for(var t=this._stack;t;){var e=t.array,r=t.index++;if(this._reverse&&(r=We-r,r>t.rawMax&&(r=t.rawMax,t.index=Pe-r)),r>=0&&Pe>r&&t.rawMax>=r){var n=e&&e[r];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(r<<t.level),this._reverse&&(i=this._maxIndex-i)),v(u,i,n)}this._stack=t=fe(n&&n.array,t.level-Ue,t.offset+(r<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return g()}},{},er);var Wr,Kr=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return zr.from(t)},zr=Kr;je.createClass(Kr,{toString:function(){return this.__toString("Stack [","]")},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.length+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.length=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):we(t,e)},pushAll:function(t){if(t=nr(t),0===t.length)return this;var e=this.length,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.length=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):we(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):zr.empty() <del>},slice:function(t,e){if(S(t,e,this.length))return this;var r=I(t,this.length),n=q(e,this.length);if(n!==this.length)return je.superCall(this,zr.prototype,"slice",[t,e]);for(var i=this.length-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.length=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):we(i,u)},__ensureOwner:function(t){return t===this.__ownerID?this:t?we(this.length,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=0,n=this._head;return new er(function(){if(n){var e=n.value;return n=n.next,v(t,r++,e)}return g()})}},{empty:function(){return Br||(Br=we(0))},from:function(t){var e=zr.empty();return t?t.constructor===zr?t:e.unshiftAll(t):e}},ar);var Jr=Kr.prototype;Jr.withMutations=dr.withMutations,Jr.asMutable=dr.asMutable,Jr.asImmutable=dr.asImmutable,Jr.wasAltered=dr.wasAltered;var Br,Vr=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Lr.from(t)},Lr=Vr;je.createClass(Vr,{toString:function(){return this.__toString("Set {","}")},get:function(t,e){return this._map.has(t)?t:e},contains:function(t){return this._map.has(t)},add:function(t){var e=this._map.set(t,null);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:Se(e)},remove:function(t){var e=this._map.remove(t);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:0===e.length?Lr.empty():Se(e)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):Lr.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var r=0;t.length>r;r++)nr(t[r]).forEach(function(t){return e.add(t)})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return nr(t) <del>});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return nr(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},isSubset:function(t){return t=nr(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=nr(t),t.every(function(t){return e.contains(t)})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?Se(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return Tr||(Tr=Se(pr.empty()))},from:function(t){var e=Lr.empty();return t?t.constructor===Lr?t:e.union(t):e},fromKeys:function(t){return Lr.from(nr(t).flip())}},nr);var Nr=Vr.prototype;Nr[Re]=Nr.remove,Nr[tr]=Nr.values,Nr.mergeDeep=Nr.merge,Nr.mergeDeepWith=Nr.mergeWith,Nr.withMutations=dr.withMutations,Nr.asMutable=dr.asMutable,Nr.asImmutable=dr.asImmutable,Nr.__toJS=or.__toJS,Nr.__toStringMapper=or.__toStringMapper;var Tr,Fr=function(t){var e=Gr.empty();return t?t.constructor===Gr?t:e.merge(t):e},Gr=Fr;je.createClass(Fr,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return null!=r?this._vector.get(r)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):Gr.empty()},set:function(t,e){return qe(this,t,e)},remove:function(t){return qe(this,t,Ke)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered() <del>},__iterate:function(t,e){var r=this;return this._vector.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){return this._vector.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._vector.__ensureOwner(t);return t?Ie(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=r,this)}},{empty:function(){return Hr||(Hr=Ie(pr.empty(),Ar.empty()))}},pr),Fr.from=Fr,Fr.prototype[Re]=Fr.prototype.remove;var Hr,Qr=function(t,e){var r=function(t){return this instanceof r?void(this._map=pr(t)):new r(t)},n=Object.keys(t),i=r.prototype=Object.create(Xr);i.constructor=r,e&&(i._name=e),i._defaultValues=t,i._keys=n,i.length=n.length;try{nr(t).forEach(function(t,e){Object.defineProperty(r.prototype,e,{get:function(){return this.get(e)},set:function(t){o(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})})}catch(u){}return r};je.createClass(Qr,{toString:function(){return this.__toString(this._name+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues[t]):e},clear:function(){if(this.__ownerID)return this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=be(this,pr.empty()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+this._name);var r=this._map.set(t,e);return this.__ownerID||r===this._map?this:be(this,r)},remove:function(t){if(null==t||!this.has(t))return this;var e=this._map.remove(t);return this.__ownerID||e===this._map?this:be(this,e)},keys:function(){return this._map.keys()},values:function(){return this._map.values()},entries:function(){return this._map.entries()},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){return this._map.__iterator(t,e)},__iterate:function(t,e){var r=this;return nr(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this; <del>var e=this._map&&this._map.__ensureOwner(t);return t?be(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},nr);var Xr=Qr.prototype;Xr._name="Record",Xr[Re]=Xr.remove,Xr.merge=dr.merge,Xr.mergeWith=dr.mergeWith,Xr.mergeDeep=dr.mergeDeep,Xr.mergeDeepWith=dr.mergeDeepWith,Xr.update=dr.update,Xr.updateIn=dr.updateIn,Xr.cursor=dr.cursor,Xr.withMutations=dr.withMutations,Xr.asMutable=dr.asMutable,Xr.asImmutable=dr.asImmutable;var Yr=function(t,e,r){return this instanceof Zr?(o(0!==r,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&tn?tn:(r=null==r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.length=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new Zr(t,e,r)},Zr=Yr;je.createClass(Yr,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},get:function(t,e){return this.has(t)?this._start+A(this,t)*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.length>e&&e===Math.floor(e)},slice:function(t,e){return S(t,e,this.length)?this:(t=I(t,this.length),e=q(e,this.length),t>=e?tn:new Zr(this.get(t,this._end),this.get(e,this._end),this._step))},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.length>r)return r}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,Math.max(0,t))},skip:function(t){return this.slice(Math.max(0,t))},__iterate:function(t,e){for(var r=this.length-1,n=this._step,i=e?this._start+r*n:this._start,u=0;r>=u;u++){if(t(i,u,this)===!1)return u+1;i+=e?-n:n}return u},__iterator:function(t,e){var r=this.length-1,n=this._step,i=e?this._start+r*n:this._start,u=0;return new er(function(){var a=i;return i+=e?-n:n,u>r?g():v(t,u++,a)})},__deepEquals:function(t){return t instanceof Zr?this._start===t._start&&this._end===t._end&&this._step===t._step:je.superCall(this,Zr.prototype,"__deepEquals",[t])}},{},ar);var $r=Yr.prototype;$r.__toJS=$r.toArray,$r.first=jr.first,$r.last=jr.last;var tn=Yr(0,0),en=function(t,e){return 0===e&&un?un:this instanceof rn?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new rn(t,e) <del>},rn=en;je.createClass(en,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return n(this._value,t)},slice:function(t,e){var r=this.length;return t=0>t?Math.max(0,r+t):Math.min(r,t),e=null==e?r:e>0?Math.min(r,e):Math.max(0,r+e),e>t?new rn(this._value,e-t):un},reverse:function(){return this},indexOf:function(t){return n(this._value,t)?0:-1},lastIndexOf:function(t){return n(this._value,t)?this.length:-1},__iterate:function(t){for(var e=0;this.length>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},__iterator:function(t){var e=this,r=0;return new er(function(){return e.length>r?v(t,r++,e._value):g()})},__deepEquals:function(t){return t instanceof rn?n(this._value,t._value):je.superCall(this,rn.prototype,"__deepEquals",[t])}},{},ar);var nn=en.prototype;nn.last=nn.first,nn.has=$r.has,nn.take=$r.take,nn.skip=$r.skip,nn.__toJS=$r.__toJS;var un=new en(void 0,0),an=function(t,e,r,n){this.length=n,this._rootData=t,this._keyPath=e,this._onChange=r};je.createClass(an,{equals:function(t){return n(this.deref(),t&&("function"==typeof t.deref?t.deref():t))},deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var r=this._rootData.getIn(this._keyPath.concat(t),Ke);return r===Ke?e:Oe(this,t,r)},set:function(t,e){return Ae(this,function(r){return r.set(t,e)},t)},remove:function(t){return Ae(this,function(e){return e.remove(t)},t)},clear:function(){return Ae(this,function(t){return t.clear()})},update:function(t,e,r){return 1===arguments.length?Ae(this,t):Ae(this,function(n){return n.update(t,e,r)},t)},withMutations:function(t){return Ae(this,function(e){return(e||pr.empty()).withMutations(t)})},cursor:function(t){return Array.isArray(t)&&0===t.length?this:Ce(this,t)},__iterate:function(t,e){var r=this,n=this.deref();return n&&n.__iterate?n.__iterate(function(e,n){return t(Oe(r,n,e),n,r)},e):0},__iterator:function(t,e){var r=this,n=this.deref(),i=n&&n.__iterator&&n.__iterator(Ze,e); <del>return new er(function(){if(!i)return g();var e=i.next();if(e.done)return e;var n=e.value,u=n[0],a=n[1];return v(t,u,Oe(r,u,a),e)})}},{},nr);var sn=an.prototype;sn[Re]=sn.remove,sn.getIn=sn.get;var on=function(t,e,r,n){this.length=n,this._rootData=t,this._keyPath=e,this._onChange=r};je.createClass(on,{},{},ar);var hn=on.prototype;hn.equals=sn.equals,hn.deref=sn.deref,hn.get=sn.get,hn.getIn=sn.getIn,hn.set=sn.set,hn[Re]=hn.remove=sn.remove,hn.clear=sn.clear,hn.update=sn.update,hn.withMutations=sn.withMutations,hn.cursor=sn.cursor,hn.__iterate=sn.__iterate,hn.__iterator=sn.__iterator;var cn={Sequence:nr,Map:pr,Vector:Ar,Stack:Kr,Set:Vr,OrderedMap:Fr,Record:Qr,Range:Yr,Repeat:en,is:n,fromJS:xe};return cn}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t(); <ide>\ No newline at end of file <add>return"function"==typeof e?e:void 0}function w(t){return null==t.length&&t.cacheResult(),o(1/0>t.length,"Cannot reverse infinite range."),t.length}function S(t,e,r){return(0===t||null!=r&&-r>=t)&&(null==e||null!=r&&e>=r)}function I(t,e){return b(t,e,0)}function q(t,e){return b(t,e,e)}function b(t,e,r){return null==t?r:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function x(t){return t}function k(t,e){return[e,t]}function M(){return!0}function D(t){return function(){return!t.apply(this,arguments)}}function O(t){return"string"==typeof t?JSON.stringify(t):t}function C(t,e){return t>e?1:e>t?-1:0}function A(t,e){return 0>e?(null==t.length&&t.cacheResult(),t.length+e):e}function E(t){o(1/0!==t,"Cannot perform this action with an infinite sequence.")}function j(t,e,r,n){var i=t._cache;if(i){for(var u=i.length-1,a=0;u>=a;a++){var s=i[r?u-a:a];if(e(s[1],n?s[0]:a,t)===!1)return a+1}return a}return t.__iterateUncached(e,r)}function R(t,e,r,n){var i=t._cache;if(i){var u=i.length-1,a=0;return new rr(function(){var t=i[r?u-a:a];return a++>u?g():v(e,n?t[0]:a-1,t[1])})}return t.__iteratorUncached(e,r)}function U(t){var e=t.__makeSequence();return e.length=t.length,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.contains(e)},e.contains=function(e){return t.has(e)},e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Ze){var n=t.__iterator(e,r);return new rr(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===Ye?Xe:Ye,r)},e}function P(t,e,r){var n=t.__makeSequence();return n.length=t.length,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,Ke);return u===Ke?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var u=this;return t.__iterate(function(t,i,a){return n(e.call(r,t,i,a),i,u)!==!1},i)},n.__iteratorUncached=function(n,i){var u=t.__iterator(Ze,i);return new rr(function(){var i=u.next(); <add>if(i.done)return i;var a=i.value,s=a[0];return v(n,s,e.call(r,a[1],s,t),i)})},n}function W(t,e){var r=t.__makeSequence();return r.length=t.length,r.reverse=function(){return t},r.flip=function(){var e=t.flip.apply(this);return e.reverse=function(){return t.flip()},e},r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=function(){return t.cacheResult(),this.length=t.length,this},r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function K(t,e,r,n){var i=t.__makeSequence();return n&&(i.has=function(n){var i=t.get(n,Ke);return i!==Ke&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,Ke);return u!==Ke&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,u){var a=this,s=0;return t.__iterate(function(t,u,o){return e.call(r,t,u,o)?(s++,i(t,n?u:s-1,a)):void 0},u),s},i.__iteratorUncached=function(i,u){var a=t.__iterator(Ze,u),s=0;return new rr(function(){for(;;){var u=a.next();if(u.done)return u;var o=u.value,h=o[0],c=o[1];if(e.call(r,c,h,t))return v(i,n?h:s++,c,u)}})},i}function z(t,e,r,n){var i={},u=[];return t.__iterate(function(a,s){var o=e.call(r,a,s,t),c=h(o),f=n?[s,a]:a;i.hasOwnProperty(c)?u[i[c]][1].push(f):(i[c]=u.length,u.push([o,[f]]))}),ir(u).fromEntrySeq().map(n?function(t){return ir(t).fromEntrySeq()}:function(t){return ir(t)})}function J(t,e){if(e>t.length)return t;0>e&&(e=0);var r=t.__makeSequence();return r.length=t.length&&Math.min(t.length,e),r.__iterateUncached=function(r,n){var i=this;if(0===e)return 0;if(n)return this.cacheResult().__iterate(r,n);var u=0;return t.__iterate(function(t,n){return++u&&r(t,n,i)!==!1&&e>u}),u},r.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=e&&t.__iterator(r,n),u=0;return new rr(function(){return u++>e?g():i.next()})},r}function B(t,e,r){var n=t.__makeSequence();return n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i); <add>var a=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++a&&n(t,i,u)}),a},n.__iteratorUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterator(n,i);var a=t.__iterator(Ze,i),s=!0;return new rr(function(){if(!s)return g();var t=a.next();if(t.done)return t;var i=t.value,o=i[0],h=i[1];return e.call(r,h,o,u)?n===Ze?t:v(n,o,h,t):(s=!1,g())})},n}function V(t,e,r){if(0>=e)return t;var n=t.__makeSequence();return n.length=t.length&&Math.max(0,t.length-e),n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var a=0,s=!0,o=0;return t.__iterate(function(t,i){return s&&(s=a++<e)?void 0:(o++,n(t,r?i:o-1,u))}),o},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var u=e&&t.__iterator(n,i),a=0,s=0;return new rr(function(){for(;e>a;)a++,u.next();var t=u.next();return r||n===Ye?t:n===Xe?v(n,s++,null,t):v(n,s++,t.value[1],t)})},n}function L(t,e,r,n){var i=t.__makeSequence();return i.__iterateUncached=function(i,u){var a=this;if(u)return this.cacheResult().__iterate(i,u);var s=!0,o=0;return t.__iterate(function(t,u,h){return s&&(s=e.call(r,t,u,h))?void 0:(o++,i(t,n?u:o-1,a))}),o},i.__iteratorUncached=function(i,u){var a=this;if(u)return this.cacheResult().__iterator(i,u);var s=t.__iterator(Ze,u),o=!0,h=0;return new rr(function(){var t,u,c;do{if(t=s.next(),t.done)return n||i===Ye?t:i===Xe?v(i,h++,null,t):v(i,h++,t.value[1],t);var f=t.value;u=f[0],c=f[1],o&&(o=e.call(r,c,u,a))}while(o);return i===Ze?t:v(i,u,c,t)})},i}function N(t,e,r){var n=[t].concat(e),i=ir(n);return r&&(i=i.toKeyedSeq()),i=i.flatMap(x),i.length=n.reduce(function(t,e){if(void 0!==t){var r=ir(e).length;if(null!=r)return t+r}},0),i}function T(t,e,r){var n=t.__makeSequence();return n.__iterateUncached=function(n,i){function u(t,o){var h=this;t.__iterate(function(t,i){return(!e||e>o)&&t instanceof ir?u(t,o+1):n(t,r?i:a++,h)===!1&&(s=!0),!s},i)}var a=0,s=!1;return u(t,0),a},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),a=[],s=0;return new rr(function(){for(;u;){var t=u.next(); <add>if(t.done===!1){var o=t.value;if(n===Ze&&(o=o[1]),!((!e||e>a.length)&&o instanceof ir))return r?t:v(n,s++,o,t);a.push(u),u=o.__iterator(n,i)}else u=a.pop()}return g()})},n}function F(t,e){var r=t.__makeSequence();return r.length=t.length&&2*t.length-1,r.__iterateUncached=function(r,n){var i=this,u=0;return t.__iterate(function(t){return(!u||r(e,u++,i)!==!1)&&r(t,u++,i)!==!1},n),u},r.__iteratorUncached=function(r,n){var i,u=t.__iterator(Ye,n),a=0;return new rr(function(){return(!i||a%2)&&(i=u.next(),i.done)?i:a%2?v(r,a++,e):v(r,a++,i.value,i)})},r}function G(t,e){return v(t,e[0],e[1])}function H(t,e){return{node:t,index:0,__prev:e}}function Q(t,e,r,n){var i=Object.create(yr);return i.length=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function X(t,e,r){var n=i(ze),u=i(Je),a=Y(t._root,t.__ownerID,0,h(e),e,r,n,u);if(!u.value)return t;var s=t.length+(n.value?r===Ke?-1:1:0);return t.__ownerID?(t.length=s,t._root=a,t.__hash=void 0,t.__altered=!0,t):a?Q(s,a):mr.empty()}function Y(t,e,r,n,i,a,s,o){return t?t.update(e,r,n,i,a,s,o):a===Ke?t:(u(o),u(s),new kr(e,n,[i,a]))}function Z(t){return t.constructor===kr||t.constructor===br}function $(t,e,r,n,i){if(t.hash===n)return new br(e,n,[t.entry,i]);var u,a=(0===r?t.hash:t.hash>>>r)&We,s=(0===r?n:n>>>r)&We,o=a===s?[$(t,e,r+Ue,n,i)]:(u=new kr(e,n,i),s>a?[t,u]:[u,t]);return new wr(e,1<<a|1<<s,o)}function te(t,e,r,n){for(var i=0,u=0,a=Array(r),s=0,o=1,h=e.length;h>s;s++,o<<=1){var c=e[s];null!=c&&s!==n&&(i|=o,a[u++]=c)}return new wr(t,i,a)}function ee(t,e,r,n,i){for(var u=0,a=Array(Pe),s=0;0!==r;s++,r>>>=1)a[s]=1&r?e[u++]:null;return a[n]=i,new Ir(t,u+1,a)}function re(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i];u instanceof ir||(u=ir(u),u instanceof sr&&(u=u.fromEntrySeq())),u&&n.push(u)}return ie(t,e,n)}function ne(t){return function(e,r){return e&&e.mergeDeepWith?e.mergeDeepWith(t,r):t?t(e,r):r}}function ie(t,e,r){return 0===r.length?t:t.withMutations(function(t){for(var n=e?function(r,n){var i=t.get(n,Ke);t.set(n,i===Ke?r:e(i,r))}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n) <add>})}function ue(t,e,r,n,i){var u=e.length;if(i===u)return n(t);o(t.set,"updateIn with invalid keyPath");var a=i===u-1?r:mr.empty(),s=e[i],h=t.get(s,a),c=ue(h,e,r,n,i+1);return c===h?t:t.set(s,c)}function ae(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function se(t,e,r,n){var i=n?t:s(t);return i[e]=r,i}function oe(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var u=Array(i),a=0,s=0;i>s;s++)s===e?(u[s]=r,a=-1):u[s]=t[s+a];return u}function he(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),u=0,a=0;n>a;a++)a===e&&(u=1),i[a]=t[a+u];return i}function ce(t,e,r,n,i,u){var a,s=t&&t.array;if(0===e){var o=0>r?-r:0,h=n-r;for(h>Pe&&(h=Pe),a=o;h>a;a++)if(i(s&&s[u?o+h-1-a:a])===!1)return!1}else{var c=1<<e,f=e-Ue;for(a=0;We>=a;a++){var _=u?We-a:a,l=r+(_<<e);if(n>l&&l+c>0){var v=s&&s[_];if(!ce(v,f,l,n,i,u))return!1}}}return!0}function fe(t,e,r,n,i){return{array:t,level:e,offset:r,max:n,rawMax:n-r>>e,index:0,__prev:i}}function _e(t,e,r,n,i,u,a){var s=Object.create(Rr);return s.length=e-t,s._origin=t,s._size=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=u,s.__hash=a,s.__altered=!1,s}function le(t,e,r){if(e=A(t,e),e>=t.length||0>e)return r===Ke?t:t.withMutations(function(t){0>e?me(t,e).set(0,r):me(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,u=t._root,a=i(Je);return e>=ye(t._size)?n=ve(n,t.__ownerID,0,e,r,a):u=ve(u,t.__ownerID,t._level,e,r,a),a.value?t.__ownerID?(t._root=u,t._tail=n,t.__hash=void 0,t.__altered=!0,t):_e(t._origin,t._size,t._level,u,n):t}function ve(t,e,r,n,i,a){var s,o=i===Ke,h=n>>>r&We,c=t&&t.array.length>h;if(o&&!c)return t;if(r>0){var f=t&&t.array[h],_=ve(f,e,r-Ue,n,i,a);return _===f?t:(s=ge(t,e),s.array[h]=_,s)}return!o&&c&&t.array[h]===i?t:(u(a),s=ge(t,e),o&&h===s.array.length-1?s.array.pop():s.array[h]=o?void 0:i,s)}function ge(t,e){return e&&t&&e===t.ownerID?t:new Ur(t?t.array.slice():[],e)}function pe(t,e){if(e>=ye(t._size))return t._tail;if(1<<t._level+Ue>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&We],n-=Ue; <add>return r}}function me(t,e,r){var n=t.__ownerID||new a,i=t._origin,u=t._size,s=i+e,o=null==r?u:0>r?u+r:i+r;if(s===i&&o===u)return t;if(s>=o)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new Ur(c&&c.array.length?[null,c]:[],n),h+=Ue,f+=1<<h;f&&(s+=f,i+=f,o+=f,u+=f);for(var _=ye(u),l=ye(o);l>=1<<h+Ue;)c=new Ur(c&&c.array.length?[c]:[],n),h+=Ue;var v=t._tail,g=_>l?pe(t,o-1):l>_?new Ur([],n):v;if(v&&l>_&&u>s&&v.array.length){c=ge(c,n);for(var p=c,m=h;m>Ue;m-=Ue){var d=_>>>m&We;p=p.array[d]=ge(p.array[d],n)}p.array[_>>>Ue&We]=v}if(u>o&&(g=g&&g.removeAfter(n,0,o)),s>=l)s-=l,o-=l,h=Ue,c=null,g=g&&g.removeBefore(n,0,s);else if(s>i||_>l){var y,w;f=0;do y=s>>>h&We,w=l-1>>>h&We,y===w&&(y&&(f+=(1<<h)*y),h-=Ue,c=c&&c.array[y]);while(c&&y===w);c&&s>i&&(c=c&&c.removeBefore(n,h,s-f)),c&&_>l&&(c=c&&c.removeAfter(n,h,l-f)),f&&(s-=f,o-=f)}return t.__ownerID?(t.length=o-s,t._origin=s,t._size=o,t._level=h,t._root=c,t._tail=g,t.__hash=void 0,t.__altered=!0,t):_e(s,o,h,c,g)}function de(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i];u&&n.push(ir(u))}var a=Math.max.apply(null,n.map(function(t){return t.length||0}));return a>t.length&&(t=t.setLength(a)),ie(t,e,n)}function ye(t){return Pe>t?0:t-1>>>Ue<<Ue}function we(t,e,r,n){var i=Object.create(Br);return i.length=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Se(t,e){var r=Object.create(Tr);return r.length=t?t.length:0,r._map=t,r.__ownerID=e,r}function Ie(t,e,r,n){var i=Object.create(Gr.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=r,i.__hash=n,i}function qe(t,e,r){var n=t._map,i=t._vector,u=n.get(e),a=void 0!==u,s=r===Ke;if(!a&&s||a&&r===i.get(u)[1])return t;a||(u=i.length);var o=s?n.remove(e):a?n:n.set(e,u),h=s?i.remove(u):i.set(u,[e,r]);return t.__ownerID?(t.length=o.length,t._map=o,t._vector=h,t.__hash=void 0,t):Ie(o,h)}function be(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function xe(t,e){return e?ke(e,t,"",{"":t}):Me(t)}function ke(t,e,r,n){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(n,r,ir(e).map(function(r,n){return ke(t,r,n,e) <add>})):e}function Me(t){if(t){if(Array.isArray(t))return ir(t).map(Me).toVector();if(t.constructor===Object)return ir(t).map(Me).toMap()}return t}function De(t,e,r,n){4>arguments.length&&(n=t.getIn(e));var i=n instanceof ir?n.length:null,u=n instanceof sr?hn:sn;return new u(t,e,r,i)}function Oe(t,e,r){return r instanceof ir?Ce(t,e,r):r}function Ce(t,e,r){return De(t._rootData,t._keyPath.concat(e),t._onChange,r)}function Ae(t,e,r){var n=t._rootData.updateIn(t._keyPath,r?mr.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,n,t._rootData,r?i.concat(r):i),De(n,t._keyPath,t._onChange)}var Ee=Object,je={};je.createClass=t,je.superCall=e,je.defaultSuperCall=r;var Re="delete",Ue=5,Pe=1<<Ue,We=Pe-1,Ke={},ze={value:!1},Je={value:!1},Be=Object.prototype.propertyIsEnumerable,Ve=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),Le=2147483647,Ne=0,Te="__immutablehash__";"undefined"!=typeof Symbol&&(Te=Symbol(Te));var Fe=16,Ge=255,He=0,Qe={},Xe=0,Ye=1,Ze=2,$e="@@iterator",tr="function"==typeof Symbol&&Symbol.iterator,er=tr||$e,rr=function(t){this.next=t};je.createClass(rr,{toString:function(){return"[Iterator]"}},{});var nr=rr.prototype;nr.inspect=nr.toSource=function(){return""+this},nr[er]=function(){return this};var ir=function(t){return ur.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},ur=ir;je.createClass(ir,{toArray:function(){E(this.length);var t=Array(this.length||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toJS:function(){return this.map(function(t){return t instanceof ur?t.toJS():t}).__toJS()},toMap:function(){return E(this.length),mr.from(this)},toObject:function(){E(this.length);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return E(this.length),Gr.from(this)},toSet:function(){return E(this.length),Lr.from(this)},toStack:function(){return E(this.length),zr.from(this)},toVector:function(){return E(this.length),Er.from(this)},toString:function(){return this.__toString("Seq {","}")},__toString:function(t,e){return 0===this.length?t+e:t+" "+this.map(this.__toStringMapper).join(", ")+" "+e <add>},__toStringMapper:function(t,e){return e+": "+O(t)},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return N(this,t,!0)},contains:function(t){return this.find(function(e){return n(e,t)},null,Ke)!==Ke},entries:function(){return this.__iterator(Ze)},every:function(t,e){var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return K(this,t,e,!0)},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},join:function(t){t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!=n?n:""}),e},keys:function(){return this.__iterator(Xe)},map:function(t,e){return P(this,t,e)},reduce:function(t,e,r){var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,a){i?(i=!1,n=e):n=t.call(r,n,e,u,a)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return W(this,!0)},slice:function(t,e){if(S(t,e,this.length))return this;var r=I(t,this.length),n=q(e,this.length);if(r!==r||n!==n)return this.cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return null==n||n===this.length?i:i.take(n-r)},some:function(t,e){return!this.every(D(t),e)},sort:function(t){return this.sortBy(x,t)},values:function(){return this.__iterator(Ye)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.__iterate(M)),this.length)},countBy:function(t,e){var r=this,n={},i=[];return this.__iterate(function(u,a){var s=t.call(e,u,a,r),o=h(s);n.hasOwnProperty(o)?i[n[o]][1]++:(n[o]=i.length,i.push([s,1]))}),ur(i).fromEntrySeq()},equals:function(t){if(this===t)return!0;if(!(t instanceof ur))return!1;if(null!=this.length&&null!=t.length){if(this.length!==t.length)return!1;if(0===this.length&&0===t.length)return!0}return null!=this.__hash&&null!=t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t) <add>},__deepEquals:function(t){var e=this.entries();return t.every(function(t,r){var i=e.next().value;return i&&n(i[0],r)&&n(i[1],t)})&&e.next().done},entrySeq:function(){var t=this;if(t._cache)return ur(t._cache);var e=t.toKeyedSeq().map(k).valueSeq();return e.fromEntries=function(){return t},e},findKey:function(t,e){var r;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?(r=i,!1):void 0}),r},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(M)},flatMap:function(t,e){return this.map(function(r,n,i){return ur(t.call(e,r,n,i))}).flatten(!0)},flatten:function(t){return T(this,t,!0)},flip:function(){return U(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)},null,e)},getIn:function(t,e){var r=this;if(t)for(var n=0;t.length>n;n++)if(r=r&&r.get?r.get(t[n],Ke):Ke,r===Ke)return e;return r},groupBy:function(t,e){return z(this,t,e,!0)},has:function(t){return this.get(t,Ke)!==Ke},keySeq:function(){return this.flip().valueSeq()},last:function(){return this.reverse().first()},mapEntries:function(t,e){var r=this;return this.entrySeq().map(function(n,i){return t.call(e,n,i,r)}).fromEntrySeq()},mapKeys:function(t,e){var r=this;return this.flip().map(function(n,i){return t.call(e,n,i,r)}).flip()},rest:function(){return this.slice(1)},skip:function(t){return V(this,t,!0)},skipLast:function(t){return this.reverse().skip(t).reverse()},skipWhile:function(t,e){return L(this,t,e,!0)},skipUntil:function(t,e){return this.skipWhile(D(t),e)},sortBy:function(t,e){e=e||C;var r=this;return ur(this.entrySeq().entrySeq().toArray().sort(function(n,i){return e(t(n[1][1],n[1][0],r),t(i[1][1],i[1][0],r))||n[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},take:function(t){return J(this,t)},takeLast:function(t){return this.reverse().take(t).reverse()},takeWhile:function(t,e){return B(this,t,e)},takeUntil:function(t,e){return this.takeWhile(D(t),e)},toKeyedSeq:function(){return this},valueSeq:function(){return new vr(this) <add>},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(E(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,r){return t+(h(e)^(e===r?0:h(r)))&Le},0))},__makeSequence:function(){return Object.create(ar)},__iterate:function(t,e){return j(this,t,e,!0)},__iterator:function(t,e){return R(this,t,e,!0)}},{from:function(t){if(t instanceof ur)return t;if(!Array.isArray(t)){if(m(t))return new cr(t);if(p(t))return new fr(t);if(t&&t.constructor===Object)return new _r(t);t=[t]}return new lr(t)}});var ar=ir.prototype;ar[er]=ar.entries,ar.toJSON=ar.toJS,ar.__toJS=ar.toObject,ar.inspect=ar.toSource=function(){return""+this},ar.chain=ar.flatMap;var sr=function(){je.defaultSuperCall(this,or.prototype,arguments)},or=sr;je.createClass(sr,{toString:function(){return this.__toString("Seq [","]")},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return N(this,t,!1)},filter:function(t,e){return K(this,t,e,!1)},findIndex:function(t,e){var r=this.findKey(t,e);return null==r?-1:r},indexOf:function(t){return this.findIndex(function(e){return n(e,t)})},lastIndexOf:function(t){return this.toKeyedSeq().reverse().indexOf(t)},reverse:function(){return W(this,!1)},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=I(t,this.length);var n=this.slice(0,t);return 1===r?n:n.concat(s(arguments,2),this.slice(t+e))},findLastIndex:function(t,e){return this.toKeyedSeq().reverse().findIndex(t,e)},first:function(){return this.get(0)},flatten:function(t){return T(this,t,!1)},flip:function(){return U(this.toKeyedSeq())},fromEntrySeq:function(){return new pr(this)},get:function(t,e){return t=A(this,t),0>t||1/0===this.length||null!=this.length&&t>this.length?e:this.find(function(e,r){return r===t},null,e)},groupBy:function(t,e){return z(this,t,e,!1)},has:function(t){return t=A(this,t),t>=0&&(null!=this.length?1/0===this.length||this.length>t:-1!==this.indexOf(t)) <add>},interpose:function(t){return F(this,t)},last:function(){return this.get(-1)},skip:function(t){var e=this,r=V(e,t,!1);return r!==e&&(r.get=function(r,n){return r=A(this,r),r>=0?e.get(r+t,n):n}),r},skipWhile:function(t,e){return L(this,t,e,!1)},sortBy:function(t,e){e=e||C;var r=this;return ir(this.entrySeq().toArray().sort(function(n,i){return e(t(n[1],n[0],r),t(i[1],i[0],r))||n[0]-i[0]})).fromEntrySeq().valueSeq()},take:function(t){var e=this,r=J(e,t);return r!==e&&(r.get=function(r,n){return r=A(this,r),r>=0&&t>r?e.get(r,n):n}),r},toKeyedSeq:function(){return new gr(this)},valueSeq:function(){return this},__makeSequence:function(){return Object.create(hr)},__iterate:function(t,e){return j(this,t,e,!1)},__iterator:function(t,e){return R(this,t,e,!1)}},{},ir);var hr=sr.prototype;hr[er]=hr.values,hr.__toJS=hr.toArray,hr.__toStringMapper=O;var cr=function(t){this._iterator=t,this._iteratorCache=[]};je.createClass(cr,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var a=u.value;if(n[i]=a,t(a,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new rr(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return v(t,i,n[i++])})}},{},sr);var fr=function(t){this._iterable=t,this.length=t.length||t.size};je.createClass(fr,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=d(r),i=0;if(m(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=d(r);if(!m(n))return new rr(function(){return g()});var i=0;return new rr(function(){var e=n.next();return e.done?e:v(t,i++,e.value)})}},{},sr);var _r=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};je.createClass(_r,{toObject:function(){return this._object <add>},get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,u=0;i>=u;u++){var a=n[e?i-u:u];if(t(r[a],a,this)===!1)return u+1}return u},__iterator:function(t,e){var r=this._object,n=this._keys,i=n.length-1,u=0;return new rr(function(){var a=n[e?i-u:u];return u++>i?g():v(t,a,r[a])})}},{},ir);var lr=function(t){this._array=t,this.length=t.length};je.createClass(lr,{toArray:function(){return this._array},get:function(t,e){return this.has(t)?this._array[A(this,t)]:e},__iterate:function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},__iterator:function(t,e){var r=this._array,n=r.length-1,i=0;return new rr(function(){return i>n?g():v(t,i,r[e?n-i++:i++])})}},{},sr);var vr=function(t){this._seq=t,this.length=t.length};je.createClass(vr,{contains:function(t){return this._seq.contains(t)},cacheResult:function(){return this._seq.cacheResult(),this.length=this._seq.length,this},__iterate:function(t,e){var r=this,n=0;return this._seq.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._seq.__iterator(Ye,e),n=0;return new rr(function(){var e=r.next();return e.done?e:v(t,n++,e.value,e)})}},{},sr);var gr=function(t){this._seq=t,this.length=t.length};je.createClass(gr,{get:function(t,e){return this._seq.get(t,e)},has:function(t){return this._seq.has(t)},valueSeq:function(){return this._seq},reverse:function(){var t=this,e=W(this,!0);return e.valueSeq=function(){return t._seq.reverse()},e},map:function(t,e){var r=this,n=P(this,t,e);return n.valueSeq=function(){return r._seq.map(t,e)},n},cacheResult:function(){return this._seq.cacheResult(),this.length=this._seq.length,this},__iterate:function(t,e){var r=this,n=e?w(this):0;return this._seq.__iterate(function(i){return t(i,e?--n:n++,r)},e)},__iterator:function(t,e){var r=this._seq.__iterator(Ye,e),n=e?w(this):0;return new rr(function(){var i=r.next();return i.done?i:v(t,e?--n:n++,i.value,i) <add>})}},{},ir);var pr=function(t){this._seq=t,this.length=t.length};je.createClass(pr,{entrySeq:function(){return this._seq},cacheResult:function(){return this._seq.cacheResult(),this.length=this._seq.length,this},__iterate:function(t,e){var r=this;return this._seq.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){var r=this._seq.__iterator(Ye,e);return new rr(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return t===Ze?e:v(t,n[0],n[1],e)}})}},{},ir);var mr=function(t){var e=dr.empty();return t?t.constructor===dr?t:e.merge(t):e},dr=mr;je.createClass(mr,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,h(t),t,e):e},set:function(t,e){return X(this,t,e)},remove:function(t){return X(this,t,Ke)},update:function(t,e,r){return 1===arguments.length?this.updateIn([],void 0,t):this.updateIn([t],e,r)},updateIn:function(t,e,r){return r||(r=e,e=void 0),ue(this,t,e,r,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):dr.empty()},merge:function(){return re(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return re(this,t,e)},mergeDeep:function(){return re(this,ne(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return re(this,ne(t),e)},cursor:function(t,e){var r=0===arguments.length||"function"==typeof t&&(e=t)?[]:Array.isArray(t)?t:[t];return De(this,r,e)},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new a)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},__iterator:function(t,e){return new Dr(this,t,e)},__iterate:function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?Q(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this) <add>}},{empty:function(){return Or||(Or=Q(0))}},ir);var yr=mr.prototype;yr[Re]=yr.remove,mr.from=mr;var wr=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r},Sr=wr;je.createClass(wr,{get:function(t,e,r,n){var i=1<<((0===t?e:e>>>t)&We),u=this.bitmap;return 0===(u&i)?n:this.nodes[ae(u&i-1)].get(t+Ue,e,r,n)},update:function(t,e,r,n,i,u,a){var s=(0===e?r:r>>>e)&We,o=1<<s,h=this.bitmap,c=0!==(h&o);if(!c&&i===Ke)return this;var f=ae(h&o-1),_=this.nodes,l=c?_[f]:null,v=Y(l,t,e+Ue,r,n,i,u,a);if(v===l)return this;if(!c&&v&&_.length>=Cr)return ee(t,_,h,s,v);if(c&&!v&&2===_.length&&Z(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&Z(v))return v;var g=t&&t===this.ownerID,p=c?v?h:h^o:h|o,m=c?v?se(_,f,v,g):he(_,f,g):oe(_,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new Sr(t,p,m)},iterate:function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++)if(r[e?i-n:n].iterate(t,e)===!1)return!1}},{});var Ir=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r},qr=Ir;je.createClass(Ir,{get:function(t,e,r,n){var i=(0===t?e:e>>>t)&We,u=this.nodes[i];return u?u.get(t+Ue,e,r,n):n},update:function(t,e,r,n,i,u,a){var s=(0===e?r:r>>>e)&We,o=i===Ke,h=this.nodes,c=h[s];if(o&&!c)return this;var f=Y(c,t,e+Ue,r,n,i,u,a);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Ar>_))return te(t,h,_,s)}else _++;var l=t&&t===this.ownerID,v=se(h,s,f,l);return l?(this.count=_,this.nodes=v,this):new qr(t,_,v)},iterate:function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var u=r[e?i-n:n];if(u&&u.iterate(t,e)===!1)return!1}}},{});var br=function(t,e,r){this.ownerID=t,this.hash=e,this.entries=r},xr=br;je.createClass(br,{get:function(t,e,r,i){for(var u=this.entries,a=0,s=u.length;s>a;a++)if(n(r,u[a][0]))return u[a][1];return i},update:function(t,e,r,i,a,o,h){var c=a===Ke;if(r!==this.hash)return c?this:(u(h),u(o),$(this,t,e,r,[i,a]));for(var f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(c&&!v)return this;if(u(h),(c||!v)&&u(o),c&&2===l)return new kr(t,this.hash,f[1^_]);var g=t&&t===this.ownerID,p=g?f:s(f);return v?c?_===l-1?p.pop():p[_]=p.pop():p[_]=[i,a]:p.push([i,a]),g?(this.entries=p,this):new xr(t,this.hash,p) <add>},iterate:function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1}},{});var kr=function(t,e,r){this.ownerID=t,this.hash=e,this.entry=r},Mr=kr;je.createClass(kr,{get:function(t,e,r,i){return n(r,this.entry[0])?this.entry[1]:i},update:function(t,e,r,i,a,s,o){var h=a===Ke,c=n(i,this.entry[0]);return(c?a===this.entry[1]:h)?this:(u(o),h?(u(s),null):c?t&&t===this.ownerID?(this.entry[1]=a,this):new Mr(t,r,[i,a]):(u(s),$(this,t,e,r,[i,a])))},iterate:function(t){return t(this.entry)}},{});var Dr=function(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&H(t._root)};je.createClass(Dr,{next:function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return G(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return G(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var u=n.nodes[this._reverse?r-i:i];if(u){if(u.entry)return G(t,u.entry);e=this._stack=H(u,e)}continue}e=this._stack=this._stack.__prev}return g()}},{},rr);var Or,Cr=Pe/2,Ar=Pe/4,Er=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return jr.from(t)},jr=Er;je.createClass(Er,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=A(this,t),0>t||t>=this.length)return e;t+=this._origin;var r=pe(this,t);return r&&r.array[t&We]},set:function(t,e){return le(this,t,e)},remove:function(t){return le(this,t,Ke)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=Ue,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):jr.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(r){me(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return me(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){me(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return me(this,1)},merge:function(){return de(this,null,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r]; <add>return de(this,t,e)},mergeDeep:function(){return de(this,ne(null),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return de(this,ne(t),e)},setLength:function(t){return me(this,0,t)},slice:function(t,e){var r=je.superCall(this,jr.prototype,"slice",[t,e]);if(r!==this){var n=this,i=n.length;r.toVector=function(){return me(n,0>t?Math.max(0,i+t):i?Math.min(i,t):t,null==e?i:0>e?Math.max(0,i+e):i?Math.min(i,e):e)}}return r},__iterator:function(t,e){return new Wr(this,t,e)},__iterate:function(t,e){var r=this,n=0,i=function(e){return t(e,n++,r)},u=ye(this._size);return e?ce(this._tail,0,u-this._origin,this._size-this._origin,i,e)&&ce(this._root,this._level,-this._origin,u-this._origin,i,e):ce(this._root,this._level,-this._origin,u-this._origin,i,e)&&ce(this._tail,0,u-this._origin,this._size-this._origin,i,e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?_e(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return Kr||(Kr=_e(0,0,Ue))},from:function(t){if(!t||0===t.length)return jr.empty();if(t.constructor===jr)return t;var e=Array.isArray(t);return t.length>0&&Pe>t.length?_e(0,t.length,Ue,null,new Ur(e?s(t):ir(t).toArray())):(e||(t=ir(t).valueSeq()),jr.empty().merge(t))}},sr);var Rr=Er.prototype;Rr[Re]=Rr.remove,Rr.update=yr.update,Rr.updateIn=yr.updateIn,Rr.cursor=yr.cursor,Rr.withMutations=yr.withMutations,Rr.asMutable=yr.asMutable,Rr.asImmutable=yr.asImmutable,Rr.wasAltered=yr.wasAltered;var Ur=function(t,e){this.array=t,this.ownerID=e},Pr=Ur;je.createClass(Ur,{removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e&We;if(n>=this.array.length)return new Pr([],t);var i,u=0===n;if(e>0){var a=this.array[n];if(i=a&&a.removeBefore(t,e-Ue,r),i===a&&u)return this}if(u&&!i)return this;var s=ge(this,t);if(!u)for(var o=0;n>o;o++)s.array[o]=void 0;return i&&(s.array[n]=i),s},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e&We; <add>if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var a=this.array[n];if(i=a&&a.removeAfter(t,e-Ue,r),i===a&&u)return this}if(u&&!i)return this;var s=ge(this,t);return u||s.array.pop(),i&&(s.array[n]=i),s}},{});var Wr=function(t,e,r){this._type=e,this._reverse=!!r,this._maxIndex=t.length-1;var n=ye(t._size),i=fe(t._root&&t._root.array,t._level,-t._origin,n-t._origin-1),u=fe(t._tail&&t._tail.array,0,n-t._origin,t._size-t._origin-1);this._stack=r?u:i,this._stack.__prev=r?i:u};je.createClass(Wr,{next:function(){for(var t=this._stack;t;){var e=t.array,r=t.index++;if(this._reverse&&(r=We-r,r>t.rawMax&&(r=t.rawMax,t.index=Pe-r)),r>=0&&Pe>r&&t.rawMax>=r){var n=e&&e[r];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(r<<t.level),this._reverse&&(i=this._maxIndex-i)),v(u,i,n)}this._stack=t=fe(n&&n.array,t.level-Ue,t.offset+(r<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return g()}},{},rr);var Kr,zr=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Jr.from(t)},Jr=zr;je.createClass(zr,{toString:function(){return this.__toString("Stack [","]")},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.length+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.length=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):we(t,e)},pushAll:function(t){if(t=ir(t),0===t.length)return this;var e=this.length,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.length=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):we(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Jr.empty() <add>},slice:function(t,e){if(S(t,e,this.length))return this;var r=I(t,this.length),n=q(e,this.length);if(n!==this.length)return je.superCall(this,Jr.prototype,"slice",[t,e]);for(var i=this.length-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.length=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):we(i,u)},__ensureOwner:function(t){return t===this.__ownerID?this:t?we(this.length,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=0,n=this._head;return new rr(function(){if(n){var e=n.value;return n=n.next,v(t,r++,e)}return g()})}},{empty:function(){return Vr||(Vr=we(0))},from:function(t){var e=Jr.empty();return t?t.constructor===Jr?t:e.unshiftAll(t):e}},sr);var Br=zr.prototype;Br.withMutations=yr.withMutations,Br.asMutable=yr.asMutable,Br.asImmutable=yr.asImmutable,Br.wasAltered=yr.wasAltered;var Vr,Lr=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Nr.from(t)},Nr=Lr;je.createClass(Lr,{toString:function(){return this.__toString("Set {","}")},get:function(t,e){return this._map.has(t)?t:e},contains:function(t){return this._map.has(t)},add:function(t){var e=this._map.set(t,null);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:Se(e)},remove:function(t){var e=this._map.remove(t);return this.__ownerID?(this.length=e.length,this._map=e,this):e===this._map?this:0===e.length?Nr.empty():Se(e)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):Nr.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var r=0;t.length>r;r++)ir(t[r]).forEach(function(t){return e.add(t)})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return ir(t) <add>});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return ir(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},isSubset:function(t){return t=ir(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=ir(t),t.every(function(t){return e.contains(t)})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?Se(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return Fr||(Fr=Se(mr.empty()))},from:function(t){var e=Nr.empty();return t?t.constructor===Nr?t:e.union(t):e},fromKeys:function(t){return Nr.from(ir(t).flip())}},ir);var Tr=Lr.prototype;Tr[Re]=Tr.remove,Tr[er]=Tr.values,Tr.mergeDeep=Tr.merge,Tr.mergeDeepWith=Tr.mergeWith,Tr.withMutations=yr.withMutations,Tr.asMutable=yr.asMutable,Tr.asImmutable=yr.asImmutable,Tr.__toJS=hr.__toJS,Tr.__toStringMapper=hr.__toStringMapper;var Fr,Gr=function(t){var e=Hr.empty();return t?t.constructor===Hr?t:e.merge(t):e},Hr=Gr;je.createClass(Gr,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return null!=r?this._vector.get(r)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):Hr.empty()},set:function(t,e){return qe(this,t,e)},remove:function(t){return qe(this,t,Ke)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered() <add>},__iterate:function(t,e){var r=this;return this._vector.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},__iterator:function(t,e){return this._vector.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._vector.__ensureOwner(t);return t?Ie(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=r,this)}},{empty:function(){return Qr||(Qr=Ie(mr.empty(),Er.empty()))}},mr),Gr.from=Gr,Gr.prototype[Re]=Gr.prototype.remove;var Qr,Xr=function(t,e){var r=function(t){return this instanceof r?void(this._map=mr(t)):new r(t)},n=Object.keys(t),i=r.prototype=Object.create(Yr);i.constructor=r,e&&(i._name=e),i._defaultValues=t,i._keys=n,i.length=n.length;try{ir(t).forEach(function(t,e){Object.defineProperty(r.prototype,e,{get:function(){return this.get(e)},set:function(t){o(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})})}catch(u){}return r};je.createClass(Xr,{toString:function(){return this.__toString(this._name+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){return void 0===e||this.has(t)?this._map.get(t,this._defaultValues[t]):e},clear:function(){if(this.__ownerID)return this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=be(this,mr.empty()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+this._name);var r=this._map.set(t,e);return this.__ownerID||r===this._map?this:be(this,r)},remove:function(t){if(null==t||!this.has(t))return this;var e=this._map.remove(t);return this.__ownerID||e===this._map?this:be(this,e)},keys:function(){return this._map.keys()},values:function(){return this._map.values()},entries:function(){return this._map.entries()},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){return this._map.__iterator(t,e)},__iterate:function(t,e){var r=this;return ir(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this; <add>var e=this._map&&this._map.__ensureOwner(t);return t?be(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},ir);var Yr=Xr.prototype;Yr._name="Record",Yr[Re]=Yr.remove,Yr.merge=yr.merge,Yr.mergeWith=yr.mergeWith,Yr.mergeDeep=yr.mergeDeep,Yr.mergeDeepWith=yr.mergeDeepWith,Yr.update=yr.update,Yr.updateIn=yr.updateIn,Yr.cursor=yr.cursor,Yr.withMutations=yr.withMutations,Yr.asMutable=yr.asMutable,Yr.asImmutable=yr.asImmutable;var Zr=function(t,e,r){return this instanceof $r?(o(0!==r,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&en?en:(r=null==r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.length=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new $r(t,e,r)},$r=Zr;je.createClass(Zr,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},get:function(t,e){return this.has(t)?this._start+A(this,t)*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.length>e&&e===Math.floor(e)},slice:function(t,e){return S(t,e,this.length)?this:(t=I(t,this.length),e=q(e,this.length),t>=e?en:new $r(this.get(t,this._end),this.get(e,this._end),this._step))},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.length>r)return r}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,Math.max(0,t))},skip:function(t){return this.slice(Math.max(0,t))},__iterate:function(t,e){for(var r=this.length-1,n=this._step,i=e?this._start+r*n:this._start,u=0;r>=u;u++){if(t(i,u,this)===!1)return u+1;i+=e?-n:n}return u},__iterator:function(t,e){var r=this.length-1,n=this._step,i=e?this._start+r*n:this._start,u=0;return new rr(function(){var a=i;return i+=e?-n:n,u>r?g():v(t,u++,a)})},__deepEquals:function(t){return t instanceof $r?this._start===t._start&&this._end===t._end&&this._step===t._step:je.superCall(this,$r.prototype,"__deepEquals",[t])}},{},sr);var tn=Zr.prototype;tn.__toJS=tn.toArray,tn.first=Rr.first,tn.last=Rr.last;var en=Zr(0,0),rn=function(t,e){return 0===e&&an?an:this instanceof nn?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new nn(t,e) <add>},nn=rn;je.createClass(rn,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return n(this._value,t)},slice:function(t,e){var r=this.length;return t=0>t?Math.max(0,r+t):Math.min(r,t),e=null==e?r:e>0?Math.min(r,e):Math.max(0,r+e),e>t?new nn(this._value,e-t):an},reverse:function(){return this},indexOf:function(t){return n(this._value,t)?0:-1},lastIndexOf:function(t){return n(this._value,t)?this.length:-1},__iterate:function(t){for(var e=0;this.length>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},__iterator:function(t){var e=this,r=0;return new rr(function(){return e.length>r?v(t,r++,e._value):g()})},__deepEquals:function(t){return t instanceof nn?n(this._value,t._value):je.superCall(this,nn.prototype,"__deepEquals",[t])}},{},sr);var un=rn.prototype;un.last=un.first,un.has=tn.has,un.take=tn.take,un.skip=tn.skip,un.__toJS=tn.__toJS;var an=new rn(void 0,0),sn=function(t,e,r,n){this.length=n,this._rootData=t,this._keyPath=e,this._onChange=r};je.createClass(sn,{equals:function(t){return n(this.deref(),t&&("function"==typeof t.deref?t.deref():t))},deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var r=this._rootData.getIn(this._keyPath.concat(t),Ke);return r===Ke?e:Oe(this,t,r)},set:function(t,e){return Ae(this,function(r){return r.set(t,e)},t)},remove:function(t){return Ae(this,function(e){return e.remove(t)},t)},clear:function(){return Ae(this,function(t){return t.clear()})},update:function(t,e,r){return 1===arguments.length?Ae(this,t):Ae(this,function(n){return n.update(t,e,r)},t)},withMutations:function(t){return Ae(this,function(e){return(e||mr.empty()).withMutations(t)})},cursor:function(t){return Array.isArray(t)&&0===t.length?this:Ce(this,t)},__iterate:function(t,e){var r=this,n=this.deref();return n&&n.__iterate?n.__iterate(function(e,n){return t(Oe(r,n,e),n,r)},e):0},__iterator:function(t,e){var r=this,n=this.deref(),i=n&&n.__iterator&&n.__iterator(Ze,e); <add>return new rr(function(){if(!i)return g();var e=i.next();if(e.done)return e;var n=e.value,u=n[0],a=n[1];return v(t,u,Oe(r,u,a),e)})}},{},ir);var on=sn.prototype;on[Re]=on.remove,on.getIn=on.get;var hn=function(t,e,r,n){this.length=n,this._rootData=t,this._keyPath=e,this._onChange=r};je.createClass(hn,{},{},sr);var cn=hn.prototype;cn.equals=on.equals,cn.deref=on.deref,cn.get=on.get,cn.getIn=on.getIn,cn.set=on.set,cn[Re]=cn.remove=on.remove,cn.clear=on.clear,cn.update=on.update,cn.withMutations=on.withMutations,cn.cursor=on.cursor,cn.__iterate=on.__iterate,cn.__iterator=on.__iterator;var fn={Sequence:ir,Map:mr,Vector:Er,Stack:zr,Set:Lr,OrderedMap:Gr,Record:Xr,Range:Zr,Repeat:rn,is:n,fromJS:xe};return fn}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t(); <ide>\ No newline at end of file <ide><path>src/Iterator.js <ide> var ITERATE_VALUES = 1; <ide> var ITERATE_ENTRIES = 2; <ide> <ide> var FAUX_ITERATOR_SYMBOL = '@@iterator'; <del>var ITERATOR_SYMBOL = typeof Symbol !== 'undefined' ? <del> Symbol.iterator : <del> FAUX_ITERATOR_SYMBOL; <add>var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; <add>var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; <ide> <ide> <ide> class Iterator { <ide> function getIterator(iterable) { <ide> <ide> function _iteratorFn(iterable) { <ide> var iteratorFn = iterable && ( <del> (ITERATOR_SYMBOL && iterable[ITERATOR_SYMBOL]) || <add> (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || <ide> iterable[FAUX_ITERATOR_SYMBOL] <ide> ); <ide> if (typeof iteratorFn === 'function') {
3
Ruby
Ruby
reduce code footprint of standard compilers map
73b7c52673d707a4df38b96c22c9fda0cbab786d
<ide><path>Library/Homebrew/macos.rb <ide> def prefer_64_bit? <ide> Hardware.is_64_bit? and version != :leopard <ide> end <ide> <del> StandardCompilers = { <del> "3.1.4" => {:gcc_40_build_version=>5493, :gcc_42_build_version=>5577}, <del> "3.2.6" => {:gcc_40_build_version=>5494, :gcc_42_build_version=>5666, :llvm_build_version=>2335, :clang_version=>"1.7", :clang_build_version=>77}, <del> "4.0" => {:gcc_40_build_version=>5494, :gcc_42_build_version=>5666, :llvm_build_version=>2335, :clang_version=>"2.0", :clang_build_version=>137}, <del> "4.0.1" => {:gcc_40_build_version=>5494, :gcc_42_build_version=>5666, :llvm_build_version=>2335, :clang_version=>"2.0", :clang_build_version=>137}, <del> "4.0.2" => {:gcc_40_build_version=>5494, :gcc_42_build_version=>5666, :llvm_build_version=>2335, :clang_version=>"2.0", :clang_build_version=>137}, <del> "4.2" => {:llvm_build_version=>2336, :clang_version=>"3.0", :clang_build_version=>211}, <del> "4.3" => {:llvm_build_version=>2336, :clang_version=>"3.1", :clang_build_version=>318}, <del> "4.3.1" => {:llvm_build_version=>2336, :clang_version=>"3.1", :clang_build_version=>318}, <del> "4.3.2" => {:llvm_build_version=>2336, :clang_version=>"3.1", :clang_build_version=>318}, <del> "4.3.3" => {:llvm_build_version=>2336, :clang_version=>"3.1", :clang_build_version=>318}, <del> "4.4" => {:llvm_build_version=>2336, :clang_version=>"4.0", :clang_build_version=>421}, <del> "4.4.1" => {:llvm_build_version=>2336, :clang_version=>"4.0", :clang_build_version=>421}, <del> "4.5" => {:llvm_build_version=>2336, :clang_version=>"4.1", :clang_build_version=>421}, <del> "4.5.1" => {:llvm_build_version=>2336, :clang_version=>"4.1", :clang_build_version=>421} <add> STANDARD_COMPILERS = { <add> "3.1.4" => { :gcc_40_build => 5493, :gcc_42_build => 5577 }, <add> "3.2.6" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :llvm_build => 2335, :clang => "1.7", :clang_build => 77 }, <add> "4.0" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :llvm_build => 2335, :clang => "2.0", :clang_build => 137 }, <add> "4.0.1" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :llvm_build => 2335, :clang => "2.0", :clang_build => 137 }, <add> "4.0.2" => { :gcc_40_build => 5494, :gcc_42_build => 5666, :llvm_build => 2335, :clang => "2.0", :clang_build => 137 }, <add> "4.2" => { :llvm_build => 2336, :clang => "3.0", :clang_build => 211 }, <add> "4.3" => { :llvm_build => 2336, :clang => "3.1", :clang_build => 318 }, <add> "4.3.1" => { :llvm_build => 2336, :clang => "3.1", :clang_build => 318 }, <add> "4.3.2" => { :llvm_build => 2336, :clang => "3.1", :clang_build => 318 }, <add> "4.3.3" => { :llvm_build => 2336, :clang => "3.1", :clang_build => 318 }, <add> "4.4" => { :llvm_build => 2336, :clang => "4.0", :clang_build => 421 }, <add> "4.4.1" => { :llvm_build => 2336, :clang => "4.0", :clang_build => 421 }, <add> "4.5" => { :llvm_build => 2336, :clang => "4.1", :clang_build => 421 }, <add> "4.5.1" => { :llvm_build => 2336, :clang => "4.1", :clang_build => 421 } <ide> } <ide> <ide> def compilers_standard? <ide> xcode = Xcode.version <ide> <del> unless StandardCompilers.keys.include? xcode <add> unless STANDARD_COMPILERS.keys.include? xcode <ide> onoe <<-EOS.undent <ide> Homebrew doesn't know what compiler versions ship with your version of <ide> Xcode. Please `brew update` and if that doesn't help, file an issue with <ide> def compilers_standard? <ide> return <ide> end <ide> <del> StandardCompilers[xcode].all? { |method, build| MacOS.send(method) == build } <add> STANDARD_COMPILERS[xcode].all? do |method, build| <add> MacOS.send(:"#{method}_version") == build <add> end <ide> end <ide> <ide> def app_with_bundle_id id
1
PHP
PHP
fix a docblock.
fe8c7e17e765c99f35c0c44448258e94409f405f
<ide><path>src/Illuminate/Support/Stringable.php <ide> public function match($pattern) <ide> * Get the string matching the given pattern. <ide> * <ide> * @param string $pattern <del> * @return static|null <add> * @return \Illuminate\Support\Collection <ide> */ <ide> public function matchAll($pattern) <ide> {
1
Javascript
Javascript
add missing isgroup property to group
106b374183e884e15c94a84c7617c668ce427d7c
<ide><path>src/objects/Group.js <ide> function Group() { <ide> <ide> Group.prototype = Object.assign( Object.create( Object3D.prototype ), { <ide> <del> constructor: Group <add> constructor: Group, <add> <add> isGroup: true <ide> <ide> } ); <ide>
1
Java
Java
fix checkstyle errors
37a3765a4eb7d0d06e80a1c1de2440ddac58eeef
<ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java <ide> public static RequestPredicate all() { <ide> <ide> /** <ide> * Return a {@code RequestPredicate} that matches if the request's HTTP method is equal to the <del> * given method <add> * given method. <ide> * @param httpMethod the HTTP method to match against <ide> * @return a predicate that tests against the given HTTP method <ide> */ <ide><path>spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java <ide> public interface Builder { <ide> * {@code OrderController.routerFunction()}. <ide> * to the {@code changeUser} method in {@code userController}: <ide> * <pre class="code"> <del> * RouterFunction<ServerResponse> route = <add> * RouterFunction&lt;ServerResponse&gt; route = <ide> * RouterFunctions.route() <ide> * .GET("/users", userController::listUsers) <ide> * .add(orderController.routerFunction());
2
Ruby
Ruby
rewrite cellar names before prefix names
94ebe8e747e774d7eb8efcb0e49c84581cc11bc6
<ide><path>Library/Homebrew/keg_fix_install_names.rb <ide> def fix_install_names options={} <ide> <ide> def relocate_install_names old_prefix, new_prefix, old_cellar, new_cellar, options={} <ide> mach_o_files.each do |file| <add> install_names_for(file, options, relocate_reject_proc(old_cellar)) do |id, old_cellar_names| <add> file.ensure_writable do <add> old_cellar_names.each do |old_cellar_name| <add> new_cellar_name = old_cellar_name.to_s.gsub old_cellar, new_cellar <add> change_install_name(old_cellar_name, new_cellar_name, file) <add> end <add> end <add> end <add> <ide> install_names_for(file, options, relocate_reject_proc(old_prefix)) do |id, old_prefix_names| <ide> file.ensure_writable do <ide> new_prefix_id = id.to_s.gsub old_prefix, new_prefix <ide> def relocate_install_names old_prefix, new_prefix, old_cellar, new_cellar, optio <ide> end <ide> end <ide> end <del> <del> install_names_for(file, options, relocate_reject_proc(old_cellar)) do |id, old_cellar_names| <del> file.ensure_writable do <del> old_cellar_names.each do |old_cellar_name| <del> new_cellar_name = old_cellar_name.to_s.gsub old_cellar, new_cellar <del> change_install_name(old_cellar_name, new_cellar_name, file) <del> end <del> end <del> end <ide> end <ide> <ide> # Search for pkgconfig .pc files and relocate references to the cellar
1
Text
Text
improve example description
ec1b989fce242ac7e9d9a6be34a9c452eff8344b
<ide><path>examples/wasm-simple/README.md <ide> This very simple example shows usage of WebAssembly. <ide> <del>WebAssembly modules can be imported like other async modules. <del>Their download and compilation happens in parallel to the download and evaluation of the javascript chunk. <add>WebAssembly modules can be imported like other async modules with `import await` or `import()`. <add>They are downloaded and instantiated in a streaming way when importing. <ide> <ide> # example.js <ide> <ide><path>examples/wasm-simple/template.md <ide> This very simple example shows usage of WebAssembly. <ide> <del>WebAssembly modules can be imported like other async modules. <del>Their download and compilation happens in parallel to the download and evaluation of the javascript chunk. <add>WebAssembly modules can be imported like other async modules with `import await` or `import()`. <add>They are downloaded and instantiated in a streaming way when importing. <ide> <ide> # example.js <ide>
2
PHP
PHP
add docs for features that are coming soon
36066a2dc47db912ed1059b48ea08619d0d2987e
<ide><path>src/Routing/DispatcherFilter.php <ide> * event listener with the ability to alter the request or response as needed before it is handled <ide> * by a controller or after the response body has already been built. <ide> * <add> * ### Limiting middleware to specific paths <add> * <add> * By using the `for` option you can limit with request paths a filter is applied to. <add> * Both the before and after event will have the same conditions applied to them. For <add> * example, if you only wanted a filter applied to blog requests you could do: <add> * <add> * {{{ <add> * $ware = new BlogMiddleware(['for' => '/blog']); <add> * }}} <add> * <add> * When the above middleware is connected to a dispatcher it will only fire <add> * its `beforeDispatch` and `afterDispatch` methods on requests that start with `/blog`. <add> * <add> * ### Limiting middleware based on conditions <add> * <add> * In addition to simple path based matching you can use a closure to match on arbitrary request <add> * or response conditions. For example: <add> * <add> * {{{ <add> * $cookieMonster = new CookieMiddleware([ <add> * 'when' => function ($req, $res) { <add> * // Custom code goes here. <add> * } <add> * ]); <add> * }}} <add> * <add> * If your when condition returns `true` the before/after methods will be called. <add> * <add> * When using the `for` or `when` matchers, conditions will be re-checked on the before and after <add> * callback as the conditions could change during the dispatch cycle. <add> * <ide> */ <ide> abstract class DispatcherFilter implements EventListener { <ide> <ide> abstract class DispatcherFilter implements EventListener { <ide> * Default config <ide> * <ide> * These are merged with user-provided config when the class is used. <add> * The when and for options allow you to define conditions that are checked before <add> * your filter is called. <ide> * <ide> * @var array <ide> */ <del> protected $_defaultConfig = []; <add> protected $_defaultConfig = [ <add> 'when' => null, <add> 'for' => null, <add> ]; <ide> <ide> /** <ide> * Constructor.
1
Javascript
Javascript
fix path issue
65877d5d30d5a11394e62987d5413cf2546fc937
<ide><path>test/Compiler.test.js <ide> describe("Compiler", () => { <ide> entry: "./c", <ide> context: path.join(__dirname, "fixtures"), <ide> output: { <del> path: "/", <add> path: "/directory", <ide> pathinfo: true <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./missing", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./missing-file", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> }, <ide> bail: true <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./missing-file", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> }, <ide> watch: true <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./missing", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }, <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }, <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./c", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> devtool: false, <ide> entry: "./fixtures/count-loader!./fixtures/count-loader", <ide> output: { <del> path: "/" <add> path: "/directory" <ide> } <ide> }); <ide> compiler.outputFileSystem = new createFsFromVolume(new Volume()); <ide> compiler.run(() => { <ide> compiler.run(() => { <ide> const result = compiler.outputFileSystem.readFileSync( <del> "/main.js", <add> "/directory/main.js", <ide> "utf-8" <ide> ); <ide> expect(result).toContain("module.exports = 0;"); <ide> describe("Compiler", () => { <ide> mode: "production", <ide> entry: "./missing", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> } <ide> }); <ide> describe("Compiler", () => { <ide> context: path.join(__dirname, "fixtures"), <ide> entry: "./a", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> }, <ide> infrastructureLogging: { <ide> describe("Compiler", () => { <ide> context: path.join(__dirname, "fixtures"), <ide> entry: "./a", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> }, <ide> infrastructureLogging: { <ide> describe("Compiler", () => { <ide> context: path.join(__dirname, "fixtures"), <ide> entry: "./a", <ide> output: { <del> path: "/", <add> path: "/directory", <ide> filename: "bundle.js" <ide> }, <ide> infrastructureLogging: {
1
Text
Text
promote cdt to tier 3
ac27c58180df05583f7df4c76e74da16bf896774
<ide><path>doc/contributing/diagnostic-tooling-support-tiers.md <ide> The tools are currently assigned to Tiers as follows: <ide> | Profiling | V8 --interpreted-frames-native-stack | Yes | Yes | 2 | <ide> | Profiling | Linux perf | Yes | Partial | 2 | <ide> | Profiling | node-clinic | No | No | 3 | <add>| Debugger | Chrome Dev tools | No | No | 3 | <ide> <ide> ## Tier 4 <ide> <ide> The tools are currently assigned to Tiers as follows: <ide> | Debugger | V8 Debug protocol (API) | No | Yes | 1 | <ide> | Debugger | Command line Debug Client | ? | Yes | 1 | <ide> | Debugger | llnode | ? | No | 2 | <del>| Debugger | Chrome Dev tools | ? | No | 3 | <ide> | Tracing | trace\_events (API) | No | Yes | 1 | <ide> | Tracing | trace\_gc | No | Yes | 1 | <ide> | Tracing | DTrace | No | Partial | 3 |
1
Javascript
Javascript
fix trailing arg
8691a826c0110639480b3eae9e21db05d72bf305
<ide><path>src/support.js <ide> <ide> // release memory in IE <ide> root = script = div = all = a = null; <del>})( jQuery ); <add>})(); <ide> <ide> jQuery.props = { <ide> "for": "htmlFor",
1
Java
Java
update copyright year of changed files
12f8cdd71571449a9d583f1ecfaa16d334a566a0
<ide><path>spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java <ide> /* <del> * Copyright 2002-2019 the original author or authors. <add> * Copyright 2002-2021 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><path>spring-core/src/test/java/org/springframework/core/env/JOptCommandLinePropertySourceTests.java <ide> /* <del> * Copyright 2002-2020 the original author or authors. <add> * Copyright 2002-2021 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.
2
Javascript
Javascript
support custom headers per action
fbdab513dd48f667ad857030cf4b3481ecdd9097
<ide><path>src/ngResource/resource.js <ide> * @param {Object.<Object>=} actions Hash with declaration of custom action that should extend the <ide> * default set of resource actions. The declaration should be created in the following format: <ide> * <del> * {action1: {method:?, params:?, isArray:?}, <del> * action2: {method:?, params:?, isArray:?}, <add> * {action1: {method:?, params:?, isArray:?, headers:?}, <add> * action2: {method:?, params:?, isArray:?, headers:?}, <ide> * ...} <ide> * <ide> * Where: <ide> * - `params` – {object=} – Optional set of pre-bound parameters for this action. <ide> * - isArray – {boolean=} – If true then the returned object for this action is an array, see <ide> * `returns` section. <add> * - `headers` – {object=} – Optional HTTP headers to send <ide> * <ide> * @returns {Object} A resource "class" object with methods for the default set of resource actions <ide> * optionally extended with custom `actions`. The default set contains these actions: <ide> * The object returned from this function execution is a resource "class" which has "static" method <ide> * for each action in the definition. <ide> * <del> * Calling these methods invoke `$http` on the `url` template with the given `method` and `params`. <add> * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and `headers`. <ide> * When the data is returned from the server then the object is an instance of the resource type and <ide> * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD <ide> * operations (create, read, update, delete) on server-side data. <ide> angular.module('ngResource', ['ng']). <ide> $http({ <ide> method: action.method, <ide> url: route.url(extend({}, extractParams(data), action.params || {}, params)), <del> data: data <add> data: data, <add> headers: extend({}, action.headers || {}) <ide> }).then(function(response) { <ide> var data = response.data; <ide> <ide><path>test/ngResource/resourceSpec.js <ide> describe("resource", function() { <ide> }, <ide> patch: { <ide> method: 'PATCH' <add> }, <add> conditionalPut: { <add> method: 'PUT', <add> headers: { <add> 'If-None-Match': '*' <add> } <ide> } <add> <ide> }); <ide> callback = jasmine.createSpy(); <ide> })); <ide> describe("resource", function() { <ide> }); <ide> <ide> <add> it('should send correct headers', function() { <add> $httpBackend.expectPUT('/CreditCard/123', undefined, function(headers) { <add> return headers['If-None-Match'] == "*"; <add> }).respond({id:123}); <add> <add> CreditCard.conditionalPut({id: {key:123}}); <add> }); <add> <add> <ide> it("should read partial resource", function() { <ide> $httpBackend.expect('GET', '/CreditCard').respond([{id:{key:123}}]); <ide> var ccs = CreditCard.query();
2
Python
Python
remove config assumption in trainer
fdccf82e28faf626fa8a64004164f3cd7744de41
<ide><path>src/transformers/trainer.py <ide> def __init__( <ide> # Create output directory if needed <ide> if self.is_world_process_zero(): <ide> os.makedirs(self.args.output_dir, exist_ok=True) <del> if is_torch_tpu_available(): <add> if is_torch_tpu_available() and isinstance(self.model, PreTrainedModel): <ide> # Set an xla_device flag on the model's config. <ide> # We'll find a more elegant and not need to do this in the future. <ide> self.model.config.xla_device = True <ide> def setup_wandb(self): <ide> logger.info( <ide> 'Automatic Weights & Biases logging enabled, to disable set os.environ["WANDB_DISABLED"] = "true"' <ide> ) <del> try: <del> combined_dict = {**self.model.config.to_dict(), **self.args.to_sanitized_dict()} <del> except AttributeError: <del> # in case the model has no config <del> combined_dict = {**self.args.to_sanitized_dict()} <add> combined_dict = {**self.args.to_sanitized_dict()} <add> if isinstance(self.model, PreTrainedModel): <add> combined_dict = {**self.model.config.to_dict(), **combined_dict} <ide> wandb.init( <ide> project=os.getenv("WANDB_PROJECT", "huggingface"), config=combined_dict, name=self.args.run_name <ide> ) <ide> def setup_comet(self): <ide> if experiment is not None: <ide> experiment._set_model_graph(self.model, framework="transformers") <ide> experiment._log_parameters(self.args, prefix="args/", framework="transformers") <del> experiment._log_parameters(self.model.config, prefix="config/", framework="transformers") <add> if isinstance(self.model, PreTrainedModel): <add> experiment._log_parameters(self.model.config, prefix="config/", framework="transformers") <ide> <ide> def num_examples(self, dataloader: DataLoader) -> int: <ide> """ <ide> def train(self, model_path: Optional[str] = None, trial: Union["optuna.Trial", D <ide> model, <ide> device_ids=[self.args.local_rank], <ide> output_device=self.args.local_rank, <del> find_unused_parameters=not getattr(model.config, "gradient_checkpointing", False), <add> find_unused_parameters=( <add> not getattr(model.config, "gradient_checkpointing", False) <add> if isinstance(model, PreTrainedModel) <add> else True <add> ), <ide> ) <ide> # find_unused_parameters breaks checkpointing as per <ide> # https://github.com/huggingface/transformers/pull/4659#issuecomment-643356021 <ide> def train(self, model_path: Optional[str] = None, trial: Union["optuna.Trial", D <ide> <ide> self.global_step = 0 <ide> self.epoch = 0 <del> self.total_flos = 0 <ide> epochs_trained = 0 <ide> steps_trained_in_current_epoch = 0 <add> <ide> # Check if continuing training from a checkpoint <ide> if model_path is not None: <ide> # set global_step to global_step of last saved checkpoint from model path <ide> try: <ide> self.global_step = int(model_path.split("-")[-1].split(os.path.sep)[0]) <del> self.total_flos = getattr(self._actual_model(model).config, "total_flos", 0) <ide> <ide> epochs_trained = self.global_step // num_update_steps_per_epoch <ide> steps_trained_in_current_epoch = self.global_step % (num_update_steps_per_epoch) <ide> <ide> logger.info(" Continuing training from checkpoint, will skip to saved global_step") <ide> logger.info(" Continuing training from epoch %d", epochs_trained) <ide> logger.info(" Continuing training from global step %d", self.global_step) <del> logger.info(" Continuing training from %d non-embedding floating-point operations", self.total_flos) <ide> logger.info(" Will skip the first %d steps in the first epoch", steps_trained_in_current_epoch) <ide> except ValueError: <ide> self.global_step = 0 <del> self.total_flos = 0 <ide> logger.info(" Starting fine-tuning.") <ide> <ide> tr_loss = torch.tensor(0.0).to(self.args.device) <add> self.total_flos = self.state.total_flos <ide> logging_loss_scalar = 0.0 <ide> model.zero_grad() <ide> disable_tqdm = self.args.disable_tqdm or not self.is_local_process_zero() <ide> def log(self, logs: Dict[str, float], iterator: Optional[tqdm] = None) -> None: <ide> else: <ide> total_flos = self.total_flos <ide> if total_flos > 0: <del> logs["total_flos"] = self.total_flos <add> logs["total_flos"] = total_flos <ide> if self.global_step is None: <ide> # when logging evaluation metrics without training <ide> self.global_step = 0 <ide> def store_flos(self): <ide> # Storing the number of floating-point operations that went into the model <ide> if self.total_flos is not None: <ide> if self.args.local_rank != -1: <del> total_flos = distributed_broadcast_scalars([self.total_flos]).sum().item() <add> self.state.total_flos = distributed_broadcast_scalars([self.total_flos]).sum().item() <ide> else: <del> total_flos = self.total_flos <del> if total_flos > 0: <del> self.model.config.total_flos = total_flos <add> self.state.total_flos = self.total_flos <ide> <ide> def _sorted_checkpoints(self, checkpoint_prefix=PREFIX_CHECKPOINT_DIR, use_mtime=False) -> List[str]: <ide> ordering_and_checkpoint_path = [] <ide> def prediction_loop( <ide> prediction_loss_only if prediction_loss_only is not None else self.args.prediction_loss_only <ide> ) <ide> <del> assert not getattr( <del> self.model.config, "output_attentions", False <del> ), "The prediction loop does not work with `output_attentions=True`." <del> assert not getattr( <del> self.model.config, "output_hidden_states", False <del> ), "The prediction loop does not work with `output_hidden_states=True`." <del> <ide> model = self.model <ide> # multi-gpu eval <ide> if self.args.n_gpu > 1: <ide><path>src/transformers/trainer_utils.py <ide> class TrainerState: <ide> A class containing the `Trainer` fields that will be saved along the model and optimizer. <ide> """ <ide> <add> total_flos: int = 0 <ide> best_metric: Optional[float] = None <ide> best_model_checkpoint: Optional[str] = None <ide>
2
Javascript
Javascript
fix incorrect use of err_invalid_arg_type
1d7414354e4cce9ebc48c4f7117170c746f12970
<ide><path>lib/assert.js <ide> function innerThrows(shouldThrow, block, expected, message) { <ide> if (typeof block !== 'function') { <ide> const errors = lazyErrors(); <ide> throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'block', 'function', <del> typeof block); <add> block); <ide> } <ide> <ide> if (typeof expected === 'string') { <ide><path>test/parallel/test-assert.js <ide> try { <ide> <ide> { <ide> // Verify that throws() and doesNotThrow() throw on non-function block <del> const validationFunction = common.expectsError({ <del> code: 'ERR_INVALID_ARG_TYPE', <del> type: TypeError <del> }); <add> function typeName(value) { <add> return value === null ? 'null' : typeof value; <add> } <ide> <ide> const testBlockTypeError = (method, block) => { <ide> let threw = true; <ide> try { <ide> method(block); <ide> threw = false; <ide> } catch (e) { <del> validationFunction(e); <add> common.expectsError({ <add> code: 'ERR_INVALID_ARG_TYPE', <add> type: TypeError, <add> message: 'The "block" argument must be of type function. Received ' + <add> 'type ' + typeName(block) <add> })(e); <ide> } <ide> <ide> assert.ok(threw);
2
Ruby
Ruby
add tests for `formulaauditor#audit_deps`
e0bb978cc93ab81ffeaa15656fe74384cf7982fc
<ide><path>Library/Homebrew/test/dev-cmd/audit_spec.rb <ide> class Foo < Formula <ide> end <ide> end <ide> <add> describe "#audit_deps" do <add> describe "a dependency on a macOS-provided keg-only formula" do <add> describe "which is whitelisted" do <add> let(:fa) do <add> formula_auditor "foo", <<-EOS.undent, new_formula: true <add> class Foo < Formula <add> url "http://example.com/foo-1.0.tgz" <add> homepage "http://example.com" <add> <add> depends_on "openssl" <add> end <add> EOS <add> end <add> <add> let(:f_openssl) do <add> formula do <add> url "http://example.com/openssl-1.0.tgz" <add> homepage "http://example.com" <add> <add> keg_only :provided_by_macos <add> end <add> end <add> <add> before do <add> allow(fa.formula.deps.first) <add> .to receive(:to_formula).and_return(f_openssl) <add> fa.audit_deps <add> end <add> <add> subject { fa } <add> <add> its(:problems) { are_expected.to be_empty } <add> end <add> <add> describe "which is not whitelisted" do <add> let(:fa) do <add> formula_auditor "foo", <<-EOS.undent, new_formula: true <add> class Foo < Formula <add> url "http://example.com/foo-1.0.tgz" <add> homepage "http://example.com" <add> <add> depends_on "bc" <add> end <add> EOS <add> end <add> <add> let(:f_bc) do <add> formula do <add> url "http://example.com/bc-1.0.tgz" <add> homepage "http://example.com" <add> <add> keg_only :provided_by_macos <add> end <add> end <add> <add> before do <add> allow(fa.formula.deps.first) <add> .to receive(:to_formula).and_return(f_bc) <add> fa.audit_deps <add> end <add> <add> subject { fa } <add> <add> its(:problems) { are_expected.to match([/unnecessary/]) } <add> end <add> end <add> end <add> <ide> describe "#audit_keg_only_style" do <ide> specify "keg_only_needs_downcasing" do <ide> fa = formula_auditor "foo", <<-EOS.undent, strict: true
1
Ruby
Ruby
apply suggestions from code review
4bde62b651a3d08543f54660871cafb0ae8c0da7
<ide><path>Library/Homebrew/cmd/upgrade.rb <ide> def upgrade_formula(f) <ide> end <ide> fi.prelude <ide> <del> if f.optlinked? <del> oh1 "Upgrading #{Formatter.identifier(f.full_specified_name)} #{Keg.new(f.opt_prefix).version} ->"\ <add> upgrade_version = if f.optlinked? <add> "#{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}" <ide> " #{f.pkg_version} #{fi.options.to_a.join " "}" <ide> else <del> oh1 "Upgrading #{Formatter.identifier(f.full_specified_name)} -> #{f.pkg_version} #{fi.options.to_a.join " "}" <add> "-> #{f.pkg_version}" <ide> end <add> oh1 "Upgrading #{Formatter.identifier(f.full_specified_name)} #{upgrade_version} #{fi.options.to_a.join(" ")}" <ide> <ide> # first we unlink the currently active keg for this formula otherwise it is <ide> # possible for the existing build to interfere with the build we are about to
1
Python
Python
add a test case for it
5f0d9f6f2636e138e90a1c86388f0952825133df
<ide><path>libcloud/test/compute/test_azure_arm.py <ide> def test_create_node(self): <ide> 'version': image.version <ide> }) <ide> <add> def test_create_node_storage_account_not_provided_and_not_ex_use_managed_disks(self): <add> location = NodeLocation('any_location', '', '', self.driver) <add> size = NodeSize('any_size', '', 0, 0, 0, 0, driver=self.driver) <add> image = AzureImage('1', '1', 'ubuntu', 'pub', location.id, self.driver) <add> auth = NodeAuthPassword('any_password') <add> <add> # ex_storage_account=None and ex_use_managed_disks=False should throw <add> expected_msg = "ex_use_managed_disks is False, must provide ex_storage_account" <add> self.assertRaisesRegex(ValueError, expected_msg, self.driver.create_node, <add> 'test-node-1', <add> size, <add> image, <add> auth, <add> location=location, <add> ex_resource_group='000000', <add> ex_storage_account=None, <add> ex_user_name='any_user', <add> ex_network='000000', <add> ex_subnet='000000', <add> ex_use_managed_disks=False <add> ) <add> <add> # ex_storage_account=None and ex_use_managed_disks=True, should not throw <add> node = self.driver.create_node( <add> 'test-node-1', <add> size, <add> image, <add> auth, <add> location=location, <add> ex_resource_group='000000', <add> ex_storage_account=None, <add> ex_user_name='any_user', <add> ex_network='000000', <add> ex_subnet='000000', <add> ex_use_managed_disks=True <add> ) <add> self.assertTrue(node) <add> <ide> def test_create_node_ex_disk_size(self): <ide> location = NodeLocation('any_location', '', '', self.driver) <ide> size = NodeSize('any_size', '', 0, 0, 0, 0, driver=self.driver)
1
Text
Text
add "affects" field to issue template
f9ba069b9de19bd5bca3466fdfba8eb5ec5d024c
<ide><path>.github/ISSUE_TEMPLATE.md <ide> <!-- <ide> !!! For Security Vulnerabilities, please go to https://pivotal.io/security !!! <add>--> <add>**Affects:** \<Spring Framework version> <ide> <add>--- <add><!-- <ide> Thanks for taking the time to create an issue. Please read the following: <ide> <ide> - Questions should be asked on Stack Overflow.
1
Python
Python
add pipeline - train
2d8559731acbf673fe3e31aaeb17412a342cff73
<ide><path>transformers/commands/train.py <add>import os <ide> from argparse import ArgumentParser, Namespace <del> <ide> from logging import getLogger <ide> <ide> from transformers.commands import BaseTransformersCLICommand <ide> raise ImportError("At least one of PyTorch or TensorFlow 2.0+ should be installed to use CLI training") <ide> <ide> # TF training parameters <del>BATCH_SIZE = 32 <del>EVAL_BATCH_SIZE = BATCH_SIZE * 2 <ide> USE_XLA = False <ide> USE_AMP = False <ide> <ide> def train_command_factory(args: Namespace): <ide> Factory function used to instantiate serving server from provided command line arguments. <ide> :return: ServeCommand <ide> """ <del> return TrainCommand(args.model) <add> return TrainCommand(args) <ide> <ide> <ide> class TrainCommand(BaseTransformersCLICommand): <ide> def register_subcommand(parser: ArgumentParser): <ide> """ <ide> train_parser = parser.add_parser('train', help='CLI tool to train a model on a task.') <ide> train_parser.add_argument('--train_data', type=str, required=True, <del> help='path to train (and optionally evaluation) dataset.') <add> help="path to train (and optionally evaluation) dataset as a csv with " <add> "tab separated labels and sentences.") <add> <add> train_parser.add_argument('--column_label', type=int, default=0, <add> help='Column of the dataset csv file with example labels.') <add> train_parser.add_argument('--column_text', type=int, default=1, <add> help='Column of the dataset csv file with example texts.') <add> train_parser.add_argument('--column_id', type=int, default=2, <add> help='Column of the dataset csv file with example ids.') <add> <add> train_parser.add_argument('--validation_data', type=str, default='', <add> help='path to validation dataset.') <add> train_parser.add_argument('--validation_split', type=float, default=0.1, <add> help="if validation dataset is not provided, fraction of train dataset " <add> "to use as validation dataset.") <add> <add> train_parser.add_argument('--output', type=str, default='./', <add> help='path to saved the trained model.') <add> <ide> train_parser.add_argument('--task', type=str, default='text_classification', <ide> help='Task to train the model on.') <ide> train_parser.add_argument('--model', type=str, default='bert-base-uncased', <ide> help='Model\'s name or path to stored model.') <del> train_parser.add_argument('--valid_data', type=str, default='', <del> help='path to validation dataset.') <del> train_parser.add_argument('--valid_data_ratio', type=float, default=0.1, <del> help="if validation dataset is not provided, fraction of train dataset " <del> "to use as validation dataset.") <add> train_parser.add_argument('--train_batch_size', type=int, default=32, <add> help='Batch size for training.') <add> train_parser.add_argument('--valid_batch_size', type=int, default=64, <add> help='Batch size for validation.') <add> train_parser.add_argument('--learning_rate', type=float, default=3e-5, <add> help="Learning rate.") <add> train_parser.add_argument('--adam_epsilon', type=float, default=1e-08, <add> help="Epsilon for Adam optimizer.") <ide> train_parser.set_defaults(func=train_command_factory) <ide> <del> def __init__(self, model_name: str, task: str, train_data: str, <del> valid_data: str, valid_data_ratio: float): <del> self._logger = getLogger('transformers-cli/training') <add> def __init__(self, args: Namespace): <add> self.logger = getLogger('transformers-cli/training') <ide> <del> self._framework = 'tf' if is_tf_available() else 'torch' <add> self.framework = 'tf' if is_tf_available() else 'torch' <ide> <del> self._logger.info('Loading model {}'.format(model_name)) <del> self._model_name = model_name <del> self._tokenizer = AutoTokenizer.from_pretrained(model_name) <del> if task == 'text_classification': <del> self._model = SequenceClassifModel.from_pretrained(model_name) <del> elif task == 'token_classification': <add> os.makedirs(args.output) <add> self.output = args.output <add> <add> self.column_label = args.column_label <add> self.column_text = args.column_text <add> self.column_id = args.column_id <add> <add> self.logger.info('Loading model {}'.format(args.model_name)) <add> self.model_name = args.model_name <add> self.tokenizer = AutoTokenizer.from_pretrained(args.model_name) <add> if args.task == 'text_classification': <add> self.model = SequenceClassifModel.from_pretrained(args.model_name) <add> elif args.task == 'token_classification': <ide> raise NotImplementedError <del> elif task == 'question_answering': <add> elif args.task == 'question_answering': <ide> raise NotImplementedError <ide> <del> dataset = SingleSentenceClassificationProcessor.create_from_csv(train_data) <del> num_data_samples = len(SingleSentenceClassificationProcessor) <del> if valid_data: <del> self._train_dataset = dataset <del> self._num_train_samples = num_data_samples <del> self._valid_dataset = SingleSentenceClassificationProcessor.create_from_csv(valid_data) <del> self._num_valid_samples = len(self._valid_dataset) <add> self.logger.info('Loading dataset from {}'.format(args.train_data)) <add> dataset = SingleSentenceClassificationProcessor.create_from_csv(args.train_data) <add> num_data_samples = len(dataset) <add> if args.validation_data: <add> self.logger.info('Loading validation dataset from {}'.format(args.validation_data)) <add> self.valid_dataset = SingleSentenceClassificationProcessor.create_from_csv(args.validation_data) <add> self.num_valid_samples = len(self.valid_dataset) <add> self.train_dataset = dataset <add> self.num_train_samples = num_data_samples <ide> else: <del> assert 0.0 < valid_data_ratio < 1.0, "--valid_data_ratio should be between 0.0 and 1.0" <del> self._num_valid_samples = num_data_samples * valid_data_ratio <del> self._num_train_samples = num_data_samples - self._num_valid_samples <del> self._train_dataset = dataset[self._num_train_samples] <del> self._valid_dataset = dataset[self._num_valid_samples] <add> assert 0.0 < args.validation_split < 1.0, "--validation_split should be between 0.0 and 1.0" <add> self.num_valid_samples = num_data_samples * args.validation_split <add> self.num_train_samples = num_data_samples - self.num_valid_samples <add> self.train_dataset = dataset[self.num_train_samples] <add> self.valid_dataset = dataset[self.num_valid_samples] <add> <add> self.train_batch_size = args.train_batch_size <add> self.valid_batch_size = args.valid_batch_size <add> self.learning_rate = args.learning_rate <add> self.adam_epsilon = args.adam_epsilon <ide> <ide> def run(self): <del> if self._framework == 'tf': <add> if self.framework == 'tf': <ide> return self.run_tf() <ide> return self.run_torch() <ide> <ide> def run_tf(self): <ide> tf.config.optimizer.set_experimental_options({"auto_mixed_precision": USE_AMP}) <ide> <ide> # Prepare dataset as a tf.train_data.Dataset instance <del> train_dataset = convert_examples_to_features(self._train_dataset, self._tokenizer, mode='sequence_classification') <del> valid_dataset = convert_examples_to_features(self._valid_dataset, self._tokenizer, mode='sequence_classification') <del> train_dataset = train_dataset.shuffle(128).batch(BATCH_SIZE).repeat(-1) <del> valid_dataset = valid_dataset.batch(EVAL_BATCH_SIZE) <add> self.logger.info('Tokenizing and processing dataset') <add> train_dataset = self.train_dataset.get_features(self.tokenizer) <add> valid_dataset = self.valid_dataset.get_features(self.tokenizer) <add> train_dataset = train_dataset.shuffle(128).batch(self.train_batch_size).repeat(-1) <add> valid_dataset = valid_dataset.batch(self.valid_batch_size) <ide> <ide> # Prepare training: Compile tf.keras model with optimizer, loss and learning rate schedule <del> opt = tf.keras.optimizers.Adam(learning_rate=3e-5, epsilon=1e-08) <add> opt = tf.keras.optimizers.Adam(learning_rate=args.learning_rate, epsilon=self.adam_epsilon) <ide> if USE_AMP: <ide> # loss scaling is currently required when using mixed precision <ide> opt = tf.keras.mixed_precision.experimental.LossScaleOptimizer(opt, 'dynamic') <ide> loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True) <ide> metric = tf.keras.metrics.SparseCategoricalAccuracy('accuracy') <del> model.compile(optimizer=opt, loss=loss, metrics=[metric]) <add> self.model.compile(optimizer=opt, loss=loss, metrics=[metric]) <ide> <ide> # Train and evaluate using tf.keras.Model.fit() <del> train_steps = train_examples//BATCH_SIZE <del> valid_steps = valid_examples//EVAL_BATCH_SIZE <add> train_steps = self.num_train_samples//self.train_batch_size <add> valid_steps = self.num_valid_samples//self.valid_batch_size <ide> <del> history = model.fit(train_dataset, epochs=2, steps_per_epoch=train_steps, <del> validation_data=valid_dataset, validation_steps=valid_steps) <add> self.logger.info('Training model') <add> history = self.model.fit(train_dataset, epochs=2, steps_per_epoch=train_steps, <add> validation_data=valid_dataset, validation_steps=valid_steps) <ide> <del> # Save TF2 model <del> os.makedirs('./save/', exist_ok=True) <del> model.save_pretrained('./save/') <add> # Save trained model <add> self.model.save_pretrained(self.output) <ide><path>transformers/data/processors/utils.py <ide> import sys <ide> import copy <ide> import json <add>import logging <add> <add>from ...file_utils import is_tf_available, is_torch_available <add> <add>logger = logging.getLogger(__name__) <ide> <ide> class InputExample(object): <ide> """ <ide> class InputFeatures(object): <ide> label: Label corresponding to the input <ide> """ <ide> <del> def __init__(self, input_ids, attention_mask, token_type_ids, label): <add> def __init__(self, input_ids, attention_mask=None, token_type_ids=None, label=None): <ide> self.input_ids = input_ids <ide> self.attention_mask = attention_mask <ide> self.token_type_ids = token_type_ids <ide> def to_json_string(self): <ide> class DataProcessor(object): <ide> """Base class for data converters for sequence classification data sets.""" <ide> <del> def get_example_from_tensor_dict(self, tensor_dict): <del> """Gets an example from a dict with tensorflow tensors <del> <del> Args: <del> tensor_dict: Keys and values should match the corresponding Glue <del> tensorflow_dataset examples. <del> """ <del> raise NotImplementedError() <del> <del> def get_train_examples(self, data_dir): <del> """Gets a collection of `InputExample`s for the train set.""" <del> raise NotImplementedError() <del> <del> def get_dev_examples(self, data_dir): <del> """Gets a collection of `InputExample`s for the dev set.""" <del> raise NotImplementedError() <del> <del> def get_labels(self): <del> """Gets the list of labels for this data set.""" <del> raise NotImplementedError() <del> <del> def tfds_map(self, example): <del> """Some tensorflow_datasets datasets are not formatted the same way the GLUE datasets are. <del> This method converts examples to the correct format.""" <del> if len(self.get_labels()) > 1: <del> example.label = self.get_labels()[int(example.label)] <del> return example <del> <ide> @classmethod <ide> def _read_tsv(cls, input_file, quotechar=None): <ide> """Reads a tab separated value file.""" <ide> def _read_tsv(cls, input_file, quotechar=None): <ide> <ide> class SingleSentenceClassificationProcessor(DataProcessor): <ide> """ Generic processor for a single sentence classification data set.""" <del> def __init__(self, labels=None, examples=None): <add> def __init__(self, labels=None, examples=None, mode='classification', verbose=False): <ide> self.labels = [] if labels is None else labels <ide> self.examples = [] if examples is None else examples <del> <del> @classmethod <del> def create_from_csv(cls, file_name): <del> processor = cls() <del> processor.add_examples_from_csv(file_name) <del> return processor <add> self.mode = mode <add> self.verbose = verbose <ide> <ide> def __len__(self): <ide> return len(self.examples) <ide> def __getitem__(self, idx): <ide> examples=self.examples[idx]) <ide> return self.examples[idx] <ide> <del> def get_labels(self): <del> """Gets the list of labels for this data set.""" <del> return self.labels <add> @classmethod <add> def create_from_csv(cls, file_name, **kwargs): <add> processor = cls(**kwargs) <add> processor.add_examples_from_csv(file_name) <add> return processor <ide> <del> def add_examples_from_csv(self, file_name): <add> def add_examples_from_csv(self, file_name, split_name='', column_label=0, column_text=1, column_id=None, <add> overwrite_labels=False, overwrite_examples=False): <ide> lines = self._read_tsv(file_name) <del> self.add_examples_from_lines(lines) <del> <del> def add_examples_from_lines(self, lines, split_name='', overwrite_labels=False, overwrite_examples=False): <del> """Creates examples for the training and dev sets.""" <del> added_labels = set() <del> examples = [] <add> texts = [] <add> labels = [] <add> ids = [] <ide> for (i, line) in enumerate(lines): <del> if len(line) > 2: <del> guid = "%s-%s" % (split_name, line[0]) if split_name else line[0] <del> label = line[1] <del> text_a = line[2] <add> texts.append(line[column_text]) <add> labels.append(line[column_label]) <add> if column_id is not None: <add> ids.append(line[column_id]) <ide> else: <ide> guid = "%s-%s" % (split_name, i) if split_name else "%s" % i <del> label = line[0] <del> text_a = line[1] <add> ids.append(guid) <add> <add> return self.add_examples(texts, labels, ids, overwrite_labels=overwrite_labels, overwrite_examples=overwrite_examples) <add> <add> def add_examples(self, texts, labels, ids=None, overwrite_labels=False, overwrite_examples=False): <add> if ids is None: <add> ids = [None] * len(texts) <add> assert len(texts) == len(labels) <add> assert len(texts) == len(ids) <ide> <add> examples = [] <add> added_labels = set() <add> for (text, label, guid) in zip(texts, labels, ids): <ide> added_labels.add(label) <del> examples.append(InputExample(guid=guid, text_a=text_a, text_b=None, label=label)) <add> examples.append(InputExample(guid=guid, text_a=text, text_b=None, label=label)) <ide> <ide> # Update examples <ide> if overwrite_examples: <ide> def add_examples_from_lines(self, lines, split_name='', overwrite_labels=False, <ide> <ide> return self.examples <ide> <add> @classmethod <add> def create_from_examples(cls, texts, labels, **kwargs): <add> processor = cls(**kwargs) <add> processor.add_examples(texts, labels) <add> return processor <ide> <del>def convert_examples_to_features(examples, tokenizer, <del> mode='sequence_classification', <del> max_length=512, <del> pad_on_left=False, <del> pad_token=0, <del> pad_token_segment_id=0, <del> mask_padding_with_zero=True): <del> """ <del> Loads a data file into a list of ``InputFeatures`` <add> def get_features(self, <add> tokenizer, <add> max_length=None, <add> pad_on_left=False, <add> pad_token=0, <add> mask_padding_with_zero=True, <add> return_tensors=None): <add> """ <add> Convert examples in a list of ``InputFeatures`` <ide> <del> Args: <del> examples: List of ``InputExamples`` or ``tf.data.Dataset`` containing the examples. <del> tokenizer: Instance of a tokenizer that will tokenize the examples <del> max_length: Maximum example length <del> task: GLUE task <del> label_list: List of labels. Can be obtained from the processor using the ``processor.get_labels()`` method <del> output_mode: String indicating the output mode. Either ``regression`` or ``classification`` <del> pad_on_left: If set to ``True``, the examples will be padded on the left rather than on the right (default) <del> pad_token: Padding token <del> pad_token_segment_id: The segment ID for the padding token (It is usually 0, but can vary such as for XLNet where it is 4) <del> mask_padding_with_zero: If set to ``True``, the attention mask will be filled by ``1`` for actual values <del> and by ``0`` for padded values. If set to ``False``, inverts it (``1`` for padded values, ``0`` for <del> actual values) <del> <del> Returns: <del> If the ``examples`` input is a ``tf.data.Dataset``, will return a ``tf.data.Dataset`` <del> containing the task-specific features. If the input is a list of ``InputExamples``, will return <del> a list of task-specific ``InputFeatures`` which can be fed to the model. <add> Args: <add> tokenizer: Instance of a tokenizer that will tokenize the examples <add> max_length: Maximum example length <add> task: GLUE task <add> label_list: List of labels. Can be obtained from the processor using the ``processor.get_labels()`` method <add> output_mode: String indicating the output mode. Either ``regression`` or ``classification`` <add> pad_on_left: If set to ``True``, the examples will be padded on the left rather than on the right (default) <add> pad_token: Padding token <add> mask_padding_with_zero: If set to ``True``, the attention mask will be filled by ``1`` for actual values <add> and by ``0`` for padded values. If set to ``False``, inverts it (``1`` for padded values, ``0`` for <add> actual values) <add> <add> Returns: <add> If the ``examples`` input is a ``tf.data.Dataset``, will return a ``tf.data.Dataset`` <add> containing the task-specific features. If the input is a list of ``InputExamples``, will return <add> a list of task-specific ``InputFeatures`` which can be fed to the model. <ide> <del> """ <del> is_tf_dataset = False <del> if is_tf_available() and isinstance(examples, tf.data.Dataset): <del> is_tf_dataset = True <del> <del> if task is not None: <del> processor = glue_processors[task]() <del> if label_list is None: <del> label_list = processor.get_labels() <del> logger.info("Using label list %s for task %s" % (label_list, task)) <del> if output_mode is None: <del> output_mode = glue_output_modes[task] <del> logger.info("Using output mode %s for task %s" % (output_mode, task)) <del> <del> label_map = {label: i for i, label in enumerate(label_list)} <del> <del> features = [] <del> for (ex_index, example) in enumerate(examples): <del> if ex_index % 10000 == 0: <del> logger.info("Writing example %d" % (ex_index)) <del> if is_tf_dataset: <del> example = processor.get_example_from_tensor_dict(example) <del> <del> inputs = tokenizer.encode_plus( <del> example.text_a, <del> example.text_b, <del> add_special_tokens=True, <del> max_length=max_length, <del> ) <del> input_ids, token_type_ids = inputs["input_ids"], inputs["token_type_ids"] <del> <del> # The mask has 1 for real tokens and 0 for padding tokens. Only real <del> # tokens are attended to. <del> attention_mask = [1 if mask_padding_with_zero else 0] * len(input_ids) <del> <del> # Zero-pad up to the sequence length. <del> padding_length = max_length - len(input_ids) <del> if pad_on_left: <del> input_ids = ([pad_token] * padding_length) + input_ids <del> attention_mask = ([0 if mask_padding_with_zero else 1] * padding_length) + attention_mask <del> token_type_ids = ([pad_token_segment_id] * padding_length) + token_type_ids <del> else: <del> input_ids = input_ids + ([pad_token] * padding_length) <del> attention_mask = attention_mask + ([0 if mask_padding_with_zero else 1] * padding_length) <del> token_type_ids = token_type_ids + ([pad_token_segment_id] * padding_length) <del> <del> assert len(input_ids) == max_length, "Error with input length {} vs {}".format(len(input_ids), max_length) <del> assert len(attention_mask) == max_length, "Error with input length {} vs {}".format(len(attention_mask), max_length) <del> assert len(token_type_ids) == max_length, "Error with input length {} vs {}".format(len(token_type_ids), max_length) <del> <del> if output_mode == "classification": <del> label = label_map[example.label] <del> elif output_mode == "regression": <del> label = float(example.label) <add> """ <add> <add> label_map = {label: i for i, label in enumerate(self.labels)} <add> <add> all_input_ids = [] <add> for (ex_index, example) in enumerate(self.examples): <add> if ex_index % 10000 == 0: <add> logger.info("Tokenizing example %d", ex_index) <add> <add> input_ids = tokenizer.encode( <add> example.text_a, <add> add_special_tokens=True, <add> max_length=min(max_length, tokenizer.max_len), <add> ) <add> all_input_ids.append(input_ids) <add> <add> batch_length = max(len(input_ids) for input_ids in all_input_ids) <add> <add> features = [] <add> for (ex_index, (input_ids, example)) in enumerate(zip(all_input_ids, examples)): <add> if ex_index % 10000 == 0: <add> logger.info("Writing example %d", ex_index) <add> # The mask has 1 for real tokens and 0 for padding tokens. Only real <add> # tokens are attended to. <add> attention_mask = [1 if mask_padding_with_zero else 0] * len(input_ids) <add> <add> # Zero-pad up to the sequence length. <add> padding_length = batch_length - len(input_ids) <add> if pad_on_left: <add> input_ids = ([pad_token] * padding_length) + input_ids <add> attention_mask = ([0 if mask_padding_with_zero else 1] * padding_length) + attention_mask <add> else: <add> input_ids = input_ids + ([pad_token] * padding_length) <add> attention_mask = attention_mask + ([0 if mask_padding_with_zero else 1] * padding_length) <add> <add> assert len(input_ids) == batch_length, "Error with input length {} vs {}".format(len(input_ids), batch_length) <add> assert len(attention_mask) == batch_length, "Error with input length {} vs {}".format(len(attention_mask), batch_length) <add> <add> if self.mode == "classification": <add> label = label_map[example.label] <add> elif self.mode == "regression": <add> label = float(example.label) <add> else: <add> raise ValueError(self.mode) <add> <add> if ex_index < 5 and self.verbose: <add> logger.info("*** Example ***") <add> logger.info("guid: %s" % (example.guid)) <add> logger.info("input_ids: %s" % " ".join([str(x) for x in input_ids])) <add> logger.info("attention_mask: %s" % " ".join([str(x) for x in attention_mask])) <add> logger.info("label: %s (id = %d)" % (example.label, label)) <add> <add> features.append( <add> InputFeatures(input_ids=input_ids, <add> attention_mask=attention_mask, <add> label=label)) <add> <add> if return_tensors is None: <add> return features <add> elif return_tensors == 'tf': <add> if not is_tf_available(): <add> raise ImportError("return_tensors set to 'tf' but TensorFlow 2.0 can't be imported") <add> import tensorflow as tf <add> def gen(): <add> for ex in features: <add> yield ({'input_ids': ex.input_ids, <add> 'attention_mask': ex.attention_mask}, <add> ex.label) <add> <add> dataset = tf.data.Dataset.from_generator(gen, <add> ({'input_ids': tf.int32, <add> 'attention_mask': tf.int32}, <add> tf.int64), <add> ({'input_ids': tf.TensorShape([None]), <add> 'attention_mask': tf.TensorShape([None])}, <add> tf.TensorShape([]))) <add> return dataset <add> elif return_tensors == 'pt': <add> if not is_torch_available(): <add> raise ImportError("return_tensors set to 'pt' but PyTorch can't be imported") <add> import torch <add> from torch.utils.data import TensorDataset <add> all_input_ids = torch.tensor([f.input_ids for f in features], dtype=torch.long) <add> all_attention_mask = torch.tensor([f.attention_mask for f in features], dtype=torch.long) <add> if self.mode == "classification": <add> all_labels = torch.tensor([f.label for f in features], dtype=torch.long) <add> elif self.mode == "regression": <add> all_labels = torch.tensor([f.label for f in features], dtype=torch.float) <add> <add> dataset = TensorDataset(all_input_ids, all_attention_mask, all_labels) <add> return dataset <ide> else: <del> raise KeyError(output_mode) <del> <del> if ex_index < 5: <del> logger.info("*** Example ***") <del> logger.info("guid: %s" % (example.guid)) <del> logger.info("input_ids: %s" % " ".join([str(x) for x in input_ids])) <del> logger.info("attention_mask: %s" % " ".join([str(x) for x in attention_mask])) <del> logger.info("token_type_ids: %s" % " ".join([str(x) for x in token_type_ids])) <del> logger.info("label: %s (id = %d)" % (example.label, label)) <del> <del> features.append( <del> InputFeatures(input_ids=input_ids, <del> attention_mask=attention_mask, <del> token_type_ids=token_type_ids, <del> label=label)) <del> <del> if is_tf_available() and is_tf_dataset: <del> def gen(): <del> for ex in features: <del> yield ({'input_ids': ex.input_ids, <del> 'attention_mask': ex.attention_mask, <del> 'token_type_ids': ex.token_type_ids}, <del> ex.label) <del> <del> return tf.data.Dataset.from_generator(gen, <del> ({'input_ids': tf.int32, <del> 'attention_mask': tf.int32, <del> 'token_type_ids': tf.int32}, <del> tf.int64), <del> ({'input_ids': tf.TensorShape([None]), <del> 'attention_mask': tf.TensorShape([None]), <del> 'token_type_ids': tf.TensorShape([None])}, <del> tf.TensorShape([]))) <del> <del> return features <add> raise ValueError("return_tensors should be one of 'tf' or 'pt'") <ide><path>transformers/pipeline.py <add># coding=utf-8 <add># Copyright 2018 The HuggingFace Inc. team. <add># <add># Licensed under the Apache License, Version 2.0 (the "License"); <add># you may not use this file except in compliance with the License. <add># You may obtain a copy of the License at <add># <add># http://www.apache.org/licenses/LICENSE-2.0 <add># <add># Unless required by applicable law or agreed to in writing, software <add># distributed under the License is distributed on an "AS IS" BASIS, <add># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <add># See the License for the specific language governing permissions and <add># limitations under the License. <add>""" Pipeline class: Tokenizer + Model. """ <add> <add>from __future__ import absolute_import, division, print_function, unicode_literals <add>import os <add>import logging <add> <add>from .modeling_auto import (AutoModel, AutoModelForQuestionAnswering, <add> AutoModelForSequenceClassification, <add> AutoModelWithLMHead) <add>from .tokenization_auto import AutoTokenizer <add>from .file_utils import add_start_docstrings, is_tf_available, is_torch_available <add>from .data.processors import SingleSentenceClassificationProcessor <add> <add>if is_tf_available(): <add> import tensorflow as tf <add>if is_torch_available(): <add> import torch <add> <add>logger = logging.getLogger(__name__) <add> <add># TF training parameters <add>USE_XLA = False <add>USE_AMP = False <add> <add>class TextClassificationPipeline(object): <add> r""" <add> :class:`~transformers.TextClassificationPipeline` is a class encapsulating a pretrained model and <add> its tokenizer and will be instantiated as one of the base model classes of the library <add> when created with the `Pipeline.from_pretrained(pretrained_model_name_or_path)` <add> class method. <add> <add> The `from_pretrained()` method takes care of returning the correct model class instance <add> using pattern matching on the `pretrained_model_name_or_path` string. <add> <add> The base model class to instantiate is selected as the first pattern matching <add> in the `pretrained_model_name_or_path` string (in the following order): <add> - contains `distilbert`: DistilBertModel (DistilBERT model) <add> - contains `roberta`: RobertaModel (RoBERTa model) <add> - contains `bert`: BertModel (Bert model) <add> - contains `openai-gpt`: OpenAIGPTModel (OpenAI GPT model) <add> - contains `gpt2`: GPT2Model (OpenAI GPT-2 model) <add> - contains `ctrl`: CTRLModel (Salesforce CTRL model) <add> - contains `transfo-xl`: TransfoXLModel (Transformer-XL model) <add> - contains `xlnet`: XLNetModel (XLNet model) <add> - contains `xlm`: XLMModel (XLM model) <add> """ <add> def __init__(self, tokenizer, model): <add> self.tokenizer = tokenizer <add> self.model = model <add> if is_tf_available(): <add> self.framework = 'tf' <add> elif is_torch_available(): <add> self.framework = 'pt' <add> else: <add> raise ImportError("At least one of PyTorch or TensorFlow 2.0+ should be installed to use CLI training") <add> self.is_compiled = False <add> <add> <add> @classmethod <add> def from_pretrained(cls, pretrained_model_name_or_path, **kwargs): <add> r""" Instantiates one of the base model classes of the library <add> from a pre-trained model configuration. <add> <add> The model class to instantiate is selected as the first pattern matching <add> in the `pretrained_model_name_or_path` string (in the following order): <add> - contains `distilbert`: DistilBertModel (DistilBERT model) <add> - contains `roberta`: RobertaModel (RoBERTa model) <add> - contains `bert`: BertModel (Bert model) <add> - contains `openai-gpt`: OpenAIGPTModel (OpenAI GPT model) <add> - contains `gpt2`: GPT2Model (OpenAI GPT-2 model) <add> - contains `ctrl`: CTRLModel (Salesforce CTRL model) <add> - contains `transfo-xl`: TransfoXLModel (Transformer-XL model) <add> - contains `xlnet`: XLNetModel (XLNet model) <add> - contains `xlm`: XLMModel (XLM model) <add> <add> The model is set in evaluation mode by default using `model.eval()` (Dropout modules are deactivated) <add> To train the model, you should first set it back in training mode with `model.train()` <add> <add> Params: <add> pretrained_model_name_or_path: either: <add> <add> - a string with the `shortcut name` of a pre-trained model to load from cache or download, e.g.: ``bert-base-uncased``. <add> - a path to a `directory` containing model weights saved using :func:`~transformers.PreTrainedModel.save_pretrained`, e.g.: ``./my_model_directory/``. <add> - a path or url to a `tensorflow index checkpoint file` (e.g. `./tf_model/model.ckpt.index`). In this case, ``from_tf`` should be set to True and a configuration object should be provided as ``config`` argument. This loading path is slower than converting the TensorFlow checkpoint in a PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards. <add> <add> config: (`optional`) instance of a class derived from :class:`~transformers.PretrainedConfig`: <add> Configuration for the model to use instead of an automatically loaded configuation. Configuration can be automatically loaded when: <add> <add> - the model is a model provided by the library (loaded with the ``shortcut-name`` string of a pretrained model), or <add> - the model was saved using :func:`~transformers.PreTrainedModel.save_pretrained` and is reloaded by suppling the save directory. <add> - the model is loaded by suppling a local directory as ``pretrained_model_name_or_path`` and a configuration JSON file named `config.json` is found in the directory. <add> <add> state_dict: (`optional`) dict: <add> an optional state dictionnary for the model to use instead of a state dictionary loaded from saved weights file. <add> This option can be used if you want to create a model from a pretrained configuration but load your own weights. <add> In this case though, you should check if using :func:`~transformers.PreTrainedModel.save_pretrained` and :func:`~transformers.PreTrainedModel.from_pretrained` is not a simpler option. <add> <add> cache_dir: (`optional`) string: <add> Path to a directory in which a downloaded pre-trained model <add> configuration should be cached if the standard cache should not be used. <add> <add> force_download: (`optional`) boolean, default False: <add> Force to (re-)download the model weights and configuration files and override the cached versions if they exists. <add> <add> proxies: (`optional`) dict, default None: <add> A dictionary of proxy servers to use by protocol or endpoint, e.g.: {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. <add> The proxies are used on each request. <add> <add> output_loading_info: (`optional`) boolean: <add> Set to ``True`` to also return a dictionnary containing missing keys, unexpected keys and error messages. <add> <add> kwargs: (`optional`) Remaining dictionary of keyword arguments: <add> Can be used to update the configuration object (after it being loaded) and initiate the model. (e.g. ``output_attention=True``). Behave differently depending on whether a `config` is provided or automatically loaded: <add> <add> - If a configuration is provided with ``config``, ``**kwargs`` will be directly passed to the underlying model's ``__init__`` method (we assume all relevant updates to the configuration have already been done) <add> - If a configuration is not provided, ``kwargs`` will be first passed to the configuration class initialization function (:func:`~transformers.PretrainedConfig.from_pretrained`). Each key of ``kwargs`` that corresponds to a configuration attribute will be used to override said attribute with the supplied ``kwargs`` value. Remaining keys that do not correspond to any configuration attribute will be passed to the underlying model's ``__init__`` function. <add> <add> Examples:: <add> <add> model = AutoModel.from_pretrained('bert-base-uncased') # Download model and configuration from S3 and cache. <add> model = AutoModel.from_pretrained('./test/bert_model/') # E.g. model was saved using `save_pretrained('./test/saved_model/')` <add> model = AutoModel.from_pretrained('bert-base-uncased', output_attention=True) # Update configuration during loading <add> assert model.config.output_attention == True <add> # Loading from a TF checkpoint file instead of a PyTorch model (slower) <add> config = AutoConfig.from_json_file('./tf_model/bert_tf_model_config.json') <add> model = AutoModel.from_pretrained('./tf_model/bert_tf_checkpoint.ckpt.index', from_tf=True, config=config) <add> <add> """ <add> # Extract tokenizer and model arguments <add> tokenizer_kwargs = {} <add> for key in kwargs: <add> if key.startswith('tokenizer_'): <add> # Specific to the tokenizer <add> tokenizer_kwargs[key.replace('tokenizer_', '')] = kwargs.pop(key) <add> elif not key.startswith('model_'): <add> # used for both the tokenizer and the model <add> tokenizer_kwargs[key] = kwargs[key] <add> <add> model_kwargs = {} <add> for key in kwargs: <add> if key.startswith('model_'): <add> # Specific to the model <add> model_kwargs[key.replace('model_', '')] = kwargs.pop(key) <add> elif not key.startswith('tokenizer_'): <add> # used for both the tokenizer and the model <add> model_kwargs[key] = kwargs[key] <add> <add> tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path, **tokenizer_kwargs) <add> model = AutoModelForSequenceClassification.from_pretrained(pretrained_model_name_or_path, **model_kwargs) <add> return cls(tokenizer, model) <add> <add> <add> def save_pretrained(self, save_directory): <add> if not os.path.isdir(save_directory): <add> logger.error("Saving directory ({}) should be a directory".format(save_directory)) <add> return <add> self.model.save_pretrained(save_directory) <add> self.tokenizer.save_pretrained(save_directory) <add> <add> <add> def compile(self, learning_rate=3e-5, epsilon=1e-8): <add> if self.framework == 'tf': <add> logger.info('Preparing model') <add> # Prepare training: Compile tf.keras model with optimizer, loss and learning rate schedule <add> opt = tf.keras.optimizers.Adam(learning_rate=learning_rate, epsilon=epsilon) <add> if USE_AMP: <add> # loss scaling is currently required when using mixed precision <add> opt = tf.keras.mixed_precision.experimental.LossScaleOptimizer(opt, 'dynamic') <add> loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True) <add> metric = tf.keras.metrics.SparseCategoricalAccuracy('accuracy') <add> self.model.compile(optimizer=opt, loss=loss, metrics=[metric]) <add> else: <add> raise NotImplementedError <add> self.is_compiled = True <add> <add> <add> def prepare_data(self, train_samples_text, train_samples_labels, <add> valid_samples_text=None, valid_samples_labels=None, <add> validation_split=0.1): <add> dataset = SingleSentenceClassificationProcessor.create_from_examples(train_samples_text, <add> train_samples_labels) <add> num_data_samples = len(dataset) <add> if valid_samples_text is not None and valid_samples_labels is not None: <add> valid_dataset = SingleSentenceClassificationProcessor.create_from_examples(valid_samples_text, <add> valid_samples_labels) <add> num_valid_samples = len(valid_dataset) <add> train_dataset = dataset <add> num_train_samples = num_data_samples <add> else: <add> assert 0.0 < validation_split < 1.0, "validation_split should be between 0.0 and 1.0" <add> num_valid_samples = int(num_data_samples * validation_split) <add> num_train_samples = num_data_samples - num_valid_samples <add> train_dataset = dataset[num_train_samples] <add> valid_dataset = dataset[num_valid_samples] <add> <add> logger.info('Tokenizing and processing dataset') <add> train_dataset = train_dataset.get_features(self.tokenizer, return_tensors=self.framework) <add> valid_dataset = valid_dataset.get_features(self.tokenizer, return_tensors=self.framework) <add> return train_dataset, valid_dataset, num_train_samples, num_valid_samples <add> <add> <add> def fit(self, train_samples_text, train_samples_labels, <add> valid_samples_text=None, valid_samples_labels=None, <add> train_batch_size=None, valid_batch_size=None, <add> validation_split=0.1, <add> **kwargs): <add> <add> if not self.is_compiled: <add> self.compile() <add> <add> datasets = self.prepare_data(train_samples_text, train_samples_labels, <add> valid_samples_text, valid_samples_labels, <add> validation_split) <add> train_dataset, valid_dataset, num_train_samples, num_valid_samples = datasets <add> <add> train_steps = num_train_samples//train_batch_size <add> valid_steps = num_valid_samples//valid_batch_size <add> <add> if self.framework == 'tf': <add> # Prepare dataset as a tf.train_data.Dataset instance <add> train_dataset = train_dataset.shuffle(128).batch(train_batch_size).repeat(-1) <add> valid_dataset = valid_dataset.batch(valid_batch_size) <add> <add> logger.info('Training TF 2.0 model') <add> history = self.model.fit(train_dataset, epochs=2, steps_per_epoch=train_steps, <add> validation_data=valid_dataset, validation_steps=valid_steps, **kwargs) <add> else: <add> raise NotImplementedError <add> <add> <add> def __call__(self, text): <add> inputs = self.tokenizer.encode_plus(text, add_special_tokens=True, return_tensors=self.framework) <add> if self.framework == 'tf': <add> # TODO trace model <add> predictions = self.model(**inputs)[0] <add> else: <add> with torch.no_grad(): <add> predictions = self.model(**inputs)[0] <add> <add> return predictions.numpy().tolist()
3
Javascript
Javascript
remove extra loop (?)
1c7c38c82af1c4d9985c3dd1e2b1a4d996bd6f66
<ide><path>packages/react-dom/src/client/ReactDOMComponentTree.js <ide> export function getClosestInstanceFromNode(node) { <ide> return node[internalInstanceKey]; <ide> } <ide> <del> // Walk up the tree until we find an ancestor whose instance we have cached. <del> let parents = []; <ide> while (!node[internalInstanceKey]) { <del> parents.push(node); <ide> if (node.parentNode) { <ide> node = node.parentNode; <ide> } else { <ide> export function getClosestInstanceFromNode(node) { <ide> } <ide> } <ide> <del> let closest; <ide> let inst = node[internalInstanceKey]; <ide> if (inst.tag === HostComponent || inst.tag === HostText) { <ide> // In Fiber, this will always be the deepest root. <ide> return inst; <ide> } <del> for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) { <del> closest = inst; <del> } <ide> <del> return closest; <add> return null; <ide> } <ide> <ide> /**
1
Javascript
Javascript
simplify regex expression
2c1a8c85d22651acf584b95b4533f1b9fa264c7b
<ide><path>lib/repl.js <ide> function _memory(cmd) { <ide> if (cmd) { <ide> // Going down is { and ( e.g. function() { <ide> // going up is } and ) <del> var dw = cmd.match(/{|\(/g); <del> var up = cmd.match(/}|\)/g); <add> let dw = cmd.match(/[{(]/g); <add> let up = cmd.match(/[})]/g); <ide> up = up ? up.length : 0; <ide> dw = dw ? dw.length : 0; <ide> var depth = dw - up;
1
Javascript
Javascript
add title to "ask for help" forum requests
e3fe5d0a9b6adaf20d8d4677059f6dcc28688ea5
<ide><path>client/src/templates/Challenges/redux/create-question-epic.js <ide> import dedent from 'dedent'; <ide> import i18next from 'i18next'; <ide> import { ofType } from 'redux-observable'; <ide> import { tap, mapTo } from 'rxjs/operators'; <add>import { nanoid } from 'nanoid'; <ide> import envData from '../../../../../config/env.json'; <ide> import { <ide> closeModal, <ide> function createQuestionEpic(action$, state$, { window }) { <ide> tap(() => { <ide> const state = state$.value; <ide> const challengeFiles = challengeFilesSelector(state); <del> const { title: challengeTitle, helpCategory } = <del> challengeMetaSelector(state); <add> const { <add> title: challengeTitle, <add> superBlock, <add> block, <add> helpCategory <add> } = challengeMetaSelector(state); <ide> const { <ide> navigator: { userAgent }, <ide> location: { pathname, origin } <ide> function createQuestionEpic(action$, state$, { window }) { <ide> `${i18next.t('forum-help.browser-info')}\n\n${i18next.t( <ide> 'forum-help.user-agent', <ide> { userAgent } <del> )}\n\n${i18next.t( <del> 'forum-help.challenge' <del> )} ${challengeTitle}\n\n${i18next.t( <add> )}\n\n${i18next.t('forum-help.challenge')} ${i18next.t( <add> `intro:${superBlock}.blocks.${block}.title` <add> )} - ${challengeTitle}\n\n${i18next.t( <ide> 'forum-help.challenge-link' <ide> )}\n${challengeUrl}` <ide> ); <ide> function createQuestionEpic(action$, state$, { window }) { <ide> )}\n${i18next.t('forum-help.add-code-three')}\n\n\`\`\`\n${endingText}` <ide> ); <ide> <add> const titleText = dedent( <add> `${i18next.t( <add> `intro:${superBlock}.blocks.${block}.title` <add> )} - ${challengeTitle} - ${nanoid()}` <add> ); <add> <ide> const category = window.encodeURIComponent( <ide> i18next.t('links:help.' + helpCategory || 'Help') <ide> ); <ide> <ide> const studentCode = window.encodeURIComponent(textMessage); <ide> const altStudentCode = window.encodeURIComponent(altTextMessage); <ide> <del> const baseURI = `${forumLocation}/new-topic?category=${category}&title=&body=`; <add> const baseURI = `${forumLocation}/new-topic?category=${category}&title=${titleText}&body=`; <ide> const defaultURI = `${baseURI}${studentCode}`; <ide> const altURI = `${baseURI}${altStudentCode}`; <ide>
1
Python
Python
move schedule.step after optimizer.step
36362cf08637dea5aa00f209067e9c17b0bb2a69
<ide><path>examples/single_model_scripts/run_multiple_choice.py <ide> def train(args, train_dataset, model, tokenizer): <ide> <ide> tr_loss += loss.item() <ide> if (step + 1) % args.gradient_accumulation_steps == 0: <del> scheduler.step() # Update learning rate schedule <add> <ide> optimizer.step() <add> scheduler.step() # Update learning rate schedule <ide> model.zero_grad() <ide> global_step += 1 <ide>
1
Text
Text
add more details
d61dba9110a567e6193902e96b20de16a7655849
<ide><path>guide/english/css/background-opacity/index.md <ide> title: Background Opacity <ide> <ide> The opacity CSS property specifies the level of transparency of an element, that is, the degree to which the content behind the element is visible. <ide> <add>Opacity applies to the element as a whole, including its contents, even though the value is not inherited by child elements. Thus, the element and its children all have the same opacity relative to the element's background, even if they have different opacities relative to one another. <add> <ide> The opacity property can take a value from 0.0 - 1.0. The lower the value, the more the transparency: <ide> <ide> Find more details <a href='https://www.w3schools.com/css/css_image_transparency.asp' target='_blank' rel='nofollow'>here</a>
1
Go
Go
detect compressed archives in api /build call
4f53722dee6c8ea18a9c30bde2cc6fee24b03d32
<ide><path>buildfile.go <ide> func (b *buildFile) Build(context io.Reader) (string, error) { <ide> if err != nil { <ide> return "", err <ide> } <del> b.context = &utils.TarSum{Reader: context, DisableCompression: true} <add> <add> decompressedStream, err := archive.DecompressStream(context) <add> if err != nil { <add> return "", err <add> } <add> <add> b.context = &utils.TarSum{Reader: decompressedStream, DisableCompression: true} <ide> if err := archive.Untar(b.context, tmpdirPath, nil); err != nil { <ide> return "", err <ide> }
1
Text
Text
update main branch name in release guide
5a8440bc51930d263a8b417ef1ae2e592a80badb
<ide><path>doc/contributing/releases.md <ide> official release builds for Node.js, hosted on <https://nodejs.org/>. <ide> * [10. Test the build](#10-test-the-build) <ide> * [11. Tag and sign the release commit](#11-tag-and-sign-the-release-commit) <ide> * [12. Set up for the next release](#12-set-up-for-the-next-release) <del> * [13. Cherry-pick the release commit to `master`](#13-cherry-pick-the-release-commit-to-master) <add> * [13. Cherry-pick the release commit to `main`](#13-cherry-pick-the-release-commit-to-main) <ide> * [14. Push the release tag](#14-push-the-release-tag) <ide> * [15. Promote and sign the release builds](#15-promote-and-sign-the-release-builds) <ide> * [16. Check the release](#16-check-the-release) <ide> tracker][]. <ide> <ide> When preparing a security release, contact Build at least two weekdays in <ide> advance of the expected release. To ensure that the security patch(es) can be <del>properly tested, run a `node-test-pull-request` job against the `master` branch <add>properly tested, run a `node-test-pull-request` job against the `main` branch <ide> of the `nodejs-private/node-private` repository a day or so before the <ide> [CI lockdown procedure][] begins. This is to confirm that Jenkins can properly <ide> access the private repository. <ide> $ git checkout v1.x-staging <ide> $ git reset --hard upstream/v1.x-staging <ide> ``` <ide> <del>If the staging branch is not up to date relative to `master`, bring the <add>If the staging branch is not up to date relative to `main`, bring the <ide> appropriate PRs and commits into it. <ide> <ide> Go through PRs with the label `vN.x`. e.g. [PRs with the `v8.x` label](https://github.com/nodejs/node/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3Av8.x). <ide> For each PR: <ide> <ide> * Run or check that there is a passing CI. <ide> * Check approvals (you can approve yourself). <del>* Check that the commit metadata was not changed from the `master` commit. <add>* Check that the commit metadata was not changed from the `main` commit. <ide> * If there are merge conflicts, ask the PR author to rebase. <ide> Simple conflicts can be resolved when landing. <ide> <ide> duplicate or not. <ide> For a list of commits that could be landed in a patch release on v1.x: <ide> <ide> ```console <del>$ branch-diff v1.x-staging master --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x,backport-blocked-v1.x,backport-open-v1.x,backported-to-v1.x --filter-release --format=simple <add>$ branch-diff v1.x-staging main --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x,backport-blocked-v1.x,backport-open-v1.x,backported-to-v1.x --filter-release --format=simple <ide> ``` <ide> <ide> Previously released commits and version bumps do not need to be <ide> command. (For semver-minor releases, make sure to remove the `semver-minor` tag <ide> from `exclude-label`.) <ide> <ide> ```console <del>$ branch-diff v1.x-staging master --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x,backport-blocked-v1.x,backport-open-v1.x,backported-to-v1.x --filter-release --format=sha --reverse | xargs git cherry-pick <add>$ branch-diff v1.x-staging main --exclude-label=semver-major,semver-minor,dont-land-on-v1.x,backport-requested-v1.x,backport-blocked-v1.x,backport-open-v1.x,backported-to-v1.x --filter-release --format=sha --reverse | xargs git cherry-pick <ide> ``` <ide> <ide> When cherry-picking commits, if there are simple conflicts you can resolve <ide> release branches to more easily be passed between members of the release team if <ide> necessary. <ide> <ide> Create a pull request targeting the correct release line. For example, a <del>`v5.3.0-proposal` PR should target `v5.x`, not master. Paste the CHANGELOG <add>`v5.3.0-proposal` PR should target `v5.x`, not `main`. Paste the CHANGELOG <ide> modifications into the body of the PR so that collaborators can see what is <ide> changing. These PRs should be left open for at least 24 hours, and can be <ide> updated as new commits land. If the CHANGELOG pasted into the pull request <ide> $ git rebase v1.x <ide> $ git push upstream v1.x-staging <ide> ``` <ide> <del>### 13. Cherry-pick the release commit to `master` <add>### 13. Cherry-pick the release commit to `main` <ide> <ide> ```console <del>$ git checkout master <add>$ git checkout main <ide> $ git cherry-pick v1.x^ <ide> ``` <ide> <ide> Then finish cherry-picking and push the commit upstream: <ide> $ git add src/node_version.h doc <ide> $ git cherry-pick --continue <ide> $ make lint <del>$ git push upstream master <add>$ git push upstream main <ide> ``` <ide> <del>**Do not** cherry-pick the "Working on vx.y.z" commit to `master`. <add>**Do not** cherry-pick the "Working on vx.y.z" commit to `main`. <ide> <ide> ### 14. Push the release tag <ide> <ide> announced immediately following the release of 12.0.0). <ide> <ide> Approximately two months before a major release, new `vN.x` and <ide> `vN.x-staging` branches (where `N` indicates the major release) should be <del>created as forks of the `master` branch. Up until one week before the release <del>date, these must be kept in sync with `master`. <add>created as forks of the `main` branch. Up until one week before the release <add>date, these must be kept in sync with `main`. <ide> <ide> The `vN.x` and `vN.x-staging` branches must be kept in sync with one another <ide> up until the date of the release.
1
Javascript
Javascript
delete an unused conditional statement
a84e3e727015605ec02f21f8052ebe9530f0ea62
<ide><path>src/ngAnimate/animation.js <ide> var $$AnimationProvider = ['$animateProvider', function($animateProvider) { <ide> // may attempt more elements, but custom drivers are more particular <ide> for (var i = drivers.length - 1; i >= 0; i--) { <ide> var driverName = drivers[i]; <del> if (!$injector.has(driverName)) continue; // TODO(matsko): remove this check <del> <ide> var factory = $injector.get(driverName); <ide> var driver = factory(animationDetails); <ide> if (driver) {
1
Javascript
Javascript
fix use of hydrateroot in devtools test
061ac27bc9c30e758301d9db823677a0803938c8
<ide><path>packages/react-devtools-shared/src/__tests__/inspectedElement-test.js <ide> describe('InspectedElement', () => { <ide> await utils.actAsync(() => { <ide> const container = document.createElement('div'); <ide> container.innerHTML = '<div></div>'; <del> ReactDOMClient.hydrateRoot(container).render(<Example />); <add> ReactDOMClient.hydrateRoot(container, <Example />); <ide> }, false); <ide> <ide> const inspectedElement = await inspectElementAtIndex(0);
1
Python
Python
add new script, clean up both
d9d47174463dd2d185337c7787a0b88be9460336
<ide><path>research/object_detection/dataset_tools/create_ava_actions_tf_record.py <ide> required files are downloaded (_download_data) which enables constructing the <ide> label map. Then (in generate_examples), for each split in the data set, the <ide> metadata and image frames are generated from the annotations for each sequence <del>example (_generate_metadata). The data set is written to disk as a set of <add>example (_generate_examples). The data set is written to disk as a set of <ide> numbered TFRecord files. <ide> <ide> Generating the data on disk can take considerable time and disk space. <ide> "csv": '', <ide> "excluded-csv": '' <ide> } <del> <ide> } <add> <ide> NUM_CLASSES = 80 <ide> <ide> def feature_list_feature(value): <ide> def _generate_examples(self, annotation_file, excluded_file, label_map, <ide> reader = csv.DictReader(annotations, fieldnames) <ide> frame_annotations = collections.defaultdict(list) <ide> ids = set() <del> # aggregate by video and timestamp: <add> # aggreggate by video and timestamp: <ide> for row in reader: <ide> ids.add(row["id"]) <ide> key = (row["id"], int(float(row["timestamp_seconds"]))) <ide> def _generate_examples(self, annotation_file, excluded_file, label_map, <ide> logging.info("Generating metadata...") <ide> media_num = 1 <ide> for media_id in ids: <del> if media_num > 2: <del> continue <ide> logging.info("%d/%d, ignore warnings.\n" % (media_num, len(ids))) <ide> media_num += 1 <ide> <ide> def _generate_examples(self, annotation_file, excluded_file, label_map, <ide> windowed_timestamp += 1 <ide> <ide> if len(total_boxes) > 0: <del> print(total_boxes) <ide> yield seq_example_util.make_sequence_example("AVA", media_id, total_images, <ide> int(height), int(width), 'jpeg', total_source_ids, None, total_is_annotated, <ide> total_boxes, total_label_strings, use_strs_for_source_id=True) <ide><path>research/object_detection/dataset_tools/create_ava_tf_record_for_context.py <del># Copyright 2019 The MediaPipe Authors. <add># Copyright 2020 The TensorFlow Authors. All Rights Reserved. <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> # You may obtain a copy of the License at <ide> # <del># http://www.apache.org/licenses/LICENSE-2.0 <add># http://www.apache.org/licenses/LICENSE-2.0 <ide> # <ide> # Unless required by applicable law or agreed to in writing, software <ide> # distributed under the License is distributed on an "AS IS" BASIS, <ide> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <ide> # See the License for the specific language governing permissions and <ide> # limitations under the License. <ide> <del># Modified by Kaushik Shivakumar for the AVA Actions Dataset <del># to work without MediaPipe, code started by Bryan Seybold. <add>r"""Code to download and parse the AVA Actions dataset for TensorFlow models. <ide> <del>r"""Code to download and parse the AVA dataset for TensorFlow models. <del> <del>The [AVA data set]( <add>The [AVA Actions data set]( <ide> https://research.google.com/ava/index.html) <del>is a data set for human action recognition. <add>is a dataset for human action recognition. <ide> <ide> This script downloads the annotations and prepares data from similar annotations <ide> if local video files are available. The video files can be downloaded <ide> from the following website: <del>https://github.com/cvdfoundation/ava-datset <add>https://github.com/cvdfoundation/ava-dataset <ide> <ide> Prior to running this script, please run download_and_preprocess_ava.sh to <del>download and trim input videos. <add>download input videos. <ide> <ide> Running this code as a module generates the data set on disk. First, the <ide> required files are downloaded (_download_data) which enables constructing the <ide> label map. Then (in generate_examples), for each split in the data set, the <del>metadata is generated from the annotations for each example <del>(_generate_metadata), and MediaPipe is used to fill in the video frames <del>(_run_mediapipe). This script processes local video files defined in a custom <del>CSV in a comparable manner to the Kinetics data set for evaluating and <del>predicting values on your own data. The data set is written to disk as a set of <add>metadata and image frames are generated from the annotations for each sequence <add>example (_generate_examples). The data set is written to disk as a set of <ide> numbered TFRecord files. <ide> <del>The custom CSV format must match the Kinetics data set format, with columns <del>corresponding to [[label_name], video, start, end, split] followed by lines with <del>those fields. (Label_name is optional.) These field names can be used to <del>construct the paths to the video files using the Python string formatting <del>specification and the video_path_format_string flag: <del> --video_path_format_string="/path/to/video/{video}.mp4" <del> <ide> Generating the data on disk can take considerable time and disk space. <del>(Image compression quality is the primary determiner of disk usage. TVL1 flow <del>determines runtime.) <del> <del>Once the data is on disk, reading the data as a tf.data.Dataset is accomplished <del>with the following lines: <del> <del> kinetics = Kinetics("kinetics_data_path") <del> dataset = kinetics.as_dataset("custom") <del> # implement additional processing and batching here <del> images_and_labels = dataset.make_one_shot_iterator().get_next() <del> images = images_and_labels["images"] <del> labels = image_and_labels["labels"] <add>(Image compression quality is the primary determiner of disk usage. <ide> <del>IF using TFOD API, use the sequence example configuration in the config.proto. <add>If using the Tensorflow Object Detection API, set the input_type field <add>in the input_reader to TF_SEQUENCE_EXAMPLE. <ide> <ide> This data is structured for per-clip action classification where images is <ide> the sequence of images and labels are a one-hot encoded value. See <ide> as_dataset() for more details. <ide> <ide> Note that the number of videos changes in the data set over time, so it will <ide> likely be necessary to change the expected number of examples. <del>""" <ide> <del>from __future__ import absolute_import <del>from __future__ import division <del>from __future__ import print_function <add>The argument video_path_format_string expects a value as such: <add> "/path/to/videos/{0}" <add> <add>""" <ide> <ide> import contextlib <ide> import csv <ide> import os <ide> import random <del>import subprocess <ide> import sys <del>import tarfile <ide> import zipfile <del>import tempfile <ide> import collections <ide> import glob <del>import hashlib <ide> <ide> from absl import app <ide> from absl import flags <ide> from six.moves import urllib <ide> import tensorflow.compat.v1 as tf <ide> import cv2 <add>import hashlib <ide> <ide> from object_detection.utils import dataset_util <ide> <del>GLOBAL_SOURCE_ID = 0 <ide> POSSIBLE_TIMESTAMPS = range(902, 1798) <ide> ANNOTATION_URL = "https://research.google.com/ava/download/ava_v2.2.zip" <ide> SECONDS_TO_MILLI = 1000 <ide> FILEPATTERN = "ava_actions_%s_1fps_rgb" <ide> SPLITS = { <ide> "train": { <del> "shards": 100, <add> "shards": 1000, <ide> "examples": 862663, <ide> "csv": '', <ide> "excluded-csv": '' <ide> }, <ide> "val": { <del> "shards": 50, <add> "shards": 100, <ide> "examples": 243029, <ide> "csv": '', <ide> "excluded-csv": '' <ide> "csv": '', <ide> "excluded-csv": '' <ide> } <del> <ide> } <add> <ide> NUM_CLASSES = 80 <ide> <ide> def feature_list_feature(value): <ide> return tf.train.FeatureList(feature=value) <ide> <ide> class Ava(object): <del> """Generates and loads the Kinetics data set.""" <add> """Generates and loads the AVA Actions 2.2 data set.""" <ide> <ide> def __init__(self, path_to_output_dir, path_to_data_download): <ide> if not path_to_output_dir: <ide> raise ValueError("You must supply the path to the data directory.") <ide> self.path_to_data_download = path_to_data_download <ide> self.path_to_output_dir = path_to_output_dir <ide> <del> def generate_examples(self, <del> splits_to_process="train,val,test", <del> video_path_format_string=None, <del> download_labels_for_map=True, <del> seconds_per_sequence=10, <del> hop_between_sequences=10): <add> def generate_and_write_records(self, <add> splits_to_process="train,val,test", <add> video_path_format_string=None, <add> seconds_per_sequence=10, <add> hop_between_sequences=10): <ide> """Downloads data and generates sharded TFRecords. <ide> <ide> Downloads the data files, generates metadata, and processes the metadata <ide> def generate_examples(self, <ide> a custom CSV with the CSV flag. The original data is still downloaded <ide> to generate the label_map. <ide> video_path_format_string: The format string for the path to local files. <del> download_labels_for_map: If true, download the annotations to create the <del> label map. <ide> seconds_per_sequence: The length of each sequence, in seconds. <ide> hop_between_sequences: The gap between the centers of <ide> successive sequences. <ide> """ <ide> logging.info("Downloading data.") <del> download_output = self._download_data(download_labels_for_map) <add> download_output = self._download_data() <ide> for key in splits_to_process.split(","): <del> logging.info("Generating metadata for split: %s", key) <del> all_metadata = list(self._generate_metadata( <add> logging.info("Generating examples for split: %s", key) <add> all_metadata = list(self._generate_examples( <ide> download_output[0][key][0], download_output[0][key][1], <ide> download_output[1], seconds_per_sequence, hop_between_sequences, <ide> video_path_format_string)) <ide> def generate_examples(self, <ide> writers[i % len(writers)].write(seq_ex.SerializeToString()) <ide> logging.info("Data extraction complete.") <ide> <del> def _generate_metadata(self, annotation_file, excluded_file, label_map, <add> def _generate_examples(self, annotation_file, excluded_file, label_map, <ide> seconds_per_sequence, hop_between_sequences, <ide> video_path_format_string): <del> """For each row in the annotation CSV, generates the corresponding metadata. <add> """For each row in the annotation CSV, generates the corresponding <add> examples. When iterating through frames for a single example, skips <add> over excluded frames. Generates equal-length sequence examples, each with <add> length seconds_per_sequence (1 fps) and gaps of hop_between_sequences <add> frames (and seconds) between them, possible greater due to excluded frames. <ide> <ide> Args: <ide> annotation_file: path to the file of AVA CSV annotations. <ide> def _generate_metadata(self, annotation_file, excluded_file, label_map, <ide> hop_between_sequences: The hop between sequences. If less than <ide> seconds_per_sequence, will overlap. <ide> Yields: <del> Each tf.SequenceExample of metadata, ready to pass to MediaPipe. <add> Each prepared tf.Example of metadata also containing video frames <ide> """ <del> global GLOBAL_SOURCE_ID <ide> fieldnames = ["id", "timestamp_seconds", "xmin", "ymin", "xmax", "ymax", <ide> "action_label"] <ide> frame_excluded = {} <ide> def _generate_metadata(self, annotation_file, excluded_file, label_map, <ide> ids.add(row["id"]) <ide> key = (row["id"], int(float(row["timestamp_seconds"]))) <ide> frame_annotations[key].append(row) <del> # for each video, find aggregates near each sampled frame.: <add> # for each video, find aggreggates near each sampled frame.: <ide> logging.info("Generating metadata...") <ide> media_num = 1 <ide> for media_id in ids: <ide> def _generate_metadata(self, annotation_file, excluded_file, label_map, <ide> middle_frame_time = POSSIBLE_TIMESTAMPS[0] <ide> cur_frame_num = 0 <ide> while middle_frame_time < POSSIBLE_TIMESTAMPS[-1]: <del> GLOBAL_SOURCE_ID += 1 <del> <ide> cur_vid.set(cv2.CAP_PROP_POS_MSEC, <ide> (middle_frame_time) * SECONDS_TO_MILLI) <ide> success, image = cur_vid.read() <ide> def _generate_metadata(self, annotation_file, excluded_file, label_map, <ide> continue <ide> <ide> cur_frame_num += 1 <del> source_id = str(GLOBAL_SOURCE_ID) + "_" + media_id <del> GLOBAL_SOURCE_ID += 1 <add> source_id = str(middle_frame_time) + "_" + media_id <ide> <ide> xmins = [] <ide> xmaxs = [] <ide> def _generate_metadata(self, annotation_file, excluded_file, label_map, <ide> else: <ide> logging.warning("Unknown label: %s", row["action_label"]) <ide> <del> #Display the image and bounding boxes being <del> #processed (for debugging purposes) <del> """ <del> for i in range(len(xmins)): <del> cv2.rectangle(image, (int(xmins[i] * width), <del> int(ymaxs[i] * height)), <del> (int(xmaxs[i] * width), <del> int(ymins[i] * height)), (255, 0, 0), 2) <del> cv2.imshow("mywindow", image) <del> cv2.waitKey(1000) <del> """ <del> middle_frame_time += 1/3 <del> if abs(middle_frame_time - round(middle_frame_time) < 0.000001): <del> middle_frame_time = round(middle_frame_time) <del> <del> num_frames_in_adjusted = (middle_time_frame - 900) * 3 * 2 <del> <add> middle_frame_time += 1 <ide> key = hashlib.sha256(bufstring).hexdigest() <ide> date_captured_feature = ("2020-06-17 00:%02d:%02d" % ((middle_frame_time - 900) // 60, (middle_frame_time - 900) % 60)) <ide> context_feature_dict = { <ide> def _generate_metadata(self, annotation_file, excluded_file, label_map, <ide> <ide> cur_vid.release() <ide> <del> def _download_data(self, download_labels_for_map): <add> def _download_data(self): <ide> """Downloads and extracts data if not already available.""" <ide> if sys.version_info >= (3, 0): <ide> urlretrieve = urllib.request.urlretrieve <ide> def _download_data(self, download_labels_for_map): <ide> tf.io.gfile.makedirs(self.path_to_data_download) <ide> logging.info("Downloading annotations.") <ide> paths = {} <del> if download_labels_for_map: <del> zip_path = os.path.join(self.path_to_data_download, <del> ANNOTATION_URL.split("/")[-1]) <del> urlretrieve(ANNOTATION_URL, zip_path) <del> with zipfile.ZipFile(zip_path, 'r') as zip_ref: <del> zip_ref.extractall(self.path_to_data_download) <del> for split in ["train", "test", "val"]: <del> csv_path = os.path.join(self.path_to_data_download, "ava_%s_v2.2.csv" % split) <del> excl_name = "ava_%s_excluded_timestamps_v2.2.csv" % split <del> excluded_csv_path = os.path.join(self.path_to_data_download, excl_name) <del> SPLITS[split]["csv"] = csv_path <del> SPLITS[split]["excluded-csv"] = excluded_csv_path <del> paths[split] = (csv_path, excluded_csv_path) <add> zip_path = os.path.join(self.path_to_data_download, <add> ANNOTATION_URL.split("/")[-1]) <add> urlretrieve(ANNOTATION_URL, zip_path) <add> with zipfile.ZipFile(zip_path, 'r') as zip_ref: <add> zip_ref.extractall(self.path_to_data_download) <add> for split in ["train", "test", "val"]: <add> csv_path = os.path.join(self.path_to_data_download, "ava_%s_v2.2.csv" % split) <add> excl_name = "ava_%s_excluded_timestamps_v2.2.csv" % split <add> excluded_csv_path = os.path.join(self.path_to_data_download, excl_name) <add> SPLITS[split]["csv"] = csv_path <add> SPLITS[split]["excluded-csv"] = excluded_csv_path <add> paths[split] = (csv_path, excluded_csv_path) <ide> <ide> label_map = self.get_label_map(os.path.join(self.path_to_data_download, "ava_action_list_v2.2.pbtxt")) <ide> <ide> def bytes23(string): <ide> """Creates a bytes string in either Python 2 or 3.""" <ide> if sys.version_info >= (3, 0): <ide> return bytes(string, "utf8") <del> else: <del> return bytes(string) <add> return bytes(string) <ide> <ide> @contextlib.contextmanager <ide> def _close_on_exit(writers): <ide> def main(argv): <ide> if len(argv) > 1: <ide> raise app.UsageError("Too many command-line arguments.") <ide> Ava(flags.FLAGS.path_to_output_dir, <del> flags.FLAGS.path_to_download_data).generate_examples( <add> flags.FLAGS.path_to_download_data).generate_and_write_records( <ide> flags.FLAGS.splits_to_process, <ide> flags.FLAGS.video_path_format_string, <del> flags.FLAGS.download_labels_for_map, <ide> flags.FLAGS.seconds_per_sequence, <ide> flags.FLAGS.hop_between_sequences) <ide> <ide> def main(argv): <ide> flags.DEFINE_string("path_to_output_dir", <ide> "", <ide> "Path to directory to write data to.") <del> flags.DEFINE_boolean("download_labels_for_map", <del> True, <del> "If true, download the annotations to construct the " <del> "label map.") <ide> flags.DEFINE_string("splits_to_process", <ide> "train,val", <ide> "Process these splits. Useful for custom data splits.")
2
Text
Text
replace github wiki links with apache cwiki links
b1038284009c9da359fcb2e1bd32a691e2a1541f
<ide><path>README.md <ide> monitor progress, and troubleshoot issues when needed. <ide> ## Getting started <ide> Please visit the Airflow Platform documentation for help with [installing Airflow](http://pythonhosted.org/airflow/installation.html), getting a [quick start](http://pythonhosted.org/airflow/start.html), or a more complete [tutorial](http://pythonhosted.org/airflow/tutorial.html). <ide> <del>For further information, please visit the [Airflow Wiki](https://github.com/airbnb/airflow/wiki). <add>For further information, please visit the [Airflow Wiki](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Home). <ide> <ide> ## Beyond the Horizon <ide> <ide> if you may. <ide> <ide> Committers: <ide> <del>* Refer to [Committers](https://github.com/airbnb/airflow/wiki/Committers) <add>* Refer to [Committers](https://cwiki.apache.org/confluence/display/AIRFLOW/Committers) <ide> <ide> Currently **officially** using Airflow: <ide> <ide> Currently **officially** using Airflow: <ide> * [Full documentation on pythonhosted.org](http://pythonhosted.org/airflow/) <ide> * [Airflow Google Group (mailing list / forum)](https://groups.google.com/forum/#!forum/airbnb_airflow) <ide> * [Airbnb Blog Post about Airflow](http://nerds.airbnb.com/airflow/) <del>* [Airflow Common Pitfalls](https://github.com/airbnb/airflow/wiki/Common-Pitfalls) <add>* [Airflow Common Pitfalls](https://cwiki.apache.org/confluence/display/AIRFLOW/Common+Pitfalls) <ide> * [Hadoop Summit Airflow Video](https://www.youtube.com/watch?v=oYp49mBwH60) <ide> * [Airflow at Agari Blog Post](http://agari.com/blog/airflow-agari) <ide> * [Best practices with Airflow (Max) nov 2015](https://youtu.be/dgaoqOZlvEA)
1
PHP
PHP
set an array and adding another option
757460ca160cea6d14b25427c000495c01395e7b
<ide><path>Cake/ORM/Entity.php <ide> class Entity implements \ArrayAccess, \JsonSerializable { <ide> protected $_errors = []; <ide> <ide> /** <del> * List of properties in this entity that can be set safely <del> * an empty array means "all" <add> * Map of properties in this entity that can be safely assigned, each <add> * property name points to a boolean indicating its status. An empty array <add> * means no properties are accessible <add> * <add> * The special property '*' can also be mapped, meaning that any other property <add> * not defined in the map will take its value. For example, `'*' => true` <add> * means that any property not defin <ide> * <ide> * @var array <ide> */ <ide> class Entity implements \ArrayAccess, \JsonSerializable { <ide> * - useSetters: whether use internal setters for properties or not <ide> * - markClean: whether to mark all properties as clean after setting them <ide> * - markNew: whether this instance has not yet been persisted <add> * - safe: whether to prevent inaccessible properties from being set (default: false) <ide> */ <ide> public function __construct(array $properties = [], array $options = []) { <ide> $options += [ <ide> 'useSetters' => true, <ide> 'markClean' => false, <del> 'markNew' => null <add> 'markNew' => null, <add> 'safe' => false <ide> ]; <ide> $this->_className = get_class($this); <del> $this->set($properties, $options['useSetters']); <add> $this->set($properties, [ <add> 'setter' => $options['useSetters'], <add> 'safe' => $options['safe'] <add> ]); <ide> <ide> if ($options['markClean']) { <ide> $this->clean(); <ide> public function __unset($property) { <ide> * }} <ide> * <ide> * Some times it is handy to bypass setter functions in this entity when assigning <del> * properties. You can achieve this by setting the third argument to false when <del> * assigning a single property or the second param when using an array of <del> * properties. <add> * properties. You can achieve this by disabling the `setter` option using the <add> * `$options` parameter <add> * <add> * ### Example: <add> * <add> * ``$entity->set('name', 'Andrew', ['setter' => false]);`` <add> * <add> * ``$entity->set(['name' => 'Andrew', 'id' => 1], ['setter' => false]);`` <add> * <add> * Mass assignment should be treated carefully when accepting user input, for this <add> * case you can tell this method to only set property that are marked as accessible <add> * by setting the `safe` options in the `$options` parameter <ide> * <ide> * ### Example: <ide> * <del> * ``$entity->set('name', 'Andrew', false);`` <add> * ``$entity->set('name', 'Andrew', ['safe' => true]);`` <ide> * <del> * ``$entity->set(['name' => 'Andrew', 'id' => 1], false);`` <add> * ``$entity->set(['name' => 'Andrew', 'id' => 1], ['safe' => true]);`` <ide> * <ide> * @param string|array $property the name of property to set or a list of <ide> * properties with their respective values <del> * @param mixed|boolean $value the value to set to the property or a boolean <del> * signifying whether to use internal setter functions or not <del> * @param boolean $useSetters whether to use setter functions in this object <del> * or bypass them <add> * @param mixed|array $value the value to set to the property or an array if the <add> * first argument is also an array, in which case will be treated as $options <add> * @param array $options options to be used for setting the property. Allowed option <add> * keys are `setter` and `safe` <ide> * @return \Cake\ORM\Entity <ide> */ <del> public function set($property, $value = true, $useSetters = true) { <add> public function set($property, $value = null, $options = []) { <ide> if (is_string($property)) { <ide> $property = [$property => $value]; <ide> } else { <del> $useSetters = $value; <add> $options = (array)$value; <ide> } <ide> <add> $options += ['setter' => true, 'safe' => false]; <add> <ide> foreach ($property as $p => $value) { <add> if ($options['safe'] === true && !$this->accessible($property)) { <add> continue; <add> } <add> <ide> $markDirty = true; <ide> if (isset($this->_properties[$p])) { <ide> $markDirty = $value !== $this->_properties[$p]; <ide> public function set($property, $value = true, $useSetters = true) { <ide> $this->dirty($p, true); <ide> } <ide> <del> if (!$useSetters) { <add> if (!$options['setter']) { <ide> $this->_properties[$p] = $value; <ide> continue; <ide> } <ide> public function errors($field = null, $errors = null) { <ide> } <ide> <ide> public function accessible($property, $set = null) { <del> if ($set === null && empty($this->_accessible)) { <del> return true; <add> if ($set === null) { <add> return !empty($this->_accessible[$property]) || !empty($this->_accessible['*']); <ide> } <ide> <ide> if ($set === null) { <add> if (is_bool($this->_accessible)) { <add> return $this->_accessible; <add> } <ide> return !isset($this->_accessible[$property]) || $this->_accessible[$property]; <ide> } <ide> <ide> if ($property === '*') { <del> $this->_accessible = []; <add> $this->_accessible = array_map(function($p) use ($set) { <add> return (bool)$set; <add> }, $this->_accessible); <add> $this->_accessible['*'] = (bool)$set; <ide> return $this; <ide> } <ide> <ide><path>Cake/ORM/ResultSet.php <ide> protected function _groupResult($row) { <ide> $results[$defaultAlias] <ide> ); <ide> <del> $options = ['useSetters' => false, 'markClean' => true, 'markNew' => false]; <add> $options = [ <add> 'useSetters' => false, <add> 'markClean' => true, <add> 'markNew' => false, <add> 'safe' => false <add> ]; <ide> foreach (array_reverse($this->_associationMap) as $alias => $assoc) { <ide> if (!isset($results[$alias])) { <ide> continue; <ide><path>Cake/Test/TestCase/ORM/EntityTest.php <ide> public function testBypassSetters() { <ide> $entity->expects($this->never())->method('setName'); <ide> $entity->expects($this->never())->method('setStuff'); <ide> <del> $entity->set('name', 'Jones', false); <add> $entity->set('name', 'Jones', ['setter' => false]); <ide> $this->assertEquals('Jones', $entity->name); <ide> <del> $entity->set('stuff', 'Thing', false); <add> $entity->set('stuff', 'Thing', ['setter' => false]); <ide> $this->assertEquals('Thing', $entity->stuff); <ide> <del> $entity->set(['name' => 'foo', 'stuff' => 'bar'], false); <add> $entity->set(['name' => 'foo', 'stuff' => 'bar'], ['setter' => false]); <ide> $this->assertEquals('bar', $entity->stuff); <ide> } <ide> <ide> public function testConstructor() { <ide> ->getMock(); <ide> $entity->expects($this->at(0)) <ide> ->method('set') <del> ->with(['a' => 'b', 'c' => 'd'], true); <add> ->with(['a' => 'b', 'c' => 'd'], ['setter' => true, 'safe' => false]); <ide> <ide> $entity->expects($this->at(1)) <ide> ->method('set') <del> ->with(['foo' => 'bar'], false); <add> ->with(['foo' => 'bar'], ['setter' => false, 'safe' => false]); <ide> <ide> $entity->__construct(['a' => 'b', 'c' => 'd']); <ide> $entity->__construct(['foo' => 'bar'], ['useSetters' => false]); <ide> } <ide> <add>/** <add> * Tests that the constructor will set initial properties and pass the safe <add> * option along <add> * <add> * @return void <add> */ <add> public function testConstructorWithSafe() { <add> $entity = $this->getMockBuilder('\Cake\ORM\Entity') <add> ->setMethods(['set']) <add> ->disableOriginalConstructor() <add> ->getMock(); <add> $entity->expects($this->once()) <add> ->method('set') <add> ->with(['foo' => 'bar'], ['setter' => true, 'safe' => true]); <add> $entity->__construct(['foo' => 'bar'], ['safe' => true]); <add> } <add> <ide> /** <ide> * Tests getting properties with no custom getters <ide> * <ide> public function testCleanRemovesErrors() { <ide> */ <ide> public function testAccessible() { <ide> $entity = new Entity; <del> $this->assertTrue($entity->accessible('foo')); <del> $this->assertTrue($entity->accessible('bar')); <del> <del> $this->assertSame($entity, $entity->accessible('foo', false)); <del> $this->assertFalse($entity->accessible('foo')); <del> $this->assertTrue($entity->accessible('bar')); <del> <del> $this->assertSame($entity, $entity->accessible('bar', false)); <ide> $this->assertFalse($entity->accessible('foo')); <ide> $this->assertFalse($entity->accessible('bar')); <ide> <ide> public function testAccessible() { <ide> $this->assertSame($entity, $entity->accessible('bar', true)); <ide> $this->assertTrue($entity->accessible('foo')); <ide> $this->assertTrue($entity->accessible('bar')); <add> <add> $this->assertSame($entity, $entity->accessible('foo', false)); <add> $this->assertFalse($entity->accessible('foo')); <add> $this->assertTrue($entity->accessible('bar')); <add> <add> $this->assertSame($entity, $entity->accessible('bar', false)); <add> $this->assertFalse($entity->accessible('foo')); <add> $this->assertFalse($entity->accessible('bar')); <ide> } <ide> <ide> /** <ide> public function testAccessible() { <ide> */ <ide> public function testAccessibleAsArray() { <ide> $entity = new Entity; <add> $entity->accessible(['foo', 'bar', 'baz'], true); <add> $this->assertTrue($entity->accessible('foo')); <add> $this->assertTrue($entity->accessible('bar')); <add> $this->assertTrue($entity->accessible('baz')); <add> <add> $entity->accessible('foo', false); <add> $this->assertFalse($entity->accessible('foo')); <add> $this->assertTrue($entity->accessible('bar')); <add> $this->assertTrue($entity->accessible('baz')); <add> <ide> $entity->accessible(['foo', 'bar', 'baz'], false); <ide> $this->assertFalse($entity->accessible('foo')); <ide> $this->assertFalse($entity->accessible('bar')); <ide> $this->assertFalse($entity->accessible('baz')); <add> } <ide> <del> $entity->accessible('foo', true); <add>/** <add> * Tests that a wildcard can be used for setting accesible properties <add> * <add> * @return void <add> */ <add> public function testAccessibleWildcard() { <add> $entity = new Entity; <add> $entity->accessible(['foo', 'bar', 'baz'], true); <ide> $this->assertTrue($entity->accessible('foo')); <add> $this->assertTrue($entity->accessible('bar')); <add> $this->assertTrue($entity->accessible('baz')); <add> <add> $entity->accessible('*', false); <add> $this->assertFalse($entity->accessible('foo')); <ide> $this->assertFalse($entity->accessible('bar')); <ide> $this->assertFalse($entity->accessible('baz')); <add> $this->assertFalse($entity->accessible('newOne')); <ide> <del> $entity->accessible(['foo', 'bar', 'baz'], true); <add> $entity->accessible('*', true); <ide> $this->assertTrue($entity->accessible('foo')); <ide> $this->assertTrue($entity->accessible('bar')); <ide> $this->assertTrue($entity->accessible('baz')); <add> $this->assertTrue($entity->accessible('newOne2')); <ide> } <ide> <ide> }
3
Text
Text
fix typos, grammar, more concise wording
4982374739a37e349b82ab168fb2f43a55f3287c
<ide><path>docs/sources/project/set-up-dev-env.md <ide> page_keywords: development, inception, container, image Dockerfile, dependencies <ide> In this section, you learn to develop like a member of Docker's core team. <ide> The `docker` repository includes a `Dockerfile` at its root. This file defines <ide> Docker's development environment. The `Dockerfile` lists the environment's <del>dependencies: system libraries and binaries, go environment, go dependencies, <add>dependencies: system libraries and binaries, Go environment, Go dependencies, <ide> etc. <ide> <ide> Docker's development environment is itself, ultimately a Docker container. <ide> you continue working with your fork on this branch. <ide> <ide> ## Clean your host of Docker artifacts <ide> <del>Docker developers run the latest stable release of the Docker software; Or <del>Boot2docker and Docker if their machine is Mac OS X. They clean their local <add>Docker developers run the latest stable release of the Docker software (with Boot2Docker if their machine is Mac OS X). They clean their local <ide> hosts of unnecessary Docker artifacts such as stopped containers or unused <del>images. Cleaning unnecessary artifacts isn't strictly necessary but it is <add>images. Cleaning unnecessary artifacts isn't strictly necessary, but it is <ide> good practice, so it is included here. <ide> <del>To remove unnecessary artifacts. <add>To remove unnecessary artifacts, <ide> <ide> 1. Verify that you have no unnecessary containers running on your host. <ide> <ide> To remove unnecessary artifacts. <ide> <ide> $ docker rmi -f $(docker images -q -a -f dangling=true) <ide> <del> This command uses `docker images` to lists all images (`-a` flag) by numeric <add> This command uses `docker images` to list all images (`-a` flag) by numeric <ide> IDs (`-q` flag) and filter them to find dangling images (`-f <ide> dangling=true`). Then, the `docker rmi` command forcibly (`-f` flag) removes <ide> the resulting list. To remove just one image, use the `docker rmi ID` <ide> environment. <ide> <ide> If you are following along with this guide, you created a `dry-run-test` <ide> branch when you <a href="/project/set-up-git" target="_blank"> set up Git for <del> contributing</a> <add> contributing</a>. <ide> <ide> 4. Ensure you are on your `dry-run-test` branch. <ide> <ide> $ git checkout dry-run-test <ide> <del> If you get a message that the branch doesn't exist, add the `-b` flag so the <add> If you get a message that the branch doesn't exist, add the `-b` flag (git checkout -b dry-run-test) so the <ide> command both creates the branch and checks it out. <ide> <ide> 5. Compile your development environment container into an image. <ide> build and run a `docker` binary in your container. <ide> <ide> ![Multiple terminals](/project/images/three_terms.png) <ide> <del> Mac OSX users, make sure you run `eval "$(boot2docker shellinit)"` in any new <add> Mac OS X users, make sure you run `eval "$(boot2docker shellinit)"` in any new <ide> terminals. <ide> <ide> 2. In a terminal, create a new container from your `dry-run-test` image. <ide> build and run a `docker` binary in your container. <ide> The command creates a container from your `dry-run-test` image. It opens an <ide> interactive terminal (`-ti`) running a `/bin/bash shell`. The <ide> `--privileged` flag gives the container access to kernel features and device <del> access. It is this flag that allows you to run a container in a container. <add> access. This flag allows you to run a container in a container. <ide> Finally, the `-rm` flag instructs Docker to remove the container when you <ide> exit the `/bin/bash` shell. <ide> <ide> with the `make.sh` script. <ide> <ide> root@5f8630b873fe:/go/src/github.com/docker/docker# docker -dD <ide> <del> The `-dD` flag starts the daemon in debug mode; You'll find this useful <add> The `-dD` flag starts the daemon in debug mode. You'll find this useful <ide> when debugging your code. <ide> <ide> 9. Bring up one of the terminals on your local host. <ide> container. <ide> <ide> Your location will be different because it reflects your environment. <ide> <del>3. Create a container using `dry-run-test` but this time mount your repository <add>3. Create a container using `dry-run-test`, but this time, mount your repository <ide> onto the `/go` directory inside the container. <ide> <ide> $ docker run --privileged --rm -ti -v `pwd`:/go/src/github.com/docker/docker dry-run-test /bin/bash <ide> onto the `/go` directory inside the container. <ide> <ide> $ cd ~/repos/docker-fork/ <ide> <del>6. Create a fresh binary but this time use the `make` command. <add>6. Create a fresh binary, but this time, use the `make` command. <ide> <ide> $ make BINDDIR=. binary <ide> <ide><path>docs/sources/project/set-up-git.md <ide> To configure your username, email, and add a remote: <ide> <ide> ## Create and push a branch <ide> <del>As you change code in your fork, you make your changes on a repository branch. <add>As you change code in your fork, make your changes on a repository branch. <ide> The branch name should reflect what you are working on. In this section, you <ide> create a branch, make a change, and push it up to your fork. <ide> <ide> This branch is just for testing your config for this guide. The changes are part <del>of a dry run so the branch name is going to be dry-run-test. To create an push <add>of a dry run, so the branch name will be dry-run-test. To create and push <ide> the branch to your fork on GitHub: <ide> <ide> 1. Open a terminal and go to the root of your `docker-fork`.
2
Go
Go
improve error message to print the tag
bc45428220e4a8d05d9a0cbc701a729f7fe2aa8d
<ide><path>graph/pull.go <ide> func (s *TagStore) pullRepository(r *registry.Session, out io.Writer, localName, <ide> repoData, err := r.GetRepositoryData(remoteName) <ide> if err != nil { <ide> if strings.Contains(err.Error(), "HTTP code: 404") { <del> return fmt.Errorf("Error: image %s not found", remoteName) <add> return fmt.Errorf("Error: image %s:%s not found", remoteName, askedTag) <ide> } <ide> // Unexpected HTTP error <ide> return err
1
PHP
PHP
update docblocks and simplify code
057374882af9b50c76517e63b3675c43083171a7
<ide><path>src/Illuminate/Log/LogManager.php <ide> public function __construct($app) <ide> /** <ide> * Get a log channel instance. <ide> * <del> * @param string $driver <add> * @param string|null $channel <ide> * @return mixed <ide> */ <ide> public function channel($channel = null) <ide> public function channel($channel = null) <ide> /** <ide> * Get a log driver instance. <ide> * <del> * @param string $driver <add> * @param string|null $driver <ide> * @return mixed <ide> */ <ide> public function driver($driver = null) <ide> protected function resolve($name) <ide> <ide> if (isset($this->customCreators[$config['driver']])) { <ide> return $this->callCustomCreator($config); <del> } else { <del> $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; <del> <del> if (method_exists($this, $driverMethod)) { <del> return $this->{$driverMethod}($config); <del> } else { <del> throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); <del> } <ide> } <add> <add> $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; <add> <add> if (method_exists($this, $driverMethod)) { <add> return $this->{$driverMethod}($config); <add> } <add> <add> throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported."); <ide> } <ide> <ide> /** <ide> protected function createErrorlogDriver(array $config) <ide> * Prepare the handlers for usage by Monolog. <ide> * <ide> * @param array $handlers <del> * @return \Monolog\Handler\HandlerInterface <add> * @return array <ide> */ <ide> protected function prepareHandlers(array $handlers) <ide> {
1
Python
Python
fix comment typo
a24f830604fc150526d9fd4596a4f3900916abe9
<ide><path>pytorch_transformers/modeling_bert.py <ide> def forward(self, input_ids, token_type_ids=None, attention_mask=None, masked_lm <ide> sequence_output = outputs[0] <ide> prediction_scores = self.cls(sequence_output) <ide> <del> outputs = (prediction_scores,) + outputs[2:] # Add hidden states and attention is they are here <add> outputs = (prediction_scores,) + outputs[2:] # Add hidden states and attention if they are here <ide> if masked_lm_labels is not None: <ide> loss_fct = CrossEntropyLoss(ignore_index=-1) <ide> masked_lm_loss = loss_fct(prediction_scores.view(-1, self.config.vocab_size), masked_lm_labels.view(-1))
1
Ruby
Ruby
fix indentation for test formulae
cdb07d89ae54468d66a3f6948c937b00a3bbcdf0
<ide><path>Library/Homebrew/global.rb <ide> require "active_support/core_ext/file/atomic" <ide> require "active_support/core_ext/enumerable" <ide> require "active_support/core_ext/string/exclude" <add>require "active_support/core_ext/string/indent" <ide> <ide> I18n.backend.available_locales # Initialize locales so they can be overwritten. <ide> I18n.backend.store_translations :en, support: { array: { last_word_connector: " and " } } <ide><path>Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb <ide> def install <ide> Formulary.core_path(name).tap do |formula_path| <ide> formula_path.write <<~RUBY <ide> class #{Formulary.class_s(name)} < Formula <del> #{content} <add> #{content.indent(2)} <ide> end <ide> RUBY <ide> end <ide><path>Library/Homebrew/test/utils/bottles/bottles_spec.rb <ide> <ide> describe "#add_bottle_stanza!" do <ide> let(:bottle_output) do <del> require "active_support/core_ext/string/indent" <del> <ide> <<~RUBY.chomp.indent(2) <ide> bottle do <ide> sha256 "f7b1fc772c79c20fddf621ccc791090bc1085fcef4da6cca03399424c66e06ca" => :sierra
3
Javascript
Javascript
unify systrace native hook argument passing
52e3ae9063705bac53bad99ffe23976c29c8f1b2
<ide><path>Libraries/Performance/Systrace.js <ide> const Systrace = { <ide> _asyncCookie++; <ide> profileName = typeof profileName === 'function' ? <ide> profileName() : profileName; <del> global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie, 0); <add> global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie); <ide> } <ide> return cookie; <ide> }, <ide> const Systrace = { <ide> if (_enabled) { <ide> profileName = typeof profileName === 'function' ? <ide> profileName() : profileName; <del> global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie, 0); <add> global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS, profileName, cookie); <ide> } <ide> }, <ide>
1
Python
Python
remove unnecessary wrapper function
a9eebae822da02694fcf327e396f7d278e7f57e6
<ide><path>libcloud/common/openstack.py <ide> def morph_action_hook(self, action): <ide> self._populate_hosts_and_request_paths() <ide> return super(OpenStackBaseConnection, self).morph_action_hook(action) <ide> <del> def request(self, **kwargs): <del> return super(OpenStackBaseConnection, self).request(**kwargs) <del> <ide> def _set_up_connection_info(self, url): <ide> result = self._tuple_from_url(url) <ide> (self.host, self.port, self.secure, self.request_path) = result
1