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
14e0a9b74a11667e0cad9e5401c60425b841ba95
diff --git a/internal/service/appflow/flow.go b/internal/service/appflow/flow.go index <HASH>..<HASH> 100644 --- a/internal/service/appflow/flow.go +++ b/internal/service/appflow/flow.go @@ -667,6 +667,7 @@ func ResourceFlow() *schema.Resource { "kms_arn": { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.StringMatch(regexp.MustCompile(`arn:aws:kms:.*:[0-9]+:.*`), "must be a valid ARN of a Key Management Services (KMS) key"), }, "source_flow_config": { @@ -1092,9 +1093,12 @@ func ResourceFlow() *schema.Resource { ValidateFunc: validation.StringLenBetween(0, 256), }, "source_fields": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringLenBetween(0, 2048), + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 2048), + }, }, "task_properties": { Type: schema.TypeMap,
appflow: amend flow source_fields attribute
terraform-providers_terraform-provider-aws
train
go
9729f1f5c85c95d8fad7aad656ca1814858d657d
diff --git a/js/mexc.js b/js/mexc.js index <HASH>..<HASH> 100644 --- a/js/mexc.js +++ b/js/mexc.js @@ -2203,7 +2203,7 @@ module.exports = class mexc extends Exchange { const amount = this.safeString2 (order, 'quantity', 'vol'); const remaining = this.safeString (order, 'remain_quantity'); const filled = this.safeString2 (order, 'deal_quantity', 'dealVol'); - const cost = this.safeString2 (order, 'deal_amount', 'dealAvgPrice'); + const cost = this.safeString2 (order, 'deal_amount'); const marketId = this.safeString (order, 'symbol'); const symbol = this.safeSymbol (marketId, market, '_'); const sideCheck = this.safeInteger (order, 'side'); @@ -2275,7 +2275,7 @@ module.exports = class mexc extends Exchange { 'side': side, 'price': price, 'stopPrice': this.safeString (order, 'triggerPrice'), - 'average': undefined, + 'average': this.safeString (order, 'dealAvgPrice'), 'amount': amount, 'cost': cost, 'filled': filled,
mexc fetchOrder parser - dealAvgPrice used for average and no longer used for cost - fixes:#<I>
ccxt_ccxt
train
js
1f8a056f53fe963ecf74760fd57e750ca373cbe0
diff --git a/src/Zizaco/MongolidLaravel/MongolidServiceProvider.php b/src/Zizaco/MongolidLaravel/MongolidServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Zizaco/MongolidLaravel/MongolidServiceProvider.php +++ b/src/Zizaco/MongolidLaravel/MongolidServiceProvider.php @@ -2,7 +2,7 @@ namespace Zizaco\MongolidLaravel; use Illuminate\Support\ServiceProvider; -use Zizaco\Mongolid\MongoDbConnector; +use Zizaco\Mongolid\Sequence; use Zizaco\Mongolid\Model; class MongolidServiceProvider extends ServiceProvider @@ -54,7 +54,7 @@ class MongolidServiceProvider extends ServiceProvider } ); - $this->app['Sequence'] = $this->app->share( + $this->app['Zizaco\Mongolid\Sequence'] = $this->app->share( function ($app) use ($connection) { $database = $app['config']->get('database.mongodb.default.database', null); return new Sequence($connection, $database);
Update Sequence Service container bind to FQN
leroy-merlin-br_mongolid-laravel
train
php
13f24287bca379ae5406d58bac9205d6899a536c
diff --git a/src/org/zaproxy/zap/extension/ascan/ScriptsActiveScanner.java b/src/org/zaproxy/zap/extension/ascan/ScriptsActiveScanner.java index <HASH>..<HASH> 100644 --- a/src/org/zaproxy/zap/extension/ascan/ScriptsActiveScanner.java +++ b/src/org/zaproxy/zap/extension/ascan/ScriptsActiveScanner.java @@ -64,7 +64,7 @@ public class ScriptsActiveScanner extends AbstractAppParamPlugin { @Override public int getCategory() { - return Category.INJECTION; + return Category.MISC; } @Override
Issue <I> - Scripts Active Scanner should be category Misc not Injection
zaproxy_zaproxy
train
java
8d7035f9f03ba5302a336d530c17f58872395ad4
diff --git a/src/js/mediaelementplayer-simple.js b/src/js/mediaelementplayer-simple.js index <HASH>..<HASH> 100644 --- a/src/js/mediaelementplayer-simple.js +++ b/src/js/mediaelementplayer-simple.js @@ -165,8 +165,8 @@ function MediaElementPlayerSimple(idOrObj, options) { // Container container.id = id + '_container'; - container.className = mejs.MediaElementPlayerSimpleDefaults.classPrefix + 'simple-container ' + - mejs.MediaElementPlayerSimpleDefaults.classPrefix + 'simple-' + original.tagName.toLowerCase(); + container.className = t.options.classPrefix + 'simple-container ' + + t.options.classPrefix + 'simple-' + original.tagName.toLowerCase(); container.style.width = originalWidth + 'px'; container.style.height = originalHeight + 'px'; @@ -224,7 +224,7 @@ MediaElementPlayerSimple.prototype = { ; // CONTROLS - controls.className = mejs.MediaElementPlayerSimpleDefaults.classPrefix + 'simple-controls'; + controls.className = t.options.classPrefix + 'simple-controls'; controls.id = id + '_controls'; container.appendChild(controls);
Fixed issue with simple player when calling class prefix
mediaelement_mediaelement
train
js
49266a5ef0104021bd95e2249e669febe728b18e
diff --git a/lib/cc/analyzer/engine_output_filter.rb b/lib/cc/analyzer/engine_output_filter.rb index <HASH>..<HASH> 100644 --- a/lib/cc/analyzer/engine_output_filter.rb +++ b/lib/cc/analyzer/engine_output_filter.rb @@ -8,6 +8,8 @@ module CC end def filter?(output) + return true unless output.present? + if (json = parse_as_json(output)) issue?(json) && ignore_issue?(json) else diff --git a/spec/cc/analyzer/engine_output_filter_spec.rb b/spec/cc/analyzer/engine_output_filter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/cc/analyzer/engine_output_filter_spec.rb +++ b/spec/cc/analyzer/engine_output_filter_spec.rb @@ -2,6 +2,14 @@ require "spec_helper" module CC::Analyzer describe EngineOutputFilter do + it "filters empty output" do + filter = EngineOutputFilter.new + + filter.filter?("").must_equal true + filter.filter?(" ").must_equal true + filter.filter?("\n").must_equal true + end + it "does not filter arbitrary output" do filter = EngineOutputFilter.new
Add empty output to engine output filter rules This prevents processing errors when the engine output is parsed into another structure by adding empty output to the `EngineOutputFilter` filter rules.
codeclimate_codeclimate
train
rb,rb
68e4b07580980d6f65eac977474fe9e6d3f5ce99
diff --git a/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py b/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py index <HASH>..<HASH> 100644 --- a/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py +++ b/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py @@ -183,18 +183,20 @@ class SimulationEventSource(AbstractEventSource): if last_tick is None: last_tick = tick + yield Event( EVENT.BEFORE_TRADING, calendar_dt=calendar_dt - datetime.timedelta(minutes=30), trading_dt=trading_dt - datetime.timedelta(minutes=30) ) - yield Event(EVENT.TICK, calendar_dt=calendar_dt, trading_dt=trading_dt, tick=tick) - if self._universe_changed: self._universe_changed = False - last_dt = calendar_dt break + + last_dt = calendar_dt + yield Event(EVENT.TICK, calendar_dt=calendar_dt, trading_dt=trading_dt, tick=tick) + else: break
fix bug occurs when universe changed in before_trading
ricequant_rqalpha
train
py
45fe27d4d9397f5bf90e64edfbfcd63d2daae91d
diff --git a/examples/__tests__/SlickGoTo.test.js b/examples/__tests__/SlickGoTo.test.js index <HASH>..<HASH> 100644 --- a/examples/__tests__/SlickGoTo.test.js +++ b/examples/__tests__/SlickGoTo.test.js @@ -18,7 +18,7 @@ describe('SlickGoTo', () => { wrapper.find('input').simulate('change', { target: { value: 0 } }) expect(wrapper.find('.slick-slide.slick-active img').props().src).toEqual("/img/react-slick/abstract01.jpg"); }); - it('should go to 1st slide from another 3rd slide', () => { + it.skip('should go to 1st slide from another 3rd slide', () => { // skipped because two simultaneous clicks dont' work with css and speed>0 const wrapper = mount(<SlickGoTo waitForAnimate={false} />) wrapper.find('input').simulate('change', { target: { value: 3 } }) wrapper.find('input').simulate('change', { target: { value: 0 } })
skipped failing test for SlickGoTo example due to changes in the example
akiran_react-slick
train
js
eb6c052836f4ec09e3c6d45bad05b7cd350b2342
diff --git a/lib/restify/adapter/typhoeus.rb b/lib/restify/adapter/typhoeus.rb index <HASH>..<HASH> 100644 --- a/lib/restify/adapter/typhoeus.rb +++ b/lib/restify/adapter/typhoeus.rb @@ -27,6 +27,7 @@ module Restify def call_native(request, writer) @mutex.synchronize do @hydra.queue convert(request, writer) + @hydra.dequeue_many end sync? ? @hydra.run : start
Push requests to running hydra if possible This commit adds a @hydra.dequeue_many method call after queuing a new requests. This directly pushes the newly queued request to an existing curl multi handle if the max concurrency setting allows. Previously the first queued requests immediately issues a hydra run and subsequent queued requests were only added after the first request finished.
jgraichen_restify
train
rb
e5b3d948b222b4541dd9c63c4ad421c7beb99393
diff --git a/lib/acts_as_graph_object/base.rb b/lib/acts_as_graph_object/base.rb index <HASH>..<HASH> 100644 --- a/lib/acts_as_graph_object/base.rb +++ b/lib/acts_as_graph_object/base.rb @@ -15,7 +15,7 @@ module ActsAsGraphObject # requires routes.default_url_options[:host] to be set! # TODO: add warning message if method is called? def url - url_helpers.send("#{self.class}_url".downcase, self) + url_helpers.send("#{self.class}_url".downcase, self) rescue nil end def type
Made @model.url method silently fail.
fredkelly_acts_as_graph_object
train
rb
73da1913e5439b2274746a8c00b061383d028dae
diff --git a/src/main/java/org/tenidwa/collections/utils/ContentMap.java b/src/main/java/org/tenidwa/collections/utils/ContentMap.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/tenidwa/collections/utils/ContentMap.java +++ b/src/main/java/org/tenidwa/collections/utils/ContentMap.java @@ -112,6 +112,7 @@ public final class ContentMap<K, C, V> implements Map<K, V> { ); } + @Deprecated @Override public void putAll(Map<? extends K, ? extends V> map) { throw new UnsupportedOperationException( @@ -127,6 +128,7 @@ public final class ContentMap<K, C, V> implements Map<K, V> { ); } + @Deprecated @Override public Set<K> keySet() { throw new UnsupportedOperationException( @@ -139,6 +141,7 @@ public final class ContentMap<K, C, V> implements Map<K, V> { return this.map.values(); } + @Deprecated @Override public Set<Entry<K, V>> entrySet() { throw new UnsupportedOperationException(
#<I> Add missing Deprecated annotations
gvlasov_collections-utils
train
java
72841912141d2ccbb7d8f2cbb7e73313720f02f3
diff --git a/src/Dashboard/Http/Controllers/SendMessage.php b/src/Dashboard/Http/Controllers/SendMessage.php index <HASH>..<HASH> 100644 --- a/src/Dashboard/Http/Controllers/SendMessage.php +++ b/src/Dashboard/Http/Controllers/SendMessage.php @@ -45,6 +45,9 @@ class SendMessage $request->appId ); } else { + // Add 'appId' to the payload. + $payload['appId'] = $request->appId; + $channelManager->broadcastAcrossServers( $request->appId, $request->channel, (object) $payload );
Append appId to the request payload
beyondcode_laravel-websockets
train
php
75afe24d01763e65884ca1aa363cb142c4d72ffa
diff --git a/toml/decoder.py b/toml/decoder.py index <HASH>..<HASH> 100644 --- a/toml/decoder.py +++ b/toml/decoder.py @@ -144,7 +144,7 @@ def load(f, _dict=dict, decoder=None): if decoder is None: decoder = TomlDecoder(_dict) d = decoder.get_empty_table() - for l in f: + for l in f: # noqa: E741 if op.exists(l): d.update(load(l, _dict, decoder)) else:
Ignored flake8 E<I> on line <I> of toml/decoder.py
uiri_toml
train
py
354f4dbcf70965d7b23ed935199f437d7edc38ed
diff --git a/src/test/java/com/turn/ttorrent/client/network/HandshakeReceiverTest.java b/src/test/java/com/turn/ttorrent/client/network/HandshakeReceiverTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/turn/ttorrent/client/network/HandshakeReceiverTest.java +++ b/src/test/java/com/turn/ttorrent/client/network/HandshakeReceiverTest.java @@ -30,7 +30,7 @@ public class HandshakeReceiverTest { if (Logger.getRootLogger().getAllAppenders().hasMoreElements()) return; BasicConfigurator.configure(new ConsoleAppender(new PatternLayout("[%d{MMdd HH:mm:ss,SSS} %t] %6p - %20.20c - %m %n"))); - Logger.getRootLogger().setLevel(Level.ALL); + Logger.getRootLogger().setLevel(Level.INFO); } @BeforeMethod
fixed print all logs in handshakereceiver test
mpetazzoni_ttorrent
train
java
883fd1f45e8c7cfc342323d3849d0c8f9dde7194
diff --git a/windpowerlib/wind_farm.py b/windpowerlib/wind_farm.py index <HASH>..<HASH> 100644 --- a/windpowerlib/wind_farm.py +++ b/windpowerlib/wind_farm.py @@ -178,6 +178,15 @@ class WindFarm(object): self """ + # Check if all wind turbines have a power curve as attribute + for item in self.wind_turbine_fleet: + if item['wind_turbine'].power_curve is None: + raise ValueError("For an aggregated wind farm power curve " + + "each wind turbine needs a power curve " + + "but `power_curve` of wind turbine " + + "{} is {}.".format( + item['wind_turbine'].object_name, + item['wind_turbine'].power_curve)) # Initialize data frame for power curve values df = pd.DataFrame() for turbine_type_dict in self.wind_turbine_fleet:
Check if all wind turbines of wind farm have a power curve as attribute
wind-python_windpowerlib
train
py
4aa2ea630db2d9c6aff254fe7c0499dd2c8a8863
diff --git a/presto-main/src/main/java/com/facebook/presto/execution/TaskInfo.java b/presto-main/src/main/java/com/facebook/presto/execution/TaskInfo.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/execution/TaskInfo.java +++ b/presto-main/src/main/java/com/facebook/presto/execution/TaskInfo.java @@ -22,6 +22,8 @@ import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Maps; import org.joda.time.DateTime; import javax.annotation.concurrent.Immutable; @@ -92,7 +94,14 @@ public class TaskInfo this.failures = ImmutableList.of(); } - this.outputs = ImmutableMap.copyOf(checkNotNull(outputs, "outputs is null")); + checkNotNull(outputs, "outputs is null"); + this.outputs = ImmutableMap.copyOf(Maps.transformValues(outputs, new Function<Set<?>, Set<?>>() { + @Override + public Set<?> apply(Set<?> input) + { + return ImmutableSet.copyOf(input); + } + })); } @JsonProperty
Deep copy TaskInfo outputs in constructor to avoid ConcurrentModificationException
prestodb_presto
train
java
2cc4328e3441fafaaddc9b6e48ce89e732d9e49c
diff --git a/lib/active_admin/table_builder.rb b/lib/active_admin/table_builder.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/table_builder.rb +++ b/lib/active_admin/table_builder.rb @@ -43,7 +43,7 @@ module ActiveAdmin links += " | " links += link_to "Edit", edit_resource_path(resource) links += " | " - links += link_to "Delete", resource_path(resource), :method => :destroy, :confirm => "Are you sure you want to delete this?" + links += link_to "Delete", resource_path(resource), :method => :delete, :confirm => "Are you sure you want to delete this?" links end end
Fixed delete link to method type :delete
activeadmin_activeadmin
train
rb
2a210b57030482d3f2e0555d61272359d50cefcb
diff --git a/core/client/app/components/gh-content-view-container.js b/core/client/app/components/gh-content-view-container.js index <HASH>..<HASH> 100644 --- a/core/client/app/components/gh-content-view-container.js +++ b/core/client/app/components/gh-content-view-container.js @@ -8,6 +8,8 @@ export default Ember.Component.extend({ resizeService: Ember.inject.service(), + _resizeListener: null, + calculatePreviewIsHidden: function () { if (this.$('.content-preview').length) { this.set('previewIsHidden', !this.$('.content-preview').is(':visible')); @@ -16,8 +18,12 @@ export default Ember.Component.extend({ didInsertElement: function () { this._super(...arguments); + this._resizeListener = Ember.run.bind(this, this.calculatePreviewIsHidden); + this.get('resizeService').on('debouncedDidResize', this._resizeListener); this.calculatePreviewIsHidden(); - this.get('resizeService').on('debouncedDidResize', - Ember.run.bind(this, this.calculatePreviewIsHidden)); + }, + + willDestroy: function () { + this.get('resizeService').off('debouncedDidResize', this._resizeListener); } });
Fix teardown of resize handler in content management screen refs #<I> ([comment](<URL>)) - cleans up resize handler on willDestroy hook of gh-content-view-container
TryGhost_Ghost
train
js
5adf04a73c135dc729b9d9889bc963b45a9fc471
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -182,7 +182,7 @@ module.exports = function( grunt ) { grunt.registerTask( "test", [ "test_fast", "promises_aplus_tests" ] ); // Short list as a high frequency watch task - grunt.registerTask( "dev", [ "build:*:*", "uglify", "remove_map_comment", "dist:*" ] ); + grunt.registerTask( "dev", [ "build:*:*", "lint", "uglify", "remove_map_comment", "dist:*" ] ); grunt.registerTask( "default", [ "dev", "test_fast", "compare_size" ] ); }; diff --git a/src/data/var/acceptData.js b/src/data/var/acceptData.js index <HASH>..<HASH> 100644 --- a/src/data/var/acceptData.js +++ b/src/data/var/acceptData.js @@ -4,6 +4,7 @@ define( function() { * Determines whether an object can have data */ return function( owner ) { + // Accepts only: // - Node // - Node.ELEMENT_NODE
Build: put back "lint" command to the "dev" list Also fix lint error in `data` module. It seems this command was removed from the list during merge
jquery_jquery
train
js,js
3ce65b43510fee716973fc539a8f0cc1a7c54fbd
diff --git a/SolrClient/transport/transportbase.py b/SolrClient/transport/transportbase.py index <HASH>..<HASH> 100755 --- a/SolrClient/transport/transportbase.py +++ b/SolrClient/transport/transportbase.py @@ -28,7 +28,7 @@ class TransportBase(object): if len(self._action_log) >= self._action_log_count: self._action_log.pop(0) - def _retry(self, function): + def _retry(function): ''' Internal mechanism to try to send data to multiple Solr Hosts if the query fails on the first one.
fixed bad commit on _retry
moonlitesolutions_SolrClient
train
py
913a67eef03f270d2e6ba4dc949033e6fb8fbf17
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -132,10 +132,11 @@ exports.compute = function(buildConfig) { throw new Error('Must supply file to compute build from:'); } var mockRequestedURL = 'http://localhost:8080/' + requestedPath; + var noop = function() {}; exports.provide(buildConfig)( - {url: mockRequestedURL}, // req - {end: onComputed}, // res - function(err) { // next() + {url: mockRequestedURL, method: 'GET'}, // req + {end: onComputed, setHeader: noop}, // res + function(err) { // next() console.log('ERROR computing build:', err); } );
bug-fix: Error computing build: undefined
facebookarchive_react-page-middleware
train
js
a36f53f9da92f0e0ca0894e68474e9b9c85ce870
diff --git a/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java b/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java index <HASH>..<HASH> 100755 --- a/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java +++ b/src/main/java/com/mebigfatguy/fbcontrib/detect/MethodReturnsConstant.java @@ -177,9 +177,11 @@ public class MethodReturnsConstant extends BytecodeScanningDetector { } } else if ((seen == GOTO) || (seen == GOTO_W)) { if (stack.getStackDepth() > 0) { - // Trinaries confuse us too much, if the code has a ternary well - oh well + // Ternaries confuse us too much, if the code has a ternary well - oh well throw new StopOpcodeParsingException(); } + } else if (seen == ATHROW) { + throw new StopOpcodeParsingException(); } else if (seen == INVOKEVIRTUAL) { String clsName = getClassConstantOperand(); if (SignatureUtils.isPlainStringConvertableClass(clsName)) {
don't report MRC when a 1 return value and a throw exists. kind of silly, but ok.
mebigfatguy_fb-contrib
train
java
552bddef62c4652de61d554cc11e55d58cdf9b18
diff --git a/tests/test_looter.py b/tests/test_looter.py index <HASH>..<HASH> 100644 --- a/tests/test_looter.py +++ b/tests/test_looter.py @@ -52,9 +52,10 @@ class TestProfileDownload(_TempTestCase): # We have to use GreaterEqual since multi media posts # are counted as 1 but will download more than one # picture / video + media_count = looter.metadata['edge_owner_to_timeline_media']['count'] self.assertGreaterEqual( len(os.listdir(self.tmpdir)), - min(cls.MEDIA_COUNT, int(looter.metadata['media']['count'])) + min(cls.MEDIA_COUNT, media_count) ) self.assertEqual(profile, looter.metadata['username'])
Fix media count not being extracted well within profile tests
althonos_InstaLooter
train
py
7b4be728fff97ff7f8ef51e2fb2dc188b68339e8
diff --git a/slacker/__init__.py b/slacker/__init__.py index <HASH>..<HASH> 100644 --- a/slacker/__init__.py +++ b/slacker/__init__.py @@ -397,6 +397,8 @@ class Files(BaseAPI): class Stars(BaseAPI): def add(self, file_=None, file_comment=None, channel=None, timestamp=None): + assert file_ or file_comment or channel + return self.post('stars.add', data={ 'file': file_, @@ -410,6 +412,8 @@ class Stars(BaseAPI): params={'user': user, 'count': count, 'page': page}) def remove(self, file_=None, file_comment=None, channel=None, timestamp=None): + assert file_ or file_comment or channel + return self.post('stars.remove', data={ 'file': file_,
One of file, file_comment, channel, or the combination of channel and timestamp must be specified
os_slacker
train
py
b1ab02be045b6f75543e64886fa03444962e42ea
diff --git a/dist/ember_components/ember.aljs-modal.js b/dist/ember_components/ember.aljs-modal.js index <HASH>..<HASH> 100644 --- a/dist/ember_components/ember.aljs-modal.js +++ b/dist/ember_components/ember.aljs-modal.js @@ -109,12 +109,18 @@ _AljsApp.AljsModalComponent = Ember.Component.extend(Ember.Evented, { $('#' + this.get('modalId')).trigger('shown.aljs.modal'); }, 400); }, - closeModal: function() { - $('#' + this.get('modalId')).trigger('dismiss.aljs.modal'); + closeModal: function(e) { + var self = this; - this.set('isModalOpen', false); + if (e) { + self = e.data; + } + + $('#' + self.get('modalId')).trigger('dismiss.aljs.modal'); + + self.set('isModalOpen', false); - Ember.run.later(this, function() { + Ember.run.later(self, function() { $('#' + this.get('modalId')).trigger('dismissed.aljs.modal'); }, 200); }
Ember Modals - fixed triggering close modal by jQuery
appiphony_appiphony-lightning-js
train
js
d38cb8350cbf98873e9672806bcd62a6b3e51fb7
diff --git a/sortedm2m/static/sortedm2m/widget.js b/sortedm2m/static/sortedm2m/widget.js index <HASH>..<HASH> 100644 --- a/sortedm2m/static/sortedm2m/widget.js +++ b/sortedm2m/static/sortedm2m/widget.js @@ -108,6 +108,13 @@ if (typeof jQuery === 'undefined') { return text; } + function windowname_to_id(text) { + // django32 has removed windowname_to_id function. + text = text.replace(/__dot__/g, '.'); + text = text.replace(/__dash__/g, '-'); + return text; + } + if (window.showAddAnotherPopup) { var django_dismissAddAnotherPopup = window[dismissPopupFnName]; window[dismissPopupFnName] = function (win, newId, newRepr) {
Fixing django<I> pop-up closing issue. (#<I>) * fix: django<I> has removed `windowname_to_id` function but it is breaking sorted-m2m usage on pop-up.
gregmuellegger_django-sortedm2m
train
js
da5e0b4491d319f5a96c22495934dbf4c499971a
diff --git a/lib/rest-core/promise/thread_pool.rb b/lib/rest-core/promise/thread_pool.rb index <HASH>..<HASH> 100644 --- a/lib/rest-core/promise/thread_pool.rb +++ b/lib/rest-core/promise/thread_pool.rb @@ -1,4 +1,7 @@ +# reference implementation: puma +# https://github.com/puma/puma/blob/v2.7.1/lib/puma/thread_pool.rb + require 'thread' class RestCore::Promise::ThreadPool
puma's thread pool is the reference implementation particularly: <URL>
godfat_rest-core
train
rb
d4b5532a36afa13d46b1fc6f25fcd889e14a0ab3
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -145,7 +145,7 @@ gulp.task( 'clean-dist', function() { return del( ['dist/**/*', '!dist'] ); }); -gulp.task( 'revision', function(done) { +function revision( done ) { // by default, gulp would pick `assets/css` as the base, // so we need to set it explicitly: gulp.src([paths.css + '/theme.min.css', paths.js + '/theme.min.js'], {base: './'}) @@ -155,7 +155,9 @@ gulp.task( 'revision', function(done) { .pipe(revDel({dest: './'})) .pipe(gulp.dest('./')); // write manifest to build dir done(); -}); +}; + +exports.revision = revision; // Run // gulp dist
ReferenceError: revision is not defined
understrap_understrap
train
js
b7ea3ed156831a8c7a5c02c7c5e3b9b8bd9bc663
diff --git a/src/Flow/Compiler.php b/src/Flow/Compiler.php index <HASH>..<HASH> 100644 --- a/src/Flow/Compiler.php +++ b/src/Flow/Compiler.php @@ -976,7 +976,7 @@ class FilterExpression extends Expression if ($this->filters[$i] === 'raw') continue; list($name, $arguments) = $this->filters[$i]; if ($name == $raw) continue; - $compiler->raw('$this->helper(\'' . $name . '\','); + $compiler->raw('$this->helper(\'' . $name . '\', '); $postponed[] = $arguments; }
Add missing whitespace in compiled helper invocation
nramenta_flow
train
php
7bed1411472417f95fb64ccd59d3e2ed6809aa86
diff --git a/php/utils-wp.php b/php/utils-wp.php index <HASH>..<HASH> 100644 --- a/php/utils-wp.php +++ b/php/utils-wp.php @@ -224,7 +224,14 @@ function wp_get_cache_type() { } /** - * Clear all of the caches for memory management + * Clear WordPress internal object caches. + * + * In long-running scripts, the internal caches on `$wp_object_cache` and `$wpdb` + * can grow to consume gigabytes of memory. Periodically calling this utility + * can help with memory management. + * + * @access public + * @category System */ function wp_clear_object_cache() { global $wpdb, $wp_object_cache;
Mark `WP_CLI\Utils\wp_clear_object_cache()` as public It's a helpful utility for memory management in long-running scripts.
wp-cli_core-command
train
php
24217eecb934ab0e2958426c756144faebafc4da
diff --git a/src/Configuration/GrumPHP.php b/src/Configuration/GrumPHP.php index <HASH>..<HASH> 100644 --- a/src/Configuration/GrumPHP.php +++ b/src/Configuration/GrumPHP.php @@ -46,10 +46,7 @@ class GrumPHP return $this->container->getParameter('hooks_preset'); } - /** - * @return array - */ - public function getGitHookVariables() + public function getGitHookVariables(): array { return $this->container->getParameter('git_hook_variables'); }
Removed php doc block and added return type array
phpro_grumphp
train
php
e402e946ec8cfe1dfb02ef2a6c834c98393fe169
diff --git a/lib/spitball.rb b/lib/spitball.rb index <HASH>..<HASH> 100644 --- a/lib/spitball.rb +++ b/lib/spitball.rb @@ -48,17 +48,18 @@ class Spitball end def create_bundle - File.open(gemfile_path, 'w') {|f| f.write gemfile } FileUtils.mkdir_p bundle_path - if system "bundle install #{bundle_path} --gemfile=#{gemfile_path} --disable-shared-gems #{without_clause} > /dev/null" + File.open(gemfile_path, 'w') {|f| f.write gemfile } + + if system "cd #{bundle_path} && bundle install #{bundle_path} --disable-shared-gems #{without_clause} > /dev/null" FileUtils.rm_rf File.join(bundle_path, "cache") system "tar czf #{tarball_path}.#{Process.pid} -C #{bundle_path} ." system "mv #{tarball_path}.#{Process.pid} #{tarball_path}" else - FileUtils.rm_rf gemfile_path + #FileUtils.rm_rf gemfile_path raise BundleCreationFailure, "Bundle build failure." end @@ -79,7 +80,7 @@ class Spitball end def gemfile_path - Repo.path(digest, 'gemfile') + File.expand_path('Gemfile', bundle_path) end def tarball_path
jank backward compat with bundler <I>
twitter_spitball
train
rb
0feeab2e43a75bee3d5709248544b3078df96706
diff --git a/daemon/daemon.go b/daemon/daemon.go index <HASH>..<HASH> 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -376,6 +376,13 @@ func (daemon *Daemon) restore() error { // This must be run after any containers with a restart policy so that containerized plugins // can have a chance to be running before we try to initialize them. for _, c := range containers { + // if the container has restart policy, do not + // prepare the mountpoints since it has been done on restarting. + // This is to speed up the daemon start when a restart container + // has a volume and the volume dirver is not available. + if _, ok := restartContainers[c]; ok { + continue + } group.Add(1) go func(c *container.Container) { defer group.Done()
daemon: don't prepare mountpoint for restart container The restart container has already prepared the mountpoint, there is no need to do that again. This can speed up the daemon start if the restart container has a volume and the volume driver is not available.
moby_moby
train
go
20913da106cedf5c28fd9aee9f6a6e47c9d51f79
diff --git a/plugin/com.blackberry.ui.input/src/blackberry10/index.js b/plugin/com.blackberry.ui.input/src/blackberry10/index.js index <HASH>..<HASH> 100644 --- a/plugin/com.blackberry.ui.input/src/blackberry10/index.js +++ b/plugin/com.blackberry.ui.input/src/blackberry10/index.js @@ -37,8 +37,8 @@ */ function getScreenHeight() { return screen.height; } function getScreenWidth() { return screen.width; } -function getKeyboardOffset() { return 72; } -function getKeyboardHeight() { return 480; } +function getKeyboardOffset() { return ('keyboardOffset' in wp.device && wp.device.keyboardOffset || "0") - 0; } +function getKeyboardHeight() { return ('keyboardHeight' in wp.device && wp.device.keyboardHeight || "0") - 0; } var _screenHeight = getScreenHeight(), _screenWidth = getScreenWidth(),
Get keyboardOffset/keyboardHeight from webplatform
blackberry_cordova-blackberry-plugins
train
js
11047f84845a63c47d4f416d00e9504a7be42fa9
diff --git a/tests/image_manipulation_test.py b/tests/image_manipulation_test.py index <HASH>..<HASH> 100644 --- a/tests/image_manipulation_test.py +++ b/tests/image_manipulation_test.py @@ -38,7 +38,9 @@ class ImageManipulationTest(unittest.TestCase): print(data_out.shape) # print data # print data_out - self.assertItemsEqual(expected_shape, data_out.shape) + self.assertEquals(expected_shape[0], data_out.shape[0]) + self.assertEquals(expected_shape[1], data_out.shape[1]) + self.assertEquals(expected_shape[2], data_out.shape[2]) if __name__ == "__main__": unittest.main()
removed assertEqualsItems
mjirik_io3d
train
py
95245c3568bfb8d154ab8f3e25dda61a8d9000e9
diff --git a/src/SOAPEssence.php b/src/SOAPEssence.php index <HASH>..<HASH> 100644 --- a/src/SOAPEssence.php +++ b/src/SOAPEssence.php @@ -144,6 +144,9 @@ class SOAPEssence extends XMLEssence return parent::extract($this->lastResponse, $config, $data); } catch (SoapFault $e) { + $this->lastRequest = $this->client->__getLastRequest(); + $this->lastResponse = $this->client->__getLastResponse(); + throw new EssenceException($e->getMessage(), $e->getCode(), $e); } }
feat(*): keep last request/response before throwing an exception
impensavel_essence
train
php
bafab4679750b4bf59c45a6262f3ca9704b735d8
diff --git a/tests/packaging/release.py b/tests/packaging/release.py index <HASH>..<HASH> 100644 --- a/tests/packaging/release.py +++ b/tests/packaging/release.py @@ -91,11 +91,23 @@ class release_and_issues_(Spec): class feature: def no_unreleased(self): # release is None, issues is empty list - skip() + release, issues = release_and_issues( + changelog={'1.0.1': [1], 'unreleased_1_feature': []}, + branch='master', + release_type=Release.FEATURE, + ) + eq_(release, None) + eq_(issues, []) def has_unreleased(self): # release is still None, issues is nonempty list - skip() + release, issues = release_and_issues( + changelog={'1.0.1': [1], 'unreleased_1_feature': [2, 3]}, + branch='master', + release_type=Release.FEATURE, + ) + eq_(release, None) + eq_(issues, [2, 3]) def undefined_always_returns_None_and_empty_list(self): skip()
Fill out some skel tests re: release_and_issues
pyinvoke_invocations
train
py
d9678357aaf1c2205dcb022a1a118ba9ef1f3f2d
diff --git a/lib/Doctrine/Export/Firebird.php b/lib/Doctrine/Export/Firebird.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/Export/Firebird.php +++ b/lib/Doctrine/Export/Firebird.php @@ -483,6 +483,17 @@ class Doctrine_Export_Firebird extends Doctrine_Export return $result; } /** + * A method to return the required SQL string that fits between CREATE ... TABLE + * to create the table as a temporary table. + * + * @return string The string required to be placed between "CREATE" and "TABLE" + * to generate a temporary table, if possible. + */ + public function getTemporaryTableQuery() + { + return 'GLOBAL TEMPORARY'; + } + /** * create sequence * * @param string $seqName name of the sequence to be created
ported getTemporaryTableQuery from MDB2
doctrine_annotations
train
php
e0556a754f35c9b4f89cf975401deb6cda018473
diff --git a/src/main/java/uk/co/real_logic/agrona/collections/IntObjConsumer.java b/src/main/java/uk/co/real_logic/agrona/collections/IntObjConsumer.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/co/real_logic/agrona/collections/IntObjConsumer.java +++ b/src/main/java/uk/co/real_logic/agrona/collections/IntObjConsumer.java @@ -16,11 +16,10 @@ package uk.co.real_logic.agrona.collections; /** - * This is an (int,Object) primitive specialisation of a BiConsumer. + * This is an (int, Object) primitive specialisation of a BiConsumer. */ @FunctionalInterface -public interface -IntObjConsumer<T> +public interface IntObjConsumer<T> { /** * @param i for the tuple.
[Java] Minor style changes.
real-logic_agrona
train
java
31e15f302e8dfefbabe767df2262cf0e42e685a1
diff --git a/disque/connection.go b/disque/connection.go index <HASH>..<HASH> 100644 --- a/disque/connection.go +++ b/disque/connection.go @@ -111,8 +111,8 @@ func (d *Disque) Ack(jobId string) (err error) { } // Delete a job that was enqueued on the cluster -func (d *Disque) Delete(jobID string) (err error) { - _, err = d.call("DELJOB", redis.Args{}.Add(jobID)) +func (d *Disque) Delete(jobId string) (err error) { + _, err = d.call("DELJOB", redis.Args{}.Add(jobId)) return }
Rename jobId variable for consistency
zencoder_disque-go
train
go
1f43a47d25f8f2961a20b7d6f1979f6c3178bfc3
diff --git a/archive-commons/src/main/java/org/archive/url/WaybackURLKeyMaker.java b/archive-commons/src/main/java/org/archive/url/WaybackURLKeyMaker.java index <HASH>..<HASH> 100644 --- a/archive-commons/src/main/java/org/archive/url/WaybackURLKeyMaker.java +++ b/archive-commons/src/main/java/org/archive/url/WaybackURLKeyMaker.java @@ -6,6 +6,14 @@ public class WaybackURLKeyMaker implements URLKeyMaker { // URLCanonicalizer canonicalizer = new NonMassagingIAURLCanonicalizer(); URLCanonicalizer canonicalizer = new DefaultIAURLCanonicalizer(); + public URLCanonicalizer getCanonicalizer() { + return canonicalizer; + } + + public void setCanonicalizer(URLCanonicalizer canonicalizer) { + this.canonicalizer = canonicalizer; + } + private boolean surtMode = true; public WaybackURLKeyMaker()
archive-commons: make canonicalizer in WaybackURLKeyMaker settable
iipc_webarchive-commons
train
java
994ac3fd0971a056e30378fc08b3f35f65f6e113
diff --git a/lib/pronounce.rb b/lib/pronounce.rb index <HASH>..<HASH> 100644 --- a/lib/pronounce.rb +++ b/lib/pronounce.rb @@ -7,7 +7,10 @@ module Pronounce class << self def how_do_i_pronounce(word) @pronouncations ||= build_pronuciation_dictionary - @pronouncations[word.downcase].syllables.map {|syllable| syllable.as_strings } + word = word.downcase + if @pronouncations[word] + @pronouncations[word].syllables.map {|syllable| syllable.as_strings } + end end def symbols diff --git a/spec/pronounce_spec.rb b/spec/pronounce_spec.rb index <HASH>..<HASH> 100644 --- a/spec/pronounce_spec.rb +++ b/spec/pronounce_spec.rb @@ -9,6 +9,10 @@ describe Pronounce do it 'groups the phones by syllable' do Pronounce.how_do_i_pronounce('monkeys').should == [['M', 'AH1', 'NG'], ['K', 'IY0', 'Z']] end + + it 'returns nil for unknown words' do + Pronounce.how_do_i_pronounce('beeblebrox').should == nil + end end describe '#symbols' do
Return nil for unknown words as opposed to throwing an exception.
josephwilk_pronounce
train
rb,rb
1c41d664e94e195377bf2f35065cfd2080c3b350
diff --git a/src/js/index.js b/src/js/index.js index <HASH>..<HASH> 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -1,6 +1,7 @@ // (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP var Grommet = { // Components + Animate: require('./components/Animate'), Accordion: require('./components/Accordion'), AccordionPanel: require('./components/AccordionPanel'), Anchor: require('./components/Anchor'),
Added Animate to index.js
grommet_grommet
train
js
21cb9a728bea61fc9058b7fb08546c26c009df33
diff --git a/protocol/src/main/java/org/jboss/as/protocol/ProtocolChannelClient.java b/protocol/src/main/java/org/jboss/as/protocol/ProtocolChannelClient.java index <HASH>..<HASH> 100644 --- a/protocol/src/main/java/org/jboss/as/protocol/ProtocolChannelClient.java +++ b/protocol/src/main/java/org/jboss/as/protocol/ProtocolChannelClient.java @@ -151,11 +151,11 @@ public class ProtocolChannelClient<T extends ProtocolChannel> implements Closeab channel.writeShutdown(); } catch (IOException ignore) { } - try { - channel.awaitClosed(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } +// try { +// channel.awaitClosed(); +// } catch (InterruptedException e) { +// Thread.currentThread().interrupt(); +// } } channels.clear();
Get it working again with 'Connection reset by peer' errors by commenting out the awaitClosed() in the client was: 2c7fa<I>c<I>eeaf<I>fd<I>e<I>a<I>e9d<I>c9
wildfly_wildfly-core
train
java
357ee91e16667272548192786fc900d1f06cc4c3
diff --git a/src/Core/Framework/Demodata/Generator/ProductGenerator.php b/src/Core/Framework/Demodata/Generator/ProductGenerator.php index <HASH>..<HASH> 100644 --- a/src/Core/Framework/Demodata/Generator/ProductGenerator.php +++ b/src/Core/Framework/Demodata/Generator/ProductGenerator.php @@ -112,6 +112,13 @@ class ProductGenerator implements DemodataGeneratorInterface $this->write($payload, $context); } + // set inherited association fields, normally set in Indexer + // these are needed in Order generation + $this->connection->executeQuery(' + UPDATE product + SET visibilities = id, prices = id; + '); + $context->getConsole()->progressFinish(); }
NTR - Fix order generation in demo data command
shopware_platform
train
php
fb542f857bb7ab297b88524d8bbc471cca73de03
diff --git a/publ/queries.py b/publ/queries.py index <HASH>..<HASH> 100644 --- a/publ/queries.py +++ b/publ/queries.py @@ -57,17 +57,15 @@ def where_entry_visible(query, date=None): def where_entry_visible_future(query): """ Generate a where clause for entries that are visible now or in the future """ - return orm.select( - e for e in query - if e.status in (model.PublishStatus.PUBLISHED.value, - model.PublishStatus.SCHEDULED.value)) + return query.filter(lambda e: + e.status in (model.PublishStatus.PUBLISHED.value, + model.PublishStatus.SCHEDULED.value)) def where_entry_deleted(query): """ Generate a where clause for entries that have been deleted """ - return orm.select( - e for e in query - if e.status == model.PublishStatus.GONE.value) + return query.filter(lambda e: + e.status == model.PublishStatus.GONE.value) def where_entry_category(query, category, recurse=False):
Replace some missed selects with lambda filters
PlaidWeb_Publ
train
py
43a74be768d8eae3b1744f0f14bac8d8c81d6ae4
diff --git a/connector/jira/src/main/java/org/openengsb/connector/jira/internal/misc/JiraValueConverter.java b/connector/jira/src/main/java/org/openengsb/connector/jira/internal/misc/JiraValueConverter.java index <HASH>..<HASH> 100644 --- a/connector/jira/src/main/java/org/openengsb/connector/jira/internal/misc/JiraValueConverter.java +++ b/connector/jira/src/main/java/org/openengsb/connector/jira/internal/misc/JiraValueConverter.java @@ -71,16 +71,6 @@ public final class JiraValueConverter { } catch (Exception ignore) { //ignore } - try { - return convert(Issue.Type.valueOf(type)); - } catch (Exception ignore) { - //ignore - } - try { - return convert(Issue.Field.valueOf(type)); - } catch (Exception ignore) { - //ignore - } return null; } }
[OPENENGSB-<I>] removed duplicated code
openengsb_openengsb
train
java
bd16e32cf1a5686b424550caf83678c462ffcb61
diff --git a/src/Belt/Functions.php b/src/Belt/Functions.php index <HASH>..<HASH> 100644 --- a/src/Belt/Functions.php +++ b/src/Belt/Functions.php @@ -3,39 +3,25 @@ class Functions { /** - * Cached closures + * The cached closures. * * @var array */ - protected $cached; + protected $cached = []; /** - * Called closures + * The called closures. * * @var array */ - protected $called; + protected $called = []; /** - * "Delayed" closures + * The "delayed" closures. * * @var array */ - protected $delayed; - - /** - * The constructor - * - * @return void - */ - public function __construct() - { - $this->cached = []; - - $this->called = []; - - $this->delayed = []; - } + protected $delayed = []; /** * Execute a closure and cache its output
simplify instantiation process in Belt/Functions
ilya-dev_belt
train
php
92b486696b5869436fef6fc81c1db25211936890
diff --git a/phoebe/backend/decorators.py b/phoebe/backend/decorators.py index <HASH>..<HASH> 100644 --- a/phoebe/backend/decorators.py +++ b/phoebe/backend/decorators.py @@ -230,7 +230,7 @@ def construct_mpirun_command(script='mpirun.py', mpirun_par=None, args='', scrip cmd = ("srun {time_} {memory} {partition} " "mpirun -np {num_proc} {hostfile} {byslot} {python} " "{mpirun_loc} {args}").format(**locals()) - print cmd + print(cmd) flag = subprocess.call(cmd, shell=True) # MPI using the TORQUE scheduler
fixed bug for python 3 compatibility
phoebe-project_phoebe2
train
py
6b02f156979c5aa345719a999939bead568c6d6c
diff --git a/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php b/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php index <HASH>..<HASH> 100644 --- a/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php +++ b/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php @@ -32,8 +32,8 @@ final class PropertySchemaChoiceRestriction implements PropertySchemaRestriction { $choices = []; - if (\is_callable($choices = $constraint->callback)) { - $choices = $choices(); + if (\is_callable($constraint->callback)) { + $choices = ($constraint->callback)(); } elseif (\is_array($constraint->choices)) { $choices = $constraint->choices; }
Do not overwrite variable with unknown value (#<I>)
api-platform_core
train
php
de0ce05cb1f97cdeae1a4de5d5513dac6efe8023
diff --git a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php +++ b/lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php @@ -898,6 +898,7 @@ class ClassMetadata 'db', 'collection', 'rootDocumentName', + 'allowCustomID', ); if ($this->inheritanceType != self::INHERITANCE_TYPE_NONE) { @@ -932,4 +933,4 @@ class ClassMetadata $this->reflFields[$field] = $reflField; } } -} \ No newline at end of file +}
Fixed issue with allowCustomID being lost on serialization
doctrine_mongodb-odm
train
php
192921c6ae6fe5d238a594b51e421d67c2ea1dba
diff --git a/core/src/test/java/org/infinispan/util/CoreTestBlockHoundIntegration.java b/core/src/test/java/org/infinispan/util/CoreTestBlockHoundIntegration.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/infinispan/util/CoreTestBlockHoundIntegration.java +++ b/core/src/test/java/org/infinispan/util/CoreTestBlockHoundIntegration.java @@ -83,6 +83,9 @@ public class CoreTestBlockHoundIntegration implements BlockHoundIntegration { builder.allowBlockingCallsInside(CacheListenerVisibilityTest.EntryModifiedWithAssertListener.class.getName(), "entryCreated"); builder.allowBlockingCallsInside(CacheListenerVisibilityTest.EntryCreatedWithAssertListener.class.getName(), "entryCreated"); + + CommonsBlockHoundIntegration.allowPublicMethodsToBlock(builder, BlockingLocalTopologyManager.class); + CommonsBlockHoundIntegration.allowPublicMethodsToBlock(builder, AbstractControlledLocalTopologyManager.class); } private static void writeJUnitReport(String testName, Throwable throwable, String type) {
ISPN-<I> BlockingLocalTopologyManager is blocking - ignore in BlockHound
infinispan_infinispan
train
java
107d16ad2485c3df1fbc79b9d724affe5ffc5026
diff --git a/lib/cisco_node_utils/interface.rb b/lib/cisco_node_utils/interface.rb index <HASH>..<HASH> 100644 --- a/lib/cisco_node_utils/interface.rb +++ b/lib/cisco_node_utils/interface.rb @@ -122,6 +122,7 @@ module Cisco next if k.nil? || v.nil? k.gsub!(/ \(.*\)/, '') # Remove any parenthetical text from key v.strip! + v.gsub!(%r{half/full}, 'half,full') if k == 'Duplex' hash[k] = v end end
Fix half/full in test_duplex * For some 3k, need to munge 'half/full' into csv-style 'half,full' to play nice with interface_capabilities * Tested on n<I>
cisco_cisco-network-node-utils
train
rb
fa4813c7f29114f82a1ab49acf582c00073eff9a
diff --git a/tests/phpunit/includes/Shortcodes/Test_If.php b/tests/phpunit/includes/Shortcodes/Test_If.php index <HASH>..<HASH> 100644 --- a/tests/phpunit/includes/Shortcodes/Test_If.php +++ b/tests/phpunit/includes/Shortcodes/Test_If.php @@ -105,7 +105,7 @@ class Test_If extends \Pods_Unit_Tests\Pods_UnitTestCase { array( 'name' => __FUNCTION__ . '2', 'number1' => 456, - 'number2' => 0, + 'number2' => null, // `0` is a valid number. ) ); $content = base64_encode( 'ABC' ); @@ -177,7 +177,7 @@ class Test_If extends \Pods_Unit_Tests\Pods_UnitTestCase { array( 'name' => 'my post title', 'number1' => 456, - 'number2' => 0, + 'number2' => null, // `0` is a valid number. ) ); $content = base64_encode( '{@number2}[else]{@number1}' );
Update tests: `0` is a valid number
pods-framework_pods
train
php
2b2ab74bc3fdaaed0e2f3fe4508043e0c5c66761
diff --git a/src/services/GeoService.php b/src/services/GeoService.php index <HASH>..<HASH> 100644 --- a/src/services/GeoService.php +++ b/src/services/GeoService.php @@ -769,7 +769,11 @@ class GeoService extends Component $url = str_replace('.json', rawurlencode(', ' . $country) . '.json', $url); } - $data = (string) static::_client()->get($url)->getBody(); + $data = (string) static::_client()->get($url, [ + 'headers' => [ + 'referer' => Craft::$app->urlManager->getHostInfo() + ] + ])->getBody(); $data = Json::decodeIfJson($data); if (!is_array($data) || empty($data['features']))
Include referer header in Mapbox Geocoding request Fixes Mapbox Forbidden issue #<I>.
ethercreative_simplemap
train
php
4bf0149a1679c94834e59cc676f780a2b461c23e
diff --git a/spiketoolkit/sorters/launcher.py b/spiketoolkit/sorters/launcher.py index <HASH>..<HASH> 100644 --- a/spiketoolkit/sorters/launcher.py +++ b/spiketoolkit/sorters/launcher.py @@ -34,7 +34,7 @@ def _run_one(arg_list): def run_sorters(sorter_list, recording_dict_or_list, working_folder, grouping_property=None, - shared_binary_copy=True, engine=None, engine_kargs={}, debug=False, write_log=True): + shared_binary_copy=False, engine=None, engine_kargs={}, debug=False, write_log=True): """ This run several sorter on several recording. Simple implementation will nested loops. @@ -71,7 +71,7 @@ def run_sorters(sorter_list, recording_dict_or_list, working_folder, grouping_p grouping_property: The property of grouping given to sorters. - shared_binary_copy: True default + shared_binary_copy: False default Before running each sorter, all recording are copied inside the working_folder with the raw binary format (BinDatRecordingExtractor) and new recording are done BinDatRecordingExtractor.
shared_binary_copy False by default.
SpikeInterface_spiketoolkit
train
py
136cd8be81ad6b7eecccfb3479651471c10d0aae
diff --git a/topydo/lib/ProgressColor.py b/topydo/lib/ProgressColor.py index <HASH>..<HASH> 100644 --- a/topydo/lib/ProgressColor.py +++ b/topydo/lib/ProgressColor.py @@ -33,7 +33,7 @@ def progress_color(p_todo): 1, # red ] - # https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg + # https://commons.wikimedia.org/wiki/File:Xterm_256color_chart.svg # a gradient from green to yellow to red color256_range = \ [22, 28, 34, 40, 46, 82, 118, 154, 190, 226, 220, 214, 208, 202, 196] @@ -106,13 +106,17 @@ def progress_color(p_todo): else: return 0 - color_range = color256_range if config().colors() == 256 else color16_range + use_256_colors = config().colors() == 256 + color_range = color256_range if use_256_colors else color16_range progress = get_progress(p_todo) # TODO: remove linear scale to exponential scale if progress > 1: # overdue, return the last color return Color(color_range[-1]) + elif p_todo.is_completed(): + # return grey + return Color(243) if use_256_colors else Color(7) else: # not overdue, calculate position over color range excl. due date # color
Show a grey progress color for completed items
bram85_topydo
train
py
0ca133dd7681bb3af1d1de18a5ea6ed42142a11e
diff --git a/network.go b/network.go index <HASH>..<HASH> 100644 --- a/network.go +++ b/network.go @@ -104,7 +104,11 @@ func checkRouteOverlaps(dockerNetwork *net.IPNet) error { continue } if _, network, err := net.ParseCIDR(strings.Split(line, " ")[0]); err != nil { - return fmt.Errorf("Unexpected ip route output: %s (%s)", err, line) + // is this a mask-less IP address? + if ip := net.ParseIP(strings.Split(line, " ")[0]); ip == nil { + // fail only if it's neither a network nor a mask-less IP address + return fmt.Errorf("Unexpected ip route output: %s (%s)", err, line) + } } else if networkOverlaps(dockerNetwork, network) { return fmt.Errorf("Network %s is already routed: '%s'", dockerNetwork.String(), line) }
Handle ip route showing mask-less IP addresses Sometimes `ip route` will show mask-less IPs, so net.ParseCIDR will fail. If it does we check if we can net.ParseIP, and fail only if we can't. Fixes #<I> Fixes #<I>
moby_moby
train
go
e5cb2cd2c20305ab5c009185bd3fb4581e62fb1a
diff --git a/Kwf/Controller/Action/Cli/Web/ComponentDeepCopyController.php b/Kwf/Controller/Action/Cli/Web/ComponentDeepCopyController.php index <HASH>..<HASH> 100644 --- a/Kwf/Controller/Action/Cli/Web/ComponentDeepCopyController.php +++ b/Kwf/Controller/Action/Cli/Web/ComponentDeepCopyController.php @@ -23,6 +23,7 @@ class Kwf_Controller_Action_Cli_Web_ComponentDeepCopyController extends Kwf_Cont public function indexAction() { set_time_limit(0); + ini_set('memory_limit', '512M'); $parentSource = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('source'), array('ignoreVisible'=>true)); if (!$parentSource) throw new Kwf_Exception_Client("source not found");
increase memory limit to avoid problems with memory limit
koala-framework_koala-framework
train
php
7ad001c9744f8270ac9d30dc3a7ab00bd552ef4c
diff --git a/packages/xod-func-tools/test/index.spec.js b/packages/xod-func-tools/test/index.spec.js index <HASH>..<HASH> 100644 --- a/packages/xod-func-tools/test/index.spec.js +++ b/packages/xod-func-tools/test/index.spec.js @@ -61,7 +61,7 @@ describe('tapP', () => { Promise.resolve(1) .then(tapP(promiseFn)); }); - it('should return Promise.reject if inside function return Promise.reject', () => { + it('should return Promise.reject if inner function return Promise.reject', () => { const promiseFn = () => Promise.reject('reject'); Promise.resolve(1)
chore(xod-func-tools): fix a mistake in test case label
xodio_xod
train
js
78071fe3d5490243de3c7544d7935fa10ebe9e97
diff --git a/src/QueryTemplate.php b/src/QueryTemplate.php index <HASH>..<HASH> 100644 --- a/src/QueryTemplate.php +++ b/src/QueryTemplate.php @@ -33,11 +33,6 @@ class QueryTemplate implements QueryTemplateInterface private $loader; /** - * @var string - */ - private $found = null; - - /** * @param \GM\Hierarchy\Finder\TemplateFinderInterface|null $finder * @param \GM\Hierarchy\Loader\TemplateLoaderInterface $loader */ @@ -61,11 +56,7 @@ class QueryTemplate implements QueryTemplateInterface */ public function find(\WP_Query $query = null, $filters = true) { - if (is_string($this->found)) { - return $this->found; - } - - $leaves = (new Hierarchy($query))->get(); + $leaves = (new Hierarchy())->getHierarchy($query); if (! is_array($leaves) || empty($leaves)) { return ''; @@ -79,8 +70,6 @@ class QueryTemplate implements QueryTemplateInterface $filters and $found = $this->applyFilter("{$type}_template", $found, $query); } - (is_string($found) && $found) and $this->found = $found; - return $found; }
Remove cache state from QueryTemplate
Brain-WP_Hierarchy
train
php
08f6eaf6e2d596bb1e7782301d10115ddb56c432
diff --git a/src/edeposit/amqp/aleph/aleph.py b/src/edeposit/amqp/aleph/aleph.py index <HASH>..<HASH> 100755 --- a/src/edeposit/amqp/aleph/aleph.py +++ b/src/edeposit/amqp/aleph/aleph.py @@ -61,7 +61,7 @@ counting results from getters): getISBNCount() getAuthorsBooksCount() - getPublishersBooksIDsCount() + getPublishersBooksCount() - Other noteworthy properties ---------------------------------------------- Properties VALID_ALEPH_BASES and VALID_ALEPH_FIELDS can be specific only to @@ -456,5 +456,5 @@ def getAuthorsBooksCount(author, base="nkc"): return searchInAleph(base, author, False, "wau")["no_entries"] -def getPublishersBooksIDsCount(publisher, base="nkc"): +def getPublishersBooksCount(publisher, base="nkc"): return searchInAleph(base, publisher, False, "wpb")["no_entries"]
getPublishersBooksIDsCount() renamed to getPublishersBooksCount().
edeposit_edeposit.amqp.aleph
train
py
fbfcaba327f349f138d29c6ef9671c3506ca01fa
diff --git a/build/Gruntfile.js b/build/Gruntfile.js index <HASH>..<HASH> 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -6,19 +6,18 @@ module.exports = function(grunt) { jsdoc : { src : { src: ['../Tone/**/*.js', '../README.md'], - //src: ['../Tone.js'], options: { destination: '../doc', - //configure: './config/jsdoc.conf.json', template : "./doc_config/template", configure : "./doc_config/template/jsdoc.conf.json" - //template : "readable", } }, dist : { src: ['../Tone.js'], options: { - destination: '../doc' + destination: '../doc', + template : "./doc_config/template", + configure : "./doc_config/template/jsdoc.conf.json" } } },
pointing to docblockr config for building dist
Tonejs_Tone.js
train
js
a2f6399806e159aa406f7a775f7baf2d870a4530
diff --git a/grade/report/singleview/index.php b/grade/report/singleview/index.php index <HASH>..<HASH> 100644 --- a/grade/report/singleview/index.php +++ b/grade/report/singleview/index.php @@ -46,7 +46,16 @@ if (empty($itemid)) { } $courseparams = array('id' => $courseid); -$PAGE->set_url(new moodle_url('/grade/report/singleview/index.php', $courseparams)); +$pageparams = array( + 'id' => $courseid, + 'group' => $groupid, + 'userid' => $userid, + 'itemid' => $itemid, + 'item' => $itemtype, + 'page' => $page, + 'perpage' => $perpage, + ); +$PAGE->set_url(new moodle_url('/grade/report/singleview/index.php', $pageparams)); $PAGE->set_pagelayout('incourse'); if (!$course = $DB->get_record('course', $courseparams)) {
MDL-<I> gradereport_singleview: Correct url params supplied to PAGE
moodle_moodle
train
php
08aa5b446c22e171c8185e5372b1db1f434e7bca
diff --git a/src/class/method.js b/src/class/method.js index <HASH>..<HASH> 100644 --- a/src/class/method.js +++ b/src/class/method.js @@ -216,15 +216,15 @@ define( function attachInstanceMethod (constructor, options) { var methods = constructor.prototype, - existing = methods[options.name], overload = true, signature = getSignature(options), hasSignature = type.is("string", signature), + existing = methods[options.name], implementationExists = type.is("function", existing); if (hasSignature && (!implementationExists || options.override)) { existing = Function.Abstract(options.name); - } else if (options.override) { + } else if (!hasSignature) { overload = false; }
more work on method overload/override logic
bob-gray_solv
train
js
48c378a3c603d3fa538eed5d6976883548195a39
diff --git a/Swat/SwatTableViewColumn.php b/Swat/SwatTableViewColumn.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTableViewColumn.php +++ b/Swat/SwatTableViewColumn.php @@ -483,7 +483,7 @@ class SwatTableViewColumn extends SwatCellRendererContainer // Set the properties of the renderers to the value of the data field. foreach ($this->renderers as $renderer) { $this->renderers->applyMappingsToRenderer($renderer, $data); - $renderer->sensitive = $sensitive; + $renderer->sensitive = $renderer->sensitive && $sensitive; } }
allow sensitivity to be set dynamically on cell renderers svn commit r<I>
silverorange_swat
train
php
20cceb85eab2b354e82ae9d28fdcf3e569e794cf
diff --git a/src/main/groovy/util/GroovyScriptEngine.java b/src/main/groovy/util/GroovyScriptEngine.java index <HASH>..<HASH> 100644 --- a/src/main/groovy/util/GroovyScriptEngine.java +++ b/src/main/groovy/util/GroovyScriptEngine.java @@ -312,7 +312,7 @@ public class GroovyScriptEngine implements ResourceConnector { } } catch (IOException e1) { groovyScriptConn = null; - String message = "Cannot open URL: " + scriptURL; + String message = "Cannot open URL: " + root + resourceName; groovyScriptConn = null; if (se == null) { se = new ResourceException(message);
GROOVY-<I>: improve exception text by not using the resulting URL, but root+resourceName
apache_groovy
train
java
3ff37bf2b2964efb2e2186dc7f630810ed94bba2
diff --git a/test/stateSpec.js b/test/stateSpec.js index <HASH>..<HASH> 100644 --- a/test/stateSpec.js +++ b/test/stateSpec.js @@ -34,10 +34,6 @@ describe('Initial state', () => { const patchId = Object.keys(initialState.project.patches)[0]; chai.expect(initialState.project.patches[patchId]).to.have.any.keys(['nodes']); }); - it('pins', () => { - const patchId = Object.keys(initialState.project.patches)[0]; - chai.expect(initialState.project.patches[patchId]).to.have.any.keys(['pins']); - }); it('links', () => { const patchId = Object.keys(initialState.project.patches)[0]; chai.expect(initialState.project.patches[patchId]).to.have.any.keys(['links']);
fix(test): fix a simplest test, that checks a state shape for existing of pins inside patches
xodio_xod
train
js
6dec3e224f3a2f3ec7c9b703c164dafb9a5768fa
diff --git a/src/metpy/cbook.py b/src/metpy/cbook.py index <HASH>..<HASH> 100644 --- a/src/metpy/cbook.py +++ b/src/metpy/cbook.py @@ -4,6 +4,7 @@ """Collection of generally useful utility code from the cookbook.""" import os +from pathlib import Path import numpy as np import pooch @@ -19,13 +20,11 @@ POOCH = pooch.create( # Check if we have the data available directly from a git checkout, either from the # TEST_DATA_DIR variable, or looking relative to the path of this module's file. Use this # to override Pooch's path. -dev_data_path = os.environ.get('TEST_DATA_DIR', - os.path.join(os.path.dirname(__file__), - '..', '..', 'staticdata')) -if os.path.exists(dev_data_path): +dev_data_path = os.environ.get('TEST_DATA_DIR', Path(__file__).parents[2] / 'staticdata') +if Path(dev_data_path).exists(): POOCH.path = dev_data_path -POOCH.load_registry(os.path.join(os.path.dirname(__file__), 'static-data-manifest.txt')) +POOCH.load_registry(Path(__file__).parent / 'static-data-manifest.txt') def get_test_data(fname, as_file_obj=True, mode='rb'):
MNT: Use pathlib in registry setup code
Unidata_MetPy
train
py
48c4799429ae6ecd74fb7247442e91c58e6e0e3b
diff --git a/trashcli/filesystem.py b/trashcli/filesystem.py index <HASH>..<HASH> 100644 --- a/trashcli/filesystem.py +++ b/trashcli/filesystem.py @@ -109,7 +109,12 @@ class Path (unipath.Path) : def mkdir(self): os.mkdir(self.path) - def mkdirs(self, mode=0777): + def mkdirs(self): + if self.isdir(): + return + os.makedirs(self.path) + + def mkdirs_using_mode(self, mode): if self.isdir(): os.chmod(self.path, mode) return diff --git a/trashcli/trash.py b/trashcli/trash.py index <HASH>..<HASH> 100644 --- a/trashcli/trash.py +++ b/trashcli/trash.py @@ -84,7 +84,7 @@ class TrashDirectory(object) : trash_info.deletion_date) if not self.files_dir.exists() : - self.files_dir.mkdirs(0700) + self.files_dir.mkdirs_using_mode(0700) try : path.move(trashed_file.actual_path) @@ -189,7 +189,7 @@ class TrashDirectory(object) : def persist_trash_info(self,trash_info) : assert(isinstance(trash_info, TrashInfo)) - self.info_dir.mkdirs(0700) + self.info_dir.mkdirs_using_mode(0700) self.info_dir.chmod(0700) # write trash info
Fixed #<I>: restore-trash sets all-write permissions for the destination directory
andreafrancia_trash-cli
train
py,py
2dd667e598f3f222efd68440c79fd424d724e392
diff --git a/ui/src/utils/queryTransitions.js b/ui/src/utils/queryTransitions.js index <HASH>..<HASH> 100644 --- a/ui/src/utils/queryTransitions.js +++ b/ui/src/utils/queryTransitions.js @@ -19,15 +19,23 @@ export function chooseMeasurement(query, measurement) { } export const toggleField = (query, {field, funcs}, isKapacitorRule = false) => { - const isSelected = query.fields.find(f => f.field === field) + const {fields, groupBy} = query + + if (!fields) { + return { + ...query, + fields: [{field, funcs: ['mean']}], + } + } + + const isSelected = fields.find(f => f.field === field) if (isSelected) { - const nextFields = query.fields.filter(f => f.field !== field) + const nextFields = fields.filter(f => f.field !== field) if (!nextFields.length) { - const nextGroupBy = {...query.groupBy, time: null} return { ...query, fields: nextFields, - groupBy: nextGroupBy, + groupBy: {...groupBy, time: null}, } }
Update toggle field function to handle missing field key
influxdata_influxdb
train
js
684f37c29ad8193ba4436ac1598f885d3ed353e0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -26,7 +26,7 @@ function docdown(options) { }); if (!options.path || !options.url) { - throw new Error('Path and/or URL must be specified'); + throw new Error('Path and URL must be specified'); } return generator(fs.readFileSync(options.path, 'utf8'), options); }
Fix error message as `path` and `url` are required. [closes #<I>]
jdalton_docdown
train
js
809cf5d21ca7ca7ba5f4168cda8fb58ec0eb723c
diff --git a/lib/CoreBot.js b/lib/CoreBot.js index <HASH>..<HASH> 100755 --- a/lib/CoreBot.js +++ b/lib/CoreBot.js @@ -823,7 +823,7 @@ function Botkit(configuration) { // set up a once a second tick to process messages botkit.tickInterval = setInterval(function() { botkit.tick(); - }, 1000); + }, 1500); } };
This should be updated to <I> seconds because Facebooks servers sometimes process messages out of order when using images due to the file size processing time. <I> seconds seems to fix it.
howdyai_botkit
train
js
dfea8df7c9c3d469fcf5605e71c803a9ceb5cc69
diff --git a/superset/cli.py b/superset/cli.py index <HASH>..<HASH> 100755 --- a/superset/cli.py +++ b/superset/cli.py @@ -195,7 +195,7 @@ def worker(workers): CELERYD_CONCURRENCY=config.get("SUPERSET_CELERY_WORKERS")) worker = celery_app.Worker(optimization='fair') - worker.run() + worker.start() @manager.option(
Fix celery worker (#<I>)
apache_incubator-superset
train
py
0a40da8a6c15abffc0a4165b9c73ced25fe0f12f
diff --git a/spec/retext-emoji.spec.js b/spec/retext-emoji.spec.js index <HASH>..<HASH> 100755 --- a/spec/retext-emoji.spec.js +++ b/spec/retext-emoji.spec.js @@ -914,10 +914,7 @@ describe('emoji()', function () { ); }); -for (name in gemoji.name) { - unicode = gemoji.name[name]; - name = ':' + name + ':'; - +function describeEmoji(name, unicode) { describe('emoji `' + unicode + '`', function () { it('should decode the emoticon (from `' + unicode + '` to `' + name + '`)', function () { @@ -944,3 +941,7 @@ for (name in gemoji.name) { ); }); } + +for (name in gemoji.name) { + describeEmoji(':' + name + ':', gemoji.name[name]); +}
Fixed a bug in the spec where emoji were not correctly tested
retextjs_retext-emoji
train
js
ef85c7227796d0c1761d5bad4e264d26c19ede59
diff --git a/irc3/plugins/autocommand.py b/irc3/plugins/autocommand.py index <HASH>..<HASH> 100644 --- a/irc3/plugins/autocommand.py +++ b/irc3/plugins/autocommand.py @@ -26,7 +26,7 @@ This example will authorize on Freenode: ... irc3.plugins.autocommand ... ... autocommands = - ... PRIVMSG NickServ IDENTIFY nick password + ... PRIVMSG NickServ :IDENTIFY nick password ... """) >>> bot = IrcBot(**config) @@ -41,7 +41,7 @@ Here's another, more complicated example: ... AUTH user password ... MODE {nick} +x ... /sleep 2 - ... PRIVMSG Q INVITE #inviteonly + ... PRIVMSG Q :INVITE #inviteonly ... """) >>> bot = IrcBot(**config)
Added ':' to PRIVMSG in documentation
gawel_irc3
train
py
44e64344f05e76613f62a3eb12d61f6eecaaed20
diff --git a/code/controllers/ReportAdmin.php b/code/controllers/ReportAdmin.php index <HASH>..<HASH> 100644 --- a/code/controllers/ReportAdmin.php +++ b/code/controllers/ReportAdmin.php @@ -99,10 +99,23 @@ class ReportAdmin extends LeftAndMain implements PermissionProvider { public static function has_reports() { return sizeof(SS_Report::get_reports()) > 0; } - - public function updatereport() { - // FormResponse::load_form($this->EditForm()->forTemplate()); - // return FormResponse::respond(); + + /** + * Returns the Breadcrumbs for the ReportAdmin + * @return ArrayList + */ + public function Breadcrumbs() { + $items = parent::Breadcrumbs(); + + if ($this->reportObject) { + //build breadcrumb trail to the current report + $items->push(new ArrayData(array( + 'Title' => $this->reportObject->title(), + 'Link' => Controller::join_links($this->Link(), '?' . http_build_query(array('q' => $this->request->requestVar('q')))) + ))); + } + + return $items; } function providePermissions() {
ENHANCEMENT: SSF-<I> adding breadcrumbs to ReportAdmin
silverstripe_silverstripe-siteconfig
train
php
3616dc5e742f1ae34f2455e4d9dfa1051e63f062
diff --git a/tests/framework/console/controllers/MigrateControllerTest.php b/tests/framework/console/controllers/MigrateControllerTest.php index <HASH>..<HASH> 100644 --- a/tests/framework/console/controllers/MigrateControllerTest.php +++ b/tests/framework/console/controllers/MigrateControllerTest.php @@ -171,6 +171,10 @@ class MigrateControllerTest extends TestCase public function testCreateLongNamedMigration() { + $this->setOutputCallback(function($output) { + return null; + }); + $migrationName = str_repeat('a', 180); $this->expectException('yii\console\Exception'); diff --git a/tests/framework/widgets/FragmentCacheTest.php b/tests/framework/widgets/FragmentCacheTest.php index <HASH>..<HASH> 100644 --- a/tests/framework/widgets/FragmentCacheTest.php +++ b/tests/framework/widgets/FragmentCacheTest.php @@ -196,6 +196,10 @@ class FragmentCacheTest extends \yiiunit\TestCase public function testVariations() { + $this->setOutputCallback(function($output) { + return null; + }); + ob_start(); ob_implicit_flush(false); $view = new View();
Fix test output (Prevent output among phpunit tests) (#<I>) * Clear output in MigrateControllerTest::testCreateLongNamedMigration * Clear output in FragmentCacheTest::testVariations
yiisoft_yii2
train
php,php
f94a30c31861a97f282de3db64aead98f469d94c
diff --git a/plugins/sigma.parsers.json/sigma.parsers.json.js b/plugins/sigma.parsers.json/sigma.parsers.json.js index <HASH>..<HASH> 100644 --- a/plugins/sigma.parsers.json/sigma.parsers.json.js +++ b/plugins/sigma.parsers.json/sigma.parsers.json.js @@ -74,8 +74,8 @@ // ...or it's finally the callback: } else if (typeof sig === 'function') { - sig = null; callback = sig; + sig = null; } // Call the callback if specified:
Minor fix in sigma.parsers.json When called with only a path and a callback, the callback was actually not called at all. Now it is.
jacomyal_sigma.js
train
js
7dc9570cea5687bf658d7c88a0736616ab0c3f48
diff --git a/boil/environment.py b/boil/environment.py index <HASH>..<HASH> 100644 --- a/boil/environment.py +++ b/boil/environment.py @@ -14,6 +14,8 @@ class PlateEnvironment(jinja2.Environment): def _setup_filters(self): self.filters.update(filters.TEMPLATE_FILTERS) + if hasattr(self.plate, 'FILTERS'): + self.filters.update(self.plate.FILTERS) def get(plate, **kwargs):
Add plate-defined filters to template environment
bzurkowski_boil
train
py
c7c58e3ddb5dec3b9103820b69fbc18dc54ed15d
diff --git a/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java b/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java index <HASH>..<HASH> 100644 --- a/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java +++ b/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java @@ -56,6 +56,8 @@ public class Environment extends AbstractLifeCycle { /** * Creates a new environment. + * + * @param configuration the service's {@link Configuration} */ public Environment(Configuration configuration) { this.config = new DropwizardResourceConfig() {
Fix a Javadoc issue in Environment.
dropwizard_dropwizard
train
java
2b296f0211ac0ed0e4036a3863283f74f058d531
diff --git a/lib/fit4ruby/GlobalFitDictionaries.rb b/lib/fit4ruby/GlobalFitDictionaries.rb index <HASH>..<HASH> 100644 --- a/lib/fit4ruby/GlobalFitDictionaries.rb +++ b/lib/fit4ruby/GlobalFitDictionaries.rb @@ -86,6 +86,7 @@ module Fit4Ruby entry 36, 'calibration' entry 37, 'vo2max' # guess entry 38, 'recovery_time' # guess (in minutes) + entry 39, 'recovery_info' # guess (in minutes, < 24 good, > 24h poor) entry 42, 'front_gear_change' entry 43, 'rear_gear_change'
Adding recovery_info. Just a guess right now.
scrapper_fit4ruby
train
rb
5c31fe167eec2579f940526829a12e7719490481
diff --git a/modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java b/modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java index <HASH>..<HASH> 100644 --- a/modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java +++ b/modules/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/signavio/SignavioConnector.java @@ -639,6 +639,7 @@ public class SignavioConnector extends AbstractRepositoryConnector<SignavioConne public String transformJsonToBpmn20Xml(String jsonData) { try { JSONObject json = new JSONObject(jsonData); + de.hpi.bpmn2_0.factory.configuration.Configuration.ensureSignavioStyle = false; // disable regeneration of IDs that don't match Signavio's ID pattern Json2XmlConverter converter = new Json2XmlConverter(json.toString(), this.getClass().getClassLoader().getResource("META-INF/validation/xsd/BPMN20.xsd") .toString()); return converter.getXml().toString();
ACT-<I> BPMN <I> Export in Cycle: Disabled regeneration of IDs that don't match Signavio's ID pattern
Activiti_Activiti
train
java
23fd202c59b6414182ee8b09c068ebd5503667af
diff --git a/src/editor/EditorManager.js b/src/editor/EditorManager.js index <HASH>..<HASH> 100644 --- a/src/editor/EditorManager.js +++ b/src/editor/EditorManager.js @@ -517,11 +517,17 @@ define(function (require, exports, module) { PerfUtils.markStart(PerfUtils.INLINE_EDITOR_CLOSE); inlineWidget.close(); PerfUtils.addMeasurement(PerfUtils.INLINE_EDITOR_CLOSE); + + // return a resolved promise to CommandManager + return new $.Deferred().resolve().promise(); } else { // main editor has focus, so create an inline editor - _openInlineWidget(_currentEditor); + return _openInlineWidget(_currentEditor); } } + + // Can not open an inline editor without a host editor + return new $.Deferred().reject().promise(); } CommandManager.register(Strings.CMD_SHOW_INLINE_EDITOR, Commands.SHOW_INLINE_EDITOR, _showInlineEditor);
Fix SHOW_INLINE_EDITOR command handler to return a promise.
adobe_brackets
train
js
c9544f51af4b9a32b75ae6281a92269beb5de5c2
diff --git a/aws/resource_aws_security_group.go b/aws/resource_aws_security_group.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_security_group.go +++ b/aws/resource_aws_security_group.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "log" + "regexp" "sort" "strconv" "strings" @@ -47,7 +48,10 @@ func resourceAwsSecurityGroup() *schema.Resource { Computed: true, ForceNew: true, ConflictsWith: []string{"name_prefix"}, - ValidateFunc: validation.StringLenBetween(0, 255), + ValidateFunc: validation.All( + validation.StringLenBetween(0, 255), + validation.StringDoesNotMatch(regexp.MustCompile(`^sg-`), "cannot begin with sg-"), + ), }, "name_prefix": {
Validate that security group names aren't prefixed with sg- The [API docs](<URL>) have this to say: > Constraints: Up to <I> characters in length. Cannot start with sg-.
terraform-providers_terraform-provider-aws
train
go
af5486938b7d59abcf49db5ad290266771a74071
diff --git a/generate_test.go b/generate_test.go index <HASH>..<HASH> 100644 --- a/generate_test.go +++ b/generate_test.go @@ -14,8 +14,9 @@ func TestGenerate(t *testing.T) { } func ExampleGenerate() { + Seed(11) fmt.Println(Generate("{name.first} {name.last} lives at {address.number} {address.street_name} {address.street_suffix}")) - // Output: Estell Fay lives at 54407 Plaza berg + // Output: Markus Moen lives at 715 Garden mouth } func BenchmarkGenerate(b *testing.B) {
generate - added seeded.
brianvoe_gofakeit
train
go
6bca23ee168ae9cd5ce25a5b789432ab105980f3
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1067,6 +1067,9 @@ class Matcher(object): log.error('Targeted pillar "{0}" not found'.format(comps[0])) return False if isinstance(match, dict): + if comps[1] == '*': + # We are just checking that the key exists + return True log.error('Targeted pillar "{0}" must correspond to a list, ' 'string, or numeric value'.format(comps[0])) return False
allow matching on presence of a key when value is a dict
saltstack_salt
train
py
abfea8e8495de1b73b6c6c8d7d2e407a760d82e8
diff --git a/src/org/opencms/module/CmsModule.java b/src/org/opencms/module/CmsModule.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/module/CmsModule.java +++ b/src/org/opencms/module/CmsModule.java @@ -1,7 +1,7 @@ /* * File : $Source: /alkacon/cvs/opencms/src/org/opencms/module/CmsModule.java,v $ - * Date : $Date: 2005/06/26 15:54:25 $ - * Version: $Revision: 1.24 $ + * Date : $Date: 2005/06/27 09:31:09 $ + * Version: $Revision: 1.25 $ * * This library is part of OpenCms - * the Open Source Content Mananagement System @@ -59,7 +59,7 @@ import org.apache.commons.logging.Log; * * @author Alexander Kandzior * - * @version $Revision: 1.24 $ + * @version $Revision: 1.25 $ * * @since 6.0.0 * @@ -671,7 +671,7 @@ public class CmsModule implements Comparable { * * @param actionInstance the module action instance for this module */ - public void setActionInstance(I_CmsModuleAction actionInstance) { + /*package*/void setActionInstance(I_CmsModuleAction actionInstance) { m_actionInstance = actionInstance;
setActionInstance is now package protected to avoid external access
alkacon_opencms-core
train
java
ef751aedfde35a01fbb4d252e6836cda85408b55
diff --git a/user/view.php b/user/view.php index <HASH>..<HASH> 100644 --- a/user/view.php +++ b/user/view.php @@ -29,8 +29,6 @@ require_once($CFG->dirroot.'/tag/lib.php'); $id = optional_param('id', 0, PARAM_INT); // user id $courseid = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site) -$enable = optional_param('enable', 0, PARAM_BOOL); // enable email -$disable = optional_param('disable', 0, PARAM_BOOL); // disable email if (empty($id)) { // See your own profile by default require_login();
MDL-<I> removed old parameters, no longer used
moodle_moodle
train
php
b6fad37aadf511f025b596167a9c05e2a2244363
diff --git a/src/ShareFacade.php b/src/ShareFacade.php index <HASH>..<HASH> 100644 --- a/src/ShareFacade.php +++ b/src/ShareFacade.php @@ -14,6 +14,5 @@ class ShareFacade extends Facade protected static function getFacadeAccessor() { return static::$app['share']; - return 'share'; } }
Use new instance every time the facade is called
jorenvh_laravel-share
train
php
c01b1a9df0f380404af4ac42b2c19fa113c02a1a
diff --git a/sample/src/main/java/com/alexvasilkov/gestures/sample/utils/glide/GlideHelper.java b/sample/src/main/java/com/alexvasilkov/gestures/sample/utils/glide/GlideHelper.java index <HASH>..<HASH> 100644 --- a/sample/src/main/java/com/alexvasilkov/gestures/sample/utils/glide/GlideHelper.java +++ b/sample/src/main/java/com/alexvasilkov/gestures/sample/utils/glide/GlideHelper.java @@ -28,6 +28,7 @@ public class GlideHelper { public static void loadResource(@DrawableRes int drawableId, @NonNull ImageView image) { Glide.with(image.getContext()) .load(drawableId) + .animate(ANIMATOR) .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) .into(new GlideDrawableImageViewTarget(image)); }
Fixed glide animation issue which leaves views detached
alexvasilkov_GestureViews
train
java
92120437b1dd063d71231a0d831c0350c4fc3049
diff --git a/src/Server.js b/src/Server.js index <HASH>..<HASH> 100644 --- a/src/Server.js +++ b/src/Server.js @@ -134,7 +134,7 @@ class Server extends EventEmitter { * @param {code} [code=1000] Code as per WebSocket spec. * @returns {Promise<undefined>} Promise. */ - close (code = 1000) : Promise<void> { + close (code: number = 1000) : Promise<void> { for (let [, client] of this.clients) { client.close(code) }
refactor: add missing flow type
an-sh_ws-messaging
train
js
aea486c8d531ee5c1a5b3419d377c339182cbc69
diff --git a/lib/classes/useragent.php b/lib/classes/useragent.php index <HASH>..<HASH> 100644 --- a/lib/classes/useragent.php +++ b/lib/classes/useragent.php @@ -500,17 +500,17 @@ class core_useragent { } else { return false; } - $compat_view = false; + $compatview = false; // IE8 and later versions may pretend to be IE7 for intranet sites, use Trident version instead, // the Trident should always describe the capabilities of IE in any emulation mode. if ($browser === '7.0' and preg_match("/Trident\/([0-9\.]+)/", $useragent, $match)) { - $compat_view = true; + $compatview = true; $browser = $match[1] + 4; // NOTE: Hopefully this will work also for future IE versions. } $browser = round($browser, 1); return array( 'version' => $browser, - 'compatview' => $compat_view + 'compatview' => $compatview ); }
MDL-<I> Libraries Wrong naming convention in $compat_view.
moodle_moodle
train
php
e04bb6ce9b2e339a26dac70200b9005d1a263b5a
diff --git a/src/assessments/seo/KeyphraseDistributionAssessment.js b/src/assessments/seo/KeyphraseDistributionAssessment.js index <HASH>..<HASH> 100644 --- a/src/assessments/seo/KeyphraseDistributionAssessment.js +++ b/src/assessments/seo/KeyphraseDistributionAssessment.js @@ -67,7 +67,7 @@ class KeyphraseDistributionAssessment extends Assessment { assessmentResult.setScore( calculatedResult.score ); assessmentResult.setText( calculatedResult.resultText ); - assessmentResult.setHasMarks( calculatedResult.score > 0 ); + assessmentResult.setHasMarks( calculatedResult.score > 0 && calculatedResult.score < 9 ); return assessmentResult; }
Disable markers when the result is good
Yoast_YoastSEO.js
train
js
467bb2f337a7e6dcd6b9d269a681c80fd3ef6acc
diff --git a/spec/api_response.rb b/spec/api_response.rb index <HASH>..<HASH> 100644 --- a/spec/api_response.rb +++ b/spec/api_response.rb @@ -2,8 +2,9 @@ require 'spec_helper' require 'test_classes/projects' describe "APIResponse" do + pending "No previos spec" it "should parse response" do - + # Code me maybe? end end
Added pending message to api_response_spec
AlexDenisov_grape_doc
train
rb
7acae3db158099a575c0777d1bad4a3294d6d044
diff --git a/lib/xmlhttprequest.js b/lib/xmlhttprequest.js index <HASH>..<HASH> 100644 --- a/lib/xmlhttprequest.js +++ b/lib/xmlhttprequest.js @@ -1,8 +1,5 @@ // browser shim for xmlhttprequest module -// Indicate to eslint that ActiveXObject is global -/* global ActiveXObject */ - var hasCORS = require('has-cors'); module.exports = function (opts) { @@ -34,7 +31,7 @@ module.exports = function (opts) { if (!xdomain) { try { - return new ActiveXObject('Microsoft.XMLHTTP'); + return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP'); } catch (e) { } } };
[fix] Obfuscate `ActiveXObject` occurrences (#<I>) Some corporate firewalls/proxies such as Blue Coat prevent JavaScript files from being downloaded if they contain the word "ActiveX".
socketio_engine.io-client
train
js
b5c69f197967b41987367f77b7bc4501945b6808
diff --git a/src/Piano.js b/src/Piano.js index <HASH>..<HASH> 100644 --- a/src/Piano.js +++ b/src/Piano.js @@ -48,6 +48,7 @@ function Key(props) { }} onMouseDown={props.onNoteDown} onMouseUp={props.onNoteUp} + onMouseOver={props.isMouseDown ? props.onNoteDown : null} onMouseOut={props.onNoteUp} onTouchStart={props.onNoteDown} onTouchCancel={props.onNoteUp} @@ -95,6 +96,7 @@ class Piano extends React.Component { }; componentDidMount() { + // TODO: removeEventListener calls window.addEventListener('mousedown', () => { this.setState({ isMouseDown: true, @@ -271,6 +273,7 @@ class Piano extends React.Component { )} onNoteDown={this.handleNoteDown.bind(this, num)} onNoteUp={this.handleNoteUp.bind(this, num)} + isMouseDown={this.state.isMouseDown} key={num} > {this.props.disabled
allow mouse dragging over keys with isMouseDown state
kevinsqi_react-piano
train
js
0c9fad3cb0f53b74f11fab2c8b9a168e168ed2ff
diff --git a/src/boot_node.js b/src/boot_node.js index <HASH>..<HASH> 100644 --- a/src/boot_node.js +++ b/src/boot_node.js @@ -1,11 +1,15 @@ /*jshint node: true*/ -/*global require, __dirname*/ -/*global _gpfFinishLoading*/ // Ends the loading (declared in boot.js) +/*global gpfSourcesPath*/ // Global source path /*global _gpfNodeFS*/ // Node FS module +/*global _gpfFinishLoading*/ // Ends the loading (declared in boot.js) (function () { "use strict"; - require("./sources.js"); // Get sources + // Get sources + /*jslint evil: true*/ + eval(_gpfNodeFS.readFileSync(gpfSourcesPath + "sources.js").toString()); + /*jslint evil: false*/ + var sources = gpf.sources().split(","), length = sources.length, @@ -19,7 +23,7 @@ if (!src) { break; } - src = __dirname + "/" + src + ".js"; + src = gpfSourcesPath + src + ".js"; concat.push(_gpfNodeFS.readFileSync(src).toString()); }
Can't use require for node
ArnaudBuchholz_gpf-js
train
js
a24a7113c856696de1d7a993ffaf9021e86cecd1
diff --git a/src/gl-matrix/mat4.js b/src/gl-matrix/mat4.js index <HASH>..<HASH> 100644 --- a/src/gl-matrix/mat4.js +++ b/src/gl-matrix/mat4.js @@ -1011,7 +1011,7 @@ export function getRotation(out, mat) { out[0] = (mat[6] - mat[9]) / S; out[1] = (mat[8] - mat[2]) / S; out[2] = (mat[1] - mat[4]) / S; - } else if ((mat[0] > mat[5])&(mat[0] > mat[10])) { + } else if ((mat[0] > mat[5]) && (mat[0] > mat[10])) { S = Math.sqrt(1.0 + mat[0] - mat[5] - mat[10]) * 2; out[3] = (mat[6] - mat[9]) / S; out[0] = 0.25 * S;
Fixed an issue related to getRotation in mat4 Fixed an issue as bitwise `&` was used instead of logical `&&`
toji_gl-matrix
train
js
434d0e5bfb648979fe6ba6dbed50eb9b7005b2d1
diff --git a/openquake/engine/export/hazard.py b/openquake/engine/export/hazard.py index <HASH>..<HASH> 100644 --- a/openquake/engine/export/hazard.py +++ b/openquake/engine/export/hazard.py @@ -104,6 +104,10 @@ def _get_result_export_path(calc_id, target_dir, result): core.makedirs(directory) if output_type in ('hazard_curve', 'hazard_map', 'uh_spectra'): + # include the poe in hazard map and uhs file names + if output_type in ('hazard_map', 'uh_spectra'): + output_type = '%s-poe_%s' % (output_type, result.poe) + if result.statistics is not None: # we could have stats if result.statistics == 'quantile':
export/hazard: Include "-poe_N.N-" in filenames for UHS and hazard maps.
gem_oq-engine
train
py