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
PHP
PHP
fix trailing whitespace
e58c93c39d6e56ab3d19fc32fcf61e3ec2459572
<ide><path>lib/Cake/Console/ShellDispatcher.php <ide> public function dispatch() { <ide> return $Shell->main(); <ide> } <ide> } <del> <add> <ide> throw new MissingShellMethodException(array('shell' => $shell, 'method' => $command)); <ide> } <ide>
1
Javascript
Javascript
create textprops (flow for text props)
f71f4e7906648766e1a5b630abbad8935daef955
<ide><path>Libraries/Text/TextProps.js <add>/** <add> * Copyright (c) 2013-present, 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> * @providesModule TextProps <add> * @flow <add> * @format <add> */ <add> <add>'use strict'; <add> <add>import type {Node} from 'react'; <add> <add>import type {LayoutEvent} from 'CoreEventTypes'; <add>import type {TextStyleProp} from 'StyleSheetTypes'; <add> <add>type PressRetentionOffset = { <add> top: number, <add> left: number, <add> bottom: number, <add> right: number, <add>}; <add> <add>/** <add> * @see https://facebook.github.io/react-native/docs/text.html#reference <add> */ <add>export type TextProps = {| <add> accessible?: boolean, <add> allowFontScaling?: boolean, <add> children: Node, <add> ellipsizeMode?: 'clip' | 'head' | 'middle' | 'tail', <add> nativeID?: string, <add> numberOfLines?: number, <add> onLayout?: ?(event: LayoutEvent) => void, <add> onLongPress?: ?() => void, <add> onPress?: ?() => void, <add> pressRetentionOffset?: PressRetentionOffset, <add> selectable?: boolean, <add> style?: TextStyleProp, <add> testID?: string, <add> <add> // Android Only <add> disabled?: boolean, <add> selectionColor?: string, <add> textBreakStrategy?: 'balanced' | 'highQuality' | 'simple', <add> <add> // iOS Only <add> adjustsFontSizeToFit?: boolean, <add> minimumFontScale?: number, <add> suppressHighlighting?: boolean, <add>|};
1
PHP
PHP
improve comments in application/routes.php
3698315dc9a4e326003d8f1ce5de8c9870d96688
<ide><path>application/routes.php <ide> | Here is the public API of your application. To add functionality to your <ide> | application, you just add to the array located in this file. <ide> | <del> | It's a breeze. Simply tell Laravel the HTTP verbs and request URIs it <del> | should respond to. The GET, POST, PUT, and DELETE verbs are all <del> | recognized by the Laravel routing system. <add> | Simply tell Laravel the HTTP verbs and request URIs it should respond to. <add> | You may respond to the GET, POST, PUT, or DELETE verbs. Enjoy the simplicity <add> | and elegance of RESTful routing. <ide> | <ide> | Here is how to respond to a simple GET request to http://example.com/hello: <ide> |
1
Ruby
Ruby
remove rendered_format from lookupcontext
3e2158442b8e6e993bb6bee64c9f3f5e0c02e550
<ide><path>actionview/lib/action_view/lookup_context.rb <ide> module ActionView <ide> # view paths, used in the resolver cache lookup. Since this key is generated <ide> # only once during the request, it speeds up all cache accesses. <ide> class LookupContext # :nodoc: <del> attr_accessor :prefixes, :rendered_format <add> attr_accessor :prefixes <ide> <ide> singleton_class.attr_accessor :registered_details <ide> self.registered_details = []
1
PHP
PHP
correct doc blocks
4f1e24aac2f6c208a52473793560319840d2748c
<ide><path>src/Validation/ValidationSet.php <ide> public function rules() <ide> * <ide> * ``` <ide> * $set <del> * ->add('notEmpty', ['rule' => 'notEmpty']) <add> * ->add('notBlank', ['rule' => 'notBlank']) <ide> * ->add('inRange', ['rule' => ['between', 4, 10]) <ide> * ``` <ide> * <ide> public function add($name, $rule) <ide> * <ide> * ``` <ide> * $set <del> * ->remove('notEmpty') <add> * ->remove('notBlank') <ide> * ->remove('inRange') <ide> * ``` <ide> * <ide><path>src/Validation/Validator.php <ide> public function count() <ide> * <ide> * ``` <ide> * $validator <del> * ->add('title', 'required', ['rule' => 'notEmpty']) <add> * ->add('title', 'required', ['rule' => 'notBlank']) <ide> * ->add('user_id', 'valid', ['rule' => 'numeric', 'message' => 'Invalid User']) <ide> * <ide> * $validator->add('password', [ <ide><path>src/Validation/ValidatorAwareTrait.php <ide> trait ValidatorAwareTrait <ide> * { <ide> * return $validator <ide> * ->add('email', 'valid-email', ['rule' => 'email']) <del> * ->add('password', 'valid', ['rule' => 'notEmpty']) <add> * ->add('password', 'valid', ['rule' => 'notBlank']) <ide> * ->requirePresence('username'); <ide> * } <ide> * ``` <ide> trait ValidatorAwareTrait <ide> * $validator = new \Cake\Validation\Validator($table); <ide> * $validator <ide> * ->add('email', 'valid-email', ['rule' => 'email']) <del> * ->add('password', 'valid', ['rule' => 'notEmpty']) <add> * ->add('password', 'valid', ['rule' => 'notBlank']) <ide> * ->allowEmpty('bio'); <ide> * $table->validator('forSubscription', $validator); <ide> * ```
3
Java
Java
fix cachingresourceresolver key generation
bb3f26483b78bfd03341bab979c00210f1792cd6
<ide><path>spring-webmvc/src/main/java/org/springframework/web/servlet/resource/CachingResourceResolver.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2015 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> * delegates to the resolver chain and saves the result in the cache. <ide> * <ide> * @author Rossen Stoyanchev <add> * @author Brian Clozel <ide> * @since 4.1 <ide> */ <ide> public class CachingResourceResolver extends AbstractResourceResolver { <ide> public Cache getCache() { <ide> protected Resource resolveResourceInternal(HttpServletRequest request, String requestPath, <ide> List<? extends Resource> locations, ResourceResolverChain chain) { <ide> <del> String key = RESOLVED_RESOURCE_CACHE_KEY_PREFIX + requestPath; <add> String key = computeKey(request, requestPath); <ide> Resource resource = this.cache.get(key, Resource.class); <ide> <ide> if (resource != null) { <ide> protected Resource resolveResourceInternal(HttpServletRequest request, String re <ide> return resource; <ide> } <ide> <add> protected String computeKey(HttpServletRequest request, String requestPath) { <add> StringBuilder key = new StringBuilder(RESOLVED_RESOURCE_CACHE_KEY_PREFIX); <add> key.append(requestPath); <add> if(request != null) { <add> String encoding = request.getHeader("Accept-Encoding"); <add> if(encoding != null && encoding.contains("gzip")) { <add> key.append("+encoding=gzip"); <add> } <add> } <add> return key.toString(); <add> } <add> <ide> @Override <ide> protected String resolveUrlPathInternal(String resourceUrlPath, <ide> List<? extends Resource> locations, ResourceResolverChain chain) { <ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/resource/CachingResourceResolverTests.java <ide> /* <del> * Copyright 2002-2014 the original author or authors. <add> * Copyright 2002-2015 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.springframework.cache.concurrent.ConcurrentMapCache; <ide> import org.springframework.core.io.ClassPathResource; <ide> import org.springframework.core.io.Resource; <add>import org.springframework.mock.web.test.MockHttpServletRequest; <ide> <ide> import static org.junit.Assert.*; <ide> <ide> public void resolverUrlPathNoMatch() { <ide> assertNull(this.chain.resolveUrlPath("invalid.css", this.locations)); <ide> } <ide> <add> @Test <add> public void resolveResourceAcceptEncodingInCacheKey() { <add> String file = "bar.css"; <add> <add> MockHttpServletRequest request = new MockHttpServletRequest("GET", file); <add> request.addHeader("Accept-Encoding", "gzip"); <add> Resource expected = this.chain.resolveResource(request, file, this.locations); <add> String cacheKey = CachingResourceResolver.RESOLVED_RESOURCE_CACHE_KEY_PREFIX + file + "+encoding=gzip"; <add> <add> assertEquals(expected, this.cache.get(cacheKey).get()); <add> } <add> <add> @Test <add> public void resolveResourceNoAcceptEncodingInCacheKey() { <add> String file = "bar.css"; <add> <add> MockHttpServletRequest request = new MockHttpServletRequest("GET", file); <add> Resource expected = this.chain.resolveResource(request, file, this.locations); <add> String cacheKey = CachingResourceResolver.RESOLVED_RESOURCE_CACHE_KEY_PREFIX + file; <add> <add> assertEquals(expected, this.cache.get(cacheKey).get()); <add> } <add> <add> @Test <add> public void resolveResourceMatchingEncoding() { <add> Resource resource = Mockito.mock(Resource.class); <add> Resource gzResource = Mockito.mock(Resource.class); <add> this.cache.put(CachingResourceResolver.RESOLVED_RESOURCE_CACHE_KEY_PREFIX + "bar.css", resource); <add> this.cache.put(CachingResourceResolver.RESOLVED_RESOURCE_CACHE_KEY_PREFIX + "bar.css+encoding=gzip", gzResource); <add> <add> MockHttpServletRequest request = new MockHttpServletRequest("GET", "bar.css"); <add> assertSame(resource, this.chain.resolveResource(request,"bar.css", this.locations)); <add> <add> request = new MockHttpServletRequest("GET", "bar.css"); <add> request.addHeader("Accept-Encoding", "gzip"); <add> assertSame(gzResource, this.chain.resolveResource(request, "bar.css", this.locations)); <add> } <add> <ide> } <ide><path>spring-webmvc/src/test/java/org/springframework/web/servlet/resource/GzipResourceResolverTests.java <ide> /* <del> * Copyright 2002-2013 the original author or authors. <add> * Copyright 2002-2015 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide> import org.junit.BeforeClass; <ide> import org.junit.Test; <ide> <add>import org.springframework.cache.Cache; <add>import org.springframework.cache.concurrent.ConcurrentMapCache; <ide> import org.springframework.core.io.ClassPathResource; <ide> import org.springframework.core.io.FileSystemResource; <ide> import org.springframework.core.io.Resource; <ide> <ide> <ide> /** <add> * Unit tests for <add> * {@link org.springframework.web.servlet.resource.GzipResourceResolver}. <ide> * <ide> * @author Jeremy Grelle <ide> */ <ide> public class GzipResourceResolverTests { <ide> <ide> private List<Resource> locations; <ide> <add> private Cache cache; <add> <ide> @BeforeClass <ide> public static void createGzippedResources() throws IOException { <ide> Resource location = new ClassPathResource("test/", GzipResourceResolverTests.class); <ide> public static void createGzippedResources() throws IOException { <ide> <ide> @Before <ide> public void setUp() { <add> this.cache = new ConcurrentMapCache("resourceCache"); <add> <ide> Map<String, VersionStrategy> versionStrategyMap = new HashMap<>(); <ide> versionStrategyMap.put("/**", new ContentVersionStrategy()); <ide> VersionResourceResolver versionResolver = new VersionResourceResolver(); <ide> versionResolver.setStrategyMap(versionStrategyMap); <ide> <ide> List<ResourceResolver> resolvers = new ArrayList<ResourceResolver>(); <add> resolvers.add(new CachingResourceResolver(this.cache)); <ide> resolvers.add(new GzipResourceResolver()); <ide> resolvers.add(versionResolver); <ide> resolvers.add(new PathResourceResolver()); <ide> public void resolveGzippedFile() throws IOException { <ide> Resource resolved = resolver.resolveResource(request, file, locations); <ide> <ide> assertEquals(resource.getDescription(), resolved.getDescription()); <del> assertEquals(new ClassPathResource("test/"+file).getFilename(), resolved.getFilename()); <add> assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename()); <ide> assertTrue("Expected " + resolved + " to be of type " + EncodedResource.class, <ide> resolved instanceof EncodedResource); <ide> } <ide> public void resolveFingerprintedGzippedFile() throws IOException { <ide> assertTrue("Expected " + resolved + " to be of type " + EncodedResource.class, <ide> resolved instanceof EncodedResource); <ide> } <add> <add> @Test <add> public void resolveFromCacheWithEncodingVariants() throws IOException { <add> MockHttpServletRequest request = new MockHttpServletRequest("GET", "/js/foo.js"); <add> request.addHeader("Accept-Encoding", "gzip"); <add> String file = "js/foo.js"; <add> String gzFile = file+".gz"; <add> Resource resource = new ClassPathResource("test/"+file, getClass()); <add> Resource gzResource = new ClassPathResource("test/"+gzFile, getClass()); <add> <add> // resolved resource is now cached in CachingResourceResolver <add> Resource resolved = resolver.resolveResource(request, file, locations); <add> <add> assertEquals(gzResource.getDescription(), resolved.getDescription()); <add> assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename()); <add> assertTrue("Expected " + resolved + " to be of type " + EncodedResource.class, <add> resolved instanceof EncodedResource); <add> <add> request = new MockHttpServletRequest("GET", "/js/foo.js"); <add> resolved = resolver.resolveResource(request, file, locations); <add> assertEquals(resource.getDescription(), resolved.getDescription()); <add> assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename()); <add> assertFalse("Expected " + resolved + " to *not* be of type " + EncodedResource.class, <add> resolved instanceof EncodedResource); <add> } <ide> }
3
PHP
PHP
remove unneeded tests
5721d82315de50adc81eb0fe8167c4c8b18138c6
<ide><path>tests/View/ViewBladeCompilerTest.php <ide> public function testEscapedWithAtEchosAreCompiled() <ide> ')); <ide> } <ide> <del> public function testReversedEchosAreCompiled() <del> { <del> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <del> $compiler->setEscapedContentTags('{{', '}}'); <del> $compiler->setContentTags('{{{', '}}}'); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('{{$name}}')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('{{{$name}}}')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('{{{ $name }}}')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('{{{ <del> $name <del> }}}')); <del> } <del> <del> public function testShortRawEchosAreCompiled() <del> { <del> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <del> $compiler->setRawTags('{{', '}}'); <del> $this->assertEquals('<?php echo $name; ?>', $compiler->compileString('{{$name}}')); <del> $this->assertEquals('<?php echo $name; ?>', $compiler->compileString('{{ $name }}')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('{{{$name}}}')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('{{{ $name }}}')); <del> } <del> <ide> public function testExtendsAreCompiled() <ide> { <ide> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <ide> public function testCustomShortStatements() <ide> $this->assertEquals($expected, $compiler->compileString($string)); <ide> } <ide> <del> public function testConfiguringContentTags() <del> { <del> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <del> $compiler->setContentTags('[[', ']]'); <del> $compiler->setEscapedContentTags('[[[', ']]]'); <del> <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('[[[ $name ]]]')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('[[ $name ]]')); <del> $this->assertEquals('<?php echo e($name); ?>', $compiler->compileString('[[ <del> $name <del> ]]')); <del> } <del> <ide> public function testRawTagsCanBeSetToLegacyValues() <ide> { <ide> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <ide> public function testSequentialCompileStringCalls() <ide> $this->assertEquals($expected, $compiler->compileString($string)); <ide> } <ide> <del> /** <del> * @dataProvider testGetTagsProvider() <del> */ <del> public function testSetAndRetrieveContentTags($openingTag, $closingTag) <del> { <del> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <del> $compiler->setContentTags($openingTag, $closingTag); <del> $this->assertSame([$openingTag, $closingTag], $compiler->getContentTags()); <del> } <del> <del> /** <del> * @dataProvider testGetTagsProvider() <del> */ <del> public function testSetAndRetrieveEscapedContentTags($openingTag, $closingTag) <del> { <del> $compiler = new BladeCompiler($this->getFiles(), __DIR__); <del> $compiler->setEscapedContentTags($openingTag, $closingTag); <del> $this->assertSame([$openingTag, $closingTag], $compiler->getEscapedContentTags()); <del> } <del> <ide> public function testGetTagsProvider() <ide> { <ide> return [
1
Javascript
Javascript
extend image.android to support analyticstag prop
1c10568967231cce2be01d2341f4edb79d57ec48
<ide><path>Libraries/Image/Image.android.js <ide> const ImageProps = { <ide> ]): React$PropType$Primitive<{uri?: string, ...} | number>), <ide> progressiveRenderingEnabled: PropTypes.bool, <ide> fadeDuration: PropTypes.number, <add> /** <add> * Analytics Tag used by this Image <add> */ <add> analyticTag: PropTypes.string, <ide> /** <ide> * Invoked on load start <ide> */ <ide><path>Libraries/Image/ImageProps.js <ide> export type ImageProps = {| <ide> */ <ide> accessible?: ?boolean, <ide> <add> /** <add> * Analytics Tag used by this Image <add> */ <add> analyticTag?: ?string, <add> <ide> /** <ide> * The text that's read by the screen reader when the user interacts with <ide> * the image.
2
PHP
PHP
support multiple guesses for policy resolution
d88dfe1e5925fa61f62837359e1b26f799e4110b
<ide><path>src/Illuminate/Auth/Access/Gate.php <ide> public function getPolicyFor($class) <ide> return $this->resolvePolicy($this->policies[$class]); <ide> } <ide> <del> if (class_exists($guessedPolicy = $this->guessPolicyName($class))) { <del> return $this->resolvePolicy($guessedPolicy); <add> foreach ($this->guessPolicyName($class) as $guessedPolicy) { <add> if (class_exists($guessedPolicy)) { <add> return $this->resolvePolicy($guessedPolicy); <add> } <ide> } <ide> <ide> foreach ($this->policies as $expected => $policy) { <ide> public function getPolicyFor($class) <ide> * Guess the policy name for the given class. <ide> * <ide> * @param string $class <del> * @return string <add> * @return array <ide> */ <ide> protected function guessPolicyName($class) <ide> { <ide> if ($this->guessPolicyNamesUsingCallback) { <del> return call_user_func($this->guessPolicyNamesUsingCallback, $class); <add> return Arr::wrap(call_user_func($this->guessPolicyNamesUsingCallback, $class)); <ide> } <ide> <ide> $classDirname = str_replace('/', '\\', dirname(str_replace('\\', '/', $class))); <ide> <del> return $classDirname.'\\Policies\\'.class_basename($class).'Policy'; <add> return [$classDirname.'\\Policies\\'.class_basename($class).'Policy']; <ide> } <ide> <ide> /** <ide><path>tests/Integration/Auth/GatePolicyResolutionTest.php <ide> public function testPolicyCanBeGuessedUsingClassConventions() <ide> Gate::getPolicyFor(AuthenticationTestUser::class) <ide> ); <ide> } <add> <add> public function testPolicyCanBeGuessedUsingCallback() <add> { <add> Gate::guessPolicyNamesUsing(function () { <add> return AuthenticationTestUserPolicy::class; <add> }); <add> <add> $this->assertInstanceOf( <add> AuthenticationTestUserPolicy::class, <add> Gate::getPolicyFor(AuthenticationTestUser::class) <add> ); <add> } <add> <add> public function testPolicyCanBeGuessedMultipleTimes() <add> { <add> Gate::guessPolicyNamesUsing(function () { <add> return [ <add> 'App\\Policies\\TestUserPolicy', <add> AuthenticationTestUserPolicy::class <add> ]; <add> }); <add> <add> $this->assertInstanceOf( <add> AuthenticationTestUserPolicy::class, <add> Gate::getPolicyFor(AuthenticationTestUser::class) <add> ); <add> } <ide> }
2
Ruby
Ruby
move `select_rows` implementation to super class
c1ab4a2dbf89a52d90318323885834008aff3007
<ide><path>activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb <ide> def select_values(arel, name = nil, binds = []) <ide> # Returns an array of arrays containing the field values. <ide> # Order is the same as that returned by +columns+. <ide> def select_rows(sql, name = nil, binds = []) <del> raise NotImplementedError <add> exec_query(sql, name, binds).rows <ide> end <ide> <ide> # Executes the SQL statement in the context of this connection and returns <ide><path>activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb <ide> def execute(sql, name = nil) #:nodoc: <ide> log(sql, name) { @connection.execute(sql) } <ide> end <ide> <del> def select_rows(sql, name = nil, binds = []) <del> exec_query(sql, name, binds).rows <del> end <del> <ide> def begin_db_transaction #:nodoc: <ide> log('begin transaction',nil) { @connection.transaction } <ide> end
2
Text
Text
fix typo in homebrew/linuxbrew-core repo name
3771a607204f3670155bbb29c2ccd497110f4797
<ide><path>docs/Homebrew-linuxbrew-core-Maintainer-Guide.md <del># Homebrew linuxbrew-core Maintainer Guide <add># Homebrew/linuxbrew-core Maintainer Guide <ide> <ide> ## Merging formulae updates from Homebrew/homebrew-core <ide>
1
Javascript
Javascript
use null for the error argument
2b32985c626b57d7ea3e68d6ce088ea3183e3a58
<ide><path>lib/internal/streams/writable.js <ide> function afterWrite(stream, state, count, cb) { <ide> <ide> while (count-- > 0) { <ide> state.pendingcb--; <del> cb(); <add> cb(null); <ide> } <ide> <ide> if (state.destroyed) { <ide> Writable.prototype.end = function(chunk, encoding, cb) { <ide> } <ide> <ide> if (typeof cb === 'function') { <del> if (err || state.finished) { <add> if (err) { <ide> process.nextTick(cb, err); <add> } else if (state.finished) { <add> process.nextTick(cb, null); <ide> } else { <ide> state[kOnFinished].push(cb); <ide> } <ide> function finish(stream, state) { <ide> <ide> const onfinishCallbacks = state[kOnFinished].splice(0); <ide> for (let i = 0; i < onfinishCallbacks.length; i++) { <del> onfinishCallbacks[i](); <add> onfinishCallbacks[i](null); <ide> } <ide> <ide> stream.emit('finish'); <ide><path>test/parallel/test-stream-writable-end-cb-error.js <ide> const stream = require('stream'); <ide> let called = false; <ide> writable.end('asd', common.mustCall((err) => { <ide> called = true; <del> assert.strictEqual(err, undefined); <add> assert.strictEqual(err, null); <ide> })); <ide> <ide> writable.on('error', common.mustCall((err) => { <ide><path>test/parallel/test-stream2-writable.js <ide> for (let i = 0; i < chunks.length; i++) { <ide> { <ide> // Verify write callbacks <ide> const callbacks = chunks.map(function(chunk, i) { <del> return [i, function() { <add> return [i, function(err) { <add> assert.strictEqual(err, null); <ide> callbacks._called[i] = chunk; <ide> }]; <ide> }).reduce(function(set, x) { <ide> for (let i = 0; i < chunks.length; i++) { <ide> { <ide> // Verify end() callback <ide> const tw = new TestWriter(); <del> tw.end(common.mustCall()); <add> tw.end(common.mustCall(function(err) { <add> assert.strictEqual(err, null); <add> })); <ide> } <ide> <ide> const helloWorldBuffer = Buffer.from('hello world'); <ide> <ide> { <ide> // Verify end() callback with chunk <ide> const tw = new TestWriter(); <del> tw.end(helloWorldBuffer, common.mustCall()); <add> tw.end(helloWorldBuffer, common.mustCall(function(err) { <add> assert.strictEqual(err, null); <add> })); <ide> } <ide> <ide> {
3
Javascript
Javascript
convert ambient to class
273871385e5651212d69ac8a3c06f43b9414fa11
<ide><path>src/lights/AmbientLight.js <ide> import { Light } from './Light.js'; <ide> <del>function AmbientLight( color, intensity ) { <add>class AmbientLight extends Light { <ide> <del> Light.call( this, color, intensity ); <add> constructor( color, intensity ) { <ide> <del> this.type = 'AmbientLight'; <add> super( color, intensity ); <ide> <del>} <del> <del>AmbientLight.prototype = Object.assign( Object.create( Light.prototype ), { <add> this.type = 'AmbientLight'; <add> Object.defineProperty( this, 'isAmbientLight', { value: true } ); <ide> <del> constructor: AmbientLight, <add> } <ide> <del> isAmbientLight: true <del> <del>} ); <add>} <ide> <ide> <ide> export { AmbientLight };
1
Mixed
Ruby
remove standard_compilers & references to it
178a4e55c2ccc75773c2bf22d48158f9ec6432eb
<ide><path>Library/Homebrew/os/mac.rb <ide> def preferred_arch <ide> end <ide> end <ide> <del> STANDARD_COMPILERS = { <del> "6.0" => { clang: "6.0", clang_build: 600 }, <del> "6.0.1" => { clang: "6.0", clang_build: 600 }, <del> "6.1" => { clang: "6.0", clang_build: 600 }, <del> "6.1.1" => { clang: "6.0", clang_build: 600 }, <del> "6.2" => { clang: "6.0", clang_build: 600 }, <del> "6.3" => { clang: "6.1", clang_build: 602 }, <del> "6.3.1" => { clang: "6.1", clang_build: 602 }, <del> "6.3.2" => { clang: "6.1", clang_build: 602 }, <del> "6.4" => { clang: "6.1", clang_build: 602 }, <del> "7.0" => { clang: "7.0", clang_build: 700 }, <del> "7.0.1" => { clang: "7.0", clang_build: 700 }, <del> "7.1" => { clang: "7.0", clang_build: 700 }, <del> "7.1.1" => { clang: "7.0", clang_build: 700 }, <del> "7.2" => { clang: "7.0", clang_build: 700 }, <del> "7.2.1" => { clang: "7.0", clang_build: 700 }, <del> "7.3" => { clang: "7.3", clang_build: 703 }, <del> "7.3.1" => { clang: "7.3", clang_build: 703 }, <del> "8.0" => { clang: "8.0", clang_build: 800 }, <del> "8.1" => { clang: "8.0", clang_build: 800 }, <del> "8.2" => { clang: "8.0", clang_build: 800 }, <del> "8.2.1" => { clang: "8.0", clang_build: 800 }, <del> "8.3" => { clang: "8.1", clang_build: 802 }, <del> "8.3.1" => { clang: "8.1", clang_build: 802 }, <del> "8.3.2" => { clang: "8.1", clang_build: 802 }, <del> "8.3.3" => { clang: "8.1", clang_build: 802 }, <del> "9.0" => { clang: "9.0", clang_build: 900 }, <del> "9.0.1" => { clang: "9.0", clang_build: 900 }, <del> "9.1" => { clang: "9.0", clang_build: 900 }, <del> "9.2" => { clang: "9.0", clang_build: 900 }, <del> "9.3" => { clang: "9.1", clang_build: 902 }, <del> "9.4" => { clang: "9.1", clang_build: 902 }, <del> "10.0" => { clang: "10.0", clang_build: 1000 }, <del> "10.1" => { clang: "10.0", clang_build: 1000 }, <del> "10.2" => { clang: "10.0", clang_build: 1001 }, <del> "10.2.1" => { clang: "10.0", clang_build: 1001 }, <del> "11.0" => { clang: "11.0", clang_build: 1100 }, <del> }.freeze <del> <del> def compilers_standard? <del> STANDARD_COMPILERS.fetch(Xcode.version.to_s).all? do |method, build| <del> send(:"#{method}_version") == build <del> end <del> rescue IndexError <del> onoe <<~EOS <del> Homebrew doesn't know what compiler versions ship with your version <del> of Xcode (#{Xcode.version}). Please `brew update` and if that doesn't <del> help, file an issue with the output of `brew --config`: <del> #{Formatter.url("https://github.com/Homebrew/brew/issues")} <del> <del> Note that we only track stable, released versions of Xcode. <del> <del> Thanks! <del> EOS <del> end <del> <ide> def app_with_bundle_id(*ids) <ide> path = mdfind(*ids) <ide> .reject { |p| p.include?("/Backups.backupdb/") } <ide><path>docs/Xcode.md <ide> Homebrew supports and recommends the latest Xcode and/or Command Line <ide> Tools available for your platform (see `OS::Mac::Xcode.latest_version` and `OS::Mac::CLT.latest_version` in [`Library/Homebrew/os/mac/xcode.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac/xcode.rb)). <ide> <del>## Xcode compiler versions <del> <del>See `OS::Mac::STANDARD_COMPILERS` in [`Library/Homebrew/os/mac.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac.rb). <del> <ide> ## Updating for new Xcode releases <ide> When a new Xcode release is made, the following things need to be <ide> updated: <ide> updated: <ide> * `OS::Mac::Xcode.latest_version` <ide> * `OS::Mac::CLT.latest_version` <ide> * `OS::Mac::Xcode.detect_version_from_clang_version` <del>* In [`Library/Homebrew/os/mac.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/os/mac.rb) <del> * `OS::Mac::STANDARD_COMPILERS`
2
PHP
PHP
allow wherehas on belongsto relations
e21766c81d30bbe06c4860b7f6ff9a055abb27a0
<ide><path>src/Illuminate/Database/Eloquent/Relations/BelongsTo.php <ide> use LogicException; <ide> use Illuminate\Database\Eloquent\Model; <ide> use Illuminate\Database\Eloquent\Builder; <add>use Illuminate\Database\Query\Expression; <ide> use Illuminate\Database\Eloquent\Collection; <ide> <ide> class BelongsTo extends Relation { <ide> public function addConstraints() <ide> */ <ide> public function getRelationCountQuery(Builder $query) <ide> { <del> throw new LogicException('Has method invalid on "belongsTo" relations.'); <add> $query->select(new Expression('count(*)')); <add> <add> $otherKey = $this->wrap($query->getModel()->getTable().'.'.$this->otherKey); <add> <add> return $query->where($this->getQualifiedForeignKey(), '=', new Expression($otherKey)); <ide> } <ide> <ide> /** <ide> public function getForeignKey() <ide> return $this->foreignKey; <ide> } <ide> <add> /** <add> * Get the fully qualified foreign key of the relationship. <add> * <add> * @return string <add> */ <add> public function getQualifiedForeignKey() <add> { <add> return $this->parent->getTable().'.'.$this->foreignKey; <add> } <add> <ide> } <ide>\ No newline at end of file
1
Text
Text
update links and workflow
a45c2c4f1510bee79916d515fbddaa25d4e32161
<ide><path>docs/devops.md <ide> <!-- do not translate this --> <add> <ide> | [Read these guidelines in other languages](/docs/i18n-languages) | <del>|-| <add>| ---------------------------------------------------------------- | <add> <add> <ide> <!-- do not translate this --> <ide> <ide> # Developer Operations at freeCodeCamp.org <ide> Let us know, if you have feedback or queries, and we will be happy to clarify. <ide> <ide> ## How do we build, test and deploy the codebase? <ide> <del>Our codebase is continuously built, tested and deployed to **separate sets of infrastructure (Servers, Databases, CDNs, etc.)**. <add>Our codebase is continuously built, tested and deployed to **separate sets of infrastructure (Servers, Databases, CDNs, etc.)**. <ide> <ide> This involves three steps to be followed in sequence: <ide> <del>First, new changes are merged into our primary development branch (`master`) in form of pull requests. Next, these changes are run through a series of automated tests. And finally, once the tests pass we release the changes (or update them if needed) to deployments on our infrastructure. <add>1. New changes (both fixes and features) are merged into our primary development branch (`master`) via pull requests. <add>2. These changes are run through a series of automated tests. <add>3. Once the tests pass we release the changes (or update them if needed) to deployments on our infrastructure. <ide> <del>### Building the codebase - Mapping Git Branches to Deployments. <add>#### Building the codebase - Mapping Git Branches to Deployments. <ide> <ide> Typically, [`master`](https://github.com/freeCodeCamp/freeCodeCamp/tree/master) (the default development branch) is merged into the [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) branch once a day and is released into an isolated infrastructure. <ide> <del>This is an intermediate release for our developers and volunteer contributors. It also known as our "staging/beta" application. <add>This is an intermediate release for our developers and volunteer contributors. It also known as our "staging" or "beta" release. <ide> <ide> It is identical to our live production environment at `freeCodeCamp.org`, other than it using a separate set of databases, servers, web-proxies, etc. This isolation lets us test ongoing development and features in a "production" like scenario, without affecting regular users of freeCodeCamp.org's main platforms. <ide> <del>Once the developer team [`@freeCodeCamp/dev-team`](https://github.com/orgs/freeCodeCamp/teams/dev-team/members) is happy with the changes on the staging application, these changes are moved every few days to the [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-current) branch. <add>Once the developer team [`@freeCodeCamp/dev-team`](https://github.com/orgs/freeCodeCamp/teams/dev-team/members) is happy with the changes on the staging platform, these changes are moved every few days to the [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-current) branch. <ide> <ide> This is the final release that moves changes to our production platforms on freeCodeCamp.org. <ide> <del>### Testing changes - Integration and User Acceptance Testing. <add>#### Testing changes - Integration and User Acceptance Testing. <ide> <ide> We employ various levels of integration and acceptance testing to check on the quality of the code. All our tests are done through software like [Travis CI](https://travis-ci.org/freeCodeCamp/freeCodeCamp) and [Azure Pipelines](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp). <ide> <ide> We have unit tests for testing our challenge solutions, Server APIs and Client User interfaces. These help us test the integration between different components. <ide> <ide> > Note: We are also in the process of writing end user tests which will help in replicating real world scenarios like updating an email or making a call to the API or third-party services. <ide> <del>Together these tests help in preventing issues from repeating themselves and ensure we do not introduce a bug while working on another bug or a feature. <del> <del>### Deploying Changes - Pushing changes to servers. <add>Together these tests help in preventing issues from repeating themselves and ensure we do not introduce a bug while working on another bug or a feature. <ide> <del>We have configured continuous delivery software to push changes to our development and production servers. Once the changes are pushed to the protected release branches, these should trigger our build and release pipelines: <add>#### Deploying Changes - Pushing changes to servers. <ide> <del>You can take a look and browse these here: <add>We have configured continuous delivery software to push changes to our development and production servers. <ide> <del>| Build Pipeline | Release Pipeline | <del>| :------------- | :--------------- | <del>| Setup to build artifacts for deployments. | Setup to deploy artifacts to their destination servers. | <del>| [Go to builds](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build) | [Go to releases](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <add>Once the changes are pushed to the protected release branches, a build pipeline is automatically triggered for the branch. The build pipelines are responsible for building artefacts and keeping them in a cold storage for later use. <ide> <del>The build pipeline triggers the release pipeline after a hold of 5 minutes for our staff to go in and intervene if necessary. <del>The code/config is publicly accessible on Azure's Dev Dashboard. Write access to this is limited to the freeCodeCamp.org staff team. <add>The build pipeline goes on to trigger a corresponding release pipeline if it completes a successful run. The release pipelines are responsible for collecting the build artefacts, moving them to the servers and going live. <ide> <del>We recommend not pushing more than 3-4 builds to the pipelines within a day and not more than one within the hour. This is because our artifacts are quite large and would put a load on our servers when deploying. <add>Status of builds and releases are [available here](#build-and-deployment-status). <ide> <ide> ## Triggering a build, test and deployment. <ide> <ide> Currently, only members on the developer team can push to the production branche <ide> 1. Configure your remotes correctly. <ide> <ide> ```sh <del> freeCodeCamp on master is 📦 v0.0.1 via ⬢ v10.16.0 <del> ❯ git remote -v <add> git remote -v <add> ``` <add> <add> **Results:** <add> <add> ``` <ide> origin [email protected]:raisedadead/freeCodeCamp.git (fetch) <ide> origin [email protected]:raisedadead/freeCodeCamp.git (push) <ide> upstream [email protected]:freeCodeCamp/freeCodeCamp.git (fetch) <ide> Currently, only members on the developer team can push to the production branche <ide> <ide> 3. Check that the Travis CI is passing on the `master` branch for upstream. <ide> <del> The [continuous integration](https://travis-ci.org/freeCodeCamp/freeCodeCamp/branches) tests should be green and PASSING for the `master` branch. <add> The [continuous integration](https://travis-ci.com/github/freeCodeCamp/freeCodeCamp/branches) tests should be green and PASSING for the `master` branch. <ide> <ide> <details> <ide> <summary> <ide> Currently, only members on the developer team can push to the production branche <ide> git push upstream <ide> ``` <ide> <del> You will not be able to force push and if you have re-written the history in anyway these commands will error out. If they do, you may have done something incorrectly and you should just start over. <add> **Note:** You will not be able to force push and if you have re-written the history in anyway these commands will error out. If they do, you may have done something incorrectly and you should just start over. <ide> <del>And that's it, this will automatically trigger a build on the build pipeline for the `production-staging` branch. Typically this takes ~20-25 minutes for the all the applications. Once the build is complete, it will save the artifacts as `.zip` files in a cold storage to be retrieved and used by the release pipeline. <add>The above steps will automatically trigger a run on the build pipeline for the `production-staging` branch. Once the build is complete, the artifacts are saved as `.zip` files in a cold storage to be retrieved and used later. <ide> <del>The release pipeline automatically triggers itself when a fresh artifact is available from the connected build pipeline. For the staging applications this is completely automated and the artifacts are pushed to the client CDN and the API servers. They typically take ~15-20 mins for the client, and ~5 mins for the API servers to be available live. <add>The release pipeline is triggered automatically when a fresh artifact is available from the connected build pipeline. For staging platforms, this process does not involve manual approval and the artifacts are pushed to the Client CDN and API servers. <ide> <del>This makes each release from code push to being available on the staging applications ~60 mins. <add>> **Estimates:** <add>> <add>> Typically the build run takes ~20-25 minutes to complete followed by the release run which takes ~15-20 mins for the client, and ~5-10 mins for the API to be available live. From code push to being live on the staging platforms the whole process takes **~35-45 mins** in total. <ide> <ide> ### Pushing changes to Production Applications. <ide> <del>The process is mostly the same as the staging applications, with a few extra checks in place. This is just to make sure, we do not break anything on freeCodeCamp.org which can see hundreds of users using it at any moment. <add>The process is mostly the same as the staging platforms, with a few extra checks in place. This is just to make sure, we do not break anything on freeCodeCamp.org which can see hundreds of users using it at any moment. <add> <add>| Do NOT execute these commands unless you have verified that everything is working on the staging platform. You should not bypass or skip any testing on staging before proceeding further. | <add>| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | <ide> <del>> #### DO NOT execute these commands until you have verified that everything is working on the staging application. You should not bypass or skip any testing on staging before proceeding further. <ide> <ide> 1. Make sure your `production-staging` branch is pristine and in sync with the upstream. <ide> <ide> The process is mostly the same as the staging applications, with a few extra che <ide> git push upstream <ide> ``` <ide> <del> You will not be able to force push and if you have re-written the history in anyway these commands will error out. If they do, you may have done something incorrectly and you should just start over. <del> <del>And that's it, this will automatically trigger a build on the build pipeline for the `production-current` branch. Typically this also takes ~20-25 minutes for the all the applications like explained previously. <del> <del>Here are some additional steps that need to be followed by a freeCodeCamp.org Staff developer. To prevent any accidental pushes we have a couple of manual approval steps configured on the pipelines. <del> <del>Once a build artifact is ready on the `production-current` branch, it will trigger a release on the release pipeline. <add> **Note:** You will not be able to force push and if you have re-written the history in anyway these commands will error out. If they do, you may have done something incorrectly and you should just start over. <ide> <del>Next, the freeCodeCamp.org developer staff team will receive an email. They can either *approve* or *reject* the release. If the changes are working nicely and have been tested on the staging application, then it can be approved. This must happen within 4 hours of the release being triggered or it will automatically get rejected. If this happens a staff member will need to re-trigger the release pipeline manually. <add>The above steps will automatically trigger a run on the build pipeline for the `production-current` branch. Once a build artifact is ready, it will trigger a run on the release pipeline. <ide> <del>For staff use: <add>> **Estimates:** Typically the build run takes ~20-25 minutes to complete. <ide> <del>| Approve Release | <del>| :-------------: | <del>| Check your email for a direct link or [Open release dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release?_a=releases&view=mine&definitionId=6) | <add>**Additional Steps for Staff Action** <ide> <del>Once one of the members approves a release, the pipeline will push the changes live to freeCodeCamp.org's production CDN and API servers. They typically take ~15-20 mins for the client, and ~5 mins for the API servers to be available live. <add>One a release run is triggered, members of the developer staff team will receive an automated manual intervention email. They can either _approve_ or _reject_ the release run. <ide> <del>As a final step, a staff member will also manually click the publish deploy button on Netlify's deployment's dashboard. <add>If the changes are working nicely and have been tested on the staging platform, then it can be approved. The approval must be given within 4 hours of the release being triggered before getting rejected automatically. A staff can re-trigger the release run manually for rejected runs, or wait for the next cycle of release. <ide> <ide> For staff use: <ide> <del>| Publish or Rollback on Netlify | <del>| :----------------------------: | <del>| [Open Netlify deployments](https://app.netlify.com/sites/freecodecamp-org/deploys) | <del> <add>| Check your email for a direct link or [go to the release dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) after the build run is complete. | <add>| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | <ide> <del>## Build and Deployment Status <ide> <del>Here is the current build and deployment status of the codebase. <add>Once one of the staff members approves a release, the pipeline will push the changes live to freeCodeCamp.org's production CDN and API servers. They typically take ~15-20 mins for the client, and ~5 mins for the API servers to be available live. <ide> <del>### Build Status <add>> **Estimates:** <add>> <add>> The release run typically takes ~15-20 mins for each client instance, and ~5-10 mins for each API instance to be available live. From code push to being live on the production platforms the whole process takes **~90-120 mins** in total (not counting the wait time for the staff approval). <ide> <del>| Platform | Type | Status | <del>| :-------------- | :--------- | :---------: | <del>| Travis CI | Unit Tests | [![Travis CI Build Status](https://travis-ci.org/freeCodeCamp/freeCodeCamp.svg?branch=master)](https://travis-ci.org/freeCodeCamp/freeCodeCamp) | <del>| Azure Pipelines | Artifacts | [![Azure Pipelines Build Status](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_apis/build/status/freeCodeCamp-CI)](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build) | <add>## Test, Build and Deployment Status <ide> <del>### Deployment Status <add>Here is the current test, build and deployment status of the codebase. <ide> <del>| Application | Version | Status | <del>| :----------- | :--------- | :---------: | <del>| Client | Beta/Next | [![Azure Pipelines Deployment Status](https://vsrm.dev.azure.com/freeCodeCamp-org/_apis/public/Release/badge/4b80aded-11d9-49ea-9b7d-596e98ff07c4/4/8)](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <del>| API | Beta/Next | [![Azure Pipelines Deployment Status](https://vsrm.dev.azure.com/freeCodeCamp-org/_apis/public/Release/badge/4b80aded-11d9-49ea-9b7d-596e98ff07c4/4/9)](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <del>| Client | Production | [![Azure Pipelines Deployment Status](https://vsrm.dev.azure.com/freeCodeCamp-org/_apis/public/Release/badge/4b80aded-11d9-49ea-9b7d-596e98ff07c4/6/22)](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <del>| API | Production | [![Azure Pipelines Deployment Status](https://vsrm.dev.azure.com/freeCodeCamp-org/_apis/public/Release/badge/4b80aded-11d9-49ea-9b7d-596e98ff07c4/6/23)](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <add>| Type | Branch | Status | Dashboard | <add>| :--------------- | :------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | <add>| CI Tests | [`master`](https://github.com/freeCodeCamp/freeCodeCamp/tree/master) | ![Travis CI Build Status](https://travis-ci.com/freeCodeCamp/freeCodeCamp.svg?branch=master) | [Go to status dashboard](https://travis-ci.com/github/freeCodeCamp/freeCodeCamp/branches) | <add>| CI Tests | [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | ![Travis CI Build Status](https://travis-ci.com/freeCodeCamp/freeCodeCamp.svg?branch=production-staging) | [Go to status dashboard](https://travis-ci.com/github/freeCodeCamp/freeCodeCamp/branches) | <add>| CI Tests | [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-current) | ![Travis CI Build Status](https://travis-ci.com/freeCodeCamp/freeCodeCamp.svg?branch=production-current) | [Go to status dashboard](https://travis-ci.com/github/freeCodeCamp/freeCodeCamp/branches) | <add>| Build Pipeline | [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build) | <add>| Build Pipeline | [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_build) | <add>| Release Pipeline | [`production-staging`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <add>| Release Pipeline | [`production-current`](https://github.com/freeCodeCamp/freeCodeCamp/tree/production-staging) | | [Go to status dashboard](https://dev.azure.com/freeCodeCamp-org/freeCodeCamp/_release) | <ide> <del>## Early access and beta testing upcoming versions of freeCodeCamp.org's platform and curriculum <add>## Early access and beta testing <ide> <ide> We welcome you to test these releases in a **"public beta testing"** mode and get early access to upcoming features to the platforms. Sometimes these features/changes are referred to as **next, beta, staging,** etc. interchangeably. <ide> <ide> Your contributions via feedback and issue reports will help us in making the production platforms at `freeCodeCamp.org` more **resilient**, **consistent** and **stable** for everyone. <ide> <ide> We thank you for reporting bugs that you encounter and help in making freeCodeCamp.org better. You rock! <ide> <del>## Identifying the upcoming version of platform <add>### Identifying the upcoming version of the platforms <ide> <del>The domain name will be different than **`freeCodeCamp.org`**. Currently this public beta testing version is available at: <add>Currently a public beta testing version is available at: <ide> <del><h3 align="center"><a href='https://www.freecodecamp.dev' _target='blank'><code>www.freecodecamp.dev</code></a></h4> <add><h3 align="center"><a href='https://www.freecodecamp.dev' _target='blank'><code>www.freecodecamp.dev</code></a></h3> <ide> <del>To prevent accidental indexing on search engines and users accidentally using this site (without knowledge of it being a development site) is closed off with a simple password: <add>>**Note:** The domain name is different than **`freeCodeCamp.org`**. This is intentional to prevent search engine indexing and avoid confusion for regular users of the platform. <ide> <del><h3 align="center"><code>freecodecamp-is-awesome</code></h4> <del> <del>## Identifying the current version of platform <add>### Identifying the current version of the platforms <ide> <ide> **The current version of the platform is always available at [`freeCodeCamp.org`](https://www.freecodecamp.org).** <ide> <del>The dev-team merges changes from the `production-staging` branch to `production-current` when they release changes. The top commit should be what you see live on the site. You can identify the exact version deployed by visiting the build and deployment logs available below in the status section. <add>The dev-team merges changes from the `production-staging` branch to `production-current` when they release changes. The top commit should be what you see live on the site. <add> <add>You can identify the exact version deployed by visiting the build and deployment logs available in the status section. Alternatively you can also ping us in the [contributors chat room](https://gitter.im/FreeCodeCamp/Contributors) for a confirmation. <ide> <del>## Known Limitations <add>### Known Limitations <ide> <del>There will be some known limitations and tradeoffs when using the beta version of the platform. <add>There are some known limitations and tradeoffs when using the beta version of the platform. <ide> <del>- #### All data / personal progress on these beta applications `will NOT be saved or carried over` to production. <add>- #### All data / personal progress on these beta platforms `will NOT be saved or carried over` to production. <ide> <ide> **Users on the beta version will have a separate account from the production.** The beta version uses a physically separate database from production. This gives us the ability to prevent any accidental loss of data or modifications. The dev team may purge the database on this beta version as needed. <ide> <del>- #### There are no guarantees on the uptime and reliability of the beta applications. <add>- #### There are no guarantees on the uptime and reliability of the beta platforms. <ide> <ide> Deployment is expected to be frequent and in rapid iterations, sometimes multiple times a day. As a result there will be unexpected downtime at times or broken functionality on the beta version. <ide>
1
PHP
PHP
fix 5.4 only syntax
1ce89545bd9f267713d6238e97387d9412cc25c6
<ide><path>lib/Cake/Test/Case/Cache/CacheTest.php <ide> public function testSetOnAlternateConfigs() { <ide> */ <ide> public function testRemember() { <ide> $expected = 'This is some data 0'; <del> $result = Cache::remember('test_key', [$this, 'cacher'], 'default'); <add> $result = Cache::remember('test_key', array($this, 'cacher'), 'default'); <ide> $this->assertEquals($expected, $result); <ide> <ide> $this->_count = 1; <del> $result = Cache::remember('test_key', [$this, 'cacher'], 'default'); <add> $result = Cache::remember('test_key', array($this, 'cacher'), 'default'); <ide> $this->assertEquals($expected, $result); <ide> } <ide>
1
Javascript
Javascript
remove trailing comma
1b43272ae81ff8154fff7182a03fe3c18d46569b
<ide><path>index.js <ide> export { <ide> formatSpecifier, <ide> precisionFixed, <ide> precisionPrefix, <del> precisionRound, <add> precisionRound <ide> } from "d3-format"; <ide> <ide> export {
1
Javascript
Javascript
remove assert message
c7d291366eb9cd87e8aa3f9fad93e5c8f072b22f
<ide><path>test/pummel/test-stream-pipe-multi.js <ide> FakeStream.prototype.close = function() { <ide> <ide> // expect all streams to close properly. <ide> process.on('exit', function() { <del> assert.strictEqual(cnt, wclosed, 'writable streams closed'); <del> assert.strictEqual(cnt, rclosed, 'readable streams closed'); <add> assert.strictEqual(cnt, wclosed); <add> assert.strictEqual(cnt, rclosed); <ide> }); <ide> <ide> for (let i = 0; i < chunkSize; i++) {
1
Ruby
Ruby
memoize the result of gsubbing @virtual_path
05eaa07627376626902bd7acde35406edf1bb2f2
<ide><path>actionview/lib/action_view/helpers/translation_helper.rb <ide> def localize(*args) <ide> <ide> private <ide> def scope_key_by_partial(key) <del> if key.to_s.first == "." <add> stringified_key = key.to_s <add> if stringified_key.first == "." <ide> if @virtual_path <del> @virtual_path.gsub(%r{/_?}, ".") + key.to_s <add> @_scope_key_by_partial_cache ||= {} <add> @_scope_key_by_partial_cache[@virtual_path] ||= @virtual_path.gsub(%r{/_?}, ".") <add> "#{@_scope_key_by_partial_cache[@virtual_path]}#{stringified_key}" <ide> else <ide> raise "Cannot use t(#{key.inspect}) shortcut because path is not available" <ide> end
1
Ruby
Ruby
remove unreachable branch
6545e6dad3081baac176e1519206b2b9de7ff233
<ide><path>Library/Homebrew/formula_installer.rb <ide> def check_requirements(req_map) <ide> <ide> def install_requirement_default_formula?(req, dependent, build) <ide> return false unless req.default_formula? <del> return false if build.without?(req) && (req.recommended? || req.optional?) <ide> return true unless req.satisfied? <ide> install_bottle_for?(dependent, build) || build_bottle? <ide> end
1
Python
Python
remove old deprecation classes for 3.14 release
f34f1562ffc880078ac8517dcd818f7cc56edff5
<ide><path>rest_framework/__init__.py <ide> default_app_config = 'rest_framework.apps.RestFrameworkConfig' <ide> <ide> <del>class RemovedInDRF313Warning(DeprecationWarning): <del> pass <del> <del> <del>class RemovedInDRF314Warning(PendingDeprecationWarning): <del> pass <del> <del> <ide> class RemovedInDRF315Warning(PendingDeprecationWarning): <ide> pass
1
Ruby
Ruby
apply suggestions from code review
5657e109afb8a0c2a9cfaadf6b7aa2a872c5f7f0
<ide><path>Library/Homebrew/dev-cmd/tap-new.rb <ide> def tap_new <ide> titleized_repo = tap.repo.dup <ide> titleized_user[0] = titleized_user[0].upcase <ide> titleized_repo[0] = titleized_repo[0].upcase <del> <del> pr_pull_env = {} <del> pr_pull_env["HOMEBREW_GITHUB_API_TOKEN"] = "${{ github.token }}" <del> pr_pull_env["PULL_REQUEST"] = "${{ github.event.pull_request.number }}" <del> <del> if args.github_packages? <del> pr_pull_env["HOMEBREW_GITHUB_PACKAGES_USER"] = "${{ github.actor }}" <del> pr_pull_env["HOMEBREW_GITHUB_PACKAGES_TOKEN"] = "${{ github.token }}" <del> <del> root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repo}") <del> end <add> root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repo}") if args.github_packages? <ide> <ide> (tap.path/"Formula").mkpath <ide> <ide> def tap_new <ide> <ide> - name: Pull bottles <ide> env: <del> #{pr_pull_env.map { |k, v| "#{k}: #{v}" }.join "\n#{" " * 10}"} <add> HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }} <add> HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }} <add> HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }} <add> PULL_REQUEST: ${{ github.event.pull_request.number }} <ide> run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST <ide> <ide> - name: Push commits
1
Python
Python
add spacy evaluate
69c7c642c2c3a9c51d0b7c1c1e5e67848f9b7953
<ide><path>spacy/__main__.py <ide> import plac <ide> import sys <ide> from spacy.cli import download, link, info, package, train, convert, model <del> from spacy.cli import profile <add> from spacy.cli import profile, evaluate <ide> from spacy.util import prints <ide> <ide> commands = { <ide> 'download': download, <ide> 'link': link, <ide> 'info': info, <ide> 'train': train, <add> 'evaluate': evaluate, <ide> 'convert': convert, <ide> 'package': package, <ide> 'model': model, <ide><path>spacy/cli/__init__.py <ide> from .package import package <ide> from .profile import profile <ide> from .train import train <add>from .evaluate import evaluate <ide> from .convert import convert <ide> from .model import model <ide><path>spacy/cli/evaluate.py <add># coding: utf8 <add>from __future__ import unicode_literals, division, print_function <add> <add>import plac <add>import json <add>from collections import defaultdict <add>import cytoolz <add>from pathlib import Path <add>import dill <add>import tqdm <add>from thinc.neural._classes.model import Model <add>from thinc.neural.optimizers import linear_decay <add>from timeit import default_timer as timer <add>import random <add>import numpy.random <add> <add>from ..tokens.doc import Doc <add>from ..scorer import Scorer <add>from ..gold import GoldParse, merge_sents <add>from ..gold import GoldCorpus, minibatch <add>from ..util import prints <add>from .. import util <add>from .. import about <add>from .. import displacy <add>from ..compat import json_dumps <add> <add>random.seed(0) <add>numpy.random.seed(0) <add> <add> <add>@plac.annotations( <add> model=("Model name or path", "positional", None, str), <add> data_path=("Location of JSON-formatted evaluation data", "positional", None, str), <add> gold_preproc=("Use gold preprocessing", "flag", "G", bool), <add>) <add>def evaluate(cmd, model, data_path, gold_preproc=False): <add> """ <add> Train a model. Expects data in spaCy's JSON format. <add> """ <add> util.set_env_log(True) <add> data_path = util.ensure_path(data_path) <add> if not data_path.exists(): <add> prints(data_path, title="Evaluation data not found", exits=1) <add> corpus = GoldCorpus(data_path, data_path) <add> nlp = util.load_model(model) <add> scorer = nlp.evaluate(list(corpus.dev_docs(nlp, gold_preproc=gold_preproc))) <add> print_results(scorer) <add> <add> <add>def _render_parses(i, to_render): <add> to_render[0].user_data['title'] = "Batch %d" % i <add> with Path('/tmp/entities.html').open('w') as file_: <add> html = displacy.render(to_render[:5], style='ent', page=True) <add> file_.write(html) <add> with Path('/tmp/parses.html').open('w') as file_: <add> html = displacy.render(to_render[:5], style='dep', page=True) <add> file_.write(html) <add> <add> <add>def print_progress(itn, losses, dev_scores, wps=0.0): <add> scores = {} <add> for col in ['dep_loss', 'tag_loss', 'uas', 'tags_acc', 'token_acc', <add> 'ents_p', 'ents_r', 'ents_f', 'wps']: <add> scores[col] = 0.0 <add> scores['dep_loss'] = losses.get('parser', 0.0) <add> scores['ner_loss'] = losses.get('ner', 0.0) <add> scores['tag_loss'] = losses.get('tagger', 0.0) <add> scores.update(dev_scores) <add> scores['wps'] = wps <add> tpl = '\t'.join(( <add> '{:d}', <add> '{dep_loss:.3f}', <add> '{ner_loss:.3f}', <add> '{uas:.3f}', <add> '{ents_p:.3f}', <add> '{ents_r:.3f}', <add> '{ents_f:.3f}', <add> '{tags_acc:.3f}', <add> '{token_acc:.3f}', <add> '{wps:.1f}')) <add> print(tpl.format(itn, **scores)) <add> <add> <add>def print_results(scorer): <add> results = { <add> 'TOK': '%.2f' % scorer.token_acc, <add> 'POS': '%.2f' % scorer.tags_acc, <add> 'UAS': '%.2f' % scorer.uas, <add> 'LAS': '%.2f' % scorer.las, <add> 'NER P': '%.2f' % scorer.ents_p, <add> 'NER R': '%.2f' % scorer.ents_r, <add> 'NER F': '%.2f' % scorer.ents_f} <add> util.print_table(results, title="Results")
3
Text
Text
update dead link for getstaticpaths in docs
127bbc0ba69463638bcf2b059846fc6a481747d5
<ide><path>errors/conflicting-ssg-paths.md <ide> export default function CatchAll() { <ide> <ide> ### Useful Links <ide> <del>- [`getStaticPaths` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-paths.md) <add>- [`getStaticPaths` Documentation](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths)
1
Javascript
Javascript
add tests for dnspromises.lookup
211834234622f4da6347b1bec04333471a8443e3
<ide><path>test/parallel/test-dns-lookup.js <ide> // Flags: --expose-internals <ide> 'use strict'; <ide> const common = require('../common'); <add>const { addresses } = require('../common/internet'); <ide> const assert = require('assert'); <ide> const cares = process.binding('cares_wrap'); <ide> const dns = require('dns'); <ide> common.expectsError(() => { <ide> all: false <ide> }); <ide> assert.deepStrictEqual(res, { address: '127.0.0.1', family: 4 }); <add> <add> assert.rejects( <add> dnsPromises.lookup(addresses.INVALID_HOST, { <add> hints: 0, <add> family: 0, <add> all: false <add> }), <add> { <add> code: 'ENOTFOUND', <add> message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}` <add> } <add> ); <add> <add> assert.rejects( <add> dnsPromises.lookup(addresses.INVALID_HOST, { <add> hints: 0, <add> family: 0, <add> all: true <add> }), <add> { <add> code: 'ENOTFOUND', <add> message: `getaddrinfo ENOTFOUND ${addresses.INVALID_HOST}` <add> } <add> ); <ide> })(); <ide> <ide> dns.lookup(false, {
1
Text
Text
use ascii apostrophes consistently
895cc572ac9dee8287a2365ca0087940070ff632
<ide><path>SECURITY.md <ide> <ide> Report security bugs in Node.js via [HackerOne](https://hackerone.com/nodejs). <ide> <del>Your report will be acknowledged within 5 days, and you’ll receive a more <add>Your report will be acknowledged within 5 days, and you'll receive a more <ide> detailed response to your report within 10 days indicating the next steps in <ide> handling your submission. <ide> <ide> Here is the security disclosure policy for Node.js <ide> <ide> * This process can take some time, especially when coordination is required <ide> with maintainers of other projects. Every effort will be made to handle the <del> bug in as timely a manner as possible; however, it’s important that we follow <add> bug in as timely a manner as possible; however, it's important that we follow <ide> the release process above to ensure that the disclosure is handled in a <ide> consistent manner. <ide> <ide><path>doc/api/buffer.md <ide> console.log(uint16array); <ide> ``` <ide> <ide> It is possible to create a new `Buffer` that shares the same allocated <del>memory as a [`TypedArray`][] instance by using the `TypedArray` object’s <add>memory as a [`TypedArray`][] instance by using the `TypedArray` object's <ide> `.buffer` property in the same way. [`Buffer.from()`][`Buffer.from(arrayBuf)`] <ide> behaves like `new Uint8Array()` in this context. <ide> <ide><path>doc/api/console.md <ide> added: v10.0.0 <ide> <ide> Try to construct a table with the columns of the properties of `tabularData` <ide> (or use `properties`) and rows of `tabularData` and log it. Falls back to just <del>logging the argument if it can’t be parsed as tabular. <add>logging the argument if it can't be parsed as tabular. <ide> <ide> ```js <ide> // These can't be parsed as tabular data <ide> changes: <ide> description: The elapsed time is displayed with a suitable time unit. <ide> - version: v6.0.0 <ide> pr-url: https://github.com/nodejs/node/pull/5901 <del> description: This method no longer supports multiple calls that don’t map <add> description: This method no longer supports multiple calls that don't map <ide> to individual `console.time()` calls; see below for details. <ide> --> <ide> <ide><path>doc/api/deprecations.md <ide> changes: <ide> Type: Runtime <ide> <ide> Passing a callback to [`worker.terminate()`][] is deprecated. Use the returned <del>`Promise` instead, or a listener to the worker’s `'exit'` event. <add>`Promise` instead, or a listener to the worker's `'exit'` event. <ide> <ide> ### DEP0133: `http` `connection` <ide> <ide><path>doc/api/esm.md <ide> algorithm][]. All other specifier resolutions are always only resolved with <ide> the standard relative [URL][] resolution semantics. <ide> <ide> Like in CommonJS, module files within packages can be accessed by appending a <del>path to the package name unless the package’s [`package.json`][] contains an <add>path to the package name unless the package's [`package.json`][] contains an <ide> [`"exports"`][] field, in which case files within packages can only be accessed <ide> via the paths defined in [`"exports"`][]. <ide> <ide> Hooks are part of a chain, even if that chain consists of only one custom <ide> (user-provided) hook and the default hook, which is always present. Hook <ide> functions nest: each one must always return a plain object, and chaining happens <ide> as a result of each function calling `next<hookName>()`, which is a reference <del>to the subsequent loader’s hook. <add>to the subsequent loader's hook. <ide> <ide> A hook that returns a value lacking a required property triggers an exception. <ide> A hook that returns without calling `next<hookName>()` _and_ without returning <ide> export function globalPreload({ port }) { <ide> ### Examples <ide> <ide> The various loader hooks can be used together to accomplish wide-ranging <del>customizations of Node.js’ code loading and evaluation behaviors. <add>customizations of the Node.js code loading and evaluation behaviors. <ide> <ide> #### HTTPS loader <ide> <ide> prints the current version of CoffeeScript per the module at the URL in <ide> <ide> #### Transpiler loader <ide> <del>Sources that are in formats Node.js doesn’t understand can be converted into <add>Sources that are in formats Node.js doesn't understand can be converted into <ide> JavaScript using the [`load` hook][load hook]. Before that hook gets called, <ide> however, a [`resolve` hook][resolve hook] needs to tell Node.js not to <ide> throw an error on unknown file types. <ide><path>doc/api/events.md <ide> stack trace for such warnings. <ide> <ide> The emitted warning can be inspected with [`process.on('warning')`][] and will <ide> have the additional `emitter`, `type`, and `count` properties, referring to <del>the event emitter instance, the event’s name and the number of attached <add>the event emitter instance, the event's name and the number of attached <ide> listeners, respectively. <ide> Its `name` property is set to `'MaxListenersExceededWarning'`. <ide> <ide> added: v14.5.0 <ide> --> <ide> <ide> * `event` {Event} <del>* Returns: {boolean} `true` if either event’s `cancelable` attribute value is <add>* Returns: {boolean} `true` if either event's `cancelable` attribute value is <ide> false or its `preventDefault()` method was not invoked, otherwise `false`. <ide> <ide> Dispatches the `event` to the list of handlers for `event.type`. <ide><path>doc/api/fs.md <ide> The "not recommended" examples above check for existence and then use the <ide> file; the "recommended" examples are better because they use the file directly <ide> and handle the error, if any. <ide> <del>In general, check for the existence of a file only if the file won’t be <add>In general, check for the existence of a file only if the file won't be <ide> used directly, for example when its existence is a signal from another <ide> process. <ide> <ide> If the `target` does not exist, `'file'` will be used. Windows junction points <ide> require the destination path to be absolute. When using `'junction'`, the <ide> `target` argument will automatically be normalized to absolute path. <ide> <del>Relative targets are relative to the link’s parent directory. <add>Relative targets are relative to the link's parent directory. <ide> <ide> ```mjs <ide> import { symlink } from 'node:fs'; <ide><path>doc/api/packages.md <ide> in your project's `package.json`. <ide> <ide> ## Package entry points <ide> <del>In a package’s `package.json` file, two fields can define entry points for a <add>In a package's `package.json` file, two fields can define entry points for a <ide> package: [`"main"`][] and [`"exports"`][]. The [`"main"`][] field is supported <ide> in all versions of Node.js, but its capabilities are limited: it only defines <ide> the main entry point of the package. <ide> likely be a breaking change.** <ide> <ide> To make the introduction of [`"exports"`][] non-breaking, ensure that every <ide> previously supported entry point is exported. It is best to explicitly specify <del>entry points so that the package’s public API is well-defined. For example, <add>entry points so that the package's public API is well-defined. For example, <ide> a project that previous exported `main`, `lib`, <ide> `feature`, and the `package.json` could use the following `package.exports`: <ide> <ide> path `import feature from 'my-mod/feature/index.js`. <ide> ### Main entry point export <ide> <ide> To set the main entry point for a package, it is advisable to define both <del>[`"exports"`][] and [`"main"`][] in the package’s [`package.json`][] file: <add>[`"exports"`][] and [`"main"`][] in the package's [`package.json`][] file: <ide> <ide> ```json <ide> { <ide> changes: <ide> description: Unflag self-referencing a package using its name. <ide> --> <ide> <del>Within a package, the values defined in the package’s <del>`package.json` [`"exports"`][] field can be referenced via the package’s name. <add>Within a package, the values defined in the package's <add>`package.json` [`"exports"`][] field can be referenced via the package's name. <ide> For example, assuming the `package.json` is: <ide> <ide> ```json <ide> This approach is appropriate for any of the following use cases: <ide> install both this package and those other packages. For example a `utilities` <ide> package is used directly in an application, and a `utilities-plus` package <ide> adds a few more functions to `utilities`. Because the wrapper exports <del> underlying CommonJS files, it doesn’t matter if `utilities-plus` is written in <add> underlying CommonJS files, it doesn't matter if `utilities-plus` is written in <ide> CommonJS or ES module syntax; it will work either way. <ide> * The package stores internal state, and the package author would prefer not to <ide> refactor the package to isolate its state management. See the next section. <ide> be to add an export, e.g. `"./module"`, to point to an all-ES module-syntax <ide> version of the package. This could be used via `import 'pkg/module'` by users <ide> who are certain that the CommonJS version will not be loaded anywhere in the <ide> application, such as by dependencies; or if the CommonJS version can be loaded <del>but doesn’t affect the ES module version (for example, because the package is <add>but doesn't affect the ES module version (for example, because the package is <ide> stateless): <ide> <ide> ```json <ide> points directly: <ide> <ide> This can be done if both the CommonJS and ES module versions of the package are <ide> equivalent, for example because one is the transpiled output of the other; and <del>the package’s management of state is carefully isolated (or the package is <add>the package's management of state is carefully isolated (or the package is <ide> stateless). <ide> <ide> The reason that state is an issue is because both the CommonJS and ES module <ide> versions of the package might get used within an application; for example, the <del>user’s application code could `import` the ES module version while a dependency <add>user's application code could `import` the ES module version while a dependency <ide> `require`s the CommonJS version. If that were to occur, two copies of the <ide> package would be loaded in memory and therefore two separate states would be <ide> present. This would likely cause hard-to-troubleshoot bugs. <ide> <del>Aside from writing a stateless package (if JavaScript’s `Math` were a package, <add>Aside from writing a stateless package (if JavaScript's `Math` were a package, <ide> for example, it would be stateless as all of its methods are static), there are <del>some ways to isolate state so that it’s shared between the potentially loaded <add>some ways to isolate state so that it's shared between the potentially loaded <ide> CommonJS and ES module instances of the package: <ide> <del>1. If possible, contain all state within an instantiated object. JavaScript’s <add>1. If possible, contain all state within an instantiated object. JavaScript's <ide> `Date`, for example, needs to be instantiated to contain state; if it were a <ide> package, it would be used like this: <ide> <ide> CommonJS and ES module instances of the package: <ide> // someDate contains state; Date does not <ide> ``` <ide> <del> The `new` keyword isn’t required; a package’s function can return a new <add> The `new` keyword isn't required; a package's function can return a new <ide> object, or modify a passed-in object, to keep the state external to the <ide> package. <ide> <ide> CommonJS and ES module instances of the package: <ide> each reference of `pkg` will contain the same state; and modifying that <ide> state from either module system will apply to both. <ide> <del>Any plugins that attach to the package’s singleton would need to separately <add>Any plugins that attach to the package's singleton would need to separately <ide> attach to both the CommonJS and ES module singletons. <ide> <ide> This approach is appropriate for any of the following use cases: <ide> changes: <ide> } <ide> ``` <ide> <del>The `"name"` field defines your package’s name. Publishing to the <add>The `"name"` field defines your package's name. Publishing to the <ide> _npm_ registry requires a name that satisfies <ide> [certain requirements](https://docs.npmjs.com/files/package.json#name). <ide> <ide> Files ending with `.js` are loaded as ES modules when the nearest parent <ide> `"module"`. <ide> <ide> The nearest parent `package.json` is defined as the first `package.json` found <del>when searching in the current folder, that folder’s parent, and so on up <add>when searching in the current folder, that folder's parent, and so on up <ide> until a node\_modules folder or the volume root is reached. <ide> <ide> ```json <ide><path>doc/api/process.md <ide> added: v0.1.27 <ide> changes: <ide> - version: v11.14.0 <ide> pr-url: https://github.com/nodejs/node/pull/26544 <del> description: Worker threads will now use a copy of the parent thread’s <add> description: Worker threads will now use a copy of the parent thread's <ide> `process.env` by default, configurable through the `env` <ide> option of the `Worker` constructor. <ide> - version: v10.0.0 <ide> console.log(env.test); <ide> <ide> Unless explicitly specified when creating a [`Worker`][] instance, <ide> each [`Worker`][] thread has its own copy of `process.env`, based on its <del>parent thread’s `process.env`, or whatever was specified as the `env` option <add>parent thread's `process.env`, or whatever was specified as the `env` option <ide> to the [`Worker`][] constructor. Changes to `process.env` will not be visible <ide> across [`Worker`][] threads, and only the main thread can make changes that <ide> are visible to the operating system or to native add-ons. <ide><path>doc/api/synopsis.md <ide> Commands in this document start with `$` or `>` to replicate how they would <ide> appear in a user's terminal. Do not include the `$` and `>` characters. They are <ide> there to show the start of each command. <ide> <del>Lines that don’t start with `$` or `>` character show the output of the previous <add>Lines that don't start with `$` or `>` character show the output of the previous <ide> command. <ide> <ide> First, make sure to have downloaded and installed Node.js. See <ide><path>doc/api/url.md <ide> added: v16.7.0 <ide> `URL.createObjectURL()`. <ide> <ide> Removes the stored {Blob} identified by the given ID. Attempting to revoke a <del>ID that isn’t registered will silently fail. <add>ID that isn't registered will silently fail. <ide> <ide> ### Class: `URLSearchParams` <ide> <ide><path>doc/api/v8.md <ide> For use inside of a custom [`serializer._writeHostObject()`][]. <ide> <ide> * `buffer` {Buffer|TypedArray|DataView} <ide> <del>Write raw bytes into the serializer’s internal buffer. The deserializer <add>Write raw bytes into the serializer's internal buffer. The deserializer <ide> will require a way to compute the length of the buffer. <ide> For use inside of a custom [`serializer._writeHostObject()`][]. <ide> <ide> For use inside of a custom [`deserializer._readHostObject()`][]. <ide> * `length` {integer} <ide> * Returns: {Buffer} <ide> <del>Read raw bytes from the deserializer’s internal buffer. The `length` parameter <add>Read raw bytes from the deserializer's internal buffer. The `length` parameter <ide> must correspond to the length of the buffer that was passed to <ide> [`serializer.writeRawBytes()`][]. <ide> For use inside of a custom [`deserializer._readHostObject()`][]. <ide><path>doc/api/worker_threads.md <ide> changes: <ide> Receive a single message from a given `MessagePort`. If no message is available, <ide> `undefined` is returned, otherwise an object with a single `message` property <ide> that contains the message payload, corresponding to the oldest message in the <del>`MessagePort`’s queue. <add>`MessagePort`'s queue. <ide> <ide> ```js <ide> const { MessageChannel, receiveMessageOnPort } = require('node:worker_threads'); <ide> added: v10.5.0 <ide> --> <ide> <ide> An arbitrary JavaScript value that contains a clone of the data passed <del>to this thread’s `Worker` constructor. <add>to this thread's `Worker` constructor. <ide> <ide> The data is cloned as if using [`postMessage()`][`port.postMessage()`], <ide> according to the [HTML structured clone algorithm][]. <ide> changes: <ide> description: The `resourceLimits` option was introduced. <ide> --> <ide> <del>* `filename` {string|URL} The path to the Worker’s main script or module. Must <add>* `filename` {string|URL} The path to the Worker's main script or module. Must <ide> be either an absolute path or a relative path (i.e. relative to the <ide> current working directory) starting with `./` or `../`, or a WHATWG `URL` <ide> object using `file:` or `data:` protocol. <ide> changes: <ide> * `env` {Object} If set, specifies the initial value of `process.env` inside <ide> the Worker thread. As a special value, [`worker.SHARE_ENV`][] may be used <ide> to specify that the parent thread and the child thread should share their <del> environment variables; in that case, changes to one thread’s `process.env` <add> environment variables; in that case, changes to one thread's `process.env` <ide> object affect the other thread as well. **Default:** `process.env`. <ide> * `eval` {boolean} If `true` and the first argument is a `string`, interpret <ide> the first argument to the constructor as a script that is executed once the <ide><path>doc/api/zlib.md <ide> speed, at the cost of memory usage. <ide> There are equivalents to the zlib options for Brotli-based streams, although <ide> these options have different ranges than the zlib ones: <ide> <del>* zlib’s `level` option matches Brotli’s `BROTLI_PARAM_QUALITY` option. <del>* zlib’s `windowBits` option matches Brotli’s `BROTLI_PARAM_LGWIN` option. <add>* zlib's `level` option matches Brotli's `BROTLI_PARAM_QUALITY` option. <add>* zlib's `windowBits` option matches Brotli's `BROTLI_PARAM_LGWIN` option. <ide> <ide> See [below][Brotli parameters] for more details on Brotli-specific options. <ide> <ide><path>doc/contributing/cpp-style-guide.md <ide> tools. <ide> <ide> ## Formatting <ide> <del>Unfortunately, the C++ linter (based on [Google’s `cpplint`][]), which can be <add>Unfortunately, the C++ linter (based on [Google's `cpplint`][]), which can be <ide> run explicitly via `make lint-cpp`, does not currently catch a lot of rules that <ide> are specific to the Node.js C++ code base. This document explains the most <ide> common of these rules: <ide> void FunctionWithAVeryLongName(int parameter_with_a_very_long_name, <ide> ...); <ide> ``` <ide> <del>If that doesn’t work, break after the `(` and use 4 spaces of indentation: <add>If that doesn't work, break after the `(` and use 4 spaces of indentation: <ide> <ide> ```cpp <ide> void FunctionWithAReallyReallyReallyLongNameSeriouslyStopIt( <ide> even `try` and `catch` **will** break. <ide> [ES.48]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts <ide> [ES.49]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts-named <ide> [Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html <del>[Google’s `cpplint`]: https://github.com/google/styleguide <add>[Google's `cpplint`]: https://github.com/google/styleguide <ide> [R.20]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-owner <ide> [R.21]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-unique <ide> [Run Time Type Information]: https://en.wikipedia.org/wiki/Run-time_type_information <ide><path>doc/contributing/maintaining-icu.md <ide> Floating patches are applied at `configure` time. The "patch" files <ide> are used instead of the original source files. The patch files are <ide> complete `.cpp` files replacing the original contents. <ide> <del>Patches are tied to a specific ICU version. They won’t apply to a <add>Patches are tied to a specific ICU version. They won't apply to a <ide> future ICU version. We assume that you filed a bug against [ICU][] and <del>upstreamed the fix, so the patch won’t be needed in a later ICU <add>upstreamed the fix, so the patch won't be needed in a later ICU <ide> version. <ide> <ide> ### Example <ide><path>onboarding.md <ide> The project has a venue for real-time discussion: <ide> <ide> * Approving a change <ide> * Collaborators indicate that they have reviewed and approve of the changes in <del> a pull request using GitHub’s approval interface <add> a pull request using GitHub's approval interface <ide> * Some people like to comment `LGTM` (“Looks Good To Me”) <del> * You have the authority to approve any other collaborator’s work. <add> * You have the authority to approve any other collaborator's work. <ide> * You cannot approve your own pull requests. <ide> * When explicitly using `Changes requested`, show empathy – comments will <del> usually be addressed even if you don’t use it. <add> usually be addressed even if you don't use it. <ide> * If you do, it is nice if you are available later to check whether your <ide> comments have been addressed <ide> * If you see that the requested changes have been made, you can clear <ide> The project has a venue for real-time discussion: <ide> comments to block the pull request from landing. <ide> <ide> * What belongs in Node.js: <del> * Opinions vary – it’s good to have a broad collaborator base for that reason! <add> * Opinions vary – it's good to have a broad collaborator base for that reason! <ide> * If Node.js itself needs it (due to historical reasons), then it belongs in <ide> Node.js. <ide> * That is to say, `url` is there because of `http`, `freelist` is there <ide><path>src/README.md <ide> # Node.js C++ codebase <ide> <del>Hi! 👋 You’ve found the C++ code backing Node.js. This README aims to help you <add>Hi! 👋 You've found the C++ code backing Node.js. This README aims to help you <ide> get started working on it and document some idioms you may encounter while <ide> doing so. <ide> <ide> accessed online in the following locations: <ide> <ide> * On GitHub: [`v8.h` in Node.js master][] <ide> * On GitHub: [`v8.h` in V8 master][] <del>* On the Chromium project’s Code Search application: [`v8.h` in Code Search][] <add>* On the Chromium project's Code Search application: [`v8.h` in Code Search][] <ide> <ide> V8 also provides an [introduction for V8 embedders][], <ide> which can be useful for understanding some of the concepts it uses in its <ide> There is a [reference documentation for the libuv API][]. <ide> <ide> The Node.js C++ files follow this structure: <ide> <del>The `.h` header files contain declarations, and sometimes definitions that don’t <add>The `.h` header files contain declarations, and sometimes definitions that don't <ide> require including other headers (e.g. getters, setters, etc.). They should only <ide> include other `.h` header files and nothing else. <ide> <ide> Often, the `Context` is passed around for [exception handling][]. <ide> Typical ways of accessing the current `Context` in the Node.js code are: <ide> <ide> * Given an [`Isolate`][], using `isolate->GetCurrentContext()`. <del>* Given an [`Environment`][], using `env->context()` to get the `Environment`’s <add>* Given an [`Environment`][], using `env->context()` to get the `Environment`'s <ide> main context. <ide> <ide> <a id="event-loop"></a> <ide> The current event loop can be accessed using `env->event_loop()` given an <ide> [`Environment`][] instance. The restriction of using a single event loop <ide> is not inherent to the design of Node.js, and a sufficiently committed person <ide> could restructure Node.js to provide e.g. the ability to run parts of Node.js <del>inside an event loop separate from the active thread’s event loop. <add>inside an event loop separate from the active thread's event loop. <ide> <ide> <a id="environment"></a> <ide> <ide> The platform can be accessed through `isolate_data->platform()` given an <ide> <ide> * The current Node.js instance was not started by an embedder; or <ide> * The current Node.js instance was started by an embedder whose `v8::Platform` <del> implementation also implement’s the `node::MultiIsolatePlatform` interface <add> implementation also implement's the `node::MultiIsolatePlatform` interface <ide> and who passed this to Node.js. <ide> <ide> <a id="binding-functions"></a> <ide> void Initialize(Local<Object> target, <ide> } <ide> <ide> // Run the `Initialize` function when loading this module through <del>// `internalBinding('cares_wrap')` in Node.js’s built-in JavaScript code: <add>// `internalBinding('cares_wrap')` in Node.js's built-in JavaScript code: <ide> NODE_MODULE_CONTEXT_AWARE_INTERNAL(cares_wrap, Initialize) <ide> ``` <ide> <ide> That object is always a [`BaseObject`][]. <ide> <ide> Its class needs to have a static `type_name` field based on a <ide> constant string, in order to disambiguate it from other classes of this type, <del>and which could e.g. match the binding’s name (in the example above, that would <add>and which could e.g. match the binding's name (in the example above, that would <ide> be `cares_wrap`). <ide> <ide> ```cpp <ide> the process otherwise. `maybe.FromJust()` (aka `maybe.ToChecked()`) can be used <ide> to access the value and crash the process if it is not set. <ide> <ide> This should only be performed if it is actually sure that the operation has <del>not failed. A lot of Node.js’s source code does **not** follow this rule, and <add>not failed. A lot of the Node.js source code does **not** follow this rule, and <ide> can be brought to crash through this. <ide> <ide> In particular, it is often not safe to assume that an operation does not throw <ide> v8::Maybe<double> SumNumbers(v8::Local<v8::Context> context, <ide> v8::Local<v8::Value> entry; <ide> if (array_of_integers->Get(context, i).ToLocal(&entry)) { <ide> // Oops, we might have hit a getter that throws an exception! <del> // It’s better to not continue return an empty (“nothing”) Maybe. <add> // It's better to not continue return an empty (“nothing”) Maybe. <ide> return v8::Nothing<double>(); <ide> } <ide> <ide> if (!entry->IsNumber()) { <del> // Let’s just skip any non-numbers. It would also be reasonable to throw <add> // Let's just skip any non-numbers. It would also be reasonable to throw <ide> // an exception here, e.g. using the error system in src/node_errors.h, <ide> // and then to return an empty Maybe again. <ide> continue; <ide> } <ide> <del> // This cast is valid, because we’ve made sure it’s really a number. <add> // This cast is valid, because we've made sure it's really a number. <ide> v8::Local<v8::Number> entry_as_number = entry.As<v8::Number>(); <ide> <ide> sum += entry_as_number->Value(); <ide> v8::Maybe<double> SumNumbers(v8::Local<v8::Context> context, <ide> <ide> // Function that is exposed to JS: <ide> void SumNumbers(const v8::FunctionCallbackInfo<v8::Value>& args) { <del> // This will crash if the first argument is not an array. Let’s assume we <add> // This will crash if the first argument is not an array. Let's assume we <ide> // have performed type checking in a JavaScript wrapper function. <ide> CHECK(args[0]->IsArray()); <ide> <ide> this information is provided to async tracking tools. <ide> The `AsyncWrap` class has a set of methods called `MakeCallback()`, with the <ide> intention of the naming being that it is used to “make calls back into <ide> JavaScript” from the event loop, rather than making callbacks in some way. <del>(As the naming has made its way into Node.js’s public API, it’s not worth <add>(As the naming has made its way into the Node.js public API, it's not worth <ide> the breakage of fixing it). <ide> <ide> `MakeCallback()` generally calls a method on the JavaScript object associated <ide> classes provide the same facilities as [`MakeCallback()`][], namely: <ide> <ide> Usually, using `AsyncWrap::MakeCallback()` or using the constructor taking <ide> an `AsyncWrap*` argument (i.e. used as <del>`InternalCallbackScope callback_scope(this);`) suffices inside of Node.js’s <add>`InternalCallbackScope callback_scope(this);`) suffices inside of the Node.js <ide> C++ codebase. <ide> <ide> ## C++ utilities
18
Javascript
Javascript
fix enterleaveeventplugin test in jsdom
73d9d286ee84770c10fd84022fde92bd2efc8eaa
<ide><path>src/eventPlugins/__tests__/EnterLeaveEventPlugin-test.js <ide> * @emails react-core <ide> */ <ide> <add>/*jslint evil: true */ <add> <ide> "use strict"; <ide> <ide> var EnterLeaveEventPlugin; <ide> describe('EnterLeaveEventPlugin', function() { <ide> var iframe = document.createElement('iframe'); <ide> document.body.appendChild(iframe); <ide> <del> var component = React.renderComponent(<div />, iframe.contentDocument.body); <add> var iframeDocument = iframe.contentDocument; <add> <add> if (!iframeDocument.innerHTML) { <add> iframeDocument.innerHTML = '<html><head></head><body></body></html>'; <add> } <add> <add> var component = React.renderComponent(<div />, iframeDocument.body); <ide> var div = component.getDOMNode(); <ide> <ide> var extracted = EnterLeaveEventPlugin.extractEvents(
1
PHP
PHP
fix some higher phpstan issues
c802a9c3ba8c45a3d3db91b8941ee583c55b4e87
<ide><path>src/Database/Connection.php <ide> public function begin() <ide> <ide> $this->_transactionLevel++; <ide> if ($this->isSavePointsEnabled()) { <del> $this->createSavePoint($this->_transactionLevel); <add> $this->createSavePoint((string)$this->_transactionLevel); <ide> } <ide> } <ide> <ide> public function commit() <ide> return $this->_driver->commitTransaction(); <ide> } <ide> if ($this->isSavePointsEnabled()) { <del> $this->releaseSavePoint($this->_transactionLevel); <add> $this->releaseSavePoint((string)$this->_transactionLevel); <ide> } <ide> <ide> $this->_transactionLevel--; <ide><path>src/Database/Expression/ValuesExpression.php <ide> public function setQuery(Query $query) <ide> * Gets the query object to be used as the values expression to be evaluated <ide> * to insert records in the table. <ide> * <del> * @return \Cake\Database\Query <add> * @return \Cake\Database\Query|null <ide> */ <ide> public function getQuery() <ide> { <ide><path>src/Database/Query.php <ide> class Query implements ExpressionInterface, IteratorAggregate <ide> * The object responsible for generating query placeholders and temporarily store values <ide> * associated to each of those. <ide> * <del> * @var \Cake\Database\ValueBinder|null <add> * @var \Cake\Database\ValueBinder|false|null <ide> */ <ide> protected $_valueBinder; <ide> <ide> public function getValueBinder() <ide> * to the statement object. <ide> * <ide> * @deprecated 3.5.0 Use getValueBinder() for the getter part instead. <del> * @param \Cake\Database\ValueBinder|null $binder new instance to be set. If no value is passed the <add> * @param \Cake\Database\ValueBinder|false|null $binder new instance to be set. If no value is passed the <ide> * default one will be returned <ide> * @return $this|\Cake\Database\ValueBinder <ide> */ <ide><path>src/Database/Statement/StatementDecorator.php <ide> class StatementDecorator implements StatementInterface, Countable, IteratorAggre <ide> * Statement instance implementation, such as PDOStatement <ide> * or any other custom implementation. <ide> * <del> * @var \Cake\Database\StatementInterface|\PDOStatement <add> * @var \Cake\Database\StatementInterface|\PDOStatement|null <ide> */ <ide> protected $_statement; <ide> <ide> /** <ide> * Reference to the driver object associated to this statement. <ide> * <del> * @var \Cake\Database\Driver <add> * @var \Cake\Database\Driver|null <ide> */ <ide> protected $_driver; <ide> <ide> public function rowCount() <ide> * } <ide> * ``` <ide> * <del> * @return \Iterator <add> * @return \Cake\Database\StatementInterface|\PDOStatement <ide> */ <ide> public function getIterator() <ide> { <ide><path>src/Database/Type.php <ide> class Type implements TypeInterface <ide> /** <ide> * Identifier name for this type <ide> * <del> * @var string <add> * @var string|null <ide> */ <ide> protected $_name; <ide> <ide><path>src/Database/Type/DateTimeType.php <ide> public function __construct($name = null) <ide> * <ide> * @param string|int|\DateTime $value The value to convert. <ide> * @param \Cake\Database\Driver $driver The driver instance to convert with. <del> * @return string <add> * @return string|null <ide> */ <ide> public function toDatabase($value, Driver $driver) <ide> { <ide><path>src/Utility/Hash.php <ide> public static function get($data, $path, $default = null) <ide> * <ide> * @param array|\ArrayAccess $data The data to extract from. <ide> * @param string $path The path to extract. <del> * @return array An array of the extracted values. Returns an empty array <add> * @return array|\ArrayAccess An array of the extracted values. Returns an empty array <ide> * if there are no matches. <ide> * @link https://book.cakephp.org/3.0/en/core-libraries/hash.html#Cake\Utility\Hash::extract <ide> */
7
PHP
PHP
apply fixes from styleci
f46a96c8b5fec4a8778f27b786c5d9f6f49b2949
<ide><path>src/Illuminate/Http/ResponseTrait.php <ide> public function status() <ide> public function statusText() <ide> { <ide> return $this->statusText; <del> } <add> } <ide> <ide> /** <ide> * Get the content of the response. <ide><path>tests/Http/HttpResponseTest.php <ide> public function testSetStatusCodeAndRetrieveStatusText() <ide> $response->setStatusCode(404); <ide> $this->assertSame('Not Found', $response->statusText()); <ide> } <del> <add> <ide> public function testOnlyInputOnRedirect() <ide> { <ide> $response = new RedirectResponse('foo.bar');
2
Ruby
Ruby
remove bad test
17439e3a4027a813d8b746ea892c1c3373c26df3
<ide><path>activesupport/test/caching_test.rb <ide> def test_local_store_strategy <ide> end <ide> assert_nil @cache.read("name") <ide> end <del> <del> def test_setting_nil_cache_store <del> assert ActiveSupport::Cache.lookup_store.class.name, ActiveSupport::Cache::NullStore.name <del> end <ide> end <ide> <ide> class CacheStoreLoggerTest < ActiveSupport::TestCase
1
Python
Python
remove the deprecated flask.modules property
6af9690ae9800f5a6074c70498cba4b26335ec72
<ide><path>flask/app.py <ide> def wsgi_app(self, environ, start_response): <ide> error = None <ide> ctx.auto_pop(error) <ide> <del> @property <del> def modules(self): <del> from warnings import warn <del> warn(DeprecationWarning('Flask.modules is deprecated, use ' <del> 'Flask.blueprints instead'), stacklevel=2) <del> return self.blueprints <del> <ide> def __call__(self, environ, start_response): <ide> """Shortcut for :attr:`wsgi_app`.""" <ide> return self.wsgi_app(environ, start_response)
1
Python
Python
remove unused code
f09d133625d7df602b01b22e82350a2774f0da4a
<ide><path>libcloud/test/compute/test_openstack.py <ide> <ide> <ide> def test_driver_instantiation_invalid_auth(): <del> forced_auth = 'http://x.y.z.y:5000' <ide> with pytest.raises(LibcloudError): <ide> d = OpenStackNodeDriver( <ide> 'user', 'correct_password',
1
Ruby
Ruby
add basic json serializer to amo
fbdf706fffbfb17731a1f459203d242414ef5086
<ide><path>activemodel/lib/active_model.rb <ide> module ActiveModel <ide> autoload :TestCase, 'active_model/test_case' <ide> autoload :Validations, 'active_model/validations' <ide> autoload :ValidationsRepairHelper, 'active_model/validations_repair_helper' <add> <add> module Serializers <add> autoload :JSON, 'active_model/serializers/json' <add> end <ide> end <ide> <ide> I18n.load_path << File.dirname(__FILE__) + '/active_model/locale/en.yml' <ide><path>activemodel/lib/active_model/serializers/json.rb <add>require 'active_support/json' <add>require 'active_support/core_ext/class/attribute_accessors' <add>require 'active_support/core_ext/hash/except' <add>require 'active_support/core_ext/hash/slice' <add> <add>module ActiveModel <add> module Serializers <add> module JSON <add> extend ActiveSupport::Concern <add> include ActiveModel::Attributes <add> <add> included do <add> cattr_accessor :include_root_in_json, :instance_writer => false <add> end <add> <add> def encode_json(encoder) <add> options = encoder.options || {} <add> <add> hash = if options[:only] <add> only = Array.wrap(options[:only]).map { |attr| attr.to_s } <add> attributes.slice(*only) <add> elsif options[:except] <add> except = Array.wrap(options[:except]).map { |attr| attr.to_s } <add> attributes.except(*except) <add> else <add> attributes <add> end <add> <add> hash = { self.class.model_name.element => hash } if include_root_in_json <add> ActiveSupport::JSON.encode(hash) <add> end <add> <add> def as_json(options = nil) <add> self <add> end <add> end <add> end <add>end <ide><path>activemodel/test/cases/json_serialization_test.rb <add>require 'cases/helper' <add> <add>class JsonSerializationTest < ActiveModel::TestCase <add> class Contact <add> extend ActiveModel::Naming <add> include ActiveModel::Serializers::JSON <add> attr_accessor :name, :age, :created_at, :awesome, :preferences <add> end <add> <add> def setup <add> @contact = Contact.new <add> @contact.name = 'Konata Izumi' <add> @contact.age = 16 <add> @contact.created_at = Time.utc(2006, 8, 1) <add> @contact.awesome = true <add> @contact.preferences = { 'shows' => 'anime' } <add> end <add> <add> test "should include root in json" do <add> begin <add> Contact.include_root_in_json = true <add> json = @contact.to_json <add> <add> assert_match %r{^\{"contact":\{}, json <add> assert_match %r{"name":"Konata Izumi"}, json <add> assert_match %r{"age":16}, json <add> assert json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) <add> assert_match %r{"awesome":true}, json <add> assert_match %r{"preferences":\{"shows":"anime"\}}, json <add> ensure <add> Contact.include_root_in_json = false <add> end <add> end <add> <add> test "should encode all encodable attributes" do <add> json = @contact.to_json <add> <add> assert_match %r{"name":"Konata Izumi"}, json <add> assert_match %r{"age":16}, json <add> assert json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) <add> assert_match %r{"awesome":true}, json <add> assert_match %r{"preferences":\{"shows":"anime"\}}, json <add> end <add> <add> test "should allow attribute filtering with only" do <add> json = @contact.to_json(:only => [:name, :age]) <add> <add> assert_match %r{"name":"Konata Izumi"}, json <add> assert_match %r{"age":16}, json <add> assert_no_match %r{"awesome":true}, json <add> assert !json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) <add> assert_no_match %r{"preferences":\{"shows":"anime"\}}, json <add> end <add> <add> test "should allow attribute filtering with except" do <add> json = @contact.to_json(:except => [:name, :age]) <add> <add> assert_no_match %r{"name":"Konata Izumi"}, json <add> assert_no_match %r{"age":16}, json <add> assert_match %r{"awesome":true}, json <add> assert json.include?(%("created_at":#{ActiveSupport::JSON.encode(Time.utc(2006, 8, 1))})) <add> assert_match %r{"preferences":\{"shows":"anime"\}}, json <add> end <add>end <ide><path>activesupport/lib/active_support/json/decoding.rb <ide> require 'active_support/core_ext/module/attribute_accessors' <add>require 'active_support/core_ext/module/delegation' <ide> <ide> module ActiveSupport <ide> # Look for and parse json strings that look like ISO 8601 times. <ide><path>activesupport/lib/active_support/json/encoding.rb <ide> require 'active_support/core_ext/object/instance_variables' <ide> require 'active_support/deprecation' <ide> <add>require 'active_support/core_ext/date_time/conversions' <add>require 'active_support/core_ext/time/conversions' <add>require 'active_support/time_with_zone' <add>require 'active_support/values/time_zone' <add> <ide> # Hack to load json gem first so we can overwrite its to_json. <ide> begin <ide> require 'json'
5
PHP
PHP
fix failing tests due to prefixes
858a5edcd5015fab1853ecd8a244e193ae61842c
<ide><path>lib/Cake/Test/TestCase/View/Helper/PaginatorHelperTest.php <ide> public function testSortDirFallbackToParams() { <ide> public function testSortAdminLinks() { <ide> Configure::write('Routing.prefixes', array('admin')); <ide> Router::reload(); <del> Router::connect('/admin/:controller/:action/*', array('admin' => true, 'prefix' => 'admin')); <add> Router::connect('/admin/:controller/:action/*', array('prefix' => 'admin')); <ide> Router::setRequestInfo(array( <del> array('controller' => 'users', 'plugin' => null, 'action' => 'admin_index', 'prefix' => 'admin', 'admin' => true), <add> array('controller' => 'users', 'plugin' => null, 'action' => 'index', 'prefix' => 'admin'), <ide> array('base' => '', 'here' => '/admin/users', 'webroot' => '/') <ide> )); <ide> $this->Paginator->request->params['paging']['Article']['page'] = 1; <ide> public function testUrlGeneration() { <ide> public function testUrlGenerationWithPrefixes() { <ide> Configure::write('Routing.prefixes', array('members')); <ide> Router::reload(); <del> Router::connect('/members/:controller/:action/*', array('prefix' => 'members', 'members' => true)); <add> Router::connect('/members/:controller/:action/*', array('prefix' => 'members')); <ide> Router::connect('/:controller/:action/*'); <ide> <ide> Router::setRequestInfo(array( <ide> public function testUrlGenerationWithPrefixes() { <ide> $this->Paginator->request->params['paging']['Article']['options']['page'] = 2; <ide> $this->Paginator->request->params['paging']['Article']['page'] = 2; <ide> $this->Paginator->request->params['paging']['Article']['prevPage'] = true; <del> $options = array('members' => true); <add> $options = array('prefix' => 'members'); <ide> <ide> $result = $this->Paginator->url($options); <ide> $expected = '/members/posts/index?page=2'; <ide> public function testUrlGenerationWithPrefixes() { <ide> ); <ide> $this->assertTags($result, $expected); <ide> <del> $options = array('members' => true, 'controller' => 'posts', 'order' => array('name' => 'desc')); <add> $options = array('prefix' => 'members', 'controller' => 'posts', 'order' => array('name' => 'desc')); <ide> $result = $this->Paginator->url($options); <ide> $expected = '/members/posts/index?page=2&amp;sort=name&amp;direction=desc'; <ide> $this->assertEquals($expected, $result); <ide> public function testPassedArgsMergingWithUrlOptions() { <ide> <ide> $result = $this->Paginator->sort('title'); <ide> $expected = array( <del> 'a' => array('href' => '/articles/index/2?page=1&amp;foo=bar&amp;sort=title&amp;direction=asc&amp;x=y'), <add> 'a' => array('href' => '/articles/index/2?page=1&amp;sort=title&amp;direction=asc&amp;foo=bar&amp;x=y'), <ide> 'Title', <ide> '/a' <ide> ); <ide><path>lib/Cake/View/View.php <ide> public function __construct(Controller $controller = null) { <ide> $this->_eventManager = $controller->getEventManager(); <ide> } <ide> if (empty($this->request) && !($this->request = Router::getRequest(true))) { <del> $this->request = new Request(null, false); <add> $this->request = new Request(); <ide> $this->request->base = ''; <ide> $this->request->here = $this->request->webroot = '/'; <ide> }
2
Python
Python
standardize the airflow cli help descriptions
5e25c167cde301c95a03dd951e97af0ffdf1deb9
<ide><path>airflow/cli/cli_parser.py <ide> class GroupCommand(NamedTuple): <ide> ), <ide> GroupCommand( <ide> name="kubernetes", <del> help='tools to help run the KubernetesExecutor', <add> help='Tools to help run the KubernetesExecutor', <ide> subcommands=KUBERNETES_COMMANDS <ide> ), <ide> GroupCommand(
1
Text
Text
release notes for 1.0.0rc6 runny-nose
983c3095428d3055fa2f99e8df7d9532c3ca0517
<ide><path>CHANGELOG.md <add><a name="v1.0.0rc6"></a> <add># v1.0.0rc6 runny-nose (2012-04-20) <add> <add> <add>## Bug Fixes <add> <add>- **select:** properly handle empty & unknown options without ngOptions <add> ([904b69c7](https://github.com/angular/angular.js/commit/904b69c745ea4afc1d6ecd2a5f3138c6f947b157)) <add>- **compiler:** reading comment throws error in ie <add> ([46bb08a9](https://github.com/angular/angular.js/commit/46bb08a9d0780fafef6dc5c1140c71912462887a)) <add>- **document:** accidental clobbering of document.getAttribute <add> ([eafe15f5](https://github.com/angular/angular.js/commit/eafe15f54c686d5c83f777fd319f4c568e209432), <add> [#877](https://github.com/angular/angular.js/issues/877)) <add>- **script:** Incorrectly reading script text on ie <add> ([94dd6857](https://github.com/angular/angular.js/commit/94dd68570952f6f31abfa351b1159afcd3588a57)) <add> <add> <add>## Features <add> <add>- **$resource:** support HTTP PATCH method <add> ([e61fd1b4](https://github.com/angular/angular.js/commit/e61fd1b43a55496c11c63da7ca2fc05b88d44043), <add> [#887](https://github.com/angular/angular.js/issues/887)) <add>- **jquery:** jquery 1.7.2 support <add> ([8ebe5ccd](https://github.com/angular/angular.js/commit/8ebe5ccd9ace7807bedc7317d605370fe82b773d)) <add> <add> <add> <ide> <a name="1.0.0rc5"></a> <ide> # 1.0.0rc5 reality-distortion (2012-04-12) <ide>
1
Javascript
Javascript
use strict in user.js
9634eab60b7a786a95ba60a76d93872d127f2bc4
<ide><path>test/resources/firefox/user.js <del>user_pref("browser.console.showInPanel", true); <del>user_pref("browser.dom.window.dump.enabled", true); <del>user_pref("browser.firstrun.show.localepicker", false); <del>user_pref("browser.firstrun.show.uidiscovery", false); <del>user_pref("dom.allow_scripts_to_close_windows", true); <del>user_pref("dom.disable_open_during_load", false); <del>user_pref("dom.max_script_run_time", 0); // no slow script dialogs <del>user_pref("dom.max_chrome_script_run_time", 0); <del>user_pref("dom.popup_maximum", -1); <del>user_pref("dom.send_after_paint_to_content", true); <del>user_pref("dom.successive_dialog_time_limit", 0); <del>user_pref("security.warn_submit_insecure", false); <del>user_pref("browser.shell.checkDefaultBrowser", false); <del>user_pref("shell.checkDefaultClient", false); <del>user_pref("browser.warnOnQuit", false); <del>user_pref("accessibility.typeaheadfind.autostart", false); <del>user_pref("javascript.options.showInConsole", true); <del>user_pref("devtools.errorconsole.enabled", true); <del>user_pref("layout.debug.enable_data_xbl", true); <del>user_pref("browser.EULA.override", true); <del>user_pref("javascript.options.tracejit.content", true); <del>user_pref("javascript.options.methodjit.content", true); <del>user_pref("javascript.options.jitprofiling.content", true); <del>user_pref("javascript.options.methodjit_always", false); <del>user_pref("gfx.color_management.force_srgb", true); <del>user_pref("network.manage-offline-status", false); <del>user_pref("test.mousescroll", true); <del>user_pref("network.http.prompt-temp-redirect", false); <del>user_pref("media.cache_size", 100); <del>user_pref("security.warn_viewing_mixed", false); <del>user_pref("app.update.enabled", false); <del>user_pref("browser.panorama.experienced_first_run", true); // Assume experienced <del>user_pref("dom.w3c_touch_events.enabled", true); <del>user_pref("extensions.checkCompatibility", false); <del>user_pref("extensions.installDistroAddons", false); // prevent testpilot etc <del>user_pref("browser.safebrowsing.enable", false); // prevent traffic to google servers <del>user_pref("toolkit.telemetry.prompted", true); // prevent telemetry banner <del>user_pref("toolkit.telemetry.enabled", false); <add>'use strict'; <add> <add>user_pref('browser.console.showInPanel', true); <add>user_pref('browser.dom.window.dump.enabled', true); <add>user_pref('browser.firstrun.show.localepicker', false); <add>user_pref('browser.firstrun.show.uidiscovery', false); <add>user_pref('dom.allow_scripts_to_close_windows', true); <add>user_pref('dom.disable_open_during_load', false); <add>user_pref('dom.max_script_run_time', 0); // no slow script dialogs <add>user_pref('dom.max_chrome_script_run_time', 0); <add>user_pref('dom.popup_maximum', -1); <add>user_pref('dom.send_after_paint_to_content', true); <add>user_pref('dom.successive_dialog_time_limit', 0); <add>user_pref('security.warn_submit_insecure', false); <add>user_pref('browser.shell.checkDefaultBrowser', false); <add>user_pref('shell.checkDefaultClient', false); <add>user_pref('browser.warnOnQuit', false); <add>user_pref('accessibility.typeaheadfind.autostart', false); <add>user_pref('javascript.options.showInConsole', true); <add>user_pref('devtools.errorconsole.enabled', true); <add>user_pref('layout.debug.enable_data_xbl', true); <add>user_pref('browser.EULA.override', true); <add>user_pref('javascript.options.tracejit.content', true); <add>user_pref('javascript.options.methodjit.content', true); <add>user_pref('javascript.options.jitprofiling.content', true); <add>user_pref('javascript.options.methodjit_always', false); <add>user_pref('gfx.color_management.force_srgb', true); <add>user_pref('network.manage-offline-status', false); <add>user_pref('test.mousescroll', true); <add>user_pref('network.http.prompt-temp-redirect', false); <add>user_pref('media.cache_size', 100); <add>user_pref('security.warn_viewing_mixed', false); <add>user_pref('app.update.enabled', false); <add>user_pref('browser.panorama.experienced_first_run', true); // Assume experienced <add>user_pref('dom.w3c_touch_events.enabled', true); <add>user_pref('extensions.checkCompatibility', false); <add>user_pref('extensions.installDistroAddons', false); // prevent testpilot etc <add>user_pref('browser.safebrowsing.enable', false); // prevent traffic to google servers <add>user_pref('toolkit.telemetry.prompted', true); // prevent telemetry banner <add>user_pref('toolkit.telemetry.enabled', false);
1
Javascript
Javascript
remove useless cwd in posix.resolve
b255cd48b105b02fb1ee26a8012b764e83a6a419
<ide><path>lib/path.js <ide> const posix = { <ide> resolve: function resolve() { <ide> var resolvedPath = ''; <ide> var resolvedAbsolute = false; <del> var cwd; <ide> <ide> for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { <ide> var path; <ide> if (i >= 0) <ide> path = arguments[i]; <ide> else { <del> if (cwd === undefined) <del> cwd = process.cwd(); <del> path = cwd; <add> path = process.cwd(); <ide> } <ide> <ide> assertPath(path);
1
Text
Text
fix typo in streams.md
a6e416270d116da5c3bf565adcb1e6dddb92d2b6
<ide><path>doc/api/stream.md <ide> implement streams using JavaScript's prototypal inheritance model. <ide> <ide> First, a stream developer would declare a new JavaScript class that extends one <ide> of the four basic stream classes (`stream.Writable`, `stream.Readable`, <del>`stream.Duplex`, or `stream.Transform`), making sure the call the appropriate <add>`stream.Duplex`, or `stream.Transform`), making sure they call the appropriate <ide> parent class constructor: <ide> <ide> ```js
1
Ruby
Ruby
teach brew about mksh
6e691320f8a87b50c0f25c284fdc89aefc3332d6
<ide><path>Library/Homebrew/utils/shell.rb <ide> def from_path(path) <ide> shell_name = File.basename(path) <ide> # handle possible version suffix like `zsh-5.2` <ide> shell_name.sub!(/-.*\z/m, "") <del> shell_name.to_sym if %w[bash csh fish ksh sh tcsh zsh].include?(shell_name) <add> shell_name.to_sym if %w[bash csh fish ksh mksh sh tcsh zsh].include?(shell_name) <ide> end <ide> <ide> def preferred <ide> def parent <ide> # quote values. quoting keys is overkill <ide> def export_value(key, value, shell = preferred) <ide> case shell <del> when :bash, :ksh, :sh, :zsh <add> when :bash, :ksh, :mksh, :sh, :zsh <ide> "export #{key}=\"#{sh_quote(value)}\"" <ide> when :fish <ide> # fish quoting is mostly Bourne compatible except that <ide> def set_variable_in_profile(variable, value) <ide> <ide> def prepend_path_in_profile(path) <ide> case preferred <del> when :bash, :ksh, :sh, :zsh, nil <add> when :bash, :ksh, :mksh, :sh, :zsh, nil <ide> "echo 'export PATH=\"#{sh_quote(path)}:$PATH\"' >> #{profile}" <ide> when :csh, :tcsh <ide> "echo 'setenv PATH #{csh_quote(path)}:$PATH' >> #{profile}" <ide> def prepend_path_in_profile(path) <ide> csh: "~/.cshrc", <ide> fish: "~/.config/fish/config.fish", <ide> ksh: "~/.kshrc", <add> mksh: "~/.kshrc", <ide> sh: "~/.bash_profile", <ide> tcsh: "~/.tcshrc", <ide> zsh: "~/.zshrc",
1
Javascript
Javascript
handle invalid unsubscriptions
9504a5cae644c048ea2b466ccc7c1a60cec74291
<ide><path>server/boot/randomAPIs.js <ide> module.exports = function(app) { <ide> req.checkParams('email', 'Must send a valid email').isEmail(); <ide> return User.findOne({ where: { email: req.params.email } }, (err, user) => { <ide> if (err) { return next(err); } <add> if (!user) { <add> req.flash('info', { <add> msg: 'Email address not found. ' + <add> 'Please update your Email preferences from your profile.' <add> }); <add> return res.redirect('/map'); <add> } <ide> return user.updateAttribute('sendMonthlyEmail', false, (err) => { <ide> if (err) { return next(err); } <ide> req.flash('info', { <ide> module.exports = function(app) { <ide> req.checkParams('email', 'Must send a valid email').isEmail(); <ide> return User.findOne({ where: { email: req.params.email } }, (err, user) => { <ide> if (err) { return next(err); } <add> if (!user) { <add> req.flash('info', { <add> msg: 'Email address not found. ' + <add> 'Please update your Email preferences from your profile.' <add> }); <add> return res.redirect('/map'); <add> } <ide> return user.updateAttribute('sendNotificationEmail', false, (err) => { <ide> if (err) { return next(err); } <ide> req.flash('info', { <ide> module.exports = function(app) { <ide> req.checkParams('email', 'Must send a valid email').isEmail(); <ide> return User.findOne({ where: { email: req.params.email } }, (err, user) => { <ide> if (err) { return next(err); } <add> if (!user) { <add> req.flash('info', { <add> msg: 'Email address not found. ' + <add> 'Please update your Email preferences from your profile.' <add> }); <add> return res.redirect('/map'); <add> } <ide> return user.updateAttribute('sendQuincyEmail', false, (err) => { <ide> if (err) { return next(err); } <ide> req.flash('info', {
1
Text
Text
fix typo in table
ccdf68bdeae8e5a41f7c8d93fcb8be65d8da5627
<ide><path>docs/how-to-work-on-the-component-library.md <ide> npm run gen-component MyComponent <ide> <ide> The command will generate a new folder inside the `ui-components` directory, with the following files: <ide> <del>| File name | Purpose | <del>| -------------------------- | ------------------------------------------------------ | <del>| `index.ts` | It is used for exporting the component and its types. | <del>| `my-component.stories.tsx` | It is used for demoing the component on Storybook. | <del>| `my-component.test.tsx` | It is a test file. | <del>| `my-component.tsx` | It is where we implement the component. | <del>| `types.ts` | Is is where we locate component's interface and types. | <add>| File name | Purpose | <add>| -------------------------- | ---------------------------------------------------------- | <add>| `index.ts` | It is used for exporting the component and its types. | <add>| `my-component.stories.tsx` | It is used for demoing the component on Storybook. | <add>| `my-component.test.tsx` | It is a test file. | <add>| `my-component.tsx` | It is where we implement the component. | <add>| `types.ts` | It is where we locate the component's interface and types. | <ide> <ide> Each component is different, but in general a component should: <ide>
1
Text
Text
fix typo in docs
249a14704b9f577628770ead5130cbb2e3b2abc7
<ide><path>docs/writing-specs.md <ide> Atom uses [Jasmine](http://jasmine.github.io/2.0/introduction.html) as its spec <ide> expect("oranges").not.toEqual("apples") <ide> ``` <ide> <del>## Runnings specs <add>## Running specs <ide> <ide> Most of the time you'll want to run specs by triggering the `window:run-package-specs` command. This command is not only to run package specs, it is also for Atom core specs. This will run all the specs in the current project's spec directory. If you want to run the Atom core specs and **all** the default package specs trigger the `window:run-all-specs` command. <ide>
1
Go
Go
use fnv1-a to construct the spi
ddff1b5a876631de0326bf41b1f22f6816572bbb
<ide><path>libnetwork/drivers/overlay/encryption.go <ide> import ( <ide> "encoding/binary" <ide> "encoding/hex" <ide> "fmt" <add> "hash/fnv" <ide> "net" <ide> "sync" <ide> "syscall" <ide> func spExists(sp *netlink.XfrmPolicy) (bool, error) { <ide> } <ide> <ide> func buildSPI(src, dst net.IP, st uint32) int { <del> spi := int(st) <del> f := src[len(src)-4:] <del> t := dst[len(dst)-4:] <del> for i := 0; i < 4; i++ { <del> spi = spi ^ (int(f[i])^int(t[3-i]))<<uint32(8*i) <del> } <del> return spi <add> b := make([]byte, 4) <add> binary.BigEndian.PutUint32(b, st) <add> h := fnv.New32a() <add> h.Write(src) <add> h.Write(b) <add> h.Write(dst) <add> return int(binary.BigEndian.Uint32(h.Sum(nil))) <ide> } <ide> <ide> func buildAeadAlgo(k *key, s int) *netlink.XfrmStateAlgo {
1
Javascript
Javascript
remove unused calculation from bad merge
a77efa0587b7f30ed8e9849a96c8c093c6d412c4
<ide><path>src/core/evaluator.js <ide> var PartialEvaluator = (function PartialEvaluatorClosure() { <ide> dir: bidiResult.dir <ide> }; <ide> var renderParams = textState.calcRenderParams(preprocessor.ctm); <del> bidiText.x = renderParams.renderMatrix[4] - (textState.fontSize * <del> renderParams.vScale * Math.sin(renderParams.angle)); <del> bidiText.y = renderParams.renderMatrix[5] + (textState.fontSize * <del> renderParams.vScale * Math.cos(renderParams.angle)); <ide> var fontHeight = textState.fontSize * renderParams.vScale; <ide> var fontAscent = font.ascent ? font.ascent * fontHeight : <ide> font.descent ? (1 + font.descent) * fontHeight : fontHeight;
1
Text
Text
add alternatives alternative to symlinks
efc730dc2fac17087f7c27ac3da3e953cc1ab21f
<ide><path>docs/build-instructions/linux.md <ide> have Node.js installed, or node isn't identified as Node.js on your machine. <ide> If it's the latter, entering `sudo ln -s /usr/bin/nodejs /usr/bin/node` into <ide> your terminal may fix the issue. <ide> <add>## You can also use Alternatives: <add> <add>On some variants it's preferrable for you to use Alternatives so can easily <add>rollback and change the binary paths: <add> <add>``` <add>sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 1 \ <add> --slave /usr/bin/js js /usr/bin/nodejs <add>``` <add> <ide> ### Linux build error reports in atom/atom <ide> * Use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Alinux&type=Issues) <ide> to get a list of reports about build errors on Linux.
1
Mixed
Ruby
preserve entry ttl when incrementing
4af6d50d44fe25df304b7f682b43b7a29125a807
<ide><path>activesupport/CHANGELOG.md <add>* Fix MemoryStore to preserve entries TTL when incrementing or decrementing <add> <add> This is to be more consistent with how MemCachedStore and RedisCacheStore behaves. <add> <add> *Jean Boussier* <add> <ide> * `Rails.error.handle` and `Rails.error.record` filter now by multiple error classes. <ide> <ide> ```ruby <ide><path>activesupport/lib/active_support/cache/memory_store.rb <ide> def delete_entry(key, **options) <ide> # If the key is not found it is created and set to +amount+. <ide> def modify_value(name, amount, options) <ide> options = merged_options(options) <del> synchronize do <del> if num = read(name, options) <del> num = num.to_i + amount <del> write(name, num, options) <del> num <del> else <del> write(name, Integer(amount), options) <del> amount <del> end <add> key = normalize_key(name, options) <add> version = normalize_version(name, options) <add> <add> entry = read_entry(key, **options) <add> <add> if !entry || entry.expired? || entry.mismatched?(version) <add> write(name, Integer(amount), options) <add> amount <add> else <add> num = entry.value.to_i + amount <add> entry = Entry.new(num, expires_at: entry.expires_at, version: entry.version) <add> write_entry(key, entry) <add> num <ide> end <ide> end <ide> end <ide><path>activesupport/test/cache/stores/memory_store_test.rb <ide> def test_large_string_with_default_compression_settings <ide> def test_large_object_with_default_compression_settings <ide> assert_uncompressed(LARGE_OBJECT) <ide> end <add> <add> def test_increment_preserves_expiry <add> @cache = lookup_store <add> @cache.write("counter", 1, raw: true, expires_in: 30.seconds) <add> assert_equal 1, @cache.read("counter", raw: true) <add> <add> Time.stub(:now, Time.now + 1.minute) do <add> assert_nil @cache.read("counter", raw: true) <add> end <add> <add> @cache.write("counter", 1, raw: true, expires_in: 30.seconds) <add> @cache.increment("counter") <add> assert_equal 2, @cache.read("counter", raw: true) <add> Time.stub(:now, Time.now + 1.minute) do <add> assert_nil @cache.read("counter", raw: true) <add> end <add> end <ide> end <ide> <ide> class MemoryStorePruningTest < ActiveSupport::TestCase
3
Python
Python
correct some minor pep8 error
f863ec5ece72694702a5775a2f2950217ca33493
<ide><path>glances/exports/glances_elasticsearch.py <ide> def export(self, name, columns, points): <ide> "_source": { <ide> "value": str(p), <ide> "timestamp": datetime.now() <del> } <add> } <ide> } <ide> actions.append(action) <ide> <ide><path>glances/outputs/glances_curses.py <ide> def __catch_key(self, return_to_browser=False): <ide> self.args.disable_swap = False <ide> elif self.pressedkey == ord('5'): <ide> # '5' > Enable/disable top menu <del> logger.info(self.args.disable_top ) <add> logger.info(self.args.disable_top) <ide> self.args.disable_top = not self.args.disable_top <ide> if self.args.disable_top: <ide> self.args.disable_quicklook = True <ide><path>setup.py <ide> print('Glances requires at least Python 2.6 or 3.3 to run.') <ide> sys.exit(1) <ide> <add> <ide> class tests(Command): <ide> user_options = [] <ide> <ide> def run(self): <ide> raise SystemExit(ret) <ide> raise SystemExit(0) <ide> <add> <ide> def get_data_files(): <ide> data_files = [ <ide> ('share/doc/glances', ['AUTHORS', 'COPYING', 'NEWS', 'README.rst', <ide> def get_data_files(): <ide> <ide> return data_files <ide> <add> <ide> def get_requires(): <ide> requires = ['psutil>=2.0.0'] <ide> if sys.platform.startswith('win'):
3
Ruby
Ruby
fix rubocop warnings
f9c621304da00c0645950506a4d7eddab70ccbdf
<ide><path>Library/Homebrew/cmd/prune.rb <ide> def prune <ide> end <ide> end <ide> <del> if ObserverPathnameExtension.total.zero? <del> puts "Nothing pruned" if ARGV.verbose? <del> else <del> n, d = ObserverPathnameExtension.counts <del> print "Pruned #{n} symbolic links " <del> print "and #{d} directories " if d > 0 <del> puts "from #{HOMEBREW_PREFIX}" <del> end unless ARGV.dry_run? <add> unless ARGV.dry_run? <add> if ObserverPathnameExtension.total.zero? <add> puts "Nothing pruned" if ARGV.verbose? <add> else <add> n, d = ObserverPathnameExtension.counts <add> print "Pruned #{n} symbolic links " <add> print "and #{d} directories " if d > 0 <add> puts "from #{HOMEBREW_PREFIX}" <add> end <add> end <ide> <ide> unlinkapps_prune(:dry_run => ARGV.dry_run?, :quiet => true) <ide> end
1
Python
Python
add pad_to_multiple_of on tokenizers (reimport)
135791e8ef12802ceb21a4abbb3a93f7da1bf390
<ide><path>src/transformers/tokenization_roberta.py <ide> def create_token_type_ids_from_sequences( <ide> <ide> def prepare_for_tokenization(self, text, is_pretokenized=False, **kwargs): <ide> add_prefix_space = kwargs.pop("add_prefix_space", self.add_prefix_space) <del> if (is_pretokenized or add_prefix_space) and text: <add> if (is_pretokenized or add_prefix_space) and (len(text) > 0 and not text[0].isspace()): <ide> text = " " + text <ide> return (text, kwargs) <ide> <ide><path>src/transformers/tokenization_utils.py <ide> def _encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def get_input_ids(text): <ide> truncation_strategy=truncation_strategy, <ide> max_length=max_length, <ide> stride=stride, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_tensors=return_tensors, <ide> prepend_batch_axis=True, <ide> return_attention_mask=return_attention_mask, <ide> def _batch_encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def get_input_ids(text): <ide> truncation_strategy=truncation_strategy, <ide> max_length=max_length, <ide> stride=stride, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_attention_mask=return_attention_mask, <ide> return_token_type_ids=return_token_type_ids, <ide> return_overflowing_tokens=return_overflowing_tokens, <ide> def _batch_prepare_for_model( <ide> truncation_strategy: TruncationStrategy = TruncationStrategy.DO_NOT_TRUNCATE, <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[str] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def _batch_prepare_for_model( <ide> truncation_strategy=truncation_strategy, <ide> max_length=max_length, <ide> stride=stride, <add> pad_to_multiple_of=None, # we pad in batch afterward <ide> return_attention_mask=False, # we pad in batch afterward <ide> return_token_type_ids=return_token_type_ids, <ide> return_overflowing_tokens=return_overflowing_tokens, <ide> def _batch_prepare_for_model( <ide> batch_outputs, <ide> padding=padding_strategy.value, <ide> max_length=max_length, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_attention_mask=return_attention_mask, <ide> ) <ide> <ide> def _prepare_for_model( <ide> truncation_strategy: TruncationStrategy = TruncationStrategy.DO_NOT_TRUNCATE, <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[str] = None, <ide> prepend_batch_axis: bool = False, <ide> return_token_type_ids: Optional[bool] = None, <ide> def _prepare_for_model( <ide> <ide> encoded_inputs = {} <ide> <del> # Truncation: Handle max sequence length <add> # Compute the total size of the returned encodings <ide> total_len = len_ids + len_pair_ids + (self.num_special_tokens_to_add(pair=pair) if add_special_tokens else 0) <add> <add> # Truncation: Handle max sequence length <ide> if truncation_strategy != TruncationStrategy.DO_NOT_TRUNCATE and max_length and total_len > max_length: <ide> ids, pair_ids, overflowing_tokens = self.truncate_sequences( <ide> ids, <ide> def _prepare_for_model( <ide> encoded_inputs, <ide> max_length=max_length, <ide> padding=padding_strategy.value, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_attention_mask=return_attention_mask, <ide> ) <ide> <ide><path>src/transformers/tokenization_utils_base.py <ide> class attributes (cls_token, unk_token...). <ide> The value of this argument defines the number of overlapping tokens. <ide> is_pretokenized (:obj:`bool`, defaults to :obj:`False`): <ide> Set to True to indicate the input is already tokenized <add> pad_to_multiple_of: (optional) Integer if set will pad the sequence to a multiple of the provided value. <add> This is especially useful to enable the use of Tensor Core on NVIDIA hardware with compute capability <add> >= 7.5 (Volta). <ide> return_tensors (:obj:`str`, `optional`, defaults to :obj:`None`): <ide> Can be set to 'tf', 'pt' or 'np' to return respectively TensorFlow :obj:`tf.constant`, <ide> PyTorch :obj:`torch.Tensor` or Numpy :oj: `np.ndarray` instead of a list of python integers. <ide> def num_special_tokens_to_add(self, pair: bool = False) -> int: <ide> raise NotImplementedError <ide> <ide> def _get_padding_truncation_strategies( <del> self, padding=False, truncation=False, max_length=None, verbose=True, **kwargs <add> self, padding=False, truncation=False, max_length=None, pad_to_multiple_of=None, verbose=True, **kwargs <ide> ): <ide> """ Find the correct padding/truncation strategy with backward compatibility <ide> for old arguments (truncation_strategy and pad_to_max_length) and behaviors. <ide> def _get_padding_truncation_strategies( <ide> "or add a new pad token via `tokenizer.add_special_tokens({'pad_token': '[PAD]'})`." <ide> ) <ide> <add> # Check that we will truncate to a multiple of pad_to_multiple_of if both are provided <add> if ( <add> truncation_strategy != TruncationStrategy.DO_NOT_TRUNCATE <add> and padding_strategy != PaddingStrategy.DO_NOT_PAD <add> and pad_to_multiple_of is not None <add> and max_length is not None <add> and (max_length % pad_to_multiple_of != 0) <add> ): <add> raise ValueError( <add> f"Truncation and padding are both activated but " <add> f"truncation length ({max_length}) is not a multiple of pad_to_multiple_of ({pad_to_multiple_of})." <add> ) <add> <ide> return padding_strategy, truncation_strategy, max_length, kwargs <ide> <ide> @add_end_docstrings(ENCODE_KWARGS_DOCSTRING, ENCODE_PLUS_ADDITIONAL_KWARGS_DOCSTRING) <ide> def __call__( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def __call__( <ide> max_length=max_length, <ide> stride=stride, <ide> is_pretokenized=is_pretokenized, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_tensors=return_tensors, <ide> return_token_type_ids=return_token_type_ids, <ide> return_attention_mask=return_attention_mask, <ide> def __call__( <ide> max_length=max_length, <ide> stride=stride, <ide> is_pretokenized=is_pretokenized, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_tensors=return_tensors, <ide> return_token_type_ids=return_token_type_ids, <ide> return_attention_mask=return_attention_mask, <ide> def encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def encode_plus( <ide> <ide> # Backward compatibility for 'truncation_strategy', 'pad_to_max_length' <ide> padding_strategy, truncation_strategy, max_length, kwargs = self._get_padding_truncation_strategies( <del> padding, truncation, max_length, verbose, **kwargs <add> padding=padding, <add> truncation=truncation, <add> max_length=max_length, <add> pad_to_multiple_of=pad_to_multiple_of, <add> verbose=verbose, <add> **kwargs, <ide> ) <ide> <ide> return self._encode_plus( <ide> def encode_plus( <ide> max_length=max_length, <ide> stride=stride, <ide> is_pretokenized=is_pretokenized, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_tensors=return_tensors, <ide> return_token_type_ids=return_token_type_ids, <ide> return_attention_mask=return_attention_mask, <ide> def _encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def batch_encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def batch_encode_plus( <ide> <ide> # Backward compatibility for 'truncation_strategy', 'pad_to_max_length' <ide> padding_strategy, truncation_strategy, max_length, kwargs = self._get_padding_truncation_strategies( <del> padding, truncation, max_length, verbose, **kwargs <add> padding=padding, <add> truncation=truncation, <add> max_length=max_length, <add> pad_to_multiple_of=pad_to_multiple_of, <add> verbose=verbose, <add> **kwargs, <ide> ) <ide> <ide> return self._batch_encode_plus( <ide> def batch_encode_plus( <ide> max_length=max_length, <ide> stride=stride, <ide> is_pretokenized=is_pretokenized, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_tensors=return_tensors, <ide> return_token_type_ids=return_token_type_ids, <ide> return_attention_mask=return_attention_mask, <ide> def _batch_encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def pad( <ide> ], <ide> padding: Union[bool, str] = True, <ide> max_length: Optional[int] = None, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> return_tensors: Optional[Union[str, TensorType]] = None, <ide> verbose: bool = True, <ide> def pad( <ide> - 'do_not_pad' (or `False`): Do not pad <ide> max_length: maximum length of the returned list and optionally padding length (see below). <ide> Will truncate by taking into account the special tokens. <add> pad_to_multiple_of: (optional) Integer if set will pad the sequence to a multiple of the provided value. <add> This is especially useful to enable the use of Tensor Core on NVIDIA hardware with compute capability <add> >= 7.5 (Volta). <ide> return_attention_mask: (optional) Set to False to avoid returning attention mask (default: set to model specifics) <ide> return_tensors (:obj:`str`, `optional`, defaults to :obj:`None`): <ide> Can be set to 'tf', 'pt' or 'np' to return respectively TensorFlow :obj:`tf.constant`, <ide> def pad( <ide> encoded_inputs["attention_mask"] = [] <ide> return encoded_inputs <ide> <del> # Backward compatibility for 'truncation_strategy', 'pad_to_max_length' <add> # Convert padding_strategy in PaddingStrategy <ide> padding_strategy, _, max_length, _ = self._get_padding_truncation_strategies( <ide> padding=padding, max_length=max_length, verbose=verbose <ide> ) <ide> def pad( <ide> encoded_inputs, <ide> max_length=max_length, <ide> padding_strategy=padding_strategy, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_attention_mask=return_attention_mask, <ide> ) <ide> return BatchEncoding(encoded_inputs, tensor_type=return_tensors) <ide> def pad( <ide> inputs, <ide> max_length=max_length, <ide> padding_strategy=padding_strategy, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_attention_mask=return_attention_mask, <ide> ) <ide> <ide> def _pad( <ide> encoded_inputs: Union[Dict[str, EncodedInput], BatchEncoding], <ide> max_length: Optional[int] = None, <ide> padding_strategy: PaddingStrategy = PaddingStrategy.DO_NOT_PAD, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> ) -> dict: <ide> """ Pad encoded inputs (on left/right and up to predefined legnth or max length in the batch) <ide> def _pad( <ide> The tokenizer padding sides are defined in self.padding_side: <ide> - 'left': pads on the left of the sequences <ide> - 'right': pads on the right of the sequences <add> pad_to_multiple_of: (optional) Integer if set will pad the sequence to a multiple of the provided value. <add> This is especially useful to enable the use of Tensor Core on NVIDIA hardware with compute capability <add> >= 7.5 (Volta). <ide> return_attention_mask: (optional) Set to False to avoid returning attention mask (default: set to model specifics) <ide> """ <ide> # Load from model defaults <ide> def _pad( <ide> if padding_strategy == PaddingStrategy.LONGEST: <ide> max_length = len(encoded_inputs["input_ids"]) <ide> <add> if max_length is not None and pad_to_multiple_of is not None and (max_length % pad_to_multiple_of != 0): <add> max_length = ((max_length // pad_to_multiple_of) + 1) * pad_to_multiple_of <add> <ide> needs_to_be_padded = ( <ide> padding_strategy != PaddingStrategy.DO_NOT_PAD and len(encoded_inputs["input_ids"]) != max_length <ide> ) <ide><path>src/transformers/tokenization_utils_fast.py <ide> def tokenize(self, text: str, pair: Optional[str] = None, add_special_tokens: bo <ide> return self._tokenizer.encode(text, pair, add_special_tokens=add_special_tokens).tokens <ide> <ide> def set_truncation_and_padding( <del> self, padding_strategy: PaddingStrategy, truncation_strategy: TruncationStrategy, max_length: int, stride: int, <add> self, <add> padding_strategy: PaddingStrategy, <add> truncation_strategy: TruncationStrategy, <add> max_length: int, <add> stride: int, <add> pad_to_multiple_of: Optional[int], <ide> ): <del> """ This contextmanager is in charge of defining the truncation and the padding strategies for fast tokenizers <add> """ Define the truncation and the padding strategies for fast tokenizers <ide> (provided by HuggingFace tokenizers library) and restore the tokenizer settings afterwards. <ide> <del> This contextmanager assumes the provider tokenizer has no padding / truncation strategy <add> The provided tokenizer has no padding / truncation strategy <ide> before the managed section. If your tokenizer set a padding / truncation strategy before, <ide> then it will be reset to no padding/truncation when exiting the managed section. <ide> <ide> Args: <del> tokenizer (BaseTokenizerFast): The tokenizer which will be used <del> max_length (int): The maximum size of the sequence <del> stride (int): The stride to use when handling overflow <del> strategy (str): Overflowing logic to use <del> pad_to_max_length (bool): Boolean indicating if the output needs to be padded up to max_length <del> padding_side (str): "left" or "right" indicating the direction the output sequence will be padded <del> pad_token_id (int): The integer representation of the padding token to use <del> pad_token_type_id (int): The integer representation of the padding token type to use <del> pad_token (str): The string representation of the padding token to use <add> padding_strategy (:obj:`PaddingStrategy`): The kind of padding that will be applied to the input <add> truncation_strategy (:obj:`TruncationStrategy`): The kind of truncation that will be applied to the input <add> max_length (:obj:`int`): The maximum size of the sequence <add> stride (:obj:`int`): The stride to use when handling overflow <add> pad_to_multiple_of (:obj:`int`, `optional`, defaults to `None`) <ide> <ide> """ <ide> # Set truncation and padding on the backend tokenizer <ide> def set_truncation_and_padding( <ide> pad_id=self.pad_token_id, <ide> pad_type_id=self.pad_token_type_id, <ide> pad_token=self.pad_token, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> ) <ide> else: <ide> self._tokenizer.no_padding() <ide> def _batch_encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[str] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def _batch_encode_plus( <ide> truncation_strategy=truncation_strategy, <ide> max_length=max_length, <ide> stride=stride, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> ) <ide> <ide> # Avoid thread overhead if only one example. <ide> def _encode_plus( <ide> max_length: Optional[int] = None, <ide> stride: int = 0, <ide> is_pretokenized: bool = False, <add> pad_to_multiple_of: Optional[int] = None, <ide> return_tensors: Optional[bool] = None, <ide> return_token_type_ids: Optional[bool] = None, <ide> return_attention_mask: Optional[bool] = None, <ide> def _encode_plus( <ide> truncation_strategy=truncation_strategy, <ide> max_length=max_length, <ide> stride=stride, <add> pad_to_multiple_of=pad_to_multiple_of, <ide> return_tensors=return_tensors, <ide> return_token_type_ids=return_token_type_ids, <ide> return_attention_mask=return_attention_mask, <ide><path>tests/test_tokenization_common.py <ide> def test_padding_to_max_length(self): <ide> assert sequence_length == padded_sequence_right_length <ide> assert encoded_sequence == padded_sequence_right <ide> <add> def test_padding_to_multiple_of(self): <add> tokenizers = self.get_tokenizers() <add> for tokenizer in tokenizers: <add> if tokenizer.pad_token is None: <add> self.skipTest("No padding token.") <add> else: <add> with self.subTest(f"{tokenizer.__class__.__name__}"): <add> empty_tokens = tokenizer("", padding=True, pad_to_multiple_of=8) <add> normal_tokens = tokenizer("This is a sample input", padding=True, pad_to_multiple_of=8) <add> for key, value in empty_tokens.items(): <add> self.assertEqual(len(value) % 8, 0, "BatchEncoding.{} is not multiple of 8".format(key)) <add> for key, value in normal_tokens.items(): <add> self.assertEqual(len(value) % 8, 0, "BatchEncoding.{} is not multiple of 8".format(key)) <add> <add> normal_tokens = tokenizer("This", pad_to_multiple_of=8) <add> for key, value in normal_tokens.items(): <add> self.assertNotEqual(len(value) % 8, 0, "BatchEncoding.{} is not multiple of 8".format(key)) <add> <add> # Should also work with truncation <add> normal_tokens = tokenizer("This", padding=True, truncation=True, pad_to_multiple_of=8) <add> for key, value in normal_tokens.items(): <add> self.assertEqual(len(value) % 8, 0, "BatchEncoding.{} is not multiple of 8".format(key)) <add> <add> # truncation to something which is not a multiple of pad_to_multiple_of raises an error <add> self.assertRaises( <add> ValueError, <add> tokenizer.__call__, <add> "This", <add> padding=True, <add> truncation=True, <add> max_length=12, <add> pad_to_multiple_of=8, <add> ) <add> <ide> def test_encode_plus_with_padding(self): <ide> tokenizers = self.get_tokenizers(do_lower_case=False) <ide> for tokenizer in tokenizers:
5
Text
Text
update documentation for setting up database tests
b4ee2d5f6568a6edbf5ab521e6babd10639747f0
<ide><path>guides/source/contributing_to_ruby_on_rails.md <ide> $ SEED=15002 bundle exec ruby -w -Itest test/mail_layout_test.rb <ide> First, create the databases you'll need. You can find a list of the required <ide> table names, usernames, and passwords in `activerecord/test/config.example.yml`. <ide> <del>For MySQL and PostgreSQL, running the SQL statements `create database <del>activerecord_unittest` and `create database activerecord_unittest2` is <del>sufficient. This is not necessary for SQLite3. <add>For MySQL and PostgreSQL, it is sufficient to run: <add> <add>```bash <add>$ cd activerecord <add>$ bundle exec rake db:mysql:build <add>``` <add>Or: <add> <add>```bash <add>$ cd activerecord <add>$ bundle exec rake db:postgresql:build <add>``` <add>This is not necessary for SQLite3. <ide> <ide> This is how you run the Active Record test suite only for SQLite3: <ide>
1
Python
Python
modernise parser tests and don't depend on models
d0e37b56705f4a26ffb2e832af8f780cbcb87796
<ide><path>spacy/tests/parser/test_parse.py <add># coding: utf-8 <ide> from __future__ import unicode_literals <ide> <add>from ..util import get_doc, apply_transition_sequence <add> <ide> import pytest <ide> <ide> <del>@pytest.mark.models <del>def test_root(EN): <del> tokens = EN(u"i don't have other assistance") <del> for t in tokens: <del> assert t.dep != 0, t.orth_ <add>def test_parser_root(en_tokenizer): <add> text = "i don't have other assistance" <add> heads = [3, 2, 1, 0, 1, -2] <add> deps = ['nsubj', 'aux', 'neg', 'ROOT', 'amod', 'dobj'] <add> tokens = en_tokenizer(text) <add> doc = get_doc(tokens.vocab, [t.text for t in tokens], heads=heads, deps=deps) <add> for t in doc: <add> assert t.dep != 0, t.text <add> <ide> <add>@pytest.mark.parametrize('text', ["Hello"]) <add>def test_parser_parse_one_word_sentence(en_tokenizer, en_parser, text): <add> tokens = en_tokenizer(text) <add> doc = get_doc(tokens.vocab, [t.text for t in tokens], heads=[0], deps=['ROOT']) <ide> <del>@pytest.mark.models <del>def test_one_word_sentence(EN): <del> # one word sentence <del> doc = EN.tokenizer.tokens_from_list(['Hello']) <del> EN.tagger(doc) <ide> assert len(doc) == 1 <del> with EN.parser.step_through(doc) as _: <add> with en_parser.step_through(doc) as _: <ide> pass <ide> assert doc[0].dep != 0 <ide> <ide> <del>def apply_transition_sequence(model, doc, sequence): <del> for action_name in sequence: <del> if '-' in action_name: <del> move, label = action_name.split('-') <del> model.parser.add_label(label) <del> with model.parser.step_through(doc) as stepwise: <del> for transition in sequence: <del> stepwise.transition(transition) <del> <add>def test_parser_arc_eager_finalize_state(en_tokenizer, en_parser): <add> text = "a b c d e" <ide> <del>@pytest.mark.models <del>def test_arc_eager_finalize_state(EN): <ide> # right branching <del> example = EN.tokenizer.tokens_from_list(u"a b c d e".split(' ')) <del> apply_transition_sequence(EN, example, ['R-nsubj','D','R-nsubj','R-nsubj','D','R-ROOT']) <del> <del> assert example[0].n_lefts == 0 <del> assert example[0].n_rights == 2 <del> assert example[0].left_edge.i == 0 <del> assert example[0].right_edge.i == 4 <del> assert example[0].head.i == 0 <del> <del> assert example[1].n_lefts == 0 <del> assert example[1].n_rights == 0 <del> assert example[1].left_edge.i == 1 <del> assert example[1].right_edge.i == 1 <del> assert example[1].head.i == 0 <del> <del> assert example[2].n_lefts == 0 <del> assert example[2].n_rights == 2 <del> assert example[2].left_edge.i == 2 <del> assert example[2].right_edge.i == 4 <del> assert example[2].head.i == 0 <del> <del> assert example[3].n_lefts == 0 <del> assert example[3].n_rights == 0 <del> assert example[3].left_edge.i == 3 <del> assert example[3].right_edge.i == 3 <del> assert example[3].head.i == 2 <del> <del> assert example[4].n_lefts == 0 <del> assert example[4].n_rights == 0 <del> assert example[4].left_edge.i == 4 <del> assert example[4].right_edge.i == 4 <del> assert example[4].head.i == 2 <add> transition = ['R-nsubj', 'D', 'R-nsubj', 'R-nsubj', 'D', 'R-ROOT'] <add> tokens = en_tokenizer(text) <add> apply_transition_sequence(en_parser, tokens, transition) <add> <add> assert tokens[0].n_lefts == 0 <add> assert tokens[0].n_rights == 2 <add> assert tokens[0].left_edge.i == 0 <add> assert tokens[0].right_edge.i == 4 <add> assert tokens[0].head.i == 0 <add> <add> assert tokens[1].n_lefts == 0 <add> assert tokens[1].n_rights == 0 <add> assert tokens[1].left_edge.i == 1 <add> assert tokens[1].right_edge.i == 1 <add> assert tokens[1].head.i == 0 <add> <add> assert tokens[2].n_lefts == 0 <add> assert tokens[2].n_rights == 2 <add> assert tokens[2].left_edge.i == 2 <add> assert tokens[2].right_edge.i == 4 <add> assert tokens[2].head.i == 0 <add> <add> assert tokens[3].n_lefts == 0 <add> assert tokens[3].n_rights == 0 <add> assert tokens[3].left_edge.i == 3 <add> assert tokens[3].right_edge.i == 3 <add> assert tokens[3].head.i == 2 <add> <add> assert tokens[4].n_lefts == 0 <add> assert tokens[4].n_rights == 0 <add> assert tokens[4].left_edge.i == 4 <add> assert tokens[4].right_edge.i == 4 <add> assert tokens[4].head.i == 2 <ide> <ide> # left branching <del> example = EN.tokenizer.tokens_from_list(u"a b c d e".split(' ')) <del> apply_transition_sequence(EN, example, ['S', 'S', 'S', 'L-nsubj','L-nsubj','L-nsubj', 'L-nsubj']) <del> <del> assert example[0].n_lefts == 0 <del> assert example[0].n_rights == 0 <del> assert example[0].left_edge.i == 0 <del> assert example[0].right_edge.i == 0 <del> assert example[0].head.i == 4 <del> <del> assert example[1].n_lefts == 0 <del> assert example[1].n_rights == 0 <del> assert example[1].left_edge.i == 1 <del> assert example[1].right_edge.i == 1 <del> assert example[1].head.i == 4 <del> <del> assert example[2].n_lefts == 0 <del> assert example[2].n_rights == 0 <del> assert example[2].left_edge.i == 2 <del> assert example[2].right_edge.i == 2 <del> assert example[2].head.i == 4 <del> <del> assert example[3].n_lefts == 0 <del> assert example[3].n_rights == 0 <del> assert example[3].left_edge.i == 3 <del> assert example[3].right_edge.i == 3 <del> assert example[3].head.i == 4 <del> <del> assert example[4].n_lefts == 4 <del> assert example[4].n_rights == 0 <del> assert example[4].left_edge.i == 0 <del> assert example[4].right_edge.i == 4 <del> assert example[4].head.i == 4 <add> transition = ['S', 'S', 'S', 'L-nsubj','L-nsubj','L-nsubj', 'L-nsubj'] <add> tokens = en_tokenizer(text) <add> apply_transition_sequence(en_parser, tokens, transition) <add> <add> assert tokens[0].n_lefts == 0 <add> assert tokens[0].n_rights == 0 <add> assert tokens[0].left_edge.i == 0 <add> assert tokens[0].right_edge.i == 0 <add> assert tokens[0].head.i == 4 <add> <add> assert tokens[1].n_lefts == 0 <add> assert tokens[1].n_rights == 0 <add> assert tokens[1].left_edge.i == 1 <add> assert tokens[1].right_edge.i == 1 <add> assert tokens[1].head.i == 4 <add> <add> assert tokens[2].n_lefts == 0 <add> assert tokens[2].n_rights == 0 <add> assert tokens[2].left_edge.i == 2 <add> assert tokens[2].right_edge.i == 2 <add> assert tokens[2].head.i == 4 <add> <add> assert tokens[3].n_lefts == 0 <add> assert tokens[3].n_rights == 0 <add> assert tokens[3].left_edge.i == 3 <add> assert tokens[3].right_edge.i == 3 <add> assert tokens[3].head.i == 4 <add> <add> assert tokens[4].n_lefts == 4 <add> assert tokens[4].n_rights == 0 <add> assert tokens[4].left_edge.i == 0 <add> assert tokens[4].right_edge.i == 4 <add> assert tokens[4].head.i == 4
1
Javascript
Javascript
use .test domain for not found address
8645a3610e1b2eb89fdb96ae795017ec239410c8
<ide><path>test/common/internet.js <ide> const addresses = { <ide> MX_HOST: 'nodejs.org', <ide> // On some systems, .invalid returns a server failure/try again rather than <ide> // record not found. Use this to guarantee record not found. <del> NOT_FOUND: 'come.on.fhqwhgads', <add> NOT_FOUND: 'come.on.fhqwhgads.test', <ide> // A host with SRV records registered <ide> SRV_HOST: '_jabber._tcp.google.com', <ide> // A host with PTR records registered
1
Javascript
Javascript
add geometries es6 unit tests
1061e2e0cd220d84c1a6a14814ae8514cd04ef78
<ide><path>test/unit/src/geometries/BoxGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> BoxGeometry, <add> BoxBufferGeometry <add>} from '../../../../src/geometries/BoxGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'BoxGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> width: 10, <add> height: 20, <add> depth: 30, <add> widthSegments: 2, <add> heightSegments: 3, <add> depthSegments: 4 <add> }; <add> <add> geometries = [ <add> new BoxGeometry(), <add> new BoxGeometry( parameters.width, parameters.height, parameters.depth ), <add> new BoxGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments ) <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'BoxBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> width: 10, <add> height: 20, <add> depth: 30, <add> widthSegments: 2, <add> heightSegments: 3, <add> depthSegments: 4 <add> }; <add> <add> geometries = [ <add> new BoxBufferGeometry(), <add> new BoxBufferGeometry( parameters.width, parameters.height, parameters.depth ), <add> new BoxBufferGeometry( parameters.width, parameters.height, parameters.depth, parameters.widthSegments, parameters.heightSegments, parameters.depthSegments ) <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/CircleGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> CircleGeometry, <add> CircleBufferGeometry <add>} from '../../../../src/geometries/CircleGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'CircleGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> segments: 20, <add> thetaStart: 0.1, <add> thetaLength: 0.2 <add> }; <add> <add> geometries = [ <add> new CircleGeometry(), <add> new CircleGeometry( parameters.radius ), <add> new CircleGeometry( parameters.radius, parameters.segments ), <add> new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart ), <add> new CircleGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'CircleBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> segments: 20, <add> thetaStart: 0.1, <add> thetaLength: 0.2 <add> }; <add> <add> geometries = [ <add> new CircleBufferGeometry(), <add> new CircleBufferGeometry( parameters.radius ), <add> new CircleBufferGeometry( parameters.radius, parameters.segments ), <add> new CircleBufferGeometry( parameters.radius, parameters.segments, parameters.thetaStart ), <add> new CircleBufferGeometry( parameters.radius, parameters.segments, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/ConeGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> ConeGeometry, <add> ConeBufferGeometry <add>} from '../../../../src/geometries/ConeGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'ConeGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new ConeGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'ConeBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new ConeBufferGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/CylinderGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> CylinderGeometry, <add> CylinderBufferGeometry <add>} from '../../../../src/geometries/CylinderGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'CylinderGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radiusTop: 10, <add> radiusBottom: 20, <add> height: 30, <add> radialSegments: 20, <add> heightSegments: 30, <add> openEnded: true, <add> thetaStart: 0.1, <add> thetaLength: 2.0, <add> }; <add> <add> geometries = [ <add> new CylinderGeometry(), <add> new CylinderGeometry( parameters.radiusTop ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ), <add> new CylinderGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'CylinderBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radiusTop: 10, <add> radiusBottom: 20, <add> height: 30, <add> radialSegments: 20, <add> heightSegments: 30, <add> openEnded: true, <add> thetaStart: 0.1, <add> thetaLength: 2.0, <add> }; <add> <add> geometries = [ <add> new CylinderBufferGeometry(), <add> new CylinderBufferGeometry( parameters.radiusTop ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart ), <add> new CylinderBufferGeometry( parameters.radiusTop, parameters.radiusBottom, parameters.height, parameters.radialSegments, parameters.heightSegments, parameters.openEnded, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/DodecahedronGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> DodecahedronGeometry, <add> DodecahedronBufferGeometry <add>} from '../../../../src/geometries/DodecahedronGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'CircleGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new DodecahedronGeometry(), <add> new DodecahedronGeometry( parameters.radius ), <add> new DodecahedronGeometry( parameters.radius, parameters.detail ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'CircleBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new DodecahedronBufferGeometry(), <add> new DodecahedronBufferGeometry( parameters.radius ), <add> new DodecahedronBufferGeometry( parameters.radius, parameters.detail ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/EdgesGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { EdgesGeometry } from '../../../../src/geometries/EdgesGeometry'; <add>import { Geometry } from '../../../../src/core/Geometry'; <add>import { BufferGeometry } from '../../../../src/core/BufferGeometry'; <add>import { BufferAttribute } from '../../../../src/core/BufferAttribute'; <add>import { Vector3 } from '../../../../src/math/Vector3'; <add> <add>// DEBUGGING <add>import { Scene } from '../../../../src/scenes/Scene'; <add>import { Mesh } from '../../../../src/objects/Mesh'; <add>import { LineSegments } from '../../../../src/objects/LineSegments'; <add>import { LineBasicMaterial } from '../../../../src/materials/LineBasicMaterial'; <add>import { WebGLRenderer } from '../../../../src/renderers/WebGLRenderer'; <add>import { PerspectiveCamera } from '../../../../src/cameras/PerspectiveCamera'; <add> <add>// <add>// HELPERS <add>// <add> <add>function testEdges( vertList, idxList, numAfter, assert ) { <add> <add> var geoms = createGeometries( vertList, idxList ); <add> <add> for ( var i = 0; i < geoms.length; i ++ ) { <add> <add> var geom = geoms[ i ]; <add> <add> var numBefore = idxList.length; <add> assert.equal( countEdges( geom ), numBefore, "Edges before!" ); <add> <add> var egeom = new EdgesGeometry( geom ); <add> <add> assert.equal( countEdges( egeom ), numAfter, "Edges after!" ); <add> output( geom, egeom ); <add> <add> } <add> <add>} <add> <add>function createGeometries( vertList, idxList ) { <add> <add> var geomIB = createIndexedBufferGeometry( vertList, idxList ); <add> var geom = new Geometry().fromBufferGeometry( geomIB ); <add> var geomB = new BufferGeometry().fromGeometry( geom ); <add> var geomDC = addDrawCalls( geomIB.clone() ); <add> return [ geom, geomB, geomIB, geomDC ]; <add> <add>} <add> <add>function createIndexedBufferGeometry( vertList, idxList ) { <add> <add> var geom = new BufferGeometry(); <add> <add> var indexTable = []; <add> var numTris = idxList.length / 3; <add> var numVerts = 0; <add> <add> var indices = new Uint32Array( numTris * 3 ); <add> var vertices = new Float32Array( vertList.length * 3 ); <add> <add> for ( var i = 0; i < numTris; i ++ ) { <add> <add> for ( var j = 0; j < 3; j ++ ) { <add> <add> var idx = idxList[ 3 * i + j ]; <add> if ( indexTable[ idx ] === undefined ) { <add> <add> var v = vertList[ idx ]; <add> vertices[ 3 * numVerts ] = v.x; <add> vertices[ 3 * numVerts + 1 ] = v.y; <add> vertices[ 3 * numVerts + 2 ] = v.z; <add> <add> indexTable[ idx ] = numVerts; <add> <add> numVerts ++; <add> <add> } <add> <add> indices[ 3 * i + j ] = indexTable[ idx ]; <add> <add> } <add> <add> } <add> <add> vertices = vertices.subarray( 0, 3 * numVerts ); <add> <add> geom.setIndex( new BufferAttribute( indices, 1 ) ); <add> geom.addAttribute( 'position', new BufferAttribute( vertices, 3 ) ); <add> <add> geom.computeFaceNormals(); <add> <add> return geom; <add> <add>} <add> <add>function addDrawCalls( geometry ) { <add> <add> var numTris = geometry.index.count / 3; <add> <add> for ( var i = 0; i < numTris; i ++ ) { <add> <add> var start = i * 3; <add> var count = 3; <add> <add> geometry.addGroup( start, count ); <add> <add> } <add> <add> return geometry; <add> <add>} <add> <add>function countEdges( geom ) { <add> <add> if ( geom instanceof EdgesGeometry ) { <add> <add> return geom.getAttribute( 'position' ).count / 2; <add> <add> } <add> <add> if ( geom.faces !== undefined ) { <add> <add> return geom.faces.length * 3; <add> <add> } <add> <add> var indices = geom.index; <add> if ( indices ) { <add> <add> return indices.count; <add> <add> } <add> <add> return geom.getAttribute( 'position' ).count; <add> <add>} <add> <add>// <add>// DEBUGGING <add>// <add>var DEBUG = false; <add>var renderer; <add>var camera; <add>var scene = new Scene(); <add>var xoffset = 0; <add> <add>function output( geom, egeom ) { <add> <add> if ( DEBUG !== true ) return; <add> <add> if ( ! renderer ) initDebug(); <add> <add> var mesh = new Mesh( geom, undefined ); <add> var edges = new LineSegments( egeom, new LineBasicMaterial( { color: 'black' } ) ); <add> <add> mesh.position.setX( xoffset ); <add> edges.position.setX( xoffset ++ ); <add> scene.add( mesh ); <add> scene.add( edges ); <add> <add> if ( scene.children.length % 8 === 0 ) { <add> <add> xoffset += 2; <add> <add> } <add> <add>} <add> <add>function initDebug() { <add> <add> renderer = new WebGLRenderer( { <add> <add> antialias: true <add> <add> } ); <add> <add> var width = 600; <add> var height = 480; <add> <add> renderer.setSize( width, height ); <add> renderer.setClearColor( 0xCCCCCC ); <add> <add> camera = new PerspectiveCamera( 45, width / height, 1, 100 ); <add> camera.position.x = 30; <add> camera.position.z = 40; <add> camera.lookAt( new Vector3( 30, 0, 0 ) ); <add> <add> document.body.appendChild( renderer.domElement ); <add> <add> var controls = new THREE.OrbitControls( camera, renderer.domElement ); // TODO: please do somethings for that -_-' <add> controls.target = new Vector3( 30, 0, 0 ); <add> <add> animate(); <add> <add> function animate() { <add> <add> requestAnimationFrame( animate ); <add> <add> controls.update(); <add> <add> renderer.render( scene, camera ); <add> <add> } <add> <add>} <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'EdgesGeometry', () => { <add> <add> var vertList = [ <add> new Vector3( 0, 0, 0 ), <add> new Vector3( 1, 0, 0 ), <add> new Vector3( 1, 1, 0 ), <add> new Vector3( 0, 1, 0 ), <add> new Vector3( 1, 1, 1 ), <add> ]; <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( "singularity", ( assert ) => { <add> <add> testEdges( vertList, [ 1, 1, 1 ], 0, assert ); <add> <add> } ); <add> <add> QUnit.test( "needle", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 0, 1 ], 0, assert ); <add> <add> } ); <add> <add> QUnit.test( "single triangle", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2 ], 3, assert ); <add> <add> } ); <add> <add> QUnit.test( "two isolated triangles", ( assert ) => { <add> <add> var vertList = [ <add> new Vector3( 0, 0, 0 ), <add> new Vector3( 1, 0, 0 ), <add> new Vector3( 1, 1, 0 ), <add> new Vector3( 0, 0, 1 ), <add> new Vector3( 1, 0, 1 ), <add> new Vector3( 1, 1, 1 ), <add> ]; <add> <add> testEdges( vertList, [ 0, 1, 2, 3, 4, 5 ], 6, assert ); <add> <add> } ); <add> <add> QUnit.test( "two flat triangles", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2, 0, 2, 3 ], 4, assert ); <add> <add> } ); <add> <add> QUnit.test( "two flat triangles, inverted", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2, 0, 3, 2 ], 5, assert ); <add> <add> } ); <add> <add> QUnit.test( "two non-coplanar triangles", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2, 0, 4, 2 ], 5, assert ); <add> <add> } ); <add> <add> QUnit.test( "three triangles, coplanar first", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2, 0, 2, 3, 0, 4, 2 ], 7, assert ); <add> <add> } ); <add> <add> QUnit.test( "three triangles, coplanar last", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2, 0, 4, 2, 0, 2, 3 ], 6, assert ); // Should be 7 <add> <add> } ); <add> <add> QUnit.test( "tetrahedron", ( assert ) => { <add> <add> testEdges( vertList, [ 0, 1, 2, 0, 1, 4, 0, 4, 2, 1, 2, 4 ], 6, assert ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/ExtrudeGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { ExtrudeGeometry, ExtrudeBufferGeometry } from '../../../../src/geometries/ExtrudeGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'ExtrudeGeometry', () => { <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'ExtrudeBufferGeometry', () => { <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // STATIC STUFF <add> QUnit.test( "WorldUVGenerator.generateTopUV", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> QUnit.test( "WorldUVGenerator.generateSideWallUV", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( "getArrays", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> QUnit.test( "addShapeList", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> QUnit.test( "addShape", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/IcosahedronGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> IcosahedronGeometry, <add> IcosahedronBufferGeometry <add>} from '../../../../src/geometries/IcosahedronGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'IcosahedronGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new IcosahedronGeometry(), <add> new IcosahedronGeometry( parameters.radius ), <add> new IcosahedronGeometry( parameters.radius, parameters.detail ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'IcosahedronBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new IcosahedronBufferGeometry(), <add> new IcosahedronBufferGeometry( parameters.radius ), <add> new IcosahedronBufferGeometry( parameters.radius, parameters.detail ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/LatheGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> LatheGeometry, <add> LatheBufferGeometry <add>} from '../../../../src/geometries/LatheGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'LatheGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> points: [], <add> segments: 0, <add> phiStart: 0, <add> phiLength: 0 <add> }; <add> <add> geometries = [ <add> // new LatheGeometry(), // Todo: error for undefined point <add> new LatheGeometry( parameters.points ) <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'LatheBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> points: [], <add> segments: 0, <add> phiStart: 0, <add> phiLength: 0 <add> }; <add> <add> geometries = [ <add> // new LatheBufferGeometry(), // Todo: error for undefined point <add> new LatheBufferGeometry( parameters.points ) <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/OctahedronGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> OctahedronGeometry, <add> OctahedronBufferGeometry <add>} from '../../../../src/geometries/OctahedronGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'OctahedronGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new OctahedronGeometry(), <add> new OctahedronGeometry( parameters.radius ), <add> new OctahedronGeometry( parameters.radius, parameters.detail ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'OctahedronBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new OctahedronBufferGeometry(), <add> new OctahedronBufferGeometry( parameters.radius ), <add> new OctahedronBufferGeometry( parameters.radius, parameters.detail ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/ParametricGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> ParametricGeometry, <add> ParametricBufferGeometry <add>} from '../../../../src/geometries/ParametricGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'ParametricGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new ParametricGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'ParametricBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new ParametricBufferGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/PlaneGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> PlaneGeometry, <add> PlaneBufferGeometry <add>} from '../../../../src/geometries/PlaneGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'PlaneGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> width: 10, <add> height: 30, <add> widthSegments: 3, <add> heightSegments: 5 <add> }; <add> <add> geometries = [ <add> new PlaneGeometry(), <add> new PlaneGeometry( parameters.width ), <add> new PlaneGeometry( parameters.width, parameters.height ), <add> new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments ), <add> new PlaneGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'PlaneBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> width: 10, <add> height: 30, <add> widthSegments: 3, <add> heightSegments: 5 <add> }; <add> <add> geometries = [ <add> new PlaneBufferGeometry(), <add> new PlaneBufferGeometry( parameters.width ), <add> new PlaneBufferGeometry( parameters.width, parameters.height ), <add> new PlaneBufferGeometry( parameters.width, parameters.height, parameters.widthSegments ), <add> new PlaneBufferGeometry( parameters.width, parameters.height, parameters.widthSegments, parameters.heightSegments ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/PolyhedronGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> PolyhedronGeometry, <add> PolyhedronBufferGeometry <add>} from '../../../../src/geometries/PolyhedronGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'PolyhedronGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new PolyhedronGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'PolyhedronBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new PolyhedronBufferGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/RingGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> RingGeometry, <add> RingBufferGeometry <add>} from '../../../../src/geometries/RingGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'RingGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> innerRadius: 10, <add> outerRadius: 60, <add> thetaSegments: 12, <add> phiSegments: 14, <add> thetaStart: 0.1, <add> thetaLength: 2.0 <add> }; <add> <add> geometries = [ <add> new RingGeometry(), <add> new RingGeometry( parameters.innerRadius ), <add> new RingGeometry( parameters.innerRadius, parameters.outerRadius ), <add> new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments ), <add> new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ), <add> new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ), <add> new RingGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'RingBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> innerRadius: 10, <add> outerRadius: 60, <add> thetaSegments: 12, <add> phiSegments: 14, <add> thetaStart: 0.1, <add> thetaLength: 2.0 <add> }; <add> <add> geometries = [ <add> new RingBufferGeometry(), <add> new RingBufferGeometry( parameters.innerRadius ), <add> new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius ), <add> new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments ), <add> new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments ), <add> new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart ), <add> new RingBufferGeometry( parameters.innerRadius, parameters.outerRadius, parameters.thetaSegments, parameters.phiSegments, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/ShapeGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> ShapeGeometry, <add> ShapeBufferGeometry <add>} from '../../../../src/geometries/ShapeGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'ShapeGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new ShapeGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'ShapeBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new ShapeBufferGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/SphereGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> SphereGeometry, <add> SphereBufferGeometry <add>} from '../../../../src/geometries/SphereGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'SphereGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> widthSegments: 20, <add> heightSegments: 30, <add> phiStart: 0.5, <add> phiLength: 1.0, <add> thetaStart: 0.4, <add> thetaLength: 2.0, <add> }; <add> <add> geometries = [ <add> new SphereGeometry(), <add> new SphereGeometry( parameters.radius ), <add> new SphereGeometry( parameters.radius, parameters.widthSegments ), <add> new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), <add> new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), <add> new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), <add> new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), <add> new SphereGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'SphereBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> widthSegments: 20, <add> heightSegments: 30, <add> phiStart: 0.5, <add> phiLength: 1.0, <add> thetaStart: 0.4, <add> thetaLength: 2.0, <add> }; <add> <add> geometries = [ <add> new SphereBufferGeometry(), <add> new SphereBufferGeometry( parameters.radius ), <add> new SphereBufferGeometry( parameters.radius, parameters.widthSegments ), <add> new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), <add> new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), <add> new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), <add> new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), <add> new SphereBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/TetrahedronGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> TetrahedronGeometry, <add> TetrahedronBufferGeometry <add>} from '../../../../src/geometries/TetrahedronGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'TetrahedronGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new TetrahedronGeometry(), <add> new TetrahedronGeometry( parameters.radius ), <add> new TetrahedronGeometry( parameters.radius, parameters.widthSegments ), <add> new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), <add> new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), <add> new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), <add> new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), <add> new TetrahedronGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'SphereBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> detail: undefined <add> }; <add> <add> geometries = [ <add> new TetrahedronBufferGeometry(), <add> new TetrahedronBufferGeometry( parameters.radius ), <add> new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments ), <add> new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments ), <add> new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart ), <add> new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength ), <add> new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart ), <add> new TetrahedronBufferGeometry( parameters.radius, parameters.widthSegments, parameters.heightSegments, parameters.phiStart, parameters.phiLength, parameters.thetaStart, parameters.thetaLength ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/TextGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> TextGeometry, <add> TextBufferGeometry <add>} from '../../../../src/geometries/TextGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'TextGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> // TODO: we cannot load any font from Threejs package :S <add> const parameters = { <add> font: undefined <add> }; <add> <add> geometries = [ <add> new TextGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'TextBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new TextBufferGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/TorusGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> TorusGeometry, <add> TorusBufferGeometry <add>} from '../../../../src/geometries/TorusGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'TorusGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> tube: 20, <add> radialSegments: 30, <add> tubularSegments: 10, <add> arc: 2.0, <add> }; <add> <add> geometries = [ <add> new TorusGeometry(), <add> new TorusGeometry( parameters.radius ), <add> new TorusGeometry( parameters.radius, parameters.tube ), <add> new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments ), <add> new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ), <add> new TorusGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'TorusBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> tube: 20, <add> radialSegments: 30, <add> tubularSegments: 10, <add> arc: 2.0, <add> }; <add> <add> geometries = [ <add> new TorusBufferGeometry(), <add> new TorusBufferGeometry( parameters.radius ), <add> new TorusBufferGeometry( parameters.radius, parameters.tube ), <add> new TorusBufferGeometry( parameters.radius, parameters.tube, parameters.radialSegments ), <add> new TorusBufferGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments ), <add> new TorusBufferGeometry( parameters.radius, parameters.tube, parameters.radialSegments, parameters.tubularSegments, parameters.arc ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/TorusKnotGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> * @author Anonymous <add> */ <add>/* global QUnit */ <add> <add>import { <add> TorusKnotGeometry, <add> TorusKnotBufferGeometry <add>} from '../../../../src/geometries/TorusKnotGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'SphereGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> tube: 20, <add> tubularSegments: 30, <add> radialSegments: 10, <add> p: 3, <add> q: 2 <add> }; <add> <add> geometries = [ <add> new TorusKnotGeometry(), <add> new TorusKnotGeometry( parameters.radius ), <add> new TorusKnotGeometry( parameters.radius, parameters.tube ), <add> new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ), <add> new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ), <add> new TorusKnotGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'TorusKnotBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = { <add> radius: 10, <add> tube: 20, <add> tubularSegments: 30, <add> radialSegments: 10, <add> p: 3, <add> q: 2 <add> }; <add> <add> geometries = [ <add> new TorusKnotBufferGeometry(), <add> new TorusKnotBufferGeometry( parameters.radius ), <add> new TorusKnotBufferGeometry( parameters.radius, parameters.tube ), <add> new TorusKnotBufferGeometry( parameters.radius, parameters.tube, parameters.tubularSegments ), <add> new TorusKnotBufferGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments ), <add> new TorusKnotBufferGeometry( parameters.radius, parameters.tube, parameters.tubularSegments, parameters.radialSegments, parameters.p, parameters.q ), <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/TubeGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { <add> TubeGeometry, <add> TubeBufferGeometry <add>} from '../../../../src/geometries/TubeGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'TubeGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new TubeGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add> QUnit.module.todo( 'TubeBufferGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new TubeBufferGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} ); <ide><path>test/unit/src/geometries/WireframeGeometry.tests.js <add>/** <add> * @author TristanVALCKE / https://github.com/Itee <add> */ <add>/* global QUnit */ <add> <add>import { WireframeGeometry } from '../../../../src/geometries/WireframeGeometry'; <add> <add>export default QUnit.module( 'Geometries', () => { <add> <add> QUnit.module.todo( 'WireframeGeometry', ( hooks ) => { <add> <add> var geometries = undefined; <add> hooks.beforeEach( function () { <add> <add> const parameters = {}; <add> <add> geometries = [ <add> new WireframeGeometry() <add> ]; <add> <add> } ); <add> <add> // INHERITANCE <add> QUnit.test( "Extending", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // INSTANCING <add> QUnit.test( "Instancing", ( assert ) => { <add> <add> assert.ok( false, "everything's gonna be alright" ); <add> <add> } ); <add> <add> // OTHERS <add> QUnit.test( 'Standard geometry tests', ( assert ) => { <add> <add> runStdGeometryTests( assert, geometries ); <add> <add> } ); <add> <add> } ); <add> <add>} );
22
Python
Python
use bind=true in example
20ac02664bf06d4814f142e7f2105d750da5c07c
<ide><path>examples/django/tasks/__init__.py <ide> celery.autodiscover_tasks(settings.INSTALLED_APPS) <ide> <ide> <del>@celery.task <del>def debug_task(): <del> print(repr(debug_task.request)) <add>@celery.task(bind=True) <add>def debug_task(self): <add> print(repr(self.request))
1
Python
Python
improve api of activityregularization
cbde35fdf5fa72cbc725eb1103c2063cdc81add2
<ide><path>keras/layers/core.py <ide> from .. import activations, initializations <ide> from ..utils.theano_utils import shared_zeros, floatX <ide> from ..utils.generic_utils import make_tuple <del>from .. import regularizers <add>from ..regularizers import ActivityRegularizer <ide> from .. import constraints <ide> <ide> from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams <ide> class ActivityRegularization(Layer): <ide> Layer that passes through its input unchanged, but applies an update <ide> to the cost function based on the activity. <ide> ''' <del> def __init__(self, activity_regularizer=None): <add> def __init__(self, l1=0., l2=0.): <ide> super(ActivityRegularization, self).__init__() <add> self.l1 = l1 <add> self.l2 = l2 <ide> <del> self.activity_regularizer = activity_regularizer <del> if activity_regularizer is not None: <del> activity_regularizer.set_layer(self) <del> self.regularizers = [activity_regularizer] <add> activity_regularizer = ActivityRegularizer(l1=l1, l2=l2) <add> activity_regularizer.set_layer(self) <add> self.regularizers = [activity_regularizer] <ide> <ide> def get_output(self, train): <ide> return self.get_input(train) <ide> <ide> def get_config(self): <ide> return {"name":self.__class__.__name__, <del> "activity_regularizer":self.activity_regularizer.__name__} <add> "l1":self.l1, <add> "l2":self.l2} <ide> <ide> <ide> class TimeDistributedDense(Layer):
1
Ruby
Ruby
add method for bottle checksums
5de0b4964a730591a9f948906d0499bcee214c27
<ide><path>Library/Homebrew/software_spec.rb <ide> def #{cksum}(val=nil) <ide> end <ide> EOS <ide> end <add> <add> def checksums <add> checksums = {} <add> Checksum::TYPES.each do |checksum_type| <add> checksum_os_versions = send checksum_type <add> next unless checksum_os_versions <add> os_versions = checksum_os_versions.keys <add> os_versions.map! {|osx| MacOS::Version.from_symbol osx } <add> os_versions.sort.reverse.each do |os_version| <add> osx = os_version.to_sym <add> checksum = checksum_os_versions[osx] <add> checksums[checksum_type] = { checksum => osx } <add> end <add> end <add> checksums <add> end <ide> end
1
Javascript
Javascript
upgrade importplugin to es6
def1d086a4496c910626af2195216615835fdbd2
<ide><path>lib/dependencies/ImportPlugin.js <ide> MIT License http://www.opensource.org/licenses/mit-license.php <ide> Author Tobias Koppers @sokra <ide> */ <del>var ImportDependency = require("./ImportDependency"); <del>var ImportContextDependency = require("./ImportContextDependency"); <del>var ImportParserPlugin = require("./ImportParserPlugin"); <add>"use strict"; <ide> <del>function ImportPlugin(options) { <del> this.options = options; <del>} <del>module.exports = ImportPlugin; <add>const ImportDependency = require("./ImportDependency"); <add>const ImportContextDependency = require("./ImportContextDependency"); <add>const ImportParserPlugin = require("./ImportParserPlugin"); <add> <add>class ImportPlugin { <add> constructor(options) { <add> this.options = options; <add> } <ide> <del>ImportPlugin.prototype.apply = function(compiler) { <del> var options = this.options; <del> compiler.plugin("compilation", function(compilation, params) { <del> var normalModuleFactory = params.normalModuleFactory; <del> var contextModuleFactory = params.contextModuleFactory; <add> apply(compiler) { <add> const options = this.options; <add> compiler.plugin("compilation", (compilation, params) => { <add> const normalModuleFactory = params.normalModuleFactory; <add> const contextModuleFactory = params.contextModuleFactory; <ide> <del> compilation.dependencyFactories.set(ImportDependency, normalModuleFactory); <del> compilation.dependencyTemplates.set(ImportDependency, new ImportDependency.Template()); <add> compilation.dependencyFactories.set(ImportDependency, normalModuleFactory); <add> compilation.dependencyTemplates.set(ImportDependency, new ImportDependency.Template()); <ide> <del> compilation.dependencyFactories.set(ImportContextDependency, contextModuleFactory); <del> compilation.dependencyTemplates.set(ImportContextDependency, new ImportContextDependency.Template()); <add> compilation.dependencyFactories.set(ImportContextDependency, contextModuleFactory); <add> compilation.dependencyTemplates.set(ImportContextDependency, new ImportContextDependency.Template()); <ide> <del> params.normalModuleFactory.plugin("parser", function(parser, parserOptions) { <add> params.normalModuleFactory.plugin("parser", (parser, parserOptions) => { <ide> <del> if(typeof parserOptions.import !== "undefined" && !parserOptions.import) <del> return; <add> if(typeof parserOptions.import !== "undefined" && !parserOptions.import) <add> return; <ide> <del> parser.apply( <del> new ImportParserPlugin(options) <del> ); <add> parser.apply( <add> new ImportParserPlugin(options) <add> ); <add> }); <ide> }); <del> }); <del>}; <add> } <add>} <add>module.exports = ImportPlugin;
1
Ruby
Ruby
add apipublicexception middleware
3adb5eac3b6d81a0943bebd8dffa25a3b63681eb
<ide><path>actionpack/lib/action_dispatch.rb <ide> class IllegalStateError < StandardError <ide> autoload :ExceptionWrapper <ide> autoload :Flash <ide> autoload :ParamsParser <add> autoload :ApiPublicExceptions <ide> autoload :PublicExceptions <ide> autoload :Reloader <ide> autoload :RemoteIp <ide><path>actionpack/lib/action_dispatch/middleware/api_public_exceptions.rb <add>module ActionDispatch <add> class ApiPublicExceptions <add> attr_accessor :public_path <add> <add> def initialize(public_path) <add> @public_path = public_path <add> end <add> <add> def call(env) <add> exception = env["action_dispatch.exception"] <add> status = env["PATH_INFO"][1..-1] <add> request = ActionDispatch::Request.new(env) <add> content_type = request.formats.first <add> body = { :status => status, :error => exception.message } <add> <add> render(status, content_type, body) <add> end <add> <add> private <add> <add> def render(status, content_type, body) <add> format = content_type && "to_#{content_type.to_sym}" <add> if format && body.respond_to?(format) <add> render_format(status, content_type, body.public_send(format)) <add> else <add> render_html(status) <add> end <add> end <add> <add> def render_format(status, content_type, body) <add> [status, {'Content-Type' => "#{content_type}; charset=#{ActionDispatch::Response.default_charset}", <add> 'Content-Length' => body.bytesize.to_s}, [body]] <add> end <add> <add> def render_html(status) <add> found = false <add> path = "#{public_path}/#{status}.#{I18n.locale}.html" if I18n.locale <add> path = "#{public_path}/#{status}.html" unless path && (found = File.exist?(path)) <add> <add> if found || File.exist?(path) <add> render_format(status, 'text/html', File.read(path)) <add> else <add> [404, { "X-Cascade" => "pass" }, []] <add> end <add> end <add> end <add>end <ide><path>actionpack/test/dispatch/show_exceptions_test.rb <ide> def call(env) <ide> when "/bad_params" <ide> raise ActionDispatch::ParamsParser::ParseError.new("", StandardError.new) <ide> when "/method_not_allowed" <del> raise ActionController::MethodNotAllowed <add> raise ActionController::MethodNotAllowed, 'PUT' <ide> when "/unknown_http_method" <ide> raise ActionController::UnknownHttpMethod <ide> when "/not_found_original_exception" <ide> def call(env) <ide> end <ide> end <ide> <del> ProductionApp = ActionDispatch::ShowExceptions.new(Boomer.new, ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")) <add> ProductionApp = ActionDispatch::ShowExceptions.new(Boomer.new, ActionDispatch::PublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")) <add> ProductionApiApp = ActionDispatch::ShowExceptions.new(Boomer.new, ActionDispatch::ApiPublicExceptions.new("#{FIXTURE_LOAD_PATH}/public")) <ide> <ide> test "skip exceptions app if not showing exceptions" do <ide> @app = ProductionApp <ide> def call(env) <ide> assert_equal "", body <ide> end <ide> <add> test "rescue api apps with json response" do <add> @app = ProductionApiApp <add> <add> get "/", headers: { 'HTTP_ACCEPT' => 'application/json', 'action_dispatch.show_exceptions' => true } <add> assert_response 500 <add> assert_equal({ :status => '500', :error => 'puke!' }.to_json, body) <add> <add> get "/method_not_allowed", headers: { 'HTTP_ACCEPT' => 'application/json', 'action_dispatch.show_exceptions' => true } <add> assert_response 405 <add> assert_equal({ :status => '405', :error => 'Only PUT requests are allowed.' }.to_json, body) <add> <add> get "/unknown_http_method", headers: { 'HTTP_ACCEPT' => 'application/json', 'action_dispatch.show_exceptions' => true } <add> assert_response 405 <add> assert_equal({ :status => '405', :error => 'ActionController::UnknownHttpMethod' }.to_json, body) <add> end <add> <add> test "rescue api apps unknown content-type requests with html response" do <add> @app = ProductionApiApp <add> <add> get "/", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } <add> assert_response 500 <add> assert_equal "500 error fixture\n", body <add> <add> get "/bad_params", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } <add> assert_response 400 <add> assert_equal "400 error fixture\n", body <add> <add> get "/not_found", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } <add> assert_response 404 <add> assert_equal "404 error fixture\n", body <add> <add> get "/unknown_http_method", headers: { 'HTTP_ACCEPT' => 'application/x-custom', 'action_dispatch.show_exceptions' => true } <add> assert_response 405 <add> assert_equal("", body) <add> end <add> <ide> test "localize rescue error page" do <ide> old_locale, I18n.locale = I18n.locale, :da <ide>
3
Python
Python
add `long_description` field in setup.py
5959d34aca8d6605b3e4b3f9c905b030cae600e3
<ide><path>setup.py <ide> from setuptools import setup <ide> from setuptools import find_packages <ide> <add>long_description = ''' <add>Keras is a high-level neural networks API, <add>written in Python and capable of running on top of <add>TensorFlow, CNTK, or Theano. <add> <add>Use Keras if you need a deep learning library that: <add> <add>- Allows for easy and fast prototyping <add> (through user friendliness, modularity, and extensibility). <add>- Supports both convolutional networks and recurrent networks, <add> as well as combinations of the two. <add>- Runs seamlessly on CPU and GPU. <add> <add>Read the documentation at: https://keras.io/ <add> <add>For a detailed overview of what makes Keras special, see: <add>https://keras.io/why-use-keras/ <add> <add>Keras is compatible with Python 2.7-3.6 <add>and is distributed under the MIT liense. <add>''' <ide> <ide> setup(name='Keras', <ide> version='2.1.6', <ide> description='Deep Learning for humans', <add> long_description=long_description, <ide> author='Francois Chollet', <ide> author_email='[email protected]', <ide> url='https://github.com/keras-team/keras',
1
Javascript
Javascript
remove relative path to babel-runtime
8eb80342362c545e511c3b0c5416f4542610ca46
<ide><path>server/build/babel/preset.js <add>const babelRuntimePath = require.resolve('babel-runtime/package').replace(/[\\/]package\.json$/, '') <ide> const relativeResolve = require('../root-module-relative-path').default(require) <ide> <ide> // Resolve styled-jsx plugins <ide> module.exports = (context, opts = {}) => ({ <ide> require.resolve('babel-plugin-module-resolver'), <ide> { <ide> alias: { <del> 'babel-runtime': relativeResolve('babel-runtime/package'), <add> 'babel-runtime': babelRuntimePath, <ide> 'next/link': relativeResolve('../../../lib/link'), <ide> 'next/prefetch': relativeResolve('../../../lib/prefetch'), <ide> 'next/css': relativeResolve('../../../lib/css'), <ide><path>server/build/webpack.js <ide> export default async function createCompiler (dir, { buildId, dev = false, quiet <ide> return { content, sourceMap } <ide> } <ide> <add> const babelRuntimePath = require.resolve('babel-runtime/package').replace(/[\\/]package\.json$/, '') <add> <ide> const transpiled = babelCore.transform(content, { <ide> babelrc: false, <ide> sourceMaps: dev ? 'both' : false, <ide> export default async function createCompiler (dir, { buildId, dev = false, quiet <ide> require.resolve('babel-plugin-module-resolver'), <ide> { <ide> alias: { <del> 'babel-runtime': relativeResolve('babel-runtime/package'), <add> 'babel-runtime': babelRuntimePath, <ide> 'next/link': relativeResolve('../../lib/link'), <ide> 'next/prefetch': relativeResolve('../../lib/prefetch'), <ide> 'next/css': relativeResolve('../../lib/css'),
2
Go
Go
add c.assert in docker_cli_ps_test.go
83b03b00578a27f24dc80bb110d36b1f6eed7684
<ide><path>integration-cli/docker_cli_ps_test.go <ide> import ( <ide> "os" <ide> "os/exec" <ide> "path/filepath" <del> "reflect" <ide> "strconv" <ide> "strings" <ide> "time" <ide> <add> "github.com/docker/docker/pkg/integration/checker" <ide> "github.com/go-check/check" <ide> "sort" <ide> <ide> func (s *DockerSuite) TestPsListContainersBase(c *check.C) { <ide> fourthID := strings.TrimSpace(out) <ide> <ide> // make sure the second is running <del> c.Assert(waitRun(secondID), check.IsNil) <add> c.Assert(waitRun(secondID), checker.IsNil) <ide> <ide> // make sure third one is not running <ide> dockerCmd(c, "wait", thirdID) <ide> <ide> // make sure the forth is running <del> c.Assert(waitRun(fourthID), check.IsNil) <add> c.Assert(waitRun(fourthID), checker.IsNil) <ide> <ide> // all <ide> out, _ = dockerCmd(c, "ps", "-a") <del> if !assertContainerList(out, []string{fourthID, thirdID, secondID, firstID}) { <del> c.Errorf("ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, []string{fourthID, thirdID, secondID, firstID}), checker.Equals, true, check.Commentf("ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> // running <ide> out, _ = dockerCmd(c, "ps") <del> if !assertContainerList(out, []string{fourthID, secondID, firstID}) { <del> c.Errorf("RUNNING: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, []string{fourthID, secondID, firstID}), checker.Equals, true, check.Commentf("RUNNING: Container list is not in the correct order: \n%s", out)) <ide> <ide> // from here all flag '-a' is ignored <ide> <ide> // limit <ide> out, _ = dockerCmd(c, "ps", "-n=2", "-a") <ide> expected := []string{fourthID, thirdID} <del> if !assertContainerList(out, expected) { <del> c.Errorf("LIMIT & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("LIMIT & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "-n=2") <del> if !assertContainerList(out, expected) { <del> c.Errorf("LIMIT: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("LIMIT: Container list is not in the correct order: \n%s", out)) <ide> <ide> // since <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "-a") <ide> expected = []string{fourthID, thirdID, secondID} <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--since", firstID) <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE: Container list is not in the correct order: \n%s", out)) <ide> <ide> // before <ide> out, _ = dockerCmd(c, "ps", "--before", thirdID, "-a") <ide> expected = []string{secondID, firstID} <del> if !assertContainerList(out, expected) { <del> c.Errorf("BEFORE & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("BEFORE & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--before", thirdID) <del> if !assertContainerList(out, expected) { <del> c.Errorf("BEFORE: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("BEFORE: Container list is not in the correct order: \n%s", out)) <ide> <ide> // since & before <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "--before", fourthID, "-a") <ide> expected = []string{thirdID, secondID} <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE, BEFORE & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE, BEFORE & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "--before", fourthID) <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE, BEFORE: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE, BEFORE: Container list is not in the correct order: \n%s", out)) <ide> <ide> // since & limit <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "-n=2", "-a") <ide> expected = []string{fourthID, thirdID} <ide> <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE, LIMIT & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "-n=2") <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE, LIMIT: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE, LIMIT: Container list is not in the correct order: \n%s", out)) <ide> <ide> // before & limit <ide> out, _ = dockerCmd(c, "ps", "--before", fourthID, "-n=1", "-a") <ide> expected = []string{thirdID} <del> if !assertContainerList(out, expected) { <del> c.Errorf("BEFORE, LIMIT & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("BEFORE, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--before", fourthID, "-n=1") <del> if !assertContainerList(out, expected) { <del> c.Errorf("BEFORE, LIMIT: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("BEFORE, LIMIT: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "--before", fourthID, "-n=1", "-a") <ide> expected = []string{thirdID} <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE, BEFORE, LIMIT & ALL: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE, BEFORE, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "--since", firstID, "--before", fourthID, "-n=1") <del> if !assertContainerList(out, expected) { <del> c.Errorf("SINCE, BEFORE, LIMIT: Container list is not in the correct order: \n%s", out) <del> } <add> c.Assert(assertContainerList(out, expected), checker.Equals, true, check.Commentf("SINCE, BEFORE, LIMIT: Container list is not in the correct order: \n%s", out)) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersSize(c *check.C) { <ide> baseSizeIndex := strings.Index(baseLines[0], "SIZE") <ide> baseFoundsize := baseLines[1][baseSizeIndex:] <ide> baseBytes, err := strconv.Atoi(strings.Split(baseFoundsize, " ")[0]) <del> if err != nil { <del> c.Fatal(err) <del> } <add> c.Assert(err, checker.IsNil) <ide> <ide> name := "test_size" <ide> out, _ := dockerCmd(c, "run", "--name", name, "busybox", "sh", "-c", "echo 1 > test") <ide> id, err := getIDByName(name) <del> if err != nil { <del> c.Fatal(err) <del> } <add> c.Assert(err, checker.IsNil) <ide> <ide> runCmd := exec.Command(dockerBinary, "ps", "-s", "-n=1") <ide> <ide> func (s *DockerSuite) TestPsListContainersSize(c *check.C) { <ide> case <-time.After(3 * time.Second): <ide> c.Fatalf("Calling \"docker ps -s\" timed out!") <ide> } <del> if err != nil { <del> c.Fatal(out, err) <del> } <add> c.Assert(err, checker.IsNil) <ide> lines := strings.Split(strings.Trim(out, "\n "), "\n") <del> if len(lines) != 2 { <del> c.Fatalf("Expected 2 lines for 'ps -s -n=1' output, got %d", len(lines)) <del> } <add> c.Assert(lines, checker.HasLen, 2, check.Commentf("Expected 2 lines for 'ps -s -n=1' output, got %d", len(lines))) <ide> sizeIndex := strings.Index(lines[0], "SIZE") <ide> idIndex := strings.Index(lines[0], "CONTAINER ID") <ide> foundID := lines[1][idIndex : idIndex+12] <del> if foundID != id[:12] { <del> c.Fatalf("Expected id %s, got %s", id[:12], foundID) <del> } <add> c.Assert(foundID, checker.Equals, id[:12], check.Commentf("Expected id %s, got %s", id[:12], foundID)) <ide> expectedSize := fmt.Sprintf("%d B", (2 + baseBytes)) <ide> foundSize := lines[1][sizeIndex:] <del> if !strings.Contains(foundSize, expectedSize) { <del> c.Fatalf("Expected size %q, got %q", expectedSize, foundSize) <del> } <add> c.Assert(foundSize, checker.Contains, expectedSize, check.Commentf("Expected size %q, got %q", expectedSize, foundSize)) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterStatus(c *check.C) { <ide> // filter containers by exited <ide> out, _ = dockerCmd(c, "ps", "-q", "--filter=status=exited") <ide> containerOut := strings.TrimSpace(out) <del> if containerOut != firstID[:12] { <del> c.Fatalf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, firstID[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out)) <ide> <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--filter=status=running") <ide> containerOut = strings.TrimSpace(out) <del> if containerOut != secondID[:12] { <del> c.Fatalf("Expected id %s, got %s for running filter, output: %q", secondID[:12], containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, secondID[:12], check.Commentf("Expected id %s, got %s for running filter, output: %q", secondID[:12], containerOut, out)) <ide> <ide> out, _, _ = dockerCmdWithTimeout(time.Second*60, "ps", "-a", "-q", "--filter=status=rubbish") <del> if !strings.Contains(out, "Unrecognised filter value for status") { <del> c.Fatalf("Expected error response due to invalid status filter output: %q", out) <del> } <add> c.Assert(out, checker.Contains, "Unrecognised filter value for status", check.Commentf("Expected error response due to invalid status filter output: %q", out)) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterID(c *check.C) { <ide> // filter containers by id <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--filter=id="+firstID) <ide> containerOut := strings.TrimSpace(out) <del> if containerOut != firstID[:12] { <del> c.Fatalf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, firstID[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out)) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterName(c *check.C) { <ide> // filter containers by name <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--filter=name=a_name_to_match") <ide> containerOut := strings.TrimSpace(out) <del> if containerOut != firstID[:12] { <del> c.Fatalf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, firstID[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out)) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterAncestorImage(c *check.C) { <ide> imageID1, err := buildImage(imageName1, <ide> `FROM busybox <ide> LABEL match me 1`, true) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> imageName1Tagged := "images_ps_filter_test1:tag" <ide> imageID1Tagged, err := buildImage(imageName1Tagged, <ide> `FROM busybox <ide> LABEL match me 1 tagged`, true) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> imageName2 := "images_ps_filter_test2" <ide> imageID2, err := buildImage(imageName2, <ide> fmt.Sprintf(`FROM %s <ide> LABEL match me 2`, imageName1), true) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> // start containers <ide> out, _ := dockerCmd(c, "run", "-d", "busybox", "echo", "hello") <ide> func checkPsAncestorFilterOutput(c *check.C, out string, filterName string, expe <ide> sort.Strings(actualIDs) <ide> sort.Strings(expectedIDs) <ide> <del> if len(actualIDs) != len(expectedIDs) { <del> c.Fatalf("Expected filtered container(s) for %s ancestor filter to be %v:%v, got %v:%v", filterName, len(expectedIDs), expectedIDs, len(actualIDs), actualIDs) <del> } <add> c.Assert(actualIDs, checker.HasLen, len(expectedIDs), check.Commentf("Expected filtered container(s) for %s ancestor filter to be %v:%v, got %v:%v", filterName, len(expectedIDs), expectedIDs, len(actualIDs), actualIDs)) <ide> if len(expectedIDs) > 0 { <ide> same := true <ide> for i := range expectedIDs { <ide> func checkPsAncestorFilterOutput(c *check.C, out string, filterName string, expe <ide> break <ide> } <ide> } <del> if !same { <del> c.Fatalf("Expected filtered container(s) for %s ancestor filter to be %v, got %v", filterName, expectedIDs, actualIDs) <del> } <add> c.Assert(same, checker.Equals, true, check.Commentf("Expected filtered container(s) for %s ancestor filter to be %v, got %v", filterName, expectedIDs, actualIDs)) <ide> } <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterLabel(c *check.C) { <ide> // filter containers by exact match <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me") <ide> containerOut := strings.TrimSpace(out) <del> if containerOut != firstID { <del> c.Fatalf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out)) <ide> <ide> // filter containers by two labels <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag") <ide> containerOut = strings.TrimSpace(out) <del> if containerOut != firstID { <del> c.Fatalf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out)) <ide> <ide> // filter containers by two labels, but expect not found because of AND behavior <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag-no") <ide> containerOut = strings.TrimSpace(out) <del> if containerOut != "" { <del> c.Fatalf("Expected nothing, got %s for exited filter, output: %q", containerOut, out) <del> } <add> c.Assert(containerOut, checker.Equals, "", check.Commentf("Expected nothing, got %s for exited filter, output: %q", containerOut, out)) <ide> <ide> // filter containers by exact key <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match") <ide> containerOut = strings.TrimSpace(out) <del> if (!strings.Contains(containerOut, firstID) || !strings.Contains(containerOut, secondID)) || strings.Contains(containerOut, thirdID) { <del> c.Fatalf("Expected ids %s,%s, got %s for exited filter, output: %q", firstID, secondID, containerOut, out) <del> } <add> c.Assert(containerOut, checker.Contains, firstID) <add> c.Assert(containerOut, checker.Contains, secondID) <add> c.Assert(containerOut, checker.Not(checker.Contains), thirdID) <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterExited(c *check.C) { <ide> func (s *DockerSuite) TestPsListContainersFilterExited(c *check.C) { <ide> <ide> dockerCmd(c, "run", "--name", "zero1", "busybox", "true") <ide> firstZero, err := getIDByName("zero1") <del> if err != nil { <del> c.Fatal(err) <del> } <add> c.Assert(err, checker.IsNil) <ide> <ide> dockerCmd(c, "run", "--name", "zero2", "busybox", "true") <ide> secondZero, err := getIDByName("zero2") <del> if err != nil { <del> c.Fatal(err) <del> } <add> c.Assert(err, checker.IsNil) <ide> <del> if out, _, err := dockerCmdWithError("run", "--name", "nonzero1", "busybox", "false"); err == nil { <del> c.Fatal("Should fail.", out, err) <del> } <add> out, _, err := dockerCmdWithError("run", "--name", "nonzero1", "busybox", "false") <add> c.Assert(err, checker.NotNil, check.Commentf("Should fail.", out, err)) <ide> <ide> firstNonZero, err := getIDByName("nonzero1") <del> if err != nil { <del> c.Fatal(err) <del> } <add> c.Assert(err, checker.IsNil) <ide> <del> if out, _, err := dockerCmdWithError("run", "--name", "nonzero2", "busybox", "false"); err == nil { <del> c.Fatal("Should fail.", out, err) <del> } <add> out, _, err = dockerCmdWithError("run", "--name", "nonzero2", "busybox", "false") <add> c.Assert(err, checker.NotNil, check.Commentf("Should fail.", out, err)) <ide> secondNonZero, err := getIDByName("nonzero2") <del> if err != nil { <del> c.Fatal(err) <del> } <add> c.Assert(err, checker.IsNil) <ide> <ide> // filter containers by exited=0 <del> out, _ := dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=0") <add> out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=0") <ide> ids := strings.Split(strings.TrimSpace(out), "\n") <del> if len(ids) != 2 { <del> c.Fatalf("Should be 2 zero exited containers got %d: %s", len(ids), out) <del> } <del> if ids[0] != secondZero { <del> c.Fatalf("First in list should be %q, got %q", secondZero, ids[0]) <del> } <del> if ids[1] != firstZero { <del> c.Fatalf("Second in list should be %q, got %q", firstZero, ids[1]) <del> } <add> c.Assert(ids, checker.HasLen, 2, check.Commentf("Should be 2 zero exited containers got %d: %s", len(ids), out)) <add> c.Assert(ids[0], checker.Equals, secondZero, check.Commentf("First in list should be %q, got %q", secondZero, ids[0])) <add> c.Assert(ids[1], checker.Equals, firstZero, check.Commentf("Second in list should be %q, got %q", firstZero, ids[1])) <ide> <ide> out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=1") <ide> ids = strings.Split(strings.TrimSpace(out), "\n") <del> if len(ids) != 2 { <del> c.Fatalf("Should be 2 zero exited containers got %d", len(ids)) <del> } <del> if ids[0] != secondNonZero { <del> c.Fatalf("First in list should be %q, got %q", secondNonZero, ids[0]) <del> } <del> if ids[1] != firstNonZero { <del> c.Fatalf("Second in list should be %q, got %q", firstNonZero, ids[1]) <del> } <add> c.Assert(ids, checker.HasLen, 2, check.Commentf("Should be 2 zero exited containers got %d", len(ids))) <add> c.Assert(ids[0], checker.Equals, secondNonZero, check.Commentf("First in list should be %q, got %q", secondNonZero, ids[0])) <add> c.Assert(ids[1], checker.Equals, firstNonZero, check.Commentf("Second in list should be %q, got %q", firstNonZero, ids[1])) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsRightTagName(c *check.C) { <ide> lines := strings.Split(strings.TrimSpace(string(out)), "\n") <ide> // skip header <ide> lines = lines[1:] <del> if len(lines) != 3 { <del> c.Fatalf("There should be 3 running container, got %d", len(lines)) <del> } <add> c.Assert(lines, checker.HasLen, 3, check.Commentf("There should be 3 running container, got %d", len(lines))) <ide> for _, line := range lines { <ide> f := strings.Fields(line) <ide> switch f[0] { <ide> case id1: <del> if f[1] != "busybox" { <del> c.Fatalf("Expected %s tag for id %s, got %s", "busybox", id1, f[1]) <del> } <add> c.Assert(f[1], checker.Equals, "busybox", check.Commentf("Expected %s tag for id %s, got %s", "busybox", id1, f[1])) <ide> case id2: <del> if f[1] != tag { <del> c.Fatalf("Expected %s tag for id %s, got %s", tag, id2, f[1]) <del> } <add> c.Assert(f[1], checker.Equals, tag, check.Commentf("Expected %s tag for id %s, got %s", tag, id2, f[1])) <ide> case id3: <del> if f[1] != imageID { <del> c.Fatalf("Expected %s imageID for id %s, got %s", tag, id3, f[1]) <del> } <add> c.Assert(f[1], checker.Equals, imageID, check.Commentf("Expected %s imageID for id %s, got %s", tag, id3, f[1])) <ide> default: <ide> c.Fatalf("Unexpected id %s, expected %s and %s and %s", f[0], id1, id2, id3) <ide> } <ide> func (s *DockerSuite) TestPsLinkedWithNoTrunc(c *check.C) { <ide> fields := strings.Fields(l) <ide> names = append(names, fields[len(fields)-1]) <ide> } <del> if !reflect.DeepEqual(expected, names) { <del> c.Fatalf("Expected array: %v, got: %v", expected, names) <del> } <add> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array: %v, got: %v", expected, names)) <ide> } <ide> <ide> func (s *DockerSuite) TestPsGroupPortRange(c *check.C) { <ide> func (s *DockerSuite) TestPsGroupPortRange(c *check.C) { <ide> <ide> out, _ := dockerCmd(c, "ps") <ide> <del> // check that the port range is in the output <del> if !strings.Contains(string(out), portRange) { <del> c.Fatalf("docker ps output should have had the port range %q: %s", portRange, string(out)) <del> } <add> c.Assert(string(out), checker.Contains, portRange, check.Commentf("docker ps output should have had the port range %q: %s", portRange, string(out))) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsWithSize(c *check.C) { <ide> dockerCmd(c, "run", "-d", "--name", "sizetest", "busybox", "top") <ide> <ide> out, _ := dockerCmd(c, "ps", "--size") <del> if !strings.Contains(out, "virtual") { <del> c.Fatalf("docker ps with --size should show virtual size of container") <del> } <add> c.Assert(out, checker.Contains, "virtual", check.Commentf("docker ps with --size should show virtual size of container")) <ide> } <ide> <ide> func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) { <ide> func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) { <ide> <ide> // Make sure it DOESN'T show up w/o a '-a' for normal 'ps' <ide> out, _ = dockerCmd(c, "ps", "-q") <del> if strings.Contains(out, shortCID) { <del> c.Fatalf("Should have not seen '%s' in ps output:\n%s", shortCID, out) <del> } <add> c.Assert(out, checker.Not(checker.Contains), shortCID, check.Commentf("Should have not seen '%s' in ps output:\n%s", shortCID, out)) <ide> <ide> // Make sure it DOES show up as 'Created' for 'ps -a' <ide> out, _ = dockerCmd(c, "ps", "-a") <ide> func (s *DockerSuite) TestPsListContainersFilterCreated(c *check.C) { <ide> continue <ide> } <ide> hits++ <del> if !strings.Contains(line, "Created") { <del> c.Fatalf("Missing 'Created' on '%s'", line) <del> } <add> c.Assert(line, checker.Contains, "Created", check.Commentf("Missing 'Created' on '%s'", line)) <ide> } <ide> <del> if hits != 1 { <del> c.Fatalf("Should have seen '%s' in ps -a output once:%d\n%s", shortCID, hits, out) <del> } <add> c.Assert(hits, checker.Equals, 1, check.Commentf("Should have seen '%s' in ps -a output once:%d\n%s", shortCID, hits, out)) <ide> <ide> // filter containers by 'create' - note, no -a needed <ide> out, _ = dockerCmd(c, "ps", "-q", "-f", "status=created") <ide> containerOut := strings.TrimSpace(out) <del> if !strings.HasPrefix(cID, containerOut) { <del> c.Fatalf("Expected id %s, got %s for filter, out: %s", cID, containerOut, out) <del> } <add> c.Assert(cID, checker.HasPrefix, containerOut) <ide> } <ide> <ide> func (s *DockerSuite) TestPsFormatMultiNames(c *check.C) { <ide> func (s *DockerSuite) TestPsFormatMultiNames(c *check.C) { <ide> for _, l := range lines { <ide> names = append(names, l) <ide> } <del> if !reflect.DeepEqual(expected, names) { <del> c.Fatalf("Expected array with non-truncated names: %v, got: %v", expected, names) <del> } <add> c.Assert(expected, checker.DeepEquals, names, check.Commentf("Expected array with non-truncated names: %v, got: %v", expected, names)) <ide> <ide> //now list without turning off truncation and make sure we only get the non-link names <ide> out, _ = dockerCmd(c, "ps", "--format", "{{.Names}}") <ide> func (s *DockerSuite) TestPsFormatMultiNames(c *check.C) { <ide> for _, l := range lines { <ide> truncNames = append(truncNames, l) <ide> } <del> if !reflect.DeepEqual(expected, truncNames) { <del> c.Fatalf("Expected array with truncated names: %v, got: %v", expected, truncNames) <del> } <add> c.Assert(expected, checker.DeepEquals, truncNames, check.Commentf("Expected array with truncated names: %v, got: %v", expected, truncNames)) <ide> <ide> } <ide> <ide> func (s *DockerSuite) TestPsFormatHeaders(c *check.C) { <ide> testRequires(c, DaemonIsLinux) <ide> // make sure no-container "docker ps" still prints the header row <ide> out, _ := dockerCmd(c, "ps", "--format", "table {{.ID}}") <del> if out != "CONTAINER ID\n" { <del> c.Fatalf(`Expected 'CONTAINER ID\n', got %v`, out) <del> } <add> c.Assert(out, checker.Equals, "CONTAINER ID\n", check.Commentf(`Expected 'CONTAINER ID\n', got %v`, out)) <ide> <ide> // verify that "docker ps" with a container still prints the header row also <ide> dockerCmd(c, "run", "--name=test", "-d", "busybox", "top") <ide> out, _ = dockerCmd(c, "ps", "--format", "table {{.Names}}") <del> if out != "NAMES\ntest\n" { <del> c.Fatalf(`Expected 'NAMES\ntest\n', got %v`, out) <del> } <add> c.Assert(out, checker.Equals, "NAMES\ntest\n", check.Commentf(`Expected 'NAMES\ntest\n', got %v`, out)) <ide> } <ide> <ide> func (s *DockerSuite) TestPsDefaultFormatAndQuiet(c *check.C) { <ide> func (s *DockerSuite) TestPsDefaultFormatAndQuiet(c *check.C) { <ide> "psFormat": "{{ .ID }} default" <ide> }` <ide> d, err := ioutil.TempDir("", "integration-cli-") <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> defer os.RemoveAll(d) <ide> <ide> err = ioutil.WriteFile(filepath.Join(d, "config.json"), []byte(config), 0644) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> out, _ := dockerCmd(c, "run", "--name=test", "-d", "busybox", "top") <ide> id := strings.TrimSpace(out) <ide> <ide> out, _ = dockerCmd(c, "--config", d, "ps", "-q") <del> if !strings.HasPrefix(id, strings.TrimSpace(out)) { <del> c.Fatalf("Expected to print only the container id, got %v\n", out) <del> } <add> c.Assert(id, checker.HasPrefix, strings.TrimSpace(out), check.Commentf("Expected to print only the container id, got %v\n", out)) <ide> } <ide> <ide> // Test for GitHub issue #12595 <ide> func (s *DockerSuite) TestPsImageIDAfterUpdate(c *check.C) { <ide> <ide> runCmd := exec.Command(dockerBinary, "tag", "busybox:latest", originalImageName) <ide> out, _, err := runCommandWithOutput(runCmd) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> originalImageID, err := getIDByName(originalImageName) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> runCmd = exec.Command(dockerBinary, "run", "-d", originalImageName, "top") <ide> out, _, err = runCommandWithOutput(runCmd) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> containerID := strings.TrimSpace(out) <ide> <ide> linesOut, err := exec.Command(dockerBinary, "ps", "--no-trunc").CombinedOutput() <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> lines := strings.Split(strings.TrimSpace(string(linesOut)), "\n") <ide> // skip header <ide> lines = lines[1:] <del> c.Assert(len(lines), check.Equals, 1) <add> c.Assert(len(lines), checker.Equals, 1) <ide> <ide> for _, line := range lines { <ide> f := strings.Fields(line) <del> c.Assert(f[1], check.Equals, originalImageName) <add> c.Assert(f[1], checker.Equals, originalImageName) <ide> } <ide> <ide> runCmd = exec.Command(dockerBinary, "commit", containerID, updatedImageName) <ide> out, _, err = runCommandWithOutput(runCmd) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> runCmd = exec.Command(dockerBinary, "tag", "-f", updatedImageName, originalImageName) <ide> out, _, err = runCommandWithOutput(runCmd) <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> linesOut, err = exec.Command(dockerBinary, "ps", "--no-trunc").CombinedOutput() <del> c.Assert(err, check.IsNil) <add> c.Assert(err, checker.IsNil) <ide> <ide> lines = strings.Split(strings.TrimSpace(string(linesOut)), "\n") <ide> // skip header <ide> lines = lines[1:] <del> c.Assert(len(lines), check.Equals, 1) <add> c.Assert(len(lines), checker.Equals, 1) <ide> <ide> for _, line := range lines { <ide> f := strings.Fields(line) <del> c.Assert(f[1], check.Equals, originalImageID) <add> c.Assert(f[1], checker.Equals, originalImageID) <ide> } <ide> <ide> }
1
Ruby
Ruby
add test for bug fixed in 4f2bf64
b8c85de62004868a34a27e58731f2a9e37aeebd0
<ide><path>actionpack/test/dispatch/request_test.rb <ide> def url_for(options = {}) <ide> assert_equal '9.9.9.9', request.remote_ip <ide> end <ide> <add> test "remote ip when the remote ip middleware returns nil" do <add> request = stub_request 'REMOTE_ADDR' => '127.0.0.1' <add> assert_equal '127.0.0.1', request.remote_ip <add> end <add> <ide> test "remote ip with user specified trusted proxies" do <ide> @trusted_proxies = /^67\.205\.106\.73$/i <ide>
1
Ruby
Ruby
fix wrong `assert_equal` argument order
6158355f2eb51f6768c60077a177af370e95a14b
<ide><path>activerecord/test/cases/connection_management_test.rb <ide> def test_connections_closed_if_exception_and_explicitly_not_test <ide> app = lambda { |_| [200, {}, body] } <ide> response_body = ConnectionManagement.new(app).call(@env)[2] <ide> assert response_body.respond_to?(:to_path) <del> assert_equal response_body.to_path, "/path" <add> assert_equal "/path", response_body.to_path <ide> end <ide> <ide> test "doesn't mutate the original response" do <ide> original_response = [200, {}, 'hi'] <ide> app = lambda { |_| original_response } <ide> ConnectionManagement.new(app).call(@env)[2] <del> assert_equal original_response.last, 'hi' <add> assert_equal 'hi', original_response.last <ide> end <ide> end <ide> end
1
Python
Python
fix fixture scopes
f432bb4b48d84d541420d3888c4487b4e0d57622
<ide><path>spacy/tests/conftest.py <ide> # only used for tests that require loading the models <ide> # in all other cases, use specific instances <ide> <del>@pytest.fixture(params=_models['en'], scope="session") <add>@pytest.fixture(params=_models['en'], scope='session') <ide> def EN(request): <ide> return load_test_model(request.param) <ide> <ide> <del>@pytest.fixture(params=_models['de'], scope="session") <add>@pytest.fixture(params=_models['de'], scope='session') <ide> def DE(request): <ide> return load_test_model(request.param) <ide> <ide> <del>@pytest.fixture(params=_models['fr'], scope="session") <add>@pytest.fixture(params=_models['fr'], scope='session') <ide> def FR(request): <ide> return load_test_model(request.param) <ide> <ide> <del>@pytest.fixture(params=_languages) <add>@pytest.fixture(params=_languages, scope='session') <ide> def tokenizer(request): <ide> lang = util.get_lang_class(request.param) <ide> return lang.Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def en_tokenizer(): <ide> return util.get_lang_class('en').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def en_vocab(): <ide> return util.get_lang_class('en').Defaults.create_vocab() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def en_parser(): <ide> return util.get_lang_class('en').Defaults.create_parser() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def es_tokenizer(): <ide> return util.get_lang_class('es').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def de_tokenizer(): <ide> return util.get_lang_class('de').Defaults.create_tokenizer() <ide> <ide> def fr_tokenizer(): <ide> return util.get_lang_class('fr').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def hu_tokenizer(): <ide> return util.get_lang_class('hu').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def fi_tokenizer(): <ide> return util.get_lang_class('fi').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def sv_tokenizer(): <ide> return util.get_lang_class('sv').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def bn_tokenizer(): <ide> return util.get_lang_class('bn').Defaults.create_tokenizer() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def he_tokenizer(): <ide> return util.get_lang_class('he').Defaults.create_tokenizer() <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def nb_tokenizer(): <ide> return util.get_lang_class('nb').Defaults.create_tokenizer() <ide> <ide> def stringstore(): <ide> return StringStore() <ide> <ide> <del>@pytest.fixture <add>@pytest.fixture(scope='module') <ide> def en_entityrecognizer(): <ide> return util.get_lang_class('en').Defaults.create_entity() <ide>
1
PHP
PHP
remove usage of arr from cookie class
629122a5a965b0734251494f54ce57fac0e8f09e
<ide><path>system/cookie.php <ide> public static function has($name) <ide> */ <ide> public static function get($name, $default = null) <ide> { <del> return Arr::get($_COOKIE, $name, $default); <add> return (array_key_exists($name, $_COOKIE)) ? $_COOKIE[$name] : $default; <ide> } <ide> <ide> /**
1
Java
Java
update javadoc on @responsestatus
042519043f774385b30591bf2e6476b7cbee9dfc
<ide><path>spring-web/src/main/java/org/springframework/web/bind/annotation/ResponseStatus.java <ide> <ide> /** <ide> * The <em>reason</em> to be used for the response. <del> * <p>If this attribute is not set, it will default to the standard status <del> * message for the status code. Note that due to the use of <add> * <p><strong>Note:</strong> due to the use of <ide> * {@code HttpServletResponse.sendError(int, String)}, the response will be <del> * considered complete and should not be written to any further. <del> * <add> * considered complete and should not be written to any further. Furthermore <add> * servlet container will typically write an HTML error page therefore making <add> * the use of a reason unsuitable for REST APIs. For such cases prefer <add> * sending error details in the body of the response. <ide> * @see javax.servlet.http.HttpServletResponse#sendError(int, String) <ide> */ <ide> String reason() default "";
1
Javascript
Javascript
support symbol events
66cb4bcf0c032adc0f6abf7452150875c8a82243
<ide><path>src/node.js <ide> var signalWraps = {}; <ide> <ide> function isSignal(event) { <del> return event.slice(0, 3) === 'SIG' && <add> return typeof event === 'string' && <add> event.slice(0, 3) === 'SIG' && <ide> startup.lazyConstants().hasOwnProperty(event); <ide> } <ide> <ide><path>test/parallel/test-process-emit.js <add>'use strict'; <add>const common = require('../common'); <add>const assert = require('assert'); <add>const sym = Symbol(); <add> <add>process.on('normal', common.mustCall(data => { <add> assert.strictEqual(data, 'normalData'); <add>})); <add> <add>process.on(sym, common.mustCall(data => { <add> assert.strictEqual(data, 'symbolData'); <add>})); <add> <add>process.on('SIGPIPE', common.mustCall(data => { <add> assert.strictEqual(data, 'signalData'); <add>})); <add> <add>process.emit('normal', 'normalData'); <add>process.emit(sym, 'symbolData'); <add>process.emit('SIGPIPE', 'signalData');
2
Javascript
Javascript
avoid deprecation warning for viewstate tests
946cefdc2ec93a36205fa8f32a1e1644bd61451f
<ide><path>packages/ember-viewstates/tests/view_state_test.js <ide> var get = Ember.get, set = Ember.set, getPath = Ember.getPath, setPath = Ember.setPath; <ide> <del>module("Ember.ViewState"); <add>module("Ember.ViewState", { <add> setup: function() { <add> Ember.TESTING_DEPRECATION = true; <add> }, <add> <add> teardown: function() { <add> Ember.TESTING_DEPRECATION = false; <add> } <add>}); <ide> <ide> test("it inherits from Ember.State", function() { <ide> ok(Ember.State.detect(Ember.ViewState), "Ember.ViewState is an Ember.State"); <ide> test("it appends and removes a view to the view specified in the state manager's <ide> <ide> test("it reports the view associated with the current view state, if any", function() { <ide> var view = Ember.View.create(); <del> <add> <ide> var stateManager = Ember.StateManager.create({ <ide> foo: Ember.ViewState.create({ <ide> view: view, <ide> bar: Ember.State.create() <ide> }) <ide> }); <del> <add> <ide> Ember.run(function(){ <ide> stateManager.transitionTo('foo.bar'); <ide> }); <del> <add> <ide> equal(get(stateManager, 'currentView'), view, "returns nearest parent view state's view"); <ide> }); <ide>
1
Python
Python
set the --clone_model_in_keras_dist_strat to none.
2d4cfad039a75b22bcfa4cc283723f1d9d0ece69
<ide><path>official/recommendation/ncf_keras_benchmark.py <ide> def benchmark_1_gpu(self): <ide> self._setup() <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_1_gpu_no_cloning(self): <del> self._setup() <del> FLAGS.clone_model_in_keras_dist_strat = False <del> self._run_and_report_benchmark() <del> <ide> def benchmark_2_gpus(self): <ide> self._setup() <ide> FLAGS.num_gpus = 2 <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_2_gpus_no_cloning(self): <del> self._setup() <del> FLAGS.num_gpus = 2 <del> FLAGS.clone_model_in_keras_dist_strat = False <del> self._run_and_report_benchmark() <del> <ide> <ide> class KerasNCFSyntheticData(KerasNCFBenchmarkBase): <ide> """Benchmark NCF model using synthetic data.""" <ide> def benchmark_1_gpu(self): <ide> self._setup() <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_1_gpu_no_cloning(self): <del> self._setup() <del> FLAGS.clone_model_in_keras_dist_strat = False <del> self._run_and_report_benchmark() <del> <ide> def benchmark_2_gpus(self): <ide> self._setup() <ide> FLAGS.num_gpus = 2 <ide> self._run_and_report_benchmark() <del> <del> def benchmark_2_gpus_no_cloning(self): <del> self._setup() <del> FLAGS.num_gpus = 2 <del> FLAGS.clone_model_in_keras_dist_strat = False <del> self._run_and_report_benchmark() <ide><path>official/resnet/keras/keras_cifar_benchmark.py <ide> def benchmark_2_gpu(self): <ide> FLAGS.enable_eager = True <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_2_gpu_no_cloning(self): <del> """Test keras based model with eager, distributed no-cloning.""" <del> self._setup() <del> FLAGS.num_gpus = 2 <del> FLAGS.data_dir = self.data_dir <del> FLAGS.batch_size = 128 <del> FLAGS.train_epochs = 182 <del> FLAGS.model_dir = self._get_model_dir('benchmark_2_gpu_no_cloning') <del> FLAGS.dtype = 'fp32' <del> FLAGS.clone_model_in_keras_dist_strat = False <del> FLAGS.enable_eager = True <del> self._run_and_report_benchmark() <del> <ide> def benchmark_graph_2_gpu(self): <ide> """Test keras based model with Keras fit and distribution strategies.""" <ide> self._setup() <ide> def benchmark_2_gpu(self): <ide> FLAGS.batch_size = 128 * 2 # 2 GPUs <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_2_gpu_no_cloning(self): <del> self._setup() <del> FLAGS.num_gpus = 2 <del> FLAGS.enable_eager = True <del> FLAGS.distribution_strategy = 'default' <del> FLAGS.model_dir = self._get_model_dir('benchmark_2_gpu_no_cloning') <del> FLAGS.batch_size = 128 * 2 # 2 GPUs <del> FLAGS.clone_model_in_keras_dist_strat = False <del> self._run_and_report_benchmark() <del> <ide> def benchmark_graph_2_gpu(self): <ide> self._setup() <ide> FLAGS.num_gpus = 2 <ide><path>official/resnet/keras/keras_common.py <ide> def __init__(self, batch_size, epoch_size, warmup_epochs, boundaries, <ide> self.compute_lr_on_cpu = compute_lr_on_cpu <ide> self.name = name <ide> <del> self.cached_learning_rate_op = None <add> self.learning_rate_ops_cache = {} <ide> <ide> def __call__(self, step): <ide> if tf.executing_eagerly(): <ide> def __call__(self, step): <ide> # In an eager function or graph, the current implementation of optimizer <ide> # repeatedly call and thus create ops for the learning rate schedule. To <ide> # avoid this, we cache the ops if not executing eagerly. <del> if self.cached_learning_rate_op is None: <add> graph = tf.compat.v1.get_default_graph() <add> if graph not in self.learning_rate_ops_cache: <ide> if self.compute_lr_on_cpu: <ide> with tf.device('/device:CPU:0'): <del> self.cached_learning_rate_op = self._get_learning_rate(step) <add> self.learning_rate_ops_cache[graph] = self._get_learning_rate(step) <ide> else: <del> self.cached_learning_rate_op = self._get_learning_rate(step) <del> return self.cached_learning_rate_op <add> self.learning_rate_ops_cache[graph] = self._get_learning_rate(step) <add> return self.learning_rate_ops_cache[graph] <ide> <ide> def _get_learning_rate(self, step): <ide> """Compute learning rate at given step.""" <ide> def define_keras_flags(): <ide> name='batchnorm_spatial_persistent', default=True, <ide> help='Enable the spacial persistent mode for CuDNN batch norm kernel.') <ide> flags.DEFINE_boolean( <del> name='clone_model_in_keras_dist_strat', default=True, <add> name='clone_model_in_keras_dist_strat', default=None, <ide> help='If False, then the experimental code path is used that doesn\'t ' <ide> 'clone models for distribution.') <ide> <ide><path>official/resnet/keras/keras_imagenet_benchmark.py <ide> def benchmark_1_gpu(self): <ide> FLAGS.batch_size = 128 <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_1_gpu_no_cloning(self): <del> """Test Keras model with 1 GPU and no-cloning.""" <del> self._setup() <del> <del> FLAGS.num_gpus = 1 <del> FLAGS.enable_eager = True <del> FLAGS.distribution_strategy = 'default' <del> FLAGS.model_dir = self._get_model_dir('benchmark_1_gpu_no_cloning') <del> FLAGS.batch_size = 128 <del> FLAGS.clone_model_in_keras_dist_strat = False <del> self._run_and_report_benchmark() <del> <ide> def benchmark_xla_1_gpu(self): <ide> """Test Keras model with XLA and 1 GPU.""" <ide> self._setup() <ide> def benchmark_8_gpu(self): <ide> FLAGS.batch_size = 128 * 8 # 8 GPUs <ide> self._run_and_report_benchmark() <ide> <del> def benchmark_8_gpu_no_cloning(self): <del> """Test Keras model with 8 GPUs and no-cloning.""" <add> def benchmark_8_gpu_cloning(self): <add> """Test Keras model with 8 GPUs and cloning.""" <ide> self._setup() <ide> <ide> FLAGS.num_gpus = 8 <ide> FLAGS.enable_eager = True <ide> FLAGS.distribution_strategy = 'default' <del> FLAGS.model_dir = self._get_model_dir('benchmark_8_gpu_no_cloning') <del> FLAGS.clone_model_in_keras_dist_strat = False <add> FLAGS.clone_model_in_keras_dist_strat = True <add> FLAGS.model_dir = self._get_model_dir('benchmark_8_gpu_cloning') <ide> FLAGS.batch_size = 128 * 8 # 8 GPUs <ide> self._run_and_report_benchmark() <ide> <ide> def benchmark_8_gpu_fp16(self): <ide> FLAGS.batch_size = 256 * 8 # 8 GPUs <ide> self._run_and_report_benchmark() <ide> <add> def benchmark_8_gpu_fp16_cloning(self): <add> """Test Keras model with 8 GPUs, fp16 and cloning.""" <add> self._setup() <add> <add> FLAGS.num_gpus = 8 <add> FLAGS.dtype = 'fp16' <add> FLAGS.enable_eager = True <add> FLAGS.distribution_strategy = 'default' <add> FLAGS.clone_model_in_keras_dist_strat = True <add> FLAGS.model_dir = self._get_model_dir('benchmark_8_gpu_fp16_cloning') <add> FLAGS.batch_size = 256 * 8 # 8 GPUs <add> self._run_and_report_benchmark() <add> <ide> def benchmark_8_gpu_fp16_tweaked(self): <ide> """Test Keras model with 8 GPUs, fp16, and manual config tuning.""" <ide> self._setup() <ide> def benchmark_xla_8_gpu_fp16(self): <ide> FLAGS.batch_size = 256 * 8 # 8 GPUs <ide> self._run_and_report_benchmark() <ide> <add> def benchmark_xla_8_gpu_fp16_cloning(self): <add> """Test Keras model with XLA, 8 GPUs, fp16 and cloning.""" <add> self._setup() <add> <add> FLAGS.num_gpus = 8 <add> FLAGS.dtype = 'fp16' <add> FLAGS.enable_eager = True <add> FLAGS.enable_xla = True <add> FLAGS.distribution_strategy = 'default' <add> FLAGS.clone_model_in_keras_dist_strat = True <add> FLAGS.model_dir = self._get_model_dir('benchmark_xla_8_gpu_fp16_cloning') <add> FLAGS.batch_size = 256 * 8 # 8 GPUs <add> self._run_and_report_benchmark() <add> <ide> def benchmark_xla_8_gpu_fp16_tweaked(self): <ide> """Test Keras model with manual config tuning, XLA, 8 GPUs and fp16.""" <ide> self._setup()
4
Ruby
Ruby
fix definition of find_name
0dea211f44d85e9c28963784286838bfa6c343f9
<ide><path>railties/lib/rails/vendor_gem_source_index.rb <ide> def load_specification(gem_dir) <ide> YAML.load_file(spec_file) if File.exist?(spec_file) <ide> end <ide> <del> def find_name(gem_name, version_requirement = Gem::Requirement.default) <del> search(/^#{gem_name}$/, version_requirement) <add> def find_name(*args) <add> @installed_source_index.find_name(*args) + @vendor_source_index.find_name(*args) <ide> end <ide> <ide> def search(*args)
1
Java
Java
fix typo in test method names
5a12e7b2c513731e9bc36589583c7e5b5d96059f
<ide><path>spring-test/src/test/java/org/springframework/test/util/JsonPathExpectationsHelperTests.java <ide> /* <del> * Copyright 2004-2019 the original author or authors. <add> * Copyright 2004-2020 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> void existsForAnEmptyMap() throws Exception { <ide> } <ide> <ide> @Test <del> void existsForIndefinatePathWithResults() throws Exception { <add> void existsForIndefinitePathWithResults() throws Exception { <ide> new JsonPathExpectationsHelper("$.familyMembers[?(@.name == 'Bart')]").exists(SIMPSONS); <ide> } <ide> <ide> @Test <del> void existsForIndefinatePathWithEmptyResults() throws Exception { <add> void existsForIndefinitePathWithEmptyResults() throws Exception { <ide> String expression = "$.familyMembers[?(@.name == 'Dilbert')]"; <ide> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> <ide> new JsonPathExpectationsHelper(expression).exists(SIMPSONS)) <ide> void doesNotExistForAnEmptyMap() throws Exception { <ide> } <ide> <ide> @Test <del> void doesNotExistForIndefinatePathWithResults() throws Exception { <add> void doesNotExistForIndefinitePathWithResults() throws Exception { <ide> String expression = "$.familyMembers[?(@.name == 'Bart')]"; <ide> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> <ide> new JsonPathExpectationsHelper(expression).doesNotExist(SIMPSONS)) <ide> .withMessageContaining("Expected no value at JSON path \"" + expression + "\" but found: [{\"name\":\"Bart\"}]"); <ide> } <ide> <ide> @Test <del> void doesNotExistForIndefinatePathWithEmptyResults() throws Exception { <add> void doesNotExistForIndefinitePathWithEmptyResults() throws Exception { <ide> new JsonPathExpectationsHelper("$.familyMembers[?(@.name == 'Dilbert')]").doesNotExist(SIMPSONS); <ide> } <ide> <ide> void assertValueIsEmptyForAnEmptyMap() throws Exception { <ide> } <ide> <ide> @Test <del> void assertValueIsEmptyForIndefinatePathWithEmptyResults() throws Exception { <add> void assertValueIsEmptyForIndefinitePathWithEmptyResults() throws Exception { <ide> new JsonPathExpectationsHelper("$.familyMembers[?(@.name == 'Dilbert')]").assertValueIsEmpty(SIMPSONS); <ide> } <ide> <ide> @Test <del> void assertValueIsEmptyForIndefinatePathWithResults() throws Exception { <add> void assertValueIsEmptyForIndefinitePathWithResults() throws Exception { <ide> String expression = "$.familyMembers[?(@.name == 'Bart')]"; <ide> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> <ide> new JsonPathExpectationsHelper(expression).assertValueIsEmpty(SIMPSONS)) <ide> void assertValueIsNotEmptyForMap() throws Exception { <ide> } <ide> <ide> @Test <del> void assertValueIsNotEmptyForIndefinatePathWithResults() throws Exception { <add> void assertValueIsNotEmptyForIndefinitePathWithResults() throws Exception { <ide> new JsonPathExpectationsHelper("$.familyMembers[?(@.name == 'Bart')]").assertValueIsNotEmpty(SIMPSONS); <ide> } <ide> <ide> @Test <del> void assertValueIsNotEmptyForIndefinatePathWithEmptyResults() throws Exception { <add> void assertValueIsNotEmptyForIndefinitePathWithEmptyResults() throws Exception { <ide> String expression = "$.familyMembers[?(@.name == 'Dilbert')]"; <ide> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> <ide> new JsonPathExpectationsHelper(expression).assertValueIsNotEmpty(SIMPSONS)) <ide> void hasJsonPathWithNull() { <ide> } <ide> <ide> @Test <del> void hasJsonPathForIndefinatePathWithResults() { <add> void hasJsonPathForIndefinitePathWithResults() { <ide> new JsonPathExpectationsHelper("$.familyMembers[?(@.name == 'Bart')]").hasJsonPath(SIMPSONS); <ide> } <ide> <ide> @Test <del> void hasJsonPathForIndefinatePathWithEmptyResults() { <add> void hasJsonPathForIndefinitePathWithEmptyResults() { <ide> String expression = "$.familyMembers[?(@.name == 'Dilbert')]"; <ide> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> <ide> new JsonPathExpectationsHelper(expression).hasJsonPath(SIMPSONS)) <ide> void doesNotHaveJsonPathWithNull() { <ide> } <ide> <ide> @Test <del> void doesNotHaveJsonPathForIndefinatePathWithEmptyResults() { <add> void doesNotHaveJsonPathForIndefinitePathWithEmptyResults() { <ide> new JsonPathExpectationsHelper("$.familyMembers[?(@.name == 'Dilbert')]").doesNotHaveJsonPath(SIMPSONS); <ide> } <ide> <ide> @Test <del> void doesNotHaveEmptyPathForIndefinatePathWithResults() { <add> void doesNotHaveEmptyPathForIndefinitePathWithResults() { <ide> String expression = "$.familyMembers[?(@.name == 'Bart')]"; <ide> assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> <ide> new JsonPathExpectationsHelper(expression).doesNotHaveJsonPath(SIMPSONS))
1
Python
Python
remove doc/reference from setup
4dbfac0dad8d629b83ce64f2d1aa8cbaee88649c
<ide><path>numpy/setup.py <ide> def configuration(parent_package='',top_path=None): <ide> config.add_subpackage('random') <ide> config.add_subpackage('ma') <ide> config.add_subpackage('doc') <del> config.add_subpackage('doc/reference') <ide> config.add_data_dir('doc') <ide> config.add_data_dir('tests') <ide> config.make_config_py() # installs __config__.py
1
PHP
PHP
make gettokenforrequest public
71040ec51e58d96f521ab5d5ccf600ea3c4305be
<ide><path>src/Illuminate/Auth/TokenGuard.php <ide> public function user() <ide> * <ide> * @return string <ide> */ <del> protected function getTokenForRequest() <add> public function getTokenForRequest() <ide> { <ide> $token = $this->request->input($this->inputKey); <ide>
1
Javascript
Javascript
add chunkid declaration
2101892e3c3ee435d2ef2be7a42482413970ccc8
<ide><path>lib/HotModuleReplacement.runtime.js <ide> var hotDownloadManifest = undefined; <ide> var hotDownloadUpdateChunk = undefined; <ide> var hotDisposeChunk = undefined; <ide> var modules = undefined; <add>var chunkId = undefined; <ide> <ide> module.exports = function() { <ide> var hotApplyOnUpdate = true; <ide> module.exports = function() { <ide> /*foreachInstalledChunks*/ <ide> // eslint-disable-next-line no-lone-blocks <ide> { <del> /*globals chunkId */ <ide> hotEnsureUpdateChunk(chunkId); <ide> } <ide> if (
1
Python
Python
fix d202 issue
01a52ccb53bc805308bd085dc51ae4674dd5eb4a
<ide><path>airflow/www/security.py <ide> def _sync_dag_view_permissions(self, dag_id, access_control): <ide> :param access_control: a dict where each key is a rolename and <ide> each value is a set() of action names (e.g. {'can_read'}) <ide> """ <del> <ide> dag_resource_name = permissions.resource_name_for_dag(dag_id) <ide> <ide> def _get_or_create_dag_permission(action_name: str) -> Optional[Permission]:
1
Javascript
Javascript
remove post-processing ("attributes") hook
d280c5353c3031272a3fda59e619e1d8f6fc6e02
<ide><path>packages/ember-htmlbars/lib/env.js <ide> import lookupHelper from 'ember-htmlbars/hooks/lookup-helper'; <ide> import hasHelper from 'ember-htmlbars/hooks/has-helper'; <ide> import invokeHelper from 'ember-htmlbars/hooks/invoke-helper'; <ide> import element from 'ember-htmlbars/hooks/element'; <del>import attributes from 'ember-htmlbars/hooks/attributes'; <ide> <ide> import helpers from 'ember-htmlbars/helpers'; <ide> import keywords, { registerKeyword } from 'ember-htmlbars/keywords'; <ide> merge(emberHooks, { <ide> lookupHelper, <ide> hasHelper, <ide> invokeHelper, <del> element, <del> attributes <add> element <ide> }); <ide> <ide> import debuggerKeyword from 'ember-htmlbars/keywords/debugger'; <ide><path>packages/ember-htmlbars/lib/hooks/attributes.js <del>import { render, internal } from 'htmlbars-runtime'; <del> <del>export default function attributes(morph, env, scope, template, parentNode, visitor) { <del> let state = morph.state; <del> let block = state.block; <del> <del> if (!block) { <del> let element = findRootElement(parentNode); <del> if (!element) { return; } <del> <del> normalizeClassStatement(template.statements, element); <del> <del> template.element = element; <del> block = morph.state.block = internal.blockFor(render, template, { scope }); <del> } <del> <del> block(env, [], undefined, morph, undefined, visitor); <del>} <del> <del>function normalizeClassStatement(statements, element) { <del> let className = element.getAttribute('class'); <del> if (!className) { return; } <del> <del> for (let i = 0, l = statements.length; i < l; i++) { <del> let statement = statements[i]; <del> <del> if (statement[1] === 'class') { <del> statement[2][2].unshift(className); <del> } <del> } <del>} <del> <del>function findRootElement(parentNode) { <del> let node = parentNode.firstChild; <del> let found = null; <del> <del> while (node) { <del> if (node.nodeType === 1) { <del> // found more than one top-level element, so there is no "root element" <del> if (found) { return null; } <del> found = node; <del> } <del> node = node.nextSibling; <del> } <del> <del> let className = found && found.getAttribute('class'); <del> if (!className || className.split(' ').indexOf('ember-view') === -1) { <del> return found; <del> } <del>} <ide><path>packages/ember-views/lib/system/build-component-template.js <ide> import Ember from 'ember-metal/core'; <ide> import { get } from 'ember-metal/property_get'; <add>import assign from 'ember-metal/assign'; <ide> import { isGlobal } from 'ember-metal/path_cache'; <ide> import { internal, render } from 'htmlbars-runtime'; <ide> import getValue from 'ember-htmlbars/hooks/get-value'; <ide> export default function buildComponentTemplate({ component, layout, isAngleBrack <ide> } <ide> <ide> if (layout && layout.raw) { <del> let attributes = (component && component._isAngleBracket) ? normalizeComponentAttributes(component, true, attrs) : undefined; <del> <ide> let yieldTo = createContentBlocks(content.templates, content.scope, content.self, component); <del> blockToRender = createLayoutBlock(layout.raw, yieldTo, content.self, component, attrs, attributes); <add> blockToRender = createLayoutBlock(layout.raw, yieldTo, content.self, component, attrs); <ide> meta = layout.raw.meta; <ide> } else if (content.templates && content.templates.default) { <ide> blockToRender = createContentBlock(content.templates.default, content.scope, content.self, component); <ide> export default function buildComponentTemplate({ component, layout, isAngleBrack <ide> // element. We use `manualElement` to create a template that represents <ide> // the wrapping element and yields to the previous block. <ide> if (tagName !== '') { <del> let attributes; <del> <del> if (isComponentElement) { <del> attributes = convertAttrsToAst(attrs); <del> } else { <del> attributes = normalizeComponentAttributes(component, isAngleBracket, attrs); <del> } <del> <add> if (isComponentElement) { attrs = mergeAttrs(attrs, outerAttrs); } <add> var attributes = normalizeComponentAttributes(component, isAngleBracket, attrs); <ide> var elementTemplate = internal.manualElement(tagName, attributes); <ide> elementTemplate.meta = meta; <ide> <ide> export default function buildComponentTemplate({ component, layout, isAngleBrack <ide> return { createdElement: !!tagName, block: blockToRender }; <ide> } <ide> <add>function mergeAttrs(innerAttrs, outerAttrs) { <add> let result = assign({}, innerAttrs, outerAttrs); <add> <add> if (innerAttrs.class && outerAttrs.class) { <add> result.class = ['subexpr', '-join-classes', [['value', innerAttrs.class], ['value', outerAttrs.class]], []]; <add> } <add> <add> return result; <add>} <add> <ide> function blockFor(template, options) { <ide> Ember.assert('BUG: Must pass a template to blockFor', !!template); <ide> return internal.blockFor(render, template, options); <ide> } <ide> <del>function createContentBlock(template, scope, self, component, attributes) { <add>function createContentBlock(template, scope, self, component) { <ide> Ember.assert('BUG: buildComponentTemplate can take a scope or a self, but not both', !(scope && self)); <ide> <ide> return blockFor(template, { <ide> scope, <ide> self, <del> attributes, <ide> options: { view: component } <ide> }); <ide> } <ide> function createContentBlocks(templates, scope, self, component) { <ide> return output; <ide> } <ide> <del>function createLayoutBlock(template, yieldTo, self, component, attrs, attributes) { <add>function createLayoutBlock(template, yieldTo, self, component, attrs) { <ide> return blockFor(template, { <ide> yieldTo, <del> attributes, <ide> <ide> // If we have an old-style Controller with a template it will be <ide> // passed as our `self` argument, and it should be the context for <ide> function tagNameFor(view) { <ide> return tagName; <ide> } <ide> <del>function convertAttrsToAst(attrs) { <del> let normalized = {}; <del> <del> for (var prop in attrs) { <del> let val = attrs[prop]; <del> if (!val) { continue; } <del> <del> if (typeof val === 'string') { <del> normalized[prop] = val; <del> } else if (val.isConcat) { <del> normalized[prop] = ['value', val]; <del> } <del> } <del> <del> return normalized; <del>} <del> <ide> // Takes a component and builds a normalized set of attribute <ide> // bindings consumable by HTMLBars' `attribute` hook. <ide> function normalizeComponentAttributes(component, isAngleBracket, attrs) {
3
Javascript
Javascript
remove debugging code
535ab939685216c81fecab0ae9f01b13c4c1f033
<ide><path>script/lib/create-debian-package.js <ide> module.exports = function(packagedAppPath) { <ide> path.join(debianPackageBinDirPath, apmExecutableName) <ide> ); <ide> <del> try { <del> fs.chmodSync(path.join(debianPackageAtomDirPath, 'chrome-sandbox'), '4755'); <del> } catch (ex) { <del> console.log('Chmod failed'); <del> <del> spawnSync('find', [debianPackageDirPath, '-name', 'chrome-sandbox'], { <del> stdio: 'inherit' <del> }); <del> } <add> fs.chmodSync(path.join(debianPackageAtomDirPath, 'chrome-sandbox'), '4755'); <ide> <ide> console.log(`Writing control file into "${debianPackageConfigPath}"`); <ide> const packageSizeInKilobytes = spawnSync('du', ['-sk', packagedAppPath])
1
Python
Python
fix bug in flax-speech-encoder-decoder test
1da84ae02ce2776bf1babbe7eba1f9a2572dcd44
<ide><path>tests/speech_encoder_decoder/test_modeling_flax_speech_encoder_decoder.py <ide> def compute_loss( <ide> inputs, <ide> attention_mask, <ide> decoder_input_ids, <del> decoder_attention_mask, <ide> freeze_feature_encoder: bool = False, <ide> ): <ide> outputs_enc_dec = enc_dec_model( <ide> inputs=inputs, <ide> attention_mask=attention_mask, <ide> decoder_input_ids=decoder_input_ids, <del> decoder_attention_mask=decoder_attention_mask, <ide> freeze_feature_encoder=freeze_feature_encoder, <ide> params=params, <ide> ) <ide> def compute_loss( <ide> grad_fn = jax.value_and_grad(compute_loss) <ide> <ide> # compute the loss and gradients for the unfrozen model <del> loss, grads = grad_fn( <del> params, inputs, attention_mask, decoder_input_ids, decoder_attention_mask, freeze_feature_encoder=False <del> ) <add> loss, grads = grad_fn(params, inputs, attention_mask, decoder_input_ids, freeze_feature_encoder=False) <ide> <ide> # compare to the loss and gradients for the frozen model <ide> loss_frozen, grads_frozen = grad_fn( <del> params, inputs, attention_mask, decoder_input_ids, decoder_attention_mask, freeze_feature_encoder=True <add> params, inputs, attention_mask, decoder_input_ids, freeze_feature_encoder=True <ide> ) <ide> <ide> self.assert_almost_equals(loss, loss_frozen, 1e-5) <ide> def compute_loss( <ide> feature_extractor_grads, feature_extractor_grads_frozen <ide> ): <ide> self.assertTrue((feature_extractor_grad_frozen == 0.0).all()) <del> self.assert_difference(feature_extractor_grad, feature_extractor_grad_frozen, 1e-8) <add> self.assert_difference(feature_extractor_grad, feature_extractor_grad_frozen, 1e-10) <ide> <ide> # ensure that the gradients of all unfrozen layers remain equal, i.e. all layers excluding the frozen 'feature_extractor' <ide> grads = tuple(grads[k] for k in grads if "feature_extractor" not in k) <ide> grads_frozen = tuple(grads_frozen[k] for k in grads_frozen if "feature_extractor" not in k) <ide> <ide> for grad, grad_frozen in zip(grads, grads_frozen): <del> self.assert_almost_equals(grad, grad_frozen, 1e-8) <add> self.assert_almost_equals(grad, grad_frozen, 1e-10) <ide> <ide> def check_pt_flax_equivalence(self, pt_model, fx_model, inputs_dict): <ide>
1
Text
Text
fix broken internal link in http.md
42e85c705c3573c266a9c9cec31e0607a05e3a71
<ide><path>doc/api/http.md <ide> try { <ide> [`net.Socket`]: net.md#net_class_net_socket <ide> [`net.createConnection()`]: net.md#net_net_createconnection_options_connectlistener <ide> [`new URL()`]: url.md#url_new_url_input_base <del>[`outgoingMessage.socket`]: #http_outgoingMessage.socket <add>[`outgoingMessage.socket`]: #http_outgoingmessage_socket <ide> [`removeHeader(name)`]: #http_request_removeheader_name <ide> [`request.destroy()`]: #http_request_destroy_error <ide> [`request.end()`]: #http_request_end_data_encoding_callback
1
Ruby
Ruby
change internal implementation to use a tree
90997f9300eef08d380f2e0fb5874885b5d57a26
<ide><path>actionview/lib/action_view/digestor.rb <ide> class << self <ide> def digest(name:, finder:, **options) <ide> options.assert_valid_keys(:dependencies, :partial) <ide> <del> cache_key = ([ name, finder.details_key.hash ].compact + Array.wrap(options[:dependencies])).join('.') <add> dependencies = Array.wrap(options[:dependencies]) <add> cache_key = ([ name, finder.details_key.hash ].compact + dependencies).join('.') <ide> <ide> # this is a correctly done double-checked locking idiom <ide> # (Concurrent::Map's lookups have volatile semantics) <ide> digest_monitor.synchronize do <ide> @@cache.fetch(cache_key) do # re-check under lock <del> compute_and_store_digest(cache_key, name, finder, options) <add> @@cache[cache_key] = tree(name, finder, dependencies).digest <ide> end <ide> end <ide> end <ide> <add> def logger <add> ActionView::Base.logger || NullLogger <add> end <add> <ide> private <ide> def compute_and_store_digest(cache_key, name, finder, options) # called under @@digest_monitor lock <ide> klass = if options[:partial] || name.include?("/_") <ide> def self.tree(name, finder, injected = [], partial = false, seen = {}) <ide> node <ide> end <ide> else <add> logger.error " '#{name}' file doesn't exist, so no dependencies" <ide> seen[name] ||= Missing.new(name, logical_name, nil) <ide> end <ide> end <ide> def dependency_digest(stack) <ide> end <ide> end.join("-") <ide> end <add> <add> def to_dep_map <add> children.any? ? { name => children.map(&:to_dep_map) } : name <add> end <ide> end <ide> <ide> class Partial < Node <ide> def to_dep(finder) <ide> <ide> class Missing < Node <ide> def digest(_ = []) <add> logger.error " Couldn't find template for digesting: #{name}" <ide> '' <ide> end <add> <add> class NullLogger <add> def self.debug(_); end <add> def self.error(_); end <add> end <add> <add> def logger <add> ActionView::Base.logger || NullLogger <add> end <ide> end <ide> <ide> class Injected < Node <ide><path>actionview/test/template/digestor_test.rb <ide> def teardown <ide> ActionView::Digestor.cache.clear <ide> end <ide> <del> def test_amaze <del> node = ActionView::Digestor.tree "messages/show", finder <del> x = ActionView::Digestor.new("messages/show", finder) <del> #assert_equal digest("messages/show"), node.to_dep(finder).digest <del> assert_equal digest("messages/show"), node.digest <del> end <del> <ide> def test_top_level_change_reflected <ide> assert_digest_difference("messages/show") do <ide> change_template("messages/show") <ide> def test_nested_template_directory <ide> end <ide> end <ide> <add> def test_nested_template_deps <add> nested_deps = ["messages/header", {"comments/comments"=>["comments/comment"]}, "messages/actions/move", "events/event", "messages/something_missing", "messages/something_missing_1", "messages/message", "messages/form"] <add> assert_equal nested_deps, nested_dependencies("messages/show") <add> end <add> <ide> def test_recursion_in_renders <ide> assert digest("level/recursion") # assert recursion is possible <ide> assert_not_nil digest("level/recursion") # assert digest is stored <ide> def digest(template_name, options = {}) <ide> finder.variants = options.delete(:variants) || [] <ide> <ide> node = ActionView::Digestor.tree(template_name, finder, options[:dependencies] || []) <del> y = node.digest <del> x = ActionView::Digestor.digest({ name: template_name, finder: finder }.merge(options)) <del> assert_equal x, y <del> x <add> node.digest <ide> end <ide> <ide> def dependencies(template_name) <del> ActionView::Digestor.new(template_name, finder).dependencies <add> tree = ActionView::Digestor.tree(template_name, finder, []) <add> tree.children.map(&:name) <ide> end <ide> <ide> def nested_dependencies(template_name) <del> ActionView::Digestor.new(template_name, finder).nested_dependencies <add> tree = ActionView::Digestor.tree(template_name, finder, []) <add> tree.children.map(&:to_dep_map) <ide> end <ide> <ide> def finder
2
Ruby
Ruby
add support for error_messages_for(@obj)
c4d1075bd366e89a070afd5d6bf859af276c9507
<ide><path>actionpack/lib/action_view/helpers/active_model_helper.rb <ide> def error_message_on(object, method, *args) <ide> # <ide> # error_messages_for 'user' <ide> # <add> # You can also supply an object: <add> # <add> # error_messages_for @user <add> # <add> # This will use the last part of the model name in the presentation. For instance, if <add> # this is a MyKlass::User object, this will use "user" as the name in the String. This <add> # is taken from MyKlass::User.model_name.human, which can be overridden. <add> # <ide> # To specify more than one object, you simply list them; optionally, you can add an extra <tt>:object_name</tt> parameter, which <ide> # will be the name used in the header message: <ide> # <ide> # error_messages_for 'user_common', 'user', :object_name => 'user' <ide> # <add> # You can also use a number of objects, which will have the same naming semantics <add> # as a single object. <add> # <add> # error_messages_for @user, @post <add> # <ide> # If the objects cannot be located as instance variables, you can add an extra <tt>:object</tt> parameter which gives the actual <ide> # object (or array of objects to use): <ide> # <ide> def error_message_on(object, method, *args) <ide> def error_messages_for(*params) <ide> options = params.extract_options!.symbolize_keys <ide> <del> if object = options.delete(:object) <del> objects = [object].flatten <del> else <del> objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact <add> objects = Array.wrap(options.delete(:object) || params).map do |object| <add> unless object.respond_to?(:to_model) <add> object = instance_variable_get("@#{object}") <add> object = convert_to_model(object) <add> else <add> object = object.to_model <add> options[:object_name] ||= object.class.model_name.human <add> end <add> object <ide> end <ide> <del> objects.map! {|o| convert_to_model(o) } <add> objects.compact! <ide> <del> count = objects.inject(0) {|sum, object| sum + object.errors.count } <add> count = objects.inject(0) {|sum, object| sum + object.errors.count } <ide> unless count.zero? <ide> html = {} <ide> [:id, :class].each do |key| <ide><path>actionpack/test/template/active_record_helper_i18n_test.rb <ide> class ActiveRecordHelperI18nTest < Test::Unit::TestCase <ide> include ActionView::Context <ide> include ActionView::Helpers::ActiveModelHelper <del> <add> <ide> attr_reader :request <ide> <ide> def setup <ide> @object = stub :errors => stub(:count => 1, :full_messages => ['full_messages']) <add> @object.stubs :to_model => @object <add> @object.stubs :class => stub(:model_name => stub(:human => "")) <add> <ide> @object_name = 'book_seller' <ide> @object_name_without_underscore = 'book seller' <ide> <ide> def test_error_messages_for_given_no_message_option_it_translates_message <ide> I18n.expects(:t).with('', :default => '', :count => 1, :scope => [:activerecord, :models]).once.returns '' <ide> error_messages_for(:object => @object, :locale => 'en') <ide> end <del> <add> <ide> def test_error_messages_for_given_object_name_it_translates_object_name <ide> I18n.expects(:t).with(:header, :locale => 'en', :scope => [:activerecord, :errors, :template], :count => 1, :model => @object_name_without_underscore).returns "1 error prohibited this #{@object_name_without_underscore} from being saved" <ide> I18n.expects(:t).with(@object_name, :default => @object_name_without_underscore, :count => 1, :scope => [:activerecord, :models]).once.returns @object_name_without_underscore <ide><path>actionpack/test/template/active_record_helper_test.rb <ide> def test_error_messages_for_non_instance_variable <ide> assert_equal '', error_messages_for('user', :object => nil) <ide> end <ide> <add> def test_error_messages_for_model_objects <add> error = error_messages_for(@post) <add> assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>), <add> error <add> <add> error = error_messages_for(@user, @post) <add> assert_dom_equal %(<div class="errorExplanation" id="errorExplanation"><h2>2 errors prohibited this user from being saved</h2><p>There were problems with the following fields:</p><ul><li>User email can't be empty</li><li>Author name can't be empty</li></ul></div>), <add> error <add> end <add> <ide> def test_form_with_string_multipart <ide> assert_dom_equal( <ide> %(<form action="create" enctype="multipart/form-data" method="post"><p><label for="post_title">Title</label><br /><input id="post_title" name="post[title]" size="30" type="text" value="Hello World" /></p>\n<p><label for="post_body">Body</label><br /><div class="fieldWithErrors"><textarea cols="40" id="post_body" name="post[body]" rows="20">Back to the hill and over it again!</textarea></div></p><input name="commit" type="submit" value="Create" /></form>), <ide><path>activemodel/lib/active_model/naming.rb <ide> <ide> module ActiveModel <ide> class Name < String <del> attr_reader :singular, :plural, :element, :collection, :partial_path <add> attr_reader :singular, :plural, :element, :collection, :partial_path, :human <ide> alias_method :cache_key, :collection <ide> <ide> def initialize(name) <ide> super <ide> @singular = ActiveSupport::Inflector.underscore(self).tr('/', '_').freeze <ide> @plural = ActiveSupport::Inflector.pluralize(@singular).freeze <ide> @element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self)).freeze <add> @human = @element.gsub(/_/, " ") <ide> @collection = ActiveSupport::Inflector.tableize(self).freeze <ide> @partial_path = "#{@collection}/#{@element}".freeze <ide> end
4
Ruby
Ruby
fix undefined method error
47afde940a70f2a3a597f01bf52f1b8ad096e65f
<ide><path>Library/Homebrew/formula.rb <ide> def eligible_kegs_for_cleanup <ide> # If the cellar only has one version installed, don't complain <ide> # that we can't tell which one to keep. Don't complain at all if the <ide> # only installed version is a pinned formula. <del> opoo "Skipping #{full_name}: most recent version #{f.pkg_version} not installed" <add> opoo "Skipping #{full_name}: most recent version #{pkg_version} not installed" <ide> end <ide> eligible_for_cleanup <ide> end
1
Javascript
Javascript
remove material.combine from webglprogram
95c1ca3777626e7d0a0d83c8185e73e101eba194
<ide><path>src/renderers/webgl/WebGLProgram.js <ide> function generateEnvMapModeDefine( parameters ) { <ide> <ide> } <ide> <del>function generateEnvMapBlendingDefine( parameters, material ) { <add>function generateEnvMapBlendingDefine( parameters ) { <ide> <ide> var envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; <ide> <ide> if ( parameters.envMap ) { <ide> <del> switch ( material.combine ) { <add> switch ( parameters.combine ) { <ide> <ide> case MultiplyOperation: <ide> envMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY'; <ide> function WebGLProgram( renderer, extensions, code, material, shader, parameters <ide> var shadowMapTypeDefine = generateShadowMapTypeDefine( parameters ); <ide> var envMapTypeDefine = generateEnvMapTypeDefine( parameters ); <ide> var envMapModeDefine = generateEnvMapModeDefine( parameters ); <del> var envMapBlendingDefine = generateEnvMapBlendingDefine( parameters, material ); <add> var envMapBlendingDefine = generateEnvMapBlendingDefine( parameters ); <ide> <ide> <ide> var gammaFactorDefine = ( renderer.gammaFactor > 0 ) ? renderer.gammaFactor : 1.0;
1
Javascript
Javascript
fix locale generation on linux
63979e25d7e1082d73de3ae4e54387d98951b07d
<ide><path>src/locale.js <ide> var fs = require("fs"), <ide> formats = {}, <ide> kvRe = /=/, <ide> valueRe = /;/g, <del> quotedRe = /"([^"]+?)"/g, <add> quotedRe = /"([^"]*?)"/g, <ide> data = []; <ide> <ide> process.stdin.resume();
1
Javascript
Javascript
fix typo in hmr api
ccc431756c5f0e5bf1ef1a08dfcde5e17355de01
<ide><path>lib/HotModuleReplacement.runtime.js <ide> module.exports = function() { <ide> type: "self-accept-error-handler-errored", <ide> moduleId: moduleId, <ide> error: err2, <del> orginalError: err <add> orginalError: err, // TODO remove in webpack 4 <add> originalError: err <ide> }); <ide> } <ide> if(!options.ignoreErrored) {
1
Python
Python
fix resources __eq__ check
6b308446eae2f83bf379f976c7d7801aa53370a3
<ide><path>airflow/utils/operator_resources.py <ide> def __init__(self, name, units_str, qty): <ide> self._qty = qty <ide> <ide> def __eq__(self, other): <add> if not isinstance(other, self.__class__): <add> return NotImplemented <ide> return self.__dict__ == other.__dict__ <ide> <ide> def __repr__(self): <ide> def __init__( <ide> self.gpus = GpuResource(gpus) <ide> <ide> def __eq__(self, other): <add> if not isinstance(other, self.__class__): <add> return NotImplemented <ide> return self.__dict__ == other.__dict__ <ide> <ide> def __repr__(self): <ide><path>tests/utils/test_operator_resources.py <add># <add># Licensed to the Apache Software Foundation (ASF) under one <add># or more contributor license agreements. See the NOTICE file <add># distributed with this work for additional information <add># regarding copyright ownership. The ASF licenses this file <add># to you under the Apache License, Version 2.0 (the <add># "License"); you may not use this file except in compliance <add># with the License. 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, <add># software distributed under the License is distributed on an <add># "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY <add># KIND, either express or implied. See the License for the <add># specific language governing permissions and limitations <add># under the License. <add> <add>import unittest <add> <add>from airflow.utils.operator_resources import Resources <add> <add> <add>class TestResources(unittest.TestCase): <add> def test_resource_eq(self): <add> r = Resources(cpus=0.1, ram=2048) <add> assert r not in [{}, [], None] <add> assert r == r <add> <add> r2 = Resources(cpus=0.1, ram=2048) <add> assert r == r2 <add> assert r2 == r <add> <add> r3 = Resources(cpus=0.2, ram=2048) <add> assert r != r3
2
Java
Java
add missing @nullable declaration
5105b74f6e7cdb80cd1dc1f1d426ad931e038184
<ide><path>spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyUtils.java <ide> public static String getTargetBeanName(String originalBeanName) { <ide> * @see #getTargetBeanName(String) <ide> * @see #isScopedTarget(String) <ide> */ <del> public static String getOriginalBeanName(String targetBeanName) { <add> public static String getOriginalBeanName(@Nullable String targetBeanName) { <ide> Assert.isTrue(isScopedTarget(targetBeanName), () -> "bean name '" + <ide> targetBeanName + "' does not refer to the target of a scoped proxy"); <ide> return targetBeanName.substring(TARGET_NAME_PREFIX_LENGTH);
1
Javascript
Javascript
remove an unused dependency
d98c5f03a4cee88a3f0a383c217e3b2f84bbaa25
<ide><path>src/ng/compile.js <ide> function $CompileProvider($provide, $$sanitizeUriProvider) { <ide> <ide> this.$get = [ <ide> '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', <del> '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri', <add> '$controller', '$rootScope', '$sce', '$animate', '$$sanitizeUri', <ide> function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, <del> $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) { <add> $controller, $rootScope, $sce, $animate, $$sanitizeUri) { <ide> <ide> var SIMPLE_ATTR_NAME = /^\w/; <ide> var specialAttrHolder = document.createElement('div');
1
Javascript
Javascript
use path2d as cache
e530a4d1a0bd264885a559b1bb5213e26d898454
<ide><path>src/elements/element.line.js <ide> import {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../help <ide> import {_computeSegments, _boundSegments} from '../helpers/helpers.segment'; <ide> import {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas'; <ide> import {_updateBezierControlPoints} from '../helpers/helpers.curve'; <add>import {_coordsAnimated} from '../helpers/helpers.extras'; <ide> <ide> /** <ide> * @typedef { import("./element.point").default } PointElement <ide> function pathVars(points, segment, params) { <ide> /** <ide> * Create path from points, grouping by truncated x-coordinate <ide> * Points need to be in order by x-coordinate for this to work efficiently <del> * @param {CanvasRenderingContext2D} ctx - Context <add> * @param {CanvasRenderingContext2D|Path2D} ctx - Context <ide> * @param {LineElement} line <ide> * @param {object} segment <ide> * @param {number} segment.start - start index of the segment, referring the points array <ide> function pathSegment(ctx, line, segment, params) { <ide> /** <ide> * Create path from points, grouping by truncated x-coordinate <ide> * Points need to be in order by x-coordinate for this to work efficiently <del> * @param {CanvasRenderingContext2D} ctx - Context <add> * @param {CanvasRenderingContext2D|Path2D} ctx - Context <ide> * @param {LineElement} line <ide> * @param {object} segment <ide> * @param {number} segment.start - start index of the segment, referring the points array <ide> export default class LineElement extends Element { <ide> this.options = undefined; <ide> this._loop = undefined; <ide> this._fullLoop = undefined; <add> this._path = undefined; <ide> this._points = undefined; <ide> this._segments = undefined; <ide> this._pointsUpdated = false; <ide> export default class LineElement extends Element { <ide> set points(points) { <ide> this._points = points; <ide> delete this._segments; <add> delete this._path; <ide> } <ide> <ide> get points() { <ide> export default class LineElement extends Element { <ide> <ide> /** <ide> * Append all segments of this line to current path. <del> * @param {CanvasRenderingContext2D} ctx <add> * @param {CanvasRenderingContext2D|Path2D} ctx <ide> * @param {number} [start] <ide> * @param {number} [count] <ide> * @returns {undefined|boolean} - true if line is a full loop (path should be closed) <ide> export default class LineElement extends Element { <ide> <ide> setStyle(ctx, options); <ide> <del> ctx.beginPath(); <del> <del> if (this.path(ctx, start, count)) { <del> ctx.closePath(); <add> let path = this._path; <add> if (!path) { <add> path = this._path = new Path2D(); <add> if (this.path(path, start, count)) { <add> path.closePath(); <add> } <ide> } <ide> <del> ctx.stroke(); <add> ctx.stroke(path); <add> <ide> ctx.restore(); <ide> <del> this._pointsUpdated = false; <add> if (_coordsAnimated(points[0]) || _coordsAnimated(points[points.length - 1])) { <add> // When point coordinates are animating, we need to recalculate the <add> // path (and control points when beziers are used). Only coordinates <add> // matter, other animations are ignored. <add> this._pointsUpdated = false; <add> this._path = undefined; <add> } <ide> } <ide> } <ide> <ide><path>src/helpers/helpers.extras.js <add> <ide> export function fontString(pixelSize, fontStyle, fontFamily) { <ide> return fontStyle + ' ' + pixelSize + 'px ' + fontFamily; <ide> } <ide> export const _toLeftRightCenter = (align) => align === 'start' ? 'left' : align <ide> * @private <ide> */ <ide> export const _alignStartEnd = (align, start, end) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2; <add> <add>/** <add> * Return true if `x` or `y` property (coordinates) of the element is currently animated. <add> * @param {object} element <add> * @returns {boolean} <add> * @private <add> */ <add>export function _coordsAnimated(element) { <add> const anims = element && element.$animations; <add> return anims && ((anims.x && anims.x.active) || (anims.y && anims.y.active)); <add>}
2
Javascript
Javascript
use symbol for object hash when possible
bbd9784a81413c3dcc3c618997efd2a469f2c863
<ide><path>dist/Immutable.js <ide> function invariant(condition, error) { <ide> throw new Error(error); <ide> } <ide> var DELETE = 'delete'; <del>var ITERATOR = typeof Symbol === 'undefined' ? '@@iterator' : Symbol.iterator; <add>var ITERATOR = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator'; <ide> function hash(o) { <ide> if (!o) { <ide> return 0; <ide> function hashJSObj(obj) { <ide> var HASH_MAX_VAL = 0x7FFFFFFF; <ide> var UID_HASH_COUNT = 0; <ide> var UID_HASH_KEY = '__immutablehash__'; <add>if (typeof Symbol !== 'undefined') { <add> UID_HASH_KEY = Symbol(UID_HASH_KEY); <add>} <ide> var isIE8 = false; <ide> var STRING_HASH_CACHE_MIN_STRLEN = 16; <ide> var STRING_HASH_CACHE_MAX_SIZE = 255; <ide><path>dist/Immutable.min.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,n,r){var i;if(r){var u=r.prototype;i=me.create(u)}else i=t.prototype;return me.keys(e).forEach(function(t){i[t]=e[t]}),me.keys(n).forEach(function(e){t[e]=n[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,n,r){return me.getPrototypeOf(e)[n].apply(t,r)}function n(t,n,r){e(t,n,"constructor",r)}function r(t){return t.value=!1,t}function i(t){t&&(t.value=!0)}function u(){}function s(t){for(var e=t.length,n=Array(e),r=0;e>r;r++)n[r]=t[r];return n}function a(t){return Me.value=t,Me.done=!1,Me}function o(){return Me.value=void 0,Me.done=!0,Me}function h(t,e){if(!t)throw Error(e)}function c(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&Oe;t=""+t,e="string"}return"string"===e?t.length>Ee?f(t):l(t):t.hashCode?c("function"==typeof t.hashCode?t.hashCode():t.hashCode):_(t)}function f(t){var e=We[t];return null==e&&(e=l(t),Pe===je&&(Pe=0,We={}),Pe++,We[t]=e),e}function l(t){for(var e=0,n=0;t.length>n;n++)e=31*e+t.charCodeAt(n)&Oe;return e}function _(t){if(t[Ae])return t[Ae];var e=++xe&Oe;if(!Ce)try{return Object.defineProperty(t,Ae,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}catch(n){Ce=!0}return t[Ae]=e,e}function v(){return Object.create(ze)}function g(t){var e=Object.create(Le);return e.__reversedIndices=t?t.__reversedIndices:!1,e}function p(t,e,n,r){var i=t.get?t.get(e[r],Se):Se;return i===Se?n:++r===e.length?i:p(i,e,n,r)}function m(t,e,n){return(0===t||null!=n&&-n>=t)&&(null==e||null!=n&&e>=n)}function y(t,e){return 0>t?Math.max(0,e+t):e?Math.min(e,t):t}function d(t,e){return null==t?e:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function w(t){return t}function I(t,e){return[e,t]}function S(){return!0}function k(){return this}function b(t){return(t||0)+1}function M(t,e,n,r,i){var u=t.__makeSequence();return u.__iterateUncached=function(u,s,a){var o=0,h=t.__iterate(function(t,i,s){if(e.call(n,t,i,s)){if(u(t,r?i:o,s)===!1)return!1;o++}},s,a);return i?h:o},u}function D(t){return function(){return!t.apply(this,arguments)}}function q(t){return"string"==typeof t?JSON.stringify(t):t <del>}function O(t,e){for(var n="";e;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n}function x(t,e){return t>e?1:e>t?-1:0}function A(t){h(1/0!==t,"Cannot perform this action with an infinite sequence.")}function C(t,e){var n=new Ne;return n.next=function(){var n=t.next();return n.done?n:(n.value=e(n.value),n)},n}function E(t,e,n){return n instanceof Re?j(t,e,n):n}function j(t,e,n){return new Ge(t._rootData,t._keyPath.concat(e),t._onChange,n)}function P(t,e,n){var r=t._rootData.updateIn(t._keyPath,n?He.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,r,t._rootData,n?i.concat(n):i),new Ge(r,t._keyPath,t._onChange)}function W(t,e){return t instanceof Ge&&(t=t.deref()),e instanceof Ge&&(e=e.deref()),t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof Re?t.equals(e):!1}function R(t,e){return a(0===t||1===t?e[t]:[e[0],e[1]])}function U(t,e){return{node:t,index:0,__prev:e}}function z(t,e,n,r){var i=Object.create(Te);return i.length=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function J(t,e,n){var i=r(ke),u=r(be),s=B(t._root,t.__ownerID,0,c(e),e,n,i,u);if(!u.value)return t;var a=t.length+(i.value?n===Se?-1:1:0);return t.__ownerID?(t.length=a,t._root=s,t.__hash=void 0,t.__altered=!0,t):s?z(a,s):He.empty()}function B(t,e,n,r,u,s,a,o){return t?t.update(e,n,r,u,s,a,o):s===Se?t:(i(o),i(a),new nn(e,r,[u,s]))}function L(t){return t.constructor===nn||t.constructor===tn}function V(t,e,n,r,i){if(t.hash===r)return new tn(e,r,[t.entry,i]);var u,s=t.hash>>>n&Ie,a=r>>>n&Ie,o=s===a?[V(t,e,n+de,r,i)]:(u=new nn(e,r,i),a>s?[t,u]:[u,t]);return new Xe(e,1<<s|1<<a,o)}function K(t,e,n,r){for(var i=0,u=0,s=Array(n),a=0,o=1,h=e.length;h>a;a++,o<<=1){var c=e[a];null!=c&&a!==r&&(i|=o,s[u++]=c)}return new Xe(t,i,s)}function N(t,e,n,r,i){for(var u=0,s=Array(we),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[u++]:null;return s[r]=i,new Ze(t,u+1,s)}function F(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Array.isArray(u)?Re(u).fromEntrySeq():Re(u))}return H(t,e,r)}function G(t){return function(e,n){return e&&e.mergeDeepWith?e.mergeDeepWith(t,n):t?t(e,n):n <del>}}function H(t,e,n){return 0===n.length?t:t.withMutations(function(t){for(var r=e?function(n,r){var i=t.get(r,Se);t.set(r,i===Se?n:e(i,n))}:function(e,n){t.set(n,e)},i=0;n.length>i;i++)n[i].forEach(r)})}function Q(t,e,n,r,i){var u=e.length;if(i===u)return r(t);h(t.set,"updateIn with invalid keyPath");var s=i===u-1?n:He.empty(),a=e[i],o=t.get(a,s),c=Q(o,e,n,r,i+1);return c===o?t:t.set(a,c)}function T(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 X(t,e,n,r){var i=r?t:s(t);return i[e]=n,i}function Y(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var u=Array(i),s=0,a=0;i>a;a++)a===e?(u[a]=n,s=-1):u[a]=t[a+s];return u}function Z(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=Array(r),u=0,s=0;r>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function $(t,e,n,r,i,u){if(t){var s,a=t.array,o=a.length-1;if(0===e)for(s=0;o>=s;s++){var h=u?o-s:s;if(a.hasOwnProperty(h)){var c=h+n;if(c>=0&&r>c&&i(a[h],c)===!1)return!1}}else{var f=1<<e,l=e-de;for(s=0;o>=s;s++){var _=u?o-s:s,v=n+_*f;if(r>v&&v+f>0){var g=a[_];if(g&&!$(g,l,v,r,i,u))return!1}}}}return!0}function te(t,e,n,r,i){return{array:t,level:e,offset:n,max:r,rawMax:r-n>>e,index:0,__prev:i}}function ee(t,e,n,r,i,u,s){var a=Object.create(fn);return a.length=e-t,a._origin=t,a._size=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=u,a.__hash=s,a.__altered=!1,a}function ne(t,e,n){if(e>=t.length)return n===Se?t:t.withMutations(function(t){se(t,0,e+1).set(e,n)});e=oe(e,t._origin);var i=t._tail,u=t._root,s=r(be);return e>=he(t._size)?i=re(i,t.__ownerID,0,e,n,s):u=re(u,t.__ownerID,t._level,e,n,s),s.value?t.__ownerID?(t._root=u,t._tail=i,t.__hash=void 0,t.__altered=!0,t):ee(t._origin,t._size,t._level,u,i):t}function re(t,e,n,r,u,s){var a,o=u===Se,h=r>>>n&Ie,c=t&&t.array.length>h&&t.array.hasOwnProperty(h);if(o&&!c)return t;if(n>0){var f=t&&t.array[h],l=re(f,e,n-de,r,u,s);return l===f?t:(a=ie(t,e),a.array[h]=l,a)}return!o&&c&&t.array[h]===u?t:(i(s),a=ie(t,e),o?delete a.array[h]:a.array[h]=u,a)}function ie(t,e){return e&&t&&e===t.ownerID?t:new ln(t?t.array.slice():[],e) <del>}function ue(t,e){if(e>=he(t._size))return t._tail;if(1<<t._level+de>e){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&Ie],r-=de;return n}}function se(t,e,n){var r=t.__ownerID||new u,i=t._origin,s=t._size,a=i+e,o=null==n?s:0>n?s+n:i+n;if(a===i&&o===s)return t;if(a>=o)return t.clear();for(var h=t._level,c=t._root,f=0;0>a+f;)c=new ln(c&&c.array.length?[null,c]:[],r),h+=de,f+=1<<h;f&&(a+=f,i+=f,o+=f,s+=f);for(var l=he(s),_=he(o);_>=1<<h+de;)c=new ln(c&&c.array.length?[c]:[],r),h+=de;var v=t._tail,g=l>_?ue(t,o-1):_>l?new ln([],r):v;if(v&&_>l&&s>a&&v.array.length){c=ie(c,r);for(var p=c,m=h;m>de;m-=de){var y=l>>>m&Ie;p=p.array[y]=ie(p.array[y],r)}p.array[l>>>de&Ie]=v}if(s>o&&(g=g&&g.removeAfter(r,0,o)),a>=_)a-=_,o-=_,h=de,c=null,g=g&&g.removeBefore(r,0,a);else if(a>i||l>_){var d,w;f=0;do d=a>>>h&Ie,w=_-1>>>h&Ie,d===w&&(d&&(f+=(1<<h)*d),h-=de,c=c&&c.array[d]);while(c&&d===w);c&&a>i&&(c=c&&c.removeBefore(r,h,a-f)),c&&l>_&&(c=c&&c.removeAfter(r,h,_-f)),f&&(a-=f,o-=f)}return t.__ownerID?(t.length=o-a,t._origin=a,t._size=o,t._level=h,t._root=c,t._tail=g,t.__hash=void 0,t.__altered=!0,t):ee(a,o,h,c,g)}function ae(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Re(u))}var s=Math.max.apply(null,r.map(function(t){return t.length||0}));return s>t.length&&(t=t.setLength(s)),H(t,e,r)}function oe(t,e){return h(t>=0,"Index out of bounds"),t+e}function he(t){return we>t?0:t-1>>>de<<de}function ce(t,e){var n=Object.create(yn);return n.length=t?t.length:0,n._map=t,n.__ownerID=e,n}function fe(t,e,n,r){var i=Object.create(wn.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=n,i.__hash=r,i}function le(t,e,n){var r=t._map,i=t._vector,u=r.get(e),s=void 0!==u,a=n===Se;if(!s&&a||s&&n===i.get(u)[1])return t;s||(u=i.length);var o=a?r.remove(e):s?r:r.set(e,u),h=a?i.remove(u):i.set(u,[e,n]);return t.__ownerID?(t.length=o.length,t._map=o,t._vector=h,t.__hash=void 0,t):fe(o,h)}function _e(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function ve(t,e){return e?ge(e,t,"",{"":t}):pe(t) <del>}function ge(t,e,n,r){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(r,n,Re(e).map(function(n,r){return ge(t,n,r,e)})):e}function pe(t){if(t){if(Array.isArray(t))return Re(t).map(pe).toVector();if(t.constructor===Object)return Re(t).map(pe).toMap()}return t}var me=Object,ye={};ye.createClass=t,ye.superCall=e,ye.defaultSuperCall=n;var de=5,we=1<<de,Ie=we-1,Se={},ke={value:!1},be={value:!1},Me={value:void 0,done:!1},De="delete",qe="undefined"==typeof Symbol?"@@iterator":Symbol.iterator,Oe=2147483647,xe=0,Ae="__immutablehash__",Ce=!1,Ee=16,je=255,Pe=0,We={},Re=function(t){return Ue.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},Ue=Re;ye.createClass(Re,{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+": "+q(t)},toJS:function(){return this.map(function(t){return t instanceof Ue?t.toJS():t}).__toJS()},toArray:function(){A(this.length);var t=Array(this.length||0);return this.valueSeq().forEach(function(e,n){t[n]=e}),t},toObject:function(){A(this.length);var t={};return this.forEach(function(e,n){t[n]=e}),t},toVector:function(){return A(this.length),hn.from(this)},toMap:function(){return A(this.length),He.from(this)},toOrderedMap:function(){return A(this.length),wn.from(this)},toSet:function(){return A(this.length),pn.from(this)},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,n){return t+(c(e)^(e===n?0:c(n)))&Oe},0))},equals:function(t){if(this===t)return!0;if(!(t instanceof Ue))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)},__deepEquals:function(t){var e=this.cacheResult().entrySeq().toArray(),n=0;return t.every(function(t,r){var i=e[n++];return W(r,i[0])&&W(t,i[1])})},join:function(t){t=t||",";var e="",n=!0;return this.forEach(function(r){n?(n=!1,e+=r):e+=t+r <del>}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(S)),this.length)},countBy:function(t){var e=this;return wn.empty().withMutations(function(n){e.forEach(function(e,r,i){n.update(t(e,r,i),b)})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t.map(function(t){return Ue(t)})),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e){for(var r,i=0,u=n.length-1,s=0;u>=s&&!r;s++){var a=n[e?u-s:s];i+=a.__iterate(function(e,n,i){return t(e,n,i)===!1?(r=!0,!1):void 0},e)}return i},r},reverse:function(){var t=this,e=t.__makeSequence();return e.length=t.length,e.__iterateUncached=function(e,n){return t.__iterate(e,!n)},e.reverse=function(){return t},e},keySeq:function(){return this.flip().valueSeq()},valueSeq:function(){var t=this,e=g(t);return e.length=t.length,e.valueSeq=k,e.__iterateUncached=function(e,n,r){if(r&&null==this.length)return this.cacheResult().__iterate(e,n,r);var i,u=0;return r?(u=this.length-1,i=function(t,n,r){return e(t,u--,r)!==!1}):i=function(t,n,r){return e(t,u++,r)!==!1},t.__iterate(i,n),r?this.length:u},e},entrySeq:function(){var t=this;if(t._cache)return Ue(t._cache);var e=t.map(I).valueSeq();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,n){var r=e;return this.forEach(function(e,i,u){r=t.call(n,r,e,i,u)}),r},reduceRight:function(t,e,n){return this.reverse(!0).reduce(t,e,n)},every:function(t,e){var n=!0;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?void 0:(n=!1,!1)}),n},some:function(t,e){return!this.every(D(t),e)},first:function(){return this.find(S)},last:function(){return this.findLast(S)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,Se)!==Se},get:function(t,e){return this.find(function(e,n){return W(n,t)},null,e)},getIn:function(t,e){return t&&0!==t.length?p(this,t,e,0):this <del>},contains:function(t){return this.find(function(e){return W(e,t)},null,Se)!==Se},find:function(t,e,n){var r=n;return this.forEach(function(n,i,u){return t.call(e,n,i,u)?(r=n,!1):void 0}),r},findKey:function(t,e){var n;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?(n=i,!1):void 0}),n},findLast:function(t,e,n){return this.reverse(!0).find(t,e,n)},findLastKey:function(t,e){return this.reverse(!0).findKey(t,e)},flip:function(){var t=this,e=v();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,n){return t.__iterate(function(t,n,r){return e(n,t,r)!==!1},n)},e},map:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){return n.__iterate(function(n,i,u){return r(t.call(e,n,i,u),i,u)!==!1},i)},r},mapKeys:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){return n.__iterate(function(n,i,u){return r(n,t.call(e,i,n,u),u)!==!1},i)},r},filter:function(t,e){return M(this,t,e,!0,!1)},slice:function(t,e){if(m(t,e,this.length))return this;var n=y(t,this.length),r=d(e,this.length);if(n!==n||r!==r)return this.entrySeq().slice(t,e).fromEntrySeq();var i=0===n?this:this.skip(n);return null==r||r===this.length?i:i.take(r-n)},take:function(t){var e=0,n=this.takeWhile(function(){return e++<t});return n.length=this.length&&Math.min(this.length,t),n},takeLast:function(t,e){return this.reverse(e).take(t).reverse(e)},takeWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){if(i)return this.cacheResult().__iterate(r,i,u);var s=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&r(n,i,u)!==!1?void s++:!1},i,u),s},r},takeUntil:function(t,e,n){return this.takeWhile(D(t),e,n)},skip:function(t,e){if(0===t)return this;var n=0,r=this.skipWhile(function(){return n++<t},null,e);return r.length=this.length&&Math.max(0,this.length-t),r},skipLast:function(t,e){return this.reverse(e).skip(t).reverse(e)},skipWhile:function(t,e){var n=this,r=n.__makeSequence(); <del>return r.__iterateUncached=function(r,i,u){if(i)return this.cacheResult().__iterate(r,i,u);var s=!0,a=0;return n.__iterate(function(n,i,u){if(!s||!(s=t.call(e,n,i,u))){if(r(n,i,u)===!1)return!1;a++}},i,u),a},r},skipUntil:function(t,e,n){return this.skipWhile(D(t),e,n)},groupBy:function(t){var e=this,n=wn.empty().withMutations(function(n){e.forEach(function(e,r,i){var u=t(e,r,i),s=n.get(u,Se);s===Se&&(s=[],n.set(u,s)),s.push([r,e])})});return n.map(function(t){return Ue(t).fromEntrySeq()})},sort:function(t,e){return this.sortBy(w,t,e)},sortBy:function(t,e){e=e||x;var n=this;return Ue(this.entrySeq().entrySeq().toArray().sort(function(r,i){return e(t(r[1][1],r[1][0],n),t(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(A(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e,n){if(!this._cache)return this.__iterateUncached(t,e,n);var r=this.length-1,i=this._cache,u=this;if(e)for(var s=i.length-1;s>=0;s--){var a=i[s];if(t(a[1],n?a[0]:r-a[0],u)===!1)break}else i.every(n?function(e){return t(e[1],r-e[0],u)!==!1}:function(e){return t(e[1],e[0],u)!==!1});return this.length},__makeSequence:function(){return v()}},{from:function(t){if(t instanceof Ue)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Ve(t);t=[t]}return new Ke(t)}});var ze=Re.prototype;ze.toJSON=ze.toJS,ze.__toJS=ze.toObject,ze.inspect=ze.toSource=function(){return""+this};var Je=function(){ye.defaultSuperCall(this,Be.prototype,arguments)},Be=Je;ye.createClass(Je,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){A(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,n){t[n]=e}),t},fromEntrySeq:function(){var t=this,e=v();return e.length=t.length,e.entrySeq=function(){return t},e.__iterateUncached=function(e,n,r){return t.__iterate(function(t,n,r){return e(t[1],t[0],r)},n,r)},e},join:function(t){t=t||",";var e="",n=0; <del>return this.forEach(function(r,i){var u=i-n;n=i,e+=(1===u?t:O(t,u))+r}),this.length&&this.length-1>n&&(e+=O(t,this.length-1-n)),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t).map(function(t){return Re(t)}),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e,r){if(r&&!this.length)return this.cacheResult().__iterate(t,e,r);for(var i,u=0,s=r&&this.length-1,a=n.length-1,o=0;a>=o&&!i;o++){var h=n[e?a-o:o];h instanceof Be||(h=h.valueSeq()),u+=h.__iterate(function(e,n,a){return n+=u,t(e,r?s-n:n,a)===!1?(i=!0,!1):void 0},e)}return u},r},reverse:function(t){var e=this,n=e.__makeSequence();return n.length=e.length,n.__reversedIndices=!!(t^e.__reversedIndices),n.__iterateUncached=function(n,r,i){return e.__iterate(n,!r,i^t)},n.reverse=function(n){return t===n?e:Le.reverse.call(this,n)},n},valueSeq:function(){var t=ye.superCall(this,Be.prototype,"valueSeq",[]);return t.length=void 0,t},filter:function(t,e,n){var r=M(this,t,e,n,n);return n&&(r.length=this.length),r},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 n=this.findKey(t,e);return null==n?-1:n},findLastIndex:function(t,e){return this.reverse(!0).findIndex(t,e)},slice:function(t,e,n){var r=this;if(m(t,e,r.length))return r;var i=r.__makeSequence(),u=y(t,r.length),s=d(e,r.length);return i.length=r.length&&(n?r.length:s-u),i.__reversedIndices=r.__reversedIndices,i.__iterateUncached=function(i,a,o){if(a)return this.cacheResult().__iterate(i,a,o);var h=this.__reversedIndices^o;if(u!==u||s!==s||h&&null==r.length){var c=r.count();u=y(t,c),s=d(e,c)}var f=h?r.length-s:u,l=h?r.length-u:s,_=r.__iterate(function(t,e,r){return h?null!=l&&e>=l||e>=f&&i(t,n?e:e-f,r)!==!1:f>e||(null==l||l>e)&&i(t,n?e:e-f,r)!==!1},a,o);return null!=this.length?this.length:n?_:Math.max(0,_-f)},i},splice:function(t,e){for(var n=[],r=2;arguments.length>r;r++)n[r-2]=arguments[r]; <del>return 0===e&&0===n.length?this:this.slice(0,t).concat(n,this.slice(t+e))},takeWhile:function(t,e,n){var r=this,i=r.__makeSequence();return i.__iterateUncached=function(u,s,a){if(s)return this.cacheResult().__iterate(u,s,a);var o=0,h=!0,c=r.__iterate(function(n,r,i){return t.call(e,n,r,i)&&u(n,r,i)!==!1?void(o=r):(h=!1,!1)},s,a);return n?i.length:h?c:o+1},n&&(i.length=this.length),i},skipWhile:function(t,e,n){var r=this,i=r.__makeSequence();return n&&(i.length=this.length),i.__iterateUncached=function(i,u,s){if(u)return this.cacheResult().__iterate(i,u,s);var a=r.__reversedIndices^s,o=!0,h=0,c=r.__iterate(function(r,u,a){return o&&(o=t.call(e,r,u,a),o||(h=u)),o||i(r,s||n?u:u-h,a)!==!1},u,s);return n?c:a?h+1:c-h},i},groupBy:function(t,e,n){var r=this,i=wn.empty().withMutations(function(e){r.forEach(function(i,u,s){var a=t(i,u,s),o=e.get(a,Se);o===Se&&(o=Array(n?r.length:0),e.set(a,o)),n?o[u]=i:o.push(i)})});return i.map(function(t){return Re(t)})},sortBy:function(t,e,n){var r=ye.superCall(this,Be.prototype,"sortBy",[t,e]);return n||(r=r.valueSeq()),r.length=this.length,r},__makeSequence:function(){return g(this)}},{},Re);var Le=Je.prototype;Le.__toJS=Le.toArray,Le.__toStringMapper=q;var Ve=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};ye.createClass(Ve,{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 n=this._object,r=this._keys,i=r.length-1,u=0;i>=u;u++){var s=e?i-u:u;if(t(n[r[s]],r[s],n)===!1)break}return u}},{},Re);var Ke=function(t){this._array=t,this.length=t.length};ye.createClass(Ke,{toArray:function(){return this._array},__iterate:function(t,e,n){var r=this._array,i=r.length-1,u=-1;if(e){for(var s=i;s>=0;s--){if(r.hasOwnProperty(s)&&t(r[s],n?s:i-s,r)===!1)return u+1;u=s}return r.length}var a=r.every(function(e,s){return t(e,n?i-s:s,r)===!1?!1:(u=s,!0)});return a?r.length:u+1}},{},Je),Ke.prototype.get=Ve.prototype.get,Ke.prototype.has=Ve.prototype.has; <del>var Ne=function(){};ye.createClass(Ne,{toString:function(){return"[Iterator]"}},{});var Fe=Ne.prototype;Fe[qe]=k,Fe.inspect=Fe.toSource=function(){return""+this};var Ge=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof Re?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};ye.createClass(Ge,{deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var n=this._rootData.getIn(this._keyPath.concat(t),Se);return n===Se?e:E(this,t,n)},set:function(t,e){return P(this,function(n){return n.set(t,e)},t)},remove:function(t){return P(this,function(e){return e.remove(t)},t)},clear:function(){return P(this,function(t){return t.clear()})},update:function(t,e,n){return 1===arguments.length?P(this,t):P(this,function(r){return r.update(t,e,n)},t)},cursor:function(t){return Array.isArray(t)&&0===t.length?this:j(this,t)},__iterate:function(t,e,n){var r=this,i=r.deref();return i&&i.__iterate?i.__iterate(function(e,n,i){return t(E(r,n,e),n,i)},e,n):0}},{},Re),Ge.prototype[De]=Ge.prototype.remove,Ge.prototype.getIn=Ge.prototype.get;var He=function(t){var e=Qe.empty();return t?t.constructor===Qe?t:e.merge(t):e},Qe=He;ye.createClass(He,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,c(t),t,e):e},set:function(t,e){return J(this,t,e)},remove:function(t){return J(this,t,Se)},update:function(t,e,n){return 1===arguments.length?this.updateIn([],null,t):this.updateIn([t],e,n)},updateIn:function(t,e,n){var r;return n||(r=[e,n],n=r[0],e=r[1],r),Q(this,t,e,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe.empty()},merge:function(){return F(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return F(this,t,e)},mergeDeep:function(){return F(this,G(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return F(this,G(t),e) <del>},cursor:function(t,e){return e||"function"!=typeof t?0===arguments.length?t=[]:Array.isArray(t)||(t=[t]):(e=t,t=[]),new Ge(this,t,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 u)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},keys:function(){return new un(this,0)},values:function(){return new un(this,1)},entries:function(){return new un(this,2)},__iterator:function(t){return new un(this,2,t)},__iterate:function(t,e){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(e){return t(e[1],e[0],n)===!1?!1:void r++},e),r},__deepEqual:function(t){var e=this;return t.every(function(t,n){return W(e.get(n,Se),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?z(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{empty:function(){return sn||(sn=z(0))}},Re);var Te=He.prototype;Te[De]=Te.remove,Te[qe]=function(){return this.entries()},He.from=He;var Xe=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},Ye=Xe;ye.createClass(Xe,{get:function(t,e,n,r){var i=1<<(e>>>t&Ie),u=this.bitmap;return 0===(u&i)?r:this.nodes[T(u&i-1)].get(t+de,e,n,r)},update:function(t,e,n,r,i,u,s){var a=n>>>e&Ie,o=1<<a,h=this.bitmap,c=0!==(h&o);if(!c&&i===Se)return this;var f=T(h&o-1),l=this.nodes,_=c?l[f]:null,v=B(_,t,e+de,n,r,i,u,s);if(v===_)return this;if(!c&&v&&l.length>=an)return N(t,l,h,a,v);if(c&&!v&&2===l.length&&L(l[1^f]))return l[1^f];if(c&&v&&1===l.length&&L(v))return v;var g=t&&t===this.ownerID,p=c?v?h:h^o:h|o,m=c?v?X(l,f,v,g):Z(l,f,g):Y(l,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new Ye(t,p,m)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[e?i-r:r].iterate(t,e)===!1)return!1}},{});var Ze=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},$e=Ze;ye.createClass(Ze,{get:function(t,e,n,r){var i=e>>>t&Ie,u=this.nodes[i];return u?u.get(t+de,e,n,r):r <del>},update:function(t,e,n,r,i,u,s){var a=n>>>e&Ie,o=i===Se,h=this.nodes,c=h[a];if(o&&!c)return this;var f=B(c,t,e+de,n,r,i,u,s);if(f===c)return this;var l=this.count;if(c){if(!f&&(l--,on>l))return K(t,h,l,a)}else l++;var _=t&&t===this.ownerID,v=X(h,a,f,_);return _?(this.count=l,this.nodes=v,this):new $e(t,l,v)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var u=n[e?i-r:r];if(u&&u.iterate(t,e)===!1)return!1}}},{});var tn=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},en=tn;ye.createClass(tn,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(W(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,o){var h=u===Se;if(n!==this.hash)return h?this:(i(o),i(a),V(this,t,e,n,[r,u]));for(var c=this.entries,f=0,l=c.length;l>f&&!W(r,c[f][0]);f++);var _=l>f;if(h&&!_)return this;if(i(o),(h||!_)&&i(a),h&&2===l)return new nn(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);return _?h?f===l-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new en(t,this.hash,g)},iterate:function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1}},{});var nn=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n},rn=nn;ye.createClass(nn,{get:function(t,e,n,r){return W(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var o=u===Se,h=W(r,this.entry[0]);return(h?u===this.entry[1]:o)?this:(i(a),o?(i(s),null):h?t&&t===this.ownerID?(this.entry[1]=u,this):new rn(t,n,[r,u]):(i(s),V(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var un=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&U(t._root)};ye.createClass(un,{next:function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return R(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return R(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var u=r.nodes[this._reverse?n-i:i];if(u){if(u.entry)return R(t,u.entry);e=this._stack=U(u,e)}continue}e=this._stack=this._stack.__prev <del>}return o()}},{},Ne);var sn,an=we/2,on=we/4,hn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return cn.from(t)},cn=hn;ye.createClass(hn,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=oe(t,this._origin),t>=this._size)return e;var n=ue(this,t),r=t&Ie;return n&&(void 0===e||n.array.hasOwnProperty(r))?n.array[r]:e},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){return ne(this,t,e)},remove:function(t){return ne(this,t,Se)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=de,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):cn.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(n){se(n,0,e+t.length);for(var r=0;t.length>r;r++)n.set(e+r,t[r])})},pop:function(){return se(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){se(e,-t.length);for(var n=0;t.length>n;n++)e.set(n,t[n])})},shift:function(){return se(this,1)},merge:function(){return ae(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return ae(this,t,e)},mergeDeep:function(){return ae(this,G(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return ae(this,G(t),e)},setLength:function(t){return se(this,0,t)},slice:function(t,e,n){var r=ye.superCall(this,cn.prototype,"slice",[t,e,n]);if(!n&&r!==this){var i=this,u=i.length;r.toVector=function(){return se(i,0>t?Math.max(0,u+t):u?Math.min(u,t):t,null==e?u:0>e?Math.max(0,u+e):u?Math.min(u,e):e)}}return r},keys:function(t){return new vn(this,0,t)},values:function(t){return new vn(this,1,t)},entries:function(t){return new vn(this,2,t)},__iterator:function(t,e,n){return new vn(this,2,n,t,e)},__iterate:function(t,e,n){var r=this,i=0,u=r.length-1;n^=e;var s,a=function(e,s){return t(e,n?u-s:s,r)===!1?!1:(i=s,!0)},o=he(this._size);return s=e?$(this._tail,0,o-this._origin,this._size-this._origin,a,e)&&$(this._root,this._level,-this._origin,o-this._origin,a,e):$(this._root,this._level,-this._origin,o-this._origin,a,e)&&$(this._tail,0,o-this._origin,this._size-this._origin,a,e),(s?u:e?u-i:i)+1 <del>},__deepEquals:function(t){var e=this.entries(!0);return t.every(function(t,n){var r=e.next().value;return r&&r[0]===n&&W(r[1],t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?ee(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return gn||(gn=ee(0,0,de))},from:function(t){if(!t||0===t.length)return cn.empty();if(t.constructor===cn)return t;var e=Array.isArray(t);return t.length>0&&we>t.length?ee(0,t.length,de,null,new ln(e?s(t):Re(t).toArray())):(e||(t=Re(t),t instanceof Je||(t=t.valueSeq())),cn.empty().merge(t))}},Je);var fn=hn.prototype;fn[De]=fn.remove,fn[qe]=fn.values,fn.update=Te.update,fn.updateIn=Te.updateIn,fn.cursor=Te.cursor,fn.withMutations=Te.withMutations,fn.asMutable=Te.asMutable,fn.asImmutable=Te.asImmutable,fn.wasAltered=Te.wasAltered;var ln=function(t,e){this.array=t,this.ownerID=e},_n=ln;ye.createClass(ln,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n>>>e&Ie;if(r>=this.array.length)return new _n([],t);var i,u=0===r;if(e>0){var s=this.array[r];if(i=s&&s.removeBefore(t,e-de,n),i===s&&u)return this}if(u&&!i)return this;var a=ie(this,t);if(!u)for(var o=0;r>o;o++)delete a.array[o];return i&&(a.array[r]=i),a},removeAfter:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n-1>>>e&Ie;if(r>=this.array.length)return this;var i,u=r===this.array.length-1;if(e>0){var s=this.array[r];if(i=s&&s.removeAfter(t,e-de,n),i===s&&u)return this}if(u&&!i)return this;var a=ie(this,t);return u||(a.array.length=r+1),i&&(a.array[r]=i),a}},{});var vn=function(t,e,n,r,i){this._type=e,this._sparse=!!n,this._reverse=!!r,this._flipIndices=!!(i^r),this._maxIndex=t.length-1;var u=he(t._size),s=te(t._root&&t._root.array,t._level,-t._origin,u-t._origin-1),a=te(t._tail&&t._tail.array,0,u-t._origin,t._size-t._origin-1);this._stack=r?a:s,this._stack.__prev=r?s:a};ye.createClass(vn,{next:function(){for(var t=this._sparse,e=this._stack;e;){var n=e.array,r=e.index++;if(this._reverse&&(r=Ie-r,r>e.rawMax&&(r=e.rawMax,e.index=we-r)),r>=0&&we>r&&e.rawMax>=r){var i=n&&n[r]; <add>function t(){function t(t,e,n,r){var i;if(r){var u=r.prototype;i=me.create(u)}else i=t.prototype;return me.keys(e).forEach(function(t){i[t]=e[t]}),me.keys(n).forEach(function(e){t[e]=n[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,n,r){return me.getPrototypeOf(e)[n].apply(t,r)}function n(t,n,r){e(t,n,"constructor",r)}function r(t){return t.value=!1,t}function i(t){t&&(t.value=!0)}function u(){}function s(t){for(var e=t.length,n=Array(e),r=0;e>r;r++)n[r]=t[r];return n}function a(t){return Me.value=t,Me.done=!1,Me}function o(){return Me.value=void 0,Me.done=!0,Me}function h(t,e){if(!t)throw Error(e)}function c(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&Oe;t=""+t,e="string"}return"string"===e?t.length>Ee?f(t):l(t):t.hashCode?c("function"==typeof t.hashCode?t.hashCode():t.hashCode):_(t)}function f(t){var e=We[t];return null==e&&(e=l(t),Pe===je&&(Pe=0,We={}),Pe++,We[t]=e),e}function l(t){for(var e=0,n=0;t.length>n;n++)e=31*e+t.charCodeAt(n)&Oe;return e}function _(t){if(t[Ae])return t[Ae];var e=++xe&Oe;if(!Ce)try{return Object.defineProperty(t,Ae,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}catch(n){Ce=!0}return t[Ae]=e,e}function v(){return Object.create(ze)}function g(t){var e=Object.create(Le);return e.__reversedIndices=t?t.__reversedIndices:!1,e}function p(t,e,n,r){var i=t.get?t.get(e[r],Ie):Ie;return i===Ie?n:++r===e.length?i:p(i,e,n,r)}function m(t,e,n){return(0===t||null!=n&&-n>=t)&&(null==e||null!=n&&e>=n)}function y(t,e){return 0>t?Math.max(0,e+t):e?Math.min(e,t):t}function d(t,e){return null==t?e:0>t?Math.max(0,e+t):e?Math.min(e,t):t}function w(t){return t}function S(t,e){return[e,t]}function I(){return!0}function k(){return this}function b(t){return(t||0)+1}function M(t,e,n,r,i){var u=t.__makeSequence();return u.__iterateUncached=function(u,s,a){var o=0,h=t.__iterate(function(t,i,s){if(e.call(n,t,i,s)){if(u(t,r?i:o,s)===!1)return!1;o++}},s,a);return i?h:o},u}function D(t){return function(){return!t.apply(this,arguments)}}function q(t){return"string"==typeof t?JSON.stringify(t):t <add>}function O(t,e){for(var n="";e;)1&e&&(n+=t),(e>>=1)&&(t+=t);return n}function x(t,e){return t>e?1:e>t?-1:0}function A(t){h(1/0!==t,"Cannot perform this action with an infinite sequence.")}function C(t,e){var n=new Ne;return n.next=function(){var n=t.next();return n.done?n:(n.value=e(n.value),n)},n}function E(t,e,n){return n instanceof Re?j(t,e,n):n}function j(t,e,n){return new Ge(t._rootData,t._keyPath.concat(e),t._onChange,n)}function P(t,e,n){var r=t._rootData.updateIn(t._keyPath,n?He.empty():void 0,e),i=t._keyPath||[];return t._onChange&&t._onChange.call(void 0,r,t._rootData,n?i.concat(n):i),new Ge(r,t._keyPath,t._onChange)}function W(t,e){return t instanceof Ge&&(t=t.deref()),e instanceof Ge&&(e=e.deref()),t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t instanceof Re?t.equals(e):!1}function R(t,e){return a(0===t||1===t?e[t]:[e[0],e[1]])}function U(t,e){return{node:t,index:0,__prev:e}}function z(t,e,n,r){var i=Object.create(Te);return i.length=t,i._root=e,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function J(t,e,n){var i=r(ke),u=r(be),s=B(t._root,t.__ownerID,0,c(e),e,n,i,u);if(!u.value)return t;var a=t.length+(i.value?n===Ie?-1:1:0);return t.__ownerID?(t.length=a,t._root=s,t.__hash=void 0,t.__altered=!0,t):s?z(a,s):He.empty()}function B(t,e,n,r,u,s,a,o){return t?t.update(e,n,r,u,s,a,o):s===Ie?t:(i(o),i(a),new nn(e,r,[u,s]))}function L(t){return t.constructor===nn||t.constructor===tn}function V(t,e,n,r,i){if(t.hash===r)return new tn(e,r,[t.entry,i]);var u,s=t.hash>>>n&Se,a=r>>>n&Se,o=s===a?[V(t,e,n+de,r,i)]:(u=new nn(e,r,i),a>s?[t,u]:[u,t]);return new Xe(e,1<<s|1<<a,o)}function K(t,e,n,r){for(var i=0,u=0,s=Array(n),a=0,o=1,h=e.length;h>a;a++,o<<=1){var c=e[a];null!=c&&a!==r&&(i|=o,s[u++]=c)}return new Xe(t,i,s)}function N(t,e,n,r,i){for(var u=0,s=Array(we),a=0;0!==n;a++,n>>>=1)s[a]=1&n?e[u++]:null;return s[r]=i,new Ze(t,u+1,s)}function F(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Array.isArray(u)?Re(u).fromEntrySeq():Re(u))}return H(t,e,r)}function G(t){return function(e,n){return e&&e.mergeDeepWith?e.mergeDeepWith(t,n):t?t(e,n):n <add>}}function H(t,e,n){return 0===n.length?t:t.withMutations(function(t){for(var r=e?function(n,r){var i=t.get(r,Ie);t.set(r,i===Ie?n:e(i,n))}:function(e,n){t.set(n,e)},i=0;n.length>i;i++)n[i].forEach(r)})}function Q(t,e,n,r,i){var u=e.length;if(i===u)return r(t);h(t.set,"updateIn with invalid keyPath");var s=i===u-1?n:He.empty(),a=e[i],o=t.get(a,s),c=Q(o,e,n,r,i+1);return c===o?t:t.set(a,c)}function T(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 X(t,e,n,r){var i=r?t:s(t);return i[e]=n,i}function Y(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(var u=Array(i),s=0,a=0;i>a;a++)a===e?(u[a]=n,s=-1):u[a]=t[a+s];return u}function Z(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var i=Array(r),u=0,s=0;r>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function $(t,e,n,r,i,u){if(t){var s,a=t.array,o=a.length-1;if(0===e)for(s=0;o>=s;s++){var h=u?o-s:s;if(a.hasOwnProperty(h)){var c=h+n;if(c>=0&&r>c&&i(a[h],c)===!1)return!1}}else{var f=1<<e,l=e-de;for(s=0;o>=s;s++){var _=u?o-s:s,v=n+_*f;if(r>v&&v+f>0){var g=a[_];if(g&&!$(g,l,v,r,i,u))return!1}}}}return!0}function te(t,e,n,r,i){return{array:t,level:e,offset:n,max:r,rawMax:r-n>>e,index:0,__prev:i}}function ee(t,e,n,r,i,u,s){var a=Object.create(fn);return a.length=e-t,a._origin=t,a._size=e,a._level=n,a._root=r,a._tail=i,a.__ownerID=u,a.__hash=s,a.__altered=!1,a}function ne(t,e,n){if(e>=t.length)return n===Ie?t:t.withMutations(function(t){se(t,0,e+1).set(e,n)});e=oe(e,t._origin);var i=t._tail,u=t._root,s=r(be);return e>=he(t._size)?i=re(i,t.__ownerID,0,e,n,s):u=re(u,t.__ownerID,t._level,e,n,s),s.value?t.__ownerID?(t._root=u,t._tail=i,t.__hash=void 0,t.__altered=!0,t):ee(t._origin,t._size,t._level,u,i):t}function re(t,e,n,r,u,s){var a,o=u===Ie,h=r>>>n&Se,c=t&&t.array.length>h&&t.array.hasOwnProperty(h);if(o&&!c)return t;if(n>0){var f=t&&t.array[h],l=re(f,e,n-de,r,u,s);return l===f?t:(a=ie(t,e),a.array[h]=l,a)}return!o&&c&&t.array[h]===u?t:(i(s),a=ie(t,e),o?delete a.array[h]:a.array[h]=u,a)}function ie(t,e){return e&&t&&e===t.ownerID?t:new ln(t?t.array.slice():[],e) <add>}function ue(t,e){if(e>=he(t._size))return t._tail;if(1<<t._level+de>e){for(var n=t._root,r=t._level;n&&r>0;)n=n.array[e>>>r&Se],r-=de;return n}}function se(t,e,n){var r=t.__ownerID||new u,i=t._origin,s=t._size,a=i+e,o=null==n?s:0>n?s+n:i+n;if(a===i&&o===s)return t;if(a>=o)return t.clear();for(var h=t._level,c=t._root,f=0;0>a+f;)c=new ln(c&&c.array.length?[null,c]:[],r),h+=de,f+=1<<h;f&&(a+=f,i+=f,o+=f,s+=f);for(var l=he(s),_=he(o);_>=1<<h+de;)c=new ln(c&&c.array.length?[c]:[],r),h+=de;var v=t._tail,g=l>_?ue(t,o-1):_>l?new ln([],r):v;if(v&&_>l&&s>a&&v.array.length){c=ie(c,r);for(var p=c,m=h;m>de;m-=de){var y=l>>>m&Se;p=p.array[y]=ie(p.array[y],r)}p.array[l>>>de&Se]=v}if(s>o&&(g=g&&g.removeAfter(r,0,o)),a>=_)a-=_,o-=_,h=de,c=null,g=g&&g.removeBefore(r,0,a);else if(a>i||l>_){var d,w;f=0;do d=a>>>h&Se,w=_-1>>>h&Se,d===w&&(d&&(f+=(1<<h)*d),h-=de,c=c&&c.array[d]);while(c&&d===w);c&&a>i&&(c=c&&c.removeBefore(r,h,a-f)),c&&l>_&&(c=c&&c.removeAfter(r,h,_-f)),f&&(a-=f,o-=f)}return t.__ownerID?(t.length=o-a,t._origin=a,t._size=o,t._level=h,t._root=c,t._tail=g,t.__hash=void 0,t.__altered=!0,t):ee(a,o,h,c,g)}function ae(t,e,n){for(var r=[],i=0;n.length>i;i++){var u=n[i];u&&r.push(Re(u))}var s=Math.max.apply(null,r.map(function(t){return t.length||0}));return s>t.length&&(t=t.setLength(s)),H(t,e,r)}function oe(t,e){return h(t>=0,"Index out of bounds"),t+e}function he(t){return we>t?0:t-1>>>de<<de}function ce(t,e){var n=Object.create(yn);return n.length=t?t.length:0,n._map=t,n.__ownerID=e,n}function fe(t,e,n,r){var i=Object.create(wn.prototype);return i.length=t?t.length:0,i._map=t,i._vector=e,i.__ownerID=n,i.__hash=r,i}function le(t,e,n){var r=t._map,i=t._vector,u=r.get(e),s=void 0!==u,a=n===Ie;if(!s&&a||s&&n===i.get(u)[1])return t;s||(u=i.length);var o=a?r.remove(e):s?r:r.set(e,u),h=a?i.remove(u):i.set(u,[e,n]);return t.__ownerID?(t.length=o.length,t._map=o,t._vector=h,t.__hash=void 0,t):fe(o,h)}function _e(t,e,n){var r=Object.create(Object.getPrototypeOf(t));return r._map=e,r.__ownerID=n,r}function ve(t,e){return e?ge(e,t,"",{"":t}):pe(t) <add>}function ge(t,e,n,r){return e&&(Array.isArray(e)||e.constructor===Object)?t.call(r,n,Re(e).map(function(n,r){return ge(t,n,r,e)})):e}function pe(t){if(t){if(Array.isArray(t))return Re(t).map(pe).toVector();if(t.constructor===Object)return Re(t).map(pe).toMap()}return t}var me=Object,ye={};ye.createClass=t,ye.superCall=e,ye.defaultSuperCall=n;var de=5,we=1<<de,Se=we-1,Ie={},ke={value:!1},be={value:!1},Me={value:void 0,done:!1},De="delete",qe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Oe=2147483647,xe=0,Ae="__immutablehash__";"undefined"!=typeof Symbol&&(Ae=Symbol(Ae));var Ce=!1,Ee=16,je=255,Pe=0,We={},Re=function(t){return Ue.from(1===arguments.length?t:Array.prototype.slice.call(arguments))},Ue=Re;ye.createClass(Re,{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+": "+q(t)},toJS:function(){return this.map(function(t){return t instanceof Ue?t.toJS():t}).__toJS()},toArray:function(){A(this.length);var t=Array(this.length||0);return this.valueSeq().forEach(function(e,n){t[n]=e}),t},toObject:function(){A(this.length);var t={};return this.forEach(function(e,n){t[n]=e}),t},toVector:function(){return A(this.length),hn.from(this)},toMap:function(){return A(this.length),He.from(this)},toOrderedMap:function(){return A(this.length),wn.from(this)},toSet:function(){return A(this.length),pn.from(this)},hashCode:function(){return this.__hash||(this.__hash=1/0===this.length?0:this.reduce(function(t,e,n){return t+(c(e)^(e===n?0:c(n)))&Oe},0))},equals:function(t){if(this===t)return!0;if(!(t instanceof Ue))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)},__deepEquals:function(t){var e=this.cacheResult().entrySeq().toArray(),n=0;return t.every(function(t,r){var i=e[n++];return W(r,i[0])&&W(t,i[1])})},join:function(t){t=t||","; <add>var e="",n=!0;return this.forEach(function(r){n?(n=!1,e+=r):e+=t+r}),e},count:function(t,e){return t?this.filter(t,e).count():(null==this.length&&(this.length=this.forEach(I)),this.length)},countBy:function(t){var e=this;return wn.empty().withMutations(function(n){e.forEach(function(e,r,i){n.update(t(e,r,i),b)})})},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t.map(function(t){return Ue(t)})),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e){for(var r,i=0,u=n.length-1,s=0;u>=s&&!r;s++){var a=n[e?u-s:s];i+=a.__iterate(function(e,n,i){return t(e,n,i)===!1?(r=!0,!1):void 0},e)}return i},r},reverse:function(){var t=this,e=t.__makeSequence();return e.length=t.length,e.__iterateUncached=function(e,n){return t.__iterate(e,!n)},e.reverse=function(){return t},e},keySeq:function(){return this.flip().valueSeq()},valueSeq:function(){var t=this,e=g(t);return e.length=t.length,e.valueSeq=k,e.__iterateUncached=function(e,n,r){if(r&&null==this.length)return this.cacheResult().__iterate(e,n,r);var i,u=0;return r?(u=this.length-1,i=function(t,n,r){return e(t,u--,r)!==!1}):i=function(t,n,r){return e(t,u++,r)!==!1},t.__iterate(i,n),r?this.length:u},e},entrySeq:function(){var t=this;if(t._cache)return Ue(t._cache);var e=t.map(S).valueSeq();return e.fromEntries=function(){return t},e},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},reduce:function(t,e,n){var r=e;return this.forEach(function(e,i,u){r=t.call(n,r,e,i,u)}),r},reduceRight:function(t,e,n){return this.reverse(!0).reduce(t,e,n)},every:function(t,e){var n=!0;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?void 0:(n=!1,!1)}),n},some:function(t,e){return!this.every(D(t),e)},first:function(){return this.find(I)},last:function(){return this.findLast(I)},rest:function(){return this.slice(1)},butLast:function(){return this.slice(0,-1)},has:function(t){return this.get(t,Ie)!==Ie},get:function(t,e){return this.find(function(e,n){return W(n,t) <add>},null,e)},getIn:function(t,e){return t&&0!==t.length?p(this,t,e,0):this},contains:function(t){return this.find(function(e){return W(e,t)},null,Ie)!==Ie},find:function(t,e,n){var r=n;return this.forEach(function(n,i,u){return t.call(e,n,i,u)?(r=n,!1):void 0}),r},findKey:function(t,e){var n;return this.forEach(function(r,i,u){return t.call(e,r,i,u)?(n=i,!1):void 0}),n},findLast:function(t,e,n){return this.reverse(!0).find(t,e,n)},findLastKey:function(t,e){return this.reverse(!0).findKey(t,e)},flip:function(){var t=this,e=v();return e.length=t.length,e.flip=function(){return t},e.__iterateUncached=function(e,n){return t.__iterate(function(t,n,r){return e(n,t,r)!==!1},n)},e},map:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){return n.__iterate(function(n,i,u){return r(t.call(e,n,i,u),i,u)!==!1},i)},r},mapKeys:function(t,e){var n=this,r=n.__makeSequence();return r.length=n.length,r.__iterateUncached=function(r,i){return n.__iterate(function(n,i,u){return r(n,t.call(e,i,n,u),u)!==!1},i)},r},filter:function(t,e){return M(this,t,e,!0,!1)},slice:function(t,e){if(m(t,e,this.length))return this;var n=y(t,this.length),r=d(e,this.length);if(n!==n||r!==r)return this.entrySeq().slice(t,e).fromEntrySeq();var i=0===n?this:this.skip(n);return null==r||r===this.length?i:i.take(r-n)},take:function(t){var e=0,n=this.takeWhile(function(){return e++<t});return n.length=this.length&&Math.min(this.length,t),n},takeLast:function(t,e){return this.reverse(e).take(t).reverse(e)},takeWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){if(i)return this.cacheResult().__iterate(r,i,u);var s=0;return n.__iterate(function(n,i,u){return t.call(e,n,i,u)&&r(n,i,u)!==!1?void s++:!1},i,u),s},r},takeUntil:function(t,e,n){return this.takeWhile(D(t),e,n)},skip:function(t,e){if(0===t)return this;var n=0,r=this.skipWhile(function(){return n++<t},null,e);return r.length=this.length&&Math.max(0,this.length-t),r},skipLast:function(t,e){return this.reverse(e).skip(t).reverse(e) <add>},skipWhile:function(t,e){var n=this,r=n.__makeSequence();return r.__iterateUncached=function(r,i,u){if(i)return this.cacheResult().__iterate(r,i,u);var s=!0,a=0;return n.__iterate(function(n,i,u){if(!s||!(s=t.call(e,n,i,u))){if(r(n,i,u)===!1)return!1;a++}},i,u),a},r},skipUntil:function(t,e,n){return this.skipWhile(D(t),e,n)},groupBy:function(t){var e=this,n=wn.empty().withMutations(function(n){e.forEach(function(e,r,i){var u=t(e,r,i),s=n.get(u,Ie);s===Ie&&(s=[],n.set(u,s)),s.push([r,e])})});return n.map(function(t){return Ue(t).fromEntrySeq()})},sort:function(t,e){return this.sortBy(w,t,e)},sortBy:function(t,e){e=e||x;var n=this;return Ue(this.entrySeq().entrySeq().toArray().sort(function(r,i){return e(t(r[1][1],r[1][0],n),t(i[1][1],i[1][0],n))||r[0]-i[0]})).fromEntrySeq().valueSeq().fromEntrySeq()},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(A(this.length),this._cache=this.entrySeq().toArray(),null==this.length&&(this.length=this._cache.length)),this},__iterate:function(t,e,n){if(!this._cache)return this.__iterateUncached(t,e,n);var r=this.length-1,i=this._cache,u=this;if(e)for(var s=i.length-1;s>=0;s--){var a=i[s];if(t(a[1],n?a[0]:r-a[0],u)===!1)break}else i.every(n?function(e){return t(e[1],r-e[0],u)!==!1}:function(e){return t(e[1],e[0],u)!==!1});return this.length},__makeSequence:function(){return v()}},{from:function(t){if(t instanceof Ue)return t;if(!Array.isArray(t)){if(t&&t.constructor===Object)return new Ve(t);t=[t]}return new Ke(t)}});var ze=Re.prototype;ze.toJSON=ze.toJS,ze.__toJS=ze.toObject,ze.inspect=ze.toSource=function(){return""+this};var Je=function(){ye.defaultSuperCall(this,Be.prototype,arguments)},Be=Je;ye.createClass(Je,{toString:function(){return this.__toString("Seq [","]")},toArray:function(){A(this.length);var t=Array(this.length||0);return t.length=this.forEach(function(e,n){t[n]=e}),t},fromEntrySeq:function(){var t=this,e=v();return e.length=t.length,e.entrySeq=function(){return t},e.__iterateUncached=function(e,n,r){return t.__iterate(function(t,n,r){return e(t[1],t[0],r) <add>},n,r)},e},join:function(t){t=t||",";var e="",n=0;return this.forEach(function(r,i){var u=i-n;n=i,e+=(1===u?t:O(t,u))+r}),this.length&&this.length-1>n&&(e+=O(t,this.length-1-n)),e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=[this].concat(t).map(function(t){return Re(t)}),r=this.__makeSequence();return r.length=n.reduce(function(t,e){return null!=t&&null!=e.length?t+e.length:void 0},0),r.__iterateUncached=function(t,e,r){if(r&&!this.length)return this.cacheResult().__iterate(t,e,r);for(var i,u=0,s=r&&this.length-1,a=n.length-1,o=0;a>=o&&!i;o++){var h=n[e?a-o:o];h instanceof Be||(h=h.valueSeq()),u+=h.__iterate(function(e,n,a){return n+=u,t(e,r?s-n:n,a)===!1?(i=!0,!1):void 0},e)}return u},r},reverse:function(t){var e=this,n=e.__makeSequence();return n.length=e.length,n.__reversedIndices=!!(t^e.__reversedIndices),n.__iterateUncached=function(n,r,i){return e.__iterate(n,!r,i^t)},n.reverse=function(n){return t===n?e:Le.reverse.call(this,n)},n},valueSeq:function(){var t=ye.superCall(this,Be.prototype,"valueSeq",[]);return t.length=void 0,t},filter:function(t,e,n){var r=M(this,t,e,n,n);return n&&(r.length=this.length),r},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 n=this.findKey(t,e);return null==n?-1:n},findLastIndex:function(t,e){return this.reverse(!0).findIndex(t,e)},slice:function(t,e,n){var r=this;if(m(t,e,r.length))return r;var i=r.__makeSequence(),u=y(t,r.length),s=d(e,r.length);return i.length=r.length&&(n?r.length:s-u),i.__reversedIndices=r.__reversedIndices,i.__iterateUncached=function(i,a,o){if(a)return this.cacheResult().__iterate(i,a,o);var h=this.__reversedIndices^o;if(u!==u||s!==s||h&&null==r.length){var c=r.count();u=y(t,c),s=d(e,c)}var f=h?r.length-s:u,l=h?r.length-u:s,_=r.__iterate(function(t,e,r){return h?null!=l&&e>=l||e>=f&&i(t,n?e:e-f,r)!==!1:f>e||(null==l||l>e)&&i(t,n?e:e-f,r)!==!1},a,o);return null!=this.length?this.length:n?_:Math.max(0,_-f)},i},splice:function(t,e){for(var n=[],r=2;arguments.length>r;r++)n[r-2]=arguments[r]; <add>return 0===e&&0===n.length?this:this.slice(0,t).concat(n,this.slice(t+e))},takeWhile:function(t,e,n){var r=this,i=r.__makeSequence();return i.__iterateUncached=function(u,s,a){if(s)return this.cacheResult().__iterate(u,s,a);var o=0,h=!0,c=r.__iterate(function(n,r,i){return t.call(e,n,r,i)&&u(n,r,i)!==!1?void(o=r):(h=!1,!1)},s,a);return n?i.length:h?c:o+1},n&&(i.length=this.length),i},skipWhile:function(t,e,n){var r=this,i=r.__makeSequence();return n&&(i.length=this.length),i.__iterateUncached=function(i,u,s){if(u)return this.cacheResult().__iterate(i,u,s);var a=r.__reversedIndices^s,o=!0,h=0,c=r.__iterate(function(r,u,a){return o&&(o=t.call(e,r,u,a),o||(h=u)),o||i(r,s||n?u:u-h,a)!==!1},u,s);return n?c:a?h+1:c-h},i},groupBy:function(t,e,n){var r=this,i=wn.empty().withMutations(function(e){r.forEach(function(i,u,s){var a=t(i,u,s),o=e.get(a,Ie);o===Ie&&(o=Array(n?r.length:0),e.set(a,o)),n?o[u]=i:o.push(i)})});return i.map(function(t){return Re(t)})},sortBy:function(t,e,n){var r=ye.superCall(this,Be.prototype,"sortBy",[t,e]);return n||(r=r.valueSeq()),r.length=this.length,r},__makeSequence:function(){return g(this)}},{},Re);var Le=Je.prototype;Le.__toJS=Le.toArray,Le.__toStringMapper=q;var Ve=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.length=e.length};ye.createClass(Ve,{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 n=this._object,r=this._keys,i=r.length-1,u=0;i>=u;u++){var s=e?i-u:u;if(t(n[r[s]],r[s],n)===!1)break}return u}},{},Re);var Ke=function(t){this._array=t,this.length=t.length};ye.createClass(Ke,{toArray:function(){return this._array},__iterate:function(t,e,n){var r=this._array,i=r.length-1,u=-1;if(e){for(var s=i;s>=0;s--){if(r.hasOwnProperty(s)&&t(r[s],n?s:i-s,r)===!1)return u+1;u=s}return r.length}var a=r.every(function(e,s){return t(e,n?i-s:s,r)===!1?!1:(u=s,!0)});return a?r.length:u+1}},{},Je),Ke.prototype.get=Ve.prototype.get,Ke.prototype.has=Ve.prototype.has; <add>var Ne=function(){};ye.createClass(Ne,{toString:function(){return"[Iterator]"}},{});var Fe=Ne.prototype;Fe[qe]=k,Fe.inspect=Fe.toSource=function(){return""+this};var Ge=function(t,e,n,r){r=r?r:t.getIn(e),this.length=r instanceof Re?r.length:null,this._rootData=t,this._keyPath=e,this._onChange=n};ye.createClass(Ge,{deref:function(t){return this._rootData.getIn(this._keyPath,t)},get:function(t,e){if(Array.isArray(t)&&0===t.length)return this;var n=this._rootData.getIn(this._keyPath.concat(t),Ie);return n===Ie?e:E(this,t,n)},set:function(t,e){return P(this,function(n){return n.set(t,e)},t)},remove:function(t){return P(this,function(e){return e.remove(t)},t)},clear:function(){return P(this,function(t){return t.clear()})},update:function(t,e,n){return 1===arguments.length?P(this,t):P(this,function(r){return r.update(t,e,n)},t)},cursor:function(t){return Array.isArray(t)&&0===t.length?this:j(this,t)},__iterate:function(t,e,n){var r=this,i=r.deref();return i&&i.__iterate?i.__iterate(function(e,n,i){return t(E(r,n,e),n,i)},e,n):0}},{},Re),Ge.prototype[De]=Ge.prototype.remove,Ge.prototype.getIn=Ge.prototype.get;var He=function(t){var e=Qe.empty();return t?t.constructor===Qe?t:e.merge(t):e},Qe=He;ye.createClass(He,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,c(t),t,e):e},set:function(t,e){return J(this,t,e)},remove:function(t){return J(this,t,Ie)},update:function(t,e,n){return 1===arguments.length?this.updateIn([],null,t):this.updateIn([t],e,n)},updateIn:function(t,e,n){var r;return n||(r=[e,n],n=r[0],e=r[1],r),Q(this,t,e,n,0)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qe.empty()},merge:function(){return F(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return F(this,t,e)},mergeDeep:function(){return F(this,G(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return F(this,G(t),e) <add>},cursor:function(t,e){return e||"function"!=typeof t?0===arguments.length?t=[]:Array.isArray(t)||(t=[t]):(e=t,t=[]),new Ge(this,t,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 u)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},keys:function(){return new un(this,0)},values:function(){return new un(this,1)},entries:function(){return new un(this,2)},__iterator:function(t){return new un(this,2,t)},__iterate:function(t,e){var n=this;if(!n._root)return 0;var r=0;return this._root.iterate(function(e){return t(e[1],e[0],n)===!1?!1:void r++},e),r},__deepEqual:function(t){var e=this;return t.every(function(t,n){return W(e.get(n,Ie),t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?z(this.length,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{empty:function(){return sn||(sn=z(0))}},Re);var Te=He.prototype;Te[De]=Te.remove,Te[qe]=function(){return this.entries()},He.from=He;var Xe=function(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n},Ye=Xe;ye.createClass(Xe,{get:function(t,e,n,r){var i=1<<(e>>>t&Se),u=this.bitmap;return 0===(u&i)?r:this.nodes[T(u&i-1)].get(t+de,e,n,r)},update:function(t,e,n,r,i,u,s){var a=n>>>e&Se,o=1<<a,h=this.bitmap,c=0!==(h&o);if(!c&&i===Ie)return this;var f=T(h&o-1),l=this.nodes,_=c?l[f]:null,v=B(_,t,e+de,n,r,i,u,s);if(v===_)return this;if(!c&&v&&l.length>=an)return N(t,l,h,a,v);if(c&&!v&&2===l.length&&L(l[1^f]))return l[1^f];if(c&&v&&1===l.length&&L(v))return v;var g=t&&t===this.ownerID,p=c?v?h:h^o:h|o,m=c?v?X(l,f,v,g):Z(l,f,g):Y(l,f,v,g);return g?(this.bitmap=p,this.nodes=m,this):new Ye(t,p,m)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++)if(n[e?i-r:r].iterate(t,e)===!1)return!1}},{});var Ze=function(t,e,n){this.ownerID=t,this.count=e,this.nodes=n},$e=Ze;ye.createClass(Ze,{get:function(t,e,n,r){var i=e>>>t&Se,u=this.nodes[i];return u?u.get(t+de,e,n,r):r <add>},update:function(t,e,n,r,i,u,s){var a=n>>>e&Se,o=i===Ie,h=this.nodes,c=h[a];if(o&&!c)return this;var f=B(c,t,e+de,n,r,i,u,s);if(f===c)return this;var l=this.count;if(c){if(!f&&(l--,on>l))return K(t,h,l,a)}else l++;var _=t&&t===this.ownerID,v=X(h,a,f,_);return _?(this.count=l,this.nodes=v,this):new $e(t,l,v)},iterate:function(t,e){for(var n=this.nodes,r=0,i=n.length-1;i>=r;r++){var u=n[e?i-r:r];if(u&&u.iterate(t,e)===!1)return!1}}},{});var tn=function(t,e,n){this.ownerID=t,this.hash=e,this.entries=n},en=tn;ye.createClass(tn,{get:function(t,e,n,r){for(var i=this.entries,u=0,s=i.length;s>u;u++)if(W(n,i[u][0]))return i[u][1];return r},update:function(t,e,n,r,u,a,o){var h=u===Ie;if(n!==this.hash)return h?this:(i(o),i(a),V(this,t,e,n,[r,u]));for(var c=this.entries,f=0,l=c.length;l>f&&!W(r,c[f][0]);f++);var _=l>f;if(h&&!_)return this;if(i(o),(h||!_)&&i(a),h&&2===l)return new nn(t,this.hash,c[1^f]);var v=t&&t===this.ownerID,g=v?c:s(c);return _?h?f===l-1?g.pop():g[f]=g.pop():g[f]=[r,u]:g.push([r,u]),v?(this.entries=g,this):new en(t,this.hash,g)},iterate:function(t,e){for(var n=this.entries,r=0,i=n.length-1;i>=r;r++)if(t(n[e?i-r:r])===!1)return!1}},{});var nn=function(t,e,n){this.ownerID=t,this.hash=e,this.entry=n},rn=nn;ye.createClass(nn,{get:function(t,e,n,r){return W(n,this.entry[0])?this.entry[1]:r},update:function(t,e,n,r,u,s,a){var o=u===Ie,h=W(r,this.entry[0]);return(h?u===this.entry[1]:o)?this:(i(a),o?(i(s),null):h?t&&t===this.ownerID?(this.entry[1]=u,this):new rn(t,n,[r,u]):(i(s),V(this,t,e,n,[r,u])))},iterate:function(t){return t(this.entry)}},{});var un=function(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&U(t._root)};ye.createClass(un,{next:function(){for(var t=this._type,e=this._stack;e;){var n,r=e.node,i=e.index++;if(r.entry){if(0===i)return R(t,r.entry)}else if(r.entries){if(n=r.entries.length-1,n>=i)return R(t,r.entries[this._reverse?n-i:i])}else if(n=r.nodes.length-1,n>=i){var u=r.nodes[this._reverse?n-i:i];if(u){if(u.entry)return R(t,u.entry);e=this._stack=U(u,e)}continue}e=this._stack=this._stack.__prev <add>}return o()}},{},Ne);var sn,an=we/2,on=we/4,hn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return cn.from(t)},cn=hn;ye.createClass(hn,{toString:function(){return this.__toString("Vector [","]")},get:function(t,e){if(t=oe(t,this._origin),t>=this._size)return e;var n=ue(this,t),r=t&Se;return n&&(void 0===e||n.array.hasOwnProperty(r))?n.array[r]:e},first:function(){return this.get(0)},last:function(){return this.get(this.length?this.length-1:0)},set:function(t,e){return ne(this,t,e)},remove:function(t){return ne(this,t,Ie)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=this._origin=this._size=0,this._level=de,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):cn.empty()},push:function(){var t=arguments,e=this.length;return this.withMutations(function(n){se(n,0,e+t.length);for(var r=0;t.length>r;r++)n.set(e+r,t[r])})},pop:function(){return se(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){se(e,-t.length);for(var n=0;t.length>n;n++)e.set(n,t[n])})},shift:function(){return se(this,1)},merge:function(){return ae(this,null,arguments)},mergeWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return ae(this,t,e)},mergeDeep:function(){return ae(this,G(null),arguments)},mergeDeepWith:function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];return ae(this,G(t),e)},setLength:function(t){return se(this,0,t)},slice:function(t,e,n){var r=ye.superCall(this,cn.prototype,"slice",[t,e,n]);if(!n&&r!==this){var i=this,u=i.length;r.toVector=function(){return se(i,0>t?Math.max(0,u+t):u?Math.min(u,t):t,null==e?u:0>e?Math.max(0,u+e):u?Math.min(u,e):e)}}return r},keys:function(t){return new vn(this,0,t)},values:function(t){return new vn(this,1,t)},entries:function(t){return new vn(this,2,t)},__iterator:function(t,e,n){return new vn(this,2,n,t,e)},__iterate:function(t,e,n){var r=this,i=0,u=r.length-1;n^=e;var s,a=function(e,s){return t(e,n?u-s:s,r)===!1?!1:(i=s,!0)},o=he(this._size);return s=e?$(this._tail,0,o-this._origin,this._size-this._origin,a,e)&&$(this._root,this._level,-this._origin,o-this._origin,a,e):$(this._root,this._level,-this._origin,o-this._origin,a,e)&&$(this._tail,0,o-this._origin,this._size-this._origin,a,e),(s?u:e?u-i:i)+1 <add>},__deepEquals:function(t){var e=this.entries(!0);return t.every(function(t,n){var r=e.next().value;return r&&r[0]===n&&W(r[1],t)})},__ensureOwner:function(t){return t===this.__ownerID?this:t?ee(this._origin,this._size,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{empty:function(){return gn||(gn=ee(0,0,de))},from:function(t){if(!t||0===t.length)return cn.empty();if(t.constructor===cn)return t;var e=Array.isArray(t);return t.length>0&&we>t.length?ee(0,t.length,de,null,new ln(e?s(t):Re(t).toArray())):(e||(t=Re(t),t instanceof Je||(t=t.valueSeq())),cn.empty().merge(t))}},Je);var fn=hn.prototype;fn[De]=fn.remove,fn[qe]=fn.values,fn.update=Te.update,fn.updateIn=Te.updateIn,fn.cursor=Te.cursor,fn.withMutations=Te.withMutations,fn.asMutable=Te.asMutable,fn.asImmutable=Te.asImmutable,fn.wasAltered=Te.wasAltered;var ln=function(t,e){this.array=t,this.ownerID=e},_n=ln;ye.createClass(ln,{removeBefore:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n>>>e&Se;if(r>=this.array.length)return new _n([],t);var i,u=0===r;if(e>0){var s=this.array[r];if(i=s&&s.removeBefore(t,e-de,n),i===s&&u)return this}if(u&&!i)return this;var a=ie(this,t);if(!u)for(var o=0;r>o;o++)delete a.array[o];return i&&(a.array[r]=i),a},removeAfter:function(t,e,n){if(n===e?1<<e:0||0===this.array.length)return this;var r=n-1>>>e&Se;if(r>=this.array.length)return this;var i,u=r===this.array.length-1;if(e>0){var s=this.array[r];if(i=s&&s.removeAfter(t,e-de,n),i===s&&u)return this}if(u&&!i)return this;var a=ie(this,t);return u||(a.array.length=r+1),i&&(a.array[r]=i),a}},{});var vn=function(t,e,n,r,i){this._type=e,this._sparse=!!n,this._reverse=!!r,this._flipIndices=!!(i^r),this._maxIndex=t.length-1;var u=he(t._size),s=te(t._root&&t._root.array,t._level,-t._origin,u-t._origin-1),a=te(t._tail&&t._tail.array,0,u-t._origin,t._size-t._origin-1);this._stack=r?a:s,this._stack.__prev=r?s:a};ye.createClass(vn,{next:function(){for(var t=this._sparse,e=this._stack;e;){var n=e.array,r=e.index++;if(this._reverse&&(r=Se-r,r>e.rawMax&&(r=e.rawMax,e.index=we-r)),r>=0&&we>r&&e.rawMax>=r){var i=n&&n[r]; <ide> if(0===e.level){if(!t||null!=i||n&&n.length>r&&n.hasOwnProperty(r)){var u,s=this._type;return 1!==s&&(u=e.offset+(r<<e.level),this._flipIndices&&(u=this._maxIndex-u)),a(0===s?u:1===s?i:[u,i])}}else t&&null==i||(this._stack=e=te(i&&i.array,e.level-de,e.offset+(r<<e.level),e.max,e))}else e=this._stack=this._stack.__prev}return o()}},{},Ne);var gn,pn=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return mn.from(t)},mn=pn;ye.createClass(pn,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},get:function(t,e){return this.has(t)?t:e},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:ce(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?mn.empty():ce(e)},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this):mn.empty()},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var n=0;t.length>n;n++)Re(t[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 Re(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.every(function(t){return t.contains(n)})||e.remove(n)})})},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 Re(t)});var n=this;return this.withMutations(function(e){n.forEach(function(n){t.some(function(t){return t.contains(n)})&&e.remove(n)})})},isSubset:function(t){return t=Re(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){var e=this;return t=Re(t),t.every(function(t){return e.contains(t)})},wasAltered:function(){return this._map.wasAltered()},values:function(){return this._map.keys()},entries:function(){return C(this.values(),function(t){return[t,t] <del>})},hashCode:function(){return this._map.hashCode()},equals:function(t){return this._map.equals(t._map)},__iterate:function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?ce(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return dn||(dn=ce(He.empty()))},from:function(t){var e=mn.empty();return t?t.constructor===mn?t:e.union(t):e},fromKeys:function(t){return mn.from(Re(t).flip())}},Re);var yn=pn.prototype;yn[De]=yn.remove,yn[qe]=yn.keys=yn.values,yn.contains=yn.has,yn.mergeDeep=yn.merge=yn.union,yn.mergeDeepWith=yn.mergeWith=function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.merge.apply(this,t)},yn.withMutations=Te.withMutations,yn.asMutable=Te.asMutable,yn.asImmutable=Te.asImmutable,yn.__toJS=Le.__toJS,yn.__toStringMapper=Le.__toStringMapper;var dn,wn=function(t){var e=In.empty();return t?t.constructor===In?t:e.merge(t):e},In=wn;ye.createClass(wn,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var n=this._map.get(t);return null!=n?this._vector.get(n)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):In.empty()},set:function(t,e){return le(this,t,e)},remove:function(t){return le(this,t,Se)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered()},keys:function(){return C(this.entries(),function(t){return t[0]})},values:function(){return C(this.entries(),function(t){return t[1]})},entries:function(){return this._vector.values(!0)},__iterate:function(t,e){return this._vector.fromEntrySeq().__iterate(t,e)},__deepEqual:function(t){var e=this.entries();return t.every(function(t,n){var r=e.next().value;return r&&W(r[0],n)&&W(r[1],t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._vector.__ensureOwner(t);return t?fe(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=n,this) <del>}},{empty:function(){return Sn||(Sn=fe(He.empty(),hn.empty()))}},He),wn.from=wn,wn.prototype[De]=wn.prototype.remove;var Sn,kn=function(t,e){var n=function(t){this._map=He(t)};t=Re(t);var r=n.prototype=Object.create(Mn);r.constructor=n,r._name=e,r._defaultValues=t;var i=Object.keys(t);return n.prototype.length=i.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(n.prototype,e,{get:function(){return this.get(e)},set:function(t){h(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}),n},bn=kn;ye.createClass(kn,{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(){if(this.__ownerID)return this._map.clear(),this;Object.getPrototypeOf(this).constructor;return bn._empty||(bn._empty=_e(this,He.empty()))},set:function(t,e){if(null==t||!this.has(t))return this;var n=this._map.set(t,e);return this.__ownerID||n===this._map?this:_e(this,n)},remove:function(t){if(null==t||!this.has(t))return this;var e=this._map.remove(t);return this.__ownerID||e===this._map?this:_e(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()},__iterate:function(t,e){var n=this;return this._defaultValues.map(function(t,e){return n.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?_e(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},Re);var Mn=kn.prototype;Mn[De]=Mn.remove,Mn[qe]=Te[qe],Mn.merge=Te.merge,Mn.mergeWith=Te.mergeWith,Mn.mergeDeep=Te.mergeDeep,Mn.mergeDeepWith=Te.mergeDeepWith,Mn.update=Te.update,Mn.updateIn=Te.updateIn,Mn.cursor=Te.cursor,Mn.withMutations=Te.withMutations,Mn.asMutable=Te.asMutable,Mn.asImmutable=Te.asImmutable,Mn.__deepEqual=Te.__deepEqual;var Dn=function(t,e,n){return this instanceof qn?(h(0!==n,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&xn?xn:(n=null==n?1:Math.abs(n),t>e&&(n=-n),this._start=t,this._end=e,this._step=n,void(this.length=Math.max(0,Math.ceil((e-t)/n-1)+1)))):new qn(t,e,n) <add>})},hashCode:function(){return this._map.hashCode()},equals:function(t){return this._map.equals(t._map)},__iterate:function(t,e){var n=this;return this._map.__iterate(function(e,r){return t(r,r,n)},e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?ce(e,t):(this.__ownerID=t,this._map=e,this)}},{empty:function(){return dn||(dn=ce(He.empty()))},from:function(t){var e=mn.empty();return t?t.constructor===mn?t:e.union(t):e},fromKeys:function(t){return mn.from(Re(t).flip())}},Re);var yn=pn.prototype;yn[De]=yn.remove,yn[qe]=yn.keys=yn.values,yn.contains=yn.has,yn.mergeDeep=yn.merge=yn.union,yn.mergeDeepWith=yn.mergeWith=function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.merge.apply(this,t)},yn.withMutations=Te.withMutations,yn.asMutable=Te.asMutable,yn.asImmutable=Te.asImmutable,yn.__toJS=Le.__toJS,yn.__toStringMapper=Le.__toStringMapper;var dn,wn=function(t){var e=Sn.empty();return t?t.constructor===Sn?t:e.merge(t):e},Sn=wn;ye.createClass(wn,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var n=this._map.get(t);return null!=n?this._vector.get(n)[1]:e},clear:function(){return 0===this.length?this:this.__ownerID?(this.length=0,this._map.clear(),this._vector.clear(),this):Sn.empty()},set:function(t,e){return le(this,t,e)},remove:function(t){return le(this,t,Ie)},wasAltered:function(){return this._map.wasAltered()||this._vector.wasAltered()},keys:function(){return C(this.entries(),function(t){return t[0]})},values:function(){return C(this.entries(),function(t){return t[1]})},entries:function(){return this._vector.values(!0)},__iterate:function(t,e){return this._vector.fromEntrySeq().__iterate(t,e)},__deepEqual:function(t){var e=this.entries();return t.every(function(t,n){var r=e.next().value;return r&&W(r[0],n)&&W(r[1],t)})},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),n=this._vector.__ensureOwner(t);return t?fe(e,n,t,this.__hash):(this.__ownerID=t,this._map=e,this._vector=n,this) <add>}},{empty:function(){return In||(In=fe(He.empty(),hn.empty()))}},He),wn.from=wn,wn.prototype[De]=wn.prototype.remove;var In,kn=function(t,e){var n=function(t){this._map=He(t)};t=Re(t);var r=n.prototype=Object.create(Mn);r.constructor=n,r._name=e,r._defaultValues=t;var i=Object.keys(t);return n.prototype.length=i.length,Object.defineProperty&&t.forEach(function(t,e){Object.defineProperty(n.prototype,e,{get:function(){return this.get(e)},set:function(t){h(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}),n},bn=kn;ye.createClass(kn,{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(){if(this.__ownerID)return this._map.clear(),this;Object.getPrototypeOf(this).constructor;return bn._empty||(bn._empty=_e(this,He.empty()))},set:function(t,e){if(null==t||!this.has(t))return this;var n=this._map.set(t,e);return this.__ownerID||n===this._map?this:_e(this,n)},remove:function(t){if(null==t||!this.has(t))return this;var e=this._map.remove(t);return this.__ownerID||e===this._map?this:_e(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()},__iterate:function(t,e){var n=this;return this._defaultValues.map(function(t,e){return n.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?_e(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},Re);var Mn=kn.prototype;Mn[De]=Mn.remove,Mn[qe]=Te[qe],Mn.merge=Te.merge,Mn.mergeWith=Te.mergeWith,Mn.mergeDeep=Te.mergeDeep,Mn.mergeDeepWith=Te.mergeDeepWith,Mn.update=Te.update,Mn.updateIn=Te.updateIn,Mn.cursor=Te.cursor,Mn.withMutations=Te.withMutations,Mn.asMutable=Te.asMutable,Mn.asImmutable=Te.asImmutable,Mn.__deepEqual=Te.__deepEqual;var Dn=function(t,e,n){return this instanceof qn?(h(0!==n,"Cannot step a Range by 0"),t=t||0,null==e&&(e=1/0),t===e&&xn?xn:(n=null==n?1:Math.abs(n),t>e&&(n=-n),this._start=t,this._end=e,this._step=n,void(this.length=Math.max(0,Math.ceil((e-t)/n-1)+1)))):new qn(t,e,n) <ide> },qn=Dn;ye.createClass(Dn,{toString:function(){return 0===this.length?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},has:function(t){return h(t>=0,"Index out of bounds"),this.length>t},get:function(t,e){return h(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,n){return m(t,e,this.length)?this:n?ye.superCall(this,qn.prototype,"slice",[t,e,n]):(t=y(t,this.length),e=d(e,this.length),t>=e?xn:new qn(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 n=e/this._step;if(n>=0&&this.length>n)return n}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,t)},skip:function(t,e){return e?ye.superCall(this,qn.prototype,"skip",[t]):this.slice(t)},__iterate:function(t,e,n){for(var r=e^n,i=this.length-1,u=this._step,s=e?this._start+i*u:this._start,a=0;i>=a&&t(s,r?i-a:a,this)!==!1;a++)s+=e?-u:u;return r?this.length:a},__deepEquals:function(t){return this._start===t._start&&this._end===t._end&&this._step===t._step}},{},Je);var On=Dn.prototype;On.__toJS=On.toArray,On.first=fn.first,On.last=fn.last;var xn=Dn(0,0),An=function(t,e){return 0===e&&jn?jn:this instanceof Cn?(this._value=t,void(this.length=null==e?1/0:Math.max(0,e))):new Cn(t,e)},Cn=An;ye.createClass(An,{toString:function(){return 0===this.length?"Repeat []":"Repeat [ "+this._value+" "+this.length+" times ]"},get:function(t,e){return h(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)},slice:function(t,e,n){if(n)return ye.superCall(this,Cn.prototype,"slice",[t,e,n]);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 Cn(this._value,e-t):jn},reverse:function(t){return t?ye.superCall(this,Cn.prototype,"reverse",[t]):this <ide> },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,n){var r=e^n;h(!r||1/0>this.length,"Cannot access end of infinite range.");for(var i=this.length-1,u=0;i>=u&&t(this._value,r?i-u:u,this)!==!1;u++);return r?this.length:u},__deepEquals:function(t){return W(this._value,t._value)}},{},Je);var En=An.prototype;En.last=En.first,En.has=On.has,En.take=On.take,En.skip=On.skip,En.__toJS=On.__toJS;var jn=new An(void 0,0),Pn={Sequence:Re,Map:He,Vector:hn,Set:pn,OrderedMap:wn,Record:kn,Range:Dn,Repeat:An,is:W,fromJS:ve};return Pn}"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/Hash.js <ide> * of patent rights can be found in the PATENTS file in the same directory. <ide> */ <ide> <add>/* global Symbol */ <ide> /* exported hash, HASH_MAX_VAL */ <ide> <ide> function hash(o) { <ide> var HASH_MAX_VAL = 0x7FFFFFFF; // 2^31 - 1 is an efficiently stored int <ide> <ide> var UID_HASH_COUNT = 0; <ide> var UID_HASH_KEY = '__immutablehash__'; <add>if (typeof Symbol !== 'undefined') { <add> UID_HASH_KEY = Symbol(UID_HASH_KEY); <add>} <ide> var isIE8 = false; <ide> <ide> var STRING_HASH_CACHE_MIN_STRLEN = 16; <ide><path>src/Symbol.js <ide> /* exported DELETE, ITERATOR */ <ide> <ide> var DELETE = 'delete'; <del>var ITERATOR = typeof Symbol === 'undefined' ? '@@iterator' : Symbol.iterator; <add>var ITERATOR = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
4
PHP
PHP
add reverse assertion
9297ad762f2db3744db7ed7588dae844a282277f
<ide><path>tests/Database/DatabaseEloquentIntegrationTests.php <ide> public function testBasicHasManyEagerLoading() <ide> $user = EloquentTestUser::with('posts')->where('email', '[email protected]')->first(); <ide> <ide> $this->assertEquals('First Post', $user->posts->first()->name); <add> <add> $post = EloquentTestPost::with('user')->where('name', 'First Post')->get(); <add> $this->assertEquals('[email protected]', $post->first()->user->email); <ide> } <ide> <ide> /**
1
Java
Java
ignore blockhound tests on java 19
94da3609af8505ec98c7cb482eb7ad44327d9e4e
<ide><path>spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java <ide> * @author Sam Brannen <ide> * @since 5.2.4 <ide> */ <del>@DisabledOnJre(JRE.JAVA_18) // BlockHound is not compatible with JDK 18 yet <add>@DisabledOnJre(value= {JRE.JAVA_18, JRE.JAVA_19}, disabledReason = "BlockHound is not compatible with Java 18+") <ide> class SpringCoreBlockHoundIntegrationTests { <ide> <ide>
1
PHP
PHP
return null if undefined
54f6990d0cb5f33526ff9b47c48de74c389cc4a2
<ide><path>src/Mailer/Mailer.php <ide> public function offsetExists($offset) <ide> public function offsetGet($offset) <ide> { <ide> if (!$this->offsetExists($offset)) { <del> throw \Exception(); <add> return null; <ide> } <ide> <ide> if (isset($this->{$offset})) {
1
Go
Go
fix testrmi race condition
fef41ef7bf83ed04c7df8e0247e60c0d495eefdc
<ide><path>integration/server_test.go <ide> func TestRmi(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> <add> if _, err := srv.ContainerWait(containerID); err != nil { <add> t.Fatal(err) <add> } <add> <ide> imageID, err := srv.ContainerCommit(containerID, "test", "", "", "", nil) <ide> if err != nil { <ide> t.Fatal(err) <ide> func TestRmi(t *testing.T) { <ide> t.Fatal(err) <ide> } <ide> <add> if _, err := srv.ContainerWait(containerID); err != nil { <add> t.Fatal(err) <add> } <add> <ide> _, err = srv.ContainerCommit(containerID, "test", "", "", "", nil) <ide> if err != nil { <ide> t.Fatal(err)
1
Ruby
Ruby
improve test descriptions
1d8372cbc86cb5391140e8b78b61de59496045f8
<ide><path>Library/Homebrew/test/rubocops/components_order_spec.rb <ide> describe RuboCop::Cop::FormulaAudit::ComponentsOrder do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing formula components order" do <add> context "when auditing formula components order" do <ide> it "reports and corrects an offense when `uses_from_macos` precedes `depends_on`" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> class Foo < Formula <ide> RUBY <ide> end <ide> <del> context "no on_os_block" do <del> it "does not fail when there is no on_os block" do <add> context "when formula has no OS-specific blocks" do <add> it "reports no offenses" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> homepage "https://brew.sh" <ide> def install <ide> end <ide> end <ide> <del> context "on_os_block" do <del> it "correctly uses on_macos and on_linux blocks" do <add> context "when formula has OS-specific block(s)" do <add> it "reports no offenses when `on_macos` and `on_linux` are used correctly" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> homepage "https://brew.sh" <ide> def install <ide> end <ide> RUBY <ide> end <del> end <ide> <del> context "on_macos_block" do <del> it "correctly uses as single on_macos block" do <add> it "reports no offenses when `on_macos` is used correctly" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> homepage "https://brew.sh" <ide> def install <ide> end <ide> RUBY <ide> end <del> end <ide> <del> context "on_linux_block" do <del> it "correctly uses as single on_linux block" do <add> it "reports no offenses when `on_linux` is used correctly" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> homepage "https://brew.sh" <ide> class Foo < Formula <ide> RUBY <ide> end <ide> <del> it "reports no offenses for a valid `on_macos` and `on_linux` block with versions" do <add> it "reports no offenses for a valid `on_macos` and `on_linux` block (with `version`)" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> homepage "https://brew.sh" <ide><path>Library/Homebrew/test/rubocops/files_spec.rb <ide> describe RuboCop::Cop::FormulaAudit::Files do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing files" do <del> it "when the permissions are invalid" do <add> context "when auditing files" do <add> it "reports an offense when the permissions are invalid" do <ide> filename = Formulary.core_path("test_formula") <ide> File.open(filename, "w") do |file| <ide> FileUtils.chmod "-rwx", filename <ide><path>Library/Homebrew/test/rubocops/homepage_spec.rb <ide> describe RuboCop::Cop::FormulaAudit::Homepage do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing homepage" do <add> context "when auditing homepage" do <ide> it "reports an offense when there is no homepage" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide><path>Library/Homebrew/test/rubocops/lines_spec.rb <ide> class Foo < Formula <ide> describe RuboCop::Cop::FormulaAudit::ClassInheritance do <ide> subject(:cop) { described_class.new } <ide> <del> context "auditing formula class inheritance" do <add> context "when auditing formula class inheritance" do <ide> it "reports an offense when not using spaces for class inheritance" do <ide> expect_offense(<<~RUBY, "/homebrew-core/Formula/foo.rb") <ide> class Foo<Formula <ide> class Foo<Formula <ide> describe RuboCop::Cop::FormulaAudit::Comments do <ide> subject(:cop) { described_class.new } <ide> <del> context "auditing comment text" do <add> context "when auditing comment text" do <ide> it "reports an offense when commented cmake calls exist" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> class Foo < Formula <ide> describe RuboCop::Cop::FormulaAudit::AssertStatements do <ide> subject(:cop) { described_class.new } <ide> <del> context "auditing formula assertions" do <add> context "when auditing formula assertions" do <ide> it "reports an offense when assert ... include is used" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> class Foo < Formula <ide> describe RuboCop::Cop::FormulaAudit::OptionDeclarations do <ide> subject(:cop) { described_class.new } <ide> <del> context "auditing options" do <add> context "when auditing options" do <ide> it "reports an offense when `build.without?` is used in homebrew/core" do <ide> expect_offense(<<~RUBY, "/homebrew-core/") <ide> class Foo < Formula <ide> def install; end <ide> describe RuboCop::Cop::FormulaAudit::ShellVariables do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing shell variables" do <add> context "when auditing shell variables" do <ide> it "reports and corrects unexpanded shell variables in `Utils.popen`" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> def install <ide> describe RuboCop::Cop::FormulaAudit::LicenseArrays do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing license arrays" do <add> context "when auditing license arrays" do <ide> it "reports no offenses for license strings" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> class Foo < Formula <ide> describe RuboCop::Cop::FormulaAudit::Licenses do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing licenses" do <add> context "when auditing licenses" do <ide> it "reports no offenses for license strings" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> class Foo < Formula <ide> describe RuboCop::Cop::FormulaAudit::PythonVersions do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing Python versions" do <add> context "when auditing Python versions" do <ide> it "reports no offenses for Python with no dependency" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> def install <ide> RUBY <ide> end <ide> <del> it "reports no offenses when a Pytohn reference matches its dependency without `@`" do <add> it "reports no offenses when a Python reference matches its dependency without `@`" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> depends_on "[email protected]" <ide> def install <ide> describe RuboCop::Cop::FormulaAudit::Miscellaneous do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing formula miscellany" do <add> context "when auditing formula miscellany" do <ide> it "reports an offense for unneeded `FileUtils` usage" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> class Bar < Formula <ide> describe RuboCop::Cop::FormulaAuditStrict::ShellCommands do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing shell commands" do <add> context "when auditing shell commands" do <ide> it "reports and corrects an offense when `system` arguments should be separated" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide><path>Library/Homebrew/test/rubocops/options_spec.rb <ide> describe RuboCop::Cop::FormulaAudit::Options do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing options" do <add> context "when auditing options" do <ide> it "reports an offense when using the 32-bit option" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide><path>Library/Homebrew/test/rubocops/patches_spec.rb <ide> describe RuboCop::Cop::FormulaAudit::Patches do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing legacy patches" do <del> it "reports no offenses when there is no legacy patch" do <add> context "when auditing legacy patches" do <add> it "reports no offenses if there is no legacy patch" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> url 'https://brew.sh/foo-1.0.tgz' <ide> def patches <ide> end <ide> end <ide> <del> context "When auditing inline patches" do <add> context "when auditing inline patches" do <ide> it "reports no offenses for valid inline patches" do <ide> expect_no_offenses(<<~RUBY) <ide> class Foo < Formula <ide> class Foo < Formula <ide> end <ide> end <ide> <del> context "When auditing external patches" do <add> context "when auditing external patches" do <ide> it "reports an offense for various patch URLs" do <ide> patch_urls = [ <ide> "https://raw.github.com/mogaal/sendemail", <ide><path>Library/Homebrew/test/rubocops/urls_spec.rb <ide> }] <ide> } <ide> <del> context "When auditing urls" do <del> it "with offenses" do <add> context "when auditing URLs" do <add> it "reports any offenses" do <ide> formulae.each do |formula| <ide> allow_any_instance_of(RuboCop::Cop::FormulaCop).to receive(:formula_tap) <ide> .and_return(formula["formula_tap"]) <ide> class Foo < Formula <ide> end <ide> end <ide> <del> it "with offenses in stable/head block" do <add> it "reports an offense for GitHub repositories with git:// prefix" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> desc "foo" <ide> class Foo < Formula <ide> RUBY <ide> end <ide> <del> it "with duplicate mirror" do <add> it "reports an offense if `url` is the same as `mirror`" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> desc "foo" <ide><path>Library/Homebrew/test/rubocops/version_spec.rb <ide> describe RuboCop::Cop::FormulaAudit::Version do <ide> subject(:cop) { described_class.new } <ide> <del> context "When auditing version" do <del> it "version should not be an empty string" do <add> context "when auditing version" do <add> it "reports an offense if `version` is an empty string" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> url 'https://brew.sh/foo-1.0.tgz' <ide> class Foo < Formula <ide> RUBY <ide> end <ide> <del> it "version should not have a leading 'v'" do <add> it "reports an offense if `version` has a leading 'v'" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> url 'https://brew.sh/foo-1.0.tgz' <ide> class Foo < Formula <ide> RUBY <ide> end <ide> <del> it "version should not end with underline and number" do <add> it "reports an offense if `version` ends with an underline and a number" do <ide> expect_offense(<<~RUBY) <ide> class Foo < Formula <ide> url 'https://brew.sh/foo-1.0.tgz'
8
Python
Python
register priority for mx records
f29960fbe01f6c3204eea84e62bfb51c7c9fb4c7
<ide><path>libcloud/dns/drivers/gandi.py <ide> def delete_zone(self, zone): <ide> return res.object <ide> <ide> def _to_record(self, record, zone): <add> extras = {'ttl': record['ttl']} <add> value = record['value'] <add> if record['type'] == 'MX': <add> extras['priority'] = record['value'].split(' ')[0] <add> value = record['value'].split(' ')[1] <ide> return Record( <ide> id='%s:%s' % (record['type'], record['name']), <ide> name=record['name'], <ide> type=self._string_to_record_type(record['type']), <del> data=record['value'], <add> data=value, <ide> zone=zone, <ide> driver=self, <ide> ttl=record['ttl'], <del> extra={'ttl': record['ttl']} <del> ) <add> extra=extras <ide> <ide> def _to_records(self, records, zone): <ide> retval = []
1
Python
Python
replace line that was errantly removed in
58c604c1aa765d37f0d0324efb1852ddf4d9d9ef
<ide><path>numpy/core/fromnumeric.py <ide> def nonzero(a): <ide> array([[1, 0, 0], <ide> [0, 2, 0], <ide> [1, 1, 0]]) <del> >>> (array([0, 1, 2, 2], dtype=int64), array([0, 1, 0, 1], dtype=int64)) <add> >>> np.nonzero(x) <add> (array([0, 1, 2, 2], dtype=int64), array([0, 1, 0, 1], dtype=int64)) <ide> <ide> >>> x[np.nonzero(x)] <ide> array([ 1., 1., 1.])
1
Javascript
Javascript
fix error message of hrtime()
a0f728434617c1b84e20a56da33ed888dc254508
<ide><path>lib/internal/errors.js <ide> E('ERR_HTTP_INVALID_CHAR', 'Invalid character in statusMessage.'); <ide> E('ERR_HTTP_INVALID_STATUS_CODE', <ide> (originalStatusCode) => `Invalid status code: ${originalStatusCode}`); <ide> E('ERR_INDEX_OUT_OF_RANGE', 'Index out of range'); <add>E('ERR_INVALID_ARRAY_LENGTH', <add> (name, length, actual) => { <add> let msg = `The "${name}" array must have a length of ${length}`; <add> if (arguments.length > 2) { <add> const len = Array.isArray(actual) ? actual.length : actual; <add> msg += `. Received length ${len}`; <add> } <add> return msg; <add> }); <ide> E('ERR_INVALID_ARG_TYPE', invalidArgType); <ide> E('ERR_INVALID_CALLBACK', 'callback must be a function'); <ide> E('ERR_INVALID_FD', (fd) => `"fd" must be a positive integer: ${fd}`); <ide><path>lib/internal/process.js <ide> function setup_hrtime() { <ide> _hrtime(hrValues); <ide> <ide> if (time !== undefined) { <del> if (Array.isArray(time) && time.length === 2) { <del> const sec = (hrValues[0] * 0x100000000 + hrValues[1]) - time[0]; <del> const nsec = hrValues[2] - time[1]; <del> const needsBorrow = nsec < 0; <del> return [needsBorrow ? sec - 1 : sec, needsBorrow ? nsec + 1e9 : nsec]; <add> if (!Array.isArray(time)) { <add> throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'time', 'Array', <add> time); <ide> } <del> throw new errors.TypeError('ERR_INVALID_ARG_TYPE', <del> 'process.hrtime()', 'Array'); <add> if (time.length !== 2) { <add> throw new errors.TypeError('ERR_INVALID_ARRAY_LENGTH', 'time', 2, <add> time); <add> } <add> <add> const sec = (hrValues[0] * 0x100000000 + hrValues[1]) - time[0]; <add> const nsec = hrValues[2] - time[1]; <add> const needsBorrow = nsec < 0; <add> return [needsBorrow ? sec - 1 : sec, needsBorrow ? nsec + 1e9 : nsec]; <ide> } <ide> <ide> return [ <ide><path>test/parallel/test-process-hrtime.js <ide> validateTuple(tuple); <ide> // validate that passing an existing tuple returns another valid tuple <ide> validateTuple(process.hrtime(tuple)); <ide> <del>const invalidHrtimeArgument = common.expectsError({ <del> code: 'ERR_INVALID_ARG_TYPE', <del> type: TypeError, <del> message: 'The "process.hrtime()" argument must be of type Array' <del>}); <del> <ide> // test that only an Array may be passed to process.hrtime() <ide> assert.throws(() => { <ide> process.hrtime(1); <del>}, invalidHrtimeArgument); <add>}, common.expectsError({ <add> code: 'ERR_INVALID_ARG_TYPE', <add> type: TypeError, <add> message: 'The "time" argument must be of type Array. Received type number' <add>})); <ide> assert.throws(() => { <ide> process.hrtime([]); <del>}, invalidHrtimeArgument); <add>}, common.expectsError({ <add> code: 'ERR_INVALID_ARRAY_LENGTH', <add> type: TypeError, <add> message: 'The "time" array must have a length of 2. Received length 0' <add>})); <ide> assert.throws(() => { <ide> process.hrtime([1]); <del>}, invalidHrtimeArgument); <add>}, common.expectsError({ <add> code: 'ERR_INVALID_ARRAY_LENGTH', <add> type: TypeError, <add> message: 'The "time" array must have a length of 2. Received length 1' <add>})); <ide> assert.throws(() => { <ide> process.hrtime([1, 2, 3]); <del>}, invalidHrtimeArgument); <add>}, common.expectsError({ <add> code: 'ERR_INVALID_ARRAY_LENGTH', <add> type: TypeError, <add> message: 'The "time" array must have a length of 2. Received length 3' <add>})); <ide> <ide> function validateTuple(tuple) { <ide> assert(Array.isArray(tuple));
3