hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
0fcb372a207f4057773b857766a2511abc808ec3
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java @@ -716,8 +716,10 @@ public class XbaseTypeComputer implements ITypeComputer { protected LightweightTypeReference getAndEnhanceIterableOrArrayFromComponent(LightweightTypeReference parameterType, JvmGenericType iterableType, final CompoundTypeReference compoundResult) { - if (parameterType.isUnknown()) + if (parameterType.isUnknown()) { + compoundResult.addComponent(parameterType); return parameterType; + } ITypeReferenceOwner owner = compoundResult.getOwner(); LightweightTypeReference iterableOrArray = null; LightweightTypeReference addAsArrayComponentAndIterable = null;
[xbase][typesystem] Fixed NPE in type computation unresolved types in for-expression may have caused trouble, e.g. for(DoesNotExist d: someExpression) { .. }
eclipse_xtext-extras
train
java
d05d9605c3dd887ce50203aeda9d4c7303fc1672
diff --git a/src/main/java/eu/bitwalker/useragentutils/OperatingSystem.java b/src/main/java/eu/bitwalker/useragentutils/OperatingSystem.java index <HASH>..<HASH> 100644 --- a/src/main/java/eu/bitwalker/useragentutils/OperatingSystem.java +++ b/src/main/java/eu/bitwalker/useragentutils/OperatingSystem.java @@ -245,8 +245,9 @@ public enum OperatingSystem { /* * Shortcut to check of an operating system is a mobile device. - * Left in here for backwards compatibility. + * Left in here for backwards compatibility. Use .getDeciceType() instead. */ + @Deprecated public boolean isMobileDevice() { return deviceType.equals(DeviceType.MOBILE); }
Mark isMobileDevice as deprecated
HaraldWalker_user-agent-utils
train
java
b752f17b71c1cb30ee1cf6e2b0580ab1a43699e9
diff --git a/h2o-core/src/main/java/hex/Model.java b/h2o-core/src/main/java/hex/Model.java index <HASH>..<HASH> 100755 --- a/h2o-core/src/main/java/hex/Model.java +++ b/h2o-core/src/main/java/hex/Model.java @@ -2081,7 +2081,7 @@ public abstract class Model<M extends Model<M,P,O>, P extends Model.Parameters, return true; } catch (Exception e) { e.printStackTrace(); - throw H2O.fail("Internal POJO compilation failed",e); + throw new IllegalStateException("Internal POJO compilation failed",e); } // Check that POJO has the expected interfaces @@ -2131,7 +2131,7 @@ public abstract class Model<M extends Model<M,P,O>, P extends Model.Parameters, features = MemoryManager.malloc8d(genmodel._names.length); } catch (IOException e1) { e1.printStackTrace(); - throw H2O.fail("Internal MOJO loading failed", e1); + throw new IllegalStateException("Internal MOJO loading failed", e1); } finally { boolean deleted = new File(filename).delete(); if (!deleted) Log.warn("Failed to delete the file");
There is no reason to halt tests completely when POJO/MOJO loading fails
h2oai_h2o-3
train
java
e6b3a40b360ba53738d9de69568aaafae7dc9367
diff --git a/api/charms/client.go b/api/charms/client.go index <HASH>..<HASH> 100644 --- a/api/charms/client.go +++ b/api/charms/client.go @@ -95,7 +95,9 @@ func (c *Client) ResolveCharms(charms []CharmToResolve) ([]ResolvedCharm, error) return resolvedCharms, nil } -// DownloadInfo holds the information for a given DownloadInfo. +// DownloadInfo holds the URL and Origin for a charm that requires downloading +// on the client side. This is mainly for bundles as we don't resolve bundles +// on the server. type DownloadInfo struct { URL string Origin apicharm.Origin diff --git a/charmhub/refresh.go b/charmhub/refresh.go index <HASH>..<HASH> 100644 --- a/charmhub/refresh.go +++ b/charmhub/refresh.go @@ -31,7 +31,7 @@ const ( RefreshAction Action = "refresh" ) -// RefreshPlatform defines a platform refreshing charms. +// RefreshPlatform defines a platform for selecting a specific charm. type RefreshPlatform struct { Architecture string OS string
Clean up the comment describing the DownloadInfo The comment was rather tautological so clean it up to better explain what the payload is for.
juju_juju
train
go,go
0220590a67e616086b42b61a976d0a3e2e4232f1
diff --git a/src/context.js b/src/context.js index <HASH>..<HASH> 100644 --- a/src/context.js +++ b/src/context.js @@ -40,7 +40,7 @@ function _gpfReduceContext (path, reducer) { * - when `"gpf"`, it **always** returns the GPF object * - when it leads to nothing, `undefined` is returned - * @typedef {*} gpfTypeContextResult + * @typedef {*} gpf.typedef.contextResult * @since 0.1.5 */ @@ -51,7 +51,7 @@ function _gpfReduceContext (path, reducer) { * @param {Boolean} [createMissingParts=false] If the path includes undefined parts and createMissingParts is true, * it allocates a default empty object. This allows building namespaces on the fly. * - * @return {gpfTypeContextResult} Resolved path + * @return {gpf.typedef.contextResult} Resolved path * @since 0.1.5 */ function _gpfContext (path, createMissingParts) { @@ -69,7 +69,7 @@ function _gpfContext (path, createMissingParts) { * * @param {String} path Dot separated list of identifiers * - * @return {gpfTypeContextResult} Resolved path + * @return {gpf.typedef.contextResult} Resolved path * @since 0.1.5 */ gpf.context = function (path) {
Makes the type definition gpf specific and not global
ArnaudBuchholz_gpf-js
train
js
e632b31689afb047d3d7b8e104dc5f89c074c63e
diff --git a/measure_it.py b/measure_it.py index <HASH>..<HASH> 100644 --- a/measure_it.py +++ b/measure_it.py @@ -3,11 +3,11 @@ from functools import wraps # if your metric function throws an exception or is slow, you suck. -def print_metric(name, count, total_time): +def print_metric(name, count, elapsed): if name is not None: - print("%s: %d elements in %f seconds"%(name, count, total_time)) + print("%s: %d elements in %f seconds"%(name, count, elapsed)) else: - print("%d elements in %f seconds"%(count, total_time)) + print("%d elements in %f seconds"%(count, elapsed)) def measure(iterable, metric = print_metric, name = None): """Record count and time statistics for consuming an iterable @@ -85,4 +85,15 @@ def _measure_each_decorate(metric = print_metric, name = None): return wrapped return wrapper -measure_each.func = _measure_each_decorate \ No newline at end of file +measure_each.func = _measure_each_decorate + +try: + from statsd import statsd + if not statsd: raise RuntimeError("no statsd") +except Exception: + pass +else: + def statsd_metric(name, count, elapsed): + with statsd.pipeline as pipe: + pipe.incr(name, count) + pipe.timing(name, int(round(1000 * dt))) # Convert to ms. \ No newline at end of file
rename var and add statsd support
wearpants_instrument
train
py
3ada3afa7f49f00dac2a28cd3e6a88bd431be931
diff --git a/packages/ember-metal/lib/is_none.js b/packages/ember-metal/lib/is_none.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/is_none.js +++ b/packages/ember-metal/lib/is_none.js @@ -9,7 +9,7 @@ Ember.isNone(undefined); // true Ember.isNone(''); // false Ember.isNone([]); // false - Ember.isNone(function() {}); // false + Ember.isNone(function() {}); // false ``` @method isNone
[DOC] Fix alignment in examples According to <URL>
emberjs_ember.js
train
js
01dceeef46ce2dd034aaf9919c209dd16662baf1
diff --git a/lib/ansiblelint/rules/RoleNames.py b/lib/ansiblelint/rules/RoleNames.py index <HASH>..<HASH> 100644 --- a/lib/ansiblelint/rules/RoleNames.py +++ b/lib/ansiblelint/rules/RoleNames.py @@ -48,8 +48,8 @@ class RoleNames(AnsibleLintRule): def match(self, file, text): path = file['path'].split("/") - if "roles" in path: - role_name = path[path.index("roles") + 1] + if "tasks" in path: + role_name = path[path.index("tasks") - 1] if role_name in self.done: return False self.done.append(role_name)
E<I>: Role name should be the parent dir of tasks (#<I>)
ansible_ansible-lint
train
py
731fd1cb24017a36234de23d322575be24019d40
diff --git a/services/service_broker_lifecycle_test.go b/services/service_broker_lifecycle_test.go index <HASH>..<HASH> 100644 --- a/services/service_broker_lifecycle_test.go +++ b/services/service_broker_lifecycle_test.go @@ -69,6 +69,6 @@ var _ = Describe("Service Broker Lifecycle", func() { Expect(session).NotTo(Say(broker.Service.Name)) Expect(session).NotTo(Say(broker.Plan.Name)) - helpers.Require(Cf("delete", broker.Name, "-f")).To(ExitWithTimeout(0, 2*time.Second)) + helpers.Require(Cf("delete", broker.Name, "-f")).To(ExitWithTimeout(0, 10*time.Second)) }) })
increase timeout of app delete to <I> seconds
cloudfoundry_cf-acceptance-tests
train
go
0c82bc6863fa8ef911ab3d61614902e0673bad30
diff --git a/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/portlet/CommerceSubscriptionEntryPortlet.java b/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/portlet/CommerceSubscriptionEntryPortlet.java index <HASH>..<HASH> 100644 --- a/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/portlet/CommerceSubscriptionEntryPortlet.java +++ b/commerce-subscription-web/src/main/java/com/liferay/commerce/subscription/web/internal/portlet/CommerceSubscriptionEntryPortlet.java @@ -44,7 +44,6 @@ import org.osgi.service.component.annotations.Reference; "com.liferay.portlet.add-default-resource=true", "com.liferay.portlet.css-class-wrapper=portlet-commerce-product-subscription", "com.liferay.portlet.display-category=category.hidden", - "com.liferay.portlet.header-portlet-css=/css/main.css", "com.liferay.portlet.layout-cacheable=true", "com.liferay.portlet.preferences-owned-by-group=true", "com.liferay.portlet.preferences-unique-per-layout=false",
COMMERCE-<I> Removed useless portlet property
liferay_com-liferay-commerce
train
java
13bbdc09ece4f48e9b2537092a4505a3942e373b
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index <HASH>..<HASH> 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -214,14 +214,14 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_new_application_load_defaults app_root = File.join(destination_root, "myfirstapp") - run_generator [app_root, "--no-skip-javascript"] + run_generator [app_root] output = nil assert_file "#{app_root}/config/application.rb", /\s+config\.load_defaults #{Rails::VERSION::STRING.to_f}/ Dir.chdir(app_root) do - output = `./bin/rails r "puts Rails.application.config.assets.unknown_asset_fallback"` + output = `SKIP_REQUIRE_WEBPACKER=true ./bin/rails r "puts Rails.application.config.assets.unknown_asset_fallback"` end assert_equal "false\n", output
Avoid `webpacker:install` if unnecessary Since this is a test to check the behavior of `load_defaults`, webpacker is unnecessary.
rails_rails
train
rb
d427a6aa705005075f57dbcf46bc234e73c6ed0d
diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php @@ -184,6 +184,7 @@ class XmlDriver extends AbstractFileDriver 'embedded' => true, 'targetDocument' => isset($attributes['target-document']) ? (string) $attributes['target-document'] : null, 'name' => (string) $attributes['field'], + 'strategy' => isset($attributes['strategy']) ? (string) $attributes['strategy'] : 'pushPull', ); $this->addFieldMapping($class, $mapping); } @@ -201,6 +202,7 @@ class XmlDriver extends AbstractFileDriver 'reference' => true, 'targetDocument' => isset($attributes['target-document']) ? (string) $attributes['target-document'] : null, 'name' => (string) $attributes['field'], + 'strategy' => isset($attributes['strategy']) ? (string) $attributes['strategy'] : 'pushPull', ); $this->addFieldMapping($class, $mapping); }
Add strategy attribute to reference and embed mapping in XmlDriver
doctrine_mongodb-odm
train
php
58ac1f4a4d4d3fa10156aba947174f32719f23f8
diff --git a/rocketchat_API/rocketchat.py b/rocketchat_API/rocketchat.py index <HASH>..<HASH> 100644 --- a/rocketchat_API/rocketchat.py +++ b/rocketchat_API/rocketchat.py @@ -352,6 +352,10 @@ class RocketChat: """Adds a user to the channel.""" return self.__call_api_post('channels.invite', roomId=room_id, userId=user_id, kwargs=kwargs) + def channels_join(self, room_id, join_code, **kwargs): + """Joins yourself to the channel.""" + return self.__call_api_post('channels.join', roomId=room_id, joinCode=join_code, kwargs=kwargs) + def channels_kick(self, room_id, user_id, **kwargs): """Removes a user from the channel.""" return self.__call_api_post('channels.kick', roomId=room_id, userId=user_id, kwargs=kwargs)
Fixes #<I> by adding the channels.join API endpoint
jadolg_rocketchat_API
train
py
8072dc6f4cedb6a750dadc5fdc4e890c11ae1102
diff --git a/flask_ipblock/documents.py b/flask_ipblock/documents.py index <HASH>..<HASH> 100644 --- a/flask_ipblock/documents.py +++ b/flask_ipblock/documents.py @@ -11,7 +11,7 @@ class IPNetwork(Document): whitelist = BooleanField(default=False) meta = { - 'indexes': [('start', 'stop')] + 'indexes': [('start', 'stop', 'whitelist')] } @classmethod
adding whitelist to indexed fields.
closeio_flask-ipblock
train
py
0484b2c3254238a6c534f7d417c12c10b694f0d0
diff --git a/utils.go b/utils.go index <HASH>..<HASH> 100644 --- a/utils.go +++ b/utils.go @@ -197,7 +197,7 @@ func RootIsShared() bool { if data, err := ioutil.ReadFile("/proc/self/mountinfo"); err == nil { for _, line := range strings.Split(string(data), "\n") { cols := strings.Split(line, " ") - if len(cols) >= 6 && cols[3] == "/" && cols[4] == "/" { + if len(cols) >= 6 && cols[4] == "/" { return strings.HasPrefix(cols[6], "shared") } }
RootIsShared: Fix root detection Column 4 is the mount position, column 3 will not always be "/" for the root. On one of my system its "/root".
moby_moby
train
go
4bb89a891fa011ca27c27abf30e32a3e57c31d1b
diff --git a/js/base/Exchange.js b/js/base/Exchange.js index <HASH>..<HASH> 100644 --- a/js/base/Exchange.js +++ b/js/base/Exchange.js @@ -11,7 +11,8 @@ const { deepExtend , extend , sleep , timeout - , sortBy } = functions + , sortBy + , aggregate } = functions const { ExchangeError , NotSupported
fixing aggregate in fetchL2OrderBook
ccxt_ccxt
train
js
e59bdd9163c589ba7afd828fb0c5014a7470acb0
diff --git a/spec/unit/software_spec.rb b/spec/unit/software_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/software_spec.rb +++ b/spec/unit/software_spec.rb @@ -41,7 +41,7 @@ module Omnibus let(:uri) { URI.parse('http://example.com/foo.tar.gz') } before { allow(subject).to receive(:source_uri).and_return(uri) } - it_behaves_like 'a cleanroom getter', :downloaded_file + it_behaves_like 'a cleanroom getter', :project_file end describe "with_standard_compiler_flags helper" do
project_file, not downloaded_file
chef_omnibus
train
rb
2e76a3a4d416cb1e40b5dba07940395a791df54b
diff --git a/src/__/collections/set.php b/src/__/collections/set.php index <HASH>..<HASH> 100644 --- a/src/__/collections/set.php +++ b/src/__/collections/set.php @@ -37,12 +37,10 @@ function set($collection, $path, $value = null) return $collection; } - $path = \__::split($path, '.'); - // TODO Use __::first($portions) - $key = \array_shift($path); + $portions = \__::split($path, '.', 2); + $key = $portions[0]; - // TODO Use __::isEmpty($portions) - if (\count($path) === 0) { + if (\count($portions) === 1) { $collection = call_user_func_array($setter, [$collection, $key, $value]); } else { if ( @@ -58,7 +56,7 @@ function set($collection, $path, $value = null) $collection = call_user_func_array( $setter, // TODO Use __::join(__::drop($portions), '.') - [$collection, $key, set(\__::get($collection, $key), implode('.', $path), $value)] + [$collection, $key, set(\__::get($collection, $key), $portions[1], $value)] ); }
Use __::split() with limit to 2 in __::set() implementation
maciejczyzewski_bottomline
train
php
757a7a7989fed2c5f9217c0ad3d7d4c310f719f3
diff --git a/hook/pre-commit.js b/hook/pre-commit.js index <HASH>..<HASH> 100644 --- a/hook/pre-commit.js +++ b/hook/pre-commit.js @@ -365,7 +365,11 @@ var doWithStashIf = function ( condition ) { } ); } ); } - return Promise.resolve(); + return Promise.resolve( { + success: true, restoreFn: function () { + return Promise.resolve(); + } + } ); }; var main = function () {
FIX: execute the precommit scripts when directory not dirty
royriojas_precommit
train
js
449def7234e636664aa4435871a91a31ec610270
diff --git a/core/server/data/fixtures/index.js b/core/server/data/fixtures/index.js index <HASH>..<HASH> 100644 --- a/core/server/data/fixtures/index.js +++ b/core/server/data/fixtures/index.js @@ -289,16 +289,21 @@ to004 = function to004() { posts.each(function (post) { var order = 0; post.related('tags').each(function (tag) { - tagOps.push(post.tags().updatePivot( - {sort_order: order}, _.extend({}, options, {query: {where: {tag_id: tag.id}}}) - )); + tagOps.push((function (order) { + var sortOrder = order; + return function () { + return post.tags().updatePivot( + {sort_order: sortOrder}, _.extend({}, options, {query: {where: {tag_id: tag.id}}}) + ); + }; + }(order))); order += 1; }); }); } if (tagOps.length > 0) { logInfo('Updating order on ' + tagOps.length + ' tags'); - return Promise.all(tagOps); + return sequence(tagOps); } }); };
Switch to using sequence for updating tags no issue - makes upgrading very large numbers of posts & tags more reliable
TryGhost_Ghost
train
js
1fdd8b8d831a31aea44c445ab4cbd1a910b88b2f
diff --git a/modules/Common.php b/modules/Common.php index <HASH>..<HASH> 100644 --- a/modules/Common.php +++ b/modules/Common.php @@ -384,7 +384,7 @@ class Piwik_Common * * @return string Continent (3 letters code : afr, asi, eur, amn, ams, oce) */ - function getContinent($country) + static function getContinent($country) { require_once PIWIK_DATAFILES_INCLUDE_PATH . "/Countries.php"; @@ -407,7 +407,7 @@ class Piwik_Common * * @return string */ - function getCountry( $lang ) + static function getCountry( $lang ) { require_once PIWIK_DATAFILES_INCLUDE_PATH . "/Countries.php";
- fix Non-static method Piwik_Common::getCountry() should not be called statically, assuming $this from incompatible context git-svn-id: <URL>
matomo-org_matomo
train
php
dba10561f7a784fc05c300a67088c40678f75f09
diff --git a/lionengine-game/src/main/java/com/b3dgs/lionengine/game/collision/tile/MapTileCollisionRendererModel.java b/lionengine-game/src/main/java/com/b3dgs/lionengine/game/collision/tile/MapTileCollisionRendererModel.java index <HASH>..<HASH> 100644 --- a/lionengine-game/src/main/java/com/b3dgs/lionengine/game/collision/tile/MapTileCollisionRendererModel.java +++ b/lionengine-game/src/main/java/com/b3dgs/lionengine/game/collision/tile/MapTileCollisionRendererModel.java @@ -226,6 +226,9 @@ public class MapTileCollisionRendererModel implements MapTileCollisionRenderer @Override public void renderTile(Graphic g, Tile tile, int x, int y) { - renderCollision(g, tile.getFeature(TileCollision.class), x, y); + if (tile.hasFeature(TileCollision.class)) + { + renderCollision(g, tile.getFeature(TileCollision.class), x, y); + } } }
#<I>: Check collision feature presence before rendering.
b3dgs_lionengine
train
java
91a5ebee6f5ac0f36789b0a9bcd42828cbde8f9a
diff --git a/lavalink/PlayerManager.py b/lavalink/PlayerManager.py index <HASH>..<HASH> 100644 --- a/lavalink/PlayerManager.py +++ b/lavalink/PlayerManager.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod from random import randrange -from .Events import QueueEndEvent, TrackExceptionEvent, TrackEndEvent, TrackStartEvent +from .Events import QueueEndEvent, TrackExceptionEvent, TrackEndEvent, TrackStartEvent, TrackStuckEvent from .AudioTrack import AudioTrack
Whoops! How did flake8 not pick this up
Devoxin_Lavalink.py
train
py
15442b9667ad2f047d06737f9aa2a70a5b02f1b3
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java index <HASH>..<HASH> 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ResourceProperties.java @@ -116,7 +116,7 @@ public class ResourceProperties implements ResourceLoaderAware { return result; } - public List<Resource> getFaviconLocations() { + List<Resource> getFaviconLocations() { List<Resource> locations = new ArrayList<Resource>( CLASSPATH_RESOURCE_LOCATIONS.length + 1); if (this.resourceLoader != null) {
Avoid wrong meta-data Make `getFaviconLocations` package private so that it's not (wrongly) exposed in the meta-data. Closes gh-<I>
spring-projects_spring-boot
train
java
167af5fd4294588a9f0f3dd129873442cc6c26d9
diff --git a/lib/falcor/Model.js b/lib/falcor/Model.js index <HASH>..<HASH> 100644 --- a/lib/falcor/Model.js +++ b/lib/falcor/Model.js @@ -10,6 +10,7 @@ var call = require('./operations/call'); var operations = require('./operations'); var pathSyntax = require('falcor-path-syntax'); var getBoundValue = require('./../get/getBoundValue'); +var collect = require('../lru/collect'); var slice = Array.prototype.slice; var $ref = require('./../types/path'); var $error = require('./../types/error'); @@ -140,7 +141,17 @@ Model.prototype = { }); }, setCache: function(cache) { - return (this._cache = {}) && this._setCache(this, cache); + var size = this._cache && this._cache.$size || 0; + var lru = this._root; + var expired = lru.expired; + this._cache = {}; + collect(lru, expired, -1, size, 0, 0); + if(Array.isArray(cache.paths) && cache.jsong && typeof cache.jsong === "object") { + this._setJSONGsAsJSON(this, [cache], []); + } else { + this._setCache(this, cache); + } + return this; }, getCache: function() { var pathmaps = [{}];
Fixes setCache to accept a JSON Graph Envelope
Netflix_falcor
train
js
845eee62fd8a5d14ae69d235ee8c7a918b30e6c8
diff --git a/src/Ouzo/Migrations/Migration/MigrationDbConfig.php b/src/Ouzo/Migrations/Migration/MigrationDbConfig.php index <HASH>..<HASH> 100644 --- a/src/Ouzo/Migrations/Migration/MigrationDbConfig.php +++ b/src/Ouzo/Migrations/Migration/MigrationDbConfig.php @@ -46,7 +46,7 @@ class MigrationDbConfig public function __toString(): string { - return Objects::toString($this); + return Objects::toString($this->dbConfig); } public function toArray(): array
[migrations] Extracted migrations related classes - cleanup.
letsdrink_ouzo
train
php
5d48b95e9d991baed11e1ad0b73a193e80e85f7c
diff --git a/lxd/firewall/firewall_interface.go b/lxd/firewall/firewall_interface.go index <HASH>..<HASH> 100644 --- a/lxd/firewall/firewall_interface.go +++ b/lxd/firewall/firewall_interface.go @@ -13,7 +13,7 @@ type Firewall interface { Compat() (bool, error) NetworkSetup(networkName string, opts drivers.Opts) error - NetworkClear(networkName string, ipVersion uint) error + NetworkClear(networkName string, delete bool, ipVersions []uint) error InstanceSetupBridgeFilter(projectName string, instanceName string, deviceName string, parentName string, hostName string, hwAddr string, IPv4 net.IP, IPv6 net.IP) error InstanceClearBridgeFilter(projectName string, instanceName string, deviceName string, parentName string, hostName string, hwAddr string, IPv4 net.IP, IPv6 net.IP) error
lxd/firewall/firewall/interface: Adds delete and ipVersions slice args to NetworkClear So that one call to NetworkClear can clear all rules as needed, and we can indicate if network-specific chains need to be deleted.
lxc_lxd
train
go
4334fa7b99cc6007c055df123adc52fd5ae2f1f6
diff --git a/packages/dai-plugin-scd/test/QueryApi.spec.js b/packages/dai-plugin-scd/test/QueryApi.spec.js index <HASH>..<HASH> 100644 --- a/packages/dai-plugin-scd/test/QueryApi.spec.js +++ b/packages/dai-plugin-scd/test/QueryApi.spec.js @@ -1,9 +1,9 @@ import QueryApi from '../src/QueryApiScd'; -test('getCdpIdsForOwner on kovan', async () => { - const q = new QueryApi('kovan'); +test('getCdpIdsForOwner on mainnet', async () => { + const q = new QueryApi('mainnet'); const ids = await q.getCdpIdsForOwner( - '0x90d01f84f8db06d9af09054fe06fb69c1f8ee9e9' + '0xa464c0873368367778f2981eA1e65E5DC646bb9e' ); - expect(ids).toEqual([4756, 4751, 1821]); + expect(ids).toEqual([30]); });
update scd query api test now that sai-kovan api has been shut down
makerdao_dai.js
train
js
bf11eb637e64be1ba806df764af1c24294dd59ad
diff --git a/es/ae/aens.js b/es/ae/aens.js index <HASH>..<HASH> 100644 --- a/es/ae/aens.js +++ b/es/ae/aens.js @@ -114,7 +114,7 @@ async function query (name, opt = {}) { const nameId = o.id return Object.freeze(Object.assign(o, { - pointers: o.pointers || {}, + pointers: o.pointers || [], update: async (target, options) => { return { ...(await this.aensUpdate(nameId, target, R.merge(opt, options))),
aensQuery: Fix default value of pointers field (#<I>)
aeternity_aepp-sdk-js
train
js
5bf4e8619859c66d8484fb058f89e4373df45114
diff --git a/Kwf/User/Row.php b/Kwf/User/Row.php index <HASH>..<HASH> 100644 --- a/Kwf/User/Row.php +++ b/Kwf/User/Row.php @@ -108,6 +108,11 @@ class Kwf_User_Row extends Kwf_Model_RowCache_Row throw new Kwf_Exception(); } + public function getAdditionalRoles() + { + return $this->getProxiedRow()->getAdditionalRoles(); + } + //moved to model protected final function _allowFrontendUrls() {}
added the getAdditionalRolesFunction to the User Row Controller for the User ProxyModel
koala-framework_koala-framework
train
php
2986793345ed6e9fbc4ac4f08307acb37b830d72
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open('requirements.txt') as f: setup( name='pyicloud', - version='0.5.1', + version='0.5.2', url='https://github.com/picklepete/pyicloud', description=( 'PyiCloud is a module which allows pythonistas to '
Release <I>; only for updating PyPI record.
picklepete_pyicloud
train
py
ae5dfaa756e596db18aa299f6c121070c2174ed5
diff --git a/lib/specjour/db_scrub.rb b/lib/specjour/db_scrub.rb index <HASH>..<HASH> 100644 --- a/lib/specjour/db_scrub.rb +++ b/lib/specjour/db_scrub.rb @@ -32,6 +32,7 @@ module Specjour def connect_to_database ActiveRecord::Base.remove_connection + ActiveRecord::Base.establish_connection connection rescue # assume the database doesn't exist Rake::Task['db:create'].invoke
Set up DB config before connecting to DB
sandro_specjour
train
rb
274ff46894f01a408f32d6247690a612ef1da338
diff --git a/src/Iterator.php b/src/Iterator.php index <HASH>..<HASH> 100644 --- a/src/Iterator.php +++ b/src/Iterator.php @@ -11,7 +11,5 @@ class Iterator /** * */ - use Config\Count; - use Config\Iterator; use Config\ModelObject; }
model object contains count and iterator
mvc5_mvc5
train
php
a16a6cf01b4927e4912fb0234b27cdd85a24d6b9
diff --git a/trimesh/base.py b/trimesh/base.py index <HASH>..<HASH> 100644 --- a/trimesh/base.py +++ b/trimesh/base.py @@ -2049,8 +2049,8 @@ class Trimesh(Geometry): plane_normal, **kwargs): """ - Returns another mesh that is the current mesh - sliced by the plane defined by origin and normal. + Slice the mesh with a plane, returning a new mesh that is the + portion of the original mesh to the positive normal side of the plane Parameters ------------ @@ -2062,7 +2062,8 @@ class Trimesh(Geometry): Returns --------- new_mesh: trimesh.Trimesh or None - Subset of current mesh sliced by plane + Subset of current mesh that intersects the half plane + to the positive normal side of the plane """ # return a new mesh
Clarify comment for slice_plane
mikedh_trimesh
train
py
6a2a93f986bce4c4f5256d1c2f2a118e7b3264d2
diff --git a/collections_.py b/collections_.py index <HASH>..<HASH> 100644 --- a/collections_.py +++ b/collections_.py @@ -3,7 +3,7 @@ # # Copyright © 2009 Michael Lenzen <m.lenzen@gmail.com> # -_version = '0.1.1' +_version = '0.1.2' __all__ = ['collection', 'Collection', 'Mutable', 'set', 'frozenset', 'setlist', 'frozensetlist', 'bag', 'frozenbag']
Incremented to version <I>
mlenzen_collections-extended
train
py
abae21fe57bbddb0b5b3383acff205fe0eb666ce
diff --git a/lib/file_templater/options_handler.rb b/lib/file_templater/options_handler.rb index <HASH>..<HASH> 100644 --- a/lib/file_templater/options_handler.rb +++ b/lib/file_templater/options_handler.rb @@ -52,9 +52,10 @@ module FileTemplater o.separator "" o.separator "Common options:" - o.on_tail("--verbose", "Run verbosely") do |v| - @verbose = true - end + o.on_tail("-v", "--version", "Display the version") do + puts VERSION + exit + end o.on_tail("-h", "--help", "Show this message") do puts o
Remove verbose command, add version command The verbose command may be added later.
Sammidysam_file_templater
train
rb
6c83ac32657b0fedf935ff7ad42e5a5399704509
diff --git a/tests/ASN1/Universal/IntegerTest.php b/tests/ASN1/Universal/IntegerTest.php index <HASH>..<HASH> 100644 --- a/tests/ASN1/Universal/IntegerTest.php +++ b/tests/ASN1/Universal/IntegerTest.php @@ -30,6 +30,14 @@ class IntegerTest extends ASN1TestCase $this->assertEquals(chr(Identifier::INTEGER), $object->getIdentifier()); } + /** + * @expectedException \Exception + */ + public function testCreateInstanceCanFail() + { + new Integer('a'); + } + public function testContent() { $object = new Integer(1234);
Test case where Integer can throw an exception, if the integer is invalid
fgrosse_PHPASN1
train
php
e113ec7592ee4df54c1375820ee17d1a3e95f484
diff --git a/salt/modules/npm.py b/salt/modules/npm.py index <HASH>..<HASH> 100644 --- a/salt/modules/npm.py +++ b/salt/modules/npm.py @@ -129,8 +129,8 @@ def install(pkg=None, cmd = ['npm', 'install'] if silent: - cmd.append(['--silent']) - cmd.append(['--json']) + cmd.append('--silent') + cmd.append('--json') if dir is None: cmd.append(' --global')
Adding ability to disable npm install silent flag
saltstack_salt
train
py
247bcf12b3cc88401111c81c60db8079b3939673
diff --git a/mysite/settings.py b/mysite/settings.py index <HASH>..<HASH> 100644 --- a/mysite/settings.py +++ b/mysite/settings.py @@ -73,11 +73,6 @@ STATICFILES_DIRS = ( ) SITE_ID = 1 -# For filer's Django 1.7 compatibility -MIGRATION_MODULES = { - 'filer': 'filer.migrations_django', -} - # For easy_thumbnails to support retina displays (recent MacBooks, iOS) THUMBNAIL_HIGH_RESOLUTION = True THUMBNAIL_QUALITY = 95 @@ -213,5 +208,6 @@ MIGRATION_MODULES = { 'djangocms_link': 'djangocms_link.migrations_django', 'djangocms_picture': 'djangocms_picture.migrations_django', 'djangocms_teaser': 'djangocms_teaser.migrations_django', - 'djangocms_video': 'djangocms_video.migrations_django' + 'djangocms_video': 'djangocms_video.migrations_django', + 'filer': 'filer.migrations_django', }
Add filer migrations in the correct place for Django <I>
mfcovington_djangocms-lab-members
train
py
e7c210e4cf59c2848430a8dbf796939a02c11276
diff --git a/salt/modules/network.py b/salt/modules/network.py index <HASH>..<HASH> 100644 --- a/salt/modules/network.py +++ b/salt/modules/network.py @@ -418,7 +418,12 @@ def arp(): comps = line.split() if len(comps) < 4: continue - ret[comps[3]] = comps[1].strip('(').strip(')') + if not __grains__['kernel'] == 'OpenBSD': + ret[comps[3]] = comps[1].strip('(').strip(')') + else: + if comps[0] == 'Host' or comps[1] == '(incomplete)': + continue + ret[comps[1]] = comps[0] return ret @@ -611,6 +616,9 @@ def mod_hostname(hostname): elif __grains__['os_family'] == 'Debian': with salt.utils.fopen('/etc/hostname', 'w') as fh: fh.write(hostname + '\n') + elif __grains__['os_family'] == 'OpenBSD': + with salt.utils.fopen('/etc/myname', 'w') as fh: + fh.write(hostname + '\n') return True
network: fix mod_hostname() and arp() to work on OpenBSD. arp(8) output has recently changed on OpenBSD and the hostname is set under /etc/myname.
saltstack_salt
train
py
65d089a17160410dfe005690a3e0f05d817f50b8
diff --git a/source/classes/TextDatasource.js b/source/classes/TextDatasource.js index <HASH>..<HASH> 100644 --- a/source/classes/TextDatasource.js +++ b/source/classes/TextDatasource.js @@ -95,6 +95,7 @@ class TextDatasource { .then(function(history) { var archive = new Archive(), westley = archive._getWestley(); + westley.clear(); history.forEach(westley.execute.bind(westley)); return archive; });
Fix Archive not being cleared in TextDatasource
buttercup_buttercup-core
train
js
4152b7569138760254314e7a3c7551720fe70b8e
diff --git a/lib/assets/jzip/rich/cms/editor.js b/lib/assets/jzip/rich/cms/editor.js index <HASH>..<HASH> 100644 --- a/lib/assets/jzip/rich/cms/editor.js +++ b/lib/assets/jzip/rich/cms/editor.js @@ -53,12 +53,11 @@ Rich.Cms.Editor = (function() { var text = content_item.is("textarea") || content_item.hasClass("block"); var attrs = content_item.get(0).attributes; - - var match = $.grep($.makeArray(editable_content), function(hash) { - return content_item.is($.keys(hash)[0]); + + var selector = $.grep($.keys(editable_content), function(s) { + return content_item.is(s); })[0]; - var selector = $.keys(match)[0]; - var specs = $.values(match)[0]; + var specs = editable_content[selector]; label.html($.map(specs.keys, function(key) { return content_item.attr(key); }).join(", "));
Deriving the CMS content (to edit) the correct way within Rich.Cms.Editor
archan937_rich_cms
train
js
fdb9d519b5d42e62504104aade73dbfc37b3473c
diff --git a/src/Offer/OfferEditingServiceInterface.php b/src/Offer/OfferEditingServiceInterface.php index <HASH>..<HASH> 100644 --- a/src/Offer/OfferEditingServiceInterface.php +++ b/src/Offer/OfferEditingServiceInterface.php @@ -132,4 +132,18 @@ interface OfferEditingServiceInterface * @param PriceInfo $priceInfo */ public function updatePriceInfo($id, PriceInfo $priceInfo); + + /** + * @param string $id + * @param StringLiteral $typeId + * @return string + */ + public function updateType($id, StringLiteral $typeId); + + /** + * @param string $id + * @param StringLiteral $themeId + * @return string + */ + public function updateTheme($id, StringLiteral $themeId); }
III-<I>: Add theme and type update to offer editor interface
cultuurnet_udb3-php
train
php
73211d4ba8e2ea732ddf0d7494767f158b54c45d
diff --git a/ftr/extractor.py b/ftr/extractor.py index <HASH>..<HASH> 100644 --- a/ftr/extractor.py +++ b/ftr/extractor.py @@ -458,11 +458,26 @@ class ContentExtractor(object): new_tree = etree.parse( StringIO(pruned_string), self.parser) + failed = False + try: body.append( new_tree.xpath('//html/body/div/div')[0] ) except IndexError: + + if 'id="readabilityBody"' in pruned_string: + try: + body.append( + new_tree.xpath('//body') + ) + except: + failed = True + + else: + failed = True + + if failed: LOGGER.error(u'Pruning this item did not ' u'work:\n\n%s\n\nWe got: “%s” ' u'and skipped it.',
Handle pruned body parts better.
1flow_python-ftr
train
py
08f7193b6b155b4f93a367711a011fd3a4f35f82
diff --git a/src/TappableMixin.js b/src/TappableMixin.js index <HASH>..<HASH> 100644 --- a/src/TappableMixin.js +++ b/src/TappableMixin.js @@ -267,7 +267,6 @@ var Mixin = { this.processEvent(event); this.props.onKeyUp && this.props.onKeyUp(event); this.props.onTap && this.props.onTap(event); - this._keyDown = false; this.cancelPressDetection(); this.setState({ @@ -278,7 +277,7 @@ var Mixin = { onKeyDown: function (event) { if (this.props.onKeyDown && this.props.onKeyDown(event) === false) return; if (event.which !== SPACE_KEY && event.which !== ENTER_KEY) return; - + if (this._keyDown) return; this.initPressDetection(event, this.endKeyEvent); this.processEvent(event); this._keyDown = true;
Bailing from onKeyDown handler when key is already down, ref #<I>
JedWatson_react-tappable
train
js
0bbb5998c974bd6416372700ea5e28176338783d
diff --git a/buffalo/cmd/generate/task.go b/buffalo/cmd/generate/task.go index <HASH>..<HASH> 100644 --- a/buffalo/cmd/generate/task.go +++ b/buffalo/cmd/generate/task.go @@ -14,7 +14,7 @@ import ( //TaskCmd is the command called with the generate grift cli. var TaskCmd = &cobra.Command{ Use: "task [name]", - Aliases: []string{"task", "g"}, + Aliases: []string{"t", "grift"}, Short: "Generates a grift task", RunE: func(cmd *cobra.Command, args []string) error {
changed some aliases on the task generator
gobuffalo_buffalo
train
go
f3d00e2e841791527d2ebeef596491515643110a
diff --git a/dev/com.ibm.ws.security.wim.core_fat/fat/src/com/ibm/ws/security/wim/core/fat/DynamicUpdateTest.java b/dev/com.ibm.ws.security.wim.core_fat/fat/src/com/ibm/ws/security/wim/core/fat/DynamicUpdateTest.java index <HASH>..<HASH> 100755 --- a/dev/com.ibm.ws.security.wim.core_fat/fat/src/com/ibm/ws/security/wim/core/fat/DynamicUpdateTest.java +++ b/dev/com.ibm.ws.security.wim.core_fat/fat/src/com/ibm/ws/security/wim/core/fat/DynamicUpdateTest.java @@ -98,7 +98,7 @@ public class DynamicUpdateTest { Log.info(c, "tearDown", "Stopping the server..."); try { - server.stopServer("CWIML1018E", "CWIML4538E"); + server.stopServer("CWIML1018E", "CWIML4538E", "CWWKG0027W"); } finally { server.removeInstalledAppForValidation("userRegistry"); server.deleteFileFromLibertyInstallRoot("lib/features/internalfeatures/securitylibertyinternals-1.0.mf");
Issue <I>: Ignore CWWKG<I>W config update on DynamicUpdateTest
OpenLiberty_open-liberty
train
java
4f3abd849b7691326c6bdd7fdf88bb135dc6c391
diff --git a/tests/test-valve.js b/tests/test-valve.js index <HASH>..<HASH> 100644 --- a/tests/test-valve.js +++ b/tests/test-valve.js @@ -2072,7 +2072,7 @@ exports['test_UUID'] = function(test, assert) { assert.ifError(err); assert.deepEqual(cleaned, pos, 'isUUID test'); }); - callback(null, 'two'); + callback(null, 'one'); }, function(callback) {
test-valve.js: fixed a copy-paste mistake wasn't major, just ugly
racker_node-swiz
train
js
db3296047ef08aa82f67b4433ee9b88c8001bac8
diff --git a/tests/unit/system/http-request-test.js b/tests/unit/system/http-request-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/system/http-request-test.js +++ b/tests/unit/system/http-request-test.js @@ -149,6 +149,18 @@ test('successful send with a text/xml response', function (assert) { }); }); +test(`succesful open with 'withCredentials: true'`, function (assert) { + this.subject = new HttpRequest({withCredentials: true}); + this.subject.open('POST', 'http://emberjs.com'); + + assert.equal(this.request.withCredentials, true); +}); + +test(`confirm withCredentials: undefined by default`, function (assert) { + this.subject.open('POST', 'http://emberjs.com'); + assert.equal(this.request.withCredentials, undefined); +}); + skip('onprogress', function () { });
Add basic tests for withCredentials functionality
adopted-ember-addons_ember-file-upload
train
js
1ec95f3657bd209ceef179584759adc13640a306
diff --git a/pgcatalog/types.go b/pgcatalog/types.go index <HASH>..<HASH> 100644 --- a/pgcatalog/types.go +++ b/pgcatalog/types.go @@ -39,6 +39,7 @@ type Oid struct{} type Oidvector struct{} type Opaque struct{} type Path struct{} +type PgDdlCommand struct{} type PgLsn struct{} type PgNodeTree struct{} type Point struct{} @@ -48,16 +49,19 @@ type Refcursor struct{} type Regclass struct{} type Regconfig struct{} type Regdictionary struct{} +type Regnamespace struct{} type Regoperator struct{} type Regoper struct{} type Regprocedure struct{} type Regproc struct{} +type Regrole struct{} type Regtype struct{} type Reltime struct{} type Smgr struct{} type Tid struct{} type Tinterval struct{} type Trigger struct{} +type TsmHandler struct{} type Tsquery struct{} type Tsrange struct{} type Tstzrange struct{}
Adding types introduced in postgresql-<I> to pgcatalog
xo_xo
train
go
2a16ab86c7e6e803575f54e9d3f3f8232eb08753
diff --git a/www/src/components/PropTable.js b/www/src/components/PropTable.js index <HASH>..<HASH> 100644 --- a/www/src/components/PropTable.js +++ b/www/src/components/PropTable.js @@ -1,6 +1,6 @@ import styled from 'astroturf'; import { graphql } from 'gatsby'; -import capitalize from 'lodash/capitalize'; +import upperFirst from 'lodash/upperFirst'; import sortBy from 'lodash/sortBy'; import PropTypes from 'prop-types'; import * as React from 'react'; @@ -150,7 +150,7 @@ class PropTable extends React.Component { ) : ( <span> controlled by: <Code>{controllable}</Code>, initial prop:{' '} - <Code>{`default${capitalize(propName)}`}</Code> + <Code>{`default${upperFirst(propName)}`}</Code> </span> );
docs: replace lodash capitalize with upperFirst in PropTable (#<I>)
react-bootstrap_react-bootstrap
train
js
5b7c943299c9c5aba5ab9782078cb5a3f3974ba2
diff --git a/salt/cli/__init__.py b/salt/cli/__init__.py index <HASH>..<HASH> 100644 --- a/salt/cli/__init__.py +++ b/salt/cli/__init__.py @@ -308,6 +308,7 @@ class SaltCMD(object): self._output_ret(ret, out) elif self.opts['fun'] == 'sys.doc': ret = {} + out = '' for full_ret in local.cmd_cli(*args): ret_, out = self._format_ret(full_ret) ret.update(ret_)
Fix #<I>, define out to ensure no unbound vars. When there are no minions to check for docs, out will be undefined.
saltstack_salt
train
py
ff6c6867b4f24500b3d585e3f62d584d9d61b114
diff --git a/tensorflow_probability/python/distributions/variational_gaussian_process.py b/tensorflow_probability/python/distributions/variational_gaussian_process.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/distributions/variational_gaussian_process.py +++ b/tensorflow_probability/python/distributions/variational_gaussian_process.py @@ -57,7 +57,7 @@ def _solve_cholesky_factored_system_vec(cholesky_factor, rhs, name=None): rhs = tf.convert_to_tensor(value=rhs, name='rhs') lin_op = tf.linalg.LinearOperatorLowerTriangular( cholesky_factor, name=scope) - return lin_op.solvevec(lin_op.solvevec(rhs)) + return lin_op.solvevec(lin_op.solvevec(rhs), adjoint=True) class VariationalGaussianProcess(
Fix bug in VGP solve_cholesky_factored_system_vec Should have been an adjoint on one of the solves PiperOrigin-RevId: <I>
tensorflow_probability
train
py
eb5601b0a5a88824a2598956f96e06e7f2422bce
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ extras["mecab"] = ["mecab-python3"] extras["sklearn"] = ["scikit-learn"] extras["tf"] = ["tensorflow"] extras["tf-cpu"] = ["tensorflow-cpu"] -extras["torch"] = ["torch"] +extras["torch"] = ["torch==1.4.0"] extras["serving"] = ["pydantic", "uvicorn", "fastapi", "starlette"] extras["all"] = extras["serving"] + ["tensorflow", "torch"]
[ci] Pin torch version while we update
huggingface_pytorch-pretrained-BERT
train
py
337d044c353d214e9ff01ee5274985a752eeface
diff --git a/lib/shell_mock/call_verifier.rb b/lib/shell_mock/call_verifier.rb index <HASH>..<HASH> 100644 --- a/lib/shell_mock/call_verifier.rb +++ b/lib/shell_mock/call_verifier.rb @@ -31,23 +31,23 @@ module ShellMock times(0) end - def matches?(actual) - @actual = actual + def matches?(command_stub) + @command_stub = command_stub - condition.call(actual.calls) + condition.call(command_stub.calls) end def failure_message - "#{actual.command} was expected." + "#{command_stub.command} was expected." end def failure_message_when_negated - "#{actual.command} was not expected." + "#{command_stub.command} was not expected." end private - attr_reader :actual, :condition + attr_reader :command_stub, :condition def match_calls_when(&blk) @condition = blk
changing actual to a domain term made the class easier to understand
yarmiganosca_shell_mock
train
rb
5964a65c91da8efafb9a6f683eda6dbcd7499b5d
diff --git a/qds_sdk/commands.py b/qds_sdk/commands.py index <HASH>..<HASH> 100644 --- a/qds_sdk/commands.py +++ b/qds_sdk/commands.py @@ -375,7 +375,7 @@ class ShellCommand(Command): optparser.add_option("-i", "--files", dest="files", help="List of files [optional] Format : file1,file2 (files in s3 bucket) These files will be copied to the working directory where the command is executed") - optparser.add_option("-a", "--archive", dest="archive", + optparser.add_option("-a", "--archives", dest="archives", help="List of archives [optional] Format : archive1,archive2 (archives in s3 bucket) These are unarchived in the working directory where the command is executed") optparser.add_option("--cluster-label", dest="label",
The API accepts 'archives' and not 'archive'. This change will break stuff for people who were using the --archive option. But I think that's okay because it was already broken - only earlier they didn't know about it (because the API just ignores bad parameters.)
qubole_qds-sdk-py
train
py
1e03435283df47c97e88031a6f2ce7f821914e6d
diff --git a/mangopay/resources.py b/mangopay/resources.py index <HASH>..<HASH> 100644 --- a/mangopay/resources.py +++ b/mangopay/resources.py @@ -354,6 +354,7 @@ class DirectPayIn(PayIn): secure_mode_redirect_url = CharField(api_name='SecureModeRedirectURL') secure_mode_return_url = CharField(api_name='SecureModeReturnURL') card = ForeignKeyField(Card, api_name='CardId', required=True) + secure_mode_needed = BooleanField(api_name='SecureModeNeeded') secure_mode = CharField(api_name='SecureMode', choices=constants.SECURE_MODE_CHOICES, default=constants.SECURE_MODE_CHOICES.default) diff --git a/tests/test_payins.py b/tests/test_payins.py index <HASH>..<HASH> 100644 --- a/tests/test_payins.py +++ b/tests/test_payins.py @@ -143,6 +143,7 @@ class PayInsTest(BaseTest): direct_payin.save() self.assertIsInstance(direct_payin, DirectPayIn) self.assertEqual(direct_payin.status, 'SUCCEEDED') + self.assertEqual(direct_payin.secure_mode_needed, False) self.assertEqual(direct_payin.secure_mode_return_url, None) direct_payin_params.pop('secure_mode_return_url')
Added secure mode need property into DirectPayIn class. Updated unit test.
Mangopay_mangopay2-python-sdk
train
py,py
288aaf7c8c742d945ee4d4ae0a8074f596ff1e03
diff --git a/python/sbp/client/handler.py b/python/sbp/client/handler.py index <HASH>..<HASH> 100644 --- a/python/sbp/client/handler.py +++ b/python/sbp/client/handler.py @@ -258,7 +258,7 @@ class Handler(object): payload = None def cb(sbp_msg): payload = sbp_msg.payload - self.add(cb, msg_type) + self.add_callback(cb, msg_type) event.wait(timeout) self.remove(cb, msg_type) return payload
Fix add function call which should be add_callback
swift-nav_libsbp
train
py
fa80ae5a0a66c020b3694492bac3f72659863a3b
diff --git a/components/menu/__tests__/index.test.js b/components/menu/__tests__/index.test.js index <HASH>..<HASH> 100644 --- a/components/menu/__tests__/index.test.js +++ b/components/menu/__tests__/index.test.js @@ -118,6 +118,23 @@ describe('Menu', () => { expect(wrapper.find('.ant-menu-submenu-selected').length).toBe(1); }); + it('forceSubMenuRender', () => { + const wrapper = mount( + <Menu mode="horizontal"> + <SubMenu key="1" title="submenu1"> + <Menu.Item key="1-1"> + <span className="bamboo" /> + </Menu.Item> + </SubMenu> + </Menu>, + ); + + expect(wrapper.find('.bamboo').hostNodes()).toHaveLength(0); + + wrapper.setProps({ forceSubMenuRender: true }); + expect(wrapper.find('.bamboo').hostNodes()).toHaveLength(1); + }); + it('should accept defaultOpenKeys in mode horizontal', () => { const wrapper = mount( <Menu defaultOpenKeys={['1']} mode="horizontal">
test: more test case (#<I>)
ant-design_ant-design
train
js
886e64610e452284fc03a2cd0919f7d948591cff
diff --git a/iotdb.js b/iotdb.js index <HASH>..<HASH> 100644 --- a/iotdb.js +++ b/iotdb.js @@ -371,15 +371,17 @@ exports.cookbook = cookbook; /** * Users - * we really don't have anything here except a function - * to return the "owner" - basically the user the - * system has authorized itself as. We may do - * more exciting things in the future + * Sorry no real docs. By default everything is open. + * HomeStar changes these to do user authentication. + * Transporters are the biggest clients of this interface */ exports.users = { owner: function() { return null; }, + authorize: function(authd, callback) { + return callback(null, true); + }, }; /** diff --git a/modules.js b/modules.js index <HASH>..<HASH> 100644 --- a/modules.js +++ b/modules.js @@ -200,6 +200,7 @@ Modules.prototype._load_setup = function () { exception: x, cause: "likely the module has a bad setup function", }, "unexpected exception running module.setup"); + process.exit(1); } } };
bring in the concept (lightly!) of users
dpjanes_node-iotdb
train
js,js
ad3c18272b845f3a832b32921c1dab54d69d588e
diff --git a/src/test/java/org/hobsoft/hamcrest/compose/ConjunctionMatcher.java b/src/test/java/org/hobsoft/hamcrest/compose/ConjunctionMatcher.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/hobsoft/hamcrest/compose/ConjunctionMatcher.java +++ b/src/test/java/org/hobsoft/hamcrest/compose/ConjunctionMatcher.java @@ -21,6 +21,7 @@ import org.hamcrest.Matcher; import org.hamcrest.TypeSafeDiagnosingMatcher; import static java.util.Collections.singletonList; +import static java.util.Collections.unmodifiableList; /** * @@ -36,7 +37,7 @@ public class ConjunctionMatcher<T> extends TypeSafeDiagnosingMatcher<T> public ConjunctionMatcher(List<Matcher<T>> matchers) { - this.matchers = new ArrayList<>(matchers); + this.matchers = unmodifiableList(new ArrayList<>(matchers)); } public static <T> ConjunctionMatcher<T> compose(Matcher<T> matcher)
Ensured ConjunctionMatcher submatcher list is immutable
markhobson_hamcrest-compose
train
java
ab0a58c02629680b3dc77aaed723077410c23bdf
diff --git a/holoviews/core/element.py b/holoviews/core/element.py index <HASH>..<HASH> 100644 --- a/holoviews/core/element.py +++ b/holoviews/core/element.py @@ -239,6 +239,9 @@ class NdElement(Element, NdMapping): def _add_item(self, key, value, sort=True): value = (value,) if np.isscalar(value) else tuple(value) + if len(value) != len(self.vdims): + raise ValueError("%s values must match value dimensions" + % type(self).__name__) super(NdElement, self)._add_item(key, value, sort)
Added value length check to NdElement
pyviz_holoviews
train
py
4f82b50d390a20f1127559ce3a2c068e6a3ab7a2
diff --git a/src/commands/watch.js b/src/commands/watch.js index <HASH>..<HASH> 100644 --- a/src/commands/watch.js +++ b/src/commands/watch.js @@ -43,6 +43,8 @@ export default asyncCommand({ async handler(argv) { argv.production = false; + if (process.env.HTTPS) argv.https = true; + if (argv.https) { let ssl = await getSslCert(); if (!ssl) {
handle watch command to look for HTTPS
developit_preact-cli
train
js
b0282fe40571f1b6c5f8052db4cea8ce7f17b6a9
diff --git a/lib/rules/rules.js b/lib/rules/rules.js index <HASH>..<HASH> 100644 --- a/lib/rules/rules.js +++ b/lib/rules/rules.js @@ -1509,6 +1509,9 @@ function matchFilter(url, filter, req) { if (filter.from === 'httpsServer') { return filter.not ? !req.fromHttpsServer : req.fromHttpsServer; } + if (filter.from === 'httpsPort') { + return filter.not ? !req.isHttpsServer : req.isHttpsServer; + } return false; } if (filterProp(req.method, filter.method, filter.mPattern)) {
refactor: from=httpsPort
avwo_whistle
train
js
0e84d785082c6e3a7974460452b7265d2317144d
diff --git a/esprima.js b/esprima.js index <HASH>..<HASH> 100644 --- a/esprima.js +++ b/esprima.js @@ -250,13 +250,34 @@ parseStatement: true, parseSourceElement: true */ // 7.6.1.2 Future Reserved Words function isFutureReservedWord(id) { - return ['class', 'enum', 'export', 'extends', 'import', 'super']. - indexOf(id) >= 0; + switch (id) { + case 'class': + case 'enum': + case 'export': + case 'extends': + case 'import': + case 'super': + return true; + default: + return false; + } } function isStrictModeReservedWord(id) { - return ['implements', 'interface', 'package', 'private', 'protected', - 'public', 'static', 'yield', 'let'].indexOf(id) >= 0; + switch (id) { + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'yield': + case 'let': + return true; + default: + return false; + } } function isRestrictedWord(id) {
Keyword detection: bring back IE support. We can't use Array#indexOf there. <URL>
jscs-dev_esprima-harmony
train
js
900293b40d66df20ac44d1b215105d956215c536
diff --git a/housekeeper/store/cli.py b/housekeeper/store/cli.py index <HASH>..<HASH> 100644 --- a/housekeeper/store/cli.py +++ b/housekeeper/store/cli.py @@ -15,7 +15,7 @@ log = logging.getLogger(__name__) @click.option('-c', '--case') @click.option('-s', '--sample') @click.option('-i', '--infer-case', is_flag=True) -@click.option('-c', '--category') +@click.option('-t', '--category') @click.pass_context def get(context, case, sample, infer_case, category): """Ask Housekeeper for a file."""
avoid using same short option in CLI
Clinical-Genomics_housekeeper
train
py
64c834bbab63142b099cc46a48a1585bdfab3b20
diff --git a/ast/parser_internal.go b/ast/parser_internal.go index <HASH>..<HASH> 100644 --- a/ast/parser_internal.go +++ b/ast/parser_internal.go @@ -509,6 +509,19 @@ func makeNumber(loc *Location, text interface{}) (interface{}, error) { // possible. panic("illegal value") } + + // Put limit on size of exponent to prevent non-linear cost of String() + // function on big.Float from causing denial of service: https://github.com/golang/go/issues/11068 + // + // n == sign * mantissa * 2^exp + // 0.5 <= mantissa < 1.0 + // + // The limit is arbitrary. + exp := f.MantExp(nil) + if exp > 1e5 || exp < -1e5 { + return nil, fmt.Errorf("number too big") + } + return NumberTerm(json.Number(f.String())).SetLocation(loc), nil }
Limit size of exponent component in numbers
open-policy-agent_opa
train
go
356a270dc29af441a58bc705b2f70774227ae674
diff --git a/seaglass/trunk/seaglass/src/main/java/com/seaglass/SeaGlassComboPopup.java b/seaglass/trunk/seaglass/src/main/java/com/seaglass/SeaGlassComboPopup.java index <HASH>..<HASH> 100644 --- a/seaglass/trunk/seaglass/src/main/java/com/seaglass/SeaGlassComboPopup.java +++ b/seaglass/trunk/seaglass/src/main/java/com/seaglass/SeaGlassComboPopup.java @@ -152,7 +152,7 @@ class SeaGlassComboPopup extends BasicComboPopup { py -= margin.bottom; } } else { - int yOffset = 3 - margin.top; + int yOffset = - margin.top; int selectedIndex = comboBox.getSelectedIndex(); if (selectedIndex <= 0) { py = -yOffset;
Removed size overcorrection.
khuxtable_seaglass
train
java
70266d019f078b6c9dc9f8715350dc0f0eec3a2b
diff --git a/spec/operators/zipAll-spec.js b/spec/operators/zipAll-spec.js index <HASH>..<HASH> 100644 --- a/spec/operators/zipAll-spec.js +++ b/spec/operators/zipAll-spec.js @@ -678,4 +678,23 @@ describe('Observable.prototype.zipAll', function () { expect(vals).toDeepEqual(r[i++]); }, null, done); }); -}); \ No newline at end of file + + it('should not break unsubscription chain when unsubscribed explicitly', function () { + var a = hot('---1---2---3---|'); + var unsub = ' !'; + var asubs = '^ !'; + var b = hot('--4--5--6--7--8--|'); + var bsubs = '^ !'; + var expected = '---x---y--'; + var values = { x: ['1', '4'], y: ['2', '5']}; + + var r = Observable.of(a, b) + .mergeMap(function (x) { return Observable.of(x); }) + .zipAll() + .mergeMap(function (x) { return Observable.of(x); }); + + expectObservable(r, unsub).toBe(expected, values); + expectSubscriptions(a.subscriptions).toBe(asubs); + expectSubscriptions(b.subscriptions).toBe(bsubs); + }); +});
test(zipAll): add test against breaking unsubscription chain Relates to #<I>.
ReactiveX_rxjs
train
js
c5bb70296d220250d102ee0e4ebefd47d88ade0b
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -6,6 +6,7 @@ if ( !$_tests_dir ) $_tests_dir = '/tmp/wordpress-tests-lib'; require_once $_tests_dir . '/includes/functions.php'; function _manually_load_plugin() { + require dirname( __FILE__ ) . '/../vendor/autoload.php'; require dirname( __FILE__ ) . '/../themosis.php'; } tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
Add composer autoloading on phpunit bootstrap.
themosis_framework
train
php
c6f96e91fa19650417ef9196500efd3baf0d7f13
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,10 @@ -require 'simplecov' -require 'coveralls' -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter -] -if RUBY_VERSION >= '1.9' +if RUBY_VERSION >= '1.9' # dont include <1.9 otherwise this breaks jruby-18mode + require 'coveralls' + require 'simplecov' + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ] SimpleCov.start do add_group 'Libraries', 'lib' add_group 'Spec', 'spec'
Fix issue with jruby <I> mode
richhollis_diversion
train
rb
e4740ffa789aa8a819c82b0639f7d98b68c84d4e
diff --git a/examples/example5-allfiles.py b/examples/example5-allfiles.py index <HASH>..<HASH> 100644 --- a/examples/example5-allfiles.py +++ b/examples/example5-allfiles.py @@ -4,13 +4,13 @@ import basc_py4chan def main(): # grab the first thread on the board by checking first page - board = py8chan.Board('v') + board = basc_py4chan.Board('v') all_thread_ids = board.get_all_thread_ids() first_thread_id = all_thread_ids[0] thread = board.get_thread(first_thread_id) # display the url of every file on the first thread, even extra files in posts - for url in first_thread.files(): + for url in thread.files(): print(url) if __name__ == '__main__':
should really test examples before pushing at all
bibanon_BASC-py4chan
train
py
803a0a54a1cdf83f942065497403cada614e00e8
diff --git a/widgets/search/views/result.php b/widgets/search/views/result.php index <HASH>..<HASH> 100644 --- a/widgets/search/views/result.php +++ b/widgets/search/views/result.php @@ -38,7 +38,7 @@ $js = <<<EOT $(document).bind("pjax:timeout", rhoone.search.cancel); $(document).bind("rhoone:search_start", {pattern: pattern}, function(e) { $("#$keywordsInputId").attr("value", rhoone.search.keywords); - $("#$formId").attr("action", e.data.pattern.replace("{{%keywords}}",$("#$keywordsInputId").val())); + $("#$formId").attr("action", e.data.pattern.replace("{{%keywords}}",$("#$keywordsInputId").val()).replace(/#/g, "%23")); $("#$formId").submit(); $jsCnzz });
Update result.php Fixed a bug where the keyword contained "#" and could not pass parameters correctly.
rhoone_yii2-rhoone
train
php
1794acdfece98c8441805175aa2ff35de4e0de2d
diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index <HASH>..<HASH> 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -87,7 +87,7 @@ class TelegramClient(TelegramBareClient): # TODO JsonSession until migration is complete (by v1.0) if isinstance(session, str) or session is None: session = JsonSession.try_load_or_create_new(session) - elif not isinstance(session, Session): + elif not isinstance(session, Session) and not isinstance(session, JsonSession): raise ValueError( 'The given session must be a str or a Session instance.')
Check for isinstance(x, JsonSession) instead crashing during transition
LonamiWebs_Telethon
train
py
008d8789acc23230a0ef18ccd270819a79a5250d
diff --git a/src/SortableContainer/index.js b/src/SortableContainer/index.js index <HASH>..<HASH> 100644 --- a/src/SortableContainer/index.js +++ b/src/SortableContainer/index.js @@ -180,6 +180,15 @@ export default function sortableContainer(WrappedComponent, config = {withRef: f const containerBoundingRect = this.container.getBoundingClientRect(); const dimensions = getHelperDimensions({index, node, collection}); + /* + * Fixes a bug in Firefox where the :active state of anchor tags + * prevent subsequent 'mousemove' events from being fired + * (see https://github.com/clauderic/react-sortable-hoc/issues/118) + */ + if (e.target.tagName.toLowerCase() === 'a') { + e.preventDefault(); + } + this.node = node; this.margin = margin; this.width = dimensions.width;
Fix: Firefox bug where `a:active` prevents mousemove events from firing (#<I>)
clauderic_react-sortable-hoc
train
js
36b0117eec06c97dbfeccbb3af0d7f6e4825cc5b
diff --git a/moto/ssm/urls.py b/moto/ssm/urls.py index <HASH>..<HASH> 100644 --- a/moto/ssm/urls.py +++ b/moto/ssm/urls.py @@ -3,6 +3,7 @@ from .responses import SimpleSystemManagerResponse url_bases = [ "https?://ssm.(.+).amazonaws.com", + "https?://ssm.(.+).amazonaws.com.cn", ] url_paths = { diff --git a/tests/test_ssm/test_ssm_boto3.py b/tests/test_ssm/test_ssm_boto3.py index <HASH>..<HASH> 100644 --- a/tests/test_ssm/test_ssm_boto3.py +++ b/tests/test_ssm/test_ssm_boto3.py @@ -277,6 +277,18 @@ def test_put_parameter(): response['Parameters'][0]['Type'].should.equal('String') response['Parameters'][0]['Version'].should.equal(2) +@mock_ssm +def test_put_parameter_china(): + client = boto3.client('ssm', region_name='cn-north-1') + + response = client.put_parameter( + Name='test', + Description='A test parameter', + Value='value', + Type='String') + + response['Version'].should.equal(1) + @mock_ssm def test_get_parameter():
Updating the list of urls the SSM moto will match to include china
spulec_moto
train
py,py
cc815d85305dc0b665a2ccb42113cf7a49b1eb0a
diff --git a/website2/website/pages/en/index.js b/website2/website/pages/en/index.js index <HASH>..<HASH> 100755 --- a/website2/website/pages/en/index.js +++ b/website2/website/pages/en/index.js @@ -33,7 +33,7 @@ class HomeSplash extends React.Component { ); const Logo = props => ( - <div className="" style={{width: '750px', alignItems: 'center', margin: 'auto'}}> + <div className="" style={{width: '100%', alignItems: 'center', margin: 'auto'}}> <img src={props.img_src} /> </div> );
Updated to make site look better on mobile (#<I>)
apache_incubator-heron
train
js
504e722c16af04230554716f25fbaf9e418fd111
diff --git a/src/ViewModels/SharePopupViewModel.js b/src/ViewModels/SharePopupViewModel.js index <HASH>..<HASH> 100644 --- a/src/ViewModels/SharePopupViewModel.js +++ b/src/ViewModels/SharePopupViewModel.js @@ -19,7 +19,7 @@ var SharePopupViewModel = function(options) { knockout.track(this, ['imageUrl', 'url', 'embedCode', 'itemsSkippedBecauseTheyHaveLocalData']); // Build the share URL. - var camera = this.application.currentViewer.getCurrentExtent(); + var cameraExtent = this.application.currentViewer.getCurrentExtent(); var request = { version: '0.0.03', @@ -59,10 +59,10 @@ var SharePopupViewModel = function(options) { // Add an init source with the camera position. var camera = { - west: CesiumMath.toDegrees(camera.west), - south: CesiumMath.toDegrees(camera.south), - east: CesiumMath.toDegrees(camera.east), - north: CesiumMath.toDegrees(camera.north), + west: CesiumMath.toDegrees(cameraExtent.west), + south: CesiumMath.toDegrees(cameraExtent.south), + east: CesiumMath.toDegrees(cameraExtent.east), + north: CesiumMath.toDegrees(cameraExtent.north), }; if (defined(this.application.cesium)) {
Fix jshint warning.
TerriaJS_terriajs
train
js
54a1d5a44bac6570d825b3e8a2a0693d4455f936
diff --git a/simulator/src/test/java/com/hazelcast/simulator/protocol/ProtocolSmokeTest.java b/simulator/src/test/java/com/hazelcast/simulator/protocol/ProtocolSmokeTest.java index <HASH>..<HASH> 100644 --- a/simulator/src/test/java/com/hazelcast/simulator/protocol/ProtocolSmokeTest.java +++ b/simulator/src/test/java/com/hazelcast/simulator/protocol/ProtocolSmokeTest.java @@ -38,7 +38,7 @@ public class ProtocolSmokeTest { private static final int MAX_ADDRESS_INDEX = 5; - private static final int DEFAULT_TEST_TIMEOUT_MILLIS = NUMBER_OF_MESSAGES * 5; + private static final int DEFAULT_TEST_TIMEOUT_MILLIS = NUMBER_OF_MESSAGES * 10; private static final Logger LOGGER = Logger.getLogger(ProtocolSmokeTest.class);
Increased timeout of ProtocolSmokeTest to deal with slow CloudBees servers.
hazelcast_hazelcast-simulator
train
java
9ccaf05cc7cf3d03a935b1a1ba99b0e2b1004ac8
diff --git a/core/src/main/java/org/acegisecurity/intercept/web/SecurityEnforcementFilter.java b/core/src/main/java/org/acegisecurity/intercept/web/SecurityEnforcementFilter.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/acegisecurity/intercept/web/SecurityEnforcementFilter.java +++ b/core/src/main/java/org/acegisecurity/intercept/web/SecurityEnforcementFilter.java @@ -278,6 +278,10 @@ public class SecurityEnforcementFilter implements Filter, InitializingBean { ((HttpServletRequest) request).getSession().setAttribute(AbstractProcessingFilter.ACEGI_SECURITY_TARGET_URL_KEY, targetUrl); } + + // SEC-112: Clear the SecurityContextHolder's Authentication, as the + // existing Authentication is no longer considered valid + SecurityContextHolder.getContext().setAuthentication(null); authenticationEntryPoint.commence(request, (HttpServletResponse) fi.getResponse(), reason);
SEC-<I>: Bug when SecurityEnforcementFilter used with disabled Authentication and remember-me services.
spring-projects_spring-security
train
java
54cb4a4abc95b867edcc8d5887b4b9a0ca6e5465
diff --git a/src/Honeybadger.php b/src/Honeybadger.php index <HASH>..<HASH> 100644 --- a/src/Honeybadger.php +++ b/src/Honeybadger.php @@ -125,7 +125,7 @@ class Honeybadger implements Reporter { $this->context = new Repository; } - + /** * @return \Honeybadger\Support\Repository */
Apply fixes from StyleCI (#<I>)
honeybadger-io_honeybadger-php
train
php
4f96f61442aadb149daba2f040ff0dbdbd3ed688
diff --git a/src/leaflet.timedimension.layer.wms.js b/src/leaflet.timedimension.layer.wms.js index <HASH>..<HASH> 100644 --- a/src/leaflet.timedimension.layer.wms.js +++ b/src/leaflet.timedimension.layer.wms.js @@ -342,7 +342,7 @@ L.TimeDimension.Layer.WMS = L.TimeDimension.Layer.extend({ if ((this._timeDimension && this._updateTimeDimension) || (this._timeDimension && this._timeDimension.getAvailableTimes().length == 0)) { this._timeDimension.setAvailableTimes(this._availableTimes, this._updateTimeDimensionMode); - if (this._defaultTime > 0) { + if (this._setDefaultTime && this._defaultTime > 0) { this._timeDimension.setCurrentTime(this._defaultTime); } }
Avoid undesired time changes when capabilities are loaded
socib_Leaflet.TimeDimension
train
js
474d19e69ee98f2b357995e82efaf9c90d0ac50e
diff --git a/test/grunt.js b/test/grunt.js index <HASH>..<HASH> 100644 --- a/test/grunt.js +++ b/test/grunt.js @@ -76,8 +76,7 @@ module.exports = function (grunt) { } }, empty: { - src: 'test_files/nested_empty.zip', - // dest: 'actual/empty' + src: 'test_files/empty.zip', dest: 'actual/empty' }, 'test-zip-nested': {
Deep dived looking for EISDIR but drowing in C
twolfson_grunt-zip
train
js
e988d22b1ba049b7b96a243be49bf5ee032efa66
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ setup( 'paste.app_factory': 'main = openfisca_web_api.application:make_app', }, extras_require = { - 'dev': [ + 'paster': [ 'PasteScript', ], 'france': [
Rename extra dependency dev -> paster
openfisca_openfisca-web-api
train
py
93fc26d869ffd2b22d442ea8a91837712086b476
diff --git a/src/Symfony/Component/EventDispatcher/EventDispatcher.php b/src/Symfony/Component/EventDispatcher/EventDispatcher.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -140,13 +140,8 @@ class EventDispatcher implements EventDispatcherInterface return array(); } - $listeners = array(); - $all = $this->listeners[$name]; - krsort($all); - foreach ($all as $l) { - $listeners = array_merge($listeners, $l); - } + krsort($this->listeners[$name]); - return $listeners; + return call_user_func_array('array_merge', $this->listeners[$name]); } }
[EventDispatcher] simplified code (thanks Kris Wallsmith for the tip)
symfony_symfony
train
php
86aafa2330fd023fc5bb3da83e1fc84b265b3470
diff --git a/app/controllers/think_feel_do_dashboard/moderators_controller.rb b/app/controllers/think_feel_do_dashboard/moderators_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/think_feel_do_dashboard/moderators_controller.rb +++ b/app/controllers/think_feel_do_dashboard/moderators_controller.rb @@ -4,7 +4,7 @@ module ThinkFeelDoDashboard # Allows Coaches/Clinicians to moderate. # That is, log in as a participant class ModeratorsController < ApplicationController - before_action :authenticate_user!, :set_group + before_action :set_group # POST /coach/groups/:group_id/moderates def create diff --git a/app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb b/app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb +++ b/app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb @@ -5,7 +5,6 @@ module ThinkFeelDoDashboard # Allows for the creation, updating, and deletion of social networking # profile questions class ProfileQuestionsController < ApplicationController - before_action :authenticate_user! before_action :set_profile_question, except: [:index, :new, :create] before_action :set_group
Add General Authentication * Add `authenticate_user!` to engine application folder * Remvoe unnecessary `authentication_user!` form child controllers [#<I>]
NU-CBITS_think_feel_do_dashboard
train
rb,rb
1f2a98351deb540ef35f9087aa7ec7981cecbb8d
diff --git a/auth/controllers/Register.php b/auth/controllers/Register.php index <HASH>..<HASH> 100644 --- a/auth/controllers/Register.php +++ b/auth/controllers/Register.php @@ -23,7 +23,6 @@ class Register extends Base parent::__construct(); // -------------------------------------------------------------------------- - // Is registration enabled if (!appSetting('user_registration_enabled', 'auth')) {
Upgrade the views finder to be compatible with the new controllers naming
nails_module-auth
train
php
41aa22b00d3c2b4033263d2741c51881dfa487f1
diff --git a/admin_trees_export.php b/admin_trees_export.php index <HASH>..<HASH> 100644 --- a/admin_trees_export.php +++ b/admin_trees_export.php @@ -51,6 +51,9 @@ $export = safe_GET('export', preg_quote_array($gedcoms)); if ($export) { $ged_id = get_id_from_gedcom($export); $filename = get_site_setting('INDEX_DIRECTORY').$export; + if (substr($export, -4)!=='.ged') { + $filename.='.ged'; + } echo '<p>', htmlspecialchars(filename_decode($export)), ' => ', $filename, '</p>'; flush(); $gedout = fopen($filename.'.tmp', 'w');
add .ged to exported files when needed
fisharebest_webtrees
train
php
72b58836b0c5b121123957479fa4c74f8272e6ca
diff --git a/lib/devpipeline_core/taskqueue.py b/lib/devpipeline_core/taskqueue.py index <HASH>..<HASH> 100644 --- a/lib/devpipeline_core/taskqueue.py +++ b/lib/devpipeline_core/taskqueue.py @@ -8,14 +8,16 @@ class _TaskQueue: self._dependencies = copy.deepcopy(dependencies) self._reverse_dependencies = copy.deepcopy(reverse_dependencies) + def _get_ready_tasks(self): + next_tasks = [] + for component, dependencies in self._dependencies.items(): + if not dependencies: + next_tasks.append(component) + return next_tasks + def __iter__(self): while self._dependencies: - next_tasks = [] - - for component, dependencies in self._dependencies.items(): - if not dependencies: - next_tasks.append(component) - + next_tasks = self._get_ready_tasks() if next_tasks: yield next_tasks else:
Fix complexity issue detected by CodeClimate
dev-pipeline_dev-pipeline-core
train
py
347ed6c38afe8937fbbe19fcc06880a88e0e0530
diff --git a/satpy/writers/mitiff.py b/satpy/writers/mitiff.py index <HASH>..<HASH> 100644 --- a/satpy/writers/mitiff.py +++ b/satpy/writers/mitiff.py @@ -607,9 +607,9 @@ class MITIFFWriter(ImageWriter): chn = datasets.sel(bands=band) # Need to possible translate channels names from satpy to mitiff # Note the last index is a tuple index. - cn = cns.get(chn.attrs['prerequisites'][i][0], - chn.attrs['prerequisites'][i][0]) - data = self._calibrate_data(chn, chn.attrs['prerequisites'][i][4], + cn = cns.get(chn.attrs['prerequisites'][int(_cn) - 1][0], + chn.attrs['prerequisites'][int(_cn) - 1][0]) + data = self._calibrate_data(chn, chn.attrs['prerequisites'][int(_cn) - 1][4], self.mitiff_config[kwargs['sensor']][cn]['min-val'], self.mitiff_config[kwargs['sensor']][cn]['max-val'])
FIxed bug assuming order of channels/bands to be equal for both <I> and <I>
pytroll_satpy
train
py
e30a92a27f858aad2cc7dc149020138578d196ae
diff --git a/Backoffice/GenerateForm/Strategies/ContentListStrategy.php b/Backoffice/GenerateForm/Strategies/ContentListStrategy.php index <HASH>..<HASH> 100644 --- a/Backoffice/GenerateForm/Strategies/ContentListStrategy.php +++ b/Backoffice/GenerateForm/Strategies/ContentListStrategy.php @@ -40,7 +40,7 @@ class ContentListStrategy extends AbstractBlockStrategy array( 'div' => 'divclass', 'title' => 'titleclass', - 'ul' => 'ulclass' + 'each' => 'eachclass' ) ), ));
Modified ul to div for news listing
open-orchestra_open-orchestra-media-admin-bundle
train
php
d2c3e028a7027e0140741d505260997c654e2c7b
diff --git a/test/url_rewriting.js b/test/url_rewriting.js index <HASH>..<HASH> 100644 --- a/test/url_rewriting.js +++ b/test/url_rewriting.js @@ -7,6 +7,7 @@ var fs = require('fs'), var source = fs.readFileSync(__dirname + '/source/index.html'); var expected = fs.readFileSync(__dirname + '/expected/index.html'); +/* test("url_rewriting should support support all kinds of links", function(t) { getServers(source, function(err, servers) { function cleanup() { @@ -25,7 +26,7 @@ test("url_rewriting should support support all kinds of links", function(t) { }); }); }) - +*/ test("clustering should not break url rewriting", function(t) { getServers(source, true, function(err, servers) {
removing non-clustered test to see if it helps on Travis CI
nfriedly_node-unblocker
train
js
90df135564e64a10844a40c0f33815978c05a860
diff --git a/tests/unit/states/test_ldap.py b/tests/unit/states/test_ldap.py index <HASH>..<HASH> 100644 --- a/tests/unit/states/test_ldap.py +++ b/tests/unit/states/test_ldap.py @@ -255,18 +255,14 @@ class LDAPTestCase(TestCase, LoaderModuleMockMixin): expected_db = copy.deepcopy(init_db) for dn, attrs in add_items.items(): for attr, vals in attrs.items(): - log.debug("=== attr %s vals %s ===", attrs, vals) vals = [to_bytes(val) for val in vals] - vals.extend(old.get(dn).get(attr, OrderedSet())) + vals.extend(old.get(dn, {}).get(attr, OrderedSet())) vals.sort() if vals: - log.debug("=== vals %s is valid ===", vals) new.setdefault(dn, {})[attr] = list(OrderedSet(vals)) expected_db.setdefault(dn, {})[attr] = OrderedSet(vals) - log.debug("=== new %s ===", new) - log.debug("=== expected_db %s ===", expected_db) elif dn in expected_db: new[dn].pop(attr, None) expected_db[dn].pop(attr, None)
fixing failing ldap tests
saltstack_salt
train
py
25d5e42e8ad47e42d4825464a7e6061c13cd66f5
diff --git a/ncclient/operations/rpc.py b/ncclient/operations/rpc.py index <HASH>..<HASH> 100644 --- a/ncclient/operations/rpc.py +++ b/ncclient/operations/rpc.py @@ -296,7 +296,6 @@ class RPC(object): self._event = Event() self._device_handler = device_handler self.logger = SessionLoggerAdapter(logger, {'session': session}) - self._filter_xml = None # to be used for sax parsing def _wrap(self, subele): @@ -314,8 +313,6 @@ class RPC(object): In asynchronous mode, returns immediately, returning `self`. The :attr:`event` attribute will be set when the reply has been received (see :attr:`reply`) or an error occured (see :attr:`error`). *op* is the operation to be requested as an :class:`~xml.etree.ElementTree.Element` - - *filter_xml* input xml of type :class:`~xml.etree.ElementTree.Element` for sax parsing. """ self.logger.info('Requesting %r', self.__class__.__name__) req = self._wrap(op)
first draft of SAX parser implementation
ncclient_ncclient
train
py
39ad5e8574783dd9f32cd553a3d5854f844496c1
diff --git a/lib/chef/cookbook/gem_installer.rb b/lib/chef/cookbook/gem_installer.rb index <HASH>..<HASH> 100644 --- a/lib/chef/cookbook/gem_installer.rb +++ b/lib/chef/cookbook/gem_installer.rb @@ -53,9 +53,7 @@ class Chef tf.puts "gem #{args.map { |i| "'#{i}'" }.join(' ')}" end tf.close - Dir.chdir(dir) do - so = shell_out!("bundle install") - end + so = shell_out!("bundle install", pwd: dir) end end rescue Exception => e
tighten up the chdir logic
chef_chef
train
rb
5fc49f5f60bb80dc79b839096c6d7fe14cd23eb5
diff --git a/lib/attr_encrypted.rb b/lib/attr_encrypted.rb index <HASH>..<HASH> 100644 --- a/lib/attr_encrypted.rb +++ b/lib/attr_encrypted.rb @@ -303,10 +303,7 @@ module AttrEncrypted end end -# I say this super rarely, but the following line is really, really dumb. Also ugly. -# Please figure out another way to make this work. Polluting every Ruby object everywhere with these methods -# is super bad and leads to really weird shit happening, not to mention that every single missing method error -# now says it's coming from "method_missing in lib/attr_encrypted.rb". +# Can the following line be done in any other way? Polluting the global Object namespace is unnecessary (and smelly!) # Object.extend AttrEncrypted Dir[File.join(File.dirname(__FILE__), 'attr_encrypted', 'adapters', '*.rb')].each { |adapter| require adapter }
Update attr_encrypted.rb Toned down my wording.
attr-encrypted_attr_encrypted
train
rb
67f04c1257d5c74eee713ed7106df327c75da41c
diff --git a/doc/make.py b/doc/make.py index <HASH>..<HASH> 100755 --- a/doc/make.py +++ b/doc/make.py @@ -321,7 +321,7 @@ def generate_index(api=True, single=False, **kwds): with open("source/index.rst.template") as f: t = Template(f.read()) - with open("source/index.rst","wb") as f: + with open("source/index.rst","w") as f: f.write(t.render(api=api,single=single,**kwds)) import argparse
BLD/DOC: make.py open file as 'w' rather then 'wb'
pandas-dev_pandas
train
py
8533918acea9a49a89ff374c0d69dbbc38a250ae
diff --git a/path.py b/path.py index <HASH>..<HASH> 100644 --- a/path.py +++ b/path.py @@ -63,10 +63,9 @@ except NameError: basestring = (str, unicode) # Universal newline support -_textmode = 'r' -if hasattr(file, 'newlines'): - _textmode = 'U' - +_textmode = 'U' +if hasattr(__builtins__, 'file') and not hasattr(file, 'newlines'): + _textmode = 'r' class TreeWalkWarning(Warning): pass
Fixed NameError with 'file' removed
jaraco_path.py
train
py
5b4c8bfd5048709e4dc8058a780f63b6b7d14d8e
diff --git a/src/plugin.js b/src/plugin.js index <HASH>..<HASH> 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -85,7 +85,12 @@ module.exports = function plugin(command, targets, opts) { } var config_json = config(projectRoot, {}); - var searchPath = opts.searchpath || config_json.plugin_search_path; + var searchPath = config_json.plugin_search_path || []; + if (typeof opts.searchpath == 'string') { + searchPath = opts.searchpath.split(path.delimiter).concat(searchPath); + } else if (opts.searchpath) { + searchPath = opts.searchpath.concat(searchPath); + } return hooks.fire('before_plugin_add', opts) .then(function() {
When searchpath is specified in config and CLI, merge them.
apache_cordova-cli
train
js
7bd2a69b34126e47ea723367fdc306a3ba971755
diff --git a/linux/hci/signal.go b/linux/hci/signal.go index <HASH>..<HASH> 100644 --- a/linux/hci/signal.go +++ b/linux/hci/signal.go @@ -107,22 +107,23 @@ func (c *Conn) handleSignal(p pdu) error { c.LECreditBasedConnectionRequest(s) case SignalLEFlowControlCredit: c.LEFlowControlCredit(s) - } - - // Check if it's a response to a sent command. - select { - case c.sigSent <- s: - continue default: + // Check if it's a response to a sent command. + select { + case c.sigSent <- s: + continue + default: + } + + c.sendResponse( + SignalCommandReject, + s.id(), + &CommandReject{ + Reason: 0x0000, // Command not understood. + }) + s = s[4+s.len():] // advance to next the packet. } - c.sendResponse( - SignalCommandReject, - s.id(), - &CommandReject{ - Reason: 0x0000, // Command not understood. - }) - s = s[4+s.len():] // advance to next the packet. } return nil }
linux: fix l2cap signaling response Currently, the SignalCommandReject is responded uncontionally. In cases we've already handled and respond the request properly, the superfluous SignalCommandReject causes the remote device responds SignalCommandReject, and we go into a ping pong loop...
currantlabs_ble
train
go