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
Mixed
Ruby
treat blank uuid values as nil
1f432c54658cf54608a6e37b70b8dc8e40521502
<ide><path>activerecord/CHANGELOG.md <add>* Treat blank UUID values as `nil`. <add> <add> Example: <add> <add> Sample.new(uuid_field: '') #=> <Sample id: nil, uuid_field: nil> <add> <add> *Dmitry Lavrov* <add> <ide> * Enable support for materialized views on PostgreSQL >= 9.3. <ide> <ide> *Dave Lee* <ide><path>activerecord/lib/active_record/connection_adapters/postgresql/oid.rb <ide> def accessor <ide> end <ide> end <ide> <add> class Uuid < Type <add> def type; :uuid end <add> def type_cast(value) <add> value.presence <add> end <add> end <add> <ide> class TypeMap <ide> def initialize <ide> @mapping = {} <ide> def self.registered_type?(name) <ide> register_type 'json', OID::Json.new <ide> register_type 'cidr', OID::Cidr.new <ide> register_type 'inet', OID::Inet.new <add> register_type 'uuid', OID::Uuid.new <ide> register_type 'xml', SpecializedString.new(:xml) <ide> register_type 'tsvector', SpecializedString.new(:tsvector) <ide> register_type 'macaddr', SpecializedString.new(:macaddr) <del> register_type 'uuid', SpecializedString.new(:uuid) <ide> register_type 'citext', SpecializedString.new(:citext) <ide> register_type 'ltree', SpecializedString.new(:ltree) <ide> <ide><path>activerecord/test/cases/adapters/postgresql/uuid_test.rb <ide> def test_data_type_of_uuid_types <ide> assert_not column.array <ide> end <ide> <add> def test_treat_blank_uuid_as_nil <add> UUIDType.create! guid: '' <add> assert_equal(nil, UUIDType.last.guid) <add> end <add> <ide> def test_uuid_formats <ide> ["A0EEBC99-9C0B-4EF8-BB6D-6BB9BD380A11", <ide> "{a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11}",
3
Ruby
Ruby
add missing require
38b5af6595338cb2212980062d9aaf51241878cc
<ide><path>actionpack/lib/action_dispatch/http/response.rb <ide> require 'active_support/core_ext/module/attribute_accessors' <ide> require 'action_dispatch/http/filter_redirect' <add>require 'action_dispatch/http/cache' <ide> require 'monitor' <ide> <ide> module ActionDispatch # :nodoc:
1
Ruby
Ruby
revert some stuff to use the new sanitizers
d4cd7e2a44b2c19df31f7cb0ce03b957f3a359af
<ide><path>actionview/lib/action_view/helpers/sanitize_helper.rb <ide> module ClassMethods #:nodoc: <ide> end <ide> <ide> # A class to vendor out the full, link and white list sanitizers <del> # Can be set to either HTML::Scanner or HTML::Sanitizer <add> # Can be set to either HTML::Deprecated::Sanitizer or Rails::Html::Sanitizer <ide> mattr_accessor :sanitizer_vendor <del> self.sanitizer_vendor = HTML::Scanner <add> self.sanitizer_vendor = Rails::Html::Sanitizer <ide> <ide> def sanitized_allowed_tags <del> HTML::WhiteListSanitizer.allowed_tags <add> Rails::Html::WhiteListSanitizer.allowed_tags <ide> end <ide> <ide> def sanitized_allowed_attributes <del> HTML::WhiteListSanitizer.allowed_attributes <add> Rails::Html::WhiteListSanitizer.allowed_attributes <ide> end <ide> <ide> # Gets the Rails::Html::FullSanitizer instance used by +strip_tags+. Replace with <ide> def white_list_sanitizer <ide> # end <ide> # <ide> def sanitized_allowed_tags=(*tags) <del> HTML::WhiteListSanitizer.allowed_tags = tags <add> Rails::Html::WhiteListSanitizer.allowed_tags = tags <ide> end <ide> <ide> # Replaces the allowed HTML attributes for the +sanitize+ helper. <ide> def sanitized_allowed_tags=(*tags) <ide> # end <ide> # <ide> def sanitized_allowed_attributes=(*attributes) <del> HTML::WhiteListSanitizer.allowed_attributes = attributes <add> Rails::Html::WhiteListSanitizer.allowed_attributes = attributes <ide> end <ide> end <ide> end
1
PHP
PHP
add @trigger to functions docs when event added
26b9d9449a1fb47005ed77d436ec343f88fe34ef
<ide><path>src/Error/ExceptionRenderer.php <ide> public function __construct(Exception $exception) { <ide> * a bare controller will be used. <ide> * <ide> * @return \Cake\Controller\Controller <add> * @triggers Controller.startup $controller <ide> */ <ide> protected function _getController() { <ide> if (!$request = Router::getRequest(true)) { <ide><path>src/Event/EventManager.php <ide> protected function _detachSubscriber(EventListenerInterface $subscriber, $eventK <ide> * <ide> * @param string|\Cake\Event\Event $event the event key name or instance of Event <ide> * @return \Cake\Event\Event <add> * @triggers $event <ide> */ <ide> public function dispatch($event) { <ide> if (is_string($event)) { <ide><path>src/Shell/Task/TemplateTask.php <ide> class TemplateTask extends Shell { <ide> * Get view instance <ide> * <ide> * @return \Cake\View\View <add> * @triggers Bake.initialize $view <ide> */ <ide> public function getView() { <ide> if ($this->View) { <ide><path>tests/TestCase/Controller/Component/AuthComponentTest.php <ide> public function testNoAuth() { <ide> * testIsErrorOrTests <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testIsErrorOrTests() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testIdentify() { <ide> * testRedirectVarClearing method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRedirectVarClearing() { <ide> $this->Controller->request['controller'] = 'auth_test'; <ide> public function testRedirectVarClearing() { <ide> * testAuthorizeFalse method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAuthorizeFalse() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testSameAuthenticateWithDifferentHashers() { <ide> * Tests that deny always takes precedence over allow <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAllowDenyAll() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testAllowDenyAll() { <ide> * test that deny() converts camel case inputs to lowercase. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testDenyWithCamelCaseMethods() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testDenyWithCamelCaseMethods() { <ide> * test that allow() and allowedActions work with camelCase method names. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAllowedActionsWithCamelCaseMethods() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testAllowedActionsSetWithAllowMethod() { <ide> * testLoginRedirect method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testLoginRedirect() { <ide> $url = '/auth_test/camelCase'; <ide> public function testLoginRedirect() { <ide> * testNoLoginRedirectForAuthenticatedUser method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testNoLoginRedirectForAuthenticatedUser() { <ide> $this->Controller->request['controller'] = 'auth_test'; <ide> public function testNoLoginRedirectForAuthenticatedUser() { <ide> * Default to loginRedirect, if set, on authError. <ide> * <ide> * @return void <add> * @triggers Controller.startup $Controller <ide> */ <ide> public function testDefaultToLoginRedirect() { <ide> $url = '/party/on'; <ide> public function testDefaultToLoginRedirect() { <ide> * testRedirectToUnauthorizedRedirect <ide> * <ide> * @return void <add> * @triggers Controller.startup $Controller <ide> */ <ide> public function testRedirectToUnauthorizedRedirect() { <ide> $url = '/party/on'; <ide> public function testRedirectToUnauthorizedRedirect() { <ide> * testRedirectToUnauthorizedRedirectSuppressedAuthError <ide> * <ide> * @return void <add> * @triggers Controller.startup $Controller <ide> */ <ide> public function testRedirectToUnauthorizedRedirectSuppressedAuthError() { <ide> $url = '/party/on'; <ide> public function testRedirectToUnauthorizedRedirectSuppressedAuthError() { <ide> * <ide> * @expectedException \Cake\Network\Exception\ForbiddenException <ide> * @return void <add> * @triggers Controller.startup $Controller <ide> */ <ide> public function testForbiddenException() { <ide> $url = '/party/on'; <ide> public function testForbiddenException() { <ide> * Test that no redirects or authorization tests occur on the loginAction <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testNoRedirectOnLoginAction() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testNoRedirectOnLoginAction() { <ide> * And the user doesn't have a session. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testNoRedirectOn404() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testNoRedirectOn404() { <ide> * testAdminRoute method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAdminRoute() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testAdminRoute() { <ide> * testAjaxLogin method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAjaxLogin() { <ide> $this->Controller->request = new Request([ <ide> public function testAjaxLogin() { <ide> * testLoginActionRedirect method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testLoginActionRedirect() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testLoginActionRedirect() { <ide> * accessed by $this->user(). <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStatelessAuthWorksWithUser() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testGettingUserAfterSetUser() { <ide> * test flash settings. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller) <ide> */ <ide> public function testFlashSettings() { <ide> $this->Auth->Flash = $this->getMock( <ide> public function testUser() { <ide> * @expectedException \Cake\Network\Exception\UnauthorizedException <ide> * @expectedExceptionCode 401 <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStatelessAuthNoRedirect() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testStatelessAuthNoRedirect() { <ide> * testStatelessAuthRedirect method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStatelessFollowedByStatefulAuth() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide><path>tests/TestCase/Controller/Component/CsrfComponentTest.php <ide> public function tearDown() { <ide> * Test setting the cookie value <ide> * <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testSettingCookie() { <ide> $_SERVER['REQUEST_METHOD'] = 'GET'; <ide> public static function httpMethodProvider() { <ide> * <ide> * @dataProvider httpMethodProvider <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testValidTokenInHeader($method) { <ide> $_SERVER['REQUEST_METHOD'] = $method; <ide> public function testValidTokenInHeader($method) { <ide> * @dataProvider httpMethodProvider <ide> * @expectedException \Cake\Network\Exception\ForbiddenException <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testInvalidTokenInHeader($method) { <ide> $_SERVER['REQUEST_METHOD'] = $method; <ide> public function testInvalidTokenInHeader($method) { <ide> * <ide> * @dataProvider httpMethodProvider <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testValidTokenRequestData($method) { <ide> $_SERVER['REQUEST_METHOD'] = $method; <ide> public function testValidTokenRequestData($method) { <ide> * @dataProvider httpMethodProvider <ide> * @expectedException \Cake\Network\Exception\ForbiddenException <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testInvalidTokenRequestData($method) { <ide> $_SERVER['REQUEST_METHOD'] = $method; <ide> public function testInvalidTokenRequestData($method) { <ide> * Test that CSRF checks are not applied to request action requests. <ide> * <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testCsrfValidationSkipsRequestAction() { <ide> $_SERVER['REQUEST_METHOD'] = 'POST'; <ide> public function testCsrfValidationSkipsRequestAction() { <ide> * Test that the configuration options work. <ide> * <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testConfigurationCookieCreate() { <ide> $_SERVER['REQUEST_METHOD'] = 'GET'; <ide> public function testConfigurationCookieCreate() { <ide> * Test that the configuration options work. <ide> * <ide> * @return void <add> * @triggers Controller.startup $controller <ide> */ <ide> public function testConfigurationValidate() { <ide> $_SERVER['REQUEST_METHOD'] = 'POST'; <ide><path>tests/TestCase/Controller/Component/RequestHandlerComponentTest.php <ide> public function testViewClassMap() { <ide> * Verify that isAjax is set on the request params for ajax requests <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testIsAjaxParams() { <ide> $this->request->env('HTTP_X_REQUESTED_WITH', 'XMLHttpRequest'); <ide> public function testIsAjaxParams() { <ide> * testAutoAjaxLayout method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAutoAjaxLayout() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testAutoAjaxLayout() { <ide> * test custom JsonView class is loaded and correct. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testJsonViewLoaded() { <ide> Router::extensions(['json', 'xml', 'ajax'], false); <ide> public function testJsonViewLoaded() { <ide> * test custom XmlView class is loaded and correct. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testXmlViewLoaded() { <ide> Router::extensions(['json', 'xml', 'ajax'], false); <ide> public function testXmlViewLoaded() { <ide> * test custom AjaxView class is loaded and correct. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAjaxViewLoaded() { <ide> Router::extensions(['json', 'xml', 'ajax'], false); <ide> public function testAjaxViewLoaded() { <ide> * test configured extension but no view class set. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testNoViewClassExtension() { <ide> Router::extensions(['json', 'xml', 'ajax', 'csv'], false); <ide> public function testNoViewClassExtension() { <ide> * testStartupCallback method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStartupCallback() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testStartupCallback() { <ide> * testStartupCallback with charset. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStartupCallbackCharset() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testStartupCallbackCharset() { <ide> * Test mapping a new type and having startup process it. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStartupCustomTypeProcess() { <ide> if (!function_exists('str_getcsv')) { <ide> public function testStartupCustomTypeProcess() { <ide> * testNonAjaxRedirect method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testNonAjaxRedirect() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testNonAjaxRedirect() { <ide> * test that redirects with ajax and no URL don't do anything. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testAjaxRedirectWithNoUrl() { <ide> $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; <ide> public function testPrefers() { <ide> * test that ajax requests involving redirects trigger requestAction instead. <ide> * <ide> * @return void <add> * @triggers Controller.beforeRedirect $this->Controller <ide> */ <ide> public function testAjaxRedirectAsRequestAction() { <ide> Configure::write('App.namespace', 'TestApp'); <ide> public function testAjaxRedirectAsRequestAction() { <ide> * this would cause the ajax layout to not be rendered. <ide> * <ide> * @return void <add> * @triggers Controller.beforeRedirect $this->Controller <ide> */ <ide> public function testAjaxRedirectAsRequestActionStillRenderingLayout() { <ide> Configure::write('App.namespace', 'TestApp'); <ide> public function testAjaxRedirectAsRequestActionStillRenderingLayout() { <ide> * <ide> * @link https://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276 <ide> * @return void <add> * @triggers Controller.beforeRender $this->Controller <ide> */ <ide> public function testBeforeRedirectCallbackWithArrayUrl() { <ide> Configure::write('App.namespace', 'TestApp'); <ide> public function testAddInputTypeException() { <ide> * Test checkNotModified method <ide> * <ide> * @return void <add> * @triggers Controller.beforeRender $this->Controller <ide> */ <ide> public function testCheckNotModifiedByEtagStar() { <ide> $_SERVER['HTTP_IF_NONE_MATCH'] = '*'; <ide> public function testCheckNotModifiedByEtagStar() { <ide> * Test checkNotModified method <ide> * <ide> * @return void <add> * @triggers Controller.beforeRender <ide> */ <ide> public function testCheckNotModifiedByEtagExact() { <ide> $_SERVER['HTTP_IF_NONE_MATCH'] = 'W/"something", "other"'; <ide> public function testCheckNotModifiedByEtagExact() { <ide> * Test checkNotModified method <ide> * <ide> * @return void <add> * @triggers Controller.beforeRender $this->Controller <ide> */ <ide> public function testCheckNotModifiedByEtagAndTime() { <ide> $_SERVER['HTTP_IF_NONE_MATCH'] = 'W/"something", "other"'; <ide> public function testCheckNotModifiedByEtagAndTime() { <ide> * Test checkNotModified method <ide> * <ide> * @return void <add> * @triggers Controller.beforeRender $this->Controller <ide> */ <ide> public function testCheckNotModifiedNoInfo() { <ide> $event = new Event('Controller.beforeRender', $this->Controller); <ide><path>tests/TestCase/Controller/Component/SecurityComponentTest.php <ide> public function tearDown() { <ide> * <ide> * @expectedException \Cake\Network\Exception\BadRequestException <ide> * @return void <add> * @triggers Controller.startup $Controller, $this->Controller <ide> */ <ide> public function testBlackholeWithBrokenCallback() { <ide> $request = new Request([ <ide> public function testBlackholeWithBrokenCallback() { <ide> * action results in an exception. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testExceptionWhenActionIsBlackholeCallback() { <ide> $this->Controller->request->addParams(array( <ide> public function testConstructorSettingProperties() { <ide> * testStartup method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testStartup() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testStartup() { <ide> * testRequireSecureFail method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRequireSecureFail() { <ide> $_SERVER['HTTPS'] = 'off'; <ide> public function testRequireSecureFail() { <ide> * testRequireSecureSucceed method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRequireSecureSucceed() { <ide> $_SERVER['HTTPS'] = 'on'; <ide> public function testRequireSecureSucceed() { <ide> * testRequireSecureEmptyFail method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRequireSecureEmptyFail() { <ide> $_SERVER['HTTPS'] = 'off'; <ide> public function testRequireSecureEmptyFail() { <ide> * testRequireSecureEmptySucceed method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRequireSecureEmptySucceed() { <ide> $_SERVER['HTTPS'] = 'on'; <ide> public function testRequireSecureEmptySucceed() { <ide> * testRequireAuthFail method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRequireAuthFail() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testRequireAuthFail() { <ide> * testRequireAuthSucceed method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testRequireAuthSucceed() { <ide> $_SERVER['REQUEST_METHOD'] = 'AUTH'; <ide> public function testRequireAuthSucceed() { <ide> * Simple hash validation test <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePost() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePost() { <ide> * Test that validatePost fails if you are missing the session information. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostNoSession() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostNoSession() { <ide> * test that validatePost fails if any of its required fields are missing. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostFormHacking() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostFormHacking() { <ide> * attacks. Thanks to Felix Wilhelm <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostObjectDeserialize() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostObjectDeserialize() { <ide> * Tests validation post data ignores `_csrfToken`. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostIgnoresCsrfToken() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostIgnoresCsrfToken() { <ide> * Tests validation of checkbox arrays <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostArray() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostArray() { <ide> * testValidatePostNoModel method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostNoModel() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostNoModel() { <ide> * testValidatePostSimple method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostSimple() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostSimple() { <ide> * Tests hash validation for multiple records, including locked fields <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostComplex() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostComplex() { <ide> * test ValidatePost with multiple select elements. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostMultipleSelect() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostMultipleSelect() { <ide> * Second block tests checked checkbox <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostCheckbox() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostCheckbox() { <ide> * testValidatePostHidden method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostHidden() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostHidden() { <ide> * testValidatePostWithDisabledFields method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostWithDisabledFields() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostWithDisabledFields() { <ide> * test validating post data with posted unlocked fields. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostDisabledFieldsInData() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostDisabledFieldsInData() { <ide> * test that missing 'unlocked' input causes failure <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostFailNoDisabled() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostFailNoDisabled() { <ide> * Test that validatePost fails when unlocked fields are changed. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostFailDisabledFieldTampering() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostFailDisabledFieldTampering() { <ide> * testValidateHiddenMultipleModel method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidateHiddenMultipleModel() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidateHiddenMultipleModel() { <ide> * testValidateHasManyModel method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidateHasManyModel() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidateHasManyModel() { <ide> * testValidateHasManyRecordsPass method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidateHasManyRecordsPass() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidateHasManyRecordsPass() { <ide> * Test that values like Foo.0.1 <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidateNestedNumericSets() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidateNestedNumericSets() { <ide> * validatePost should fail, hidden fields have been changed. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidateHasManyRecordsFail() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidateHasManyRecordsFail() { <ide> * testFormDisabledFields method <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testFormDisabledFields() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testFormDisabledFields() { <ide> * test validatePost with radio buttons <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostRadio() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostRadio() { <ide> * test validatePost uses here() as a hash input. <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testValidatePostUrlAsHashInput() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testValidatePostUrlAsHashInput() { <ide> * <ide> * @link https://cakephp.lighthouseapp.com/projects/42648/tickets/214 <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testBlackHoleNotDeletingSessionInformation() { <ide> $event = new Event('Controller.startup', $this->Controller); <ide> public function testGenerateToken() { <ide> * Test unlocked actions <ide> * <ide> * @return void <add> * @triggers Controller.startup $this->Controller <ide> */ <ide> public function testUnlockedActions() { <ide> $_SERVER['REQUEST_METHOD'] = 'POST'; <ide><path>tests/TestCase/Event/EventManagerTest.php <ide> public function testDetachFromAll() { <ide> * Tests event dispatching <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatch() { <ide> $manager = new EventManager(); <ide> public function testDispatchWithKeyName() { <ide> * Tests event dispatching with a return value <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatchReturnValue() { <ide> $this->skipIf( <ide> public function testDispatchReturnValue() { <ide> * Tests that returning false in a callback stops the event <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatchFalseStopsEvent() { <ide> $this->skipIf( <ide> public function testDispatchFalseStopsEvent() { <ide> * Tests event dispatching using priorities <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatchPrioritized() { <ide> $manager = new EventManager(); <ide> public function testDispatchPrioritized() { <ide> * Tests subscribing a listener object and firing the events it subscribed to <ide> * <ide> * @return void <add> * @triggers fake.event <add> * @triggers another.event $this, array(some => data) <ide> */ <ide> public function testAttachSubscriber() { <ide> $manager = new EventManager(); <ide> public function testAttachSubscriber() { <ide> * Test implementedEvents binding multiple callbacks to the same event name. <ide> * <ide> * @return void <add> * @triggers multiple.handlers <ide> */ <ide> public function testAttachSubscriberMultiple() { <ide> $manager = new EventManager(); <ide> public function testGlobalDispatcherGetter() { <ide> * Tests that the global event manager gets the event too from any other manager <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatchWithGlobal() { <ide> $generalManager = $this->getMock('Cake\Event\EventManager', array('prioritisedListeners')); <ide> public function testDispatchWithGlobal() { <ide> * Tests that stopping an event will not notify the rest of the listeners <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testStopPropagation() { <ide> $generalManager = $this->getMock('Cake\Event\EventManager'); <ide> public function testStopPropagation() { <ide> * Tests event dispatching using priorities <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatchPrioritizedWithGlobal() { <ide> $generalManager = $this->getMock('Cake\Event\EventManager'); <ide> public function testDispatchPrioritizedWithGlobal() { <ide> * Tests event dispatching using priorities <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testDispatchGlobalBeforeLocal() { <ide> $generalManager = $this->getMock('Cake\Event\EventManager'); <ide> public function onMyEvent($event) { <ide> /** <ide> * Tests events dispatched by a local manager can be handled by <ide> * handler registered in the global event manager <add> * @triggers my_event $manager <ide> */ <ide> public function testDispatchLocalHandledByGlobal() { <ide> $callback = array($this, 'onMyEvent'); <ide> public function testDispatchLocalHandledByGlobal() { <ide> * listeners at the same priority. <ide> * <ide> * @return void <add> * @triggers fake.event $this) <ide> */ <ide> public function testDispatchWithGlobalAndLocalEvents() { <ide> $listener = new CustomTestEventListenerInterface(); <ide><path>tests/TestCase/Event/EventTest.php <ide> class EventTest extends TestCase { <ide> * Tests the name() method <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testName() { <ide> $event = new Event('fake.event'); <ide> public function testName() { <ide> * Tests the subject() method <ide> * <ide> * @return void <add> * @triggers fake.event $this <add> * @triggers fake.event <ide> */ <ide> public function testSubject() { <ide> $event = new Event('fake.event', $this); <ide> public function testSubject() { <ide> * Tests the event propagation stopping property <ide> * <ide> * @return void <add> * @triggers fake.event <ide> */ <ide> public function testPropagation() { <ide> $event = new Event('fake.event'); <ide> public function testPropagation() { <ide> * Tests that it is possible to get/set custom data in a event <ide> * <ide> * @return void <add> * @triggers fake.event $this, array('some' => 'data') <ide> */ <ide> public function testEventData() { <ide> $event = new Event('fake.event', $this, array('some' => 'data')); <ide> public function testEventData() { <ide> * Tests that it is possible to get the name and subject directly <ide> * <ide> * @return void <add> * @triggers fake.event $this <ide> */ <ide> public function testEventDirectPropertyAccess() { <ide> $event = new Event('fake.event', $this); <ide><path>tests/TestCase/Model/Behavior/TimestampBehaviorTest.php <ide> public function testImplementedEventsCustom() { <ide> * testCreatedAbsent <ide> * <ide> * @return void <add> * @triggers Model.beforeSave <ide> */ <ide> public function testCreatedAbsent() { <ide> $table = $this->getMock('Cake\ORM\Table'); <ide> public function testCreatedAbsent() { <ide> * testCreatedPresent <ide> * <ide> * @return void <add> * @triggers Model.beforeSave <ide> */ <ide> public function testCreatedPresent() { <ide> $table = $this->getMock('Cake\ORM\Table'); <ide> public function testCreatedPresent() { <ide> * testCreatedNotNew <ide> * <ide> * @return void <add> * @triggers Model.beforeSave <ide> */ <ide> public function testCreatedNotNew() { <ide> $table = $this->getMock('Cake\ORM\Table'); <ide> public function testCreatedNotNew() { <ide> * testModifiedAbsent <ide> * <ide> * @return void <add> * @triggers Model.beforeSave <ide> */ <ide> public function testModifiedAbsent() { <ide> $table = $this->getMock('Cake\ORM\Table'); <ide> public function testModifiedAbsent() { <ide> * testModifiedPresent <ide> * <ide> * @return void <add> * @triggers Model.beforeSave <ide> */ <ide> public function testModifiedPresent() { <ide> $table = $this->getMock('Cake\ORM\Table'); <ide> public function testModifiedPresent() { <ide> * @expectedException \UnexpectedValueException <ide> * @expectedExceptionMessage When should be one of "always", "new" or "existing". The passed value "fat fingers" is invalid <ide> * @return void <add> * @triggers Model.beforeSave <ide> */ <ide> public function testInvalidEventConfig() { <ide> $table = $this->getMock('Cake\ORM\Table'); <ide><path>tests/TestCase/Routing/DispatcherFilterTest.php <ide> public function testConstructorInvalidWhen() { <ide> * Test basic matching with for option. <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('request') <add> * @triggers Dispatcher.beforeDispatch $this, compact('request') <add> * @triggers Dispatcher.beforeDispatch $this, compact('request') <add> * @triggers Dispatcher.beforeDispatch $this, compact('request') <ide> */ <ide> public function testMatchesWithFor() { <ide> $request = new Request(['url' => '/articles/view']); <ide> public function testMatchesWithFor() { <ide> * Test matching with when option. <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') <ide> */ <ide> public function testMatchesWithWhen() { <ide> $matcher = function ($request, $response) { <ide> public function testMatchesWithWhen() { <ide> * Test matching with for & when option. <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') <ide> */ <ide> public function testMatchesWithForAndWhen() { <ide> $request = new Request(['url' => '/articles/view']); <ide> public function testMatchesWithForAndWhen() { <ide> * Test event bindings have use condition checker <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') <add> * @triggers Dispatcher.afterDispatch $this, compact('response', 'request') <ide> */ <ide> public function testImplementedEventsMethodName() { <ide> $request = new Request(['url' => '/articles/view']); <ide> public function testImplementedEventsMethodName() { <ide> * Test handle applies for conditions <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') <ide> */ <ide> public function testHandleAppliesFor() { <ide> $request = new Request(['url' => '/articles/view']); <ide> public function testHandleAppliesFor() { <ide> * Test handle applies when conditions <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('response', 'request') <ide> */ <ide> public function testHandleAppliesWhen() { <ide> $request = new Request(['url' => '/articles/view']); <ide><path>tests/TestCase/Routing/Filter/AssetFilterTest.php <ide> public function tearDown() { <ide> * file dispatching <ide> * <ide> * @return void <add> * @triggers DispatcherTest $this, compact('request', 'response') <add> * @triggers DispatcherTest $this, compact('request', 'response') <ide> */ <ide> public function testNotModified() { <ide> $filter = new AssetFilter(); <ide> public function testNotModified() { <ide> * Test that no exceptions are thrown for //index.php type URLs. <ide> * <ide> * @return void <add> * @triggers Dispatcher.beforeRequest $this, compact('request', 'response') <ide> */ <ide> public function test404OnDoubleSlash() { <ide> $filter = new AssetFilter(); <ide> public function test404OnDoubleSlash() { <ide> * Test that 404's are returned when .. is in the URL <ide> * <ide> * @return voi <add> * @triggers Dispatcher.beforeRequest $this, compact('request', 'response') <add> * @triggers Dispatcher.beforeRequest $this, compact('request', 'response') <ide> */ <ide> public function test404OnDoubleDot() { <ide> $filter = new AssetFilter(); <ide> public static function assetProvider() { <ide> * <ide> * @dataProvider assetProvider <ide> * @return void <add> * @triggers Dispatcher.beforeDispatch $this, compact('request', 'response') <ide> */ <ide> public function testAsset($url, $file) { <ide> Plugin::load(array('Company/TestPluginThree', 'TestPlugin', 'PluginJs')); <ide><path>tests/TestCase/Routing/Filter/LocaleSelectorFilterTest.php <ide> public function tearDown() { <ide> * Tests selecting a language from a http header <ide> * <ide> * @return void <add> * @triggers name null, [request => $request]) <add> * @triggers name null, [request => $request]) <add> * @triggers name null, [request => $request]) <ide> */ <ide> public function testSimpleSelection() { <ide> $filter = new LocaleSelectorFilter(); <ide> public function testSimpleSelection() { <ide> * Tests selecting a language from a http header and filtering by a whitelist <ide> * <ide> * @return void <add> * @triggers name null, [request => $request]) <add> * @triggers name null, [request => $request]) <ide> */ <ide> public function testWithWhitelist() { <ide> Locale::setDefault('en_US'); <ide><path>tests/TestCase/Routing/Filter/RoutingFilterTest.php <ide> class RoutingFilterTest extends TestCase { <ide> * test setting parameters in beforeDispatch method <ide> * <ide> * @return void <add> * @triggers __CLASS__ $this, compact(request) <ide> */ <ide> public function testBeforeDispatchSkipWhenControllerSet() { <ide> $filter = new RoutingFilter(); <ide> public function testBeforeDispatchSkipWhenControllerSet() { <ide> * test setting parameters in beforeDispatch method <ide> * <ide> * @return void <add> * @triggers __CLASS__ $this, compact(request) <ide> */ <ide> public function testBeforeDispatchSetsParameters() { <ide> Router::connect('/:controller/:action/*'); <ide> public function testBeforeDispatchSetsParameters() { <ide> * test setting parameters in beforeDispatch method <ide> * <ide> * @return void <add> * @triggers __CLASS__ $this, compact(request) <add> * @triggers __CLASS__ $this, compact(request) <ide> */ <ide> public function testQueryStringOnRoot() { <ide> Router::reload();
14
Python
Python
improve text generation doc
89514f0541f312945854236132a5f4ea2516fa86
<ide><path>src/transformers/generation_tf_utils.py <ide> def greedy_search( <ide> >>> tokenizer = AutoTokenizer.from_pretrained("gpt2") <ide> >>> model = TFAutoModelForCausalLM.from_pretrained("gpt2") <ide> <del> >>> # set pad_token_id to eos_token_id because GPT2 does not have a EOS token <add> >>> # set pad_token_id to eos_token_id because GPT2 does not have a PAD token <ide> >>> model.config.pad_token_id = model.config.eos_token_id <ide> <ide> >>> input_prompt = "Today is a beautiful day, and" <ide><path>src/transformers/generation_utils.py <ide> def generate( <ide> >>> sentence = "Paris is one of the densest populated areas in Europe." <ide> >>> input_ids = tokenizer(sentence, return_tensors="pt").input_ids <ide> <del> >>> outputs = model.generate(input_ids) <add> >>> outputs = model.generate(input_ids, num_beams=5) <ide> >>> tokenizer.batch_decode(outputs, skip_special_tokens=True) <ide> ['Paris ist eines der dichtesten besiedelten Gebiete Europas.'] <ide> ```""" <ide> def greedy_search( <ide> >>> tokenizer = AutoTokenizer.from_pretrained("gpt2") <ide> >>> model = AutoModelForCausalLM.from_pretrained("gpt2") <ide> <del> >>> # set pad_token_id to eos_token_id because GPT2 does not have a EOS token <add> >>> # set pad_token_id to eos_token_id because GPT2 does not have a PAD token <ide> >>> model.config.pad_token_id = model.config.eos_token_id <ide> <ide> >>> input_prompt = "It might be possible to"
2
Python
Python
remove unnecessary models.py file
468cdd16edabbb327c7dde877f3b0a18bea082b9
<ide><path>rest_framework/models.py <del># Just to keep things like ./manage.py test happy
1
PHP
PHP
move reponse header setting
2173b46d18c4a0dd8d0348bf727ce9ff90f893e4
<ide><path>src/Error/ExceptionRenderer.php <ide> protected function _getController($exception) { <ide> } <ide> $response = new Response(); <ide> <del> if (method_exists($exception, 'responseHeader')) { <del> $response->header($exception->responseHeader()); <del> } <del> <ide> try { <ide> $controller = new ErrorController($request, $response); <ide> $controller->startupProcess(); <ide> public function render() { <ide> $message = $this->_message($exception, $code); <ide> $url = $this->controller->request->here(); <ide> <add> if (method_exists($exception, 'responseHeader')) { <add> $this->controller->response->header($exception->responseHeader()); <add> } <ide> $this->controller->response->statusCode($code); <ide> $this->controller->set(array( <ide> 'message' => h($message),
1
Go
Go
move inspect from server to daemon
603e00a3a7644caf118d3efd0932500b4dfc4de3
<ide><path>api/server/server.go <ide> func getContainersLogs(eng *engine.Engine, version version.Version, w http.Respo <ide> } <ide> <ide> var ( <del> job = eng.Job("inspect", vars["name"], "container") <add> job = eng.Job("container_inspect", vars["name"]) <ide> c, err = job.Stdout.AddEnv() <ide> ) <ide> if err != nil { <ide> func postContainersAttach(eng *engine.Engine, version version.Version, w http.Re <ide> } <ide> <ide> var ( <del> job = eng.Job("inspect", vars["name"], "container") <add> job = eng.Job("container_inspect", vars["name"]) <ide> c, err = job.Stdout.AddEnv() <ide> ) <ide> if err != nil { <ide> func wsContainersAttach(eng *engine.Engine, version version.Version, w http.Resp <ide> return fmt.Errorf("Missing parameter") <ide> } <ide> <del> if err := eng.Job("inspect", vars["name"], "container").Run(); err != nil { <add> if err := eng.Job("container_inspect", vars["name"]).Run(); err != nil { <ide> return err <ide> } <ide> <ide> func getContainersByName(eng *engine.Engine, version version.Version, w http.Res <ide> if vars == nil { <ide> return fmt.Errorf("Missing parameter") <ide> } <del> var job = eng.Job("inspect", vars["name"], "container") <add> var job = eng.Job("container_inspect", vars["name"]) <ide> streamJSON(job, w, false) <del> job.SetenvBool("conflict", true) //conflict=true to detect conflict between containers and images in the job <ide> return job.Run() <ide> } <ide> <ide> func getImagesByName(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error { <ide> if vars == nil { <ide> return fmt.Errorf("Missing parameter") <ide> } <del> var job = eng.Job("inspect", vars["name"], "image") <add> var job = eng.Job("image_inspect", vars["name"]) <ide> streamJSON(job, w, false) <del> job.SetenvBool("conflict", true) //conflict=true to detect conflict between containers and images in the job <ide> return job.Run() <ide> } <ide> <ide><path>daemon/daemon.go <ide> type Daemon struct { <ide> execDriver execdriver.Driver <ide> } <ide> <add>// Install installs daemon capabilities to eng. <add>func (daemon *Daemon) Install(eng *engine.Engine) error { <add> return eng.Register("container_inspect", daemon.ContainerInspect) <add>} <add> <ide> // Mountpoints should be private to the container <ide> func remountPrivate(mountPoint string) error { <ide> mounted, err := mount.Mounted(mountPoint) <ide><path>daemon/inspect.go <add>package daemon <add> <add>import ( <add> "encoding/json" <add> <add> "github.com/dotcloud/docker/engine" <add> "github.com/dotcloud/docker/runconfig" <add>) <add> <add>func (daemon *Daemon) ContainerInspect(job *engine.Job) engine.Status { <add> if len(job.Args) != 1 { <add> return job.Errorf("usage: %s NAME", job.Name) <add> } <add> name := job.Args[0] <add> if container := daemon.Get(name); container != nil { <add> b, err := json.Marshal(&struct { <add> *Container <add> HostConfig *runconfig.HostConfig <add> }{container, container.HostConfig()}) <add> if err != nil { <add> return job.Error(err) <add> } <add> job.Stdout.Write(b) <add> return engine.StatusOK <add> } <add> return job.Errorf("No such container: %s", name) <add>} <ide><path>graph/service.go <ide> package graph <ide> <ide> import ( <add> "encoding/json" <ide> "fmt" <add> "io" <add> <ide> "github.com/dotcloud/docker/engine" <ide> "github.com/dotcloud/docker/image" <ide> "github.com/dotcloud/docker/utils" <ide> func (s *TagStore) Install(eng *engine.Engine) error { <ide> eng.Register("image_set", s.CmdSet) <ide> eng.Register("image_tag", s.CmdTag) <ide> eng.Register("image_get", s.CmdGet) <add> eng.Register("image_inspect", s.CmdLookup) <add> eng.Register("image_tarlayer", s.CmdTarLayer) <ide> return nil <ide> } <ide> <ide> func (s *TagStore) CmdGet(job *engine.Job) engine.Status { <ide> // but we didn't, so now we're doing it here. <ide> // <ide> // Fields that we're probably better off not including: <del> // - ID (the caller already knows it, and we stay more flexible on <del> // naming down the road) <del> // - Parent. That field is really an implementation detail of <del> // layer storage ("layer is a diff against this other layer). <del> // It doesn't belong at the same level as author/description/etc. <ide> // - Config/ContainerConfig. Those structs have the same sprawl problem, <ide> // so we shouldn't include them wholesale either. <ide> // - Comment: initially created to fulfill the "every image is a git commit" <ide> func (s *TagStore) CmdGet(job *engine.Job) engine.Status { <ide> res.Set("os", img.OS) <ide> res.Set("architecture", img.Architecture) <ide> res.Set("docker_version", img.DockerVersion) <add> res.Set("ID", img.ID) <add> res.Set("Parent", img.Parent) <ide> } <ide> res.WriteTo(job.Stdout) <ide> return engine.StatusOK <ide> } <add> <add>// CmdLookup return an image encoded in JSON <add>func (s *TagStore) CmdLookup(job *engine.Job) engine.Status { <add> if len(job.Args) != 1 { <add> return job.Errorf("usage: %s NAME", job.Name) <add> } <add> name := job.Args[0] <add> if image, err := s.LookupImage(name); err == nil && image != nil { <add> b, err := json.Marshal(image) <add> if err != nil { <add> return job.Error(err) <add> } <add> job.Stdout.Write(b) <add> return engine.StatusOK <add> } <add> return job.Errorf("No such image: %s", name) <add>} <add> <add>// CmdTarLayer return the tarLayer of the image <add>func (s *TagStore) CmdTarLayer(job *engine.Job) engine.Status { <add> if len(job.Args) != 1 { <add> return job.Errorf("usage: %s NAME", job.Name) <add> } <add> name := job.Args[0] <add> if image, err := s.LookupImage(name); err == nil && image != nil { <add> fs, err := image.TarLayer() <add> if err != nil { <add> return job.Error(err) <add> } <add> defer fs.Close() <add> <add> if written, err := io.Copy(job.Stdout, fs); err != nil { <add> return job.Error(err) <add> } else { <add> utils.Debugf("rendered layer for %s of [%d] size", image.ID, written) <add> } <add> <add> return engine.StatusOK <add> } <add> return job.Errorf("No such image: %s", name) <add>} <ide><path>integration/api_test.go <ide> func TestGetContainersByName(t *testing.T) { <ide> func TestPostCommit(t *testing.T) { <ide> eng := NewTestEngine(t) <ide> defer mkDaemonFromEngine(eng, t).Nuke() <del> srv := mkServerFromEngine(eng, t) <ide> <ide> // Create a container and remove a file <ide> containerID := createTestContainer(eng, <ide> func TestPostCommit(t *testing.T) { <ide> if err := env.Decode(r.Body); err != nil { <ide> t.Fatal(err) <ide> } <del> if _, err := srv.ImageInspect(env.Get("Id")); err != nil { <add> if err := eng.Job("image_inspect", env.Get("Id")).Run(); err != nil { <ide> t.Fatalf("The image has not been committed") <ide> } <ide> } <ide><path>integration/buildfile_test.go <ide> package docker <ide> <ide> import ( <add> "bytes" <add> "encoding/json" <ide> "fmt" <del> "github.com/dotcloud/docker/archive" <del> "github.com/dotcloud/docker/engine" <del> "github.com/dotcloud/docker/image" <del> "github.com/dotcloud/docker/nat" <del> "github.com/dotcloud/docker/server" <del> "github.com/dotcloud/docker/utils" <ide> "io/ioutil" <ide> "net" <ide> "net/http" <ide> "net/http/httptest" <ide> "strings" <ide> "testing" <add> <add> "github.com/dotcloud/docker/archive" <add> "github.com/dotcloud/docker/engine" <add> "github.com/dotcloud/docker/image" <add> "github.com/dotcloud/docker/nat" <add> "github.com/dotcloud/docker/server" <add> "github.com/dotcloud/docker/utils" <ide> ) <ide> <ide> // A testContextTemplate describes a build context and how to test it <ide> func buildImage(context testContextTemplate, t *testing.T, eng *engine.Engine, u <ide> return nil, err <ide> } <ide> <del> return srv.ImageInspect(id) <add> job := eng.Job("image_inspect", id) <add> buffer := bytes.NewBuffer(nil) <add> image := &image.Image{} <add> job.Stdout.Add(buffer) <add> if err := job.Run(); err != nil { <add> return nil, err <add> } <add> err = json.NewDecoder(buffer).Decode(image) <add> return image, err <ide> } <ide> <ide> func TestVolume(t *testing.T) { <ide><path>integration/commands_test.go <ide> func TestContainerOrphaning(t *testing.T) { <ide> if err := cli.CmdBuild("-t", image, tmpDir); err != nil { <ide> t.Fatal(err) <ide> } <del> img, err := srv.ImageInspect(image) <del> if err != nil { <add> job := globalEngine.Job("image_get", image) <add> info, _ := job.Stdout.AddEnv() <add> if err := job.Run(); err != nil { <ide> t.Fatal(err) <ide> } <del> return img.ID <add> return info.Get("ID") <ide> } <ide> <ide> // build an image <ide><path>integration/server_test.go <ide> func TestMergeConfigOnCommit(t *testing.T) { <ide> container2, _, _ := mkContainer(runtime, []string{engine.Tail(outputBuffer, 1)}, t) <ide> defer runtime.Destroy(container2) <ide> <del> job = eng.Job("inspect", container1.Name, "container") <add> job = eng.Job("container_inspect", container1.Name) <ide> baseContainer, _ := job.Stdout.AddEnv() <ide> if err := job.Run(); err != nil { <ide> t.Error(err) <ide> } <ide> <del> job = eng.Job("inspect", container2.Name, "container") <add> job = eng.Job("container_inspect", container2.Name) <ide> commitContainer, _ := job.Stdout.AddEnv() <ide> if err := job.Run(); err != nil { <ide> t.Error(err) <ide><path>server/server.go <ide> func InitServer(job *engine.Job) engine.Status { <ide> "pull": srv.ImagePull, <ide> "import": srv.ImageImport, <ide> "image_delete": srv.ImageDelete, <del> "inspect": srv.JobInspect, <ide> "events": srv.Events, <ide> "push": srv.ImagePush, <ide> "containers": srv.Containers, <ide> func InitServer(job *engine.Job) engine.Status { <ide> if err := srv.daemon.Repositories().Install(job.Eng); err != nil { <ide> return job.Error(err) <ide> } <add> // Install daemon-related commands from the daemon subsystem. <add> // See `daemon/` <add> if err := srv.daemon.Install(job.Eng); err != nil { <add> return job.Error(err) <add> } <ide> return engine.StatusOK <ide> } <ide> <ide> func (srv *Server) ImageExport(job *engine.Job) engine.Status { <ide> } <ide> if rootRepo != nil { <ide> for _, id := range rootRepo { <del> image, err := srv.ImageInspect(id) <del> if err != nil { <del> return job.Error(err) <del> } <del> <del> if err := srv.exportImage(image, tempdir); err != nil { <add> if err := srv.exportImage(job.Eng, id, tempdir); err != nil { <ide> return job.Error(err) <ide> } <ide> } <ide> func (srv *Server) ImageExport(job *engine.Job) engine.Status { <ide> return job.Error(err) <ide> } <ide> } else { <del> image, err := srv.ImageInspect(name) <del> if err != nil { <del> return job.Error(err) <del> } <del> if err := srv.exportImage(image, tempdir); err != nil { <add> if err := srv.exportImage(job.Eng, name, tempdir); err != nil { <ide> return job.Error(err) <ide> } <ide> } <ide> func (srv *Server) ImageExport(job *engine.Job) engine.Status { <ide> if _, err := io.Copy(job.Stdout, fs); err != nil { <ide> return job.Error(err) <ide> } <add> utils.Debugf("End Serializing %s", name) <ide> return engine.StatusOK <ide> } <ide> <del>func (srv *Server) exportImage(img *image.Image, tempdir string) error { <del> for i := img; i != nil; { <add>func (srv *Server) exportImage(eng *engine.Engine, name, tempdir string) error { <add> for n := name; n != ""; { <ide> // temporary directory <del> tmpImageDir := path.Join(tempdir, i.ID) <add> tmpImageDir := path.Join(tempdir, n) <ide> if err := os.Mkdir(tmpImageDir, os.FileMode(0755)); err != nil { <ide> if os.IsExist(err) { <ide> return nil <ide> func (srv *Server) exportImage(img *image.Image, tempdir string) error { <ide> } <ide> <ide> // serialize json <del> b, err := json.Marshal(i) <add> json, err := os.Create(path.Join(tmpImageDir, "json")) <ide> if err != nil { <ide> return err <ide> } <del> if err := ioutil.WriteFile(path.Join(tmpImageDir, "json"), b, os.FileMode(0644)); err != nil { <add> job := eng.Job("image_inspect", n) <add> job.Stdout.Add(json) <add> if err := job.Run(); err != nil { <ide> return err <ide> } <ide> <ide> // serialize filesystem <del> fs, err := i.TarLayer() <del> if err != nil { <del> return err <del> } <del> defer fs.Close() <del> <ide> fsTar, err := os.Create(path.Join(tmpImageDir, "layer.tar")) <ide> if err != nil { <ide> return err <ide> } <del> if written, err := io.Copy(fsTar, fs); err != nil { <del> return err <del> } else { <del> utils.Debugf("rendered layer for %s of [%d] size", i.ID, written) <del> } <del> <del> if err = fsTar.Close(); err != nil { <add> job = eng.Job("image_tarlayer", n) <add> job.Stdout.Add(fsTar) <add> if err := job.Run(); err != nil { <ide> return err <ide> } <ide> <ide> // find parent <del> if i.Parent != "" { <del> i, err = srv.ImageInspect(i.Parent) <del> if err != nil { <del> return err <del> } <del> } else { <del> i = nil <add> job = eng.Job("image_get", n) <add> info, _ := job.Stdout.AddEnv() <add> if err := job.Run(); err != nil { <add> return err <ide> } <add> n = info.Get("Parent") <ide> } <ide> return nil <ide> } <ide> func (srv *Server) ImageLoad(job *engine.Job) engine.Status { <ide> <ide> for _, d := range dirs { <ide> if d.IsDir() { <del> if err := srv.recursiveLoad(d.Name(), tmpImageDir); err != nil { <add> if err := srv.recursiveLoad(job.Eng, d.Name(), tmpImageDir); err != nil { <ide> return job.Error(err) <ide> } <ide> } <ide> func (srv *Server) ImageLoad(job *engine.Job) engine.Status { <ide> return engine.StatusOK <ide> } <ide> <del>func (srv *Server) recursiveLoad(address, tmpImageDir string) error { <del> if _, err := srv.ImageInspect(address); err != nil { <add>func (srv *Server) recursiveLoad(eng *engine.Engine, address, tmpImageDir string) error { <add> if err := eng.Job("image_get", address).Run(); err != nil { <ide> utils.Debugf("Loading %s", address) <ide> <ide> imageJson, err := ioutil.ReadFile(path.Join(tmpImageDir, "repo", address, "json")) <ide> func (srv *Server) recursiveLoad(address, tmpImageDir string) error { <ide> } <ide> if img.Parent != "" { <ide> if !srv.daemon.Graph().Exists(img.Parent) { <del> if err := srv.recursiveLoad(img.Parent, tmpImageDir); err != nil { <add> if err := srv.recursiveLoad(eng, img.Parent, tmpImageDir); err != nil { <ide> return err <ide> } <ide> } <ide> func (srv *Server) ContainerAttach(job *engine.Job) engine.Status { <ide> return engine.StatusOK <ide> } <ide> <del>func (srv *Server) ContainerInspect(name string) (*daemon.Container, error) { <del> if container := srv.daemon.Get(name); container != nil { <del> return container, nil <del> } <del> return nil, fmt.Errorf("No such container: %s", name) <del>} <del> <del>func (srv *Server) ImageInspect(name string) (*image.Image, error) { <del> if image, err := srv.daemon.Repositories().LookupImage(name); err == nil && image != nil { <del> return image, nil <del> } <del> return nil, fmt.Errorf("No such image: %s", name) <del>} <del> <del>func (srv *Server) JobInspect(job *engine.Job) engine.Status { <del> // TODO: deprecate KIND/conflict <del> if n := len(job.Args); n != 2 { <del> return job.Errorf("Usage: %s CONTAINER|IMAGE KIND", job.Name) <del> } <del> var ( <del> name = job.Args[0] <del> kind = job.Args[1] <del> object interface{} <del> conflict = job.GetenvBool("conflict") //should the job detect conflict between containers and images <del> image, errImage = srv.ImageInspect(name) <del> container, errContainer = srv.ContainerInspect(name) <del> ) <del> <del> if conflict && image != nil && container != nil { <del> return job.Errorf("Conflict between containers and images") <del> } <del> <del> switch kind { <del> case "image": <del> if errImage != nil { <del> return job.Error(errImage) <del> } <del> object = image <del> case "container": <del> if errContainer != nil { <del> return job.Error(errContainer) <del> } <del> object = &struct { <del> *daemon.Container <del> HostConfig *runconfig.HostConfig <del> }{container, container.HostConfig()} <del> default: <del> return job.Errorf("Unknown kind: %s", kind) <del> } <del> <del> b, err := json.Marshal(object) <del> if err != nil { <del> return job.Error(err) <del> } <del> job.Stdout.Write(b) <del> return engine.StatusOK <del>} <del> <ide> func (srv *Server) ContainerCopy(job *engine.Job) engine.Status { <ide> if len(job.Args) != 2 { <ide> return job.Errorf("Usage: %s CONTAINER RESOURCE\n", job.Name)
9
Javascript
Javascript
use const/let in more places
bb3c22c66f84e4a69ce99ccce2701db48a84df08
<ide><path>packages/react-dom/src/client/ReactDOM.js <ide> import { <ide> DOCUMENT_FRAGMENT_NODE, <ide> } from '../shared/HTMLNodeType'; <ide> import {ROOT_ATTRIBUTE_NAME} from '../shared/DOMProperty'; <del>var { <add>const { <ide> createElement, <ide> createTextNode, <ide> setInitialProperties, <ide> var { <ide> warnForInsertedHydratedElement, <ide> warnForInsertedHydratedText, <ide> } = ReactDOMFiberComponent; <del>var {updatedAncestorInfo} = validateDOMNesting; <del>var {precacheFiberNode, updateFiberProps} = ReactDOMComponentTree; <add>const {updatedAncestorInfo} = validateDOMNesting; <add>const {precacheFiberNode, updateFiberProps} = ReactDOMComponentTree; <ide> <ide> if (__DEV__) { <ide> var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; <ide> function shouldAutoFocusHostComponent(type: string, props: Props): boolean { <ide> return false; <ide> } <ide> <del>var DOMRenderer = ReactFiberReconciler({ <add>const DOMRenderer = ReactFiberReconciler({ <ide> getRootHostContext(rootContainerInstance: Container): HostContext { <ide> let type; <ide> let namespace; <ide> var DOMRenderer = ReactFiberReconciler({ <ide> const hostContextDev = ((hostContext: any): HostContextDev); <ide> validateDOMNesting(null, text, hostContextDev.ancestorInfo); <ide> } <del> var textNode: TextInstance = createTextNode(text, rootContainerInstance); <add> const textNode: TextInstance = createTextNode(text, rootContainerInstance); <ide> precacheFiberNode(internalInstanceHandle, textNode); <ide> return textNode; <ide> }, <ide> ReactGenericBatching.injection.injectFiberBatchedUpdates( <ide> DOMRenderer.batchedUpdates, <ide> ); <ide> <del>var warnedAboutHydrateAPI = false; <add>let warnedAboutHydrateAPI = false; <ide> <ide> function renderSubtreeIntoContainer( <ide> parentComponent: ?React$Component<any, any>, <ide> ReactRoot.prototype.unmount = function(callback) { <ide> DOMRenderer.updateContainer(null, root, null, callback); <ide> }; <ide> <del>var ReactDOM: Object = { <add>const ReactDOM: Object = { <ide> createPortal, <ide> <ide> findDOMNode( <ide> componentOrElement: Element | ?React$Component<any, any>, <ide> ): null | Element | Text { <ide> if (__DEV__) { <del> var owner = (ReactCurrentOwner.current: any); <add> let owner = (ReactCurrentOwner.current: any); <ide> if (owner !== null) { <del> var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender; <add> const warnedAboutRefsInRender = <add> owner.stateNode._warnedAboutRefsInRender; <ide> warning( <ide> warnedAboutRefsInRender, <ide> '%s is accessing findDOMNode inside its render(). ' + <ide> var ReactDOM: Object = { <ide> return (componentOrElement: any); <ide> } <ide> <del> var inst = ReactInstanceMap.get(componentOrElement); <add> const inst = ReactInstanceMap.get(componentOrElement); <ide> if (inst) { <ide> return DOMRenderer.findHostInstance(inst); <ide> } <ide><path>packages/react-dom/src/client/ReactDOMComponentTree.js <ide> import {HostComponent, HostText} from 'shared/ReactTypeOfWork'; <ide> import invariant from 'fbjs/lib/invariant'; <ide> <del>var randomKey = Math.random().toString(36).slice(2); <del>var internalInstanceKey = '__reactInternalInstance$' + randomKey; <del>var internalEventHandlersKey = '__reactEventHandlers$' + randomKey; <add>const randomKey = Math.random().toString(36).slice(2); <add>const internalInstanceKey = '__reactInternalInstance$' + randomKey; <add>const internalEventHandlersKey = '__reactEventHandlers$' + randomKey; <ide> <ide> export function precacheFiberNode(hostInst, node) { <ide> node[internalInstanceKey] = hostInst; <ide> export function getClosestInstanceFromNode(node) { <ide> } <ide> <ide> // Walk up the tree until we find an ancestor whose instance we have cached. <del> var parents = []; <add> let parents = []; <ide> while (!node[internalInstanceKey]) { <ide> parents.push(node); <ide> if (node.parentNode) { <ide> export function getClosestInstanceFromNode(node) { <ide> } <ide> } <ide> <del> var closest; <del> var inst = node[internalInstanceKey]; <add> let closest; <add> let inst = node[internalInstanceKey]; <ide> if (inst.tag === HostComponent || inst.tag === HostText) { <ide> // In Fiber, this will always be the deepest root. <ide> return inst; <ide> export function getClosestInstanceFromNode(node) { <ide> * instance, or null if the node was not rendered by this React. <ide> */ <ide> export function getInstanceFromNode(node) { <del> var inst = node[internalInstanceKey]; <add> const inst = node[internalInstanceKey]; <ide> if (inst) { <ide> if (inst.tag === HostComponent || inst.tag === HostText) { <ide> return inst; <ide><path>packages/react-dom/src/client/ReactInputSelection.js <ide> function isInDocument(node) { <ide> */ <ide> <ide> export function hasSelectionCapabilities(elem) { <del> var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); <add> const nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); <ide> return ( <ide> nodeName && <ide> ((nodeName === 'input' && elem.type === 'text') || <ide> export function hasSelectionCapabilities(elem) { <ide> } <ide> <ide> export function getSelectionInformation() { <del> var focusedElem = getActiveElement(); <add> const focusedElem = getActiveElement(); <ide> return { <ide> focusedElem: focusedElem, <ide> selectionRange: hasSelectionCapabilities(focusedElem) <ide> export function getSelectionInformation() { <ide> * nodes and place them back in, resulting in focus being lost. <ide> */ <ide> export function restoreSelection(priorSelectionInformation) { <del> var curFocusedElem = getActiveElement(); <del> var priorFocusedElem = priorSelectionInformation.focusedElem; <del> var priorSelectionRange = priorSelectionInformation.selectionRange; <add> const curFocusedElem = getActiveElement(); <add> const priorFocusedElem = priorSelectionInformation.focusedElem; <add> const priorSelectionRange = priorSelectionInformation.selectionRange; <ide> if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { <ide> if (hasSelectionCapabilities(priorFocusedElem)) { <ide> setSelection(priorFocusedElem, priorSelectionRange); <ide> export function restoreSelection(priorSelectionInformation) { <ide> * -@return {start: selectionStart, end: selectionEnd} <ide> */ <ide> export function getSelection(input) { <del> var selection; <add> let selection; <ide> <ide> if ('selectionStart' in input) { <ide> // Modern browser with input or textarea. <ide> export function getSelection(input) { <ide> * -@offsets Object of same form that is returned from get* <ide> */ <ide> export function setSelection(input, offsets) { <del> var start = offsets.start; <del> var end = offsets.end; <add> let {start, end} = offsets; <ide> if (end === undefined) { <ide> end = start; <ide> } <ide><path>packages/react-dom/src/client/getNodeForCharacterOffset.js <ide> function getSiblingNode(node) { <ide> * @return {?object} <ide> */ <ide> function getNodeForCharacterOffset(root, offset) { <del> var node = getLeafNode(root); <del> var nodeStart = 0; <del> var nodeEnd = 0; <add> let node = getLeafNode(root); <add> let nodeStart = 0; <add> let nodeEnd = 0; <ide> <ide> while (node) { <ide> if (node.nodeType === TEXT_NODE) { <ide><path>packages/react-dom/src/client/getTextContentAccessor.js <ide> <ide> import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment'; <ide> <del>var contentKey = null; <add>let contentKey = null; <ide> <ide> /** <ide> * Gets the key used to access text content on a DOM node. <ide><path>packages/react-dom/src/client/inputValueTracking.js <ide> type WrapperState = {_valueTracker: ?ValueTracker}; <ide> type ElementWithValueTracker = HTMLInputElement & WrapperState; <ide> <ide> function isCheckable(elem: HTMLInputElement) { <del> var type = elem.type; <del> var nodeName = elem.nodeName; <add> const type = elem.type; <add> const nodeName = elem.nodeName; <ide> return ( <ide> nodeName && <ide> nodeName.toLowerCase() === 'input' && <ide> function detachTracker(node: ElementWithValueTracker) { <ide> } <ide> <ide> function getValueFromNode(node: HTMLInputElement): string { <del> var value = ''; <add> let value = ''; <ide> if (!node) { <ide> return value; <ide> } <ide> function getValueFromNode(node: HTMLInputElement): string { <ide> } <ide> <ide> function trackValueOnNode(node: any): ?ValueTracker { <del> var valueField = isCheckable(node) ? 'checked' : 'value'; <del> var descriptor = Object.getOwnPropertyDescriptor( <add> const valueField = isCheckable(node) ? 'checked' : 'value'; <add> const descriptor = Object.getOwnPropertyDescriptor( <ide> node.constructor.prototype, <ide> valueField, <ide> ); <ide> <del> var currentValue = '' + node[valueField]; <add> let currentValue = '' + node[valueField]; <ide> <ide> // if someone has already defined a value or Safari, then bail <ide> // and don't track value will cause over reporting of changes, <ide> function trackValueOnNode(node: any): ?ValueTracker { <ide> }, <ide> }); <ide> <del> var tracker = { <add> const tracker = { <ide> getValue() { <ide> return currentValue; <ide> }, <ide> export function updateValueIfChanged(node: ElementWithValueTracker) { <ide> return false; <ide> } <ide> <del> var tracker = getTracker(node); <add> const tracker = getTracker(node); <ide> // if there is no tracker at this point it's unlikely <ide> // that trying again will succeed <ide> if (!tracker) { <ide> return true; <ide> } <ide> <del> var lastValue = tracker.getValue(); <del> var nextValue = getValueFromNode(node); <add> const lastValue = tracker.getValue(); <add> const nextValue = getValueFromNode(node); <ide> if (nextValue !== lastValue) { <ide> tracker.setValue(nextValue); <ide> return true; <ide> export function updateValueIfChanged(node: ElementWithValueTracker) { <ide> } <ide> <ide> export function stopTracking(node: ElementWithValueTracker) { <del> var tracker = getTracker(node); <add> const tracker = getTracker(node); <ide> if (tracker) { <ide> tracker.stopTracking(); <ide> } <ide><path>packages/react-dom/src/client/setInnerHTML.js <ide> import createMicrosoftUnsafeLocalFunction <ide> from '../shared/createMicrosoftUnsafeLocalFunction'; <ide> <ide> // SVG temp container for IE lacking innerHTML <del>var reusableSVGContainer; <add>let reusableSVGContainer; <ide> <ide> /** <ide> * Set the innerHTML property of a node <ide> var reusableSVGContainer; <ide> * @param {string} html <ide> * @internal <ide> */ <del>var setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) { <add>const setInnerHTML = createMicrosoftUnsafeLocalFunction(function(node, html) { <ide> // IE does not have innerHTML for SVG nodes, so instead we inject the <ide> // new markup in a temp node and then move the child nodes across into <ide> // the target node <add> <ide> if (node.namespaceURI === Namespaces.svg && !('innerHTML' in node)) { <ide> reusableSVGContainer = <ide> reusableSVGContainer || document.createElement('div'); <ide> reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>'; <del> var svgNode = reusableSVGContainer.firstChild; <add> const svgNode = reusableSVGContainer.firstChild; <ide> while (node.firstChild) { <ide> node.removeChild(node.firstChild); <ide> } <ide><path>packages/react-dom/src/client/setTextContent.js <ide> import {TEXT_NODE} from '../shared/HTMLNodeType'; <ide> */ <ide> var setTextContent = function(node, text) { <ide> if (text) { <del> var firstChild = node.firstChild; <add> let firstChild = node.firstChild; <ide> <ide> if ( <ide> firstChild && <ide><path>packages/react-dom/src/client/validateDOMNesting.js <ide> import warning from 'fbjs/lib/warning'; <ide> import ReactDebugCurrentFiber <ide> from 'react-reconciler/src/ReactDebugCurrentFiber'; <ide> <del>var {getCurrentFiberStackAddendum} = ReactDebugCurrentFiber; <add>const {getCurrentFiberStackAddendum} = ReactDebugCurrentFiber; <ide> var validateDOMNesting = emptyFunction; <ide> <ide> if (__DEV__) { <ide> if (__DEV__) { <ide> <ide> validateDOMNesting = function(childTag, childText, ancestorInfo) { <ide> ancestorInfo = ancestorInfo || emptyAncestorInfo; <del> var parentInfo = ancestorInfo.current; <del> var parentTag = parentInfo && parentInfo.tag; <add> const parentInfo = ancestorInfo.current; <add> const parentTag = parentInfo && parentInfo.tag; <ide> <ide> if (childText != null) { <ide> warning( <ide> if (__DEV__) { <ide> childTag = '#text'; <ide> } <ide> <del> var invalidParent = isTagValidWithParent(childTag, parentTag) <add> const invalidParent = isTagValidWithParent(childTag, parentTag) <ide> ? null <ide> : parentInfo; <del> var invalidAncestor = invalidParent <add> const invalidAncestor = invalidParent <ide> ? null <ide> : findInvalidAncestorForTag(childTag, ancestorInfo); <del> var invalidParentOrAncestor = invalidParent || invalidAncestor; <add> const invalidParentOrAncestor = invalidParent || invalidAncestor; <ide> if (!invalidParentOrAncestor) { <ide> return; <ide> } <ide> <del> var ancestorTag = invalidParentOrAncestor.tag; <del> var addendum = getCurrentFiberStackAddendum(); <add> const ancestorTag = invalidParentOrAncestor.tag; <add> const addendum = getCurrentFiberStackAddendum(); <ide> <del> var warnKey = <add> const warnKey = <ide> !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum; <ide> if (didWarn[warnKey]) { <ide> return; <ide> } <ide> didWarn[warnKey] = true; <ide> <del> var tagDisplayName = childTag; <del> var whitespaceInfo = ''; <add> let tagDisplayName = childTag; <add> let whitespaceInfo = ''; <ide> if (childTag === '#text') { <ide> if (/\S/.test(childText)) { <ide> tagDisplayName = 'Text nodes'; <ide> if (__DEV__) { <ide> } <ide> <ide> if (invalidParent) { <del> var info = ''; <add> let info = ''; <ide> if (ancestorTag === 'table' && childTag === 'tr') { <ide> info += <ide> ' Add a <tbody> to your code to match the DOM tree generated by ' + <ide> if (__DEV__) { <ide> // For testing <ide> validateDOMNesting.isTagValidInContext = function(tag, ancestorInfo) { <ide> ancestorInfo = ancestorInfo || emptyAncestorInfo; <del> var parentInfo = ancestorInfo.current; <del> var parentTag = parentInfo && parentInfo.tag; <add> const parentInfo = ancestorInfo.current; <add> const parentTag = parentInfo && parentInfo.tag; <ide> return ( <ide> isTagValidWithParent(tag, parentTag) && <ide> !findInvalidAncestorForTag(tag, ancestorInfo)
9
Javascript
Javascript
flow type scrollview
b1276622791d5dbe4199bb075f473908c3e62b31
<ide><path>Libraries/Components/ScrollView/InternalScrollViewType.js <add>/** <add> * Copyright (c) 2015-present, Facebook, Inc. <add> * <add> * This source code is licensed under the MIT license found in the <add> * LICENSE file in the root directory of this source tree. <add> * <add> * @format <add> * @flow <add> */ <add> <add>const React = require('React'); <add> <add>// This class is purely a facsimile of ScrollView so that we can <add>// properly type it with Flow before migrating ScrollView off of <add>// createReactClass. If there are things missing here that are in <add>// ScrollView, that is unintentional. <add>class InternalScrollViewType<Props> extends React.Component<Props> { <add> scrollTo( <add> y?: number | {x?: number, y?: number, animated?: boolean}, <add> x?: number, <add> animated?: boolean, <add> ) {} <add> <add> flashScrollIndicators() {} <add> scrollToEnd(options?: {animated?: boolean}) {} <add> scrollWithoutAnimationTo(y: number = 0, x: number = 0) {} <add> setNativeProps(props: Object) {} <add> <add> getScrollResponder(): any {} <add> getScrollableNode(): any {} <add> getInnerViewNode(): any {} <add> <add> scrollResponderScrollNativeHandleToKeyboard( <add> nodeHandle: any, <add> additionalOffset?: number, <add> preventNegativeScrollOffset?: boolean, <add> ) {} <add> <add> scrollResponderScrollTo( <add> x?: number | {x?: number, y?: number, animated?: boolean}, <add> y?: number, <add> animated?: boolean, <add> ) {} <add>} <add> <add>module.exports = InternalScrollViewType; <ide><path>Libraries/Components/ScrollView/ScrollView.js <ide> const StyleSheetPropType = require('StyleSheetPropType'); <ide> const View = require('View'); <ide> const ViewPropTypes = require('ViewPropTypes'); <ide> const ViewStylePropTypes = require('ViewStylePropTypes'); <add>const InternalScrollViewType = require('InternalScrollViewType'); <ide> <ide> const createReactClass = require('create-react-class'); <ide> const dismissKeyboard = require('dismissKeyboard'); <ide> const requireNativeComponent = require('requireNativeComponent'); <ide> const warning = require('fbjs/lib/warning'); <ide> const resolveAssetSource = require('resolveAssetSource'); <ide> <add>import type {PressEvent} from 'CoreEventTypes'; <add>import type {EdgeInsetsProp} from 'EdgeInsetsPropType'; <ide> import type {NativeMethodsMixinType} from 'ReactNativeTypes'; <add>import type {ViewStyleProp} from 'StyleSheet'; <add>import type {ViewProps} from 'ViewPropTypes'; <add>import type {PointProp} from 'PointPropType'; <add> <add>import type {ColorValue} from 'StyleSheetTypes'; <add> <add>type TouchableProps = $ReadOnly<{| <add> onTouchStart?: (event: PressEvent) => void, <add> onTouchMove?: (event: PressEvent) => void, <add> onTouchEnd?: (event: PressEvent) => void, <add> onTouchCancel?: (event: PressEvent) => void, <add> onTouchEndCapture?: (event: PressEvent) => void, <add>|}>; <add> <add>type IOSProps = $ReadOnly<{| <add> automaticallyAdjustContentInsets?: ?boolean, <add> contentInset?: ?EdgeInsetsProp, <add> contentOffset?: ?PointProp, <add> bounces?: ?boolean, <add> bouncesZoom?: ?boolean, <add> alwaysBounceHorizontal?: ?boolean, <add> alwaysBounceVertical?: ?boolean, <add> centerContent?: ?boolean, <add> decelerationRate?: ?('fast' | 'normal' | number), <add> indicatorStyle?: ?('default' | 'black' | 'white'), <add> directionalLockEnabled?: ?boolean, <add> canCancelContentTouches?: ?boolean, <add> maintainVisibleContentPosition?: ?$ReadOnly<{| <add> minIndexForVisible: number, <add> autoscrollToTopThreshold?: ?number, <add> |}>, <add> maximumZoomScale?: ?number, <add> minimumZoomScale?: ?number, <add> pinchGestureEnabled?: ?boolean, <add> scrollEventThrottle?: ?number, <add> scrollIndicatorInsets?: ?EdgeInsetsProp, <add> scrollsToTop?: ?boolean, <add> showsHorizontalScrollIndicator?: ?boolean, <add> snapToAlignment?: ?('start' | 'center' | 'end'), <add> zoomScale?: ?number, <add> contentInsetAdjustmentBehavior?: ?( <add> | 'automatic' <add> | 'scrollableAxes' <add> | 'never' <add> | 'always' <add> ), <add> DEPRECATED_sendUpdatedChildFrames?: ?boolean, <add>|}>; <add> <add>type AndroidProps = $ReadOnly<{| <add> nestedScrollEnabled?: ?boolean, <add> endFillColor?: ?ColorValue, <add> scrollPerfTag?: ?string, <add> overScrollMode?: ?('auto' | 'always' | 'never'), <add>|}>; <add> <add>type VRProps = $ReadOnly<{| <add> scrollBarThumbImage?: ?($ReadOnly<{||}> | number), <add>|}>; <add> <add>type Props = $ReadOnly<{| <add> ...ViewProps, <add> ...TouchableProps, <add> ...IOSProps, <add> ...AndroidProps, <add> ...VRProps, <add> <add> contentContainerStyle?: ?ViewStyleProp, <add> horizontal?: ?boolean, <add> invertStickyHeaders?: ?boolean, <add> keyboardDismissMode?: ?( <add> | 'none' // default <add> | 'on-drag' // cross-platform <add> | 'interactive' <add> ), // ios only <add> // $FlowFixMe Issues found when typing ScrollView <add> keyboardShouldPersistTaps?: ?('always' | 'never' | 'handled' | false | true), <add> onMomentumScrollBegin?: ?Function, <add> onMomentumScrollEnd?: ?Function, <add> <add> onScroll?: ?Function, <add> onScrollBeginDrag?: ?Function, <add> onScrollEndDrag?: ?Function, <add> onContentSizeChange?: ?Function, <add> onKeyboardDidShow?: (event: PressEvent) => void, <add> pagingEnabled?: ?boolean, <add> scrollEnabled?: ?boolean, <add> showsVerticalScrollIndicator?: ?boolean, <add> stickyHeaderIndices?: ?$ReadOnlyArray<number>, <add> snapToInterval?: ?number, <add> removeClippedSubviews?: ?boolean, <add> refreshControl?: ?React.Element<any>, <add> style?: ?ViewStyleProp, <add> children?: React.Node, <add>|}>; <ide> <ide> /** <ide> * Component that wraps platform ScrollView while providing <ide> import type {NativeMethodsMixinType} from 'ReactNativeTypes'; <ide> * multiple columns, infinite scroll loading, or any number of other features it <ide> * supports out of the box. <ide> */ <del>// $FlowFixMe(>=0.41.0) <ide> const ScrollView = createReactClass({ <ide> displayName: 'ScrollView', <ide> propTypes: { <ide> const ScrollView = createReactClass({ <ide> // $FlowFixMe Invalid prop usage <ide> hasStickyHeaders && React.Children.toArray(this.props.children); <ide> const children = hasStickyHeaders <del> // $FlowFixMe Invalid prop usage <del> ? childArray.map((child, index) => { <add> ? // $FlowFixMe Invalid prop usage <add> childArray.map((child, index) => { <ide> // $FlowFixMe Invalid prop usage <ide> const indexOfIndex = child ? stickyHeaderIndices.indexOf(index) : -1; <ide> if (indexOfIndex > -1) { <ide> const ScrollView = createReactClass({ <ide> return child; <ide> } <ide> }) <del> // $FlowFixMe Invalid prop usage <del> : this.props.children; <add> : // $FlowFixMe Invalid prop usage <add> this.props.children; <ide> const contentContainer = ( <ide> <ScrollContentContainerViewClass <ide> {...contentSizeChangeProps} <ide> const ScrollView = createReactClass({ <ide> onResponderGrant: this.scrollResponderHandleResponderGrant, <ide> onResponderReject: this.scrollResponderHandleResponderReject, <ide> onResponderRelease: this.scrollResponderHandleResponderRelease, <add> // $FlowFixMe <ide> onResponderTerminate: this.scrollResponderHandleTerminate, <ide> onResponderTerminationRequest: this <ide> .scrollResponderHandleTerminationRequest, <ide> const ScrollView = createReactClass({ <ide> }, <ide> }); <ide> <add>const TypedScrollView = ((ScrollView: any): Class< <add> InternalScrollViewType<Props>, <add>>); <add> <ide> const styles = StyleSheet.create({ <ide> baseVertical: { <ide> flexGrow: 1, <ide> if (Platform.OS === 'android') { <ide> RCTScrollContentView = requireNativeComponent('RCTScrollContentView', View); <ide> } <ide> <del>module.exports = ScrollView; <add>module.exports = TypedScrollView; <ide><path>Libraries/StyleSheet/EdgeInsetsPropType.js <ide> const EdgeInsetsPropType = PropTypes.shape({ <ide> right: PropTypes.number, <ide> }); <ide> <del>export type EdgeInsetsProp = {| <del> +top: number, <del> +left: number, <del> +bottom: number, <del> +right: number, <del>|}; <add>export type EdgeInsetsProp = $ReadOnly<{| <add> top?: ?number, <add> left?: ?number, <add> bottom?: ?number, <add> right?: ?number, <add>|}>; <ide> <ide> module.exports = EdgeInsetsPropType; <ide><path>Libraries/StyleSheet/PointPropType.js <ide> const PointPropType = PropTypes.shape({ <ide> y: PropTypes.number, <ide> }); <ide> <add>export type PointProp = $ReadOnly<{ <add> x: number, <add> y: number, <add>}>; <add> <ide> module.exports = PointPropType;
4
Mixed
Javascript
add deprecation code to expectwarning
8fb4ea9f75c8c82c46286bd5ca0c1115c4a5e956
<ide><path>test/common/README.md <ide> Indicates if there is more than 1gb of total memory. <ide> returned function has not been called exactly `exact` number of times when the <ide> test is complete, then the test will fail. <ide> <del>### expectWarning(name, expected) <add>### expectWarning(name, expected, code) <ide> * `name` [&lt;string>] <ide> * `expected` [&lt;string>] | [&lt;Array>] <add>* `code` [&lt;string>] <ide> <del>Tests whether `name` and `expected` are part of a raised warning. <add>Tests whether `name`, `expected`, and `code` are part of a raised warning. If <add>an expected warning does not have a code then `common.noWarnCode` can be used <add>to indicate this. <add> <add>### noWarnCode <add>See `common.expectWarning()` for usage. <ide> <ide> ### fileExists(pathname) <ide> * pathname [&lt;string>] <ide><path>test/common/index.js <ide> exports.isAlive = function isAlive(pid) { <ide> } <ide> }; <ide> <del>function expectWarning(name, expectedMessages) { <add>exports.noWarnCode = 'no_expected_warning_code'; <add> <add>function expectWarning(name, expected) { <add> const map = new Map(expected); <ide> return exports.mustCall((warning) => { <ide> assert.strictEqual(warning.name, name); <del> assert.ok(expectedMessages.includes(warning.message), <add> assert.ok(map.has(warning.message), <ide> `unexpected error message: "${warning.message}"`); <add> const code = map.get(warning.message); <add> if (code === undefined) { <add> throw new Error('An error code must be specified or use ' + <add> 'common.noWarnCode if there is no error code. The error ' + <add> `code for this warning was ${warning.code}`); <add> } <add> if (code !== exports.noWarnCode) { <add> assert.strictEqual(warning.code, code); <add> } <ide> // Remove a warning message after it is seen so that we guarantee that we <ide> // get each message only once. <del> expectedMessages.splice(expectedMessages.indexOf(warning.message), 1); <del> }, expectedMessages.length); <add> map.delete(expected); <add> }, map.size); <ide> } <ide> <del>function expectWarningByName(name, expected) { <add>function expectWarningByName(name, expected, code) { <ide> if (typeof expected === 'string') { <del> expected = [expected]; <add> expected = [[expected, code]]; <ide> } <ide> process.on('warning', expectWarning(name, expected)); <ide> } <ide> function expectWarningByMap(warningMap) { <ide> const catchWarning = {}; <ide> Object.keys(warningMap).forEach((name) => { <ide> let expected = warningMap[name]; <del> if (typeof expected === 'string') { <del> expected = [expected]; <add> if (!Array.isArray(expected)) { <add> throw new Error('warningMap entries must be arrays consisting of two ' + <add> 'entries: [message, warningCode]'); <add> } <add> if (!(Array.isArray(expected[0]))) { <add> if (expected.length === 0) { <add> return; <add> } <add> expected = [[expected[0], expected[1]]]; <ide> } <ide> catchWarning[name] = expectWarning(name, expected); <ide> }); <ide> function expectWarningByMap(warningMap) { <ide> // accepts a warning name and description or array of descriptions or a map <ide> // of warning names to description(s) <ide> // ensures a warning is generated for each name/description pair <del>exports.expectWarning = function(nameOrMap, expected) { <add>exports.expectWarning = function(nameOrMap, expected, code) { <ide> if (typeof nameOrMap === 'string') { <del> expectWarningByName(nameOrMap, expected); <add> expectWarningByName(nameOrMap, expected, code); <ide> } else { <ide> expectWarningByMap(nameOrMap); <ide> } <ide><path>test/parallel/test-assert-fail-deprecation.js <ide> const assert = require('assert'); <ide> common.expectWarning( <ide> 'DeprecationWarning', <ide> 'assert.fail() with more than one argument is deprecated. ' + <del> 'Please use assert.strictEqual() instead or only pass a message.' <add> 'Please use assert.strictEqual() instead or only pass a message.', <add> 'DEP0094' <ide> ); <ide> <ide> // Two args only, operator defaults to '!=' <ide><path>test/parallel/test-buffer-pending-deprecation.js <ide> const bufferWarning = 'The Buffer() and new Buffer() constructors are not ' + <ide> 'Buffer.allocUnsafe(), or Buffer.from() construction ' + <ide> 'methods instead.'; <ide> <del>common.expectWarning('DeprecationWarning', bufferWarning); <add>common.expectWarning('DeprecationWarning', bufferWarning, 'DEP0005'); <ide> <ide> // This is used to make sure that a warning is only emitted once even though <ide> // `new Buffer()` is called twice. <ide><path>test/parallel/test-child-process-custom-fds.js <ide> const oldSpawnSync = internalCp.spawnSync; <ide> { <ide> const msg = 'child_process: options.customFds option is deprecated. ' + <ide> 'Use options.stdio instead.'; <del> common.expectWarning('DeprecationWarning', msg); <add> common.expectWarning('DeprecationWarning', msg, 'DEP0006'); <ide> <ide> const customFds = [-1, process.stdout.fd, process.stderr.fd]; <ide> internalCp.spawnSync = common.mustCall(function(opts) { <ide><path>test/parallel/test-crypto-authenticated.js <ide> const errMessages = { <ide> const ciphers = crypto.getCiphers(); <ide> <ide> const expectedWarnings = common.hasFipsCrypto ? <del> [] : ['Use Cipheriv for counter mode of aes-192-gcm']; <add> [] : [['Use Cipheriv for counter mode of aes-192-gcm', <add> common.noWarnCode]]; <ide> <ide> const expectedDeprecationWarnings = [0, 1, 2, 6, 9, 10, 11, 17] <del> .map((i) => `Permitting authentication tag lengths of ${i} bytes is ` + <del> 'deprecated. Valid GCM tag lengths are 4, 8, 12, 13, 14, 15, 16.'); <add> .map((i) => [`Permitting authentication tag lengths of ${i} bytes is ` + <add> 'deprecated. Valid GCM tag lengths are 4, 8, 12, 13, 14, 15, 16.', <add> 'DEP0090']); <ide> <del>expectedDeprecationWarnings.push('crypto.DEFAULT_ENCODING is deprecated.'); <add>expectedDeprecationWarnings.push(['crypto.DEFAULT_ENCODING is deprecated.', <add> 'DEP0091']); <ide> <ide> common.expectWarning({ <ide> Warning: expectedWarnings, <ide><path>test/parallel/test-crypto-cipher-decipher.js <ide> testCipher2(Buffer.from('0123456789abcdef')); <ide> const data = Buffer.from('test-crypto-cipher-decipher'); <ide> <ide> common.expectWarning('Warning', <del> 'Use Cipheriv for counter mode of aes-256-gcm'); <add> 'Use Cipheriv for counter mode of aes-256-gcm', <add> common.noWarnCode); <ide> <ide> const cipher = crypto.createCipher('aes-256-gcm', key); <ide> cipher.setAAD(aadbuf); <ide><path>test/parallel/test-crypto-deprecated.js <ide> const crypto = require('crypto'); <ide> const tls = require('tls'); <ide> <ide> common.expectWarning('DeprecationWarning', [ <del> 'crypto.Credentials is deprecated. Use tls.SecureContext instead.', <del> 'crypto.createCredentials is deprecated. Use tls.createSecureContext ' + <del> 'instead.', <del> 'crypto.Decipher.finaltol is deprecated. Use crypto.Decipher.final instead.' <add> ['crypto.Credentials is deprecated. Use tls.SecureContext instead.', <add> 'DEP0011'], <add> ['crypto.createCredentials is deprecated. Use tls.createSecureContext ' + <add> 'instead.', 'DEP0010'], <add> ['crypto.Decipher.finaltol is deprecated. Use crypto.Decipher.final instead.', <add> 'DEP0105'] <ide> ]); <ide> <ide> // Accessing the deprecated function is enough to trigger the warning event. <ide><path>test/parallel/test-fs-filehandle.js <ide> let fdnum; <ide> <ide> common.expectWarning( <ide> 'Warning', <del> `Closing file descriptor ${fdnum} on garbage collection` <add> `Closing file descriptor ${fdnum} on garbage collection`, <add> common.noWarnCode <ide> ); <ide> <ide> gc(); // eslint-disable-line no-undef <ide><path>test/parallel/test-fs-truncate-fd.js <ide> const msg = 'Using fs.truncate with a file descriptor is deprecated.' + <ide> ' Please use fs.ftruncate with a file descriptor instead.'; <ide> <ide> <del>common.expectWarning('DeprecationWarning', msg); <add>common.expectWarning('DeprecationWarning', msg, 'DEP0081'); <ide> fs.truncate(fd, 5, common.mustCall(function(err) { <ide> assert.ok(!err); <ide> assert.strictEqual(fs.readFileSync(filename, 'utf8'), 'hello'); <ide><path>test/parallel/test-fs-truncate.js <ide> fs.ftruncateSync(fd); <ide> stat = fs.statSync(filename); <ide> assert.strictEqual(stat.size, 0); <ide> <del>// Check truncateSync <del>common.expectWarning('DeprecationWarning', msg); <add>// truncateSync <add>common.expectWarning('DeprecationWarning', msg, 'DEP0081'); <ide> fs.truncateSync(fd); <ide> <ide> fs.closeSync(fd); <ide><path>test/parallel/test-net-server-connections.js <ide> const server = new net.Server(); <ide> const expectedWarning = 'Server.connections property is deprecated. ' + <ide> 'Use Server.getConnections method instead.'; <ide> <del>common.expectWarning('DeprecationWarning', expectedWarning); <add>common.expectWarning('DeprecationWarning', expectedWarning, 'DEP0020'); <ide> <ide> // test that server.connections property is no longer enumerable now that it <ide> // has been marked as deprecated <ide><path>test/parallel/test-performance-warning.js <ide> performance.maxEntries = 1; <ide> ); <ide> }); <ide> <del>common.expectWarning('Warning', [ <del> 'Possible perf_hooks memory leak detected. There are 2 entries in the ' + <add>common.expectWarning('Warning', 'Possible perf_hooks memory leak detected. ' + <add> 'There are 2 entries in the ' + <ide> 'Performance Timeline. Use the clear methods to remove entries that are no ' + <ide> 'longer needed or set performance.maxEntries equal to a higher value ' + <del> '(currently the maxEntries is 1).']); <add> '(currently the maxEntries is 1).', common.noWarnCode); <ide> <ide> performance.mark('test'); <ide><path>test/parallel/test-process-assert.js <ide> const assert = require('assert'); <ide> <ide> common.expectWarning( <ide> 'DeprecationWarning', <del> 'process.assert() is deprecated. Please use the `assert` module instead.' <add> 'process.assert() is deprecated. Please use the `assert` module instead.', <add> 'DEP0100' <ide> ); <ide> <ide> assert.strictEqual(process.assert(1, 'error'), undefined); <ide><path>test/parallel/test-process-emit-warning-from-native.js <ide> const key = '0123456789'; <ide> <ide> { <ide> common.expectWarning('Warning', <del> 'Use Cipheriv for counter mode of aes-256-gcm'); <add> 'Use Cipheriv for counter mode of aes-256-gcm', <add> common.noWarnCode); <ide> <ide> // Emits regular warning expected by expectWarning() <ide> crypto.createCipher('aes-256-gcm', key); <ide><path>test/parallel/test-process-env-deprecation.js <ide> common.expectWarning( <ide> 'DeprecationWarning', <ide> 'Assigning any value other than a string, number, or boolean to a ' + <ide> 'process.env property is deprecated. Please make sure to convert the value ' + <del> 'to a string before setting process.env with it.' <add> 'to a string before setting process.env with it.', <add> 'DEP0104' <ide> ); <ide> <ide> process.env.ABC = undefined; <ide><path>test/parallel/test-promises-unhandled-proxy-rejections.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> <del>const expectedDeprecationWarning = 'Unhandled promise rejections are ' + <add>const expectedDeprecationWarning = ['Unhandled promise rejections are ' + <ide> 'deprecated. In the future, promise ' + <ide> 'rejections that are not handled will ' + <ide> 'terminate the Node.js process with a ' + <del> 'non-zero exit code.'; <del>const expectedPromiseWarning = 'Unhandled promise rejection. ' + <add> 'non-zero exit code.', 'DEP0018']; <add>const expectedPromiseWarning = ['Unhandled promise rejection. ' + <ide> 'This error originated either by throwing ' + <ide> 'inside of an async function without a catch ' + <ide> 'block, or by rejecting a promise which was ' + <del> 'not handled with .catch(). (rejection id: 1)'; <add> 'not handled with .catch(). (rejection id: 1)', common.noWarnCode]; <ide> <ide> function throwErr() { <ide> throw new Error('Error from proxy'); <ide><path>test/parallel/test-promises-unhandled-symbol-rejections.js <ide> 'use strict'; <ide> const common = require('../common'); <ide> <del>const expectedValueWarning = 'Symbol()'; <del>const expectedDeprecationWarning = 'Unhandled promise rejections are ' + <add>const expectedValueWarning = ['Symbol()', common.noWarnCode]; <add>const expectedDeprecationWarning = ['Unhandled promise rejections are ' + <ide> 'deprecated. In the future, promise ' + <ide> 'rejections that are not handled will ' + <ide> 'terminate the Node.js process with a ' + <del> 'non-zero exit code.'; <del>const expectedPromiseWarning = 'Unhandled promise rejection. ' + <add> 'non-zero exit code.', common.noWarnCode]; <add>const expectedPromiseWarning = ['Unhandled promise rejection. ' + <ide> 'This error originated either by throwing ' + <ide> 'inside of an async function without a catch ' + <ide> 'block, or by rejecting a promise which was ' + <del> 'not handled with .catch(). (rejection id: 1)'; <add> 'not handled with .catch(). (rejection id: 1)', common.noWarnCode]; <ide> <ide> common.expectWarning({ <ide> DeprecationWarning: expectedDeprecationWarning, <ide><path>test/parallel/test-repl-deprecations.js <ide> function testParseREPLKeyword() { <ide> const server = repl.start({ prompt: '> ' }); <ide> const warn = 'REPLServer.parseREPLKeyword() is deprecated'; <ide> <del> common.expectWarning('DeprecationWarning', warn); <add> common.expectWarning('DeprecationWarning', warn, 'DEP0075'); <ide> assert.ok(server.parseREPLKeyword('clear')); <ide> assert.ok(!server.parseREPLKeyword('tacos')); <ide> server.close(); <ide><path>test/parallel/test-repl-memory-deprecation.js <ide> function testMemory() { <ide> const server = repl.start({ prompt: '> ' }); <ide> const warn = 'REPLServer.memory() is deprecated'; <ide> <del> common.expectWarning('DeprecationWarning', warn); <add> common.expectWarning('DeprecationWarning', warn, 'DEP0082'); <ide> assert.strictEqual(server.memory(), undefined); <ide> server.close(); <ide> } <ide><path>test/parallel/test-repl-turn-off-editor-mode.js <ide> function testTurnOffEditorMode() { <ide> const server = repl.start({ prompt: '> ' }); <ide> const warn = 'REPLServer.turnOffEditorMode() is deprecated'; <ide> <del> common.expectWarning('DeprecationWarning', warn); <add> common.expectWarning('DeprecationWarning', warn, 'DEP0078'); <ide> server.turnOffEditorMode(); <ide> server.close(); <ide> } <ide><path>test/parallel/test-require-deps-deprecation.js <ide> const deps = [ <ide> ]; <ide> <ide> common.expectWarning('DeprecationWarning', deprecatedModules.map((m) => { <del> return `Requiring Node.js-bundled '${m}' module is deprecated. ` + <del> 'Please install the necessary module locally.'; <add> return [`Requiring Node.js-bundled '${m}' module is deprecated. ` + <add> 'Please install the necessary module locally.', 'DEP0084']; <ide> })); <ide> <ide> for (const m of deprecatedModules) { <ide><path>test/parallel/test-tls-dhe.js <ide> const ciphers = 'DHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; <ide> <ide> // Test will emit a warning because the DH parameter size is < 2048 bits <ide> common.expectWarning('SecurityWarning', <del> 'DH parameter is less than 2048 bits'); <add> 'DH parameter is less than 2048 bits', <add> common.noWarnCode); <ide> <ide> function loadDHParam(n) { <ide> const params = [`dh${n}.pem`]; <ide><path>test/parallel/test-tls-ecdh-disable.js <ide> const options = { <ide> }; <ide> <ide> common.expectWarning('DeprecationWarning', <del> '{ ecdhCurve: false } is deprecated.'); <add> '{ ecdhCurve: false } is deprecated.', <add> 'DEP0083'); <ide> <ide> const server = tls.createServer(options, common.mustNotCall()); <ide> <ide><path>test/parallel/test-tls-legacy-deprecated.js <ide> const tls = require('tls'); <ide> <ide> common.expectWarning( <ide> 'DeprecationWarning', <del> 'tls.createSecurePair() is deprecated. Please use tls.TLSSocket instead.' <add> 'tls.createSecurePair() is deprecated. Please use tls.TLSSocket instead.', <add> 'DEP0064' <ide> ); <ide> <ide> tls.createSecurePair(); <ide><path>test/parallel/test-tls-parse-cert-string.js <ide> common.restoreStderr(); <ide> { <ide> common.expectWarning('DeprecationWarning', <ide> 'tls.parseCertString() is deprecated. ' + <del> 'Please use querystring.parse() instead.'); <add> 'Please use querystring.parse() instead.', <add> 'DEP0076'); <ide> <ide> const ret = tls.parseCertString('foo=bar'); <ide> assert.deepStrictEqual(ret, { __proto__: null, foo: 'bar' }); <ide><path>test/parallel/test-util-inspect-deprecated.js <ide> const util = require('util'); <ide> // `common.expectWarning` will expect the warning exactly one time only <ide> common.expectWarning( <ide> 'DeprecationWarning', <del> 'Custom inspection function on Objects via .inspect() is deprecated' <add> 'Custom inspection function on Objects via .inspect() is deprecated', <add> 'DEP0079' <ide> ); <ide> util.inspect(target); // should emit deprecation warning <ide> util.inspect(target); // should not emit deprecation warning <ide><path>test/parallel/test-util.js <ide> assert.strictEqual(util.isFunction(), false); <ide> assert.strictEqual(util.isFunction('string'), false); <ide> <ide> common.expectWarning('DeprecationWarning', [ <del> 'util.print is deprecated. Use console.log instead.', <del> 'util.puts is deprecated. Use console.log instead.', <del> 'util.debug is deprecated. Use console.error instead.', <del> 'util.error is deprecated. Use console.error instead.' <add> ['util.print is deprecated. Use console.log instead.', common.noWarnCode], <add> ['util.puts is deprecated. Use console.log instead.', common.noWarnCode], <add> ['util.debug is deprecated. Use console.error instead.', common.noWarnCode], <add> ['util.error is deprecated. Use console.error instead.', common.noWarnCode] <ide> ]); <ide> <ide> util.print('test'); <ide><path>test/parallel/test-warn-sigprof.js <ide> if (common.isWindows) <ide> common.skip('test does not apply to Windows'); <ide> <ide> common.expectWarning('Warning', <del> 'process.on(SIGPROF) is reserved while debugging'); <add> 'process.on(SIGPROF) is reserved while debugging', <add> common.noWarnCode); <ide> <ide> process.on('SIGPROF', () => {});
29
Java
Java
keep nativeids immutable in reactfindviewutil
ee0c69dfa66de2a5dd320a85c6d9294f38733352
<ide><path>ReactAndroid/src/main/java/com/facebook/react/uimanager/util/ReactFindViewUtil.java <ide> public static void notifyViewRendered(View view) { <ide> } <ide> } <ide> <del> Iterator<Map.Entry<OnMultipleViewsFoundListener, Set<String>>> <del> viewIterator = mOnMultipleViewsFoundListener.entrySet().iterator(); <del> while (viewIterator.hasNext()) { <del> Map.Entry<OnMultipleViewsFoundListener, Set<String>> entry = <del> viewIterator.next(); <del> Set<String> nativeIds = entry.getValue(); <del> if (nativeIds.contains(nativeId)) { <del> entry.getKey().onViewFound(view, nativeId); <del> nativeIds.remove(nativeId); // remove it from list of NativeIds to search for. <del> } <del> if (nativeIds.isEmpty()) { <del> viewIterator.remove(); <del> } <add> for (Map.Entry<OnMultipleViewsFoundListener, Set<String>> entry : mOnMultipleViewsFoundListener.entrySet()) { <add> Set<String> nativeIds = entry.getValue(); <add> if (nativeIds != null && nativeIds.contains(nativeId)) { <add> entry.getKey().onViewFound(view, nativeId); <add> } <ide> } <ide> } <ide>
1
Ruby
Ruby
use xcode frontpage
ff8520e61be2b1ad36b676abfb426d5b95a71043
<ide><path>Library/Homebrew/exceptions.rb <ide> def initialize(formulae) <ide> elsif MacOS.version == "10.9" <ide> xcode_text = <<-EOS.undent <ide> To continue, you must install Xcode from: <del> https://developer.apple.com/downloads/ <add> https://developer.apple.com/xcode/downloads/ <ide> or the CLT by running: <ide> xcode-select --install <ide> EOS <ide> def initialize(formulae) <ide> else <ide> xcode_text = <<-EOS.undent <ide> To continue, you must install Xcode from: <del> https://developer.apple.com/downloads/ <add> https://developer.apple.com/xcode/downloads/ <ide> EOS <ide> end <ide> <ide> def initialize(flags) <ide> elsif MacOS.version == "10.9" <ide> xcode_text = <<-EOS.undent <ide> or install Xcode from: <del> https://developer.apple.com/downloads/ <add> https://developer.apple.com/xcode/downloads/ <ide> or the CLT by running: <ide> xcode-select --install <ide> EOS <ide> def initialize(flags) <ide> else <ide> xcode_text = <<-EOS.undent <ide> or install Xcode from: <del> https://developer.apple.com/downloads/ <add> https://developer.apple.com/xcode/downloads/ <ide> EOS <ide> end <ide>
1
Python
Python
add test for gh-2757
7678c988f88305bfb9be516700e8e05d902f1631
<ide><path>numpy/ma/tests/test_regression.py <ide> from numpy.testing import * <ide> import numpy as np <add>import numpy.ma as ma <ide> <ide> rlevel = 1 <ide> <ide> def test_set_fill_value_unicode_py3(self): <ide> a.fill_value = 'X' <ide> assert_(a.fill_value == 'X') <ide> <add> def test_var_sets_maskedarray_scalar(self): <add> """Issue gh-2757""" <add> a = np.ma.array(np.arange(5), mask=True) <add> mout = np.ma.array(-1, dtype=float) <add> a.var(out=mout) <add> assert_(mout._data == 0) <add> <add> <ide> if __name__ == "__main__": <ide> run_module_suite()
1
Python
Python
join fft threads before getting values
b8aedd0e69e862a74cba896bb0dbb1d2748c4edf
<ide><path>numpy/fft/tests/test_fftpack.py <ide> def worker(args, q): <ide> for i in range(self.threads)] <ide> [x.start() for x in t] <ide> <add> [x.join() for x in t] <ide> # Make sure all threads returned the correct value <ide> for i in range(self.threads): <ide> assert_array_equal(q.get(timeout=5), expected, <ide> 'Function returned wrong value in multithreaded context') <del> [x.join() for x in t] <ide> <ide> def test_fft(self): <ide> a = np.ones(self.input_shape) * 1+0j
1
Javascript
Javascript
remove unneeded eslint config for `hot` directory
ae88961fb2efccaf9fb3e716894651302af2ca60
<ide><path>.eslintrc.js <ide> module.exports = { <ide> env: { <ide> browser: true <ide> } <del> }, { <del> files: ["hot/**/*.js"], <del> env: { <del> node: true <del> }, <del> rules: { <del> "node/exports-style": ["off"] <del> } <ide> } <ide> ] <ide> };
1
Python
Python
remove two redundant empty lines
e41bf1e18104bfc2e482aa9f066c3ee7793666b4
<ide><path>tests/conftest.py <ide> def ensure_clean_request_context(): <ide> request.addfinalizer(ensure_clean_request_context) <ide> <ide> <del> <ide> @pytest.fixture(params=(True, False)) <ide> def limit_loader(request, monkeypatch): <ide> """Patch pkgutil.get_loader to give loader without get_filename or archive. <ide><path>tests/test_signals.py <ide> import flask <ide> <ide> <del> <ide> pytestmark = pytest.mark.skipif( <ide> blinker is None, <ide> reason='Signals require the blinker library.'
2
Ruby
Ruby
move `repo_var` method to `tap` class
54834ccbe3b97707bae1482d3bc10039ec1c01d6
<ide><path>Library/Homebrew/cmd/update-report.rb <ide> def initialize(var_name) <ide> def initialize(tap) <ide> @tap = tap <ide> <del> initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{repo_var}" <add> initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{tap.repo_var}" <ide> @initial_revision = ENV[initial_revision_var].to_s <ide> raise ReporterRevisionUnsetError, initial_revision_var if @initial_revision.empty? <ide> <del> current_revision_var = "HOMEBREW_UPDATE_AFTER#{repo_var}" <add> current_revision_var = "HOMEBREW_UPDATE_AFTER#{tap.repo_var}" <ide> @current_revision = ENV[current_revision_var].to_s <ide> raise ReporterRevisionUnsetError, current_revision_var if @current_revision.empty? <ide> end <ide> def migrate_formula_rename <ide> <ide> private <ide> <del> def repo_var <del> @repo_var ||= tap.path.to_s <del> .strip_prefix(Tap::TAP_DIRECTORY.to_s) <del> .tr("^A-Za-z0-9", "_") <del> .upcase <del> end <del> <ide> def diff <ide> Utils.popen_read( <ide> "git", "-C", tap.path, "diff-tree", "-r", "--name-status", "--diff-filter=AMDR", <ide><path>Library/Homebrew/tap.rb <ide> def default_remote <ide> "https://github.com/#{full_name}" <ide> end <ide> <add> def repo_var <add> @repo_var ||= path.to_s <add> .strip_prefix(TAP_DIRECTORY.to_s) <add> .tr("^A-Za-z0-9", "_") <add> .upcase <add> end <add> <ide> # True if this {Tap} is a git repository. <ide> def git? <ide> path.git? <ide><path>Library/Homebrew/test/cmd/update-report_spec.rb <ide> def perform_update(fixture_name = "") <ide> def initialize(tap) <ide> @tap = tap <ide> <del> ENV["HOMEBREW_UPDATE_BEFORE#{repo_var}"] = "12345678" <del> ENV["HOMEBREW_UPDATE_AFTER#{repo_var}"] = "abcdef00" <add> ENV["HOMEBREW_UPDATE_BEFORE#{tap.repo_var}"] = "12345678" <add> ENV["HOMEBREW_UPDATE_AFTER#{tap.repo_var}"] = "abcdef00" <ide> <ide> super(tap) <ide> end
3
Ruby
Ruby
don’t reorder “basic” artifacts
02362259a54c0b8d7399e7b19f0a56519cb1b9d1
<ide><path>Library/Homebrew/cask/lib/hbc/artifact.rb <ide> <ide> module Hbc <ide> module Artifact <del> # NOTE: Order is important here! <del> # <del> # The `uninstall` stanza should be run first, as it may <del> # depend on other artifacts still being installed. <del> # <del> # We want to extract nested containers before we <del> # handle any other artifacts. <del> # <del> CLASSES = [ <del> PreflightBlock, <del> Uninstall, <del> NestedContainer, <del> Installer, <del> App, <del> Suite, <del> Artifact, # generic 'artifact' stanza <del> Colorpicker, <del> Pkg, <del> Prefpane, <del> Qlplugin, <del> Dictionary, <del> Font, <del> Service, <del> StageOnly, <del> Binary, <del> InputMethod, <del> InternetPlugin, <del> AudioUnitPlugin, <del> VstPlugin, <del> Vst3Plugin, <del> ScreenSaver, <del> PostflightBlock, <del> Zap, <del> ].freeze <ide> end <ide> end <ide><path>Library/Homebrew/cask/lib/hbc/artifact/abstract_artifact.rb <ide> def self.dirmethod <ide> end <ide> <ide> def <=>(other) <add> return unless other.class < AbstractArtifact <add> return 0 if self.class == other.class <add> <ide> @@sort_order ||= [ # rubocop:disable Style/ClassVars <ide> PreflightBlock, <add> # The `uninstall` stanza should be run first, as it may <add> # depend on other artifacts still being installed. <ide> Uninstall, <add> # We want to extract nested containers before we <add> # handle any other artifacts. <ide> NestedContainer, <ide> Installer, <del> App, <del> Suite, <del> Artifact, # generic 'artifact' stanza <del> Colorpicker, <del> Pkg, <del> Prefpane, <del> Qlplugin, <del> Dictionary, <del> Font, <del> Service, <del> StageOnly, <add> [ <add> App, <add> Suite, <add> Artifact, <add> Colorpicker, <add> Prefpane, <add> Qlplugin, <add> Dictionary, <add> Font, <add> Service, <add> InputMethod, <add> InternetPlugin, <add> AudioUnitPlugin, <add> VstPlugin, <add> Vst3Plugin, <add> ScreenSaver, <add> ], <ide> Binary, <del> InputMethod, <del> InternetPlugin, <del> AudioUnitPlugin, <del> VstPlugin, <del> Vst3Plugin, <del> ScreenSaver, <add> Pkg, <ide> PostflightBlock, <ide> Zap, <del> ] <add> ].each_with_index.flat_map { |classes, i| [*classes].map { |c| [c, i] } }.to_h <ide> <del> (sort_order.index(other.class)).to_i <add> (sort_order[other.class]).to_i <ide> end <ide> <ide> # TODO: this sort of logic would make more sense in dsl.rb, or a
2
Text
Text
convert osx into os x
91c4fbb7bfe8851130f746911e34b9d190bb4572
<ide><path>docs/sources/installation/binaries.md <ide> In general, a 3.8 Linux kernel (or higher) is preferred, as some of the <ide> prior versions have known issues that are triggered by Docker. <ide> <ide> Note that Docker also has a client mode, which can run on virtually any <del>Linux kernel (it even builds on OSX!). <add>Linux kernel (it even builds on OS X!). <ide> <ide> ## Get the docker binary: <ide> <ide><path>docs/sources/installation/mac.md <ide> virtual machine and runs the Docker daemon. <ide> <ide> ## Installation <ide> <del>1. Download the latest release of the [Docker for OSX Installer]( <add>1. Download the latest release of the [Docker for OS X Installer]( <ide> https://github.com/boot2docker/osx-installer/releases) <ide> <ide> 2. Run the installer, which will install VirtualBox and the Boot2Docker management <ide> and `boot2docker start`. <ide> <ide> ## Upgrading <ide> <del>1. Download the latest release of the [Docker for OSX Installer]( <add>1. Download the latest release of the [Docker for OS X Installer]( <ide> https://github.com/boot2docker/osx-installer/releases) <ide> <ide> 2. Run the installer, which will update VirtualBox and the Boot2Docker management <ide><path>docs/sources/userguide/usingdocker.md <ide> see the application. <ide> Our Python application is live! <ide> <ide> > **Note:** <del>> If you have used the boot2docker virtual machine on OSX, Windows or Linux, <add>> If you have used the boot2docker virtual machine on OS X, Windows or Linux, <ide> > you'll need to get the IP of the virtual host instead of using localhost. <ide> > You can do this by running the following in <ide> > the boot2docker shell.
3
Python
Python
remove loss_update system
752037c1404be5cc277435e3d9bef2177b6a0eb6
<ide><path>keras/layers/containers.py <ide> def __init__(self, layers=[]): <ide> self.params = [] <ide> self.regularizers = [] <ide> self.constraints = [] <del> self.loss_updates = [] <ide> <ide> for layer in layers: <ide> self.add(layer) <ide> def add(self, layer): <ide> self.regularizers += regularizers <ide> self.constraints += constraints <ide> <del> if hasattr(layer, 'cost_update'): <del> self.loss_updates.append(layer.loss_update) <del> <ide> def get_output(self, train=False): <ide> return self.layers[-1].get_output(train) <ide> <ide><path>keras/layers/core.py <ide> def get_params(self): <ide> if r: <ide> regs.append(r) <ide> else: <del> regs.append(regularizers.identity) <add> regs.append(regularizers.identity()) <ide> elif hasattr(self, 'regularizer') and self.regularizer: <ide> regs += [self.regularizer for _ in range(len(self.params))] <ide> else: <del> regs += [regularizers.identity for _ in range(len(self.params))] <add> regs += [regularizers.identity() for _ in range(len(self.params))] <ide> <ide> if hasattr(self, 'constraints') and len(self.constraints) == len(self.params): <ide> for c in self.constraints: <ide> if c: <ide> consts.append(c) <ide> else: <del> consts.append(constraints.identity) <add> consts.append(constraints.identity()) <ide> elif hasattr(self, 'constraint') and self.constraint: <ide> consts += [self.constraint for _ in range(len(self.params))] <ide> else: <del> consts += [constraints.identity for _ in range(len(self.params))] <add> consts += [constraints.identity() for _ in range(len(self.params))] <ide> <ide> return self.params, regs, consts <ide> <ide><path>keras/models.py <ide> def compile(self, optimizer, loss, class_mode="categorical", theano_mode=None): <ide> raise Exception("Invalid class mode:" + str(class_mode)) <ide> self.class_mode = class_mode <ide> <del> if hasattr(self, 'loss_update'): <del> for u in self.loss_updates: <del> train_loss = u.update_loss(train_loss) <del> <ide> updates = self.optimizer.get_updates(self.params, self.regularizers, self.constraints, train_loss) <ide> <ide> if type(self.X_train) == list: <ide> def __init__(self): <ide> self.params = [] # learnable <ide> self.regularizers = [] # same size as params <ide> self.constraints = [] # same size as params <del> self.loss_updates = [] # size can vary, no 1-to-1 mapping to params <ide> <ide> <ide> def get_config(self, verbose=0):
3
Ruby
Ruby
add restart notice where missing
668872efd85291895d3e68f3a5af312973a1be74
<ide><path>railties/configs/initializers/new_rails_defaults.rb <add># Be sure to restart your server when you modify this file. <add> <ide> # These settings change the behavior of Rails 2 apps and will be defaults <ide> # for Rails 3. You can remove this initializer when Rails 3 is released. <ide> <ide><path>railties/configs/initializers/session_store.rb <add># Be sure to restart your server when you modify this file. <add> <ide> # Your secret key for verifying cookie session data integrity. <ide> # If you change this key, all old sessions will become invalid! <ide> # Make sure the secret is at least 30 characters and all random,
2
Go
Go
reduce redundant parsing of mountinfo
e8513675a20e2756e6c2915604605236d1a94d65
<ide><path>daemon/graphdriver/aufs/aufs.go <ide> func (a *Driver) unmount(m *data) error { <ide> } <ide> <ide> func (a *Driver) mounted(m *data) (bool, error) { <del> return mountpk.Mounted(m.path) <add> var buf syscall.Statfs_t <add> if err := syscall.Statfs(m.path, &buf); err != nil { <add> return false, nil <add> } <add> return graphdriver.FsMagic(buf.Type) == graphdriver.FsMagicAufs, nil <ide> } <ide> <ide> // Cleanup aufs and unmount all mountpoints
1
Javascript
Javascript
fix stats and bintestcases after adding "built at"
152575c2b0584a6648bd9030ccdeb53ae3517c49
<ide><path>lib/Stats.js <ide> class Stats { <ide> newline(); <ide> } <ide> if(typeof obj.time === "number") { <del> colors.normal("Built at: "); <del> colors.bold(new Date(obj.builtAt)); <del> newline(); <ide> colors.normal("Time: "); <ide> colors.bold(obj.time); <ide> colors.normal("ms"); <ide><path>test/StatsTestCases.test.js <ide> describe("StatsTestCases", () => { <ide> .replace(/\u001b\[39m\u001b\[22m/g, "</CLR>") <ide> .replace(/\u001b\[([0-9;]*)m/g, "<CLR=$1>") <ide> .replace(/[0-9]+(<\/CLR>)?(\s?ms)/g, "X$1$2") <del> .replace(/^(\s*Built at:) (.*)$/gm, "$1 Thu Jan 01 1970 <CLR=BOLD>00:00:00<\/CLR> GMT"); <add> .replace(/^(\s*Built at:) (.*)$/gm, "$1 Thu Jan 01 1970 <CLR=BOLD>00:00:00</CLR> GMT"); <ide> } <ide> <ide> actual = actual
2
PHP
PHP
fix doc blocks,
3ace1f03af1c604c7015d4f1bc3b25653586b654
<ide><path>src/I18n/DateFormatTrait.php <ide> public static function setJsonEncodeFormat($format): void <ide> * ``` <ide> * <ide> * @param string $time The time string to parse. <del> * @param string|array|null $format Any format accepted by IntlDateFormatter. <add> * @param string|int|array|null $format Any format accepted by IntlDateFormatter. <ide> * @return static|null <ide> */ <ide> public static function parseDateTime(string $time, $format = null) <ide> public static function parseDateTime(string $time, $format = null) <ide> * ``` <ide> * <ide> * @param string $date The date string to parse. <del> * @param string|int|null $format Any format accepted by IntlDateFormatter. <add> * @param string|int|array|null $format Any format accepted by IntlDateFormatter. <ide> * @return static|null <ide> */ <ide> public static function parseDate(string $date, $format = null) <ide><path>src/Mailer/Email.php <ide> public function serialize(): string <ide> * Unserializes the Email object. <ide> * <ide> * @param string $data Serialized string. <del> * @return $this Configured email instance. <add> * @return void <ide> */ <del> public function unserialize($data) <add> public function unserialize($data): void <ide> { <del> return $this->createFromArray(unserialize($data)); <add> $this->createFromArray(unserialize($data)); <ide> } <ide> }
2
Text
Text
remove unnecessary leading commas
417458da9b3ef0a68373d84c361bd05ec140d779
<ide><path>doc/api/test.md <ide> same as [`it([name], { skip: true }[, fn])`][it options]. <ide> Shorthand for marking a test as `TODO`, <ide> same as [`it([name], { todo: true }[, fn])`][it options]. <ide> <del>## `before([, fn][, options])` <add>## `before([fn][, options])` <ide> <ide> <!-- YAML <ide> added: v18.8.0 <ide> describe('tests', async () => { <ide> }); <ide> ``` <ide> <del>## `after([, fn][, options])` <add>## `after([fn][, options])` <ide> <ide> <!-- YAML <ide> added: v18.8.0 <ide> describe('tests', async () => { <ide> }); <ide> ``` <ide> <del>## `beforeEach([, fn][, options])` <add>## `beforeEach([fn][, options])` <ide> <ide> <!-- YAML <ide> added: v18.8.0 <ide> describe('tests', async () => { <ide> }); <ide> ``` <ide> <del>## `afterEach([, fn][, options])` <add>## `afterEach([fn][, options])` <ide> <ide> <!-- YAML <ide> added: v18.8.0 <ide> An instance of `TestContext` is passed to each test function in order to <ide> interact with the test runner. However, the `TestContext` constructor is not <ide> exposed as part of the API. <ide> <del>### `context.beforeEach([, fn][, options])` <add>### `context.beforeEach([fn][, options])` <ide> <ide> <!-- YAML <ide> added: v18.8.0 <ide> test('top level test', async (t) => { <ide> }); <ide> ``` <ide> <del>### `context.afterEach([, fn][, options])` <add>### `context.afterEach([fn][, options])` <ide> <ide> <!-- YAML <ide> added: v18.8.0
1
Ruby
Ruby
avoid uninitialized variable warning
74d7664b607a7ca2770c937a832b3339d7bf8203
<ide><path>actionpack/lib/action_view/helpers/date_helper.rb <ide> def to_datetime_select_tag(options = {}, html_options = {}) <ide> private <ide> def datetime_selector(options, html_options) <ide> datetime = value(object) || default_datetime(options) <add> @auto_index ||= nil <ide> <ide> options = options.dup <ide> options[:field_name] = @method_name
1
Python
Python
fix error when num_proxies is greater than one
cc13ee0577fb3de9602da634ab9c835749da49c4
<ide><path>rest_framework/throttling.py <ide> def get_ident(self, request): <ide> if num_proxies == 0 or xff is None: <ide> return remote_addr <ide> addrs = xff.split(',') <del> client_addr = addrs[-min(num_proxies, len(xff))] <add> client_addr = addrs[-min(num_proxies, len(addrs))] <ide> return client_addr.strip() <ide> <ide> return ''.join(xff.split()) if xff else remote_addr
1
Go
Go
add getparentdeathsignal() to pkg/system
002aa8fc207d803349777cde61426603976ca8ee
<ide><path>pkg/system/calls_linux.go <ide> package system <ide> import ( <ide> "os/exec" <ide> "syscall" <add> "unsafe" <ide> ) <ide> <ide> func Chroot(dir string) error { <ide> func ParentDeathSignal(sig uintptr) error { <ide> return nil <ide> } <ide> <add>func GetParentDeathSignal() (int, error) { <add> var sig int <add> <add> _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_GET_PDEATHSIG, uintptr(unsafe.Pointer(&sig)), 0) <add> <add> if err != 0 { <add> return -1, err <add> } <add> <add> return sig, nil <add>} <add> <ide> func Setctty() error { <ide> if _, _, err := syscall.RawSyscall(syscall.SYS_IOCTL, 0, uintptr(syscall.TIOCSCTTY), 0); err != 0 { <ide> return err
1
Javascript
Javascript
handle success responses better
ca70573bd8ec5aafc9146584d5bead9e3e5bab4b
<ide><path>packages/learn/src/redux/app/failed-updates-epic.js <ide> import uuid from 'uuid/v4'; <ide> <ide> import { types, onlineStatusChange, isOnlineSelector } from './'; <ide> import postUpdate$ from '../../templates/Challenges/utils/postUpdate$'; <add>import { isGoodXHRStatus } from '../../templates/Challenges/utils'; <ide> <ide> const key = 'fcc-failed-updates'; <ide> <ide> function delay(time = 0, fn) { <ide> function failedUpdateEpic(action$, { getState }) { <ide> const storeUpdates = action$.pipe( <ide> ofType(types.updateFailed), <del> tap(({ payload }) => { <del> const failures = store.get(key) || []; <del> payload.id = uuid(); <del> store.set(key, [...failures, payload]); <add> tap(({ payload = {} }) => { <add> if ('endpoint' in payload && 'payload' in payload) { <add> const failures = store.get(key) || []; <add> payload.id = uuid(); <add> store.set(key, [...failures, payload]); <add> } <ide> }), <ide> map(() => onlineStatusChange(false)) <ide> ); <ide> function failedUpdateEpic(action$, { getState }) { <ide> postUpdate$(update) <ide> .pipe( <ide> switchMap(response => { <del> if (response && response.message) { <add> if ( <add> response && <add> (response.message || isGoodXHRStatus(response.status)) <add> ) { <add> console.info(`${update.id} succeeded`); <ide> // the request completed successfully <ide> const failures = store.get(key) || []; <ide> const newFailures = failures.filter(x => x.id !== update.id);
1
Python
Python
add examples for complex dtypes
7e81231f49a1c2508a1b9fbe8649babf1707846d
<ide><path>numpy/lib/type_check.py <ide> def _getmaxmin(t): <ide> <ide> def nan_to_num(x, copy=True): <ide> """ <del> Replace nan with zero and inf with finite numbers. <add> Replace nan with zero and inf with large finite numbers. <ide> <del> Returns an array or scalar replacing Not a Number (NaN) with zero, <del> (positive) infinity with a very large number and negative infinity <del> with a very small (or negative) number. <add> If `x` is inexact, NaN is replaced by zero, and infinity and -infinity <add> replaced by the respectively largest and most negative finite floating <add> point values representable by ``x.dtype``. <add> <add> For complex dtypes, the above is applied to each of the real and <add> imaginary components of `x` separately. <add> <add> If `x` is not inexact, then no replacements are made. <ide> <ide> Parameters <ide> ---------- <ide> def nan_to_num(x, copy=True): <ide> Returns <ide> ------- <ide> out : ndarray <del> New Array with the same shape as `x` and dtype of the element in <del> `x` with the greatest precision. If `x` is inexact, then NaN is <del> replaced by zero, and infinity (-infinity) is replaced by the <del> largest (smallest or most negative) floating point value that fits <del> in the output dtype. If `x` is not inexact, then a copy of `x` is <del> returned. <add> `x`, with the non-finite values replaced. If `copy` is False, this may <add> be `x` itself. <ide> <ide> See Also <ide> -------- <ide> def nan_to_num(x, copy=True): <ide> NumPy uses the IEEE Standard for Binary Floating-Point for Arithmetic <ide> (IEEE 754). This means that Not a Number is not equivalent to infinity. <ide> <del> <ide> Examples <ide> -------- <del> >>> np.set_printoptions(precision=8) <ide> >>> x = np.array([np.inf, -np.inf, np.nan, -128, 128]) <ide> >>> np.nan_to_num(x) <ide> array([ 1.79769313e+308, -1.79769313e+308, 0.00000000e+000, <ide> -1.28000000e+002, 1.28000000e+002]) <del> <add> >>> y = np.array([complex(np.inf, np.nan), np.nan, complex(np.nan, np.inf)]) <add> >>> np.nan_to_num(y) <add> array([ 1.79769313e+308 +0.00000000e+000j, <add> 0.00000000e+000 +0.00000000e+000j, <add> 0.00000000e+000 +1.79769313e+308j]) <ide> """ <ide> x = _nx.array(x, subok=True, copy=copy) <ide> xtype = x.dtype.type
1
Python
Python
fix chords with chained groups
01dd66ceb5b9167074c2f291b165055e7377641b
<ide><path>celery/canvas.py <ide> def _traverse_tasks(self, tasks, value=None): <ide> task = stack.popleft() <ide> if isinstance(task, group): <ide> stack.extend(task.tasks) <add> elif isinstance(task, _chain) and isinstance(task.tasks[-1], group): <add> stack.extend(task.tasks[-1].tasks) <ide> else: <ide> yield task if value is None else value <ide> <ide><path>t/unit/tasks/test_canvas.py <ide> def test_app_fallback_to_current(self): <ide> x = chord([t1], body=t1) <ide> assert x.app is current_app <ide> <add> def test_chord_size_with_groups(self): <add> x = chord([ <add> self.add.s(2, 2) | group([self.add.si(2, 2), self.add.si(2, 2)]), <add> self.add.s(2, 2) | group([self.add.si(2, 2), self.add.si(2, 2)]), <add> ], body=self.add.si(2, 2)) <add> assert x.__length_hint__() == 4 <add> <ide> def test_set_immutable(self): <ide> x = chord([Mock(name='t1'), Mock(name='t2')], app=self.app) <ide> x.set_immutable(True)
2
Python
Python
fix tests pt/tf
128bdd4c3549e2a1401af87493ff6be467c79c14
<ide><path>pytorch_transformers/modeling_tf_pytorch_utils.py <ide> def convert_tf_weight_name_to_pt_weight_name(tf_name, start_prefix_to_remove='') <ide> ##################### <ide> ### PyTorch => TF 2.0 <ide> <del>def load_pytorch_checkpoint_in_tf2_model(tf_model, pytorch_checkpoint_path, tf_inputs=DUMMY_INPUTS, allow_missing_keys=False): <add>def load_pytorch_checkpoint_in_tf2_model(tf_model, pytorch_checkpoint_path, tf_inputs=None, allow_missing_keys=False): <ide> """ Load pytorch checkpoints in a TF 2.0 model <ide> """ <ide> try: <ide> def load_pytorch_checkpoint_in_tf2_model(tf_model, pytorch_checkpoint_path, tf_i <ide> return load_pytorch_weights_in_tf2_model(tf_model, pt_state_dict, tf_inputs=tf_inputs, allow_missing_keys=allow_missing_keys) <ide> <ide> <del>def load_pytorch_model_in_tf2_model(tf_model, pt_model, tf_inputs=DUMMY_INPUTS, allow_missing_keys=False): <add>def load_pytorch_model_in_tf2_model(tf_model, pt_model, tf_inputs=None, allow_missing_keys=False): <ide> """ Load pytorch checkpoints in a TF 2.0 model <ide> """ <ide> pt_state_dict = pt_model.state_dict() <ide> <ide> return load_pytorch_weights_in_tf2_model(tf_model, pt_state_dict, tf_inputs=tf_inputs, allow_missing_keys=allow_missing_keys) <ide> <ide> <del>def load_pytorch_weights_in_tf2_model(tf_model, pt_state_dict, tf_inputs=DUMMY_INPUTS, allow_missing_keys=False): <add>def load_pytorch_weights_in_tf2_model(tf_model, pt_state_dict, tf_inputs=None, allow_missing_keys=False): <ide> """ Load pytorch state_dict in a TF 2.0 model. <ide> """ <ide> try: <ide> def load_pytorch_weights_in_tf2_model(tf_model, pt_state_dict, tf_inputs=DUMMY_I <ide> "https://pytorch.org/ and https://www.tensorflow.org/install/ for installation instructions.") <ide> raise e <ide> <del> if tf_inputs is not None and not isinstance(tf_inputs, tf.Tensor): <del> tf_inputs = tf.constant(tf_inputs) <add> if tf_inputs is None: <add> tf_inputs = tf.constant(DUMMY_INPUTS) <ide> <ide> if tf_inputs is not None: <ide> tfo = tf_model(tf_inputs, training=False) # Make sure model is built <ide> def load_pytorch_weights_in_tf2_model(tf_model, pt_state_dict, tf_inputs=DUMMY_I <ide> ##################### <ide> ### TF 2.0 => PyTorch <ide> <del>def load_tf2_checkpoint_in_pytorch_model(pt_model, tf_checkpoint_path, tf_inputs=DUMMY_INPUTS, allow_missing_keys=False): <add>def load_tf2_checkpoint_in_pytorch_model(pt_model, tf_checkpoint_path, tf_inputs=None, allow_missing_keys=False): <ide> """ Load TF 2.0 HDF5 checkpoint in a PyTorch model <ide> We use HDF5 to easily do transfer learning <ide> (see https://github.com/tensorflow/tensorflow/blob/ee16fcac960ae660e0e4496658a366e2f745e1f0/tensorflow/python/keras/engine/network.py#L1352-L1357). <ide> def load_tf2_checkpoint_in_pytorch_model(pt_model, tf_checkpoint_path, tf_inputs <ide> tf_model_class = getattr(pytorch_transformers, tf_model_class_name) <ide> tf_model = tf_model_class(pt_model.config) <ide> <add> if tf_inputs is None: <add> tf_inputs = tf.constant(DUMMY_INPUTS) <add> <ide> if tf_inputs is not None: <del> if tf_inputs is not None and not isinstance(tf_inputs, tf.Tensor): <del> tf_inputs = tf.constant(tf_inputs) <ide> tfo = tf_model(tf_inputs, training=False) # Make sure model is built <ide> <ide> tf_model.load_weights(tf_checkpoint_path, by_name=True)
1
Javascript
Javascript
fix more lint errors
8f5e4216dc2a25fc43ce569d2b75a6105f009b43
<ide><path>src/text-editor-component.js <ide> /* global ResizeObserver */ <ide> <ide> const etch = require('etch') <del>const {CompositeDisposable} = require('event-kit') <ide> const {Point, Range} = require('text-buffer') <ide> const LineTopIndex = require('line-top-index') <ide> const TextEditor = require('./text-editor') <ide> class TextEditorComponent { <ide> <ide> this.decorationsToMeasure.cursors.forEach((cursor) => { <ide> const {screenPosition, className, style} = cursor <del> const {row, column} = cursor.screenPosition <add> const {row, column} = screenPosition <ide> <ide> const pixelTop = this.pixelPositionAfterBlocksForRow(row) <ide> const pixelLeft = this.pixelLeftForRowAndColumn(row, column) <ide> class LineNumberGutterComponent { <ide> number = NBSP_CHARACTER.repeat(maxDigits - number.length) + number <ide> <ide> const lineNumberProps = { <del> key, className, <add> key, <add> className, <ide> style: {width: width + 'px'}, <ide> dataset: {bufferRow} <ide> }
1
Javascript
Javascript
give better stack diagnostics on exceptions
07c11c03cc7f6d182eab9b50e2f3908ee397f70f
<ide><path>src/deferred/exceptionHook.js <ide> jQuery.Deferred.exceptionHook = function( error, stack ) { <ide> // Support: IE 8 - 9 only <ide> // Console exists when dev tools are open, which can happen at any time <ide> if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { <del> window.console.warn( "jQuery.Deferred exception: " + error.message, stack ); <add> window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); <ide> } <ide> }; <ide> <ide><path>test/unit/deferred.js <ide> QUnit.test( "jQuery.Deferred.then - spec compatibility", function( assert ) { <ide> } catch ( _ ) {} <ide> } ); <ide> <add>// Test fails in IE9 but is skipped there because console is not active <ide> QUnit[ window.console ? "test" : "skip" ]( "jQuery.Deferred.exceptionHook", function( assert ) { <ide> <del> assert.expect( 1 ); <add> assert.expect( 2 ); <ide> <ide> var done = assert.async(), <ide> defer = jQuery.Deferred(), <ide> oldWarn = window.console.warn; <ide> <del> window.console.warn = function( msg ) { <add> window.console.warn = function() { <ide> <ide> // Support: Chrome <=41 only <ide> // Some Chrome versions newer than 30 but older than 42 display the "undefined is <ide> // not a function" error, not mentioning the function name. This has been fixed <ide> // in Chrome 42. Relax this test there. <ide> // This affects our Android 5.0 & Yandex.Browser testing. <del> var oldChromium = false; <add> var msg = Array.prototype.join.call( arguments, " " ), <add> oldChromium = false; <ide> if ( /chrome/i.test( navigator.userAgent ) ) { <ide> oldChromium = parseInt( <ide> navigator.userAgent.match( /chrome\/(\d+)/i )[ 1 ], 10 ) < 42; <ide> } <ide> if ( oldChromium ) { <del> assert.ok( /(?:barf|undefined)/.test( msg ), "Message: " + msg ); <add> assert.ok( /(?:barf|undefined)/.test( msg ), "Message (weak assertion): " + msg ); <ide> } else { <ide> assert.ok( /barf/.test( msg ), "Message: " + msg ); <ide> } <ide> QUnit[ window.console ? "test" : "skip" ]( "jQuery.Deferred.exceptionHook", func <ide> // Should NOT get an error <ide> throw new Error( "Make me a sandwich" ); <ide> } ).then( null, jQuery.noop ) <del> ).then( function( ) { <add> ).then( function barf( ) { <add> jQuery.thisDiesToo(); <add> } ).then( null, function( ) { <ide> window.console.warn = oldWarn; <ide> done(); <ide> } ); <ide> <ide> defer.resolve(); <ide> } ); <ide> <add>// Test fails in IE9 but is skipped there because console is not active <ide> QUnit[ window.console ? "test" : "skip" ]( "jQuery.Deferred.exceptionHook with stack hooks", function( assert ) { <ide> <ide> assert.expect( 2 ); <ide> QUnit[ window.console ? "test" : "skip" ]( "jQuery.Deferred.exceptionHook with s <ide> return "NO STACK FOR YOU"; <ide> }; <ide> <del> window.console.warn = function( msg, stack ) { <add> window.console.warn = function() { <ide> <ide> // Support: Chrome <=41 only <ide> // Some Chrome versions newer than 30 but older than 42 display the "undefined is <ide> // not a function" error, not mentioning the function name. This has been fixed <ide> // in Chrome 42. Relax this test there. <ide> // This affects our Android 5.0 & Yandex.Browser testing. <del> var oldChromium = false; <add> var msg = Array.prototype.join.call( arguments, " " ), <add> oldChromium = false; <ide> if ( /chrome/i.test( navigator.userAgent ) ) { <ide> oldChromium = parseInt( <ide> navigator.userAgent.match( /chrome\/(\d+)/i )[ 1 ], 10 ) < 42; <ide> } <ide> if ( oldChromium ) { <del> assert.ok( /(?:cough_up_hairball|undefined)/.test( msg ), "Function mentioned: " + msg ); <add> assert.ok( /(?:cough_up_hairball|undefined)/.test( msg ), <add> "Function mentioned (weak assertion): " + msg ); <ide> } else { <ide> assert.ok( /cough_up_hairball/.test( msg ), "Function mentioned: " + msg ); <ide> } <del> assert.ok( /NO STACK FOR YOU/.test( stack ), "Stack trace included: " + stack ); <add> assert.ok( /NO STACK FOR YOU/.test( msg ), "Stack trace included: " + msg ); <ide> }; <ide> defer.then( function() { <ide> jQuery.cough_up_hairball();
2
PHP
PHP
add dd() and dump() to the request object
858ff9b2264c204c007b37079300499c9c178380
<ide><path>src/Illuminate/Http/Concerns/InteractsWithInput.php <ide> use Illuminate\Support\Str; <ide> use SplFileInfo; <ide> use stdClass; <add>use Symfony\Component\VarDumper\VarDumper; <ide> <ide> trait InteractsWithInput <ide> { <ide> protected function retrieveItem($source, $key, $default) <ide> <ide> return $this->$source->get($key, $default); <ide> } <add> <add> /** <add> * Dump the items and end the script. <add> * <add> * @param array|mixed $keys <add> * @return void <add> */ <add> public function dd(...$keys) <add> { <add> $keys = is_array($keys) ? $keys : func_get_args(); <add> <add> call_user_func_array([$this, 'dump'], $keys); <add> <add> exit(1); <add> } <add> <add> /** <add> * Dump the items. <add> * <add> * @return $this <add> */ <add> public function dump($keys = []) <add> { <add> $keys = is_array($keys) ? $keys : func_get_args(); <add> <add> if (count($keys) > 0) { <add> $data = $this->only($keys); <add> } else { <add> $data = $this->all(); <add> } <add> <add> VarDumper::dump($data); <add> <add> return $this; <add> } <ide> }
1
Javascript
Javascript
add unit tests for player.duration()
1e80e59614a748d35607dd63ac994ae99eb061e2
<ide><path>test/unit/player.test.js <ide> QUnit.test('should add a class with major version', function(assert) { <ide> <ide> player.dispose(); <ide> }); <add> <add>QUnit.test('player.duration() returns NaN if player.cache_.duration is undefined', function(assert) { <add> const player = TestHelpers.makePlayer(); <add> <add> player.cache_.duration = undefined; <add> assert.ok(Number.isNaN(player.duration()), 'returned NaN for unkown duration'); <add>}); <add> <add>QUnit.test('player.duration() returns player.cache_.duration if it is defined', function(assert) { <add> const player = TestHelpers.makePlayer(); <add> <add> player.cache_.duration = 200; <add> assert.equal(player.duration(), 200, 'returned correct integer duration'); <add> player.cache_.duration = 942; <add> assert.equal(player.duration(), 942, 'returned correct integer duration'); <add>}); <add> <add>QUnit.test('player.duration() sets the value of player.cache_.duration', function(assert) { <add> const player = TestHelpers.makePlayer(); <add> <add> // set an arbitrary initial cached duration value for testing the setter functionality <add> player.cache_.duration = 1; <add> <add> player.duration(NaN); <add> assert.ok(Number.isNaN(player.duration()), 'duration() set and get NaN duration value'); <add> player.duration(200); <add> assert.equal(player.duration(), 200, 'duration() set and get integer duration value'); <add>});
1
Ruby
Ruby
teach audit about new patches implementation
4f051abc3e2072af9f650b13269491d158b38157
<ide><path>Library/Homebrew/cmd/audit.rb <ide> def audit_specs <ide> "#{name} resource #{resource.name.inspect}: #{problem}" <ide> } <ide> end <add> <add> spec.patches.select(&:external?).each { |p| audit_patch(p) } <ide> end <ide> end <ide> <ide> def audit_patches <del> Patches.new(f.patches).select(&:external?).each do |p| <del> case p.url <del> when %r[raw\.github\.com], %r[gist\.github\.com/raw], %r[gist\.github\.com/.+/raw$] <del> unless p.url =~ /[a-fA-F0-9]{40}/ <del> problem "GitHub/Gist patches should specify a revision:\n#{p.url}" <del> end <del> when %r[macports/trunk] <del> problem "MacPorts patches should specify a revision instead of trunk:\n#{p.url}" <add> patches = Patch.normalize_legacy_patches(f.patches) <add> patches.grep(LegacyPatch).each { |p| audit_patch(p) } <add> end <add> <add> def audit_patch(patch) <add> case patch.url <add> when %r[raw\.github\.com], %r[gist\.github\.com/raw], %r[gist\.github\.com/.+/raw$] <add> unless patch.url =~ /[a-fA-F0-9]{40}/ <add> problem "GitHub/Gist patches should specify a revision:\n#{patch.url}" <ide> end <add> when %r[macports/trunk] <add> problem "MacPorts patches should specify a revision instead of trunk:\n#{patch.url}" <ide> end <ide> end <ide> <ide><path>Library/Homebrew/patch.rb <ide> class ExternalPatch < Patch <ide> attr_reader :resource, :strip <ide> <ide> def_delegators :@resource, :fetch, :verify_download_integrity, <del> :cached_download, :clear_cache <add> :cached_download, :clear_cache, :url <ide> <ide> def initialize(strip, &block) <ide> @strip = strip <ide> @resource = Resource.new(&block) <ide> @whence = :resource <ide> end <ide> <del> def url <del> resource.url <del> end <del> <ide> def owner= owner <ide> resource.owner = owner <ide> resource.name = "patch-#{resource.checksum}"
2
Java
Java
fix typo in exception message
8a1f9f8aa37370868ea12be6e2feed8049f97e2b
<ide><path>spring-tx/src/main/java/org/springframework/transaction/event/ApplicationListenerMethodTransactionalAdapter.java <ide> static TransactionalEventListener findAnnotation(Method method) { <ide> TransactionalEventListener annotation = AnnotationUtils <ide> .findAnnotation(method, TransactionalEventListener.class); <ide> if (annotation == null) { <del> throw new IllegalStateException("No TransactionalEventListener annotation found ou '" + method + "'"); <add> throw new IllegalStateException("No TransactionalEventListener annotation found on '" + method + "'"); <ide> } <ide> return annotation; <ide> }
1
PHP
PHP
update method documentation
8c211754a6d6d00dbaa5f46e3ae70378c02e6025
<ide><path>src/Illuminate/Foundation/Testing/AssertionsTrait.php <ide> public function assertRedirectedToAction($name, $parameters = [], $with = []) <ide> } <ide> <ide> /** <del> * Assert that the session has a given list of values. <add> * Assert that the session has a given value. <ide> * <ide> * @param string|array $key <ide> * @param mixed $value
1
Javascript
Javascript
fix typeerror when stream is closed
ab89024ddc777ff888df0e239355f563e4cfa2a8
<ide><path>lib/tty.js <ide> ObjectSetPrototypeOf(ReadStream, net.Socket); <ide> <ide> ReadStream.prototype.setRawMode = function(flag) { <ide> flag = !!flag; <del> const err = this._handle.setRawMode(flag); <add> const err = this._handle?.setRawMode(flag); <ide> if (err) { <ide> this.emit('error', errors.errnoException(err, 'setRawMode')); <ide> return this; <ide><path>test/parallel/test-repl-stdin-push-null.js <add>'use strict'; <add>const common = require('../common'); <add> <add>if (!process.stdin.isTTY) { <add> common.skip('does not apply on non-TTY stdin'); <add>} <add> <add>process.stdin.destroy(); <add>process.stdin.setRawMode(true);
2
Python
Python
use cpu converter in sum_resources()
a8f90ed5bc7df45445fdf30d0961d12dcccd9946
<ide><path>libcloud/container/drivers/kubernetes.py <ide> def sum_resources(self, *resource_dicts): <ide> total_cpu = 0 <ide> total_memory = 0 <ide> for rd in resource_dicts: <del> cpu = rd.get("cpu", "0") <del> is_in_milli_format = "m" in cpu <del> if is_in_milli_format: <del> total_cpu += int(cpu.strip("m")) <del> else: <del> total_cpu += int(cpu) * 1000 <add> total_cpu += to_n_cpus_from_cpu_str(rd.get("cpu", "0m")) <ide> total_memory += to_n_bytes_from_memory_str(rd.get("memory", "0K")) <ide> return {"cpu": f"{total_cpu}m", "memory": to_memory_str_from_n_bytes(total_memory)} <ide>
1
Javascript
Javascript
add locale es-us
c4703dc8b1f72cbd1e520b283af53f6bde8ec123
<ide><path>src/locale/es-us.js <add>//! moment.js locale configuration <add>//! locale : Spanish(United State) [es-us] <add>//! author : bustta : https://github.com/bustta <add> <add>import moment from '../moment'; <add> <add>var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), <add> monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); <add> <add>export default moment.defineLocale('es-us', { <add> months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), <add> monthsShort : function (m, format) { <add> if (!m) { <add> return monthsShortDot; <add> } else if (/-MMM-/.test(format)) { <add> return monthsShort[m.month()]; <add> } else { <add> return monthsShortDot[m.month()]; <add> } <add> }, <add> monthsParseExact : true, <add> weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), <add> weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), <add> weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), <add> weekdaysParseExact : true, <add> longDateFormat : { <add> LT : 'H:mm', <add> LTS : 'H:mm:ss', <add> L : 'MM/DD/YYYY', <add> LL : 'MMMM [de] D [de] YYYY', <add> LLL : 'MMMM [de] D [de] YYYY H:mm', <add> LLLL : 'dddd, MMMM [de] D [de] YYYY H:mm' <add> }, <add> calendar : { <add> sameDay : function () { <add> return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; <add> }, <add> nextDay : function () { <add> return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; <add> }, <add> nextWeek : function () { <add> return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; <add> }, <add> lastDay : function () { <add> return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; <add> }, <add> lastWeek : function () { <add> return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; <add> }, <add> sameElse : 'L' <add> }, <add> relativeTime : { <add> future : 'en %s', <add> past : 'hace %s', <add> s : 'unos segundos', <add> m : 'un minuto', <add> mm : '%d minutos', <add> h : 'una hora', <add> hh : '%d horas', <add> d : 'un día', <add> dd : '%d días', <add> M : 'un mes', <add> MM : '%d meses', <add> y : 'un año', <add> yy : '%d años' <add> }, <add> dayOfMonthOrdinalParse : /\d{1,2}º/, <add> ordinal : '%dº', <add> week : { <add> dow : 0, // Sunday is the first day of the week. <add> doy : 6 // The week that contains Jan 1st is the first week of the year. <add> } <add>}); <ide><path>src/test/locale/es-us.js <add>import {localeModule, test} from '../qunit'; <add>import moment from '../../moment'; <add>localeModule('es-us'); <add> <add>test('parse', function (assert) { <add> var tests = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'), i; <add> function equalTest(input, mmm, i) { <add> assert.equal(moment(input, mmm).month(), i, input + ' should be month ' + (i + 1)); <add> } <add> for (i = 0; i < 12; i++) { <add> tests[i] = tests[i].split(' '); <add> equalTest(tests[i][0], 'MMM', i); <add> equalTest(tests[i][1], 'MMM', i); <add> equalTest(tests[i][0], 'MMMM', i); <add> equalTest(tests[i][1], 'MMMM', i); <add> equalTest(tests[i][0].toLocaleLowerCase(), 'MMMM', i); <add> equalTest(tests[i][1].toLocaleLowerCase(), 'MMMM', i); <add> equalTest(tests[i][0].toLocaleUpperCase(), 'MMMM', i); <add> equalTest(tests[i][1].toLocaleUpperCase(), 'MMMM', i); <add> } <add>}); <add> <add>test('format', function (assert) { <add> var a = [ <add> ['dddd, MMMM Do YYYY, h:mm:ss a', 'domingo, febrero 14º 2010, 3:25:50 pm'], <add> ['ddd, hA', 'dom., 3PM'], <add> ['M Mo MM MMMM MMM', '2 2º 02 febrero feb.'], <add> ['YYYY YY', '2010 10'], <add> ['D Do DD', '14 14º 14'], <add> ['d do dddd ddd dd', '0 0º domingo dom. do'], <add> ['DDD DDDo DDDD', '45 45º 045'], <add> ['w wo ww', '8 8º 08'], <add> ['YYYY-MMM-DD', '2010-feb-14'], <add> ['h hh', '3 03'], <add> ['H HH', '15 15'], <add> ['m mm', '25 25'], <add> ['s ss', '50 50'], <add> ['a A', 'pm PM'], <add> ['[the] DDDo [day of the year]', 'the 45º day of the year'], <add> ['LTS', '15:25:50'], <add> ['L', '02/14/2010'], <add> ['LL', 'febrero de 14 de 2010'], <add> ['LLL', 'febrero de 14 de 2010 15:25'], <add> ['LLLL', 'domingo, febrero de 14 de 2010 15:25'], <add> ['l', '2/14/2010'], <add> ['ll', 'feb. de 14 de 2010'], <add> ['lll', 'feb. de 14 de 2010 15:25'], <add> ['llll', 'dom., feb. de 14 de 2010 15:25'] <add> ], <add> b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)), <add> i; <add> for (i = 0; i < a.length; i++) { <add> assert.equal(b.format(a[i][0]), a[i][1], a[i][0] + ' ---> ' + a[i][1]); <add> } <add>}); <add> <add>test('format ordinal', function (assert) { <add> assert.equal(moment([2011, 0, 1]).format('DDDo'), '1º', '1º'); <add> assert.equal(moment([2011, 0, 2]).format('DDDo'), '2º', '2º'); <add> assert.equal(moment([2011, 0, 3]).format('DDDo'), '3º', '3º'); <add> assert.equal(moment([2011, 0, 4]).format('DDDo'), '4º', '4º'); <add> assert.equal(moment([2011, 0, 5]).format('DDDo'), '5º', '5º'); <add> assert.equal(moment([2011, 0, 6]).format('DDDo'), '6º', '6º'); <add> assert.equal(moment([2011, 0, 7]).format('DDDo'), '7º', '7º'); <add> assert.equal(moment([2011, 0, 8]).format('DDDo'), '8º', '8º'); <add> assert.equal(moment([2011, 0, 9]).format('DDDo'), '9º', '9º'); <add> assert.equal(moment([2011, 0, 10]).format('DDDo'), '10º', '10º'); <add> <add> assert.equal(moment([2011, 0, 11]).format('DDDo'), '11º', '11º'); <add> assert.equal(moment([2011, 0, 12]).format('DDDo'), '12º', '12º'); <add> assert.equal(moment([2011, 0, 13]).format('DDDo'), '13º', '13º'); <add> assert.equal(moment([2011, 0, 14]).format('DDDo'), '14º', '14º'); <add> assert.equal(moment([2011, 0, 15]).format('DDDo'), '15º', '15º'); <add> assert.equal(moment([2011, 0, 16]).format('DDDo'), '16º', '16º'); <add> assert.equal(moment([2011, 0, 17]).format('DDDo'), '17º', '17º'); <add> assert.equal(moment([2011, 0, 18]).format('DDDo'), '18º', '18º'); <add> assert.equal(moment([2011, 0, 19]).format('DDDo'), '19º', '19º'); <add> assert.equal(moment([2011, 0, 20]).format('DDDo'), '20º', '20º'); <add> <add> assert.equal(moment([2011, 0, 21]).format('DDDo'), '21º', '21º'); <add> assert.equal(moment([2011, 0, 22]).format('DDDo'), '22º', '22º'); <add> assert.equal(moment([2011, 0, 23]).format('DDDo'), '23º', '23º'); <add> assert.equal(moment([2011, 0, 24]).format('DDDo'), '24º', '24º'); <add> assert.equal(moment([2011, 0, 25]).format('DDDo'), '25º', '25º'); <add> assert.equal(moment([2011, 0, 26]).format('DDDo'), '26º', '26º'); <add> assert.equal(moment([2011, 0, 27]).format('DDDo'), '27º', '27º'); <add> assert.equal(moment([2011, 0, 28]).format('DDDo'), '28º', '28º'); <add> assert.equal(moment([2011, 0, 29]).format('DDDo'), '29º', '29º'); <add> assert.equal(moment([2011, 0, 30]).format('DDDo'), '30º', '30º'); <add> <add> assert.equal(moment([2011, 0, 31]).format('DDDo'), '31º', '31º'); <add>}); <add> <add>test('format month', function (assert) { <add> var i, <add> expected = 'enero ene._febrero feb._marzo mar._abril abr._mayo may._junio jun._julio jul._agosto ago._septiembre sep._octubre oct._noviembre nov._diciembre dic.'.split('_'); <add> <add> for (i = 0; i < expected.length; i++) { <add> assert.equal(moment([2011, i, 1]).format('MMMM MMM'), expected[i], expected[i]); <add> } <add>}); <add> <add>test('format week', function (assert) { <add> var i, <add> expected = 'domingo dom. do_lunes lun. lu_martes mar. ma_miércoles mié. mi_jueves jue. ju_viernes vie. vi_sábado sáb. sá'.split('_'); <add> <add> for (i = 0; i < expected.length; i++) { <add> assert.equal(moment([2011, 0, 2 + i]).format('dddd ddd dd'), expected[i], expected[i]); <add> } <add>}); <add> <add>test('from', function (assert) { <add> var start = moment([2007, 1, 28]); <add> <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), 'unos segundos', '44 seconds = a few seconds'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), 'un minuto', '45 seconds = a minute'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), 'un minuto', '89 seconds = a minute'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2 minutos', '90 seconds = 2 minutes'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44 minutos', '44 minutes = 44 minutes'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), 'una hora', '45 minutes = an hour'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), 'una hora', '89 minutes = an hour'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2 horas', '90 minutes = 2 hours'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5 horas', '5 hours = 5 hours'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21 horas', '21 hours = 21 hours'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), 'un día', '22 hours = a day'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), 'un día', '35 hours = a day'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2 días', '36 hours = 2 days'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), 'un día', '1 day = a day'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5 días', '5 days = 5 days'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25 días', '25 days = 25 days'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), 'un mes', '26 days = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), 'un mes', '30 days = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), 'un mes', '43 days = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2 meses', '46 days = 2 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2 meses', '75 days = 2 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3 meses', '76 days = 3 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), 'un mes', '1 month = a month'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5 meses', '5 months = 5 months'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), 'un año', '345 days = a year'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2 años', '548 days = 2 years'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), 'un año', '1 year = a year'); <add> assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5 años', '5 years = 5 years'); <add>}); <add> <add>test('suffix', function (assert) { <add> assert.equal(moment(30000).from(0), 'en unos segundos', 'prefix'); <add> assert.equal(moment(0).from(30000), 'hace unos segundos', 'suffix'); <add>}); <add> <add>test('now from now', function (assert) { <add> assert.equal(moment().fromNow(), 'hace unos segundos', 'now from now should display as in the past'); <add>}); <add> <add>test('fromNow', function (assert) { <add> assert.equal(moment().add({s: 30}).fromNow(), 'en unos segundos', 'en unos segundos'); <add> assert.equal(moment().add({d: 5}).fromNow(), 'en 5 días', 'en 5 días'); <add>}); <add> <add>test('calendar day', function (assert) { <add> var a = moment().hours(12).minutes(0).seconds(0); <add> <add> assert.equal(moment(a).calendar(), 'hoy a las 12:00', 'today at the same time'); <add> assert.equal(moment(a).add({m: 25}).calendar(), 'hoy a las 12:25', 'Now plus 25 min'); <add> assert.equal(moment(a).add({h: 1}).calendar(), 'hoy a las 13:00', 'Now plus 1 hour'); <add> assert.equal(moment(a).add({d: 1}).calendar(), 'mañana a las 12:00', 'tomorrow at the same time'); <add> assert.equal(moment(a).add({d: 1, h : -1}).calendar(), 'mañana a las 11:00', 'tomorrow minus 1 hour'); <add> assert.equal(moment(a).subtract({h: 1}).calendar(), 'hoy a las 11:00', 'Now minus 1 hour'); <add> assert.equal(moment(a).subtract({d: 1}).calendar(), 'ayer a las 12:00', 'yesterday at the same time'); <add>}); <add> <add>test('calendar next week', function (assert) { <add> var i, m; <add> <add> for (i = 2; i < 7; i++) { <add> m = moment().add({d: i}); <add> assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days current time'); <add> m.hours(0).minutes(0).seconds(0).milliseconds(0); <add> assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days beginning of day'); <add> m.hours(23).minutes(59).seconds(59).milliseconds(999); <add> assert.equal(m.calendar(), m.format('dddd [a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today + ' + i + ' days end of day'); <add> } <add>}); <add> <add>test('calendar last week', function (assert) { <add> var i, m; <add> <add> for (i = 2; i < 7; i++) { <add> m = moment().subtract({d: i}); <add> assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days current time'); <add> m.hours(0).minutes(0).seconds(0).milliseconds(0); <add> assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days beginning of day'); <add> m.hours(23).minutes(59).seconds(59).milliseconds(999); <add> assert.equal(m.calendar(), m.format('[el] dddd [pasado a la' + ((m.hours() !== 1) ? 's' : '') + '] LT'), 'Today - ' + i + ' days end of day'); <add> } <add>}); <add> <add>test('calendar all else', function (assert) { <add> var weeksAgo = moment().subtract({w: 1}), <add> weeksFromNow = moment().add({w: 1}); <add> <add> assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '1 week ago'); <add> assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 1 week'); <add> <add> weeksAgo = moment().subtract({w: 2}); <add> weeksFromNow = moment().add({w: 2}); <add> <add> assert.equal(weeksAgo.calendar(), weeksAgo.format('L'), '2 weeks ago'); <add> assert.equal(weeksFromNow.calendar(), weeksFromNow.format('L'), 'in 2 weeks'); <add>}); <add> <add>test('weeks year starting sunday formatted', function (assert) { <add> assert.equal(moment([2012, 0, 1]).format('w ww wo'), '1 01 1º', 'Jan 1 2012 should be week 1'); <add> assert.equal(moment([2012, 0, 2]).format('w ww wo'), '1 01 1º', 'Jan 2 2012 should be week 1'); <add> assert.equal(moment([2012, 0, 7]).format('w ww wo'), '1 01 1º', 'Jan 7 2012 should be week 1'); <add> assert.equal(moment([2012, 0, 8]).format('w ww wo'), '2 02 2º', 'Jan 8 2012 should be week 2'); <add> assert.equal(moment([2012, 0, 14]).format('w ww wo'), '2 02 2º', 'Jan 14 2012 should be week 2'); <add> assert.equal(moment([2012, 0, 15]).format('w ww wo'), '3 03 3º', 'Jan 15 2012 should be week 3'); <add>}); <add>
2
Ruby
Ruby
reduce object allocation
f888448ed289fd7b32c30e48ff3c3b9334ed1d22
<ide><path>actionview/lib/action_view/template.rb <ide> def handle_render_error(view, e) #:nodoc: <ide> <ide> def locals_code #:nodoc: <ide> # Double assign to suppress the dreaded 'assigned but unused variable' warning <del> @locals.map { |key| "#{key} = #{key} = local_assigns[:#{key}];" }.join <add> @locals.each_with_object('') { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" } <ide> end <ide> <ide> def method_name #:nodoc:
1
Go
Go
use beam.router to simplify 'trace'
30424f4e3a40ec21ac25e5c3f9ef45c3109c9f06
<ide><path>pkg/beam/examples/beamsh/builtins.go <ide> func CmdExec(args []string, stdout, stderr io.Writer, in beam.Receiver, out beam <ide> } <ide> <ide> func CmdTrace(args []string, stdout, stderr io.Writer, in beam.Receiver, out beam.Sender) { <del> for { <del> p, a, err := in.Receive() <del> if err != nil { <del> return <del> } <del> var msg string <del> if pretty := data.Message(string(p)).Pretty(); pretty != "" { <del> msg = pretty <del> } else { <del> msg = string(p) <del> } <del> if a != nil { <del> msg = fmt.Sprintf("%s [%d]", msg, a.Fd()) <del> } <del> fmt.Printf("===> %s\n", msg) <del> out.Send(p, a) <del> } <add> r := beam.NewRouter(out) <add> r.NewRoute().All().Handler(func(payload []byte, attachment *os.File) error { <add> fmt.Printf("===> %s\n", beam.MsgDesc(payload, attachment)) <add> out.Send(payload, attachment) <add> return nil <add> }) <add> beam.Copy(r, in) <ide> } <ide> <ide> func CmdEmit(args []string, stdout, stderr io.Writer, in beam.Receiver, out beam.Sender) {
1
Text
Text
explain the configuration of the framework
1310e580644f458069161b5b7df6c8c0f7812f7f
<ide><path>README.md <ide> The channel has been instructed to stream everything that arrives at `web_notifi <ide> across the wire, and unpacked for the data argument arriving to `#received`. <ide> <ide> <add>## Configuration <add> <add>The only must-configure part of Action Cable is the Redis connection. By default, `ActionCable::Server::Base` will look for a configuration <add>file in `Rails.root.join('config/redis/cable.yml')`. The file must follow the following format: <add> <add>```yaml <add>production: &production <add> :url: redis://10.10.3.153:6381 <add> :host: 10.10.3.153 <add> :port: 6381 <add> :timeout: 1 <add>development: &development <add> :url: redis://localhost:6379 <add> :host: localhost <add> :port: 6379 <add> :timeout: 1 <add> :inline: true <add>test: *development <add>``` <add> <add>This format allows you to specify one configuration per Rails environment. You can also chance the location of the Redis config file in <add>a Rails initializer with something like: <add> <add>```ruby <add>ActionCable.server.config.redis_path = Rails.root('somewhere/else/cable.yml') <add>``` <add> <add>The other common option to configure is the log tags applied to the per-connection logger. Here's close to what we're using in Basecamp: <add> <add>```ruby <add>ActionCable.server.config.log_tags = [ <add> -> request { request.env['bc.account_id'] || "no-account" }, <add> :action_cable, <add> -> request { request.uuid } <add>] <add>``` <add> <add>For a full list of all configuration options, see the `ActionCable::Server::Configuration` class. <add> <add> <add>## Starting the cable server <add> <add>As mentioned, the cable server(s) is separated from your normal application server. It's still a rack application, but it is its own rack <add>application. The recommended basic setup is as follows: <add> <add>```ruby <add># cable/config.ru <add>require ::File.expand_path('../config/environment', __FILE__) <add>Rails.application.eager_load! <add> <add>require 'action_cable/process/logging' <add> <add>run ActionCable.server <add>``` <add> <add>Then you start the server using a binstub in bin/cable ala: <add>``` <add>#!/bin/bash <add>bundle exec puma cable/config.ru -p 28080 <add>``` <add> <add>That'll start a cable server on port 28080. Remember to point your client-side setup against that using something like: <add>`App.cable.createConsumer('http://basecamp.dev:28080')`. <add> <add>Note: We'll get all this abstracted properly when the framework is integrated into Rails. <add> <add> <ide> ## Dependencies <ide> <ide> Action Cable is currently tied to Redis through its use of the pubsub feature to route <ide> Redis installed and running. <ide> The Ruby side of things is built on top of [faye-websocket](https://github.com/faye/faye-websocket-ruby) and [celluoid](https://github.com/celluloid/celluloid). <ide> <ide> <add> <ide> ## Deployment <ide> <ide> Action Cable is powered by a combination of EventMachine and threads. The
1
Text
Text
add changelog.md entry for
1600c67ff99c572ca947b2d1b1e781b6070621b5
<ide><path>actioncable/CHANGELOG.md <add>* Create notion of an `ActionCable::SubscriptionAdapter`. <add> Separate out Redis functionality into `AC::SA::Redis`, <add> and add a PostgreSQL adapter as well. Configuration file <add> for ActionCable was changed from `config/redis/cable.yml` <add> to `config/cable.yml` <add> <add> *Jon Moss* <add> <ide> ## Rails 5.0.0.beta1 (December 18, 2015) ## <ide> <ide> * Added to Rails!
1
Javascript
Javascript
remove a hash symbol from split method
b5ce9ca6fc3cec5dd048ee76b8a0819938d9e1b5
<ide><path>client/commonFramework/bindings.js <ide> window.common = (function(global) { <ide> public: true, <ide> files: {} <ide> }; <del> var queryIssue = window.location.href.toString().split('#?')[0]; <add> var queryIssue = window.location.href.toString().split('?')[0]; <ide> var filename = queryIssue <ide> .substr(queryIssue.lastIndexOf('challenges/') + 11) <ide> .replace('/', '') + '.js';
1
Javascript
Javascript
add key to navigationscenerendererprops
472f815e45295e37f34c65320524907fda8b7c8a
<ide><path>Examples/UIExplorer/NavigationExperimental/NavigationAnimatedExample.js <ide> class NavigationAnimatedExample extends React.Component { <ide> return ( <ide> <NavigationCard <ide> {...props} <del> key={'card_' + props.scene.navigationState.key} <ide> renderScene={this._renderScene} <ide> /> <ide> ); <ide><path>Libraries/NavigationExperimental/NavigationAnimatedView.js <ide> class NavigationAnimatedView <ide> onNavigate, <ide> position, <ide> scene, <add> key: 'scene_' + scene.navigationState.key, <ide> scenes, <ide> }); <ide> } <ide> class NavigationAnimatedView <ide> <ide> return renderOverlay({ <ide> layout: this.state.layout, <add> key: navigationState.key, <ide> navigationState, <ide> onNavigate, <ide> position, <ide><path>Libraries/NavigationExperimental/NavigationPropTypes.js <ide> const scene = PropTypes.shape({ <ide> <ide> /* NavigationSceneRendererProps */ <ide> const SceneRenderer = { <add> key: PropTypes.string.isRequired, <ide> layout: layout.isRequired, <ide> navigationState: navigationParentState.isRequired, <ide> onNavigate: PropTypes.func.isRequired, <ide> function extractSceneRendererProps( <ide> props: NavigationSceneRendererProps, <ide> ): NavigationSceneRendererProps { <ide> return { <add> key: props.scene.navigationState.key, <ide> layout: props.layout, <ide> navigationState: props.navigationState, <ide> onNavigate: props.onNavigate, <ide><path>Libraries/NavigationExperimental/NavigationTypeDefinition.js <ide> export type NavigationSceneRendererProps = { <ide> // The scene to render. <ide> scene: NavigationScene, <ide> <add> // The key of the scene <add> key: string, <add> <ide> // All the scenes of the containing view's. <ide> scenes: Array<NavigationScene>, <ide> }; <ide><path>Libraries/NavigationExperimental/NavigationView.js <ide> class NavigationView extends React.Component<any, Props, any> { <ide> scenes, <ide> } = this.state; <ide> <add> const scene = scenes[navigationState.index]; <add> <ide> const sceneProps = { <add> key: 'scene_' + scene.navigationState.key, <ide> layout, <ide> navigationState: navigationState, <ide> onNavigate: onNavigate, <ide> position: this._position, <del> scene: scenes[navigationState.index], <add> scene, <ide> scenes, <ide> }; <ide>
5
Go
Go
return error on invalid --change command
3210d13fc8fb93263a7a5eadef0a0f133087a889
<ide><path>builder/job.go <ide> package builder <ide> import ( <ide> "bytes" <ide> "encoding/json" <del> "fmt" <ide> "io" <ide> "io/ioutil" <ide> "os" <ide> import ( <ide> "github.com/docker/docker/utils" <ide> ) <ide> <add>// whitelist of commands allowed for a commit <add>var validCommitCommands = map[string]bool{ <add> "entrypoint": true, <add> "cmd": true, <add> "user": true, <add> "workdir": true, <add> "env": true, <add> "volume": true, <add> "expose": true, <add> "onbuild": true, <add>} <add> <ide> type BuilderJob struct { <ide> Engine *engine.Engine <ide> Daemon *daemon.Daemon <ide> func (b *BuilderJob) CmdBuildConfig(job *engine.Job) engine.Status { <ide> if len(job.Args) != 0 { <ide> return job.Errorf("Usage: %s\n", job.Name) <ide> } <del> var ( <del> validCmd = map[string]struct{}{ <del> "entrypoint": {}, <del> "cmd": {}, <del> "user": {}, <del> "workdir": {}, <del> "env": {}, <del> "volume": {}, <del> "expose": {}, <del> "onbuild": {}, <del> } <ide> <add> var ( <ide> changes = job.Getenv("changes") <ide> newConfig runconfig.Config <ide> ) <ide> func (b *BuilderJob) CmdBuildConfig(job *engine.Job) engine.Status { <ide> return job.Error(err) <ide> } <ide> <add> // ensure that the commands are valid <add> for _, n := range ast.Children { <add> if !validCommitCommands[n.Value] { <add> return job.Errorf("%s is not a valid change command", n.Value) <add> } <add> } <add> <ide> builder := &Builder{ <ide> Daemon: b.Daemon, <ide> Engine: b.Engine, <ide> func (b *BuilderJob) CmdBuildConfig(job *engine.Job) engine.Status { <ide> } <ide> <ide> for i, n := range ast.Children { <del> cmd := n.Value <del> if _, ok := validCmd[cmd]; ok { <del> if err := builder.dispatch(i, n); err != nil { <del> return job.Error(err) <del> } <del> } else { <del> fmt.Fprintf(builder.ErrStream, "# Skipping serialization of instruction %s\n", strings.ToUpper(cmd)) <add> if err := builder.dispatch(i, n); err != nil { <add> return job.Error(err) <ide> } <ide> } <ide>
1
Javascript
Javascript
check args on sourcetextmodule cacheddata
766b3c18a91f5a4bd55615ac9de5793c09b15005
<ide><path>test/parallel/test-vm-module-errors.js <ide> async function checkInvalidOptionForEvaluate() { <ide> }); <ide> } <ide> <add>function checkInvalidCachedData() { <add> [true, false, 'foo', {}, Array, function() {}].forEach((invalidArg) => { <add> const message = 'The "options.cachedData" property must be an ' + <add> 'instance of Buffer, TypedArray, or DataView.' + <add> common.invalidArgTypeHelper(invalidArg); <add> assert.throws( <add> () => new SourceTextModule('import "foo";', { cachedData: invalidArg }), <add> { <add> code: 'ERR_INVALID_ARG_TYPE', <add> name: 'TypeError', <add> message, <add> } <add> ); <add> }); <add>} <add> <ide> const finished = common.mustCall(); <ide> <ide> (async function main() { <ide> const finished = common.mustCall(); <ide> await checkLinking(); <ide> await checkExecution(); <ide> await checkInvalidOptionForEvaluate(); <add> checkInvalidCachedData(); <ide> finished(); <ide> })();
1
Python
Python
change define_list to define_string
a32bf6356d795b5a06567491e93d410972b6b97e
<ide><path>research/object_detection/export_inference_graph.py <ide> flags.DEFINE_string('input_type', 'image_tensor', 'Type of input node. Can be ' <ide> 'one of [`image_tensor`, `encoded_image_string_tensor`, ' <ide> '`tf_example`]') <del>flags.DEFINE_list('input_shape', None, <del> 'If input_type is `image_tensor`, this can explicitly set ' <del> 'the shape of this input tensor to a fixed size. The ' <del> 'dimensions are to be provided as a comma-separated list of ' <del> 'integers. A value of -1 can be used for unknown dimensions. ' <del> 'If not specified, for an `image_tensor, the default shape ' <del> 'will be partially specified as `[None, None, None, 3]`.') <add>flags.DEFINE_string('input_shape', None, <add> 'If input_type is `image_tensor`, this can explicitly set ' <add> 'the shape of this input tensor to a fixed size. The ' <add> 'dimensions are to be provided as a comma-separated list ' <add> 'of integers. A value of -1 can be used for unknown ' <add> 'dimensions. If not specified, for an `image_tensor, the ' <add> 'default shape will be partially specified as ' <add> '`[None, None, None, 3]`.') <ide> flags.DEFINE_string('pipeline_config_path', None, <ide> 'Path to a pipeline_pb2.TrainEvalPipelineConfig config ' <ide> 'file.') <ide> def main(_): <ide> text_format.Merge(f.read(), pipeline_config) <ide> if FLAGS.input_shape: <ide> input_shape = [ <del> int(dim) if dim != '-1' else None for dim in FLAGS.input_shape <add> int(dim) if dim != '-1' else None <add> for dim in FLAGS.input_shape.split(',') <ide> ] <ide> else: <ide> input_shape = None
1
PHP
PHP
fix syntax errors and remove unnecessary casts
ca703f7e9d6d131cb2d6e49d7a238f33e0f05c3a
<ide><path>src/Console/ConsoleInputArgument.php <ide> public function usage(): string <ide> */ <ide> public function isRequired(): bool <ide> { <del> return (bool)$this->_required; <add> return $this->_required; <ide> } <ide> <ide> /** <ide><path>src/Console/ConsoleInputOption.php <ide> public function defaultValue() <ide> */ <ide> public function isRequired(): bool <ide> { <del> return (bool)$this->required; <add> return $this->required; <ide> } <ide> <ide> /** <ide><path>tests/TestCase/Console/ConsoleOptionParserTest.php <ide> public function testAddOptionRequired() <ide> $result = $parser->parse(['--test', '--no-default', 'value']); <ide> $this->assertSame( <ide> ['test' => 'default value', 'no-default' => 'value', 'help' => false], <del> $result[0], <add> $result[0] <ide> ); <ide> <ide> $result = $parser->parse(['--no-default', 'value']); <ide> $this->assertSame( <ide> ['no-default' => 'value', 'help' => false, 'test' => 'default value'], <del> $result[0], <add> $result[0] <ide> ); <ide> <ide> $this->expectException(ConsoleException::class);
3
Javascript
Javascript
use original error for cancelling pending streams
c197c78230e4fe9363569af091130e0e98eb4c7a
<ide><path>lib/internal/http2/core.js <ide> class Http2Session extends EventEmitter { <ide> <ide> // Destroy any pending and open streams <ide> const cancel = new errors.Error('ERR_HTTP2_STREAM_CANCEL'); <add> if (error) { <add> cancel.cause = error; <add> if (typeof error.message === 'string') <add> cancel.message += ` (caused by: ${error.message})`; <add> } <ide> state.pendingStreams.forEach((stream) => stream.destroy(cancel)); <ide> state.streams.forEach((stream) => stream.destroy(error)); <ide> <ide><path>test/parallel/test-http2-client-onconnect-errors.js <ide> function runTest(test) { <ide> req.on('error', errorMustCall); <ide> } else { <ide> client.on('error', errorMustCall); <del> req.on('error', common.expectsError({ <del> code: 'ERR_HTTP2_STREAM_CANCEL' <del> })); <add> req.on('error', (err) => { <add> common.expectsError({ <add> code: 'ERR_HTTP2_STREAM_CANCEL' <add> })(err); <add> common.expectsError({ <add> code: 'ERR_HTTP2_ERROR' <add> })(err.cause); <add> }); <ide> } <ide> <ide> req.on('end', common.mustCall());
2
Javascript
Javascript
update dataset metadata when axisid changes
9eecdf4da1bf79169642edd93275236d1aa9851b
<ide><path>src/core/core.datasetController.js <ide> helpers.extend(DatasetController.prototype, { <ide> linkScales: function() { <ide> var me = this; <ide> var meta = me.getMeta(); <add> var chart = me.chart; <add> var scales = chart.scales; <ide> var dataset = me.getDataset(); <add> var scalesOpts = chart.options.scales; <ide> <del> if (meta.xAxisID === null || !(meta.xAxisID in me.chart.scales)) { <del> meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id; <add> if (meta.xAxisID === null || !(meta.xAxisID in scales) || dataset.xAxisID) { <add> meta.xAxisID = dataset.xAxisID || scalesOpts.xAxes[0].id; <ide> } <del> if (meta.yAxisID === null || !(meta.yAxisID in me.chart.scales)) { <del> meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id; <add> if (meta.yAxisID === null || !(meta.yAxisID in scales) || dataset.yAxisID) { <add> meta.yAxisID = dataset.yAxisID || scalesOpts.yAxes[0].id; <ide> } <ide> }, <ide> <ide><path>test/specs/core.datasetController.tests.js <ide> describe('Chart.DatasetController', function() { <ide> expect(meta.data.length).toBe(42); <ide> }); <ide> <add> it('should re-synchronize metadata when scaleID changes', function() { <add> var chart = acquireChart({ <add> type: 'line', <add> data: { <add> datasets: [{ <add> data: [], <add> xAxisID: 'firstXScaleID', <add> yAxisID: 'firstYScaleID', <add> }] <add> }, <add> options: { <add> scales: { <add> xAxes: [{ <add> id: 'firstXScaleID' <add> }, { <add> id: 'secondXScaleID' <add> }], <add> yAxes: [{ <add> id: 'firstYScaleID' <add> }, { <add> id: 'secondYScaleID' <add> }] <add> } <add> } <add> }); <add> <add> var meta = chart.getDatasetMeta(0); <add> <add> expect(meta.xAxisID).toBe('firstXScaleID'); <add> expect(meta.yAxisID).toBe('firstYScaleID'); <add> <add> chart.data.datasets[0].xAxisID = 'secondXScaleID'; <add> chart.data.datasets[0].yAxisID = 'secondYScaleID'; <add> chart.update(); <add> <add> expect(meta.xAxisID).toBe('secondXScaleID'); <add> expect(meta.yAxisID).toBe('secondYScaleID'); <add> }); <add> <ide> it('should cleanup attached properties when the reference changes or when the chart is destroyed', function() { <ide> var data0 = [0, 1, 2, 3, 4, 5]; <ide> var data1 = [6, 7, 8];
2
Javascript
Javascript
fix some docs
5f014971b1c92894b67a0456828f688861ac430c
<ide><path>packages/ember-runtime/lib/system/core_object.js <ide> CoreObject.PrototypeMixin = Mixin.create({ <ide> <ide> /** <ide> Override to implement teardown. <add> <add> @method willDestroy <ide> */ <ide> willDestroy: Ember.K, <ide> <ide><path>packages/ember-views/lib/views/component.js <ide> Ember.Component = Ember.View.extend(Ember.TargetActionSupport, { <ide> }).property('_parentView'), <ide> <ide> /** <del> Sends an action to component's controller. A component inherits its <del> controller from the context in which it is used. <add> Sends an action to component's controller. A component inherits its <add> controller from the context in which it is used. <ide> <del> By default, calling `sendAction()` will send an action with the name <del> of the component's `action` property. <add> By default, calling `sendAction()` will send an action with the name <add> of the component's `action` property. <ide> <del> For example, if the component had a property `action` with the value <del> `"addItem"`, calling `sendAction()` would send the `addItem` action <del> to the component's controller. <add> For example, if the component had a property `action` with the value <add> `"addItem"`, calling `sendAction()` would send the `addItem` action <add> to the component's controller. <ide> <del> If you provide an argument to `sendAction()`, that key will be used to look <del> up the action name. <add> If you provide an argument to `sendAction()`, that key will be used to look <add> up the action name. <ide> <del> For example, if the component had a property `playing` with the value <del> `didStartPlaying`, calling `sendAction('playing')` would send the <del> `didStartPlaying` action to the component's controller. <add> For example, if the component had a property `playing` with the value <add> `didStartPlaying`, calling `sendAction('playing')` would send the <add> `didStartPlaying` action to the component's controller. <ide> <del> Whether or not you are using the default action or a named action, if <del> the action name is not defined on the component, calling `sendAction()` <del> does not have any effect. <add> Whether or not you are using the default action or a named action, if <add> the action name is not defined on the component, calling `sendAction()` <add> does not have any effect. <ide> <del> For example, if you call `sendAction()` on a component that does not have <del> an `action` property defined, no action will be sent to the controller, <del> nor will an exception be raised. <add> For example, if you call `sendAction()` on a component that does not have <add> an `action` property defined, no action will be sent to the controller, <add> nor will an exception be raised. <ide> <del> @param [action] {String} the action to trigger <add> @method sendAction <add> @param [action] {String} the action to trigger <ide> */ <ide> sendAction: function(action) { <ide> var actionName; <ide><path>packages/ember-views/lib/views/view.js <ide> Ember.View = Ember.CoreView.extend( <ide> <ide> /** <ide> The parent context for this template. <add> <add> @method parentContext <add> @return {Ember.View} <ide> */ <ide> parentContext: function() { <ide> var parentView = get(this, '_parentView');
3
Javascript
Javascript
remove debugger statement from an e2e test
19ba6510d02317311fd1af3a173bc9eb970615bc
<ide><path>src/ng/directive/ngClass.js <ide> function classDirective(name, selector) { <ide> expect(ps.get(1).getAttribute('class')).toBe(''); <ide> element(by.model('style')).clear(); <ide> element(by.model('style')).sendKeys('red'); <del> browser.debugger(); <ide> expect(ps.get(1).getAttribute('class')).toBe('red'); <ide> }); <ide>
1
Text
Text
fix minor grammar error in readme
e614851c53109701d277caacb941201b83c50845
<ide><path>README.md <ide> So, what are you waiting for? <ide> <ide> #### [Watch the 30 Free Videos!](https://egghead.io/series/getting-started-with-redux) <ide> <del>If you enjoyed my course, consider supporting Egghead by [buying a subscription](https://egghead.io/pricing). Subscribers have access to the source code for the example in every my video, as well as to tons of advanced lessons on other topics, including JavaScript in depth, React, Angular, and more. Many [Egghead instructors](https://egghead.io/instructors) are also open source library authors, so buying a subscription is a nice way to thank them for the work that they’ve done. <add>If you enjoyed my course, consider supporting Egghead by [buying a subscription](https://egghead.io/pricing). Subscribers have access to the source code for the example in every one of my videos, as well as to tons of advanced lessons on other topics, including JavaScript in depth, React, Angular, and more. Many [Egghead instructors](https://egghead.io/instructors) are also open source library authors, so buying a subscription is a nice way to thank them for the work that they’ve done. <ide> <ide> ### Documentation <ide>
1
Python
Python
apply zip fixer
0dfe67afd1ee9e4c905bf119673f6e634221f21b
<ide><path>doc/sphinxext/numpydoc/compiler_unparse.py <ide> if sys.version_info[0] >= 3: <ide> from io import StringIO <ide> else: <del> from io import StringIO <add> from StringIO import StringIO <ide> <ide> def unparse(ast, single_line_functions=False): <ide> s = StringIO() <ide> def _And(self, t): <ide> if i != len(t.nodes)-1: <ide> self._write(") and (") <ide> self._write(")") <del> <add> <ide> def _AssAttr(self, t): <ide> """ Handle assigning an attribute of an object <ide> """ <ide> self._dispatch(t.expr) <ide> self._write('.'+t.attrname) <del> <add> <ide> def _Assign(self, t): <ide> """ Expression Assignment such as "a = 1". <ide> <ide> def _AssTuple(self, t): <ide> def _AugAssign(self, t): <ide> """ +=,-=,*=,/=,**=, etc. operations <ide> """ <del> <add> <ide> self._fill() <ide> self._dispatch(t.node) <ide> self._write(' '+t.op+' ') <ide> self._dispatch(t.expr) <ide> if not self._do_indent: <ide> self._write(';') <del> <add> <ide> def _Bitand(self, t): <ide> """ Bit and operation. <ide> """ <del> <add> <ide> for i, node in enumerate(t.nodes): <ide> self._write("(") <ide> self._dispatch(node) <ide> self._write(")") <ide> if i != len(t.nodes)-1: <ide> self._write(" & ") <del> <add> <ide> def _Bitor(self, t): <ide> """ Bit or operation <ide> """ <del> <add> <ide> for i, node in enumerate(t.nodes): <ide> self._write("(") <ide> self._dispatch(node) <ide> self._write(")") <ide> if i != len(t.nodes)-1: <ide> self._write(" | ") <del> <add> <ide> def _CallFunc(self, t): <ide> """ Function call. <ide> """ <ide> def _From(self, t): <ide> self._write(name) <ide> if asname is not None: <ide> self._write(" as "+asname) <del> <add> <ide> def _Function(self, t): <ide> """ Handle function definitions <ide> """ <ide><path>numpy/core/tests/test_getlimits.py <ide> def test_singleton(self,level=2): <ide> <ide> class TestIinfo(TestCase): <ide> def test_basic(self): <del> dts = zip(['i1', 'i2', 'i4', 'i8', <add> dts = list(zip(['i1', 'i2', 'i4', 'i8', <ide> 'u1', 'u2', 'u4', 'u8'], <ide> [np.int8, np.int16, np.int32, np.int64, <del> np.uint8, np.uint16, np.uint32, np.uint64]) <add> np.uint8, np.uint16, np.uint32, np.uint64])) <ide> for dt1, dt2 in dts: <ide> assert_equal(iinfo(dt1).min, iinfo(dt2).min) <ide> assert_equal(iinfo(dt1).max, iinfo(dt2).max) <ide><path>numpy/core/tests/test_nditer.py <ide> def assign_iter(i): <ide> assert_equal(i[0], 0) <ide> i[1] = 1 <ide> assert_equal(i[0:2], [0,1]) <del> assert_equal([[x[0][()],x[1][()]] for x in i], zip(list(range(6)), [1]*6)) <add> assert_equal([[x[0][()],x[1][()]] for x in i], list(zip(range(6), [1]*6))) <ide> <ide> def test_iter_buffered_cast_simple(): <ide> # Test that buffering can handle a simple cast <ide><path>numpy/core/tests/test_ufunc.py <ide> def test_pickle_withstring(self): <ide> def test_reduceat_shifting_sum(self) : <ide> L = 6 <ide> x = np.arange(L) <del> idx = np.array(zip(np.arange(L-2), np.arange(L-2)+2)).ravel() <add> idx = np.array(list(zip(np.arange(L - 2), np.arange(L - 2) + 2))).ravel() <ide> assert_array_equal(np.add.reduceat(x,idx)[::2], [1,3,5,7]) <ide> <ide> def test_generic_loops(self) : <ide><path>numpy/lib/_iotools.py <ide> def easy_dtype(ndtype, names=None, defaultfmt="f%i", **validationargs): <ide> if nbtypes == 0: <ide> formats = tuple([ndtype.type] * len(names)) <ide> names = validate(names, defaultfmt=defaultfmt) <del> ndtype = np.dtype(zip(names, formats)) <add> ndtype = np.dtype(list(zip(names, formats))) <ide> # Structured dtype: just validate the names as needed <ide> else: <ide> ndtype.names = validate(names, nbfields=nbtypes, <ide><path>numpy/lib/npyio.py <ide> def genfromtxt(fname, dtype=float, comments='#', delimiter=None, <ide> # rows[i] = tuple([convert(val) <ide> # for (convert, val) in zip(conversionfuncs, vals)]) <ide> if loose: <del> rows = zip(*[[converter._loose_call(_r) for _r in map(itemgetter(i), rows)] <del> for (i, converter) in enumerate(converters)]) <add> rows = list(zip(*[[converter._loose_call(_r) for _r in map(itemgetter(i), rows)] <add> for (i, converter) in enumerate(converters)])) <ide> else: <del> rows = zip(*[[converter._strict_call(_r) for _r in map(itemgetter(i), rows)] <del> for (i, converter) in enumerate(converters)]) <add> rows = list(zip(*[[converter._strict_call(_r) for _r in map(itemgetter(i), rows)] <add> for (i, converter) in enumerate(converters)])) <ide> # Reset the dtype <ide> data = rows <ide> if dtype is None: <ide> def genfromtxt(fname, dtype=float, comments='#', delimiter=None, <ide> mdtype = [(defaultfmt % i, np.bool) <ide> for (i, dt) in enumerate(column_types)] <ide> else: <del> ddtype = zip(names, column_types) <del> mdtype = zip(names, [np.bool] * len(column_types)) <add> ddtype = list(zip(names, column_types)) <add> mdtype = list(zip(names, [np.bool] * len(column_types))) <ide> output = np.array(data, dtype=ddtype) <ide> if usemask: <ide> outputmask = np.array(masks, dtype=mdtype) <ide><path>numpy/lib/tests/test_arraysetops.py <ide> def check_all(a, b, i1, i2, dt): <ide> <ide> # test for structured arrays <ide> dt = [('', 'i'), ('', 'i')] <del> aa = np.array(zip(a,a), dt) <del> bb = np.array(zip(b,b), dt) <add> aa = np.array(list(zip(a,a)), dt) <add> bb = np.array(list(zip(b,b)), dt) <ide> check_all(aa, bb, i1, i2, dt) <ide> <ide> <ide><path>numpy/lib/tests/test_io.py <ide> def test_usecols(self): <ide> c = TextIO(data) <ide> names = ['stid', 'temp'] <ide> dtypes = ['S4', 'f8'] <del> arr = np.loadtxt(c, usecols=(0, 2), dtype=zip(names, dtypes)) <add> arr = np.loadtxt(c, usecols=(0, 2), dtype=list(zip(names, dtypes))) <ide> assert_equal(arr['stid'], [b"JOE", b"BOB"]) <ide> assert_equal(arr['temp'], [25.3, 27.9]) <ide> <ide> def test_usecols_with_structured_dtype(self): <ide> data = TextIO("JOE 70.1 25.3\nBOB 60.5 27.9") <ide> names = ['stid', 'temp'] <ide> dtypes = ['S4', 'f8'] <del> test = np.ndfromtxt(data, usecols=(0, 2), dtype=zip(names, dtypes)) <add> test = np.ndfromtxt(data, usecols=(0, 2), dtype=list(zip(names, dtypes))) <ide> assert_equal(test['stid'], [b"JOE", b"BOB"]) <ide> assert_equal(test['temp'], [25.3, 27.9]) <ide> <ide><path>numpy/lib/tests/test_recfunctions.py <ide> def test_checktitles(self): <ide> <ide> class TestJoinBy(TestCase): <ide> def setUp(self): <del> self.a = np.array(zip(np.arange(10), np.arange(50, 60), <del> np.arange(100, 110)), <add> self.a = np.array(list(zip(np.arange(10), np.arange(50, 60), <add> np.arange(100, 110))), <ide> dtype=[('a', int), ('b', int), ('c', int)]) <del> self.b = np.array(zip(np.arange(5, 15), np.arange(65, 75), <del> np.arange(100, 110)), <add> self.b = np.array(list(zip(np.arange(5, 15), np.arange(65, 75), <add> np.arange(100, 110))), <ide> dtype=[('a', int), ('b', int), ('d', int)]) <ide> # <ide> def test_inner_join(self): <ide> def test_leftouter_join(self): <ide> class TestJoinBy2(TestCase): <ide> @classmethod <ide> def setUp(cls): <del> cls.a = np.array(zip(np.arange(10), np.arange(50, 60), <del> np.arange(100, 110)), <add> cls.a = np.array(list(zip(np.arange(10), np.arange(50, 60), <add> np.arange(100, 110))), <ide> dtype=[('a', int), ('b', int), ('c', int)]) <del> cls.b = np.array(zip(np.arange(10), np.arange(65, 75), <del> np.arange(100, 110)), <add> cls.b = np.array(list(zip(np.arange(10), np.arange(65, 75), <add> np.arange(100, 110))), <ide> dtype=[('a', int), ('b', int), ('d', int)]) <ide> <ide> def test_no_r1postfix(self): <ide> def test_no_r2postfix(self): <ide> assert_equal(test, control) <ide> <ide> def test_two_keys_two_vars(self): <del> a = np.array(zip(np.tile([10,11],5),np.repeat(np.arange(5),2), <del> np.arange(50, 60), np.arange(10,20)), <add> a = np.array(list(zip(np.tile([10,11],5),np.repeat(np.arange(5),2), <add> np.arange(50, 60), np.arange(10,20))), <ide> dtype=[('k', int), ('a', int), ('b', int),('c',int)]) <ide> <del> b = np.array(zip(np.tile([10,11],5),np.repeat(np.arange(5),2), <del> np.arange(65, 75), np.arange(0,10)), <add> b = np.array(list(zip(np.tile([10,11],5),np.repeat(np.arange(5),2), <add> np.arange(65, 75), np.arange(0,10))), <ide> dtype=[('k', int), ('a', int), ('b', int), ('c',int)]) <ide> <ide> control = np.array([(10, 0, 50, 65, 10, 0), (11, 0, 51, 66, 11, 1), <ide><path>numpy/ma/mrecords.py <ide> def fromarrays(arraylist, dtype=None, shape=None, formats=None, <ide> dtype=dtype, shape=shape, formats=formats, <ide> names=names, titles=titles, aligned=aligned, <ide> byteorder=byteorder).view(mrecarray) <del> _array._mask.flat = zip(*masklist) <add> _array._mask.flat = list(zip(*masklist)) <ide> if fill_value is not None: <ide> _array.fill_value = fill_value <ide> return _array <ide><path>numpy/ma/tests/test_core.py <ide> def test_concatenate_alongaxis(self): <ide> <ide> def test_concatenate_flexible(self): <ide> "Tests the concatenation on flexible arrays." <del> data = masked_array(zip(np.random.rand(10), <del> np.arange(10)), <add> data = masked_array(list(zip(np.random.rand(10), <add> np.arange(10))), <ide> dtype=[('a', float), ('b', int)]) <ide> # <ide> test = concatenate([data[:5], data[5:]]) <ide> def test_fillvalue_individual_fields(self): <ide> "Test setting fill_value on individual fields" <ide> ndtype = [('a', int), ('b', int)] <ide> # Explicit fill_value <del> a = array(zip([1, 2, 3], [4, 5, 6]), <add> a = array(list(zip([1, 2, 3], [4, 5, 6])), <ide> fill_value=(-999, -999), dtype=ndtype) <ide> f = a._fill_value <ide> aa = a['a'] <ide> def test_fillvalue_individual_fields(self): <ide> a.fill_value['b'] = -10 <ide> assert_equal(tuple(a.fill_value), (10, -10)) <ide> # Implicit fill_value <del> t = array(zip([1, 2, 3], [4, 5, 6]), dtype=[('a', int), ('b', int)]) <add> t = array(list(zip([1, 2, 3], [4, 5, 6])), dtype=[('a', int), ('b', int)]) <ide> tt = t['a'] <ide> tt.set_fill_value(10) <ide> assert_equal(tt._fill_value, np.array(10)) <ide> def test_tolist(self): <ide> assert_equal(xlist[2], [8, 9, None, 11]) <ide> assert_equal(xlist, ctrl) <ide> # ... on structured array w/ masked records <del> x = array(zip([1, 2, 3], <add> x = array(list(zip([1, 2, 3], <ide> [1.1, 2.2, 3.3], <del> ['one', 'two', 'thr']), <add> ['one', 'two', 'thr'])), <ide> dtype=[('a', int), ('b', float), ('c', '|S8')]) <ide> x[-1] = masked <ide> assert_equal(x.tolist(), <ide> def setUp(self): <ide> ddtype = [('a', int), ('b', float), ('c', '|S8')] <ide> mdtype = [('a', bool), ('b', bool), ('c', bool)] <ide> mask = [0, 1, 0, 0, 1] <del> base = array(zip(ilist, flist, slist), mask=mask, dtype=ddtype) <add> base = array(list(zip(ilist, flist, slist)), mask=mask, dtype=ddtype) <ide> self.data = dict(base=base, mask=mask, ddtype=ddtype, mdtype=mdtype) <ide> <ide> def test_set_records_masks(self): <ide> def test_getmaskarray(self): <ide> # <ide> def test_view(self): <ide> "Test view w/ flexible dtype" <del> iterator = zip(np.arange(10), np.random.rand(10)) <add> iterator = list(zip(np.arange(10), np.random.rand(10))) <ide> data = np.array(iterator) <ide> a = array(iterator, dtype=[('a', float), ('b', float)]) <ide> a.mask[0] = (1, 0) <ide> def test_view(self): <ide> # <ide> def test_getitem(self): <ide> ndtype = [('a', float), ('b', float)] <del> a = array(zip(np.random.rand(10), np.arange(10)), dtype=ndtype) <del> a.mask = np.array(zip([0, 0, 0, 0, 0, 0, 0, 0, 1, 1], <del> [1, 0, 0, 0, 0, 0, 0, 0, 1, 0]), <add> a = array(list(zip(np.random.rand(10), np.arange(10))), dtype=ndtype) <add> a.mask = np.array(list(zip([0, 0, 0, 0, 0, 0, 0, 0, 1, 1], <add> [1, 0, 0, 0, 0, 0, 0, 0, 1, 0])), <ide> dtype=[('a', bool), ('b', bool)]) <ide> # No mask <ide> self.assertTrue(isinstance(a[1], MaskedArray)) <ide> def test_getitem(self): <ide> class TestMaskedView(TestCase): <ide> # <ide> def setUp(self): <del> iterator = zip(np.arange(10), np.random.rand(10)) <add> iterator = list(zip(np.arange(10), np.random.rand(10))) <ide> data = np.array(iterator) <ide> a = array(iterator, dtype=[('a', float), ('b', float)]) <ide> a.mask[0] = (1, 0) <ide><path>numpy/ma/tests/test_mrecords.py <ide> class TestView(TestCase): <ide> def setUp(self): <ide> (a, b) = (np.arange(10), np.random.rand(10)) <ide> ndtype = [('a',np.float), ('b',np.float)] <del> arr = np.array(zip(a,b), dtype=ndtype) <add> arr = np.array(list(zip(a,b)), dtype=ndtype) <ide> rec = arr.view(np.recarray) <ide> # <del> marr = ma.array(zip(a,b), dtype=ndtype, fill_value=(-9., -99.)) <add> marr = ma.array(list(zip(a,b)), dtype=ndtype, fill_value=(-9., -99.)) <ide> mrec = fromarrays([a,b], dtype=ndtype, fill_value=(-9., -99.)) <ide> mrec.mask[3] = (False, True) <ide> self.data = (mrec, a, b, arr) <ide> def test_view_simple_dtype(self): <ide> ntype = (np.float, 2) <ide> test = mrec.view(ntype) <ide> self.assertTrue(isinstance(test, ma.MaskedArray)) <del> assert_equal(test, np.array(zip(a,b), dtype=np.float)) <add> assert_equal(test, np.array(list(zip(a,b)), dtype=np.float)) <ide> self.assertTrue(test[3,1] is ma.masked) <ide> # <ide> def test_view_flexible_type(self): <ide><path>tools/py3tool.py <ide> # 'ws_comma', <ide> 'xrange', <ide> 'xreadlines', <del># 'zip', <add> 'zip', <ide> ] <ide> <ide> skip_fixes= []
13
Javascript
Javascript
remove double check of string type
35109ddaf254137ab11383fddd1a00a7f1b77916
<ide><path>lib/_http_outgoing.js <ide> OutgoingMessage.prototype.setHeader = function(name, value) { <ide> if (!common._checkIsHttpToken(name)) <ide> throw new TypeError( <ide> 'Header name must be a valid HTTP Token ["' + name + '"]'); <del> if (typeof name !== 'string') <del> throw new TypeError('"name" should be a string in setHeader(name, value)'); <ide> if (value === undefined) <ide> throw new Error('"value" required in setHeader("' + name + '", value)'); <ide> if (this._header)
1
Go
Go
fix debug in startservicevmifnotrunning()
b7a95a3ce4c731c0fca204435be758ea89d6050f
<ide><path>daemon/graphdriver/lcow/lcow.go <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> // Use the global ID if in global mode <ide> id = d.getVMID(id) <ide> <del> title := fmt.Sprintf("lcowdriver: startservicevmifnotrunning %s:", id) <add> title := "lcowdriver: startServiceVMIfNotRunning " + id <ide> <ide> // Attempt to add ID to the service vm map <del> logrus.Debugf("%s: Adding entry to service vm map", title) <add> logrus.Debugf("%s: adding entry to service vm map", title) <ide> svm, exists, err := d.serviceVms.add(id) <ide> if err != nil && err == errVMisTerminating { <ide> // VM is in the process of terminating. Wait until it's done and and then try again <del> logrus.Debugf("%s: VM with current ID still in the process of terminating: %s", title, id) <add> logrus.Debugf("%s: VM with current ID still in the process of terminating", title) <ide> if err := svm.getStopError(); err != nil { <del> logrus.Debugf("%s: VM %s did not stop successfully: %s", title, id, err) <add> logrus.Debugf("%s: VM did not stop successfully: %s", title, err) <ide> return nil, err <ide> } <ide> return d.startServiceVMIfNotRunning(id, mvdToAdd, context) <ide> } else if err != nil { <del> logrus.Debugf("%s: failed to add service vm to map: %s", err) <add> logrus.Debugf("%s: failed to add service vm to map: %s", title, err) <ide> return nil, fmt.Errorf("%s: failed to add to service vm map: %s", title, err) <ide> } <ide> <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> } <ide> <ide> // We are the first service for this id, so we need to start it <del> logrus.Debugf("%s: service vm doesn't exist. Now starting it up: %s", title, id) <add> logrus.Debugf("%s: service vm doesn't exist. Now starting it up", title) <ide> <ide> defer func() { <ide> // Signal that start has finished, passing in the error if any. <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> <ide> // Generate a default configuration <ide> if err := svm.config.GenerateDefault(d.options); err != nil { <del> return nil, fmt.Errorf("%s failed to generate default gogcs configuration for global svm (%s): %s", title, context, err) <add> return nil, fmt.Errorf("%s: failed to generate default gogcs configuration for global svm (%s): %s", title, context, err) <ide> } <ide> <ide> // For the name, we deliberately suffix if safe-mode to ensure that it doesn't <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> // and not in the process of being created by another thread. <ide> scratchTargetFile := filepath.Join(d.dataRoot, scratchDirectory, fmt.Sprintf("%s.vhdx", id)) <ide> <del> logrus.Debugf("%s locking cachedScratchMutex", title) <add> logrus.Debugf("%s: locking cachedScratchMutex", title) <ide> d.cachedScratchMutex.Lock() <ide> if _, err := os.Stat(d.cachedScratchFile); err == nil { <ide> // Make a copy of cached scratch to the scratch directory <del> logrus.Debugf("lcowdriver: startServiceVmIfNotRunning: (%s) cloning cached scratch for mvd", context) <add> logrus.Debugf("%s: (%s) cloning cached scratch for mvd", title, context) <ide> if err := client.CopyFile(d.cachedScratchFile, scratchTargetFile, true); err != nil { <del> logrus.Debugf("%s releasing cachedScratchMutex on err: %s", title, err) <add> logrus.Debugf("%s: releasing cachedScratchMutex on err: %s", title, err) <ide> d.cachedScratchMutex.Unlock() <ide> return nil, err <ide> } <ide> <ide> // Add the cached clone as a mapped virtual disk <del> logrus.Debugf("lcowdriver: startServiceVmIfNotRunning: (%s) adding cloned scratch as mvd", context) <add> logrus.Debugf("%s: (%s) adding cloned scratch as mvd", title, context) <ide> mvd := hcsshim.MappedVirtualDisk{ <ide> HostPath: scratchTargetFile, <ide> ContainerPath: toolsScratchPath, <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> svm.scratchAttached = true <ide> } <ide> <del> logrus.Debugf("%s releasing cachedScratchMutex", title) <add> logrus.Debugf("%s: releasing cachedScratchMutex", title) <ide> d.cachedScratchMutex.Unlock() <ide> <ide> // If requested to start it with a mapped virtual disk, add it now. <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> } <ide> <ide> // Start it. <del> logrus.Debugf("lcowdriver: startServiceVmIfNotRunning: (%s) starting %s", context, svm.config.Name) <add> logrus.Debugf("%s: (%s) starting %s", title, context, svm.config.Name) <ide> if err := svm.config.StartUtilityVM(); err != nil { <ide> return nil, fmt.Errorf("failed to start service utility VM (%s): %s", context, err) <ide> } <ide> <ide> // defer function to terminate the VM if the next steps fail <ide> defer func() { <ide> if err != nil { <del> waitTerminate(svm, fmt.Sprintf("startServiceVmIfNotRunning: %s (%s)", id, context)) <add> waitTerminate(svm, fmt.Sprintf("%s: (%s)", title, context)) <ide> } <ide> }() <ide> <ide> // Now we have a running service VM, we can create the cached scratch file if it doesn't exist. <del> logrus.Debugf("%s locking cachedScratchMutex", title) <add> logrus.Debugf("%s: locking cachedScratchMutex", title) <ide> d.cachedScratchMutex.Lock() <ide> if _, err := os.Stat(d.cachedScratchFile); err != nil { <del> logrus.Debugf("%s (%s): creating an SVM scratch", title, context) <add> logrus.Debugf("%s: (%s) creating an SVM scratch", title, context) <ide> <ide> // Don't use svm.CreateExt4Vhdx since that only works when the service vm is setup, <ide> // but we're still in that process right now. <ide> if err := svm.config.CreateExt4Vhdx(scratchTargetFile, client.DefaultVhdxSizeGB, d.cachedScratchFile); err != nil { <del> logrus.Debugf("%s (%s): releasing cachedScratchMutex on error path", title, context) <add> logrus.Debugf("%s: (%s) releasing cachedScratchMutex on error path", title, context) <ide> d.cachedScratchMutex.Unlock() <ide> logrus.Debugf("%s: failed to create vm scratch %s: %s", title, scratchTargetFile, err) <ide> return nil, fmt.Errorf("failed to create SVM scratch VHDX (%s): %s", context, err) <ide> } <ide> } <del> logrus.Debugf("%s (%s): releasing cachedScratchMutex", title, context) <add> logrus.Debugf("%s: (%s) releasing cachedScratchMutex", title, context) <ide> d.cachedScratchMutex.Unlock() <ide> <ide> // Hot-add the scratch-space if not already attached <ide> if !svm.scratchAttached { <del> logrus.Debugf("lcowdriver: startServiceVmIfNotRunning: (%s) hot-adding scratch %s", context, scratchTargetFile) <add> logrus.Debugf("%s: (%s) hot-adding scratch %s", title, context, scratchTargetFile) <ide> if err := svm.hotAddVHDsAtStart(hcsshim.MappedVirtualDisk{ <ide> HostPath: scratchTargetFile, <ide> ContainerPath: toolsScratchPath, <ide> func (d *Driver) startServiceVMIfNotRunning(id string, mvdToAdd []hcsshim.Mapped <ide> svm.scratchAttached = true <ide> } <ide> <del> logrus.Debugf("lcowdriver: startServiceVmIfNotRunning: (%s) success", context) <add> logrus.Debugf("%s: (%s) success", title, context) <ide> return svm, nil <ide> } <ide>
1
Ruby
Ruby
repair the command option
47699614fd4c5dce4d0c1216f09756c84c653f1b
<ide><path>Library/Homebrew/dev-cmd/edit.rb <ide> def edit <ide> else <ide> <<~EOS <ide> #{path} doesn't exist on disk. \ <del> Run #{Formatter.identifier("brew create --set-name #{path.basename} $URL")} \ <add> Run #{Formatter.identifier("brew create --formula --set-name #{path.basename} $URL")} \ <ide> to create a new formula! <ide> EOS <ide> end
1
Javascript
Javascript
fix rgb output
78a12767f0223cf429df04099353b7c0437915c0
<ide><path>examples/jsm/exporters/USDZExporter.js <ide> function buildMaterial( material, textures ) { <ide> float outputs:g <ide> float outputs:b <ide> float outputs:a <del> float3 outputs:rgba <add> float3 outputs:rgb <ide> }`; <ide> <ide> }
1
Text
Text
fix image size
325d29bad377f2c9d871160abc67578132278f88
<ide><path>threejs/lessons/threejs-post-processing-3dlut.md <ide> We'll also add a background image like we covered in [backgrounds and skyboxs](t <ide> <ide> Now that we have a scene we need a 3DLUT. The simplest 3DLUT is a 2x2x2 identity LUT where *identity* means nothing happens. It's like multiplying by 1 or doing nothign, even though we're looking up colors in the LUT each color in maps to the same color out. <ide> <del><div class="threejs_center"><img src="resources/images/3dlut-standard-2x2.svg" style="width: 100px"></div> <add><div class="threejs_center"><img src="resources/images/3dlut-standard-2x2.svg" style="width: 200px"></div> <ide> <ide> WebGL1 doesn't support 3D textures so we'll use 4x2 2D texture and treat it as a 3D texture inside a custom shader where each slice of the cube is spread out horizontally across the texture. <ide>
1
Javascript
Javascript
remove event handlers when menu item is removed
259ce71ee707ce93f4868ce0db8ee7405d76ab44
<ide><path>src/js/menu/menu.js <ide> class Menu extends Component { <ide> this.focusedChild_ = -1; <ide> <ide> this.on('keydown', this.handleKeyPress); <add> <add> // All the menu item instances share the same blur handler provided by the menu container. <add> this.boundHandleBlur_ = Fn.bind(this, this.handleBlur); <add> this.boundHandleTapClick_ = Fn.bind(this, this.handleTapClick); <add> } <add> <add> /** <add> * Add event listeners to the {@link MenuItem}. <add> * <add> * @param {Object} component <add> * The instance of the `MenuItem` to add listeners to. <add> * <add> */ <add> addEventListenerForItem(component) { <add> if (!(component instanceof Component)) { <add> return; <add> } <add> <add> component.on('blur', this.boundHandleBlur_); <add> component.on(['tap', 'click'], this.boundHandleTapClick_); <add> } <add> <add> /** <add> * Remove event listeners from the {@link MenuItem}. <add> * <add> * @param {Object} component <add> * The instance of the `MenuItem` to remove listeners. <add> * <add> */ <add> removeEventListenerForItem(component) { <add> if (!(component instanceof Component)) { <add> return; <add> } <add> <add> component.off('blur', this.boundHandleBlur_); <add> component.off(['tap', 'click'], this.boundHandleTapClick_); <add> } <add> <add> /** <add> * This method will be called indirectly when the component has been added <add> * before the component adds to the new menu instance by `addItem`. <add> * In this case, the original menu instance will remove the component <add> * by calling `removeChild`. <add> * <add> * @param {Object} component <add> * The instance of the `MenuItem` <add> */ <add> removeChild(component) { <add> if (typeof component === 'string') { <add> component = this.getChild(component); <add> } <add> <add> this.removeEventListenerForItem(component); <add> super.removeChild(component); <ide> } <ide> <ide> /** <ide> class Menu extends Component { <ide> * <ide> */ <ide> addItem(component) { <del> this.addChild(component); <del> component.on('blur', Fn.bind(this, this.handleBlur)); <del> component.on(['tap', 'click'], Fn.bind(this, function(event) { <del> // Unpress the associated MenuButton, and move focus back to it <del> if (this.menuButton_) { <del> this.menuButton_.unpressButton(); <del> <del> // don't focus menu button if item is a caption settings item <del> // because focus will move elsewhere <del> if (component.name() !== 'CaptionSettingsMenuItem') { <del> this.menuButton_.focus(); <del> } <del> } <del> })); <add> const childComponent = this.addChild(component); <add> <add> if (childComponent) { <add> this.addEventListenerForItem(childComponent); <add> } <ide> } <ide> <ide> /** <ide> class Menu extends Component { <ide> <ide> dispose() { <ide> this.contentEl_ = null; <add> this.boundHandleBlur_ = null; <add> this.boundHandleTapClick_ = null; <ide> <ide> super.dispose(); <ide> } <ide> class Menu extends Component { <ide> } <ide> } <ide> <add> /** <add> * Called when a `MenuItem` gets clicked or tapped. <add> * <add> * @param {EventTarget~Event} event <add> * The `click` or `tap` event that caused this function to be called. <add> * <add> * @listens click,tap <add> */ <add> handleTapClick(event) { <add> // Unpress the associated MenuButton, and move focus back to it <add> if (this.menuButton_) { <add> this.menuButton_.unpressButton(); <add> <add> const childComponents = this.children(); <add> <add> if (!Array.isArray(childComponents)) { <add> return; <add> } <add> <add> const foundComponent = childComponents.filter(component => component.el() === event.target)[0]; <add> <add> if (!foundComponent) { <add> return; <add> } <add> <add> // don't focus menu button if item is a caption settings item <add> // because focus will move elsewhere <add> if (foundComponent.name() !== 'CaptionSettingsMenuItem') { <add> this.menuButton_.focus(); <add> } <add> } <add> } <add> <ide> /** <ide> * Handle a `keydown` event on this menu. This listener is added in the constructor. <ide> * <ide><path>test/unit/menu.test.js <ide> /* eslint-env qunit */ <add>import * as DomData from '../../src/js/utils/dom-data'; <ide> import MenuButton from '../../src/js/menu/menu-button.js'; <add>import Menu from '../../src/js/menu/menu.js'; <add>import CaptionSettingsMenuItem from '../../src/js/control-bar/text-track-controls/caption-settings-menu-item'; <ide> import MenuItem from '../../src/js/menu/menu-item.js'; <ide> import TestHelpers from './test-helpers.js'; <ide> import * as Events from '../../src/js/utils/events.js'; <add>import sinon from 'sinon'; <ide> <ide> QUnit.module('MenuButton'); <ide> <ide> QUnit.test('should keep all the added menu items', function(assert) { <ide> assert.ok(menuButton.el().contains(menuItem1.el()), 'the menu button contains the DOM element of `menuItem1` after second update'); <ide> assert.ok(menuButton.el().contains(menuItem2.el()), 'the menu button contains the DOM element of `menuItem2` after second update'); <ide> }); <add> <add>QUnit.test('should remove old event listeners when the menu item adds to the new menu', function(assert) { <add> const player = TestHelpers.makePlayer(); <add> const menuButton = new MenuButton(player, {}); <add> const oldMenu = new Menu(player, { menuButton }); <add> const newMenu = new Menu(player, { menuButton }); <add> <add> oldMenu.addItem('MenuItem'); <add> <add> const menuItem = oldMenu.children()[0]; <add> <add> assert.ok(menuItem instanceof MenuItem, '`menuItem` should be the instanceof of `MenuItem`'); <add> <add> /** <add> * A reusable collection of assertions. <add> */ <add> function validateMenuEventListeners(watchedMenu) { <add> const eventData = DomData.getData(menuItem.eventBusEl_); <add> // `MenuButton`.`unpressButton` will be called when triggering click event on the menu item. <add> const unpressButtonSpy = sinon.spy(menuButton, 'unpressButton'); <add> // `MenuButton`.`focus` will be called when triggering click event on the menu item. <add> const focusSpy = sinon.spy(menuButton, 'focus'); <add> <add> // `Menu`.`children` will be called when triggering blur event on the menu item. <add> const menuChildrenSpy = sinon.spy(watchedMenu, 'children'); <add> <add> // The number of blur listeners is two because `ClickableComponent` <add> // adds the blur event listener during the construction and <add> // `MenuItem` inherits from `ClickableComponent`. <add> assert.strictEqual(eventData.handlers.blur.length, 2, 'the number of blur listeners is two'); <add> // Same reason mentioned above. <add> assert.strictEqual(eventData.handlers.click.length, 2, 'the number of click listeners is two'); <add> <add> const blurListenerAddedByMenu = eventData.handlers.blur[1]; <add> const clickListenerAddedByMenu = eventData.handlers.click[1]; <add> <add> assert.strictEqual( <add> typeof blurListenerAddedByMenu.calledOnce, <add> 'undefined', <add> 'previous blur listener wrapped in the spy should be removed' <add> ); <add> <add> assert.strictEqual( <add> typeof clickListenerAddedByMenu.calledOnce, <add> 'undefined', <add> 'previous click listener wrapped in the spy should be removed' <add> ); <add> <add> const blurListenerSpy = eventData.handlers.blur[1] = sinon.spy(blurListenerAddedByMenu); <add> const clickListenerSpy = eventData.handlers.click[1] = sinon.spy(clickListenerAddedByMenu); <add> <add> TestHelpers.triggerDomEvent(menuItem.el(), 'blur'); <add> <add> assert.ok(blurListenerSpy.calledOnce, 'blur event listener should be called'); <add> assert.strictEqual(blurListenerSpy.getCall(0).args[0].target, menuItem.el(), 'event target should be the `menuItem`'); <add> assert.ok(menuChildrenSpy.calledOnce, '`watchedMenu`.`children` has been called'); <add> <add> TestHelpers.triggerDomEvent(menuItem.el(), 'click'); <add> <add> assert.ok(clickListenerSpy.calledOnce, 'click event listener should be called'); <add> assert.strictEqual(clickListenerSpy.getCall(0).args[0].target, menuItem.el(), 'event target should be the `menuItem`'); <add> assert.ok(unpressButtonSpy.calledOnce, '`menuButton`.`unpressButtion` has been called'); <add> assert.ok(focusSpy.calledOnce, '`menuButton`.`focus` has been called'); <add> <add> unpressButtonSpy.restore(); <add> focusSpy.restore(); <add> menuChildrenSpy.restore(); <add> } <add> <add> validateMenuEventListeners(oldMenu); <add> <add> newMenu.addItem(menuItem); <add> validateMenuEventListeners(newMenu); <add> <add> const focusSpy = sinon.spy(menuButton, 'focus'); <add> const captionMenuItem = new CaptionSettingsMenuItem(player, { <add> kind: 'subtitles' <add> }); <add> <add> newMenu.addItem(captionMenuItem); <add> TestHelpers.triggerDomEvent(captionMenuItem.el(), 'click'); <add> assert.ok(!focusSpy.called, '`menuButton`.`focus` should never be called'); <add> <add> focusSpy.restore(); <add>});
2
Javascript
Javascript
fix similar typos in core.controller & element
57979a22708364d16eb58373910de374d736ecb0
<ide><path>src/core/core.controller.js <ide> <ide> //Declare root variable - window in the browser, global on the server <ide> var root = this, <del> previous = root.Chart, <add> Chart = root.Chart, <ide> helpers = Chart.helpers; <ide> <ide> <ide><path>src/core/core.element.js <ide> <ide> //Declare root variable - window in the browser, global on the server <ide> var root = this, <del> previous = root.Chart, <add> Chart = root.Chart, <ide> helpers = Chart.helpers; <ide> <ide> Chart.elements = {};
2
Javascript
Javascript
fix inverse block in compat helpers
c7f67e8806354e36497f68ec5644405c4d2b5e1f
<ide><path>packages/ember-htmlbars/lib/compat/helper.js <ide> function HandlebarsCompatibleHelper(fn) { <ide> handlebarsOptions.fn = function() { <ide> options.template.yield(); <ide> }; <add> <add> if (options.inverse) { <add> handlebarsOptions.inverse = function() { <add> options.inverse.yield(); <add> }; <add> } <ide> } <ide> <ide> for (var prop in hash) { <ide><path>packages/ember-htmlbars/tests/compat/helper_test.js <ide> QUnit.test('allows usage of the template fn', function() { <ide> equal(view.$().text(), 'foo'); <ide> }); <ide> <del>QUnit.skip('allows usage of the template inverse', function() { <add>QUnit.test('allows usage of the template inverse', function() { <ide> expect(1); <ide> <ide> function someHelper(options) {
2
Javascript
Javascript
write otf header using a string, not an array
c09ee48094b504028cf2f55976842bb3149bad1e
<ide><path>fonts.js <ide> var Font = (function () { <ide> convert: function font_convert(aFont, aProperties) { <ide> var otf = new Uint8Array(kMaxFontFileSize); <ide> <del> function createOpenTypeHeader(aFile, aOffsets, aNumTables) { <add> function s2a(s) { <add> var a = []; <add> for (var i = 0; i < s.length; ++i) <add> a[i] = s.charCodeAt(i); <add> return a; <add> } <add> <add> function createOpenTypeHeader(aFile, aOffsets, numTables) { <add> var header = ""; <add> <add> function WriteHeader16(value) { <add> header += String.fromCharCode(value >> 8); <add> header += String.fromCharCode(value & 0xff); <add> } <add> <ide> // sfnt version (4 bytes) <del> var version = [0x4F, 0x54, 0x54, 0X4F]; <add> header += "\x4F\x54\x54\x4F"; <ide> <ide> // numTables (2 bytes) <del> var numTables = aNumTables; <add> WriteHeader16(numTables); <ide> <ide> // searchRange (2 bytes) <ide> var tablesMaxPower2 = FontsUtils.getMaxPower2(numTables); <ide> var searchRange = tablesMaxPower2 * 16; <add> WriteHeader16(searchRange); <ide> <ide> // entrySelector (2 bytes) <del> var entrySelector = Math.log(tablesMaxPower2) / Math.log(2); <add> WriteHeader16(Math.log(tablesMaxPower2) / Math.log(2)); <ide> <ide> // rangeShift (2 bytes) <del> var rangeShift = numTables * 16 - searchRange; <del> <del> var header = [].concat(version, <del> FontsUtils.integerToBytes(numTables, 2), <del> FontsUtils.integerToBytes(searchRange, 2), <del> FontsUtils.integerToBytes(entrySelector, 2), <del> FontsUtils.integerToBytes(rangeShift, 2)); <del> aFile.set(header, aOffsets.currentOffset); <add> WriteHeader16(numTables * 16 - searchRange); <add> <add> aFile.set(s2a(header), aOffsets.currentOffset); <ide> aOffsets.currentOffset += header.length; <ide> aOffsets.virtualOffset += header.length; <ide> }
1
Text
Text
add new deployment info
836f37b09b0209d9c4a0af942f0e2a8641a2df7e
<ide><path>README.md <ide> If you want to see a really cool real-time dashboard check out this [live exampl <ide> Deployment <ide> ---------- <ide> <add>Once you are ready to deploy your app, you will need to create an account with a cloud platform to host it. These are not <add>the only choices, but they are my top picks. Create an account with **MongoLab** and then pick one of the 4 providers <add>below. Once again, there are plenty of other choices and you are not limited to just the ones listed below. From my <add>experience, **Heroku** is the easiest to get started with, it will automatically restart your node.js process when it crashes, custom domain support on free accounts, hot push deployments, and *Hackathon Starter* already includes `Procfile`, which is necessary for deployment to **Heroku**. <ide> <ide> <img src="http://i.imgur.com/7KnCa5a.png" width="200"> <del> <ide> - Open [mongolab.com](https://mongolab.com) website <ide> - Click the yellow **Sign up** button <ide> - Fill in your user information then hit **Create account** <ide> Deployment <ide> - Finally, in `secrets.js` instead of `db: 'localhost'`, use the following URI with your credentials: <ide> - `db: 'mongodb://<dbuser>:<dbpassword>@ds027479.mongolab.com:27479/<dbname>'` <ide> <add>**:exclamation:Note**: As an alternative to MongoLab there is also [MongoHQ[(http://www.mongohq.com/home). <ide> <ide> ### Heroku <ide>
1
Ruby
Ruby
add missing fixtures file
ffa56f73d5ae98fe0b8b6dd2ca6f0dffac9d9217
<ide><path>activerecord/test/cases/associations/has_many_through_associations_test.rb <ide> class HasManyThroughAssociationsTest < ActiveRecord::TestCase <ide> fixtures :posts, :readers, :people, :comments, :authors, :categories, :taggings, :tags, <ide> :owners, :pets, :toys, :jobs, :references, :companies, :members, :author_addresses, <del> :subscribers, :books, :subscriptions, :developers, :categorizations, :essays <add> :subscribers, :books, :subscriptions, :developers, :categorizations, :essays, <add> :categories_posts <ide> <ide> # Dummies to force column loads so query counts are clean. <ide> def setup
1
PHP
PHP
remove unused httpexception
f22647f8048961d75bd0944f12d38097fb4bc81f
<ide><path>src/Illuminate/Foundation/Testing/HttpException.php <del><?php <del> <del>namespace Illuminate\Foundation\Testing; <del> <del>use PHPUnit\Framework\ExpectationFailedException; <del> <del>class HttpException extends ExpectationFailedException <del>{ <del> // <del>}
1
Text
Text
update eventlooputilization documentation
6eb15ce8a3bebeda605b88972ae007bafb3a1133
<ide><path>doc/api/perf_hooks.md <ide> added: v8.5.0 <ide> If `name` is not provided, removes all `PerformanceMark` objects from the <ide> Performance Timeline. If `name` is provided, removes only the named mark. <ide> <del>### `performance.eventLoopUtilization([util1][,util2])` <add>### `performance.eventLoopUtilization([utilization1[, utilization2]])` <ide> <!-- YAML <ide> added: v14.10.0 <ide> --> <ide> <del>* `util1` {Object} The result of a previous call to `eventLoopUtilization()` <del>* `util2` {Object} The result of a previous call to `eventLoopUtilization()` <add>* `utilization1` {Object} The result of a previous call to `eventLoopUtilization()` <add>* `utilization2` {Object} The result of a previous call to `eventLoopUtilization()` <ide> prior to `util1` <ide> * Returns {Object} <ide> * `idle` {number} <ide> high resolution milliseconds timer. The `utilization` value is the calculated <ide> Event Loop Utilization (ELU). If bootstrapping has not yet finished, the <ide> properties have the value of 0. <ide> <del>`util1` and `util2` are optional parameters. <add>`utilization1` and `utilization2` are optional parameters. <ide> <del>If `util1` is passed then the delta between the current call's `active` and <del>`idle` times are calculated and returned (similar to [`process.hrtime()`][]). <del>Likewise the adjusted `utilization` value is calculated. <add>If `utilization1` is passed, then the delta between the current call's `active` <add>and `idle` times, as well as the corresponding `utilization` value are <add>calculated and returned (similar to [`process.hrtime()`][]). <ide> <del>If `util1` and `util2` are both passed then the calculation adjustments are <del>done between the two arguments. This is a convenience option because unlike <del>[`process.hrtime()`][] additional work is done to calculate the ELU. <add>If `utilization1` and `utilization2` are both passed, then the delta is <add>calculated between the two arguments. This is a convenience option because, <add>unlike [`process.hrtime()`][], calculating the ELU is more complex than a <add>single subtraction. <ide> <del>ELU is similar to CPU utilization except that it is calculated using high <del>precision wall-clock time. It represents the percentage of time the event loop <del>has spent outside the event loop's event provider (e.g. `epoll_wait`). No other <del>CPU idle time is taken into consideration. The following is an example of how <del>a mostly idle process will have a high ELU. <add>ELU is similar to CPU utilization, except that it only measures event loop <add>statistics and not CPU usage. It represents the percentage of time the event <add>loop has spent outside the event loop's event provider (e.g. `epoll_wait`). <add>No other CPU idle time is taken into consideration. The following is an example <add>of how a mostly idle process will have a high ELU. <ide> <del><!-- eslint-skip --> <ide> ```js <ide> 'use strict'; <ide> const { eventLoopUtilization } = require('perf_hooks').performance;
1
Text
Text
use headings to enable links
ab57dc840f7036a92487d5523cdf8ec832f486f5
<ide><path>README.md <ide> Atom will automatically update when a new release is available. <ide> ## Building <ide> <ide> <del>**OS X Requirements** <add>### OS X Requirements <ide> * OS X 10.8 or later <ide> * [node.js](http://nodejs.org/) <ide> * Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (Run `xcode-select --install`) <ide> Atom will automatically update when a new release is available. <ide> script/build # Creates application at /Applications/Atom.app <ide> ``` <ide> <del>**Linux Requirements** <add>### Linux Requirements <ide> * Ubuntu LTS 12.04 64-bit is the recommended platform <ide> * OS with 64-bit architecture <ide> * [node.js](http://nodejs.org/) v0.10.x <ide> Atom will automatically update when a new release is available. <ide> sudo script/grunt install # Installs command to /usr/local/bin/atom <ide> ``` <ide> <del>**Windows Requirements** <add>### Windows Requirements <ide> * Windows 7 or later <ide> * [Visual C++ 2010 Express](http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express) <ide> * [node.js - 32bit](http://nodejs.org/)
1
Python
Python
add more operators to example dags for cloud tasks
9042a585539a18953d688fff455438f4061732d1
<ide><path>airflow/providers/google/cloud/example_dags/example_tasks.py <ide> and deletes Queues and creates, gets, lists, runs and deletes Tasks in the Google <ide> Cloud Tasks service in the Google Cloud. <ide> """ <del> <del> <add>import os <ide> from datetime import datetime, timedelta <ide> <ide> from google.api_core.retry import Retry <ide> from google.cloud.tasks_v2.types import Queue <ide> from google.protobuf import timestamp_pb2 <ide> <ide> from airflow import models <add>from airflow.operators.bash_operator import BashOperator <ide> from airflow.providers.google.cloud.operators.tasks import ( <ide> CloudTasksQueueCreateOperator, <add> CloudTasksQueueDeleteOperator, <add> CloudTasksQueueGetOperator, <add> CloudTasksQueuePauseOperator, <add> CloudTasksQueuePurgeOperator, <add> CloudTasksQueueResumeOperator, <add> CloudTasksQueuesListOperator, <add> CloudTasksQueueUpdateOperator, <ide> CloudTasksTaskCreateOperator, <add> CloudTasksTaskDeleteOperator, <add> CloudTasksTaskGetOperator, <ide> CloudTasksTaskRunOperator, <add> CloudTasksTasksListOperator, <ide> ) <ide> from airflow.utils.dates import days_ago <add>from airflow.utils.helpers import chain <ide> <ide> timestamp = timestamp_pb2.Timestamp() <ide> timestamp.FromDatetime(datetime.now() + timedelta(hours=12)) # pylint: disable=no-member <ide> <ide> LOCATION = "europe-west1" <del>QUEUE_ID = "cloud-tasks-queue" <add>QUEUE_ID = os.environ.get('GCP_TASKS_QUEUE_ID', "cloud-tasks-queue") <ide> TASK_NAME = "task-to-run" <ide> <ide> <ide> tags=['example'], <ide> ) as dag: <ide> <add> # Queue operations <ide> create_queue = CloudTasksQueueCreateOperator( <ide> location=LOCATION, <del> task_queue=Queue(), <add> task_queue=Queue(stackdriver_logging_config=dict(sampling_ratio=0.5)), <ide> queue_name=QUEUE_ID, <ide> retry=Retry(maximum=10.0), <ide> timeout=5, <ide> task_id="create_queue", <ide> ) <ide> <del> create_task_to_run = CloudTasksTaskCreateOperator( <add> delete_queue = CloudTasksQueueDeleteOperator( <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> task_id="delete_queue", <add> ) <add> <add> resume_queue = CloudTasksQueueResumeOperator( <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> task_id="resume_queue", <add> ) <add> <add> pause_queue = CloudTasksQueuePauseOperator( <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> task_id="pause_queue", <add> ) <add> <add> purge_queue = CloudTasksQueuePurgeOperator( <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> task_id="purge_queue", <add> ) <add> <add> get_queue = CloudTasksQueueGetOperator( <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> task_id="get_queue", <add> ) <add> <add> get_queue_result = BashOperator( <add> task_id="get_queue_result", <add> bash_command="echo \"{{ task_instance.xcom_pull('get_queue') }}\"", <add> ) <add> get_queue >> get_queue_result <add> <add> update_queue = CloudTasksQueueUpdateOperator( <add> task_queue=Queue(stackdriver_logging_config=dict(sampling_ratio=1)), <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> update_mask={"paths": ["stackdriver_logging_config.sampling_ratio"]}, <add> task_id="update_queue", <add> ) <add> <add> list_queue = CloudTasksQueuesListOperator(location=LOCATION, task_id="list_queue") <add> <add> chain( <add> create_queue, <add> update_queue, <add> pause_queue, <add> resume_queue, <add> purge_queue, <add> get_queue, <add> list_queue, <add> delete_queue, <add> ) <add> <add> # Tasks operations <add> create_task = CloudTasksTaskCreateOperator( <ide> location=LOCATION, <ide> queue_name=QUEUE_ID, <ide> task=TASK, <ide> task_id="create_task_to_run", <ide> ) <ide> <add> tasks_get = CloudTasksTaskGetOperator( <add> location=LOCATION, <add> queue_name=QUEUE_ID, <add> task_name=TASK_NAME, <add> task_id="tasks_get", <add> ) <add> <ide> run_task = CloudTasksTaskRunOperator( <ide> location=LOCATION, <ide> queue_name=QUEUE_ID, <ide> task_name=TASK_NAME, <del> retry=Retry(maximum=10.0), <del> timeout=5, <ide> task_id="run_task", <ide> ) <ide> <del> create_queue >> create_task_to_run >> run_task <add> list_tasks = CloudTasksTasksListOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="list_tasks") <add> <add> delete_task = CloudTasksTaskDeleteOperator( <add> location=LOCATION, queue_name=QUEUE_ID, task_name=TASK_NAME, task_id="delete_task" <add> ) <add> <add> chain(purge_queue, create_task, tasks_get, list_tasks, run_task, delete_task, delete_queue) <ide><path>airflow/providers/google/cloud/operators/tasks.py <ide> def execute(self, context): <ide> gcp_conn_id=self.gcp_conn_id, <ide> impersonation_chain=self.impersonation_chain, <ide> ) <del> queues = hook.pause_queue( <add> queue = hook.pause_queue( <ide> location=self.location, <ide> queue_name=self.queue_name, <ide> project_id=self.project_id, <ide> retry=self.retry, <ide> timeout=self.timeout, <ide> metadata=self.metadata, <ide> ) <del> return [MessageToDict(q) for q in queues] <add> return MessageToDict(queue) <ide> <ide> <ide> class CloudTasksQueueResumeOperator(BaseOperator): <ide><path>tests/always/test_project_structure.py <ide> class TestGoogleProviderProjectStructure(unittest.TestCase): <ide> } <ide> <ide> MISSING_EXAMPLES_FOR_OPERATORS = { <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueueDeleteOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueueResumeOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueuePauseOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueuePurgeOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksTaskGetOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksTasksListOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksTaskDeleteOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueueGetOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueueUpdateOperator', <del> 'airflow.providers.google.cloud.operators.tasks.CloudTasksQueuesListOperator', <ide> # Deprecated operator. Ignore it. <ide> 'airflow.providers.google.cloud.operators.cloud_storage_transfer_service' <ide> '.CloudDataTransferServiceS3ToGCSOperator', <ide><path>tests/providers/google/cloud/operators/test_tasks.py <ide> FULL_QUEUE_PATH = "projects/test-project/locations/asia-east2/queues/test-queue" <ide> TASK_NAME = "test-task" <ide> FULL_TASK_PATH = "projects/test-project/locations/asia-east2/queues/test-queue/tasks/test-task" <add>TEST_QUEUE = Queue(name=FULL_QUEUE_PATH) <add>TEST_TASK = Task(app_engine_http_request={}) <ide> <ide> <ide> class TestCloudTasksQueueCreate(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_create_queue(self, mock_hook): <del> mock_hook.return_value.create_queue.return_value = mock.MagicMock() <del> operator = CloudTasksQueueCreateOperator(location=LOCATION, task_queue=Queue(), task_id="id") <del> operator.execute(context=None) <add> mock_hook.return_value.create_queue.return_value = TEST_QUEUE <add> operator = CloudTasksQueueCreateOperator(location=LOCATION, task_queue=TEST_QUEUE, task_id="id") <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'name': FULL_QUEUE_PATH}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> ) <ide> mock_hook.return_value.create_queue.assert_called_once_with( <ide> location=LOCATION, <del> task_queue=Queue(), <add> task_queue=TEST_QUEUE, <ide> project_id=None, <ide> queue_name=None, <ide> retry=None, <ide> def test_create_queue(self, mock_hook): <ide> class TestCloudTasksQueueUpdate(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_update_queue(self, mock_hook): <del> mock_hook.return_value.update_queue.return_value = mock.MagicMock() <add> mock_hook.return_value.update_queue.return_value = TEST_QUEUE <ide> operator = CloudTasksQueueUpdateOperator(task_queue=Queue(name=FULL_QUEUE_PATH), task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'name': FULL_QUEUE_PATH}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_update_queue(self, mock_hook): <ide> class TestCloudTasksQueueGet(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_get_queue(self, mock_hook): <del> mock_hook.return_value.get_queue.return_value = mock.MagicMock() <add> mock_hook.return_value.get_queue.return_value = TEST_QUEUE <ide> operator = CloudTasksQueueGetOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'name': FULL_QUEUE_PATH}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_get_queue(self, mock_hook): <ide> class TestCloudTasksQueuesList(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_list_queues(self, mock_hook): <del> mock_hook.return_value.list_queues.return_value = mock.MagicMock() <add> mock_hook.return_value.list_queues.return_value = [TEST_QUEUE] <ide> operator = CloudTasksQueuesListOperator(location=LOCATION, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual([{'name': FULL_QUEUE_PATH}], result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_list_queues(self, mock_hook): <ide> class TestCloudTasksQueueDelete(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_delete_queue(self, mock_hook): <del> mock_hook.return_value.delete_queue.return_value = mock.MagicMock() <add> mock_hook.return_value.delete_queue.return_value = None <ide> operator = CloudTasksQueueDeleteOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual(None, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_delete_queue(self, mock_hook): <ide> class TestCloudTasksQueuePurge(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_delete_queue(self, mock_hook): <del> mock_hook.return_value.purge_queue.return_value = mock.MagicMock() <add> mock_hook.return_value.purge_queue.return_value = TEST_QUEUE <ide> operator = CloudTasksQueuePurgeOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'name': FULL_QUEUE_PATH}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_delete_queue(self, mock_hook): <ide> class TestCloudTasksQueuePause(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_pause_queue(self, mock_hook): <del> mock_hook.return_value.pause_queue.return_value = mock.MagicMock() <add> mock_hook.return_value.pause_queue.return_value = TEST_QUEUE <ide> operator = CloudTasksQueuePauseOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'name': FULL_QUEUE_PATH}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_pause_queue(self, mock_hook): <ide> class TestCloudTasksQueueResume(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_resume_queue(self, mock_hook): <del> mock_hook.return_value.resume_queue.return_value = mock.MagicMock() <add> mock_hook.return_value.resume_queue.return_value = TEST_QUEUE <ide> operator = CloudTasksQueueResumeOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'name': FULL_QUEUE_PATH}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_resume_queue(self, mock_hook): <ide> class TestCloudTasksTaskCreate(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_create_task(self, mock_hook): <del> mock_hook.return_value.create_task.return_value = mock.MagicMock() <add> mock_hook.return_value.create_task.return_value = TEST_TASK <ide> operator = CloudTasksTaskCreateOperator( <ide> location=LOCATION, queue_name=QUEUE_ID, task=Task(), task_id="id" <ide> ) <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'appEngineHttpRequest': {}}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_create_task(self, mock_hook): <ide> class TestCloudTasksTaskGet(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_get_task(self, mock_hook): <del> mock_hook.return_value.get_task.return_value = mock.MagicMock() <add> mock_hook.return_value.get_task.return_value = TEST_TASK <ide> operator = CloudTasksTaskGetOperator( <ide> location=LOCATION, queue_name=QUEUE_ID, task_name=TASK_NAME, task_id="id" <ide> ) <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'appEngineHttpRequest': {}}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_get_task(self, mock_hook): <ide> class TestCloudTasksTasksList(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_list_tasks(self, mock_hook): <del> mock_hook.return_value.list_tasks.return_value = mock.MagicMock() <add> mock_hook.return_value.list_tasks.return_value = [TEST_TASK] <ide> operator = CloudTasksTasksListOperator(location=LOCATION, queue_name=QUEUE_ID, task_id="id") <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual([{'appEngineHttpRequest': {}}], result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_list_tasks(self, mock_hook): <ide> class TestCloudTasksTaskDelete(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_delete_task(self, mock_hook): <del> mock_hook.return_value.delete_task.return_value = mock.MagicMock() <add> mock_hook.return_value.delete_task.return_value = None <ide> operator = CloudTasksTaskDeleteOperator( <ide> location=LOCATION, queue_name=QUEUE_ID, task_name=TASK_NAME, task_id="id" <ide> ) <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual(None, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None, <ide> def test_delete_task(self, mock_hook): <ide> class TestCloudTasksTaskRun(unittest.TestCase): <ide> @mock.patch("airflow.providers.google.cloud.operators.tasks.CloudTasksHook") <ide> def test_run_task(self, mock_hook): <del> mock_hook.return_value.run_task.return_value = mock.MagicMock() <add> mock_hook.return_value.run_task.return_value = TEST_TASK <ide> operator = CloudTasksTaskRunOperator( <ide> location=LOCATION, queue_name=QUEUE_ID, task_name=TASK_NAME, task_id="id" <ide> ) <del> operator.execute(context=None) <add> <add> result = operator.execute(context=None) <add> <add> self.assertEqual({'appEngineHttpRequest': {}}, result) <ide> mock_hook.assert_called_once_with( <ide> gcp_conn_id=GCP_CONN_ID, <ide> impersonation_chain=None,
4
Text
Text
add troubleshoot document libudev in ubuntu 14.04
47a2e576333d88af80e3c0b88295728621ef920d
<ide><path>docs/build-instructions/linux.md <ide> Ubuntu LTS 12.04 64-bit is the recommended platform. <ide> ``` <ide> <ide> ## Troubleshooting <add> <add> * On Ubuntu 14.04 LTS when you get error message <add> <add> <add> ```sh <add> /usr/local/share/atom/atom: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory <add> ``` <add>You can solve this by make a symlink <add> <add>x64 `sudo ln -sf /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0` <add> <add>x86 `sudo ln -sf /lib/i386-linux-gnu/libudev.so.1 /lib/i386-linux-gnu/libudev.so.0`
1
Go
Go
move docker info to the job api
51e2c1794b50295607c6eddb29edf39d40816a88
<ide><path>api.go <ide> func getImagesViz(srv *Server, version float64, w http.ResponseWriter, r *http.R <ide> } <ide> <ide> func getInfo(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error { <del> return writeJSON(w, http.StatusOK, srv.DockerInfo()) <add> srv.Eng.ServeHTTP(w, r) <add> return nil <ide> } <ide> <ide> func getEvents(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error { <ide><path>api_params.go <ide> type ( <ide> VirtualSize int64 <ide> } <ide> <del> APIInfo struct { <del> Debug bool <del> Containers int <del> Images int <del> Driver string `json:",omitempty"` <del> DriverStatus [][2]string `json:",omitempty"` <del> NFd int `json:",omitempty"` <del> NGoroutines int `json:",omitempty"` <del> MemoryLimit bool `json:",omitempty"` <del> SwapLimit bool `json:",omitempty"` <del> IPv4Forwarding bool `json:",omitempty"` <del> LXCVersion string `json:",omitempty"` <del> NEventsListener int `json:",omitempty"` <del> KernelVersion string `json:",omitempty"` <del> IndexServerAddress string `json:",omitempty"` <del> } <del> <ide> APITop struct { <ide> Titles []string <ide> Processes [][]string <ide><path>commands.go <ide> func (cli *DockerCli) CmdInfo(args ...string) error { <ide> return err <ide> } <ide> <del> var out APIInfo <del> if err := json.Unmarshal(body, &out); err != nil { <add> out := engine.NewOutput() <add> remoteInfo, err := out.AddEnv() <add> if err != nil { <ide> return err <ide> } <ide> <del> fmt.Fprintf(cli.out, "Containers: %d\n", out.Containers) <del> fmt.Fprintf(cli.out, "Images: %d\n", out.Images) <del> fmt.Fprintf(cli.out, "Driver: %s\n", out.Driver) <del> for _, pair := range out.DriverStatus { <del> fmt.Fprintf(cli.out, " %s: %s\n", pair[0], pair[1]) <add> if _, err := out.Write(body); err != nil { <add> utils.Errorf("Error reading remote info: %s\n", err) <add> return err <add> } <add> out.Close() <add> <add> fmt.Fprintf(cli.out, "Containers: %d\n", remoteInfo.GetInt("Containers")) <add> fmt.Fprintf(cli.out, "Images: %d\n", remoteInfo.GetInt("Images")) <add> fmt.Fprintf(cli.out, "Driver: %s\n", remoteInfo.Get("Driver")) <add> <add> //FIXME:Cleanup this mess <add> DriverStatus := remoteInfo.GetJson("DriverStatus") <add> if DriverStatus != nil { <add> if tab, ok := DriverStatus.([]interface{}); ok { <add> for _, line := range tab { <add> if pair, ok := line.([]interface{}); ok { <add> fmt.Fprintf(cli.out, " %s: %s\n", pair[0], pair[1]) <add> } <add> } <add> } <ide> } <del> if out.Debug || os.Getenv("DEBUG") != "" { <del> fmt.Fprintf(cli.out, "Debug mode (server): %v\n", out.Debug) <add> if remoteInfo.GetBool("Debug") || os.Getenv("DEBUG") != "" { <add> fmt.Fprintf(cli.out, "Debug mode (server): %v\n", remoteInfo.GetBool("Debug")) <ide> fmt.Fprintf(cli.out, "Debug mode (client): %v\n", os.Getenv("DEBUG") != "") <del> fmt.Fprintf(cli.out, "Fds: %d\n", out.NFd) <del> fmt.Fprintf(cli.out, "Goroutines: %d\n", out.NGoroutines) <del> fmt.Fprintf(cli.out, "LXC Version: %s\n", out.LXCVersion) <del> fmt.Fprintf(cli.out, "EventsListeners: %d\n", out.NEventsListener) <del> fmt.Fprintf(cli.out, "Kernel Version: %s\n", out.KernelVersion) <add> fmt.Fprintf(cli.out, "Fds: %d\n", remoteInfo.GetInt("NFd")) <add> fmt.Fprintf(cli.out, "Goroutines: %d\n", remoteInfo.GetInt("NGoroutines")) <add> fmt.Fprintf(cli.out, "LXC Version: %s\n", remoteInfo.Get("LXCVersion")) <add> fmt.Fprintf(cli.out, "EventsListeners: %d\n", remoteInfo.GetInt("NEventsListener")) <add> fmt.Fprintf(cli.out, "Kernel Version: %s\n", remoteInfo.Get("KernelVersion")) <ide> } <ide> <del> if len(out.IndexServerAddress) != 0 { <add> if len(remoteInfo.GetList("IndexServerAddress")) != 0 { <ide> cli.LoadConfigFile() <del> u := cli.configFile.Configs[out.IndexServerAddress].Username <add> u := cli.configFile.Configs[remoteInfo.Get("IndexServerAddress")].Username <ide> if len(u) > 0 { <ide> fmt.Fprintf(cli.out, "Username: %v\n", u) <del> fmt.Fprintf(cli.out, "Registry: %v\n", out.IndexServerAddress) <add> fmt.Fprintf(cli.out, "Registry: %v\n", remoteInfo.GetList("IndexServerAddress")) <ide> } <ide> } <del> if !out.MemoryLimit { <add> if !remoteInfo.GetBool("MemoryLimit") { <ide> fmt.Fprintf(cli.err, "WARNING: No memory limit support\n") <ide> } <del> if !out.SwapLimit { <add> if !remoteInfo.GetBool("SwapLimit") { <ide> fmt.Fprintf(cli.err, "WARNING: No swap limit support\n") <ide> } <del> if !out.IPv4Forwarding { <add> if !remoteInfo.GetBool("IPv4Forwarding") { <ide> fmt.Fprintf(cli.err, "WARNING: IPv4 forwarding is disabled.\n") <ide> } <ide> return nil <ide><path>integration/api_test.go <ide> func TestGetInfo(t *testing.T) { <ide> } <ide> assertHttpNotError(r, t) <ide> <del> infos := &docker.APIInfo{} <del> err = json.Unmarshal(r.Body.Bytes(), infos) <add> out := engine.NewOutput() <add> i, err := out.AddEnv() <ide> if err != nil { <ide> t.Fatal(err) <ide> } <del> if infos.Images != len(initialImages) { <del> t.Errorf("Expected images: %d, %d found", len(initialImages), infos.Images) <add> if _, err := io.Copy(out, r.Body); err != nil { <add> t.Fatal(err) <add> } <add> out.Close() <add> if images := i.GetInt("Images"); images != int64(len(initialImages)) { <add> t.Errorf("Expected images: %d, %d found", len(initialImages), images) <ide> } <ide> } <ide> <ide><path>server.go <ide> func jobInitApi(job *engine.Job) engine.Status { <ide> job.Error(err) <ide> return engine.StatusErr <ide> } <add> if err := job.Eng.Register("info", srv.DockerInfo); err != nil { <add> job.Error(err) <add> return engine.StatusErr <add> } <ide> return engine.StatusOK <ide> } <ide> <ide> func (srv *Server) Images(all bool, filter string) ([]APIImages, error) { <ide> return outs, nil <ide> } <ide> <del>func (srv *Server) DockerInfo() *APIInfo { <add>func (srv *Server) DockerInfo(job *engine.Job) engine.Status { <ide> images, _ := srv.runtime.graph.Map() <del> var imgcount int <add> var imgcount int64 <ide> if images == nil { <ide> imgcount = 0 <ide> } else { <del> imgcount = len(images) <add> imgcount = int64(len(images)) <ide> } <ide> lxcVersion := "" <ide> if output, err := exec.Command("lxc-version").CombinedOutput(); err == nil { <ide> func (srv *Server) DockerInfo() *APIInfo { <ide> kernelVersion = kv.String() <ide> } <ide> <del> return &APIInfo{ <del> Containers: len(srv.runtime.List()), <del> Images: imgcount, <del> Driver: srv.runtime.driver.String(), <del> DriverStatus: srv.runtime.driver.Status(), <del> MemoryLimit: srv.runtime.capabilities.MemoryLimit, <del> SwapLimit: srv.runtime.capabilities.SwapLimit, <del> IPv4Forwarding: !srv.runtime.capabilities.IPv4ForwardingDisabled, <del> Debug: os.Getenv("DEBUG") != "", <del> NFd: utils.GetTotalUsedFds(), <del> NGoroutines: runtime.NumGoroutine(), <del> LXCVersion: lxcVersion, <del> NEventsListener: len(srv.events), <del> KernelVersion: kernelVersion, <del> IndexServerAddress: auth.IndexServerAddress(), <add> v := &engine.Env{} <add> v.SetInt("Containers", int64(len(srv.runtime.List()))) <add> v.SetInt("Images", imgcount) <add> v.Set("Driver", srv.runtime.driver.String()) <add> v.SetJson("DriverStatus", srv.runtime.driver.Status()) <add> v.SetBool("MemoryLimit", srv.runtime.capabilities.MemoryLimit) <add> v.SetBool("SwapLimit", srv.runtime.capabilities.SwapLimit) <add> v.SetBool("IPv4Forwarding", !srv.runtime.capabilities.IPv4ForwardingDisabled) <add> v.SetBool("Debug", os.Getenv("DEBUG") != "") <add> v.SetInt("NFd", int64(utils.GetTotalUsedFds())) <add> v.SetInt("NGoroutines", int64(runtime.NumGoroutine())) <add> v.Set("LXCVersion", lxcVersion) <add> v.SetInt("NEventsListener", int64(len(srv.events))) <add> v.Set("KernelVersion", kernelVersion) <add> v.Set("IndexServerAddress", auth.IndexServerAddress()) <add> if _, err := v.WriteTo(job.Stdout); err != nil { <add> job.Error(err) <add> return engine.StatusErr <ide> } <add> return engine.StatusOK <ide> } <ide> <ide> func (srv *Server) ImageHistory(name string) ([]APIHistory, error) {
5
Javascript
Javascript
remove double ending line
10cad8712e1ba4942fd88b20e0dc5a838425684a
<ide><path>blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js <ide> module('<%= friendlyTestDescription %>', function(hooks) { <ide> assert.ok(service); <ide> }); <ide> }); <del> <ide><path>node-tests/fixtures/service-test/rfc232.js <ide> module('Unit | Service | foo', function(hooks) { <ide> assert.ok(service); <ide> }); <ide> }); <del>
2
PHP
PHP
move the authorize middleware into foundation
65907a6be614554b7b55d53aab24bbdf3a7e2b1e
<add><path>src/Illuminate/Foundation/Auth/Access/Middleware/Authorize.php <del><path>src/Illuminate/Auth/Access/Middleware/Authorize.php <ide> <?php <ide> <del>namespace Illuminate\Auth\Access\Middleware; <add>namespace Illuminate\Foundation\Auth\Access\Middleware; <ide> <ide> use Closure; <ide> use Illuminate\Contracts\Auth\Access\Gate; <add><path>tests/Foundation/FoundationAuthorizeMiddlewareTest.php <del><path>tests/Auth/AuthorizeTest.php <ide> use Illuminate\Auth\Access\Gate; <ide> use Illuminate\Events\Dispatcher; <ide> use Illuminate\Container\Container; <del>use Illuminate\Auth\Access\Middleware\Authorize; <ide> use Illuminate\Auth\Access\AuthorizationException; <ide> use Illuminate\Contracts\Auth\Access\Gate as GateContract; <add>use Illuminate\Foundation\Auth\Access\Middleware\Authorize; <ide> <del>class AuthorizeTest extends PHPUnit_Framework_TestCase <add>class FoundationAuthorizeMiddlewareTest extends PHPUnit_Framework_TestCase <ide> { <ide> protected $container; <ide> protected $user;
2
Text
Text
synch security.md with website
5c347887d909a82326c46d2e00e41756405128da
<ide><path>SECURITY.md <ide> handling your submission. <ide> After the initial reply to your report, the security team will endeavor to keep <ide> you informed of the progress being made towards a fix and full announcement, <ide> and may ask for additional information or guidance surrounding the reported <del>issue. These updates will be sent at least every five days; in practice, this <del>is more likely to be every 24-48 hours. <add>issue. <ide> <ide> ### Node.js Bug Bounty Program <ide>
1
Javascript
Javascript
add test to show econnrefused works
1dbbaa7fa09e3bff48c5d7d9f6baf47fee49cc7b
<ide><path>test/simple/test-net-connect-handle-econnrefused.js <add>var common = require('../common'); <add>var net = require('net'); <add>var assert = require('assert'); <add> <add> <add>// Hopefully nothing is running on common.PORT <add>var c = net.createConnection(common.PORT); <add> <add>c.on('connect', function () { <add> console.error("connected?!"); <add> assert.ok(false); <add>}) <add> <add>var gotError = false; <add>c.on('error', function (e) { <add> console.error("couldn't connect."); <add> gotError = true; <add> assert.equal(require('constants').ECONNREFUSED, e.errno); <add>}); <add> <add> <add>process.on('exit', function () { <add> assert.ok(gotError); <add>});
1
Mixed
Go
fix readme flag and expose orphan network peers
9b7922ff6e97cfc7b5fcac69a3d1fc00910f564b
<ide><path>libnetwork/cmd/diagnostic/README.md <ide> Remember to use the full network ID, you can easily find that with `docker netwo <ide> **Service discovery and load balancer:** <ide> <ide> ```bash <del>$ diagnostiClient -c sd -v -net n8a8ie6tb3wr2e260vxj8ncy4 -a <add>$ diagnostiClient -t sd -v -net n8a8ie6tb3wr2e260vxj8ncy4 -a <ide> ``` <ide> <ide> **Overlay network:** <ide> <ide> ```bash <del>$ diagnostiClient -port 2001 -c overlay -v -net n8a8ie6tb3wr2e260vxj8ncy4 -a <add>$ diagnostiClient -port 2001 -t overlay -v -net n8a8ie6tb3wr2e260vxj8ncy4 -a <ide> ``` <ide><path>libnetwork/networkdb/networkdb.go <ide> func (nDB *NetworkDB) Peers(nid string) []PeerInfo { <ide> } else { <ide> // Added for testing purposes, this condition should never happen else mean that the network list <ide> // is out of sync with the node list <del> peers = append(peers, PeerInfo{}) <add> peers = append(peers, PeerInfo{Name: nodeName, IP: "unknown"}) <ide> } <ide> } <ide> return peers <ide><path>libnetwork/networkdb/networkdbdiagnostic.go <ide> func dbPeers(ctx interface{}, w http.ResponseWriter, r *http.Request) { <ide> peers := nDB.Peers(r.Form["nid"][0]) <ide> rsp := &diagnostic.TableObj{Length: len(peers)} <ide> for i, peerInfo := range peers { <del> rsp.Elements = append(rsp.Elements, &diagnostic.PeerEntryObj{Index: i, Name: peerInfo.Name, IP: peerInfo.IP}) <add> if peerInfo.IP == "unknown" { <add> rsp.Elements = append(rsp.Elements, &diagnostic.PeerEntryObj{Index: i, Name: "orphan-" + peerInfo.Name, IP: peerInfo.IP}) <add> } else { <add> rsp.Elements = append(rsp.Elements, &diagnostic.PeerEntryObj{Index: i, Name: peerInfo.Name, IP: peerInfo.IP}) <add> } <ide> } <ide> log.WithField("response", fmt.Sprintf("%+v", rsp)).Info("network peers done") <ide> diagnostic.HTTPReply(w, diagnostic.CommandSucceed(rsp), json)
3
Javascript
Javascript
expose documentinfo in viewer
102469d20cd4a62f3f2a4b69cecccc657e2e6836
<ide><path>web/viewer.js <ide> var PDFView = { <ide> <ide> this.metadata = null; <ide> var metadata = pdf.catalog.metadata; <del> var info = pdf.info; <add> var info = this.documentInfo = pdf.info; <ide> var pdfTitle; <ide> <ide> if (metadata) {
1
Ruby
Ruby
relation#merge special case of from clause
d76e3e12800414551ec42e17832227b820402007
<ide><path>activerecord/lib/active_record/relation/merger.rb <ide> def merge_single_values <ide> end <ide> <ide> def merge_clauses <del> if relation.from_clause.empty? && !other.from_clause.empty? <del> relation.from_clause = other.from_clause <del> end <add> relation.from_clause = other.from_clause if replace_from_clause? <ide> <ide> where_clause = relation.where_clause.merge(other.where_clause) <ide> relation.where_clause = where_clause unless where_clause.empty? <ide> <ide> having_clause = relation.having_clause.merge(other.having_clause) <ide> relation.having_clause = having_clause unless having_clause.empty? <ide> end <add> <add> def replace_from_clause? <add> relation.from_clause.empty? && !other.from_clause.empty? && <add> relation.klass.base_class == other.klass.base_class <add> end <ide> end <ide> end <ide> end <ide><path>activerecord/test/cases/relation/merging_test.rb <ide> def test_merging_with_from_clause <ide> assert_not_empty relation.from_clause <ide> end <ide> <add> def test_merging_with_from_clause_on_different_class <add> assert Comment.joins(:post).merge(Post.from("posts")).first <add> end <add> <ide> def test_merging_with_order_with_binds <ide> relation = Post.all.merge(Post.order([Arel.sql("title LIKE ?"), "%suffix"])) <ide> assert_equal ["title LIKE '%suffix'"], relation.order_values
2
Javascript
Javascript
add suspenselist to react-is
90bde6505e43434596ff6398c2c8acb67ced815b
<ide><path>packages/react-is/index.experimental.js <add>/** <add> * Copyright (c) Facebook, Inc. and its affiliates. <add> * <add> * This source code is licensed under the MIT license found in the <add> * LICENSE file in the root directory of this source tree. <add> * <add> * @flow <add> */ <add> <add>'use strict'; <add> <add>export { <add> isValidElementType, <add> typeOf, <add> ContextConsumer, <add> ContextProvider, <add> Element, <add> ForwardRef, <add> Fragment, <add> Lazy, <add> Memo, <add> Portal, <add> Profiler, <add> StrictMode, <add> Suspense, <add> unstable_SuspenseList, <add> isAsyncMode, <add> isConcurrentMode, <add> isContextConsumer, <add> isContextProvider, <add> isElement, <add> isForwardRef, <add> isFragment, <add> isLazy, <add> isMemo, <add> isPortal, <add> isProfiler, <add> isStrictMode, <add> isSuspense, <add> unstable_isSuspenseList, <add>} from './src/ReactIs'; <ide><path>packages/react-is/index.stable.js <add>/** <add> * Copyright (c) Facebook, Inc. and its affiliates. <add> * <add> * This source code is licensed under the MIT license found in the <add> * LICENSE file in the root directory of this source tree. <add> * <add> * @flow <add> */ <add> <add>'use strict'; <add> <add>export { <add> isValidElementType, <add> typeOf, <add> ContextConsumer, <add> ContextProvider, <add> Element, <add> ForwardRef, <add> Fragment, <add> Lazy, <add> Memo, <add> Portal, <add> Profiler, <add> StrictMode, <add> Suspense, <add> isAsyncMode, <add> isConcurrentMode, <add> isContextConsumer, <add> isContextProvider, <add> isElement, <add> isForwardRef, <add> isFragment, <add> isLazy, <add> isMemo, <add> isPortal, <add> isProfiler, <add> isStrictMode, <add> isSuspense, <add>} from './src/ReactIs'; <ide><path>packages/react-is/src/ReactIs.js <ide> export const Portal = REACT_PORTAL_TYPE; <ide> export const Profiler = REACT_PROFILER_TYPE; <ide> export const StrictMode = REACT_STRICT_MODE_TYPE; <ide> export const Suspense = REACT_SUSPENSE_TYPE; <add>export const unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; <ide> <ide> export {isValidElementType}; <ide> <ide> export function isStrictMode(object: any) { <ide> export function isSuspense(object: any) { <ide> return typeOf(object) === REACT_SUSPENSE_TYPE; <ide> } <add>export function unstable_isSuspenseList(object: any) { <add> return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; <add>} <ide><path>packages/react-is/src/__tests__/ReactIs-test.js <ide> describe('ReactIs', () => { <ide> expect(ReactIs.isSuspense(<div />)).toBe(false); <ide> }); <ide> <add> // @gate experimental <add> it('should identify suspense list', () => { <add> expect(ReactIs.isValidElementType(React.unstable_SuspenseList)).toBe(true); <add> expect(ReactIs.typeOf(<React.unstable_SuspenseList />)).toBe( <add> ReactIs.unstable_SuspenseList, <add> ); <add> expect( <add> ReactIs.unstable_isSuspenseList(<React.unstable_SuspenseList />), <add> ).toBe(true); <add> expect( <add> ReactIs.unstable_isSuspenseList({type: ReactIs.unstable_SuspenseList}), <add> ).toBe(false); <add> expect(ReactIs.unstable_isSuspenseList('React.unstable_SuspenseList')).toBe( <add> false, <add> ); <add> expect(ReactIs.unstable_isSuspenseList(<div />)).toBe(false); <add> }); <add> <ide> it('should identify profile root', () => { <ide> expect(ReactIs.isValidElementType(React.Profiler)).toBe(true); <ide> expect(
4
PHP
PHP
fix failing test for postgres
467b0f1c45d04eeaeee55e04c24aa00fbb49e0be
<ide><path>lib/Cake/Test/Case/Controller/Component/PaginatorComponentTest.php <ide> public function _findTotals($state, $query, $results = array()) { <ide> $query['fields'] = array('author_id'); <ide> $this->virtualFields['total_posts'] = "COUNT({$this->alias}.id)"; <ide> $query['fields'][] = 'total_posts'; <del> $query['group'] = array($this->alias . '.author_id'); <add> $query['group'] = array('author_id'); <add> $query['order'] = array('author_id' => 'ASC'); <ide> return $query; <ide> } <ide> $this->virtualFields = array(); <ide> public function _findTotalsOperation($state, $query, $results = array()) { <ide> $query['fields'] = array('author_id', 'Author.user'); <ide> $this->virtualFields['total_posts'] = "COUNT({$this->alias}.id)"; <ide> $query['fields'][] = 'total_posts'; <del> $query['group'] = array('Author.user'); <add> $query['group'] = array('author_id'); <add> $query['order'] = array('author_id' => 'ASC'); <ide> return $query; <ide> } <ide> $this->virtualFields = array(); <ide> public function testPaginateCustomFindGroupBy() { <ide> } <ide> <ide> /** <del> * test paginate() and custom find with returning otehr query on count operation, <add> * test paginate() and custom find with returning other query on count operation, <ide> * to make sure the correct count is returned. <ide> * <ide> * @return void <ide> public function testPaginateCustomFindCount() { <ide> $expected = array( <ide> array( <ide> 'PaginatorCustomPost' => array( <del> 'author_id' => '3', <del> 'total_posts' => '1' <add> 'author_id' => '1', <add> 'total_posts' => '2' <ide> ), <ide> 'Author' => array( <del> 'user' => 'larry', <add> 'user' => 'mariano', <ide> ) <ide> ), <ide> array( <ide> 'PaginatorCustomPost' => array( <del> 'author_id' => '1', <del> 'total_posts' => '2' <add> 'author_id' => '2', <add> 'total_posts' => '1' <ide> ), <ide> 'Author' => array( <del> 'user' => 'mariano' <add> 'user' => 'nate' <ide> ) <ide> ) <ide> );
1
PHP
PHP
use collection class to simplify entity handling
1ce283a9a41fc69992a91221696be9e226d1ebe0
<ide><path>src/View/Form/EntityContext.php <ide> */ <ide> namespace Cake\View\Form; <ide> <add>use Cake\Collection\Collection; <ide> use Cake\Network\Request; <ide> use Cake\ORM\Entity; <ide> use Cake\ORM\TableRegistry; <ide> use Cake\Utility\Inflector; <ide> use Cake\Validation\Validator; <del>use IteratorAggregate; <del>use IteratorIterator; <ide> use Traversable; <ide> <ide> /** <ide> protected function _prepare() { <ide> $table = $this->_context['table']; <ide> if (empty($table)) { <ide> $entity = $this->_context['entity']; <del> if ($entity instanceof IteratorAggregate) { <del> $entity = $entity->getIterator()->current(); <del> } elseif ($entity instanceof IteratorIterator) { <del> $entity = $entity->getInnerIterator()->current(); <del> } elseif ($entity instanceof Traversable) { <del> $entity = $entity->current(); <del> } elseif (is_array($entity)) { <del> $entity = current($entity); <add> if (is_array($entity) || $entity instanceof Traversable) { <add> $entity = (new Collection($entity))->first(); <ide> } <ide> if ($entity instanceof Entity) { <ide> list($ns, $entityClass) = namespaceSplit(get_class($entity)); <ide><path>tests/TestCase/View/Form/EntityContextTest.php <ide> public function testOperationsNoEntity() { <ide> $this->assertEquals([], $context->error('title')); <ide> $this->assertEquals( <ide> ['length' => null, 'precision' => null], <del> $context->attributes('title')); <add> $context->attributes('title') <add> ); <ide> } <ide> <ide> /**
2
Python
Python
make presto and trino compatible with airflow 2.1
5164cdbe98ad63754d969b4b300a7a0167565e33
<ide><path>airflow/providers/presto/hooks/presto.py <ide> def generate_presto_client_info() -> str: <ide> ) <ide> for format_map in AIRFLOW_VAR_NAME_FORMAT_MAPPING.values() <ide> } <add> # try_number isn't available in context for airflow < 2.2.5 <add> # https://github.com/apache/airflow/issues/23059 <add> try_number = context_var.get('try_number', '') <ide> task_info = { <ide> 'dag_id': context_var['dag_id'], <ide> 'task_id': context_var['task_id'], <ide> 'execution_date': context_var['execution_date'], <del> 'try_number': context_var['try_number'], <add> 'try_number': try_number, <ide> 'dag_run_id': context_var['dag_run_id'], <ide> 'dag_owner': context_var['dag_owner'], <ide> } <ide><path>airflow/providers/trino/hooks/trino.py <ide> def generate_trino_client_info() -> str: <ide> ) <ide> for format_map in AIRFLOW_VAR_NAME_FORMAT_MAPPING.values() <ide> } <add> # try_number isn't available in context for airflow < 2.2.5 <add> # https://github.com/apache/airflow/issues/23059 <add> try_number = context_var.get('try_number', '') <ide> task_info = { <ide> 'dag_id': context_var['dag_id'], <ide> 'task_id': context_var['task_id'], <ide> 'execution_date': context_var['execution_date'], <del> 'try_number': context_var['try_number'], <add> 'try_number': try_number, <ide> 'dag_run_id': context_var['dag_run_id'], <ide> 'dag_owner': context_var['dag_owner'], <ide> }
2
PHP
PHP
add "redirector" property on "formrequest"
059656e04a4ab0ea1fd1fe6afb2dba1cc6cfd7b4
<ide><path>src/Illuminate/Foundation/Http/FormRequest.php <ide> class FormRequest extends Request implements ValidatesWhenResolved { <ide> */ <ide> protected $container; <ide> <add> /** <add> * The redirector instance. <add> * <add> * @var Redirector <add> */ <add> protected $redirector; <add> <ide> /** <ide> * The route instance the request is dispatched to. <ide> * <ide> protected function failedValidation(Validator $validator) <ide> } <ide> <ide> /** <del> * Deteremine if the request passes the authorization check. <add> * Determine if the request passes the authorization check. <ide> * <ide> * @return bool <ide> */
1
Java
Java
restore short-circuiting in equals implementation
b5529f3f2bcf69c89a0a6a52c4f6b0034dc7f61e
<ide><path>spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java <ide> public boolean equals(@Nullable Object other) { <ide> } <ide> AbstractBeanDefinition that = (AbstractBeanDefinition) other; <ide> boolean rtn = ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName()); <del> rtn &= ObjectUtils.nullSafeEquals(this.scope, that.scope); <del> rtn &= this.abstractFlag == that.abstractFlag; <del> rtn &= this.lazyInit == that.lazyInit; <del> rtn &= this.autowireMode == that.autowireMode; <del> rtn &= this.dependencyCheck == that.dependencyCheck; <del> rtn &= Arrays.equals(this.dependsOn, that.dependsOn); <del> rtn &= this.autowireCandidate == that.autowireCandidate; <del> rtn &= ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers); <del> rtn &= this.primary == that.primary; <del> rtn &= this.nonPublicAccessAllowed == that.nonPublicAccessAllowed; <del> rtn &= this.lenientConstructorResolution == that.lenientConstructorResolution; <del> rtn &= ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues); <del> rtn &= ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues); <del> rtn &= ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides); <del> rtn &= ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName); <del> rtn &= ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName); <del> rtn &= ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName); <del> rtn &= this.enforceInitMethod == that.enforceInitMethod; <del> rtn &= ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName); <del> rtn &= this.enforceDestroyMethod == that.enforceDestroyMethod; <del> rtn &= this.synthetic == that.synthetic; <del> rtn &= this.role == that.role; <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.scope, that.scope); <add> rtn = rtn && this.abstractFlag == that.abstractFlag; <add> rtn = rtn && this.lazyInit == that.lazyInit; <add> rtn = rtn && this.autowireMode == that.autowireMode; <add> rtn = rtn && this.dependencyCheck == that.dependencyCheck; <add> rtn = rtn && Arrays.equals(this.dependsOn, that.dependsOn); <add> rtn = rtn && this.autowireCandidate == that.autowireCandidate; <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers); <add> rtn = rtn && this.primary == that.primary; <add> rtn = rtn && this.nonPublicAccessAllowed == that.nonPublicAccessAllowed; <add> rtn = rtn && this.lenientConstructorResolution == that.lenientConstructorResolution; <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues); <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues); <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides); <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName); <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName); <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName); <add> rtn = rtn && this.enforceInitMethod == that.enforceInitMethod; <add> rtn = rtn && ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName); <add> rtn = rtn && this.enforceDestroyMethod == that.enforceDestroyMethod; <add> rtn = rtn && this.synthetic == that.synthetic; <add> rtn = rtn && this.role == that.role; <ide> return rtn && super.equals(other); <ide> } <ide>
1
Java
Java
add single.mergearray & mergearraydelayerror
78c70d6a5365cb8db532d23397d5a0b4c114b72a
<ide><path>src/main/java/io/reactivex/rxjava3/core/Maybe.java <ide> public static <T> Flowable<T> merge( <ide> } <ide> <ide> /** <del> * Merges an array sequence of {@link MaybeSource} instances into a single {@link Flowable} sequence, <add> * Merges an array of {@link MaybeSource} instances into a single {@link Flowable} sequence, <ide> * running all {@code MaybeSource}s at once. <ide> * <p> <ide> * <img width="640" height="272" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.mergeArray.png" alt=""> <ide> public static <T> Flowable<T> mergeArray(MaybeSource<? extends T>... sources) { <ide> * <img width="640" height="422" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Maybe.mergeArrayDelayError.png" alt=""> <ide> * <p> <ide> * This behaves like {@link #merge(Publisher)} except that if any of the merged {@code MaybeSource}s notify of an <del> * error via {@link Subscriber#onError onError}, {@code mergeDelayError} will refrain from propagating that <add> * error via {@link Subscriber#onError onError}, {@code mergeArrayDelayError} will refrain from propagating that <ide> * error notification until all of the merged {@code MaybeSource}s have finished emitting items. <ide> * <p> <del> * Even if multiple merged {@code MaybeSource}s send {@code onError} notifications, {@code mergeDelayError} will only <add> * Even if multiple merged {@code MaybeSource}s send {@code onError} notifications, {@code mergeArrayDelayError} will only <ide> * invoke the {@code onError} method of its subscribers once. <ide> * <dl> <ide> * <dt><b>Backpressure:</b></dt> <ide><path>src/main/java/io/reactivex/rxjava3/core/Single.java <ide> import java.util.concurrent.*; <ide> import java.util.stream.*; <ide> <del>import org.reactivestreams.Publisher; <add>import org.reactivestreams.*; <ide> <ide> import io.reactivex.rxjava3.annotations.*; <ide> import io.reactivex.rxjava3.disposables.Disposable; <ide> public static <T> Flowable<T> merge( <ide> return merge(Flowable.fromArray(source1, source2, source3, source4)); <ide> } <ide> <add> /** <add> * Merges an array of {@link SingleSource} instances into a single {@link Flowable} sequence, <add> * running all {@code SingleSource}s at once. <add> * <p> <add> * <img width="640" height="272" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.mergeArray.png" alt=""> <add> * <dl> <add> * <dt><b>Backpressure:</b></dt> <add> * <dd>The operator honors backpressure from downstream.</dd> <add> * <dt><b>Scheduler:</b></dt> <add> * <dd>{@code mergeArray} does not operate by default on a particular {@link Scheduler}.</dd> <add> * <dt><b>Error handling:</b></dt> <add> * <dd>If any of the source {@code SingleSource}s signal a {@link Throwable} via {@code onError}, the resulting <add> * {@code Flowable} terminates with that {@code Throwable} and all other source {@code SingleSource}s are disposed. <add> * If more than one {@code SingleSource} signals an error, the resulting {@code Flowable} may terminate with the <add> * first one's error or, depending on the concurrency of the sources, may terminate with a <add> * {@link CompositeException} containing two or more of the various error signals. <add> * {@code Throwable}s that didn't make into the composite will be sent (individually) to the global error handler via <add> * {@link RxJavaPlugins#onError(Throwable)} method as {@link UndeliverableException} errors. Similarly, {@code Throwable}s <add> * signaled by source(s) after the returned {@code Flowable} has been cancelled or terminated with a <add> * (composite) error will be sent to the same global error handler. <add> * Use {@link #mergeArrayDelayError(SingleSource...)} to merge sources and terminate only when all source {@code SingleSource}s <add> * have completed or failed with an error. <add> * </dd> <add> * </dl> <add> * @param <T> the common and resulting value type <add> * @param sources the array sequence of {@code SingleSource} sources <add> * @return the new {@code Flowable} instance <add> * @throws NullPointerException if {@code sources} is {@code null} <add> * @see #mergeArrayDelayError(SingleSource...) <add> */ <add> @BackpressureSupport(BackpressureKind.FULL) <add> @CheckReturnValue <add> @NonNull <add> @SchedulerSupport(SchedulerSupport.NONE) <add> @SafeVarargs <add> public static <T> Flowable<T> mergeArray(SingleSource<? extends T>... sources) { <add> return Flowable.fromArray(sources).flatMapSingle(Functions.identity(), false, sources.length); <add> } <add> <add> /** <add> * Flattens an array of {@link SingleSource}s into one {@link Flowable}, in a way that allows a subscriber to receive all <add> * successfully emitted items from each of the source {@code SingleSource}s without being interrupted by an error <add> * notification from one of them. <add> * <p> <add> * <img width="640" height="422" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.mergeArrayDelayError.png" alt=""> <add> * <p> <add> * This behaves like {@link #merge(Publisher)} except that if any of the merged {@code SingleSource}s notify of an <add> * error via {@link Subscriber#onError onError}, {@code mergeArrayDelayError} will refrain from propagating that <add> * error notification until all of the merged {@code SingleSource}s have finished emitting items. <add> * <p> <add> * Even if multiple merged {@code SingleSource}s send {@code onError} notifications, {@code mergeArrayDelayError} will only <add> * invoke the {@code onError} method of its subscribers once. <add> * <dl> <add> * <dt><b>Backpressure:</b></dt> <add> * <dd>The operator honors backpressure from downstream.</dd> <add> * <dt><b>Scheduler:</b></dt> <add> * <dd>{@code mergeArrayDelayError} does not operate by default on a particular {@link Scheduler}.</dd> <add> * </dl> <add> * <add> * @param <T> the common element base type <add> * @param sources <add> * the array of {@code SingleSource}s <add> * @return the new {@code Flowable} instance <add> * @throws NullPointerException if {@code sources} is {@code null} <add> * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a> <add> */ <add> @BackpressureSupport(BackpressureKind.FULL) <add> @CheckReturnValue <add> @SchedulerSupport(SchedulerSupport.NONE) <add> @SafeVarargs <add> @NonNull <add> public static <T> Flowable<T> mergeArrayDelayError(@NonNull SingleSource<? extends T>... sources) { <add> return Flowable.fromArray(sources).flatMapSingle(Functions.identity(), true, sources.length); <add> } <add> <ide> /** <ide> * Merges an {@link Iterable} sequence of {@link SingleSource} instances into one {@link Flowable} sequence, <ide> * running all {@code SingleSource}s at once and delaying any error(s) until all sources succeed or fail. <ide><path>src/test/java/io/reactivex/rxjava3/internal/fuseable/CancellableQueueFuseableTest.java <ide> public void dispose() { <ide> <ide> @Test <ide> public void cancel2() { <del> AbstractEmptyQueueFuseable<Object> qs = new AbstractEmptyQueueFuseable<Object>() {}; <add> AbstractEmptyQueueFuseable<Object> qs = new AbstractEmptyQueueFuseable<Object>() { }; <ide> <ide> assertFalse(qs.isDisposed()); <ide> <ide> public void cancel2() { <ide> <ide> @Test <ide> public void dispose2() { <del> AbstractEmptyQueueFuseable<Object> qs = new AbstractEmptyQueueFuseable<Object>() {}; <add> AbstractEmptyQueueFuseable<Object> qs = new AbstractEmptyQueueFuseable<Object>() { }; <ide> <ide> assertFalse(qs.isDisposed()); <ide> <ide><path>src/test/java/io/reactivex/rxjava3/internal/operators/single/SingleMergeArrayTest.java <add>/** <add> * Copyright (c) 2016-present, RxJava Contributors. <add> * <add> * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in <add> * compliance 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, software distributed under the License is <add> * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See <add> * the License for the specific language governing permissions and limitations under the License. <add> */ <add> <add>package io.reactivex.rxjava3.internal.operators.single; <add> <add>import org.junit.Test; <add> <add>import io.reactivex.rxjava3.core.*; <add>import io.reactivex.rxjava3.exceptions.TestException; <add> <add>public class SingleMergeArrayTest extends RxJavaTest { <add> <add> @Test <add> public void normal() { <add> Single.mergeArray(Single.just(1), Single.just(2), Single.just(3)) <add> .test() <add> .assertResult(1, 2, 3); <add> } <add> <add> @Test <add> public void error() { <add> Single.mergeArray(Single.just(1), Single.error(new TestException()), Single.just(3)) <add> .test() <add> .assertFailure(TestException.class, 1); <add> } <add> <add> @Test <add> public void normalDelayError() { <add> Single.mergeArrayDelayError(Single.just(1), Single.just(2), Single.just(3)) <add> .test() <add> .assertResult(1, 2, 3); <add> } <add> <add> @Test <add> public void errorDelayError() { <add> Single.mergeArrayDelayError(Single.just(1), Single.error(new TestException()), Single.just(3)) <add> .test() <add> .assertFailure(TestException.class, 1, 3); <add> } <add>}
4
PHP
PHP
remove monologconfigurator infrastructure
b6f7cfbc1efcc3866eef336b6cb4f9ac1b221c32
<ide><path>src/Illuminate/Foundation/Application.php <ide> class Application extends Container implements ApplicationContract, HttpKernelIn <ide> */ <ide> protected $deferredServices = []; <ide> <del> /** <del> * A custom callback used to configure Monolog. <del> * <del> * @var callable|null <del> */ <del> protected $monologConfigurator; <del> <ide> /** <ide> * The custom database path defined by the developer. <ide> * <ide> public function provideFacades($namespace) <ide> AliasLoader::setFacadeNamespace($namespace); <ide> } <ide> <del> /** <del> * Define a callback to be used to configure Monolog. <del> * <del> * @param callable $callback <del> * @return $this <del> */ <del> public function configureMonologUsing(callable $callback) <del> { <del> $this->monologConfigurator = $callback; <del> <del> return $this; <del> } <del> <del> /** <del> * Determine if the application has a custom Monolog configurator. <del> * <del> * @return bool <del> */ <del> public function hasMonologConfigurator() <del> { <del> return ! is_null($this->monologConfigurator); <del> } <del> <del> /** <del> * Get the custom Monolog configurator for the application. <del> * <del> * @return callable <del> */ <del> public function getMonologConfigurator() <del> { <del> return $this->monologConfigurator; <del> } <del> <ide> /** <ide> * Get the current application locale. <ide> *
1
Ruby
Ruby
revert an installed? guard removal
7166289ad757641e54812bde742ea8c883510b0b
<ide><path>Library/Homebrew/os/mac/xcode.rb <ide> def version <ide> def detect_version <ide> # CLT isn't a distinct entity pre-4.3, and pkgutil doesn't exist <ide> # at all on Tiger, so just count it as installed if Xcode is installed <del> return MacOS::Xcode.version if MacOS::Xcode.version < "3.0" <add> if MacOS::Xcode.installed? && MacOS::Xcode.version < "3.0" <add> return MacOS::Xcode.version <add> end <ide> <ide> version = nil <ide> [MAVERICKS_PKG_ID, MAVERICKS_NEW_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID].each do |id|
1
PHP
PHP
use closures instead of callable for body parsers
b145714a44f5901ff3a68590b25e08483df494df
<ide><path>src/Http/Middleware/BodyParserMiddleware.php <ide> use Cake\Http\Exception\BadRequestException; <ide> use Cake\Utility\Exception\XmlException; <ide> use Cake\Utility\Xml; <add>use Closure; <ide> use Psr\Http\Message\ResponseInterface; <ide> use Psr\Http\Message\ServerRequestInterface; <ide> use Psr\Http\Server\MiddlewareInterface; <ide> class BodyParserMiddleware implements MiddlewareInterface <ide> /** <ide> * Registered Parsers <ide> * <del> * @var callable[] <add> * @var \Closure[] <ide> */ <ide> protected $parsers = []; <ide> <ide> public function __construct(array $options = []) <ide> if ($options['json']) { <ide> $this->addParser( <ide> ['application/json', 'text/json'], <del> [$this, 'decodeJson'] <add> Closure::fromCallable([$this, 'decodeJson']) <ide> ); <ide> } <ide> if ($options['xml']) { <ide> $this->addParser( <ide> ['application/xml', 'text/xml'], <del> [$this, 'decodeXml'] <add> Closure::fromCallable([$this, 'decodeXml']) <ide> ); <ide> } <ide> if ($options['methods']) { <ide> public function getMethods(): array <ide> * ``` <ide> * <ide> * @param string[] $types An array of content-type header values to match. eg. application/json <del> * @param callable $parser The parser function. Must return an array of data to be inserted <add> * @param \Closure $parser The parser function. Must return an array of data to be inserted <ide> * into the request. <ide> * @return $this <ide> */ <del> public function addParser(array $types, callable $parser) <add> public function addParser(array $types, Closure $parser) <ide> { <ide> foreach ($types as $type) { <ide> $type = strtolower($type); <ide> public function addParser(array $types, callable $parser) <ide> /** <ide> * Get the current parsers <ide> * <del> * @return callable[] <add> * @return \Closure[] <ide> */ <ide> public function getParsers(): array <ide> { <ide><path>tests/TestCase/Http/Middleware/BodyParserMiddlewareTest.php <ide> public function testConstructorXmlOption() <ide> $this->assertEquals([], $parser->getParsers(), 'No Xml types set.'); <ide> <ide> $parser = new BodyParserMiddleware(['json' => false, 'xml' => true]); <del> $expected = [ <del> 'application/xml' => [$parser, 'decodeXml'], <del> 'text/xml' => [$parser, 'decodeXml'], <del> ]; <del> $this->assertEquals($expected, $parser->getParsers(), 'Xml types are incorrect.'); <add> $this->assertEquals( <add> ['application/xml', 'text/xml'], <add> array_keys($parser->getParsers()), <add> 'Default XML parsers are not set.' <add> ); <ide> } <ide> <ide> /** <ide> public function testConstructorJsonOption() <ide> $this->assertEquals([], $parser->getParsers(), 'No JSON types set.'); <ide> <ide> $parser = new BodyParserMiddleware([]); <del> $expected = [ <del> 'application/json' => [$parser, 'decodeJson'], <del> 'text/json' => [$parser, 'decodeJson'], <del> ]; <del> $this->assertEquals($expected, $parser->getParsers(), 'JSON types are incorrect.'); <add> $this->assertEquals( <add> ['application/json', 'text/json'], <add> array_keys($parser->getParsers()), <add> 'Default JSON parsers are not set.' <add> ); <ide> } <ide> <ide> /** <ide> public function testSetMethodsReturn() <ide> public function testAddParserReturn() <ide> { <ide> $parser = new BodyParserMiddleware(['json' => false]); <del> $this->assertSame($parser, $parser->addParser(['application/json'], 'json_decode')); <add> $f1 = function (string $body) { <add> return json_decode($body, true); <add> }; <add> $this->assertSame($parser, $parser->addParser(['application/json'], $f1)); <ide> } <ide> <ide> /** <ide> public function testAddParserReturn() <ide> public function testAddParserOverwrite() <ide> { <ide> $parser = new BodyParserMiddleware(['json' => false]); <del> $parser->addParser(['application/json'], 'json_decode'); <del> $parser->addParser(['application/json'], 'strpos'); <ide> <del> $this->assertEquals(['application/json' => 'strpos'], $parser->getParsers()); <add> $f1 = function (string $body) { <add> return json_decode($body, true); <add> }; <add> $f2 = function (string $body) { <add> return ['overridden']; <add> }; <add> $parser->addParser(['application/json'], $f1); <add> $parser->addParser(['application/json'], $f2); <add> <add> $this->assertSame(['application/json' => $f2], $parser->getParsers()); <ide> } <ide> <ide> /**
2
Java
Java
update copyright date
2c89ff934ddd5b7efa14f715c4ec6a67bab7fd69
<ide><path>spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java <ide> /* <del> * Copyright 2002-2018 the original author or authors. <add> * Copyright 2002-2021 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License. <ide><path>spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java <ide> /* <del> * Copyright 2002-2020 the original author or authors. <add> * Copyright 2002-2021 the original author or authors. <ide> * <ide> * Licensed under the Apache License, Version 2.0 (the "License"); <ide> * you may not use this file except in compliance with the License.
2
Ruby
Ruby
add uses_from_macos since bound
eb303dd65438417c20c860bf1c5246d0535dc9bf
<ide><path>Library/Homebrew/extend/os/mac/software_spec.rb <ide> class SoftwareSpec <ide> undef uses_from_macos <ide> <del> def uses_from_macos(deps) <add> def uses_from_macos(deps, bounds = {}) <ide> @uses_from_macos_elements ||= [] <del> @uses_from_macos_elements << deps <add> <add> if deps.is_a?(Hash) <add> bounds = deps.dup <add> deps = Hash[*bounds.shift] <add> end <add> <add> bounds.transform_values! { |v| MacOS::Version.from_symbol(v) } <add> if MacOS.version >= bounds[:since] <add> @uses_from_macos_elements << deps <add> else <add> depends_on deps <add> end <ide> end <ide> end <ide><path>Library/Homebrew/formula.rb <ide> def depends_on(dep) <ide> # Indicates use of dependencies provided by macOS. <ide> # On macOS this is a no-op (as we use the system libraries there). <ide> # On Linux this will act as `depends_on`. <del> def uses_from_macos(dep) <del> specs.each { |spec| spec.uses_from_macos(dep) } <add> def uses_from_macos(dep, bounds = {}) <add> specs.each { |spec| spec.uses_from_macos(dep, bounds) } <ide> end <ide> <ide> # Block executed only executed on macOS. No-op on Linux. <ide><path>Library/Homebrew/rubocops/dependency_order.rb <ide> def verify_order_in_source(ordered) <ide> <ide> # Node pattern method to extract `name` in `depends_on :name` or `uses_from_macos :name` <ide> def_node_search :dependency_name_node, <<~EOS <del> {(send nil? {:depends_on :uses_from_macos} {(hash (pair $_ _)) $({str sym} _) $(const nil? _)}) <add> {(send nil? {:depends_on :uses_from_macos} {(hash (pair $_ _) ...) $({str sym} _) $(const nil? _)} ...) <ide> (if _ (send nil? :depends_on {(hash (pair $_ _)) $({str sym} _) $(const nil? _)}) nil?)} <ide> EOS <ide> <ide><path>Library/Homebrew/software_spec.rb <ide> def depends_on(spec) <ide> add_dep_option(dep) if dep <ide> end <ide> <del> def uses_from_macos(spec) <add> def uses_from_macos(spec, _bounds = {}) <add> spec = Hash[*spec.first] if spec.is_a?(Hash) <ide> depends_on(spec) <ide> end <ide> <ide><path>Library/Homebrew/test/os/linux/formula_spec.rb <ide> expect(f.class.devel.deps.first.name).to eq("foo") <ide> expect(f.class.head.deps.first.name).to eq("foo") <ide> end <add> <add> it "ignores OS version specifications" do <add> f = formula "foo" do <add> url "foo-1.0" <add> <add> uses_from_macos "foo", since: :mojave <add> end <add> <add> expect(f.class.stable.deps.first.name).to eq("foo") <add> expect(f.class.devel.deps.first.name).to eq("foo") <add> expect(f.class.head.deps.first.name).to eq("foo") <add> end <ide> end <ide> <ide> describe "#on_linux" do <ide><path>Library/Homebrew/test/os/mac/software_spec_spec.rb <ide> allow(OS::Mac).to receive(:version).and_return(OS::Mac::Version.new(sierra_os_version)) <ide> end <ide> <del> it "doesn't add a dependency" do <add> it "adds a macOS dependency if the OS version meets requirements" do <add> spec.uses_from_macos("foo", since: :el_capitan) <add> <add> expect(spec.deps).to be_empty <add> expect(spec.uses_from_macos_elements.first).to eq("foo") <add> end <add> <add> it "doesn't add a macOS dependency if the OS version doesn't meet requirements" do <add> spec.uses_from_macos("foo", since: :high_sierra) <add> <add> expect(spec.deps.first.name).to eq("foo") <add> expect(spec.uses_from_macos_elements).to be_empty <add> end <add> <add> it "works with tags" do <add> spec.uses_from_macos("foo" => :build, :since => :high_sierra) <add> <add> dep = spec.deps.first <add> <add> expect(dep.name).to eq("foo") <add> expect(dep.tags).to include(:build) <add> end <add> <add> it "doesn't add a dependency if no OS version is specified" do <ide> spec.uses_from_macos("foo") <ide> spec.uses_from_macos("bar" => :build) <ide> <ide> expect(spec.deps).to be_empty <ide> end <add> <add> it "raises an error if passing invalid OS versions" do <add> expect { <add> spec.uses_from_macos("foo", since: :bar) <add> }.to raise_error(ArgumentError, "unknown version :bar") <add> end <ide> end <ide> end <ide><path>Library/Homebrew/test/software_spec_spec.rb <ide> end <ide> <ide> it "ignores OS version specifications", :needs_linux do <del> subject.uses_from_macos("foo") <del> subject.uses_from_macos("bar" => :build) <add> subject.uses_from_macos("foo", since: :mojave) <add> subject.uses_from_macos("bar" => :build, :since => :mojave) <ide> <ide> expect(subject.deps.first.name).to eq("foo") <ide> expect(subject.deps.last.name).to eq("bar")
7
Text
Text
update links and add new public spinenet link
90afb5b8611c449afd09647632b1d95b71f51b66
<ide><path>official/projects/deepmac_maskrcnn/README.md <ide> SpienNet-143 | Hourglass-52 | `deep_mask_head_rcnn_voc_spinenet143_hg52.yaml` | <ide> This model takes Image + boxes as input and produces per-box instance <ide> masks as output. <ide> <del>* [Mask-RCNN SpineNet backbone](https://storage.cloud.google.com/tf_model_garden/vision/deepmac_maskrcnn/deepmarc_spinenet.zip) <add>* [Mask-RCNN SpineNet backbone](https://storage.googleapis.com/tf_model_garden/vision/deepmac_maskrcnn/deepmarc_spinenet.zip) <ide> <ide> ## See also <ide>
1
Javascript
Javascript
transmit glsl "defines" in shaderpass
b1673f3716e7b0a7142d2b356c9ad4435ce544fc
<ide><path>examples/js/postprocessing/ShaderPass.js <ide> THREE.ShaderPass = function ( shader, textureID ) { <ide> <ide> this.material = new THREE.ShaderMaterial( { <ide> <add> defines: shader.defines || {}, <ide> uniforms: this.uniforms, <ide> vertexShader: shader.vertexShader, <ide> fragmentShader: shader.fragmentShader
1
Text
Text
add nielsen to airflow users list
5cfacfc6bc092777bd9ac0c95d0ee5b4eda53f7b
<ide><path>README.md <ide> Currently **officially** using Airflow: <ide> 1. [Newzoo](https://www.newzoo.com) [[@newzoo-nexus](https://github.com/newzoo-nexus)] <ide> 1. [NEXT Trucking](https://www.nexttrucking.com/) [[@earthmancash2](https://github.com/earthmancash2), [@kppullin](https://github.com/kppullin)] <ide> 1. [Nextdoor](https://nextdoor.com) [[@SivaPandeti](https://github.com/SivaPandeti), [@zshapiro](https://github.com/zshapiro) & [@jthomas123](https://github.com/jthomas123)] <add>1. [Nielsen](https://www.nielsen.com) [[@roitvt](https://github.com/roitvt) & [@itaiy](https://github.com/itaiy)] <ide> 1. [Nine](https://nine.com.au) [[@TheZepto](https://github.com/TheZepto)] <ide> 1. [OdysseyPrime](https://www.goprime.io/) [[@davideberdin](https://github.com/davideberdin)] <ide> 1. [OfferUp](https://offerupnow.com)
1
Ruby
Ruby
improve relocatable debugging
c20f6395bbadef014f78e774e1526fecf2c12bfc
<ide><path>Library/Homebrew/cmd/bottle.rb <ide> require 'cmd/versions' <ide> require 'utils/inreplace' <ide> require 'erb' <add>require 'open3' <add>require 'extend/pathname' <ide> <ide> class BottleMerger < Formula <ide> # This provides a URL and Version which are the only needed properties of <ide> class << self <ide> end <ide> <ide> def keg_contains string, keg <del> quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg <add> if not ARGV.homebrew_developer? <add> return quiet_system 'fgrep', '--recursive', '--quiet', '--max-count=1', string, keg <add> end <add> <add> # Find all files that still reference the keg via a string search <add> keg_ref_files = `/usr/bin/fgrep --files-with-matches --recursive "#{string}" "#{keg}" 2>/dev/null` <add> keg_ref_files = (keg_ref_files.map{ |file| Pathname.new(file.strip) }).reject(&:symlink?) <add> <add> # If there are no files with that string found, return immediately <add> return false if keg_ref_files.empty? <add> <add> # Start printing out each file and any extra information we can find <add> opoo "String '#{string}' still exists in these files:" <add> keg_ref_files.each do |file| <add> puts "#{Tty.red}#{file}#{Tty.reset}" <add> <add> # If we can't use otool on this file, just skip to the next file <add> next if not file.mach_o_executable? and not file.mach_o_bundle? and not file.dylib? and not file.extname == '.a' <add> <add> # Get all libraries this file links to, then display only links to libraries that contain string in the path <add> linked_libraries = `otool -L "#{file}"`.split("\n").drop(1) <add> linked_libraries.map!{ |lib| lib.strip.split()[0] } <add> linked_libraries = linked_libraries.select{ |lib| lib.include? string } <add> <add> linked_libraries.each do |lib| <add> puts " #{Tty.gray}-->#{Tty.reset} links to #{lib}" <add> end <add> <add> # Use strings to search through the file for each string <add> strings = `strings -t x - "#{file}"`.select{ |str| str.include? string }.map{ |s| s.strip } <add> <add> # Don't bother reporting a string if it was found by otool <add> strings.reject!{ |str| linked_libraries.include? str.split[1] } <add> strings.each do |str| <add> offset, match = str.split <add> puts " #{Tty.gray}-->#{Tty.reset} match '#{match}' at offset #{Tty.em}0x#{offset}#{Tty.reset}" <add> end <add> end <add> puts <add> true <ide> end <ide> <ide> def bottle_output bottle
1
Python
Python
add version for compatibility
cf99fa7dabdcab1566d8497e830c648131a9df4d
<ide><path>airflow/migrations/versions/13eb55f81627_for_compatibility.py <add>"""maintain history for compatibility with earlier migrations <add> <add>Revision ID: 13eb55f81627 <add>Revises: 1507a7289a2f <add>Create Date: 2015-08-23 05:12:49.732174 <add> <add>""" <add> <add># revision identifiers, used by Alembic. <add>revision = '13eb55f81627' <add>down_revision = '1507a7289a2f' <add>branch_labels = None <add>depends_on = None <add> <add>def upgrade(): <add> pass <add> <add>def downgrade(): <add> pass <ide>\ No newline at end of file
1