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
821f6a03681c23401dca9cc669720e7f8eaa38a9
diff --git a/app/assets/javascripts/fastui/app/view/VTab.js b/app/assets/javascripts/fastui/app/view/VTab.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/fastui/app/view/VTab.js +++ b/app/assets/javascripts/fastui/app/view/VTab.js @@ -6,7 +6,6 @@ Ext.define('FastUI.view.VTab', { layout:"card", initComponent:function () { this.id = 'tab_' + this.vfactory.getVData().id; -// alert(this.vfactory.getVData().m_entity_id) FastUI.Env.setTabCtx(FastUI.Env.getWinCtx('winNo','win_id'),'tabNo','tab_id',this.id); // FastUI.Env.setTabCtx(FastUI.Env.getWinCtx('winNo','win_id'),'tabNo','m_entity_id',this.vfactory.getVData().m_entity_id); // alert(FastUI.Env.getTabCtx(FastUI.Env.getWinCtx('winNo','win_id'),'tabNo','tab_id'));
create abstract class MObject most of class are inherit it
songgz_fastui
train
js
16392e6ae52631254d16e38496c510d7504c85a2
diff --git a/modules/smartnameattribute/lib/Auth/Process/SmartName.php b/modules/smartnameattribute/lib/Auth/Process/SmartName.php index <HASH>..<HASH> 100644 --- a/modules/smartnameattribute/lib/Auth/Process/SmartName.php +++ b/modules/smartnameattribute/lib/Auth/Process/SmartName.php @@ -21,6 +21,11 @@ class sspmod_smartnameattribute_Auth_Process_SmartName extends SimpleSAML_Auth_P if (isset($attributes['displayName'])) return $attributes['displayName'][0]; + if (isset($attributes['cn'])) { + if (count(explode(' ', $attributes['cn'][0])) > 1) + return $attributes['cn'][0]; + } + if (isset($attributes['sn']) && isset($attributes['givenName'])) return $attributes['givenName'][0] . ' ' . $attributes['sn'][0];
use cn if contains multiple parts
simplesamlphp_saml2
train
php
5835f2f955819aa1aa4e52e1d98e885be4aa9af8
diff --git a/lib/chef/json_compat.rb b/lib/chef/json_compat.rb index <HASH>..<HASH> 100644 --- a/lib/chef/json_compat.rb +++ b/lib/chef/json_compat.rb @@ -18,8 +18,6 @@ # Wrapper class for interacting with JSON. require 'ffi_yajl' -#require 'json' -require 'ffi_yajl/json_gem' # XXX: parts of chef require JSON gem's Hash#to_json monkeypatch require 'chef/exceptions' class Chef
Removing old .to_json monkeypatching for all objects
chef_chef
train
rb
8703a569afe53bcd62218bf5e7f4071dd3247b42
diff --git a/anchore/cli/toolbox.py b/anchore/cli/toolbox.py index <HASH>..<HASH> 100644 --- a/anchore/cli/toolbox.py +++ b/anchore/cli/toolbox.py @@ -325,6 +325,10 @@ def show_analyzer_status(): @click.option('--outfile', help='output file for exported image', required=True, metavar='<file.json>') def export(outfile): """Export image anchore data to a JSON file.""" + + if not nav: + sys.exit(1) + ecode = 0 savelist = list() for imageId in imagelist:
small fix to disallow export if image has not been analyzed
anchore_anchore
train
py
efccb194e5d88310679299ba74b971f61aee0847
diff --git a/tests/Functional/Table/TableServiceFunctionalTest.php b/tests/Functional/Table/TableServiceFunctionalTest.php index <HASH>..<HASH> 100644 --- a/tests/Functional/Table/TableServiceFunctionalTest.php +++ b/tests/Functional/Table/TableServiceFunctionalTest.php @@ -215,7 +215,7 @@ class TableServiceFunctionalTest extends FunctionalTestBase $this->assertFalse($this->isEmulated(), 'Should succeed when not running in emulator'); - \sleep(10); + \sleep(30); $ret = (is_null($options) ? $this->restProxy->getServiceProperties() :
Resolve set service properties issue.
Azure_azure-storage-php
train
php
c3988603afa528d7835ae45e199d4b36ae540afb
diff --git a/main/cloudfoundry_client/v3/apps.py b/main/cloudfoundry_client/v3/apps.py index <HASH>..<HASH> 100644 --- a/main/cloudfoundry_client/v3/apps.py +++ b/main/cloudfoundry_client/v3/apps.py @@ -11,3 +11,6 @@ class AppManager(EntityManager): def get_env(self, application_guid: str) -> JsonObject: return super(AppManager, self)._get('%s%s/%s/env' % (self.target_endpoint, self.entity_uri, application_guid)) + + def get_routes(self, application_guid: str) -> JsonObject: + return super(AppManager, self)._get('%s%s/%s/routes' % (self.target_endpoint, self.entity_uri, application_guid))
Adding new method to retrive app routes
cloudfoundry-community_cf-python-client
train
py
ffd1d95910f6a7ec7b8b70bd93e4d44c46901f01
diff --git a/acceptance/tests/resource/service/ticket_1343_should_add_and_remove_symlinks.rb b/acceptance/tests/resource/service/ticket_1343_should_add_and_remove_symlinks.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/resource/service/ticket_1343_should_add_and_remove_symlinks.rb +++ b/acceptance/tests/resource/service/ticket_1343_should_add_and_remove_symlinks.rb @@ -1,5 +1,7 @@ test_name 'RedHat Service Symlink Validation' +confine :to, :platform => 'el-5' + manifest_httpd_setup = %Q{ package { 'httpd': ensure => present,
(PUP-<I>) confine test ticket_<I> to el-5 This fixes the acceptance test failures happening for all the platforms this test wasn't intended for.
puppetlabs_puppet
train
rb
1b0ee33ff051ae754cc72bb3c39aca24bd4b5c1d
diff --git a/packages/build-tools/svgo-plugins.js b/packages/build-tools/svgo-plugins.js index <HASH>..<HASH> 100644 --- a/packages/build-tools/svgo-plugins.js +++ b/packages/build-tools/svgo-plugins.js @@ -83,9 +83,6 @@ module.exports = [ moveGroupAttrsToElems: true, }, { - collapseGroups: true, - }, - { removeRasterImages: false, }, {
chore: don't collapse SVG groups in SVGO and instead just stick to using the default SVGO config for this
bolt-design-system_bolt
train
js
210522094dfbc727587668e10bfb512c77c879f3
diff --git a/emirdrp/recipes/image/join.py b/emirdrp/recipes/image/join.py index <HASH>..<HASH> 100644 --- a/emirdrp/recipes/image/join.py +++ b/emirdrp/recipes/image/join.py @@ -128,7 +128,6 @@ class JoinDitheredImagesRecipe(EmirRecipe): def run_single(self, rinput): use_errors = True - datamodel = EmirDataModel() # Initial checks fframe = rinput.obresult.frames[0] img = fframe.open() @@ -196,9 +195,14 @@ class JoinDitheredImagesRecipe(EmirRecipe): self.logger.info('sky correction in individual images') corrector = SkyCorrector( sky_data, - datamodel, - calibid=datamodel.get_imgid(sky_result) + self.datamodel, + calibid=self.datamodel.get_imgid(sky_result) ) + # If we do not update keyword SKYADD + # there is no sky subtraction + for m in data_hdul: + m[0].header['SKYADD'] = True + # this is a little hackish data_hdul_s = [corrector(m) for m in data_hdul] #data_arr_s = [m[0].data - sky_data for m in data_hdul] base_header = data_hdul_s[0][0].header
Update SKYADD keyword in Dither to allow forced sky subtraction
guaix-ucm_pyemir
train
py
692d0f61135bc09b4f623f48642fa8cf69f50639
diff --git a/lib/OpenLayers/Control/Scale.js b/lib/OpenLayers/Control/Scale.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Control/Scale.js +++ b/lib/OpenLayers/Control/Scale.js @@ -11,11 +11,12 @@ OpenLayers.Control.Scale = Class.create(); OpenLayers.Control.Scale.prototype = Object.extend( new OpenLayers.Control(), { INCHES_PER_UNIT: { // borrowed from MapServer mapscale.c - dd: 1.0, + inches: 1.0, ft: 12.0, mi: 63360.0, m: 39.3701, - km: 39370.1 + km: 39370.1, + dd: 4374754 }, /** @type DOMElement */
Fix broken units: inches was missing, and dd was in place of images. git-svn-id: <URL>
openlayers_openlayers
train
js
5501b192cf54dae1d13ff64ec98de9c878640759
diff --git a/impl-base/src/test/java/DefaultPackageAddTestCase.java b/impl-base/src/test/java/DefaultPackageAddTestCase.java index <HASH>..<HASH> 100644 --- a/impl-base/src/test/java/DefaultPackageAddTestCase.java +++ b/impl-base/src/test/java/DefaultPackageAddTestCase.java @@ -91,12 +91,27 @@ public class DefaultPackageAddTestCase assertClassesWereAdded(archive); } + /** + * Makes sure classes in the default package, and only in the default package, are added. + * + * SHRINKWRAP-233, SHRINKWRAP-302 + */ @Test public void testAddDefaultPackage() { JavaArchive archive = ShrinkWrap.create(JavaArchive.class); archive.addDefaultPackage(); assertClassesWereAdded(archive); + + /* + * It should have added only the following three classes: + * 1. /DefaultPackageAddTestCase.class + * 2. /ClassInDefaultPackage.class + * 3. /ClassInDefaultPackage$InnerClassInDefaultPackage.class + */ + final int expectedSize = 3; + final int size = archive.getContent().size(); + Assert.assertEquals("Not the expected number of assets added to the archive", expectedSize, size); } private void assertClassesWereAdded(JavaArchive archive) {
[SHRINKWRAP-<I>] Makes sure classes only from the default package are added
shrinkwrap_shrinkwrap
train
java
247ff30db4a2ce6b83136e802817d6b52d9beefb
diff --git a/lib/whenever/capistrano/v2/recipes.rb b/lib/whenever/capistrano/v2/recipes.rb index <HASH>..<HASH> 100644 --- a/lib/whenever/capistrano/v2/recipes.rb +++ b/lib/whenever/capistrano/v2/recipes.rb @@ -7,7 +7,7 @@ Capistrano::Configuration.instance(:must_exist).load do _cset(:whenever_options) { {:roles => fetch(:whenever_roles)} } _cset(:whenever_command) { "whenever" } _cset(:whenever_identifier) { fetch :application } - _cset(:whenever_environment) { fetch :rails_env, "production" } + _cset(:whenever_environment) { fetch :rails_env, fetch(:stage, "production") } _cset(:whenever_variables) { "environment=#{fetch :whenever_environment}" } _cset(:whenever_update_flags) { "--update-crontab #{fetch :whenever_identifier} --set #{fetch :whenever_variables}" } _cset(:whenever_clear_flags) { "--clear-crontab #{fetch :whenever_identifier}" }
Default `rails_env` to `:stage` in Capistrano v2 Similar to #<I>.
javan_whenever
train
rb
d95c8378ebaaf8dcfcc5220236bd00b9095a9de4
diff --git a/lib/Service/Application.js b/lib/Service/Application.js index <HASH>..<HASH> 100644 --- a/lib/Service/Application.js +++ b/lib/Service/Application.js @@ -16,7 +16,7 @@ module.exports = function(di, config) { methods: ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS'] })); - app.use(require('../express/response/helpers')({continue: false})); + app.use(require('../express/response/helpers')({continue: true})); app.use(bodyParser.json({type: '*/*'}));
fix: no debug response in REST, invalid continue option in Service/Application
alekzonder_maf
train
js
dc066f66883dc4fd898e390eb137ed58af96809a
diff --git a/src/main/java/com/dcsquare/hivemq/spi/callback/events/OnPublishReceivedCallback.java b/src/main/java/com/dcsquare/hivemq/spi/callback/events/OnPublishReceivedCallback.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/dcsquare/hivemq/spi/callback/events/OnPublishReceivedCallback.java +++ b/src/main/java/com/dcsquare/hivemq/spi/callback/events/OnPublishReceivedCallback.java @@ -44,7 +44,7 @@ public interface OnPublishReceivedCallback extends SynchronousCallback { * <p/> * The publish parameter references the publish object, that is sent to the subscribers, * after the onPublishReceived method was called. So if you don´t want your plugin to - * interfere in the regular publishing process, you might consider copying the publish object. + * interfere in the regular publishing process, you must copy the {@link PUBLISH} object. * Use the static copy method of the PUBLISH class for this purpose. Similar to the following code example. * PUBLISH copy = PUBLISH.copy(publish); *
fixed OnPublishReceivedCallback documentation
hivemq_hivemq-spi
train
java
4b6a6b565ab82a3583148e637c8ffa40fe0afa4a
diff --git a/config/pubsub.php b/config/pubsub.php index <HASH>..<HASH> 100644 --- a/config/pubsub.php +++ b/config/pubsub.php @@ -29,8 +29,8 @@ return [ 'connections' => [ - 'null' => [ - 'driver' => 'null', + '/dev/null' => [ + 'driver' => '/dev/null', ], 'local' => [
forgot to rename /dev/null
Superbalist_laravel-pubsub
train
php
916b90fb03b87869f7df4ee173f5fbc92219d1cf
diff --git a/content/template/bookingTemplate/questionView.php b/content/template/bookingTemplate/questionView.php index <HASH>..<HASH> 100644 --- a/content/template/bookingTemplate/questionView.php +++ b/content/template/bookingTemplate/questionView.php @@ -16,7 +16,7 @@ } array_multisort($qCategories, SORT_ASC, $qSortIndex, SORT_ASC, $questions); - echo "<pre>" . print_r($questions, true) . "</pre>"; + #echo "<pre>" . print_r($questions, true) . "</pre>"; foreach($questions as $q) { if($q->ShowExternal) {
1 file changed, 1 insertion(+), 1 deletion(-) On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: content/template/bookingTemplate/questionView.php
MultinetInteractive_EduAdmin-WordPress
train
php
83a6db895e8f8fa86b9fd7827a514ca67fa3d56c
diff --git a/lib/jsonapi/resource_serializer.rb b/lib/jsonapi/resource_serializer.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/resource_serializer.rb +++ b/lib/jsonapi/resource_serializer.rb @@ -306,7 +306,7 @@ module JSONAPI if relationship.is_a?(JSONAPI::Relationship::ToMany) if relationship.polymorphic? source._model.public_send(relationship.name).pluck(:type, :id).map do |type, id| - [type.pluralize, IdValueFormatter.format(id)] + [type.underscore.pluralize, IdValueFormatter.format(id)] end else source.public_send(relationship.foreign_key).map do |value|
underscorize resource type name in links
cerebris_jsonapi-resources
train
rb
a3c2b482ec9efaafc8ea4e7e874acf5c87d25546
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -20,7 +20,7 @@ var CodeMirror = (function() { // This mess creates the base DOM structure for the editor. wrapper.innerHTML = '<div style="overflow: hidden; position: relative; width: 3px; height: 0px;">' + // Wraps and hides input textarea - '<textarea style="position: absolute; padding: 0; width: 1px;" wrap="off" ' + + '<textarea style="position: absolute; padding: 0; width: 1px; height: 1em" wrap="off" ' + 'autocorrect="off" autocapitalize="off"></textarea></div>' + '<div class="CodeMirror-scroll" tabindex="-1">' + '<div style="position: relative">' + // Set to the height of the text, causes scrolling
Add explicit height to inner textarea to prevent surprising css rule interactions
codemirror_CodeMirror
train
js
d7f3295e5f8eb914ef0f7c23ccd4c6f75abd30e2
diff --git a/raiden/transfer/events.py b/raiden/transfer/events.py index <HASH>..<HASH> 100644 --- a/raiden/transfer/events.py +++ b/raiden/transfer/events.py @@ -412,7 +412,7 @@ class EventPaymentSentFailed(Event): pex(self.payment_network_identifier), pex(self.token_network_identifier), self.identifier, - self.target, + pex(self.target), self.reason, ) diff --git a/raiden/transfer/mediated_transfer/events.py b/raiden/transfer/mediated_transfer/events.py index <HASH>..<HASH> 100644 --- a/raiden/transfer/mediated_transfer/events.py +++ b/raiden/transfer/mediated_transfer/events.py @@ -40,7 +40,7 @@ class SendLockExpired(SendMessageEvent): return '<SendLockExpired msgid:{} balance_proof:{} secrethash:{} recipient:{}>'.format( self.message_identifier, self.balance_proof, - self.secrethash, + pex(self.secrethash), pex(self.recipient), ) @@ -417,7 +417,7 @@ class SendRefundTransfer(SendMessageEvent): return ( f'<' f'SendRefundTransfer msgid:{self.message_identifier} transfer:{self.transfer} ' - f'recipient:{self.recipient} ' + f'recipient:{pex(self.recipient)} ' f'>' )
Fix __repr__ of some classes [skip ci]
raiden-network_raiden
train
py,py
521317be5ebc228a0f0ede099fa2a0b5ece22e49
diff --git a/run.go b/run.go index <HASH>..<HASH> 100644 --- a/run.go +++ b/run.go @@ -33,9 +33,15 @@ func StartWithSize(c *exec.Cmd, sz *Winsize) (pty *os.File, err error) { return nil, err } } - c.Stdout = tty - c.Stdin = tty - c.Stderr = tty + if c.Stdout == nil { + c.Stdout = tty + } + if c.Stderr == nil { + c.Stderr = tty + } + if c.Stdin == nil { + c.Stdin = tty + } if c.SysProcAttr == nil { c.SysProcAttr = &syscall.SysProcAttr{} }
Don't set Stdin/Stdout/Stderr if already set (#<I>) * only set stdout and stderr if not already set * Don't set cmd.Stdin if it's already set Considered @craek's codereview
kr_pty
train
go
9810d8a08cc0c768c38756c474da401fce7703f8
diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index <HASH>..<HASH> 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -849,7 +849,9 @@ resource_class.prototype.clear_move_markers = function(target) { resources = target.parentObj.resources; } for (var i=0; i<resources.length; i++) { - YAHOO.util.Dom.setStyle(resources[i].getEl().id, 'border', 'none'); + if (resources[i].getEl() != null) { + YAHOO.util.Dom.setStyle(resources[i].getEl().id, 'border', 'none'); + } } } @@ -865,8 +867,10 @@ resource_class.prototype.onDragOver = function(e, ids) { } else if (target.is == 'section' && target.resources.length > 0) { // We need to have a border at the bottom of the last activity in // that section. - YAHOO.util.Dom.setStyle(target.resources[target.resources.length - 1].getEl().id, + if (target.resources[target.resources.length - 1].getEl() != null) { + YAHOO.util.Dom.setStyle(target.resources[target.resources.length - 1].getEl().id, 'border-bottom', '1px solid #BBB'); + } } }
MDL-<I> Preventing the border from being assigned to label list elements. Merged from MOODLE_<I>_STABLE
moodle_moodle
train
js
53e275b237bfdca01782c338462ea4eff2576e4f
diff --git a/code/services/QueuedJobService.php b/code/services/QueuedJobService.php index <HASH>..<HASH> 100644 --- a/code/services/QueuedJobService.php +++ b/code/services/QueuedJobService.php @@ -261,7 +261,6 @@ class QueuedJobService $job->prepareForRestart(); } - // make sure the descriptor is up to date with anything changed $this->copyJobToDescriptor($job, $jobDescriptor); @@ -371,6 +370,7 @@ class QueuedJobService // okay, we'll just catch this exception for now SS_Log::log($e, SS_Log::ERR); $jobDescriptor->JobStatus = QueuedJob::STATUS_BROKEN; + $jobDescriptor->write(); } $errorHandler->clear();
Added additional call to 'write' after setting broken job
symbiote_silverstripe-queuedjobs
train
php
bed0c128992f9e87a4216ecaa0ee67ba76b14e16
diff --git a/src/plugins/background_button/background_button.js b/src/plugins/background_button/background_button.js index <HASH>..<HASH> 100644 --- a/src/plugins/background_button/background_button.js +++ b/src/plugins/background_button/background_button.js @@ -35,7 +35,17 @@ class BackgroundButton extends UICorePlugin { this.listenTo(this.core.mediaControl, 'mediacontrol:hide', this.hide) this.listenTo(this.core.mediaControl, 'mediacontrol:playing', this.playing) this.listenTo(this.core.mediaControl, 'mediacontrol:notplaying', this.notplaying) - Mediator.on('player:resize', () => this.updateSize()) + Mediator.on('player:resize', this.updateSize, this) + } + + destroy() { + super() + Mediator.off('player:resize', this.updateSize, this) + } + + stopListening() { + super() + Mediator.off('player:resize', this.updateSize, this) } settingsUpdate() {
fix background button mediator event leak (refs #<I>)
clappr_clappr
train
js
2137709cd67c4204e63a9f7889e54ce2dfcc6c68
diff --git a/src/Events/EntityWasSaved.php b/src/Events/EntityWasSaved.php index <HASH>..<HASH> 100644 --- a/src/Events/EntityWasSaved.php +++ b/src/Events/EntityWasSaved.php @@ -42,9 +42,15 @@ class EntityWasSaved if ($relationValue instanceof ValueCollection) { foreach ($relationValue as $value) { + // Set attribute value's entity_id since it's always null, + // because when RelationBuilder::build is called very early + $value->setAttribute('entity_id', $entity->getKey()); $this->saveOrTrashValue($value); } } elseif (! is_null($relationValue)) { + // Set attribute value's entity_id since it's always null, + // because when RelationBuilder::build is called very early + $relationValue->setAttribute('entity_id', $entity->getKey()); $this->saveOrTrashValue($relationValue); } }
Set attribute value's entity_id since it's always null
rinvex_renamed-attributes
train
php
2455b22bc00cc3b55427fed47266f989c7507c70
diff --git a/lib/rspec-puppet/tasks/release_test.rb b/lib/rspec-puppet/tasks/release_test.rb index <HASH>..<HASH> 100644 --- a/lib/rspec-puppet/tasks/release_test.rb +++ b/lib/rspec-puppet/tasks/release_test.rb @@ -128,7 +128,7 @@ task :release_test do end end -class GemfileRewrite < Parser::Rewriter +class GemfileRewrite < Parser::TreeRewriter def on_send(node) _, method_name, *args = *node
Update release_test GemfileRewrite to use Parser::TreeRewriter
rodjek_rspec-puppet
train
rb
705312a7556851e248a9589fbc2e2484a38ab5c6
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index <HASH>..<HASH> 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -34,7 +34,13 @@ if is_module_installed('IPython', '>=0.12'): # bootstrap script has eventually set this option), switch to # PyQt API #2 by simply importing the IPython qt module os.environ['QT_API'] = 'pyqt' - from IPython.external import qt #analysis:ignore + try: + from IPython.external import qt #analysis:ignore + except ImportError: + # Avoid raising any error here: the spyderlib.requirements module + # will take care of it, in a user-friendly way (Tkinter message box + # if no GUI toolkit is installed) + pass # Check requirements from spyderlib import requirements
Fixed regression introduced with revision ed<I>bb<I>b<I>a: no Tkinter message was shown when neither PyQt4 or PySide was installed
spyder-ide_spyder
train
py
34a74964db66e451e7d43aae4d04feb74558ff04
diff --git a/src/frontend/org/voltdb/SnapshotDaemon.java b/src/frontend/org/voltdb/SnapshotDaemon.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/SnapshotDaemon.java +++ b/src/frontend/org/voltdb/SnapshotDaemon.java @@ -965,7 +965,7 @@ public class SnapshotDaemon implements SnapshotCompletionInterest { processTruncationRequestEvent(new WatchedEvent( EventType.NodeCreated, KeeperState.SyncConnected, - VoltZK.snapshot_truncation_master)); + VoltZK.request_truncation_snapshot)); } }
ENG-<I> Fix trunc event on SnapshotDaemon promotion.
VoltDB_voltdb
train
java
9f3cb894606706ca5e6c4a7482cb36676e3ac454
diff --git a/ParameterConverter.php b/ParameterConverter.php index <HASH>..<HASH> 100644 --- a/ParameterConverter.php +++ b/ParameterConverter.php @@ -8,12 +8,12 @@ class ParameterConverter { if (is_array($args)) { $failed = array_filter($args, function ($e) use ($type_of) { - return $e instanceof $type_of; + return ($type_of !== get_class($e)); }); if (0 < count($failed)) { return \DomainException(sprintf('You must provide only objects of class %s.'), $type_of); } } else { - if (! $args instanceof $type_of) { return \DomainException(sprintf('You must provide only objects of class %s.', $type_of)); } + if ($type_of !== get_class($args)) { return \DomainException(sprintf('You must provide only objects of class %s.', $type_of)); } $args = array($args); }
Trying to solve github issues
zebba_Utility
train
php
9b291bc337d5909cc3c108874bfcdba95f89d27f
diff --git a/lib/active_support/cache/dalli_store.rb b/lib/active_support/cache/dalli_store.rb index <HASH>..<HASH> 100644 --- a/lib/active_support/cache/dalli_store.rb +++ b/lib/active_support/cache/dalli_store.rb @@ -109,13 +109,13 @@ module ActiveSupport end if entry == not_found - result = instrument(:generate, name, options) do |payload| + result = instrument(:generate, namespaced_name, options) do |payload| yield end write(name, result, options) result else - instrument(:fetch_hit, name, options) { |payload|} + instrument(:fetch_hit, namespaced_name, options) { |payload| } entry end else @@ -168,7 +168,7 @@ module ActiveSupport def read_multi(*names) options = names.extract_options! mapping = names.inject({}) { |memo, name| memo[namespaced_key(name, options)] = name; memo } - instrument(:read_multi, names) do + instrument(:read_multi, mapping.keys) do results = {} if local_cache mapping.each_key do |key| @@ -199,7 +199,7 @@ module ActiveSupport options = names.extract_options! mapping = names.inject({}) { |memo, name| memo[namespaced_key(name, options)] = name; memo } - instrument(:fetch_multi, names) do + instrument(:fetch_multi, mapping.keys) do with do |connection| results = connection.get_multi(mapping.keys)
Always pass namespaced key to the subscriber of instrumentation API To be consistent with other events (e.g. `read`, `write`), namespaced keys should be passed to the subscribers of the following events: - fetch_hit - generate - read_multi - fetch_multi
petergoldstein_dalli
train
rb
5aa2645ad11f776454c0eb96555e63f1f5998eb3
diff --git a/gym/lib/gym/detect_values.rb b/gym/lib/gym/detect_values.rb index <HASH>..<HASH> 100644 --- a/gym/lib/gym/detect_values.rb +++ b/gym/lib/gym/detect_values.rb @@ -98,9 +98,12 @@ module Gym bundle_identifier = current["PRODUCT_BUNDLE_IDENTIFIER"] provisioning_profile_specifier = current["PROVISIONING_PROFILE_SPECIFIER"] - next if provisioning_profile_specifier.to_s.length == 0 - - provisioning_profile_mapping[bundle_identifier] = provisioning_profile_specifier + provisioning_profile_uuid = current["PROVISIONING_PROFILE"] + if provisioning_profile_specifier.to_s.length > 0 + provisioning_profile_mapping[bundle_identifier] = provisioning_profile_specifier + elsif provisioning_profile_uuid.to_s.length > 0 + provisioning_profile_mapping[bundle_identifier] = provisioning_profile_uuid + end end end rescue => ex
Detect selected provisioning profile UUIDs for Xcode 9 (#<I>) * Detect selected provisioning profile UUIDs for Xcode 9 The Xcode 9 provisioningProfiles export option allows to specify either provisioning profile names (specifiers) or UUIDs. When automatically generating provisioningProfiles from the project file content, fastlane was only using specifiers. If no specifier is present but a UUID is, this makes it use the UUID. * Make emptiness check a bit simpler
fastlane_fastlane
train
rb
d2f45e5fb94baa8ed8d0222a51bf38f97fd91489
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -40,9 +40,14 @@ setup( packages=find_packages(), install_requires=['spglib', 'numpy', 'scipy', 'pymatgen>=2017.12.30', 'h5py', 'phonopy', 'matplotlib', 'seekpath'], - extras_require={'docs': ['sphinx', 'sphinx-argparse']}, + extras_require={'docs': ['sphinx', 'sphinx-argparse']}, package_data={'sumo': ['symmetry/bradcrack.json', - 'plotting/orbital_colours.conf']}, + 'plotting/orbital_colours.conf', + 'plotting/sumo_base.mplstyle', + 'plotting/sumo_bs.mplstyle', + 'plotting/sumo_dos.mplstyle', + 'plotting/sumo_optics.mplstyle', + 'plotting/sumo_phonon.mplstyle']}, data_files=['examples/orbital_colours.conf', 'LICENSE', 'requirements_rtd.txt'], entry_points={'console_scripts': [
Add style sheets to setup.py
SMTG-UCL_sumo
train
py
78e1c4cf63a8553bde45cdb0bae0db90e0c3bdfb
diff --git a/packages/@vue/cli-service/lib/Service.js b/packages/@vue/cli-service/lib/Service.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-service/lib/Service.js +++ b/packages/@vue/cli-service/lib/Service.js @@ -189,7 +189,7 @@ module.exports = class Service { } plugins = plugins.concat(files.map(file => ({ id: `local:${file}`, - apply: loadModule(file, this.pkgContext) + apply: loadModule(`./${file}`, this.pkgContext) }))) }
fix: fix resolve project local plugin's file path (#<I>)
vuejs_vue-cli
train
js
f5c489eaadd2d17765249b1a55322a483271f4c3
diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_file.py +++ b/salt/modules/win_file.py @@ -28,6 +28,7 @@ import re # do not remove, used in imported file.py functions import sys # do not remove, used in imported file.py functions import fileinput # do not remove, used in imported file.py functions import fnmatch # do not remove, used in imported file.py functions +import mmap # do not remove, used in imported file.py functions from salt.ext.six import string_types # do not remove, used in imported file.py functions # do not remove, used in imported file.py functions from salt.ext.six.moves.urllib.parse import urlparse as _urlparse # pylint: disable=import-error,no-name-in-module
Added missing import mmap required by file.py
saltstack_salt
train
py
bf94d29b614f99a06768673c932f442a8d3d5f84
diff --git a/staticfy.py b/staticfy.py index <HASH>..<HASH> 100644 --- a/staticfy.py +++ b/staticfy.py @@ -58,8 +58,9 @@ def staticfy(file_, static_endpoint='static', project_type='flask', **kwargs): file_handle.close() - # incase filename is a link to a path + # extract the filename incase the filename is a path html_files/[home.html] filename = file_.split(os.path.sep)[-1] + # create the staticfy and the appropriate template folder out_file = os.path.join('staticfy', filename) makedir(os.path.dirname(out_file)) @@ -106,7 +107,7 @@ def parse_cmd_arguments(): def main(): args = parse_cmd_arguments() files = args.file - static_endpoint = args.static_endpoint + static_endpoint = args.static_endpoint or 'static' # if it's None project_type = args.project_type or os.getenv('STATICFY_FRAMEWORK', 'flask') add_tags = args.add_tags or '{}' exc_tags = args.exc_tags or '{}'
Fixed issue with staticfy filling in None when the static url is not specified
danidee10_Staticfy
train
py
e52c43a10d13180bb63586bc630e51c82d2f2cdf
diff --git a/lib/core/jhipster/field_types.js b/lib/core/jhipster/field_types.js index <HASH>..<HASH> 100644 --- a/lib/core/jhipster/field_types.js +++ b/lib/core/jhipster/field_types.js @@ -61,7 +61,7 @@ const CommonDBValidations = { Double: new CustomSet([REQUIRED, UNIQUE, MIN, MAX]), Enum: new CustomSet([REQUIRED, UNIQUE]), Boolean: new CustomSet([REQUIRED, UNIQUE]), - LocalDate: new CustomSet([REQUIRED], UNIQUE), + LocalDate: new CustomSet([REQUIRED, UNIQUE]), ZonedDateTime: new CustomSet([REQUIRED, UNIQUE]), Blob: new CustomSet([REQUIRED, UNIQUE, MINBYTES, MAXBYTES]), AnyBlob: new CustomSet([REQUIRED, UNIQUE, MINBYTES, MAXBYTES]),
Fixed issue with unique validation for LocalDate
jhipster_generator-jhipster
train
js
b1ead9be99e340ac8eb181c3de4740f629f4c34e
diff --git a/src/super_archives/models.py b/src/super_archives/models.py index <HASH>..<HASH> 100644 --- a/src/super_archives/models.py +++ b/src/super_archives/models.py @@ -108,6 +108,10 @@ class Thread(models.Model): verbose_name_plural = _(u"Threads") unique_together = ('subject_token', 'mailinglist') + @models.permalink + def get_absolute_url(self): + return ('thread_view', [self.mailinglist, self.subject_token]) + def __unicode__(self): return '%s - %s (%s)' % (self.id, self.subject_token,
Adding get_absolute_url method to thread
colab_colab
train
py
5e71b145ae5a4d83fd4aab2cffb3a2cde526cda3
diff --git a/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationFactory.java b/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationFactory.java index <HASH>..<HASH> 100644 --- a/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationFactory.java +++ b/drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationFactory.java @@ -153,7 +153,7 @@ public class TypeDeclarationFactory { if ( fieldCount != typeDescr.getFields().size() ) { kbuilder.addBuilderResult(new TypeDeclarationError(typeDescr, "New declaration of "+typeDescr.getType().getFullName() - +" can't declaredeclares a different set of fields \n" + + +" can't declare a different set of fields \n" + "existing : " + cfi.getFieldTypesField() + "\n" + "declared : " + typeDescr.getFields() ));
Fix typo in error message (cherry picked from commit f<I>f<I>ee<I>b<I>cb5bf3ce)
kiegroup_drools
train
java
da603af217f51cb83b844f590b62d97f3352dbf4
diff --git a/js/bitfinex.js b/js/bitfinex.js index <HASH>..<HASH> 100644 --- a/js/bitfinex.js +++ b/js/bitfinex.js @@ -673,7 +673,7 @@ module.exports = class bitfinex extends Exchange { return this.parseOrder (result); } - async editOrder (id, symbol = undefined, type = undefined, side = undefined, amount = undefined, price = undefined, params = {}) { + async editOrder (id, symbol, type, side, amount = undefined, price = undefined, params = {}) { await this.loadMarkets (); let orderType = this.translateOrderType (type); let order = {
bitfinex editOrder signature compatible with the declaration from the base class
ccxt_ccxt
train
js
0d2a777bb481ee9b2d6ec63169c93afffff2d21e
diff --git a/src/projex/rest.py b/src/projex/rest.py index <HASH>..<HASH> 100644 --- a/src/projex/rest.py +++ b/src/projex/rest.py @@ -116,6 +116,8 @@ def py2json(py_obj): return py_obj.strftime('%Y-%m-%d') elif type(py_obj) == datetime.time: return py_obj.strftime('%H:%M:%S:%f') + elif type(py_obj) == set: + return list(py_obj) else: # look through custom plugins for encoder in _encoders:
* json cannot serialize set's, converting to a list
bitesofcode_projex
train
py
c52846913b5b884bbbd57531fb8b9aad703ca667
diff --git a/spec/rbnacl/util_spec.rb b/spec/rbnacl/util_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rbnacl/util_spec.rb +++ b/spec/rbnacl/util_spec.rb @@ -118,6 +118,16 @@ describe RbNaCl::Util do end end + context "check_string" do + it "raises EncodingError when given strings with non-BINARY encoding" do + string = "foobar" + string.force_encoding('UTF-8') + expect do + RbNaCl::Util.check_string(string, string.bytesize, "encoding test") + end.to raise_error(EncodingError) + end + end + context "hex encoding" do let (:bytes) { [0xDE,0xAD,0xBE,0xEF].pack('c*') } let (:hex) { "deadbeef" }
Spec for non-BINARY encodings
crypto-rb_rbnacl
train
rb
092bf0b454ff5f68832a67408d0d7ff51bf7f549
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read(fname): setup( name='sqlacfg', - version='0.3.dev1', + version='0.4.dev1', description='Stores configurations in a database instead of a file', long_description=read('README.rst'), author='Marc Brinkmann', diff --git a/sqlacfg/__init__.py b/sqlacfg/__init__.py index <HASH>..<HASH> 100644 --- a/sqlacfg/__init__.py +++ b/sqlacfg/__init__.py @@ -4,7 +4,7 @@ import json from sqlalchemy import Column, String, distinct -__version__ = '0.3.dev1' +__version__ = '0.4.dev1' class ConfigSettingMixin(object):
Start developing version <I>.dev1 (after release of <I>)
mbr_sqlacfg
train
py,py
88498ae27c36c7d5b4f41fee5163ccc73c2bc188
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ setup( # long_description=open('README.md').read(), install_requires=[ 'Django>=1.6,<1.7', + 'django-shared', ], dependency_links=[ ],
added django-shared dependency
dArignac_ip_assembler
train
py
49732f13acbb191006e93510fe6bdc2ac65b2ca8
diff --git a/minimal.js b/minimal.js index <HASH>..<HASH> 100644 --- a/minimal.js +++ b/minimal.js @@ -22,12 +22,11 @@ function unbox(data, unboxers, key) { for(var i = 0;i < unboxers.length;i++) { var unboxer = unboxers[i] - if (key) { - plaintext = unboxer.value(data.value.content, key) - } else if (isFunction(unboxer)) { + if (isFunction(unboxer)) plaintext = unboxer(data.value.content, data.value) - } else if (!key && unboxer.key) { - key = unboxer.key(data.value.content, data.value) + else { + if (!key) key = unboxer.key(data.value.content, data.value) + if (key) plaintext = unboxer.value(data.value.content, key) } if(plaintext) { @@ -236,3 +235,14 @@ module.exports = function (dirname, keys, opts) { return db } + + + + + + + + + + +
can't use key if unboxer is old style, without key method. otherwise, handle if key is already available or not. sorry @christianbundy my earlier advice was incorrect
ssbc_ssb-db
train
js
8726787953abb0f27ae3eceebeaa4b8f8bc05f88
diff --git a/src/commands/test/util/browser-tests-runner/setup.js b/src/commands/test/util/browser-tests-runner/setup.js index <HASH>..<HASH> 100644 --- a/src/commands/test/util/browser-tests-runner/setup.js +++ b/src/commands/test/util/browser-tests-runner/setup.js @@ -9,12 +9,23 @@ window.mocha.reporter('html'); require('chai').config.includeStack = true; +function _isPromise(obj) { + return (obj && obj.then && (typeof obj.then === 'function')); +} + function runTest(it, name, handler, context) { if(handler.length <= 1) { it(name, function() { context.name = name; - handler.call(this, context); - context._afterTest(); + var testFunction = handler.call(this, context); + if (_isPromise(testFunction)) { + testFunction.then(function () { + context._afterTest(); + }); + return testFunction; + } else { + context._afterTest(); + } }); } else if(handler.length >= 2) { it(name, function(done) {
Add support for promises when testing in the browser
marko-js_cli
train
js
1af51cd0d34c4d8c904e1d15cf194ebe528917e6
diff --git a/core/serial_web_bluetooth.js b/core/serial_web_bluetooth.js index <HASH>..<HASH> 100644 --- a/core/serial_web_bluetooth.js +++ b/core/serial_web_bluetooth.js @@ -44,7 +44,7 @@ return {error:"Serving off HTTP (not HTTPS)"}; } if (!isSupportedByBrowser) { - // return {error:"Web Bluetooth API available, but not supported by this Browser"}; + return {error:"Web Bluetooth API available, but not supported by this Browser"}; } if (!ignoreSettings && !Espruino.Config.WEB_BLUETOOTH) return {warning:`"Web Bluetooth" disabled in settings`};
check for 'implemented but not enabled'
espruino_EspruinoTools
train
js
1b8257ba58912cad58d3f89fec486d28aa9dc410
diff --git a/src/config/boomcms/viewHelpers.php b/src/config/boomcms/viewHelpers.php index <HASH>..<HASH> 100644 --- a/src/config/boomcms/viewHelpers.php +++ b/src/config/boomcms/viewHelpers.php @@ -4,15 +4,11 @@ use BoomCMS\Core\Page; return [ 'viewHelpers' => [ - 'assetURL' => function() { - $args = func_get_args(); - $params = []; - - if (isset($params['asset'])) { - $params['id'] = $asset->getId(); - unset($params['asset']); + 'assetURL' => function(array $params) { + if (isset($params['asset']) && is_object($params['asset'])) { + $params['asset'] = $params['asset']->getId(); } - + if ( !isset($params['action'])) { $params['action'] = 'view'; }
Fixed bugs in $assetURL view helper
boomcms_boom-core
train
php
d34668ab762f2d7cb9231987b5bec60e2fe1efb9
diff --git a/tests/app/src/Command/CommandRunner.php b/tests/app/src/Command/CommandRunner.php index <HASH>..<HASH> 100644 --- a/tests/app/src/Command/CommandRunner.php +++ b/tests/app/src/Command/CommandRunner.php @@ -4,7 +4,6 @@ namespace App\Command; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Output\NullOutput; use Tienvx\Bundle\MbtBundle\Command\CommandRunner as BaseCommandRunner; class CommandRunner extends BaseCommandRunner @@ -29,6 +28,6 @@ class CommandRunner extends BaseCommandRunner 'mbt:bug:remove-screenshots' => ['command', 'bug-id', 'model'], ]; $command = $parameters[0]; - $application->run(new ArrayInput(array_combine($map[$command], $parameters)), new NullOutput()); + $application->run(new ArrayInput(array_combine($map[$command], $parameters))); } }
Report error on running command on unit testing
tienvx_mbt-bundle
train
php
4b6842c7b87d5a3bb58528b00828dca85c131adb
diff --git a/pyxel/editor/__init__.py b/pyxel/editor/__init__.py index <HASH>..<HASH> 100644 --- a/pyxel/editor/__init__.py +++ b/pyxel/editor/__init__.py @@ -11,7 +11,7 @@ def run(): print("usage: pyxeleditor pyxel_resource_file") print("\n") print("Pyxel Editor {}".format(pyxel.VERSION)) - print("Please specify an arbitrary file name") + print("Please specify an arbitrary file name to run Pyxel Editor") print("e.g. pyxeleditor my_resource")
Modified the usage of Pyxel Editor
kitao_pyxel
train
py
9cca9e05bec116f934e4b667b0e2f69b84314894
diff --git a/core/src/main/java/hudson/model/Computer.java b/core/src/main/java/hudson/model/Computer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Computer.java +++ b/core/src/main/java/hudson/model/Computer.java @@ -1313,7 +1313,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces * Gets the current {@link Computer} that the build is running. * This method only works when called during a build, such as by * {@link hudson.tasks.Publisher}, {@link hudson.tasks.BuildWrapper}, etc. - * @return the {@link Computer} associated with {@link Executor#currentExecutor}, or null if not on an executor thread + * @return the {@link Computer} associated with {@link Executor#currentExecutor}, or (consistently as of 1.591) null if not on an executor thread */ public static @Nullable Computer currentComputer() { Executor e = Executor.currentExecutor();
Expanding Javadoc from #<I> as suggested by @oleg-nenashev.
jenkinsci_jenkins
train
java
0f33d772393b9733970bbcd8c60550021c3a81bc
diff --git a/future/tests/test_httplib.py b/future/tests/test_httplib.py index <HASH>..<HASH> 100644 --- a/future/tests/test_httplib.py +++ b/future/tests/test_httplib.py @@ -26,7 +26,7 @@ HOST = support.HOST class FakeSocket(object): def __init__(self, text, fileclass=io.BytesIO): - if isinstance(text, str): # i.e. unicode string + if isinstance(text, type(u'')): # i.e. unicode string text = text.encode('ascii') self.text = text self.fileclass = fileclass @@ -38,7 +38,7 @@ class FakeSocket(object): if utils.PY3: self.data += data else: - if isinstance(data, str): # i.e. unicode + if isinstance(data, type(u'')): # i.e. unicode newdata = data.encode('ascii') elif isinstance(data, type(b'')): # native string type. FIXME! newdata = bytes(data)
Use isinstance(blah, type('')) idiom in test_httplib.py * TODO: The docs should describe the purpose of this too. * Is there a cleaner alternative that could be recommended over this?
PythonCharmers_python-future
train
py
78d6db129c0ecb48bc3de1b2b6fd30eb95e1f0ad
diff --git a/runipy/main.py b/runipy/main.py index <HASH>..<HASH> 100644 --- a/runipy/main.py +++ b/runipy/main.py @@ -118,7 +118,13 @@ def main(): exporter = HTMLExporter() else: exporter = HTMLExporter( - config=Config({'HTMLExporter':{'template_file':args.template, 'template_path': ['.', '/']}})) + config=Config({ + 'HTMLExporter': { + 'template_file':args.template, + 'template_path': ['.', '/'] + } + }) + ) logging.info('Saving HTML snapshot to %s' % args.html) output, resources = exporter.from_notebook_node(nb_runner.nb)
runipy/main.py: Wrap `HTMLExporter` arguments to make them more readable and shorten the line length.
paulgb_runipy
train
py
48acdf95beac271523c726b9fe2d2609f58cc8a3
diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index <HASH>..<HASH> 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -22,8 +22,11 @@ class block_admin_tree extends block_base { } function applicable_formats() { - //TODO: add 'my' only if user has role assigned in system or any course category context - return array('site' => true, 'admin' => true, 'my' => true); + if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) { + return array('site' => true, 'admin' => true, 'my' => true); + } else { + return array('site' => true, 'admin' => true); + } } function preferred_width() {
Prevent admin tree to be showed for non-admins in 'my' page. MDL-<I> ; merged from <I>_STABLE
moodle_moodle
train
php
fe88534b29594fdd29354f8003745eecab20b40e
diff --git a/grunt.js b/grunt.js index <HASH>..<HASH> 100644 --- a/grunt.js +++ b/grunt.js @@ -63,6 +63,9 @@ module.exports = function( grunt ) { lint: { files: [ "grunt.js", "dist/jquery.js" ] }, + qunit: { + files: "test/index.html" + }, watch: { files: "<config:lint.files>", tasks: "concat lint"
Grunt: Add qunit target. Currently finishes with <I>/<I> assertions failing. If that can be made to pass, it should be added to the default task
jquery_jquery
train
js
5521a0e5b5387fbc56d480a0c16bff1d8a09a55a
diff --git a/rejected/consumer.py b/rejected/consumer.py index <HASH>..<HASH> 100644 --- a/rejected/consumer.py +++ b/rejected/consumer.py @@ -896,6 +896,12 @@ class Consumer(object): self._republish_processing_error(error_text) raise gen.Return(data.PROCESSING_EXCEPTION) + except NotImplementedError as error: + self.log_exception('NotImplementedError processing delivery' + ' %s: %s', message_in.delivery_tag, error) + self._measurement.set_tag('exception', error.__class__.__name__) + raise gen.Return(NotImplementedError) + except Exception as error: exc_info = sys.exc_info() if concurrent.is_future(result):
Possibly address issue #<I> by catching NotImplementedError
gmr_rejected
train
py
4b47c24f76b90ce368b02233ebda3e47e9221980
diff --git a/lib/easypost/object.rb b/lib/easypost/object.rb index <HASH>..<HASH> 100644 --- a/lib/easypost/object.rb +++ b/lib/easypost/object.rb @@ -134,7 +134,9 @@ class EasyPost::EasyPostObject # The metaclass of an object. def metaclass - class << self; self; end + class << self + self; + end end # Add accessors of an object. diff --git a/spec/report_spec.rb b/spec/report_spec.rb index <HASH>..<HASH> 100644 --- a/spec/report_spec.rb +++ b/spec/report_spec.rb @@ -84,7 +84,6 @@ describe EasyPost::Report do # verify params by checking URL in cassette # can't do any more verification without downloading CSV end - end describe '.retrieve' do
- Fix linting issues
EasyPost_easypost-ruby
train
rb,rb
fb1c5b9c3e6968c5e21614fbc5bb266023fa6305
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -139,7 +139,7 @@ install_requires=[ 'enum34 >= 1.1.6', 'funcsigs >= 0.4', 'futures >= 3.0.5', - 'hypercube == 0.3.0a6', + 'hypercube == 0.3.2', 'numpy >= 1.11.3', 'numexpr >= 2.6.1', 'python-casacore >= 2.1.2',
Upgrade to hypercube <I>
ska-sa_montblanc
train
py
acac2d578df25f512317377cbca877832f292eaf
diff --git a/framework/zii/widgets/CMenu.php b/framework/zii/widgets/CMenu.php index <HASH>..<HASH> 100644 --- a/framework/zii/widgets/CMenu.php +++ b/framework/zii/widgets/CMenu.php @@ -24,6 +24,7 @@ * // Important: you need to specify url as 'controller/action', * // not just as 'controller' even if default acion is used. * array('label'=>'Home', 'url'=>array('site/index')), + * // 'Products' menu item will be selected no matter which tag parameter value is since it's not specified. * array('label'=>'Products', 'url'=>array('product/index'), 'items'=>array( * array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')), * array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')),
(Fixes issue <I>) More API docs for CMenu
yiisoft_yii
train
php
2a44f37d20116dfb4bf414018f5709087822896c
diff --git a/src/main/java/com/cloudbees/jenkins/support/impl/UpdateCenter.java b/src/main/java/com/cloudbees/jenkins/support/impl/UpdateCenter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/cloudbees/jenkins/support/impl/UpdateCenter.java +++ b/src/main/java/com/cloudbees/jenkins/support/impl/UpdateCenter.java @@ -70,6 +70,8 @@ public class UpdateCenter extends Component { // Only do this part of the async-http-client plugin is installed. if (Helper.getActiveInstance().getPlugin("async-http-client") != null) { addProxyInformation(out); + } else { + out.println("Proxy: 'async-http-client' not installed so proxy info available."); } } finally { out.flush();
Mention that the async-http-client plugin is not installed.
jenkinsci_support-core-plugin
train
java
5ded56a8288dfcfb9e389ea85edc13cf49981a2a
diff --git a/core/src/main/java/jenkins/security/DefaultConfidentialStore.java b/core/src/main/java/jenkins/security/DefaultConfidentialStore.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/jenkins/security/DefaultConfidentialStore.java +++ b/core/src/main/java/jenkins/security/DefaultConfidentialStore.java @@ -16,6 +16,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.security.GeneralSecurityException; import java.security.SecureRandom; +import javax.crypto.BadPaddingException; import org.apache.commons.io.IOUtils; /** @@ -107,6 +108,12 @@ public class DefaultConfidentialStore extends ConfidentialStore { return verifyMagic(bytes); } catch (GeneralSecurityException e) { throw new IOException("Failed to load the key: "+key.getId(),e); + } catch (IOException x) { + if (x.getCause() instanceof BadPaddingException) { + return null; // broken somehow + } else { + throw x; + } } finally { IOUtils.closeQuietly(cis); IOUtils.closeQuietly(fis);
[FIXED JENKINS-<I>] Treat BadPaddingException as an unloadable key and continue. (cherry picked from commit <I>b8d<I>abdf8b<I>f4e1b8ce8bf<I>e<I>ad) Conflicts: changelog.html
jenkinsci_jenkins
train
java
19bd2a3f7c151db4d6107ab8238f019e735a36a9
diff --git a/src/parser-flow.js b/src/parser-flow.js index <HASH>..<HASH> 100644 --- a/src/parser-flow.js +++ b/src/parser-flow.js @@ -4,6 +4,8 @@ const createError = require("./parser-create-error"); const includeShebang = require("./parser-include-shebang"); function parse(text) { + // Fixes Node 4 issue (#1986) + "use strict"; // eslint-disable-line // Inline the require to avoid loading all the JS if we don't use it const flowParser = require("flow-parser");
Add "use strict" to fix SyntaxError on Node@4 (#<I>)
josephfrazier_prettier_d
train
js
bc5bd6bc91f91414e6ef274a9a5067803d26cb6b
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/time/StronglyTypeTime.java b/core/src/main/java/com/google/errorprone/bugpatterns/time/StronglyTypeTime.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/time/StronglyTypeTime.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/time/StronglyTypeTime.java @@ -185,7 +185,7 @@ public final class StronglyTypeTime extends BugChecker implements CompilationUni private static final Pattern TIME_UNIT_REMOVER = Pattern.compile( - "((_?IN)?_?(NANO|NANOSECOND|NSEC|_NS|MICRO|MSEC|MICROSECOND|MILLI|MILLISECOND|_MS|SEC|SECOND|MINUTE|MIN|HOUR|DAY)S?)?$", + "((_?IN)?_?(NANO|NANOSECOND|NSEC|_NS|MICRO|MSEC|USEC|MICROSECOND|MILLI|MILLISECOND|_MS|SEC|SECOND|MINUTE|MIN|HOUR|DAY)S?)?$", Pattern.CASE_INSENSITIVE); /** Tries to strip any time-related suffix off the field name. */
Re-write DEADLINE_USEC to DEADLINE instead of DEADLINE_U. PiperOrigin-RevId: <I>
google_error-prone
train
java
489d87b14fadeb5331e0fc19e883b8e45c07e212
diff --git a/lib/rack/typhoeus/middleware/params_decoder/helper.rb b/lib/rack/typhoeus/middleware/params_decoder/helper.rb index <HASH>..<HASH> 100644 --- a/lib/rack/typhoeus/middleware/params_decoder/helper.rb +++ b/lib/rack/typhoeus/middleware/params_decoder/helper.rb @@ -48,8 +48,12 @@ module Rack # @return [Boolean] True if its a encoded Array, else false. def encoded?(hash) return false if hash.empty? - keys = hash.keys.map{|i| i.to_i if i.respond_to?(:to_i)}.sort - keys == hash.keys.size.times.to_a + if hash.keys.size > 1 + keys = hash.keys.map{|i| i.to_i if i.respond_to?(:to_i)}.sort + keys == hash.keys.size.times.to_a + else + hash.keys.first =~ /0/ + end end # If the Hash is an array encoded by typhoeus an array is returned
FIXED: Any key .to_i would turn 0. So if there was only 1 key, converted? returned true wrongly
typhoeus_typhoeus
train
rb
9b81dec1273922c972461d855e4bc7f93e41579d
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/gms/Gossiper.java +++ b/src/java/org/apache/cassandra/gms/Gossiper.java @@ -241,6 +241,7 @@ public class Gossiper implements IFailureDetectionEventListener */ void evictFromMembership(InetAddress endpoint) { + endpointStateMap_.remove(endpoint); unreachableEndpoints_.remove(endpoint); } @@ -456,7 +457,6 @@ public class Gossiper implements IFailureDetectionEventListener if (logger_.isDebugEnabled()) logger_.debug(QUARANTINE_DELAY + " elapsed, " + entry.getKey() + " gossip quarantine over"); justRemovedEndpoints_.remove(entry.getKey()); - endpointStateMap_.remove(entry.getKey()); } } }
Keep endpoint state until aVeryLongTime. Patch by brandonwilliams reviewed by gdusbabek for CASSANDRA-<I> git-svn-id: <URL>
Stratio_stratio-cassandra
train
java
30c3379dc3470e25a89feedba95f35c956df9033
diff --git a/spec/rollbar_spec.rb b/spec/rollbar_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rollbar_spec.rb +++ b/spec/rollbar_spec.rb @@ -157,6 +157,7 @@ describe Rollbar do end it 'should not modify any parent notifier configuration' do + configure Rollbar.configuration.code_version.should be_nil Rollbar.configuration.payload_options.should be_empty
Reconfigure Rollbar in a random spec.
rollbar_rollbar-gem
train
rb
06cdde350b053e2470a7ce33fb89316e06264385
diff --git a/spec/scorm_engine/api/endpoints/registrations_spec.rb b/spec/scorm_engine/api/endpoints/registrations_spec.rb index <HASH>..<HASH> 100644 --- a/spec/scorm_engine/api/endpoints/registrations_spec.rb +++ b/spec/scorm_engine/api/endpoints/registrations_spec.rb @@ -126,7 +126,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do it "returns activity_details if requested" do response = subject.get_registration_progress(registration_id: registration_options[:registration_id], detail: true) - expect(response.result.activity_details).to be_a Hash + expect(response.result.activity_details).to be_a ScormEngine::Models::RegistrationActivityDetail end end end
fix test now that we have new models
instructure-bridge_scorm_engine
train
rb
74fd457c612e1d8b809ff9c5e025f12077f50c14
diff --git a/webroot/js/helper.js b/webroot/js/helper.js index <HASH>..<HASH> 100644 --- a/webroot/js/helper.js +++ b/webroot/js/helper.js @@ -585,8 +585,9 @@ foodcoopshop.Helper = { var root = '#content'; - if (foodcoopshop.Helper.isMobile()) { - root = '#responsive-header'; + var responsiveHeaderSelector = '#responsive-header'; + if (foodcoopshop.Helper.isMobile() && $(resonsiveHeaderSelector).length == 1) { + root = responsiveHeaderSelector; } var messageNode = $('<div />');
bugfix: responsive-header not used in admin
foodcoopshop_foodcoopshop
train
js
d20a6625d81a12457ee300474b022b70f11b4ace
diff --git a/datacats/environment.py b/datacats/environment.py index <HASH>..<HASH> 100644 --- a/datacats/environment.py +++ b/datacats/environment.py @@ -384,7 +384,13 @@ class Environment(object): port = self.port production = production or self.always_prod - override_site_url = self.address == '127.0.0.1' and not is_boot2docker() + # We only override the site URL with the docker URL on three conditions + # 1 - we're listening on 127.0.0.1 + override_site_url = (self.address == '127.0.0.1' + # 2 - we're not using boot2docker + and not is_boot2docker() + # 3 - the site url is NOT set. + and not self.site_url) command = ['/scripts/web.sh', str(production), str(override_site_url), str(paster_reload)] if address != '127.0.0.1' and is_boot2docker():
Add another condition for the site_url override - that no one has explicitly set the site_url
datacats_datacats
train
py
a915ce6878c8ffdc365fec74c06a6abea157cef7
diff --git a/etebase/__init__.py b/etebase/__init__.py index <HASH>..<HASH> 100644 --- a/etebase/__init__.py +++ b/etebase/__init__.py @@ -2,7 +2,7 @@ import functools import msgpack -from .etebase_python import CollectionAccessLevel, PrefetchOption # noqa +from .etebase_python import CollectionAccessLevel, PrefetchOption, Utils # noqa from . import etebase_python
Utils: fix exposing Utils class. We weren't re-exporting it so it wasn't easily accessible.
etesync_pyetesync
train
py
045fc5667b86f49be961c9bed36013f5168622e6
diff --git a/backbone.localStorage.js b/backbone.localStorage.js index <HASH>..<HASH> 100644 --- a/backbone.localStorage.js +++ b/backbone.localStorage.js @@ -122,6 +122,10 @@ Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = function(m if (options && options.error) options.error("Record not found"); if (syncDfd) syncDfd.reject(); } + + // add compatibility with $.ajax + // always execute callback for success and error + if (options && options.complete) options.complete(resp); return syncDfd && syncDfd.promise(); };
add options.complete to Backbone.LocalStorage.sync to add compatibility with $.ajax
jeromegn_Backbone.localStorage
train
js
96aed9903e1e55dc0d52e3268f6c9340e8ee7345
diff --git a/app-examples/MongoNode.php b/app-examples/MongoNode.php index <HASH>..<HASH> 100644 --- a/app-examples/MongoNode.php +++ b/app-examples/MongoNode.php @@ -13,6 +13,7 @@ class MongoNode extends AppInstance { public $LockClient; // LockClient public $cursor; // Tailable cursor public $timer; + protected $inited = false; /** * Setting default config options
Added missing MongoNode\->inited property
kakserpom_phpdaemon
train
php
04852ce1270ed75514b931148b1151f9823482c6
diff --git a/bokeh/transforms/ar_downsample.py b/bokeh/transforms/ar_downsample.py index <HASH>..<HASH> 100644 --- a/bokeh/transforms/ar_downsample.py +++ b/bokeh/transforms/ar_downsample.py @@ -20,7 +20,7 @@ except: print("Install from the ./python directory with 'python setup.py install' (may require admin privledges)") print("Questions and feedback can be directed to Joseph Cottam (jcottam@indiana.edu)") print("-----------------------------------------------------------------------\n\n") - raise +# raise class Proxy(PlotObject):
Removed raise on import error. Now it matches behavior of image_downsample.
bokeh_bokeh
train
py
1317f458a1e8bc0527669201afd7397fd22a1422
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -7,6 +7,8 @@ require "carnival" module Carnival class Application < Rails::Application + config.i18n.available_locales = :en + config.i18n.default_locale = :en console { config.console = Pry } end end
Add locale setup do application.rb in the dummy app
Vizir_carnival
train
rb
76162dd25770fbc3e877a74867f997912e6681c0
diff --git a/packages/react/src/components/DataTable/DataTable-story.js b/packages/react/src/components/DataTable/DataTable-story.js index <HASH>..<HASH> 100644 --- a/packages/react/src/components/DataTable/DataTable-story.js +++ b/packages/react/src/components/DataTable/DataTable-story.js @@ -349,7 +349,6 @@ export const WithCheckmarkColumns = () => { className={`la-${cell.info.header}`}> <Checkbox id={'check-' + cell.id} - checked={cell.value} hideLabel labelText="checkbox" />
docs(data-table): switch checkboxes to uncontrolled (#<I>)
carbon-design-system_carbon-components
train
js
5f6cee7e41afda219e162bb793e59427b781fe38
diff --git a/xprocspec-runner/src/main/java/org/daisy/maven/xproc/xprocspec/XProcSpecRunner.java b/xprocspec-runner/src/main/java/org/daisy/maven/xproc/xprocspec/XProcSpecRunner.java index <HASH>..<HASH> 100644 --- a/xprocspec-runner/src/main/java/org/daisy/maven/xproc/xprocspec/XProcSpecRunner.java +++ b/xprocspec-runner/src/main/java/org/daisy/maven/xproc/xprocspec/XProcSpecRunner.java @@ -243,11 +243,12 @@ public class XProcSpecRunner { */ private static Collection<File> listXProcSpecFilesRecursively(File directory) { ImmutableList.Builder<File> builder = new ImmutableList.Builder<File>(); - for (File file : directory.listFiles()) { - if (file.isDirectory()) - builder.addAll(listXProcSpecFilesRecursively(file)); - else if (file.getName().endsWith(".xprocspec")) - builder.add(file); } + if (directory.isDirectory()) + for (File file : directory.listFiles()) { + if (file.isDirectory()) + builder.addAll(listXProcSpecFilesRecursively(file)); + else if (file.getName().endsWith(".xprocspec")) + builder.add(file); } return builder.build(); }
Don't fail when src/test/xprocspec directory does not exist see issue #<I>
daisy_xproc-maven-plugin
train
java
c9bbef228fa712b14388513b5f16b0ead986aeac
diff --git a/packaging/create-linux-packages.py b/packaging/create-linux-packages.py index <HASH>..<HASH> 100755 --- a/packaging/create-linux-packages.py +++ b/packaging/create-linux-packages.py @@ -10,7 +10,7 @@ create-linux-packages.py <release-version> import sys from shutil import rmtree from subprocess import run -from pathlib2 import Path +from pathlib import Path THIS_DIRECTORY = Path(__file__).absolute().parent diff --git a/packaging/upload-linux-packages.py b/packaging/upload-linux-packages.py index <HASH>..<HASH> 100755 --- a/packaging/upload-linux-packages.py +++ b/packaging/upload-linux-packages.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import sys -from pathlib2 import Path +from pathlib import Path from subprocess import run PACKAGES = Path(__file__).absolute().parent / "out"
switch back to pathlib for the deployment scripts
datawire_kubernaut
train
py,py
f49f3e7ea9b2b05a5c502a440376c60358b64c18
diff --git a/test/system/__init__.py b/test/system/__init__.py index <HASH>..<HASH> 100644 --- a/test/system/__init__.py +++ b/test/system/__init__.py @@ -42,8 +42,7 @@ def get_client(): client = get_client() -import tempfile -_, pid_fname = tempfile.mkstemp() +pid_fname = "system_test.pid" def pid(): return int(open(pid_fname).read()) @@ -55,6 +54,11 @@ class CassandraTester(object): def setUp(self): if self.runserver: + if os.path.exists(pid_fname): + pid_path = os.path.join(root, pid_fname) + print "Unclean shutdown detected, (%s found)" % pid_path + sys.exit() + # clean out old stuff import shutil # todo get directories from conf/storage-conf.xml @@ -95,3 +99,5 @@ class CassandraTester(object): # TODO kill server with SIGKILL if it's still alive time.sleep(0.5) # TODO assert server is Truly Dead + +# vim:ai sw=4 ts=4 tw=0 et
abort system tests if previous run shutdown uncleanly Patch by eevans; reviewed by Michael Greene for CASSANDRA-<I> git-svn-id: <URL>
Stratio_stratio-cassandra
train
py
9fe4a756c7dc074df8915dc991dafb3992c1c431
diff --git a/lib/dm-validations/validation_errors.rb b/lib/dm-validations/validation_errors.rb index <HASH>..<HASH> 100644 --- a/lib/dm-validations/validation_errors.rb +++ b/lib/dm-validations/validation_errors.rb @@ -84,6 +84,17 @@ module DataMapper end end + # Return validation errors for a particular field name or an empty array + # + # This method is a necessary requirement for active_model compatibility. + # + # @param [Symbol] field_name the name of the field you want an error for + # @return [Array<Array<String>>] + # array of validation errors or empty array, if there are no errors on given field + def [](field_name) + errors[field_name] ||= [] + end + # Return validation errors for a particular field_name. # # @param [Symbol] field_name the name of the field you want an error for
[dm-validations] Improved active_model compatibility With this change, dm-validations is compatible with active_model's requirements regarding the #errors and the #valid? method. The remaining aspects of of active_model compatibility are handled inside the dm-active_model plugin.
emmanuel_aequitas
train
rb
dcb905701c8370f953f9d84301f7a6a9f2203d98
diff --git a/runtime/v2/shim/util_windows.go b/runtime/v2/shim/util_windows.go index <HASH>..<HASH> 100644 --- a/runtime/v2/shim/util_windows.go +++ b/runtime/v2/shim/util_windows.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "net" + "os" "syscall" "time" @@ -48,7 +49,25 @@ func SocketAddress(ctx context.Context, id string) (string, error) { // AnonDialer returns a dialer for a npipe func AnonDialer(address string, timeout time.Duration) (net.Conn, error) { - return winio.DialPipe(address, &timeout) + var c net.Conn + var lastError error + start := time.Now() + for { + remaining := timeout - time.Now().Sub(start) + if remaining <= 0 { + lastError = errors.Errorf("timed out waiting for npipe %s", address) + break + } + c, lastError = winio.DialPipe(address, &remaining) + if lastError == nil { + break + } + if !os.IsNotExist(lastError) { + break + } + time.Sleep(10 * time.Millisecond) + } + return c, lastError } // NewSocket returns a new npipe listener
Adds retry support to Windows AnonDialer Adds retry support to AnonDialer if the pipe does not exist. This will retry up to the timeout for the pipe to exist and connect. This solves the race between the containerd-shim-* start command and the reinvocation.
containerd_containerd
train
go
703372452275e5347559665d8edf10534670620c
diff --git a/les/vflux/client/fillset_test.go b/les/vflux/client/fillset_test.go index <HASH>..<HASH> 100644 --- a/les/vflux/client/fillset_test.go +++ b/les/vflux/client/fillset_test.go @@ -34,16 +34,20 @@ type testIter struct { } func (i *testIter) Next() bool { - i.waitCh <- struct{}{} + if _, ok := <-i.waitCh; !ok { + return false + } i.node = <-i.nodeCh - return i.node != nil + return true } func (i *testIter) Node() *enode.Node { return i.node } -func (i *testIter) Close() {} +func (i *testIter) Close() { + close(i.waitCh) +} func (i *testIter) push() { var id enode.ID @@ -53,7 +57,7 @@ func (i *testIter) push() { func (i *testIter) waiting(timeout time.Duration) bool { select { - case <-i.waitCh: + case i.waitCh <- struct{}{}: return true case <-time.After(timeout): return false
les/vflux/client: fix goroutine leak in testIter (#<I>)
ethereum_go-ethereum
train
go
294d946af57a895a9d7d426bbf03d65ad4f4e519
diff --git a/core/src/main/java/io/neba/core/logviewer/LogfileViewerConsolePlugin.java b/core/src/main/java/io/neba/core/logviewer/LogfileViewerConsolePlugin.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/neba/core/logviewer/LogfileViewerConsolePlugin.java +++ b/core/src/main/java/io/neba/core/logviewer/LogfileViewerConsolePlugin.java @@ -140,7 +140,7 @@ public class LogfileViewerConsolePlugin extends AbstractWebConsolePlugin impleme StringBuilder options = new StringBuilder(1024); for (File logFile : resolveLogFiles()) { String fileIdentifier = getNormalizedFilePath(logFile); - options.append("<option value=\"").append(fileIdentifier).append("\" id=\"logfile\" ") + options.append("<option value=\"").append(fileIdentifier).append("\" ") .append("title=\"").append(fileIdentifier).append("\">") .append(logFile.getParentFile().getName()).append('/').append(logFile.getName()) .append("</option>");
Review: Removed erroneous id="..." attribute of <option>'s.
unic_neba
train
java
04b12453309376cc9db0b5a2c20cb702982da9ed
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OrderByStep.java b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OrderByStep.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OrderByStep.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/executor/OrderByStep.java @@ -110,6 +110,7 @@ public class OrderByStep extends AbstractExecutionStep { try { cachedResult.add(item); if (maxElementsAllowed >= 0 && maxElementsAllowed < cachedResult.size()) { + this.cachedResult.clear(); throw new OCommandExecutionException("Limit of allowed elements for in-heap ORDER BY in a single query exceeded (" + maxElementsAllowed + ") . You can set " + OGlobalConfiguration.QUERY_MAX_HEAP_ELEMENTS_ALLOWED_PER_OP.getKey() + " to increase this limit"); }
Improve memory management in case of query abort for exceeded limit of records in ORDER BY
orientechnologies_orientdb
train
java
6b6164638aa2ffe37e683074d9db811a267f4227
diff --git a/looptools/timer.py b/looptools/timer.py index <HASH>..<HASH> 100644 --- a/looptools/timer.py +++ b/looptools/timer.py @@ -39,16 +39,22 @@ class Timer: def function_timer(*args, **kwargs): """A nested function for timing other functions.""" + # Capture start time start = time.time() + + # Execute function with arguments value = func(*args, **kwargs) + + # Capture end time end = time.time() + + # Calculate run time runtime = end - start if runtime < 60: runtime = str('sec: ' + str('{:f}'.format(runtime))) else: runtime = str('min: ' + str('{:f}'.format(runtime / 60))) - msg = '{func:30} --> {time}' - print(msg.format(func=func.__name__, time=runtime)) + print('{func:50} --> {time}'.format(func=func.__qualname__, time=runtime)) return value return function_timer diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='looptools', - version='1.1.1', + version='1.1.2', packages=find_packages(), install_requires=[], url='https://github.com/mrstephenneal/looptools',
FIX Timer.decorator to also display the calling functions class name
mrstephenneal_looptools
train
py,py
59372d0bfae6ec9c42045ace3f8e9be475beeb30
diff --git a/lib/modules/apostrophe-areas/public/js/editor.js b/lib/modules/apostrophe-areas/public/js/editor.js index <HASH>..<HASH> 100644 --- a/lib/modules/apostrophe-areas/public/js/editor.js +++ b/lib/modules/apostrophe-areas/public/js/editor.js @@ -369,7 +369,7 @@ apos.define('apostrophe-area-editor', { }; self.enhanceWidgetControls = function($widget) { - $controls = $widget.find('[data-apos-widget-controls]'); + $controls = $widget.findSafe('[data-apos-widget-controls]', '[data-area]'); if (self.options.limit == 1) { $controls.addClass('apos-limit-one') }
Fix issue where 'apos-limit-one' class would be applied to all nested widget controls, even if it wasn't true.
apostrophecms_apostrophe
train
js
c7a275387ed022c64e52439bd3ac5be9976041da
diff --git a/src/MetaModels/DcGeneral/Data/Model.php b/src/MetaModels/DcGeneral/Data/Model.php index <HASH>..<HASH> 100644 --- a/src/MetaModels/DcGeneral/Data/Model.php +++ b/src/MetaModels/DcGeneral/Data/Model.php @@ -146,7 +146,10 @@ class Model implements ModelInterface */ public function setId($mixID) { - $this->getItem()->set('id', $mixID); + if ($this->getId() == null) { + $this->getItem()->set('id', $mixID); + $this->setMeta(static::IS_CHANGED, true); + } } /**
Mark model as changed when the id has been set.
MetaModels_core
train
php
8053ecd0ee3247334c4bce35b35220e1c6ec2b27
diff --git a/holoviews/core/spaces.py b/holoviews/core/spaces.py index <HASH>..<HASH> 100644 --- a/holoviews/core/spaces.py +++ b/holoviews/core/spaces.py @@ -463,13 +463,13 @@ class DynamicMap(HoloMap): """) def __init__(self, callback, initial_items=None, **params): + super(DynamicMap, self).__init__(initial_items, callback=callback, **params) # Set source to self if not already specified - for stream in params.get('streams',[]): + for stream in self.streams: if stream.source is None: stream.source = self - super(DynamicMap, self).__init__(initial_items, callback=callback, **params) self.counter = 0 if self.callback is None: raise Exception("A suitable callback must be "
Setting stream sources in DynamicMap after setting the parameters
pyviz_holoviews
train
py
089da384f44aba738d4ec0dd5021da2e837b0b28
diff --git a/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php b/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php index <HASH>..<HASH> 100644 --- a/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php +++ b/src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.php @@ -234,6 +234,10 @@ class RequestMapperPlugin */ private function getCurrentCategoryId(ContainerConfigurationInterface $containerConfiguration, SearchCriteriaInterface $searchCriteria) { + if ($this->searchContext->getCurrentCategory() && $this->searchContext->getCurrentCategory()->getId()) { + return $this->searchContext->getCurrentCategory()->getId(); + } + $store = $this->storeManager->getStore($containerConfiguration->getStoreId()); $categoryId = $this->storeManager->getGroup($store->getStoreGroupId())->getRootCategoryId();
Trust any previously set current category for search context.
Smile-SA_elasticsuite
train
php
a4aafe3533bbcb23e1e7a96cf9515ba3c1144d8d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ setup( author='The Graphistry Team', author_email='pygraphistry@graphistry.com', setup_requires=['numpy'], - install_requires=['numpy', 'pandas', 'requests', 'future'], + install_requires=['numpy', 'pandas', 'requests', 'future >= 0.15.0'], extras_require={ 'igraph': ['python-igraph'], 'networkx': ['networkx'],
Depend on future >= <I>. Closes #<I> (hopefully)
graphistry_pygraphistry
train
py
40c3ac19208d97a28f4f14b4b67315b1746675da
diff --git a/shoebox/disk_storage.py b/shoebox/disk_storage.py index <HASH>..<HASH> 100644 --- a/shoebox/disk_storage.py +++ b/shoebox/disk_storage.py @@ -83,6 +83,11 @@ class Version1(Version0): self.header_schema = "iii" self.header_size = struct.calcsize(self.header_schema) + def _encode(self, s): + if isinstance(s, unicode): + return s.encode('utf-8') + return s + def pack(self, notification, metadata): nsize = len(notification) raw_block_schema = "i%ds" % nsize @@ -91,12 +96,16 @@ class Version1(Version0): metadata_items = ["i"] # appended with N "%ds"'s metadata_values = [len(metadata) * 4] # [n]=key, [n+1]=value for key, value in metadata.iteritems(): + key = self._encode(key) + value = self._encode(value) metadata_items.append("i") metadata_items.append("i") metadata_values.append(len(key)) metadata_values.append(len(value)) for key, value in metadata.iteritems(): + key = self._encode(key) + value = self._encode(value) metadata_items.append("%ds" % len(key)) metadata_values.append(key) metadata_items.append("%ds" % len(value))
Proper unicode support for metadata. Json doesn't need it
openstack_stacktach-shoebox
train
py
6f8537b38832a854f68b6d3c4a17c114a66b8458
diff --git a/lib/mongodb/collection.js b/lib/mongodb/collection.js index <HASH>..<HASH> 100644 --- a/lib/mongodb/collection.js +++ b/lib/mongodb/collection.js @@ -305,6 +305,7 @@ Collection.prototype.findAndModify = function(query, sort, update, options, call queryObject['new'] = options['new'] ? 1 : 0; queryObject['remove'] = options.remove ? 1 : 0; queryObject['upsert'] = options.upsert ? 1 : 0; + if (options.fields) queryObject.fields = options.fields; // Set up the update if it exists if(update) queryObject['update'] = update;
Added fields support for findAndModify. This allows us to have findAndModify return a subset of the fields.
mongodb_node-mongodb-native
train
js
7588e4affd43f150b629cb563cc1dad3d868699a
diff --git a/interact.js b/interact.js index <HASH>..<HASH> 100644 --- a/interact.js +++ b/interact.js @@ -748,7 +748,7 @@ // get the most apprpriate dropzone based on DOM depth and order drop = resolveDrops(elements); - dropTarget = drop? dropzones[drop.index]: null; + dropTarget = drop? drops[drop.index]: null; if (selectorDZs.length) { var draggableElement = target._element;
Fix bug in getDrops the `dropzones` collection of dropzones was being used to get a qualifying dropzone instead of the drops passing Interactable#dropCheck. Closes #3
taye_interact.js
train
js
611274767c4daf68534830dbd2b9d7208d1f9cb9
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,7 +51,7 @@ copyright = u'2012, coagulant' # The short X.Y version. version = '0.2.3' # The full version, including alpha/beta/rc tags. -release = '0.2.3dev' +release = '0.2.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
Bumped version to <I>
futurecolors_django-geoip
train
py
73db284ccb4bff9aa84ae0395381871f41bc05af
diff --git a/describe.js b/describe.js index <HASH>..<HASH> 100644 --- a/describe.js +++ b/describe.js @@ -77,8 +77,6 @@ try { fun.call({ expect: function(a,b) { - done = true; - clearTimeout(timer); return expect(a,b,callback,options); } });
Fixed silly timing error (expectations shouldn't clear the timeout).
Yuffster_describe
train
js
d1a016688e7face22c4702db09b1cc25d784acd1
diff --git a/docs/examples/example_advanced_saml11.php b/docs/examples/example_advanced_saml11.php index <HASH>..<HASH> 100644 --- a/docs/examples/example_advanced_saml11.php +++ b/docs/examples/example_advanced_saml11.php @@ -42,9 +42,13 @@ phpCAS::handleLogoutRequests(true, $cas_real_hosts); // Force CAS authentication on any page that includes this file phpCAS::forceAuthentication(); - ?> -<h2>Secure Page</h2> +<html> + <head> + <title>Advanced SAML 1.1 example</title> + </head> + <body> +<h2>Advanced SAML 1.1 example</h2> <?php require 'script_info.php' ?> Authentication succeeded for user @@ -61,8 +65,11 @@ foreach (phpCAS::getAttributes() as $key => $value) { } echo '</ol></li>'; } else { - echo '<li>', $key, ': <strong>', $value, '</strong></li>'; + echo '<li>', $key, ': <strong>', $value, '</strong></li>' . PHP_EOL; } } ?> -</ul> \ No newline at end of file +</ul> +<p><a href="?logout=">Logout</a></p> +</body> +</html> \ No newline at end of file
Polish the SAML example a bit with nicer html output and a logout button.
apereo_phpCAS
train
php
9ac000540f3fbae6574bfca5af13f9237bfc25ff
diff --git a/werkzeug/serving.py b/werkzeug/serving.py index <HASH>..<HASH> 100644 --- a/werkzeug/serving.py +++ b/werkzeug/serving.py @@ -69,6 +69,7 @@ class BaseRequestHandler(BaseHTTPRequestHandler, object): 'wsgi.multithread': self.server.multithread, 'wsgi.multiprocess': self.server.multiprocess, 'wsgi.run_once': False, + 'SERVER_SOFTWARE': self.server_version, 'REQUEST_METHOD': self.command, 'SCRIPT_NAME': '', 'PATH_INFO': unquote(path_info),
Server now sets the `SERVER_SOFTWARE` environment key.
pallets_werkzeug
train
py
e21ac4ec165f79c4308939ed966b51a3a6074f04
diff --git a/core/src/main/java/org/sql2o/converters/AbstractDateConverter.java b/core/src/main/java/org/sql2o/converters/AbstractDateConverter.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/sql2o/converters/AbstractDateConverter.java +++ b/core/src/main/java/org/sql2o/converters/AbstractDateConverter.java @@ -35,7 +35,7 @@ public abstract class AbstractDateConverter<E extends Date> implements Converter throw new ConverterException("Cannot convert type " + val.getClass().toString() + " to java.util.Date"); } - public Timestamp toDatabaseParam(Date val) { + public Object toDatabaseParam(Date val) { if(val==null) return null; return (val instanceof Timestamp) ? (Timestamp) val
-Changed the return type to Object to be more consistent with the other Converters.
aaberg_sql2o
train
java
489a279e055859379c609233af043183b8f2c6d5
diff --git a/lib/puppet/indirector/indirection.rb b/lib/puppet/indirector/indirection.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/indirector/indirection.rb +++ b/lib/puppet/indirector/indirection.rb @@ -196,7 +196,12 @@ class Puppet::Indirector::Indirection result.expiration ||= self.expiration if result.respond_to?(:expiration) if cache? Puppet.info "Caching #{self.name} for #{request.key}" - cache.save request(:save, key, result, options) + begin + cache.save request(:save, key, result, options) + rescue => detail + Puppet.log_exception(detail) + raise detail + end end filtered = result diff --git a/spec/unit/indirector/indirection_spec.rb b/spec/unit/indirector/indirection_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/indirector/indirection_spec.rb +++ b/spec/unit/indirector/indirection_spec.rb @@ -393,6 +393,17 @@ describe Puppet::Indirector::Indirection do @indirection.find("/my/key") end + + it "should fail if saving to the cache fails but log the exception" do + @cache.stubs(:find).returns nil + + @terminus.stubs(:find).returns(@instance) + @cache.stubs(:save).raises RuntimeError + + Puppet.expects(:log_exception) + + expect { @indirection.find("/my/key") }.to raise_error + end end end
(PUP-<I>) Log exceptions raised by saving to cache Failing to cache requests could lead to silent exits. For example if the apply application failed to cache to PuppetDB catalog terminus. This will log the exception and continue.
puppetlabs_puppet
train
rb,rb
5dbf66c671e8cefe93f312394b39b8339fee6697
diff --git a/core-bundle/src/Resources/contao/library/Contao/Environment.php b/core-bundle/src/Resources/contao/library/Contao/Environment.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Environment.php +++ b/core-bundle/src/Resources/contao/library/Contao/Environment.php @@ -548,7 +548,7 @@ class Environment } // Android tablets are not mobile (see #4150) - if ($os == 'Android' && stripos('mobile', $ua) === false) + if ($os == 'android' && stripos($ua, 'mobile') === false) { $mobile = false; }
[Core] Correctly detect Android tablets in the `Environment` class (see #<I>)
contao_contao
train
php
ac69ad8cf9754de088282084481321f9d031ed75
diff --git a/jchart/templatetags/jchart.py b/jchart/templatetags/jchart.py index <HASH>..<HASH> 100644 --- a/jchart/templatetags/jchart.py +++ b/jchart/templatetags/jchart.py @@ -2,7 +2,7 @@ import uuid from django import template from django.template.loader import render_to_string -from django.core.urlresolvers import reverse +from django.urls import reverse from .. import Chart
Fix deprecation notice ```.../jchart/templatetags/jchart.py:5: RemovedInDjango<I>Warning: Importing from django.core.urlresolvers is deprecated in favor of django.urls. from django.core.urlresolvers import reverse```
matthisk_django-jchart
train
py
2a0c621f5be94baf357e9fd7bc51a9c05bf797c0
diff --git a/synapse/tests/test_link.py b/synapse/tests/test_link.py index <HASH>..<HASH> 100644 --- a/synapse/tests/test_link.py +++ b/synapse/tests/test_link.py @@ -73,8 +73,9 @@ class LinkTest(unittest.TestCase): self.assertEqual(link[1]['authinfo'].get('user'),'visi') self.assertEqual(link[1]['authinfo'].get('passwd'),'secret') - def test_link_ssl_basic(self): + def newp_link_ssl_basic(self): + # FIXME some kind of cert validation diffs in *py* vers killed us cafile = getTestPath('ca.pem') keyfile = getTestPath('server.key') certfile = getTestPath('server.pem')
temp disable real ssl test due to behav diffs in py vers. TODO
vertexproject_synapse
train
py
d168c61d7fb7a83ca4bf404cbde7ab3da801476d
diff --git a/src/Options.php b/src/Options.php index <HASH>..<HASH> 100644 --- a/src/Options.php +++ b/src/Options.php @@ -30,15 +30,13 @@ class Options public function expandTargetDir($target) { - $options = $this->options; - - return rtrim(preg_replace_callback('{%(.+?)%}', function ($matches) use ($options) { + return preg_replace_callback('{%(.+?)%}', function ($matches) { $option = str_replace('_', '-', strtolower($matches[1])); - if (!isset($options[$option])) { + if (!isset($this->options[$option])) { throw new \InvalidArgumentException(sprintf('Placeholder "%s" does not exist.', $matches[1])); } - return $options[$option]; - }, $target), '/'); + return rtrim($this->options[$option], '/'); + }, $target); } }
Simplified the code of Options::expandTargetDir()
symfony_flex
train
php