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
6944cefbcc48e8547c8dec4ba47d6cdb9929df06
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -149,7 +149,6 @@ function writeFile (filename, data, options, callback) { }) }) }).then(function success () { - removeOnExit() callback() }).catch(function fail (err) { removeOnExit()
Remove unneeded removeOnExit call In case of success, there seems to be no need to remove the tempfile
npm_write-file-atomic
train
js
65e864216f0732d9d907c3092eb4411d6a2e567e
diff --git a/test/instrumentation/modules/http/timeout-disabled.js b/test/instrumentation/modules/http/timeout-disabled.js index <HASH>..<HASH> 100644 --- a/test/instrumentation/modules/http/timeout-disabled.js +++ b/test/instrumentation/modules/http/timeout-disabled.js @@ -19,7 +19,7 @@ test('client-side timeout - call end', function (t) { t.equal(agent._instrumentation._queue._samples.length, 1, 'should add transactions to queue') server.close() t.end() - }, 50) + }, 100) }) clientReq.abort() @@ -54,7 +54,7 @@ test('client-side timeout - don\'t call end', function (t) { t.equal(agent._instrumentation._queue._samples.length, 0, 'should not add transactions to queue') server.close() t.end() - }, 50) + }, 100) }) clientReq.abort()
test: increase timeouts to increase chance of tests passing
opbeat_opbeat-node
train
js
e4ae8af1cfce83a5ec23cfb4fdc0ec81ca5c9b1f
diff --git a/examples/nogallery/test_kp_jfit.py b/examples/nogallery/test_kp_jfit.py index <HASH>..<HASH> 100755 --- a/examples/nogallery/test_kp_jfit.py +++ b/examples/nogallery/test_kp_jfit.py @@ -16,11 +16,12 @@ def print_fits(blob): print(fits[:10]) -args = docopt(__doc__) -fname = args['FILENAME'] +if __name__ == '__main__': + args = docopt(__doc__) + fname = args['FILENAME'] -pipe = Pipeline() -pipe.attach(FitPump, filename=fname) -pipe.attach(print_fits) -pipe.attach(HDF5Sink, filename=fname + '.h5') -pipe.drain(1) + pipe = Pipeline() + pipe.attach(FitPump, filename=fname) + pipe.attach(print_fits) + pipe.attach(HDF5Sink, filename=fname + '.h5') + pipe.drain(1)
Wrap in main, so the unit test suite does not complain
tamasgal_km3pipe
train
py
4f08585203ee3d7511048d42936e7abd3fc84103
diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ViewFetcher.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ViewFetcher.java index <HASH>..<HASH> 100755 --- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ViewFetcher.java +++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ViewFetcher.java @@ -110,8 +110,7 @@ class ViewFetcher { try{ if(views[i].isShown()) addChildren(viewsInDecorViews,(ViewGroup) views[i]);} - catch (NullPointerException ignored) {} - catch (ClassCastException ignored){} + catch (Exception ignored) {} } } return viewsInDecorViews;
All exceptions are now ignored in getViewsFromDecorViews()
RobotiumTech_robotium
train
java
655425c8a44a1312f7a9df3721efd277e030cf2e
diff --git a/js/whitebit.js b/js/whitebit.js index <HASH>..<HASH> 100644 --- a/js/whitebit.js +++ b/js/whitebit.js @@ -1505,7 +1505,12 @@ module.exports = class whitebit extends Exchange { // // [] // - return this.parseTransfer (response, currency); + const transfer = this.parseTransfer (response, currency); + return this.extend (transfer, { + 'amount': this.currencyToPrecision (code, amountString), + 'fromAccount': fromAccountId, + 'toAccount': toAccountId, + }); } parseTransfer (transfer, currency) {
extend amount, fromAccount and toAccount
ccxt_ccxt
train
js
aa70692edb9143396f14b8f25813dccd12dd8592
diff --git a/amplpy/__init__.py b/amplpy/__init__.py index <HASH>..<HASH> 100644 --- a/amplpy/__init__.py +++ b/amplpy/__init__.py @@ -15,4 +15,4 @@ from .dataframe import DataFrame from .utils import multidict from .environment import Environment from .ampl import AMPL -__version__ = '0.6.0rc3' +__version__ = 'v0.6.0rc4' diff --git a/docs/requirements.txt b/docs/requirements.txt index <HASH>..<HASH> 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1 @@ -amplpy==0.6.0rc3 +amplpy==v0.6.0rc4 diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -73,7 +73,7 @@ libdir = 'lib64' if x64 else 'lib32' setup( name='amplpy', - version='0.6.0rc3', + version='v0.6.0rc4', description='Python API for AMPL', long_description=__doc__, license='BSD-3',
Prepare test release <I>rc4
ampl_amplpy
train
py,txt,py
e8fdbdb7eee12ea15bdfbd21929275fd98763cd5
diff --git a/rxlifecycle/src/main/java/com/trello/rxlifecycle/RxLifecycle.java b/rxlifecycle/src/main/java/com/trello/rxlifecycle/RxLifecycle.java index <HASH>..<HASH> 100644 --- a/rxlifecycle/src/main/java/com/trello/rxlifecycle/RxLifecycle.java +++ b/rxlifecycle/src/main/java/com/trello/rxlifecycle/RxLifecycle.java @@ -178,7 +178,7 @@ public class RxLifecycle { * @param lifecycle the lifecycle sequence of a View * @return a reusable {@link Observable.Transformer} that unsubscribes the source during the View lifecycle */ - public static <T, E> Observable.Transformer<T, T> bindView(final Observable<E> lifecycle) { + public static <T, E> Observable.Transformer<T, T> bindView(final Observable<? extends E> lifecycle) { if (lifecycle == null) { throw new IllegalArgumentException("Lifecycle must be given"); }
Use ? extends E to allow for subclasses
trello_RxLifecycle
train
java
d534f212c65c9cf02b84fb13d42044e7942c4a15
diff --git a/modules/core/src/lib/view-manager.js b/modules/core/src/lib/view-manager.js index <HASH>..<HASH> 100644 --- a/modules/core/src/lib/view-manager.js +++ b/modules/core/src/lib/view-manager.js @@ -295,19 +295,26 @@ export default class ViewManager { this._viewports = []; this.controllers = {}; + let invalidateControllers = false; // Create controllers in reverse order, so that views on top receive events first for (let i = views.length; i--; ) { const view = views[i]; const viewState = this.getViewState(view); const viewport = view.makeViewport({width, height, viewState}); + let oldController = oldControllers[view.id]; + if (!oldController) { + // When a new controller is added, invalidate all controllers below it so that + // events are registered in the correct order + invalidateControllers = true; + } else if (invalidateControllers) { + // Remove and reattach invalidated controller + oldController.finalize(); + oldController = null; + } + // Update the controller - this.controllers[view.id] = this._updateController( - view, - viewState, - viewport, - oldControllers[view.id] - ); + this.controllers[view.id] = this._updateController(view, viewState, viewport, oldController); this._viewports.unshift(viewport); }
Fix event order when dynamically add/remove controllers (#<I>)
uber_deck.gl
train
js
2823a2f26128cae1186db0a38d9b4db153d1f858
diff --git a/lib/simple_navigation/helpers.rb b/lib/simple_navigation/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/simple_navigation/helpers.rb +++ b/lib/simple_navigation/helpers.rb @@ -21,6 +21,9 @@ module SimpleNavigation # The following options are supported: # * <tt>:level</tt> - defaults to :nested which renders the the sub_navigation for an active primary_navigation inside that active primary_navigation item. # Specify a specific level to only render that level of navigation (e.g. :level => 1 for primary_navigation etc...). + # If configuration file navigation.render_all_levels = true + # then all levels under the :level option will be rendered + # so use a range for level instead, like :level => 1..2 so that no levels under 2 will be rendered. # * <tt>:context</tt> - specifies the context for which you would render the navigation. Defaults to :default which loads the default navigation.rb (i.e. config/navigation.rb). # If you specify a context then the plugin tries to load the configuration file for that context, e.g. if you call <tt>render_navigation(:context => :admin)</tt> the file config/admin_navigation.rb # will be loaded and used for rendering the navigation.
added comments for :level range support
codeplant_simple-navigation
train
rb
71af7f5f40e013c089eaea03cefad2ae72ca513c
diff --git a/rest_api/api.py b/rest_api/api.py index <HASH>..<HASH> 100644 --- a/rest_api/api.py +++ b/rest_api/api.py @@ -283,13 +283,12 @@ def share_model(): return {} response = request.body.read().decode('utf-8') body = json.loads(response) - stmts_json = body.get('statements') - cyjs_model_str = body.get('cyjs_model') - stmts = stmts_from_json(stmts_json) + stmts_str = body.get('stmts') + stmts_json = json.loads(stmts_str) + stmts = stmts_from_json(stmts_json["statements"]) ca = CxAssembler(stmts) - ca.cx['networkAttributes'].append({'n': 'cyjs_model', - 'v': cyjs_model_str, - 'd': 'string'}) + for n, v in body.items(): + ca.cx['networkAttributes'].append({'n': n, 'v': v, 'd': 'string'}) ca.make_model() network_id = ca.upload_model(private=False) return {'network_id': network_id}
update NDEX upload to take new parameters - model_elements, preset_pos, stmts, sentences, evidence are now uploaded - makes model loading way easier
sorgerlab_indra
train
py
7bffa9dd01cdef3088e0d33fabd5fc07eb35c9d9
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -388,6 +388,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase ].each {|block| assert_raise(ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection, &block) } end + def test_has_many_association_through_a_has_many_association_to_self + sarah = Person.create!(:first_name => 'Sarah', :primary_contact_id => people(:susan).id, :gender => 'F', :number1_fan_id => 1) + john = Person.create!(:first_name => 'John', :primary_contact_id => sarah.id, :gender => 'M', :number1_fan_id => 1) + assert_equal sarah.agents, [john] + assert_equal people(:susan).agents_of_agents, [john] + end + def test_collection_singular_ids_getter_with_string_primary_keys book = books(:awdr) assert_equal 2, book.subscriber_ids.size
add test which fails for has_many through self join [#<I> state:open]
rails_rails
train
rb
f1ca5ae4a51a7aa384728c06b9ddea002180e9c9
diff --git a/apiserver/spaces/spaces.go b/apiserver/spaces/spaces.go index <HASH>..<HASH> 100644 --- a/apiserver/spaces/spaces.go +++ b/apiserver/spaces/spaces.go @@ -185,8 +185,9 @@ func (api *spacesAPI) supportsSpaces() error { return errors.NotSupportedf("networking") } ok, err = netEnv.SupportsSpaces() - if err != nil { + if !ok { logger.Warningf("environment does not support spaces: %v", err) + return errors.NotSupportedf("spaces") } return err }
Properly check result of calling SupportsSpaces
juju_juju
train
go
87b6bd05be0d2c044f1378526375418786e3be5b
diff --git a/handlers.go b/handlers.go index <HASH>..<HASH> 100644 --- a/handlers.go +++ b/handlers.go @@ -113,8 +113,31 @@ func handleServerSync(client *Client, buffer []byte) error { } func handleChannelRemove(client *Client, buffer []byte) error { - // TODO - return errUnimplementedHandler + var packet MumbleProto.ChannelRemove + if err := proto.Unmarshal(buffer, &packet); err != nil { + return err + } + + if packet.ChannelId == nil { + return errIncompleteProtobuf + } + var channel *Channel + { + channelId := uint(*packet.ChannelId) + channel = client.channels.ById(channelId) + if channel == nil { + return errInvalidProtobuf + } + client.channels.Delete(channelId) + } + + if client.state == Synced { + event := &ChannelChangeEvent{ + Channel: channel, + } + client.listeners.OnChannelChange(event) + } + return nil } func handleChannelState(client *Client, buffer []byte) error {
implement handleChannelRemove
layeh_gumble
train
go
8f8306da1ed36355fb003afe2f3ec41a84cb4838
diff --git a/django_tenants/postgresql_backend/introspection.py b/django_tenants/postgresql_backend/introspection.py index <HASH>..<HASH> 100644 --- a/django_tenants/postgresql_backend/introspection.py +++ b/django_tenants/postgresql_backend/introspection.py @@ -118,6 +118,8 @@ class DatabaseSchemaIntrospection(DatabaseIntrospection): for constraint, column, kind, used_cols in cursor.fetchall(): # If we're the first column, make the record if constraint not in constraints: + if len(used_cols) == 0: + continue # added as if the public schema hasn't got the field any more it errors constraints[constraint] = { "columns": [], "primary_key": kind.lower() == "primary key",
Fixed a problem with the introspection
tomturner_django-tenants
train
py
bda4654134adb7141d87ed4b1c25a78a79f70a61
diff --git a/packages/blueprint-gatekeeper/app/policies/gatekeeper/auth/bearer.js b/packages/blueprint-gatekeeper/app/policies/gatekeeper/auth/bearer.js index <HASH>..<HASH> 100644 --- a/packages/blueprint-gatekeeper/app/policies/gatekeeper/auth/bearer.js +++ b/packages/blueprint-gatekeeper/app/policies/gatekeeper/auth/bearer.js @@ -144,7 +144,7 @@ module.exports = Policy.extend ({ // Translate the error, if necessary. We have to check the name because the error // could be related to token verification. if (err.name === 'TokenExpiredError') - err = new ForbiddenError ('token_expired', 'The access token has expired.'); + return { failureCode: 'token_expired', failureMessage: 'The access token has expired.'}; if (err.name === 'JsonWebTokenError') err = new ForbiddenError ('invalid_token', err.message);
fix: token_expired should be <I>, not <I>
onehilltech_blueprint
train
js
54f9a4c7ec58d6310a4759c614234c50fd521b80
diff --git a/symphony/lib/toolkit/data-sources/datasource.section.php b/symphony/lib/toolkit/data-sources/datasource.section.php index <HASH>..<HASH> 100755 --- a/symphony/lib/toolkit/data-sources/datasource.section.php +++ b/symphony/lib/toolkit/data-sources/datasource.section.php @@ -171,8 +171,8 @@ (!$include_pagination_element ? true : false), true, $datasource_schema); - - if(($entries['total-entries'] <= 0 || $include_pagination_element === true) && (!is_array($entries['records']) || empty($entries['records']))){ + + if(($entries['total-entries'] <= 0 || $include_pagination_element === true) && (!is_array($entries['records']) || empty($entries['records'])) || !ctype_digit($this->dsParamSTARTPAGE) || $this->dsParamSTARTPAGE == '0'){ if($this->dsParamREDIRECTONEMPTY == 'yes'){ throw new FrontendPageNotFoundException; }
Fixes issue with pagination in DS's. The page value was cast to an integer, meaning invalid page values are always treated as 1. Thanks to 'drego'. Closes #<I>.
symphonycms_symphony-2
train
php
4b49ca822338f191603c1887382b91a9be31cdb3
diff --git a/tests/telemetry.test.js b/tests/telemetry.test.js index <HASH>..<HASH> 100644 --- a/tests/telemetry.test.js +++ b/tests/telemetry.test.js @@ -49,7 +49,7 @@ test.serial('should track --telemetry-enable', async (t) => { test.serial('should send netlify-cli/<version> user-agent', async (t) => { await withMockApi(routes, async ({ apiUrl, requests }) => { await callCli(['api', 'listSites'], getCLIOptions(apiUrl)) - t.is(requests.length, 2) + t.true(requests.length >= 2) // example: netlify-cli/6.14.25 darwin-x64 node-v16.13.0 const userAgent = requests[1].headers['user-agent'] t.assert(userAgent.startsWith(`${name}/${version}`))
test: fix a test that was failing locally (#<I>) Fixes #<I>
netlify_cli
train
js
e924c274d5c269d4b087e1c11f5e09090a0dfc0a
diff --git a/tests/integration/py2/nupic/algorithms/temporal_memory_test.py b/tests/integration/py2/nupic/algorithms/temporal_memory_test.py index <HASH>..<HASH> 100755 --- a/tests/integration/py2/nupic/algorithms/temporal_memory_test.py +++ b/tests/integration/py2/nupic/algorithms/temporal_memory_test.py @@ -279,7 +279,8 @@ class BasicTemporalMemoryTest(AbstractTemporalMemoryTest): for _ in xrange(4): self.feedTM(sequence) - self.feedTM(sequence, num=10) + for _ in xrange(2): + self.feedTM(sequence, num=10)
Made a test's results more clear
numenta_nupic
train
py
01a190ffe347089844d3189c0134f90b0629a96b
diff --git a/src/Lemonblast/Cbor4Php/Cbor.php b/src/Lemonblast/Cbor4Php/Cbor.php index <HASH>..<HASH> 100644 --- a/src/Lemonblast/Cbor4Php/Cbor.php +++ b/src/Lemonblast/Cbor4Php/Cbor.php @@ -184,20 +184,33 @@ class Cbor { switch($additional) { case AdditionalType::UINT_8: - return array_shift($bytes); + $length = 1; + break; case AdditionalType::UINT_16: - return (array_shift($bytes) << 8) + (array_shift($bytes)); + $length = 2; + break; case AdditionalType::UINT_32: - return (array_shift($bytes) << 16) + (array_shift($bytes) << 8) + (array_shift($bytes)); + $length = 4; + break; case AdditionalType::UINT_64: - return (array_shift($bytes) << 24) + (array_shift($bytes) << 16) + (array_shift($bytes) << 8) + (array_shift($bytes)); + $length = 8; + break; default: return $additional; } + + // Construct the value + $value = 0; + for($i = 0; $i < $length; $i++) + { + $value += array_shift($bytes) << ($i * 8); + } + + return $value; } /**
Changed decodeIntValue to decode with a for loop, instead of trying to shift the bytes manually
Lemonblast_Cbor4Php
train
php
e6fe00d7463e6d71c273c15d9278b4f83dfd2930
diff --git a/core/renderMiddleware.js b/core/renderMiddleware.js index <HASH>..<HASH> 100644 --- a/core/renderMiddleware.js +++ b/core/renderMiddleware.js @@ -77,6 +77,8 @@ function beginRender(req, res, start, context, page) { logger.debug("Route Name: " + routeName); + var renderTimer = logger.timer("renderFunction"); + // regardless of what happens, write out the header part // TODO: should this include the common.js file? seems like it // would give it a chance to download and parse while we're loading @@ -91,9 +93,10 @@ function beginRender(req, res, start, context, page) { writeBody, writeData, setupLateArrivals, - ].reduce((chain, func) => chain.then( - () => func(req, res, context, start, page) - )).catch(err => logger.error("Error in beginRender chain", err.stack)); + ].reduce((chain, func) => chain + .then(() => func(req, res, context, start, page)) + .then(() => renderTimer.tick(func.name)) + ).catch(err => logger.error("Error in beginRender chain", err.stack)); // TODO: we probably want a "we're not waiting any longer for this" // timeout as well, and cancel the waiting deferreds
Log timings for each function chained up in `beginRender`
redfin_react-server
train
js
50a17a5a817692040143b8f1dbeb7bc68bfb420b
diff --git a/lib/ice_cube/validated_rule.rb b/lib/ice_cube/validated_rule.rb index <HASH>..<HASH> 100644 --- a/lib/ice_cube/validated_rule.rb +++ b/lib/ice_cube/validated_rule.rb @@ -93,7 +93,11 @@ module IceCube # Fully replace validations def replace_validations_for(key, arr) - @validations[key] = arr + if arr.nil? + @validations.delete(key) + else + @validations[key] = arr + end end # Remove the specified base validations diff --git a/spec/examples/ice_cube_spec.rb b/spec/examples/ice_cube_spec.rb index <HASH>..<HASH> 100644 --- a/spec/examples/ice_cube_spec.rb +++ b/spec/examples/ice_cube_spec.rb @@ -790,6 +790,18 @@ describe IceCube::Schedule, 'occurs_on?' do rule.occurrence_count.should == 5 end + it 'should be able to remove a count validation from a rule' do + rule = IceCube::Rule.daily.count(5) + rule.occurrence_count.should == 5 + rule.count nil + rule.occurrence_count.should raise_error + end -end + it 'should be able to remove a count validation from a rule' do + rule = IceCube::Rule.daily.count(5) + rule.to_hash[:count].should == 5 + rule.count nil + rule.to_hash[:count].should be_nil + end +end
Allow count removal by setting the value to nil [#<I>]
seejohnrun_ice_cube
train
rb,rb
63690e224493090d3635ffb7dc5410bfbf9803a5
diff --git a/sphinx-prompt/__init__.py b/sphinx-prompt/__init__.py index <HASH>..<HASH> 100644 --- a/sphinx-prompt/__init__.py +++ b/sphinx-prompt/__init__.py @@ -162,3 +162,7 @@ class PromptDirective(rst.Directive): def setup(app): app.add_directive('prompt', PromptDirective) app.connect('env-purge-doc', cache.clear) + return { + 'parallel_read_safe': True, + 'parallel_write_safe': True, + }
Add ability to read and write parallel This allows users to use the `-j` option when running Sphinx with this extension.
sbrunner_sphinx-prompt
train
py
a516fdefb6433993d7fcfda7b834fee1a2309d96
diff --git a/activerecord/lib/active_record/associations/preloader/through_association.rb b/activerecord/lib/active_record/associations/preloader/through_association.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/preloader/through_association.rb +++ b/activerecord/lib/active_record/associations/preloader/through_association.rb @@ -81,12 +81,12 @@ module ActiveRecord def through_scope scope = through_reflection.klass.unscoped - values = reflection_scope.values if options[:source_type] scope.where! reflection.foreign_type => options[:source_type] elsif !reflection_scope.where_clause.empty? scope.where_clause = reflection_scope.where_clause + values = reflection_scope.values if includes = values[:includes] scope.includes!(source_reflection.name => includes)
Assigning `values` is only necessary when `reflection_scope.where_clause` is not empty Because `reflection_scope.values` will create extra new hash.
rails_rails
train
rb
9e60c51b8d359c6831de6a80ea5f026cc8d79cdb
diff --git a/app/openbel/api/app.rb b/app/openbel/api/app.rb index <HASH>..<HASH> 100644 --- a/app/openbel/api/app.rb +++ b/app/openbel/api/app.rb @@ -7,7 +7,6 @@ require_relative 'util' require 'rack/cors' require 'sinatra/base' -require "sinatra/reloader" require "sinatra/cookies" require_relative 'version' @@ -29,10 +28,6 @@ module OpenBEL class Server < Sinatra::Application - configure :development do - register Sinatra::Reloader - end - configure do config = OpenBEL::Config::load! OpenBEL.const_set :Settings, config
Remove sinatra reloader - no longer needed
OpenBEL_openbel-api
train
rb
f4b6d0c27009fa331ee182b2328ed482ecd5842d
diff --git a/tests/unit/mixins/components/tooltips-test.js b/tests/unit/mixins/components/tooltips-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/mixins/components/tooltips-test.js +++ b/tests/unit/mixins/components/tooltips-test.js @@ -25,6 +25,7 @@ test('The mixin adds the public properties', function(assert) { 'place', 'spacing', 'typeClass', + 'open' ], tooltipAuto: true, tooltipContent: null, @@ -33,9 +34,10 @@ test('The mixin adds the public properties', function(assert) { tooltipPlace: 'top', tooltipSpacing: null, tooltipTypeClass: null, + tooltipOpen: null, }; - assert.expect(9); + assert.expect(10); Ember.keys(expectedProperties).forEach(function(expectedProperty) { const expectedValue = expectedProperties[expectedProperty];
Update tooltip mixin test with new option
sir-dunxalot_ember-tooltips
train
js
672019af2e1183a30e1ef53689fd33e0530c4415
diff --git a/lib/kamerling/logging.rb b/lib/kamerling/logging.rb index <HASH>..<HASH> 100644 --- a/lib/kamerling/logging.rb +++ b/lib/kamerling/logging.rb @@ -19,10 +19,6 @@ module Kamerling class Logging private - def bytes_in_hex bytes - bytes.unpack('H*').first.scan(/../).join ' ' - end - def log_dispatcher NetDispatcher.singleton_class.extend AfterDo NetDispatcher.singleton_class.before :dispatch do |addr, message|
drop Logging#bytes_in_hex
chastell_kamerling
train
rb
5d5d5f1e0080c4f9b467ee13ddb34ce933974e46
diff --git a/merb-core/lib/merb-core/bootloader.rb b/merb-core/lib/merb-core/bootloader.rb index <HASH>..<HASH> 100644 --- a/merb-core/lib/merb-core/bootloader.rb +++ b/merb-core/lib/merb-core/bootloader.rb @@ -829,7 +829,7 @@ class Merb::BootLoader::LoadClasses < Merb::BootLoader # Ignore the file for syntax errors. The next time # the file is changed, it'll be reloaded again begin - load file + require file rescue SyntaxError => e Merb.logger.error "Cannot load #{file} because of syntax error: #{e.message}" ensure
[fixed #<I>] The LoadClasses Bootloader has been fixed to require classes and not load them.
wycats_merb
train
rb
f89cc3fe7da4b2a9dd87ef297505152999e105ff
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -85,14 +85,14 @@ function argify (opts, file) { if ((file && isAppleScript(file) && !opts.type) || (opts.type && opts.type.toLowerCase() === 'applescript')) { - return [].concat(args); + return [].concat(args, opts.flags || []); } if (opts.type) { - return ['-l', opts.type].concat(args); + return ['-l', opts.type].concat(args, opts.flags || []); } - return ['-l', 'JavaScript'].concat(args); + return ['-l', 'JavaScript'].concat(args, opts.flags || []); } function isAppleScript (file) {
Add flags to osascript calls
mikaelbr_node-osascript
train
js
77ed921e899d2b0bfedcf4aa4fc5c7bb09326915
diff --git a/demosys/opengl/shader.py b/demosys/opengl/shader.py index <HASH>..<HASH> 100644 --- a/demosys/opengl/shader.py +++ b/demosys/opengl/shader.py @@ -518,6 +518,19 @@ class Shader: # --- Sampler --- + def uniform_sampler_1d(self, unit, name, texture): + """ + Sets a sampler1d + + :param unit: The texture unit to use (0 - N) + :param name: Name of the uniform + :param texture: The Texture object + """ + uniform = self.uniform(name) + GL.glActiveTexture(GL.GL_TEXTURE0 + unit) + texture.bind() + GL.glUniform1i(uniform.location, unit) + def uniform_sampler_2d(self, unit, name, texture): """ Sets a sampler2d @@ -531,9 +544,9 @@ class Shader: texture.bind() GL.glUniform1i(uniform.location, unit) - def uniform_sampler_1d(self, unit, name, texture): + def uniform_sampler_3d(self, unit, name, texture): """ - Sets a sampler1d + Sets a sampler3d :param unit: The texture unit to use (0 - N) :param name: Name of the uniform
Shader: Support setting sampler3D
Contraz_demosys-py
train
py
2e4eda7ca87ac4b6aaf0b5ebb62f965c26b93de6
diff --git a/pymustache/mustache.py b/pymustache/mustache.py index <HASH>..<HASH> 100644 --- a/pymustache/mustache.py +++ b/pymustache/mustache.py @@ -262,7 +262,7 @@ class Token(): def _escape(self, text): """Escape text according to self.escape""" - ret = EMPTYSTRING if not text else str(text) + ret = EMPTYSTRING if text is None else str(text) if self.escape: return html_escape(ret) else:
[bug] will not print number 0
lotabout_pymustache
train
py
a889dd10fda52b5585c0494b12dd9632749bdc14
diff --git a/src/frontend/org/voltdb/client/exampleutils/ClientConnection.java b/src/frontend/org/voltdb/client/exampleutils/ClientConnection.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/client/exampleutils/ClientConnection.java +++ b/src/frontend/org/voltdb/client/exampleutils/ClientConnection.java @@ -186,17 +186,15 @@ public class ClientConnection implements Closeable * Processes the server response, tracking performance statistics internally, then calling the user-specified callback (if any). */ @Override - public void clientCallback(ClientResponse response) + public void clientCallback(ClientResponse response) throws Exception { - try - { - this.Owner.Statistics.update(this.Procedure, response); - if (this.UserCallback != null) - this.UserCallback.clientCallback(response); + + this.Owner.Statistics.update(this.Procedure, response); + if (this.UserCallback != null) + this.UserCallback.clientCallback(response); } - catch(Exception x) {} // If the user callback crashes, nothign we can do (user should handle exceptions on his own, we're just wrapping around for tracking!) } - } + /** * Executes a procedure asynchronously, then calls the provided user callback with the server response upon completion.
ENG-<I>. Don't swallow exceptions in the callback.
VoltDB_voltdb
train
java
f01e4239e3803333e0fe1cb665ff5e3446cd9294
diff --git a/Classes/Service/SlugService.php b/Classes/Service/SlugService.php index <HASH>..<HASH> 100644 --- a/Classes/Service/SlugService.php +++ b/Classes/Service/SlugService.php @@ -128,6 +128,7 @@ class SlugService implements LoggerAwareInterface $this->checkSubPages($currentPageRecord, $currentSlug, $newSlug); } $this->sendNotification(); + GeneralUtility::makeInstance(RedirectCacheService::class)->rebuild(); } }
[BUGFIX] Rebuild redirect cache after changing slug If a slug is changed, the redirect cache must be rebuilt to make the redirect actually work. Resolves: #<I> Releases: master, <I> Change-Id: Ieb<I>db<I>aa<I>eb<I>d6a7baaeed<I>a<I>b<I> Reviewed-on: <URL>
TYPO3-CMS_redirects
train
php
13f76693fbdc172a0dde928e9baca17132779c87
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js +++ b/bundles/org.eclipse.orion.client.core/web/orion/editorCommands.js @@ -319,7 +319,7 @@ exports.EditorCommandFactory = (function() { window.document.body.appendChild(iframe); // Listen for notification from the iframe. This should eventually belong as part of the plugin registry. // This mechanism should become generalized into a "page services" API for plugin iframes to contact the outer context. - window.addEventListener("message", function(event) { //$NON-NLS-0$ + window.addEventListener("message", function _messageHandler(event) { //$NON-NLS-0$ if (event.source !== iframe.contentWindow) { return; } @@ -331,6 +331,7 @@ exports.EditorCommandFactory = (function() { } else if (data.result) { deferred.resolve(data.result); } + window.removeListener("message", _messageHandler, false); window.document.body.removeChild(iframe); } }
Bug <I> - Opening a window from a plug-in -- cleanup listener when done
eclipse_orion.client
train
js
66aac9b9160f6f46e9984cb1ed7684d8b5703771
diff --git a/src/Sonrisa/Component/Sitemap/SubmitSitemap.php b/src/Sonrisa/Component/Sitemap/SubmitSitemap.php index <HASH>..<HASH> 100644 --- a/src/Sonrisa/Component/Sitemap/SubmitSitemap.php +++ b/src/Sonrisa/Component/Sitemap/SubmitSitemap.php @@ -33,7 +33,7 @@ class SubmitSitemap { //Validate URL format and Response if ( filter_var( $url, FILTER_VALIDATE_URL, array('options' => array('flags' => FILTER_FLAG_PATH_REQUIRED)) ) ) { - if (self::do_head_check($url) === true ) { + if (self::sendHttpHeadRequest($url) === true ) { return self::do_submit($url); } throw new SitemapException("The URL provided ({$url}) holds no accessible sitemap file."); @@ -65,7 +65,7 @@ class SubmitSitemap * @param $url string URL being submitted. * @return boolean */ - protected static function do_head_check($url) + protected static function sendHttpHeadRequest($url) { $opts = array
Fix for [Insight] PHP code should follow PSR-1 basic coding standard
nilportugues_php-sitemap
train
php
64f0a65de7c87f23034a904fc52f1f518c81adc5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -20,9 +20,9 @@ function parse(name, options, fn) { } options = options || {}; - options.registry = options.registry || new Registry(); - options.order = options.order || ['registry', 'content', 'github']; options.githulk = options.githulk || null; + options.order = options.order || ['registry', 'content', 'github']; + options.registry = options.registry || new Registry({ githulk: options.githulk }); async.waterfall([ // @@ -31,6 +31,7 @@ function parse(name, options, fn) { // function fetch(next) { if ('string' !== typeof name) return next(undefined, name); + options.registry.packages.get(name, next); }, @@ -39,6 +40,7 @@ function parse(name, options, fn) { // function search(data, next) { if (!options.order.length) return next(); + if (Array.isArray(data)) data = data[0]; var parser, result, name;
[fix] Pass through the githulk instance [fix] Allow arrays as data structure
3rd-Eden_licenses
train
js
7a7121569e91615d725d5c727deb2ff6f0acd604
diff --git a/definitions/npm/classnames_v2.x.x/flow_v0.25.x-/classnames_v2.x.x.js b/definitions/npm/classnames_v2.x.x/flow_v0.25.x-/classnames_v2.x.x.js index <HASH>..<HASH> 100644 --- a/definitions/npm/classnames_v2.x.x/flow_v0.25.x-/classnames_v2.x.x.js +++ b/definitions/npm/classnames_v2.x.x/flow_v0.25.x-/classnames_v2.x.x.js @@ -13,3 +13,7 @@ declare module 'classnames' { declare module 'classnames/bind' { declare module.exports: $Exports<'classnames'>; } + +declare module 'classnames/dedupe' { + declare module.exports: $Exports<'classnames'>; +}
Include dedupe in exported modules (#<I>)
flow-typed_flow-typed
train
js
d38d1b34373c50907e7c7673def8ba0ebc5a5427
diff --git a/src/http-client.js b/src/http-client.js index <HASH>..<HASH> 100644 --- a/src/http-client.js +++ b/src/http-client.js @@ -59,7 +59,7 @@ export class HttpClient { } else if (typeof config === 'function') { normalizedConfig = new HttpClientConfiguration(); let c = config(normalizedConfig); - if (typeof c === HttpClientConfiguration) { + if (c instanceof HttpClientConfiguration) { normalizedConfig = c; } } else {
fix(http-client): correct type check
aurelia_fetch-client
train
js
7387a58712f547a00c7bccc34009889409482ebc
diff --git a/fetch-browser.js b/fetch-browser.js index <HASH>..<HASH> 100644 --- a/fetch-browser.js +++ b/fetch-browser.js @@ -12,7 +12,7 @@ // {{whatwgFetch}} return { - fetch: self.fetch, + fetch: self.fetch.bind(global), Headers: self.Headers, Request: self.Request, Response: self.Response
Fix fetch not being bound to window anymore
qubyte_fetch-ponyfill
train
js
4141a00921e3ae814736249ec1806d5d35c8d46c
diff --git a/daemon/graphdriver/devmapper/deviceset.go b/daemon/graphdriver/devmapper/deviceset.go index <HASH>..<HASH> 100644 --- a/daemon/graphdriver/devmapper/deviceset.go +++ b/daemon/graphdriver/devmapper/deviceset.go @@ -776,7 +776,7 @@ func (devices *DeviceSet) poolHasFreeSpace() error { minFreeMetadata := (metadataTotal * uint64(devices.minFreeSpacePercent)) / 100 if minFreeMetadata < 1 { - minFreeData = 1 + minFreeMetadata = 1 } metadataFree := metadataTotal - metadataUsed
Fix the assignment to wrong variable We should be assigning value to minFreeMetadata instead of minFreeData. This is copy/paste error.
moby_moby
train
go
9d774e7fabcc5b3227055fb43b203c153e9ded90
diff --git a/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php b/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php index <HASH>..<HASH> 100644 --- a/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php +++ b/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php @@ -117,7 +117,7 @@ EOF throw new \Exception('No upgrade available'); } - $time = 0; + $time = 30; foreach ($this->upgrades as $version) { $time += $version->getTimeEstimation();
Upgrade base duration to <I>seconds
alchemy-fr_Phraseanet
train
php
f3fd5d13039185bad97e9538bfeb467f4498ca74
diff --git a/src/main/java/eu/hansolo/medusa/skins/LinearSkin.java b/src/main/java/eu/hansolo/medusa/skins/LinearSkin.java index <HASH>..<HASH> 100644 --- a/src/main/java/eu/hansolo/medusa/skins/LinearSkin.java +++ b/src/main/java/eu/hansolo/medusa/skins/LinearSkin.java @@ -624,7 +624,7 @@ public class LinearSkin extends SkinBase<Gauge> implements Skin<Gauge> { barBackground.setWidth(0.9 * width); barBackground.setHeight(0.14286 * height); - barBackground.relocate((width - barBackground.getWidth()) * 0.5, (height - barBackground.getHeight()) * 0.5); + barBackground.relocate(pane.getLayoutX() + (width - barBackground.getWidth()) * 0.5, pane.getLayoutY() + (height - barBackground.getHeight()) * 0.5); barBackground.setStroke(null); barBackground.setFill(new LinearGradient(barBackground.getLayoutBounds().getMinX(), 0, barBackground.getLayoutBounds().getMaxX(), 0,
First approach to fix #<I>
HanSolo_Medusa
train
java
4a5300fb8e248dcfec5ebb732067fb3c300f990d
diff --git a/math/Vector.php b/math/Vector.php index <HASH>..<HASH> 100644 --- a/math/Vector.php +++ b/math/Vector.php @@ -3,7 +3,7 @@ /** * Vector * - * Represents an immutable Euclidean vector of n dimensions. + * Represents an immutable Euclidean vector of n dimensions with floating point precision. * * @package Nyx\Utils\Math * @version 0.1.0 @@ -39,12 +39,23 @@ class Vector implements \ArrayAccess } /** - * Constructs a new Vector. + * Constructs a new n-dimensional Vector. * - * @param float[] The components of the Vector. + * @param float[] $components The components of the Vector. All values must be numeric and will + * be cast to floats. + * @throws \InvalidArgumentException When any of the components is not a numeric value. */ public function __construct(array $components) { + // Validate all components and cast them to floats. + foreach ($components as $d => &$component) { + if (!is_numeric($component)) { + throw new \InvalidArgumentException('The value of the component ['.$d.'] is not numeric.'); + } + + $component = (float) $component; + } + $this->components = $components; }
[Utils/Math] Ensure all components are floating point numbers from construction onwards.
unyx_utils
train
php
df9458510dae7df45cbaab7b8779719930fae2cc
diff --git a/mipmap.go b/mipmap.go index <HASH>..<HASH> 100644 --- a/mipmap.go +++ b/mipmap.go @@ -372,22 +372,30 @@ func pow2(power int) float32 { return x } -func maxf32(values ...float32) float32 { - max := float32(math.Inf(-1)) - for _, v := range values { - if max < v { - max = v - } +func maxf32(a, b, c, d float32) float32 { + max := a + if max < b { + max = b + } + if max < c { + max = c + } + if max < d { + max = d } return max } -func minf32(values ...float32) float32 { - min := float32(math.Inf(1)) - for _, v := range values { - if min > v { - min = v - } +func minf32(a, b, c, d float32) float32 { + min := a + if min > b { + min = b + } + if min > c { + min = c + } + if min > d { + min = d } return min }
graphics: Speed optimization at maxf<I> and minf<I>
hajimehoshi_ebiten
train
go
5cda188bf4be67ee4e897978a15d8d505cdbc80e
diff --git a/chef/spec/unit/provider/package/rubygems_spec.rb b/chef/spec/unit/provider/package/rubygems_spec.rb index <HASH>..<HASH> 100644 --- a/chef/spec/unit/provider/package/rubygems_spec.rb +++ b/chef/spec/unit/provider/package/rubygems_spec.rb @@ -612,3 +612,4 @@ describe Chef::Provider::Package::Rubygems do end end end +
fixed incorrect tests for rubygems
chef_chef
train
rb
31c3b7a2e113d55b92262a726bd91e381335c020
diff --git a/admin/tool/usertours/classes/manager.php b/admin/tool/usertours/classes/manager.php index <HASH>..<HASH> 100644 --- a/admin/tool/usertours/classes/manager.php +++ b/admin/tool/usertours/classes/manager.php @@ -561,11 +561,6 @@ class manager { public static function get_matching_tours(\moodle_url $pageurl) { global $DB, $PAGE; - if (self::tour_upgrade_pending()) { - // Do not show tours whilst upgrades are pending agains the plugin. - return null; - } - $sql = <<<EOF SELECT * FROM {tool_usertours_tours} WHERE enabled = 1 @@ -588,21 +583,6 @@ EOF; } /** - * Determine whether the tour plugin is pending an upgrade. - * - * @return bool - */ - public static function tour_upgrade_pending() { - $plugin = new \stdClass(); - include(dirname(__DIR__) . '/version.php'); - - $manager = \core_plugin_manager::instance(); - $plugininfo = $manager->get_plugin_info('tool_usertours'); - - return ($plugin->version != $plugininfo->versiondb); - } - - /** * Import the provided tour JSON. * * @param string $json The tour configuration.
MDL-<I> tool_usertours: Stop testing pending upgrades
moodle_moodle
train
php
65b55d88b4390ce219914c88b4e126eaf89a877a
diff --git a/lib/assertions.js b/lib/assertions.js index <HASH>..<HASH> 100644 --- a/lib/assertions.js +++ b/lib/assertions.js @@ -460,7 +460,7 @@ module.exports = function (expect) { } else if (isRegExp(value)) { expect(subject, 'to match', value); } else { - var type = expect.findTypeOf(subject); + var type = expect.findTypeOf(subject, value); if (type.name === 'object' || type.name === 'array') { expect(subject, 'to be an object'); Object.keys(value).forEach(function (key) {
to satisfy: Only dive into object/array mode if both subject and value have the correct type.
unexpectedjs_unexpected
train
js
48cc7bde30eca230dcc29add6d4c3d4fff897a19
diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java @@ -39,7 +39,7 @@ import org.springframework.boot.gradle.testkit.GradleBuild; public final class GradleCompatibilitySuite extends Suite { private static final List<String> GRADLE_VERSIONS = Arrays.asList("default", "4.1", - "4.2", "4.3-rc-4"); + "4.2", "4.3"); public GradleCompatibilitySuite(Class<?> clazz) throws InitializationError { super(clazz, createRunners(clazz));
Test the Gradle plugin against Gradle <I> Closes gh-<I>
spring-projects_spring-boot
train
java
abc6304da18cc3ecbf28827675f1f905a0d2abf9
diff --git a/pyemu/utils/pst_from.py b/pyemu/utils/pst_from.py index <HASH>..<HASH> 100644 --- a/pyemu/utils/pst_from.py +++ b/pyemu/utils/pst_from.py @@ -1189,7 +1189,9 @@ class PstFrom(object): new_obs = self.add_observations_from_ins( ins_file=insfile, out_file=self.new_d / filename ) - if prefix is not None: + if obsgp is not None: + new_obs.loc[:, "obgnme"] = obsgp + elif prefix is not None: new_obs.loc[:, "obgnme"] = prefix self.logger.log("adding observations from array output file '{0}'".format(filenames)) if rebuild_pst:
bug fix in array obs when obsgp is passed
jtwhite79_pyemu
train
py
a79e242bc0ea5b31f3a737a7a3e0b6eab917f9d7
diff --git a/lib/mongoid.rb b/lib/mongoid.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid.rb +++ b/lib/mongoid.rb @@ -90,16 +90,19 @@ module Mongoid #:nodoc end alias :config :configure - - delegate \ - :allow_dynamic_fields, - :database, - :master, - :max_successive_reads, - :persist_in_safe_mode, - :raise_not_found_error, - :slaves, - :temp_collection_size, :to => :configure end + # Take all the public instance methods from the Config singleton and allow + # them to be accessed through the Mongoid module directly. + # + # Example: + # + # <tt>Mongoid.database = Mongo::Connection.new.db("test")</tt> + Config.public_instance_methods(false).each do |name| + (class << self; self; end).class_eval <<-EOT + def #{name}(*args) + configure.send("#{name}", *args) + end + EOT + end end
Automatically adding methods for each config method on mongoid
mongodb_mongoid
train
rb
fe02688a06e85ec66572b333818dcfa373b3e571
diff --git a/lib/task-manager.rb b/lib/task-manager.rb index <HASH>..<HASH> 100644 --- a/lib/task-manager.rb +++ b/lib/task-manager.rb @@ -6,6 +6,8 @@ require "active_model_serializers" require "task-manager/api_constraints" require "task-manager/engine" +require "task-manager/deadline_calculator" +require "task-manager/deadline_validator" module TaskManager
Included deadline-validator and deadline-calculator
menglifang_task-manager
train
rb
5969bc31fba328715e03b8ecab301e2b7ccb7b87
diff --git a/addon/metrics-adapters/keen.js b/addon/metrics-adapters/keen.js index <HASH>..<HASH> 100644 --- a/addon/metrics-adapters/keen.js +++ b/addon/metrics-adapters/keen.js @@ -26,7 +26,7 @@ export default BaseAdapter.extend({ window.contextVars = {}; window.contextVars.currentUser = this.userContextVars(); window.contextVars.node = this.nodeContextVars(node); - return this.KeenTracker().getInstance().trackPrivateEvent('front-end-events', properties, node); + return this.KeenTracker().getInstance().trackPrivateEvent('front-end-events', { interaction: properties }, node); },
Nest properties under interaction key. [skip-ci]
CenterForOpenScience_ember-osf
train
js
bf5bc1ebce6fda1fdb12b909b27e59fb5a010f36
diff --git a/packages/cozy-konnector-libs/src/libs/categorization/localModel/parameters.js b/packages/cozy-konnector-libs/src/libs/categorization/localModel/parameters.js index <HASH>..<HASH> 100644 --- a/packages/cozy-konnector-libs/src/libs/categorization/localModel/parameters.js +++ b/packages/cozy-konnector-libs/src/libs/categorization/localModel/parameters.js @@ -1,11 +1,21 @@ -const { BankTransaction } = require('cozy-doctypes') +const cozyClient = require('../../cozyclient') +const { Q } = require('cozy-client') async function fetchTransactionsWithManualCat() { - const transactionsWithManualCat = await BankTransaction.queryAll({ - manualCategoryId: { $exists: true } - }) + const client = cozyClient.new - return transactionsWithManualCat + const query = Q('io.cozy.bank.operations') + .where({ + manualCategoryId: { $gt: null } + }) + .partialIndex({ + manualCategoryId: { + $exists: true + } + }) + .indexFields(['manualCategoryId']) + + return client.queryAll(query) } module.exports = {
fix: Use cozy-client method to query operations with manual category We used to query operations with manual category, through cozy-doctypes, which: - uses old cozy-client - uses deprecated and slow pagination skip Furthermore, the query was not using any index. We now use a partial index, which is much more efficient for this query.
konnectors_libs
train
js
b31f6ba39b91b286ab1ce8480d65d31f2e156f8a
diff --git a/holoviews/plotting/bokeh/callbacks.py b/holoviews/plotting/bokeh/callbacks.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/bokeh/callbacks.py +++ b/holoviews/plotting/bokeh/callbacks.py @@ -1059,6 +1059,8 @@ class LassoCallback(Callback): if isinstance(ys, dict): ys = ((int(i), y) for i, y in ys.items()) ys = [y for _, y in sorted(ys)] + if xs is None or ys is None: + return {} return {'geometry': np.column_stack([xs, ys])}
Skip undefined lasso select (#<I>)
pyviz_holoviews
train
py
26db81d6199651375bd9cdf800ea2111eca321b7
diff --git a/nanofilt/version.py b/nanofilt/version.py index <HASH>..<HASH> 100644 --- a/nanofilt/version.py +++ b/nanofilt/version.py @@ -1 +1 @@ -__version__= "1.1.2" +__version__= "1.1.3"
bumping version to <I>
wdecoster_nanofilt
train
py
b1ab8911587f4185a6ba7a734c93a32b4b198540
diff --git a/lib/pry-byebug/commands/breakpoint.rb b/lib/pry-byebug/commands/breakpoint.rb index <HASH>..<HASH> 100644 --- a/lib/pry-byebug/commands/breakpoint.rb +++ b/lib/pry-byebug/commands/breakpoint.rb @@ -54,6 +54,8 @@ module PryByebug end def process + PryByebug.check_file_context(target) + all = %w(condition show delete disable enable disable-all delete-all) all.each do |option| next unless opts.present?(option) diff --git a/lib/pry-byebug/commands/breakpoints.rb b/lib/pry-byebug/commands/breakpoints.rb index <HASH>..<HASH> 100644 --- a/lib/pry-byebug/commands/breakpoints.rb +++ b/lib/pry-byebug/commands/breakpoints.rb @@ -24,6 +24,8 @@ module PryByebug end def process + PryByebug.check_file_context(target) + return bold_puts('No breakpoints defined.') if breakpoints.count == 0 if opts.verbose?
Add missing checks We need a file context for adding & listing breakpoints too.
deivid-rodriguez_pry-byebug
train
rb,rb
0c091e90bc6508a0b9b50cd3ae2083d2f85c7ca3
diff --git a/lib/src/ChainWebSocket.js b/lib/src/ChainWebSocket.js index <HASH>..<HASH> 100644 --- a/lib/src/ChainWebSocket.js +++ b/lib/src/ChainWebSocket.js @@ -73,7 +73,6 @@ class ChainWebSocket { resolve(); } this.ws.onerror = (error) => { - this.closed = true; if( this.keepalive_timer ){ clearInterval(this.keepalive_timer); this.keepalive_timer = undefined;
Don't set closed to true on error
bitshares_bitsharesjs-ws
train
js
9dc3e051a5b954b4df940843956f4b2fc1045e5b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='dateinfer', - version='0.1.1', + version='0.2.0', description='Infers date format from examples', long_description="""Uses a series of pattern matching and rewriting rules to compute a "best guess" datetime.strptime format string give a list of example date strings.""", author='Jeffrey Starr',
Bumping revision to <I>
jeffreystarr_dateinfer
train
py
66627ca1273720422c41b66e779e9241f861a979
diff --git a/grequests.py b/grequests.py index <HASH>..<HASH> 100644 --- a/grequests.py +++ b/grequests.py @@ -9,7 +9,7 @@ by gevent. All API methods return a ``Request`` instance (as opposed to ``Response``). A list of requests can be sent with ``map()``. """ from functools import partial - +import traceback try: import gevent from gevent import monkey as curious_george @@ -72,6 +72,7 @@ class AsyncRequest(object): self.url, **merged_kwargs) except Exception as e: self.exception = e + self.traceback = traceback.format_exc() return self
stuff the traceback from the exception into the AsyncRequest object as well
kennethreitz_grequests
train
py
236336a364378a6e949d7cd8c44c44ff46d4660e
diff --git a/installer/cluster.go b/installer/cluster.go index <HASH>..<HASH> 100644 --- a/installer/cluster.go +++ b/installer/cluster.go @@ -578,6 +578,8 @@ iptables -A FORWARD -i eth0 -j DROP var startScript = template.Must(template.New("start.sh").Parse(` #!/bin/sh +set -e -x + FIRST_BOOT="/var/lib/flynn/first-boot" mkdir -p /var/lib/flynn
installer: Print all commands executed in userdata script
flynn_flynn
train
go
ff1f1079518e5943a9b892926c415a776d716488
diff --git a/mod/jodd-wot/src/jodd/db/orm/mapper/DefaultResultSetMapper.java b/mod/jodd-wot/src/jodd/db/orm/mapper/DefaultResultSetMapper.java index <HASH>..<HASH> 100644 --- a/mod/jodd-wot/src/jodd/db/orm/mapper/DefaultResultSetMapper.java +++ b/mod/jodd-wot/src/jodd/db/orm/mapper/DefaultResultSetMapper.java @@ -335,7 +335,6 @@ public class DefaultResultSetMapper implements ResultSetMapper { Class type = BeanUtil.getDeclaredPropertyType(result[currentResult], propertyName); if (type != null) { // match: entity -// Class<? extends SqlType> sqlTypeClass = (dec == null ? null : dec.getSqlTypeClass()); Class<? extends SqlType> sqlTypeClass = dec.getSqlTypeClass(); Object value = readColumnValue(colNdx, type, sqlTypeClass, columnDbSqlType); if (value != null) {
dec always != null
oblac_jodd
train
java
b84a6b2e13e70af1ec82741ad2fc781bf78e5861
diff --git a/src/editor/Editor.js b/src/editor/Editor.js index <HASH>..<HASH> 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -277,6 +277,7 @@ define(function (require, exports, module) { // Editor supplies some standard keyboard behavior extensions of its own var codeMirrorKeyMap = { + "Tab" : _handleTabKey, "Left" : function (instance) { if (!_handleSoftTabNavigation(instance, -1, "moveH")) { CodeMirror.commands.goCharLeft(instance); @@ -929,8 +930,10 @@ define(function (require, exports, module) { CommandManager.register(Commands.EDIT_REPLACE, _replace); CommandManager.register(Commands.EDIT_FIND_PREVIOUS, _findPrevious); CommandManager.register(Commands.EDIT_SELECT_ALL, _handleSelectAll); - CommandManager.register(Commands.EDIT_INDENT, _handleTabKey); - CommandManager.register(Commands.EDIT_UNINDENT, _handleTabKey); + + // TODO: code mirror handles + // CommandManager.register(Commands.EDIT_INDENT, _handleTabKey); + // CommandManager.register(Commands.EDIT_UNINDENT, _handleTabKey); // Define public API exports.Editor = Editor;
Fixing tab key by restoring old behavior. Menu item will not work. I will fix this as a second pull request.
adobe_brackets
train
js
8c598cef1879f4bc1172caa3c8566e16c2c5ca4f
diff --git a/lib/javascript-static.js b/lib/javascript-static.js index <HASH>..<HASH> 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -1182,13 +1182,23 @@ function openpopup(event, args) { if (!args.url.match(/https?:\/\//)) { fullurl = M.cfg.wwwroot + args.url; } + if (args.fullscreen) { + args.options = args.options. + replace(/top=\d+/, 'top=0'). + replace(/left=\d+/, 'left=0'). + replace(/width=\d+/, 'width=' + screen.availWidth). + replace(/height=\d+/, 'height=' + screen.availHeight); + } var windowobj = window.open(fullurl,args.name,args.options); if (!windowobj) { return true; } + if (args.fullscreen) { - windowobj.moveTo(0,0); - windowobj.resizeTo(screen.availWidth,screen.availHeight); + setTimeout(function() { + windowobj.moveTo(0, 0); + windowobj.resizeTo(screen.availWidth, screen.availHeight) + }, 0); } windowobj.focus();
MDL-<I> javascript-static: full-screep popups for Chrome. I have left in both: 1. the code to get the window size correct initially, becuase that seems sensible; and 2. the subsequent resize (with the setTimeout that Chrome requires, thanks Jeff Rader for finding that) becuase on Chrome, it gets the size a bit too big initially, so this correction is necessary.
moodle_moodle
train
js
ecc11af02feb6b1af94dc3dd697cb4ee55e5106c
diff --git a/grade/report/outcomes/index.php b/grade/report/outcomes/index.php index <HASH>..<HASH> 100644 --- a/grade/report/outcomes/index.php +++ b/grade/report/outcomes/index.php @@ -63,7 +63,7 @@ foreach ($outcomes as $outcomeid => $outcome) { // Get average grades for each item if (is_array($report_info[$outcomeid]['items'])) { foreach ($report_info[$outcomeid]['items'] as $itemid => $item) { - $sql = "SELECT id, AVG(finalgrade) AS `avg`, COUNT(finalgrade) AS `count` + $sql = "SELECT itemid, AVG(finalgrade) AS avg, COUNT(finalgrade) AS count FROM {$CFG->prefix}grade_grades WHERE itemid = $itemid GROUP BY itemid";
MDL-<I> Merged from <I>_STABLE. Did not work with PostgreSQL
moodle_moodle
train
php
b216d0d6b59f247a13922f257eab9a958134773c
diff --git a/eventkit/models.py b/eventkit/models.py index <HASH>..<HASH> 100644 --- a/eventkit/models.py +++ b/eventkit/models.py @@ -10,6 +10,7 @@ import six from django.core.exceptions import ValidationError from django.db import models, transaction +from django.utils import encoding from polymorphic import PolymorphicModel from timezone import timezone @@ -59,6 +60,7 @@ class AbstractBaseModel(models.Model): super(AbstractBaseModel, self).save(*args, **kwargs) +@encoding.python_2_unicode_compatible class RecurrenceRule(AbstractBaseModel): """ An iCalendar (RFC2445) recurrence rule. This model allows commonly needed @@ -75,7 +77,11 @@ class RecurrenceRule(AbstractBaseModel): 'an event repeats.', ) + def __str__(self): + return self.description or '' + +@encoding.python_2_unicode_compatible class AbstractEvent(PolymorphicModel, AbstractBaseModel): """ Abstract polymorphic event model, with the bare minimum fields. @@ -124,6 +130,9 @@ class AbstractEvent(PolymorphicModel, AbstractBaseModel): super(AbstractEvent, self).__init__(*args, **kwargs) self._store_repeat_fields() + def __str__(self): + return self.title + def _repeat_fields_changed(self, fields=None): """ Return ``True`` if the given field (or any field, if None) has changed.
Add `__str__()` methods.
ic-labs_django-icekit
train
py
58bdec20208a31dc61d099ae701a6474e5489c7b
diff --git a/app/views/uss/index.php b/app/views/uss/index.php index <HASH>..<HASH> 100644 --- a/app/views/uss/index.php +++ b/app/views/uss/index.php @@ -35,6 +35,14 @@ $this->params['breadcrumbs'][] = $this->title; 'wo_doc_name', 'aoi_name', [ + 'label'=>'Request Name', + 'attribute'=>'id', + 'value'=>function($data){ + $a= MiseoGroupLocal::find()->where(['scene_id'=>$data->id])->one()->name; + return (empty($a)?'import xml':$a); + } + ], + [ 'label' => 'Strip Name', 'attribute' => 'id', 'value' => function($data) {
added request name to uss index.
prawee_yii2-grid
train
php
7d68715e9b3b188a817ce06732b634ff0c9a8a4b
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -157,9 +157,11 @@ func (s *Server) serveSession(session *yamux.Session) { for { stream, err := session.AcceptStream() if err != nil { - // TODO(sgc): handle session errors - log.Printf("ERR session.AcceptStream failed: error=%v", err) - session.Close() + if err != io.EOF { + // TODO(sgc): handle session errors + log.Printf("ERR session.AcceptStream failed: error=%v", err) + session.Close() + } return }
don't log io.EOF
influxdata_yarpc
train
go
ee13d0db515df01548516a483e6bb6ae94b5a095
diff --git a/web/concrete/models/layout.php b/web/concrete/models/layout.php index <HASH>..<HASH> 100644 --- a/web/concrete/models/layout.php +++ b/web/concrete/models/layout.php @@ -260,7 +260,8 @@ if(!intval($rows)) $rows=1; if(!intval($columns)) $columns=3; $layoutNameClass = 'ccm-layout-name-'.TextHelper::camelcase($this->getAreaHandle()).'-'.TextHelper::camelcase($this->getLayoutNameTxt()).'-'.$this->getAreaNameNumber(); - echo '<div id="ccm-layout-'.$this->layoutID.'" class="ccm-layout ccm-layout-table '.$layoutNameClass.' '.$editMode.'">'; + $layoutIDVal = strtolower('ccm-layout-'.TextHelper::camelcase($this->getAreaHandle()).'-'.$this->layoutID . '-'. $this->getAreaNameNumber()); + echo '<div id="'.$layoutIDVal.'" class="ccm-layout ccm-layout-table '.$layoutNameClass.' '.$editMode.'">'; for( $i=0; $i<$rows; $i++ ){ echo '<div class="ccm-layout-row ccm-layout-row-'.($i+1).'">'; $cumulativeWidth=0;
fixing bug with duplicate layout IDs when using presets Former-commit-id: a<I>b9d1d3b2b<I>bdf2d<I>cd<I>d<I>ab<I>e3d
concrete5_concrete5
train
php
3e6b033e916ecc784253cf2a21ae267dc14a9dd8
diff --git a/features/step_definitions/interaction_steps.rb b/features/step_definitions/interaction_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/interaction_steps.rb +++ b/features/step_definitions/interaction_steps.rb @@ -1,9 +1,9 @@ Given /^a profile named "([^\"]*)" on "([^\"]*)"$/ do |name, tower| - When 'I run rubywarrior' - And 'I answer "y" to "create one?"' - And 'I choose "' + tower + '" for "tower"' - And 'I answer "' + name + '" to "name"' - Then 'I should see "generated"' + step 'I run rubywarrior' + step 'I answer "y" to "create one?"' + step 'I choose "' + tower + '" for "tower"' + step 'I answer "' + name + '" to "name"' + step 'I should see "generated"' end Given /^no profile at "([^\"]*)"$/ do |path|
Cleaned up warning from cucumber due to use of Given/When/Then statements inside of step definitions.
ryanb_ruby-warrior
train
rb
aa99fc3624a1d7969f9f6b2ca0ab8cb7157b2f57
diff --git a/anytemplate/engines/tests/base.py b/anytemplate/engines/tests/base.py index <HASH>..<HASH> 100644 --- a/anytemplate/engines/tests/base.py +++ b/anytemplate/engines/tests/base.py @@ -16,6 +16,7 @@ class Test(unittest.TestCase): def test_20_instance_methods(self): engine = TT.Engine() + self.assertTrue(isinstance(engine, TT.Engine)) try: engine.renders_impl("aaa", {}) # Template string must be given. engine.render_impl(__file__, {})
fix: check if instance is correctly created in .engines.tests.base
ssato_python-anytemplate
train
py
ed13c6208a4387b505b61ea555de045a88988900
diff --git a/properties/utils.py b/properties/utils.py index <HASH>..<HASH> 100644 --- a/properties/utils.py +++ b/properties/utils.py @@ -47,8 +47,13 @@ def filter_props(has_props_cls, input_dict, include_immutable=True): """ props_dict = { k: v for k, v in iter(input_dict.items()) if ( - k in has_props_cls._props and - (include_immutable or hasattr(has_props_cls._props[k], 'required')) + k in has_props_cls._props and ( + include_immutable or + any( + hasattr(has_props_cls._props[k], att) + for att in ('required', 'new_name') + ) + ) ) } others_dict = {k: v for k, v in iter(input_dict.items())
Renamed properties now filter as mutable in filter_props
seequent_properties
train
py
d0c6e8fb4f3e4c88ca952d3003f8846bba25a263
diff --git a/lib/puppet_library/version.rb b/lib/puppet_library/version.rb index <HASH>..<HASH> 100644 --- a/lib/puppet_library/version.rb +++ b/lib/puppet_library/version.rb @@ -16,5 +16,5 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. module PuppetLibrary - VERSION = "0.2.0" + VERSION = "0.3.0" end
[release] Incremented version number
drrb_puppet-library
train
rb
0e1e6aa0edeacfeec9f2737d82f25ec273c5be0a
diff --git a/src/components/Editor.js b/src/components/Editor.js index <HASH>..<HASH> 100644 --- a/src/components/Editor.js +++ b/src/components/Editor.js @@ -550,7 +550,7 @@ export default React.createClass({ } return ( - <div> + <div style={{boxSizing: 'content-box'}}> {this._renderError()} <div className="ritzy-internal-text-content-wrapper text-content-wrapper" style={wrapperStyle} onMouseDown={this._onMouseDown} onMouseUp={this._onMouseUp} onMouseMove={this._onMouseMove}>
Add box-sizing: content-box at Editor top-level div The Editor adjusts its internal sizing based on the passed in width and margin props. In order to do this properly, the top-level div must have the box sizing model set to content-box, otherwise the padding (which is used internally for the 'margin' setting) will not be included in the width if the hosting page uses border-box box sizing.
ritzyed_ritzy
train
js
a48503bd68eb2af6ff800003a3c2fbe0facd288a
diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py index <HASH>..<HASH> 100644 --- a/pychromecast/socket_client.py +++ b/pychromecast/socket_client.py @@ -528,20 +528,19 @@ class SocketClient(threading.Thread): return self.heartbeat_controller.reset() - self._force_recon = False self.logger.debug("Thread started...") - try: - while not self.stop.is_set(): + while not self.stop.is_set(): + try: if self.run_once(timeout=POLL_TIME_BLOCKING) == 1: break - except Exception: # pylint: disable=broad-except - self.logger.exception( - ("[%s(%s):%s] Unhandled exception in worker thread"), - self.fn or "", - self.host, - self.port, - ) - raise + except Exception: # pylint: disable=broad-except + self._force_recon = True + self.logger.exception( + "[%s(%s):%s] Unhandled exception in worker thread, attempting reconnect", + self.fn or "", + self.host, + self.port, + ) self.logger.debug("Thread done...") # Clean up
Attempt reconnect on unknown exceptions (#<I>)
balloob_pychromecast
train
py
5df1fd936de25f2f948bed2cdf2dd099703f433c
diff --git a/lib/accessible-name.js b/lib/accessible-name.js index <HASH>..<HASH> 100644 --- a/lib/accessible-name.js +++ b/lib/accessible-name.js @@ -152,7 +152,6 @@ var getFromNode = function(node, recurse) { }; getAccessibleName = function(node, recurse) { - /* jshint validthis:true */ var name = node.accessibleName; if (typeof name !== 'undefined') { return name;
Remove an obsolete JSHint ignore rule
ruslansagitov_loud
train
js
257a9bc309ccf8a35e01e7e1fbd7bd236f3c051e
diff --git a/collection.go b/collection.go index <HASH>..<HASH> 100644 --- a/collection.go +++ b/collection.go @@ -665,7 +665,7 @@ func (c *Collection) begin(db DB) (*pg.Tx, int64, error) { } // If there is an error setting this, rollback the transaction and don't bother doing it - // becuase Postgres < 9.6 doesn't support this + // because Postgres < 9.6 doesn't support this _, err = tx.Exec("SET idle_in_transaction_session_timeout = 0") if err != nil { _ = tx.Rollback() @@ -682,7 +682,7 @@ func (c *Collection) begin(db DB) (*pg.Tx, int64, error) { if err != nil { _ = tx.Rollback() - if !strings.Contains(err.Error(), "syntax error at or near \"lock\"") { + if !strings.Contains(err.Error(), "at or near \"lock\"") { return nil, 0, err } tx, err = db.Begin()
Update error check to be compatible with CockroachDB <I>
go-pg_migrations
train
go
688aea720ae206e4a2aeaa2ff0cdd9c729addd2d
diff --git a/test/warppointer.js b/test/warppointer.js index <HASH>..<HASH> 100644 --- a/test/warppointer.js +++ b/test/warppointer.js @@ -1,8 +1,8 @@ var angle = 0; var x11 = require('../lib/x11').createClient(function(display) { setInterval(function() { - var x = 500 + 100*Math.cos(angle*100); - var y = 500 + 100*Math.sin(angle*100); + var x = 500 + 100*Math.cos(angle); + var y = 500 + 100*Math.sin(angle); display.client.WarpPointer(0, display.screen[0].root, 0, 0, 0, 0, parseInt(x), parseInt(y)); angle += 0.05; }, 100);
Edited test/warppointer.js via GitHub
sidorares_node-x11
train
js
677b5f2d8e5f203e96157ef346d00de5f02d798f
diff --git a/lib/foreman_remote_execution/version.rb b/lib/foreman_remote_execution/version.rb index <HASH>..<HASH> 100644 --- a/lib/foreman_remote_execution/version.rb +++ b/lib/foreman_remote_execution/version.rb @@ -1,3 +1,3 @@ module ForemanRemoteExecution - VERSION = '1.2.1' + VERSION = '1.2.2' end
Bump foreman_remote_execution to <I>
theforeman_foreman_remote_execution
train
rb
b1086b87ac90cb68d6cedb9b06f1405b797bff9f
diff --git a/core/src/main/java/io/undertow/server/ConnectionSSLSessionInfo.java b/core/src/main/java/io/undertow/server/ConnectionSSLSessionInfo.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/server/ConnectionSSLSessionInfo.java +++ b/core/src/main/java/io/undertow/server/ConnectionSSLSessionInfo.java @@ -153,6 +153,7 @@ public class ConnectionSSLSessionInfo implements SSLSessionInfo { channel.setOption(Options.SSL_CLIENT_AUTH_MODE, newAuthMode); channel.getSslSession().invalidate(); channel.startHandshake(); + serverConnection.getOriginalSinkConduit().flush(); ByteBuffer buff = ByteBuffer.wrap(new byte[1]); while (!waiter.isDone() && serverConnection.isOpen()) { int read = serverConnection.getSourceChannel().read(buff);
Perform a flush when renegotiating
undertow-io_undertow
train
java
e0d4f46d722c061b1af1dfe0c86c63ef7b207a6a
diff --git a/spec/javascripts/unit/core/channels/channel_spec.js b/spec/javascripts/unit/core/channels/channel_spec.js index <HASH>..<HASH> 100644 --- a/spec/javascripts/unit/core/channels/channel_spec.js +++ b/spec/javascripts/unit/core/channels/channel_spec.js @@ -204,13 +204,21 @@ describe("Channel", function() { expect(pusher.send_event).not.toHaveBeenCalled(); }); - it("should set #subscriptionPending to true", function() { + it("should set #subscriptionPending to true if previously unsubscribed", function() { expect(channel.subscriptionPending).toEqual(false); channel.subscribe(); expect(channel.subscriptionPending).toEqual(true); }); + + it("should do nothing if already subscribed", function() { + channel.subscribed = true; + + channel.subscribe(); + + expect(channel.subscriptionPending).toEqual(false); + } }); describe("#unsubscribe", function() {
added unit test checking that channel::subscribe is idempotent
pusher_pusher-js
train
js
74c70b6f021abdddbd559d8780c49d0870971dad
diff --git a/certipy/certipy.py b/certipy/certipy.py index <HASH>..<HASH> 100644 --- a/certipy/certipy.py +++ b/certipy/certipy.py @@ -23,7 +23,7 @@ class Certipy(): Returns: None """ self.certs = {} - self.store_dir = os.path.abspath(store_dir) + self.store_dir = store_dir self.record_file = record_file self.serial = 0 @@ -76,7 +76,14 @@ class Certipy(): Returns: KeyCertPair object with location info """ try: - return self.certs[name] + info = self.certs[name] + dir_name = os.path.abspath(info.dir_name) + cert_file = os.path.abspath(info.cert_file) + key_file = os.path.abspath(info.key_file) + ca_file = os.path.abspath(info.ca_file) + info_copy = KeyCertPair(info.name, dir_name, key_file, cert_file, ca_file) + + return info_copy except KeyError: print("No certificates found with name {}".format(name))
Store paths as relative to store_dir and return absolute paths on get.
LLNL_certipy
train
py
17cf70da6184d20ad24db5191768f40f366d5f63
diff --git a/ocrd_validators/ocrd_validators/workspace_validator.py b/ocrd_validators/ocrd_validators/workspace_validator.py index <HASH>..<HASH> 100644 --- a/ocrd_validators/ocrd_validators/workspace_validator.py +++ b/ocrd_validators/ocrd_validators/workspace_validator.py @@ -155,7 +155,7 @@ class WorkspaceValidator(): for k in ['xResolution', 'yResolution']: v = exif.__dict__.get(k) if v is None or v <= 72: - self.report.add_error("Image %s: %s (%s pixels per %s) is too low" % (f.ID, k, v, exif.resolutionUnit)) + self.report.add_warning("Image %s: %s (%s pixels per %s) is too low" % (f.ID, k, v, exif.resolutionUnit)) def _validate_mets_file_group_names(self): """
reduce pixel_density problem severity: error -> warning, OCR-D/spec#<I> OCR-D/assets#<I>
OCR-D_core
train
py
403152779203eeb5e4e5e2d62cee344b2ac70d71
diff --git a/lib/api_hammer/halt.rb b/lib/api_hammer/halt.rb index <HASH>..<HASH> 100644 --- a/lib/api_hammer/halt.rb +++ b/lib/api_hammer/halt.rb @@ -19,11 +19,11 @@ module ApiHammer end module ApiHammer::Rails - unless const_defined?(:HALT_INCLUDED) - HALT_INCLUDED = proc do |controller_class| + unless instance_variables.any? { |iv| iv.to_s == '@halt_included' } + @halt_included = proc do |controller_class| controller_class.send(:rescue_from, ApiHammer::Halt, :with => :handle_halt) end - (@on_included ||= Set.new) << HALT_INCLUDED + (@on_included ||= Set.new) << @halt_included end # handle a raised ApiHammer::Halt or subclass and render it
use an ivar, not a constant
notEthan_api_hammer
train
rb
8f4e8c72dec43a71fd480c1026caee29a27b9e39
diff --git a/linux_proc_extras/test_linux_proc_extras.py b/linux_proc_extras/test_linux_proc_extras.py index <HASH>..<HASH> 100644 --- a/linux_proc_extras/test_linux_proc_extras.py +++ b/linux_proc_extras/test_linux_proc_extras.py @@ -52,7 +52,7 @@ class TestCheckLinuxProcExtras(AgentCheckTest): self.check.get_stat_info() self.check.get_stat_info() - with patch('check.get_subprocess_output', return_value=(Fixtures.read_file('process_stats'), "", 0)): + with patch('_linux_proc_extras.get_subprocess_output', return_value=(Fixtures.read_file('process_stats'), "", 0)): self.check.get_process_states() self.metrics = self.check.get_metrics()
[linux_proc_extras] fixing mocking.
DataDog_integrations-core
train
py
17a7b5c0d23917f419f644336ea6fe71d4e05a0b
diff --git a/multirange.js b/multirange.js index <HASH>..<HASH> 100644 --- a/multirange.js +++ b/multirange.js @@ -35,12 +35,12 @@ var multirange = function(input) { Object.defineProperties(input, { valueLow: { get: function() { return Math.min(this.originalValue, ghost.value); }, - set: function(v) { this.originalValue = v; }, + set: function(v) { this.originalValue = v; update(); }, enumerable: true }, valueHigh: { get: function() { return Math.max(this.originalValue, ghost.value); }, - set: function(v) { ghost.value = v; }, + set: function(v) { ghost.value = v; update(); }, enumerable: true } });
Adjust the remaining elements when changing valueLow, valueHigh (#<I>)
LeaVerou_multirange
train
js
aa7704588ccb49857c3a8249332f72979a321dd1
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def main(): 'Programming Language :: Python :: 3'], packages=['detox', ], - install_requires=['tox', 'greenlet>=0.3',], + install_requires=['tox>=1.3.dev4', 'greenlet>=0.3',], entry_points={'console_scripts': 'detox=detox.main:main'}, )
require tox version <I>.dev4
tox-dev_detox
train
py
b69c9bfad929b95fa3c9e53c0ae41557bfdfce65
diff --git a/merb-gen/spec/spec_helper.rb b/merb-gen/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/merb-gen/spec/spec_helper.rb +++ b/merb-gen/spec/spec_helper.rb @@ -1,5 +1,6 @@ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') +require 'rubygems' require 'spec' require 'merb-core' require 'merb-gen'
[merb-gen] Allow to run specsuite with rake spec
wycats_merb
train
rb
af08d8de41da919d3a957ecface2e554aebbb348
diff --git a/passbook/models.py b/passbook/models.py index <HASH>..<HASH> 100644 --- a/passbook/models.py +++ b/passbook/models.py @@ -275,7 +275,7 @@ class Pass(object): zf.close() def json_dict(self): - return { + d = { 'description': self.description, 'formatVersion': self.formatVersion, 'organizationName': self.organizationName, @@ -289,12 +289,13 @@ class Pass(object): 'suppressStripShine': self.suppressStripShine, 'locations': self.locations, 'barcode': self.barcode.json_dict(), - 'webServiceURL': self.webServiceURL, - 'authenticationToken': self.authenticationToken, 'associatedStoreIdentifiers': self.associatedStoreIdentifiers, - self.passInformation.jsonname: self.passInformation.json_dict() } + if self.webServiceURL: + d.update({'webServiceURL': self.webServiceURL, + 'authenticationToken': self.authenticationToken}) + return d def PassHandler(obj):
fixes serialization when webServiceURL is not present
devartis_passbook
train
py
2704959e6c7f7b57507fdf70d5ad225a0a3abce4
diff --git a/lib/draper/version.rb b/lib/draper/version.rb index <HASH>..<HASH> 100644 --- a/lib/draper/version.rb +++ b/lib/draper/version.rb @@ -1,3 +1,3 @@ module Draper - VERSION = "0.7.4" + VERSION = "0.8.0" end
New gem version with rewritten helper system
drapergem_draper
train
rb
9aff0973417bcd411d8a701fa1a70cbacb373f57
diff --git a/flamyngo/views.py b/flamyngo/views.py index <HASH>..<HASH> 100644 --- a/flamyngo/views.py +++ b/flamyngo/views.py @@ -19,7 +19,8 @@ module_path = os.path.dirname(os.path.abspath(__file__)) SETTINGS = loadfn(os.environ["FLAMYNGO"]) CONN = MongoClient(SETTINGS["db"]["host"], SETTINGS["db"]["port"]) DB = CONN[SETTINGS["db"]["database"]] -DB.authenticate(SETTINGS["db"]["username"], SETTINGS["db"]["password"]) +if "username" in SETTINGS["db"]: + DB.authenticate(SETTINGS["db"]["username"], SETTINGS["db"]["password"]) COLL = DB[SETTINGS["db"]["collection"]]
Support no-auth localhost collection config
materialsvirtuallab_flamyngo
train
py
24fe71a89fce3b16bf0b6cdac8baccbfa55bb068
diff --git a/public/js/geoselect.js b/public/js/geoselect.js index <HASH>..<HASH> 100644 --- a/public/js/geoselect.js +++ b/public/js/geoselect.js @@ -96,8 +96,8 @@ for (var i=initialValue.length-1; i>=0; i-=1) { console.debug("initVal " + i + ": "+ initialValue[i]); var $option = $('<option selected>Test</option>'); - $option.val(JSON.stringify(initialValue[i])); - $option.text(formatSelection({id: initialValue[i], data: initialValue[i]})); + $option.val(initialValue[i]); + $option.text(formatSelection({id: initialValue[i], data: $.parseJSON(initialValue[i])})); $node.prepend($option); } $node.trigger('change');
Fix #<I>: Wrong label in location field
yawik_geo
train
js
e2ed53c68837f3eb07e7c7a170220592178029b9
diff --git a/packages/date/src/Date.js b/packages/date/src/Date.js index <HASH>..<HASH> 100644 --- a/packages/date/src/Date.js +++ b/packages/date/src/Date.js @@ -75,9 +75,9 @@ const AvDate = ({ date.isValid() ? isoFormatted : '', false ); + setFieldTouched(name, true, false); if (date.isValid()) { - setFieldTouched(name, true, false); if (isFocused !== false) { setIsFocused(false); }
fix(date): setFieldTouched moved out of validation
Availity_availity-react
train
js
5da7534245844190476cae83c925ce6819abdd1e
diff --git a/lib/gitomator/service/hosting/service.rb b/lib/gitomator/service/hosting/service.rb index <HASH>..<HASH> 100644 --- a/lib/gitomator/service/hosting/service.rb +++ b/lib/gitomator/service/hosting/service.rb @@ -142,12 +142,12 @@ module Gitomator end - def label_pull_request(dst_repo, id, label) - _delegate(__callee__, dst_repo, id, label) + def label_pull_request(dst_repo, id, *labels) + _delegate(__callee__, dst_repo, id, *labels) end - def unlabel_pull_request(dst_repo, id, label) - _delegate(__callee__, dst_repo, id, label) + def unlabel_pull_request(dst_repo, id, *labels) + _delegate(__callee__, dst_repo, id, *labels) end
Updating the label/unlabel PR API's to take multiple labels as optional params
gitomator_gitomator
train
rb
b01bc6f3b60a8df266c2dd25eee06a18bc80d720
diff --git a/lib/Jejik/MT940/Parser/AbnAmro.php b/lib/Jejik/MT940/Parser/AbnAmro.php index <HASH>..<HASH> 100644 --- a/lib/Jejik/MT940/Parser/AbnAmro.php +++ b/lib/Jejik/MT940/Parser/AbnAmro.php @@ -31,32 +31,6 @@ class AbnAmro extends AbstractParser } /** - * Get the opening balance - * - * @param mixed $text - * @return void - */ - protected function openingBalance($text) - { - if ($line = $this->getLine('60F|60M', $text)) { - return $this->balance($this->reader->createOpeningBalance(), $line); - } - } - - /** - * Get the closing balance - * - * @param mixed $text - * @return void - */ - protected function closingBalance($text) - { - if ($line = $this->getLine('62F|62M', $text)) { - return $this->balance($this->reader->createClosingBalance(), $line); - } - } - - /** * Get the contra account from a transaction * * @param array $lines The transaction text at offset 0 and the description at offset 1
Parser/AbnAmro: remove overridden {opening|closing}balance the AbstractParser now accepts <I>F|<I>M and <I>F|<I>M for {opening|closing} balances
sandermarechal_jejik-mt940
train
php
51be8ece57d5f80d489cd1a0e68aae4d8820f12d
diff --git a/src/MadeYourDay/Contao/CustomElements.php b/src/MadeYourDay/Contao/CustomElements.php index <HASH>..<HASH> 100644 --- a/src/MadeYourDay/Contao/CustomElements.php +++ b/src/MadeYourDay/Contao/CustomElements.php @@ -404,11 +404,20 @@ class CustomElements extends \Backend continue; } - $templatePaths = CustomTemplate::getTemplates($template); - $configPath = substr($templatePaths[0], 0, -6) . '_config.php'; - if (!file_exists($configPath)) { + try { + $templatePaths = CustomTemplate::getTemplates($template); + if (empty($templatePaths[0])) { + continue; + } + $configPath = substr($templatePaths[0], 0, -6) . '_config.php'; + if (!file_exists($configPath)) { + continue; + } + } + catch (\Exception $e) { continue; } + $config = include $configPath; $label = isset($config['label']) ? $config['label'] : array(implode(' ', array_map('ucfirst', explode('_', substr($template, 5)))), '');
Fixed bug with missing templates in loadConfig
madeyourday_contao-rocksolid-custom-elements
train
php
a366a787e0a07db649849fd7a250b266c8c77ae7
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -94,7 +94,8 @@ module.exports = function(config) { // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_WARN, - browsers: ['Chrome', 'IE'], + // browsers: ['Chrome', 'IE'], + browsers: ['Chrome'], plugins: [ require('karma-jasmine'),
test: remove IE from karma
Availity_availity-angular
train
js
96906e7ccb1e85ecce6514e9d71403b2c767ce6f
diff --git a/scraperwiki/sqlite.py b/scraperwiki/sqlite.py index <HASH>..<HASH> 100644 --- a/scraperwiki/sqlite.py +++ b/scraperwiki/sqlite.py @@ -37,7 +37,7 @@ class _Buffer(object): buffered_saves = [] buffered_table = None - unique_keys = [] + unique_keys = None flushing = False # time after which records should be automatically flushed.
Initialize _Buffer.unique_keys to None
scraperwiki_scraperwiki-python
train
py
76b8ab005e24834632b6e94c8c4527ff964a7500
diff --git a/src/application/clear.js b/src/application/clear.js index <HASH>..<HASH> 100644 --- a/src/application/clear.js +++ b/src/application/clear.js @@ -1,4 +1,4 @@ -const React = require('react'); +const ReactDOM = require('react-dom'); let mountedComponents = require('./mounted-components'); /** @@ -7,7 +7,7 @@ let mountedComponents = require('./mounted-components'); */ module.exports = function clearComponent(targetSelector) { if(mountedComponents[targetSelector]){ - React.unmountComponentAtNode(document.querySelector(targetSelector)); + ReactDOM.unmountComponentAtNode(document.querySelector(targetSelector)); delete mountedComponents[targetSelector]; console.info('Component ' + targetSelector + ' unmounted.'); }
remove deprecated call to react unmountComponentAtNode
KleeGroup_focus-core
train
js
b5dd84c6fb847ceb9b9d8d071a489172725331b3
diff --git a/src/compile.js b/src/compile.js index <HASH>..<HASH> 100644 --- a/src/compile.js +++ b/src/compile.js @@ -3,8 +3,6 @@ const configureWebpack = require('./webpack-config.js') const getConfigFile = require('./utils/get-config-file-config') module.exports = (env = {}) => { - console.log(`\n\nENV: ${JSON.stringify(env)}\n\n`) - // Get user config file const { webpack, ...config } = getConfigFile(env.config)
Removed env object logging
webextension-toolbox_webextension-toolbox
train
js
709c327c403ea5485065614dff4e82bde6a83490
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup(name='baselines', packages=[package for package in find_packages() if package.startswith('baselines')], install_requires=[ - 'gym', + 'gym>=0.9.1', 'scipy', 'tqdm', 'joblib',
Update setup.py `PongNoFrameskip-v4` seems to require `gym>=<I>`
openai_baselines
train
py
cdd642c3e27dc0a7eede699f6a0b70979e21b61e
diff --git a/src/bootstrapdatepicker.js b/src/bootstrapdatepicker.js index <HASH>..<HASH> 100644 --- a/src/bootstrapdatepicker.js +++ b/src/bootstrapdatepicker.js @@ -36,7 +36,7 @@ function init(Survey, $) { // https://bootstrap-datepicker.readthedocs.io/en/latest/options.html#format name: "dateFormat", category: "general", - default: "'mm/dd/yyyy'", + default: "mm/dd/yyyy", }, { // Can take a Date or a string
bootstrap datepicker has incorrect default dateFormat #<I>
surveyjs_widgets
train
js