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
274446f5b04dfab304c0f2f6727c089480a2fb74
diff --git a/js/src/figure.js b/js/src/figure.js index <HASH>..<HASH> 100644 --- a/js/src/figure.js +++ b/js/src/figure.js @@ -192,6 +192,11 @@ var FigureView = widgets.DOMWidgetView.extend( { return false; } } + window.ipvss = () => { + var data = this.screenshot() + //download_image(data) + return data + } this.camera_control_icon = new ToolIcon('fa-arrow-up', this.toolbar_div) this.camera_control_icon.a.title = 'Camera locked to \'up\' axis (orbit), instead of trackball mode'
fix: for headless support, was missing ipvss global function
maartenbreddels_ipyvolume
train
js
030d5f7c6bb671640e7e2d1986eb0a4aacbc932f
diff --git a/src/lookahead.js b/src/lookahead.js index <HASH>..<HASH> 100644 --- a/src/lookahead.js +++ b/src/lookahead.js @@ -19,7 +19,11 @@ var STATE_KEYS = [ "exprAllowed", "potentialArrowAt", "currLine", - "input" + "input", + "inType", + "inFunction", + "inGenerator", + "labels" ]; pp.getState = function () { @@ -29,6 +33,7 @@ pp.getState = function () { state[key] = this[key] } state.context = this.context.slice() + state.labels = this.labels.slice() return state };
add labels, and inX properties to lookahead getState
babel_babylon
train
js
833a3feb67beb7d973068c8ae63543efb12bd898
diff --git a/lib/negroku/version.rb b/lib/negroku/version.rb index <HASH>..<HASH> 100644 --- a/lib/negroku/version.rb +++ b/lib/negroku/version.rb @@ -1,3 +1,3 @@ module Negroku - VERSION = '2.0.0.pre2' + VERSION = '2.0.0.pre3' end
bump to <I>.pre3
platanus_negroku
train
rb
2699270149333e1beca3e46a81fd1bf721dc9d61
diff --git a/src/Neuron/Collections/Collection.php b/src/Neuron/Collections/Collection.php index <HASH>..<HASH> 100644 --- a/src/Neuron/Collections/Collection.php +++ b/src/Neuron/Collections/Collection.php @@ -192,4 +192,9 @@ abstract class Collection } return null; } + + public function reverse () + { + $this->data = array_reverse ($this->data); + } } \ No newline at end of file
Allowing a direct "get array input"
CatLabInteractive_Neuron
train
php
d5e758433909b954fc011ec4ca521025f79f32b6
diff --git a/src/Routing/Router.php b/src/Routing/Router.php index <HASH>..<HASH> 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -956,6 +956,3 @@ class Router include CONFIG . 'routes.php'; } } - -//Save the initial state -Router::reload(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -16,6 +16,7 @@ use Cake\Core\Configure; use Cake\Datasource\ConnectionManager; use Cake\I18n\I18n; use Cake\Log\Log; +use Cake\Routing\Router; require_once 'vendor/autoload.php'; @@ -116,3 +117,5 @@ Log::config([ Carbon\Carbon::setTestNow(Carbon\Carbon::now()); ini_set('intl.default_locale', 'en_US'); + +Router::reload();
Avoid side effects in Router.php
cakephp_cakephp
train
php,php
1d246fb529b65393ae592d1a87d32c11ec12a5e1
diff --git a/salt/loader.py b/salt/loader.py index <HASH>..<HASH> 100644 --- a/salt/loader.py +++ b/salt/loader.py @@ -762,12 +762,15 @@ class LazyLoader(salt.utils.lazy.LazyDict): if mod_name in self.loaded_modules: return '{0!r} is not available.'.format(function_name) else: - if self.missing_modules.get(mod_name) is not None: - return '\'{0}\' __virtual__ returned False: {1}'.format(mod_name, self.missing_modules[mod_name]) - elif self.missing_modules.get(mod_name) is None: - return '\'{0}\' __virtual__ returned False'.format(mod_name) - else: + try: + reason = self.missing_modules[mod_name] + except KeyError: return '\'{0}\' is not available.'.format(function_name) + else: + if reason is not None: + return '\'{0}\' __virtual__ returned False: {1}'.format(mod_name, reason) + else: + return '\'{0}\' __virtual__ returned False'.format(mod_name) def refresh_file_mapping(self): '''
fix conditional logic for missing function messages
saltstack_salt
train
py
fd79015131f9b38a1b2b0d192c394c6e2886dd48
diff --git a/contrib/aws/awsexecutor.py b/contrib/aws/awsexecutor.py index <HASH>..<HASH> 100644 --- a/contrib/aws/awsexecutor.py +++ b/contrib/aws/awsexecutor.py @@ -204,9 +204,9 @@ def execute_benchmark(benchmark, output_handler): while not event_handler.is_set(): http_response = requests.get(progress_url, timeout=HTTP_REQUEST_TIMEOUT) # There is currently an issue on the server side in which the - # status code of the response is rarely not 200. - # This needs to be investigated before uncommenting the following line. - # http_response.raise_for_status() + # status code of the response is on rare occasions not 200. + # TODO: Once this is fixed, check the above http_response for a valid + # status code (i.e., call raise_for_status() ) msg = http_response.json() # poll every 15 sec and print a user message every second time
AWS executor: rewrite a comment
sosy-lab_benchexec
train
py
3de5bf7c801584274d111a2ff761b421eab9b3e0
diff --git a/nodeconductor/structure/tasks.py b/nodeconductor/structure/tasks.py index <HASH>..<HASH> 100644 --- a/nodeconductor/structure/tasks.py +++ b/nodeconductor/structure/tasks.py @@ -186,7 +186,7 @@ class BaseThrottleProvisionTask(RetryUntilAvailableTask): state=core_models.StateMixin.States.CREATING, service_project_link__service__settings=service_settings).count() - def get_limit(self, instance): + def get_limit(self, resource): return self.DEFAULT_LIMIT
Update throttling task declaration [WAL-<I>]
opennode_waldur-core
train
py
024b7b7cb6a11aa8c7fd753bf955f33c2fbc3054
diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -36,7 +36,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.1.0'; + const VERSION = '2.2.0-DEV'; /** * Compares a Doctrine version with the current one.
Bump Dev Version to <I>-DEV
doctrine_orm
train
php
bc89cf42d6a67cffe3155bdcedda2b009ce915a7
diff --git a/src/Webiny/Component/Security/Security.php b/src/Webiny/Component/Security/Security.php index <HASH>..<HASH> 100755 --- a/src/Webiny/Component/Security/Security.php +++ b/src/Webiny/Component/Security/Security.php @@ -176,7 +176,7 @@ class Security // get the encoder name $encoderName = $this->getFirewallConfig($firewallKey)->get('Encoder', 'Crypt'); if (!$encoderName) { - $encoderName = 'Null'; + $encoderName = 'Plain'; } // check if the encoder is defined in the global config
Renamed Null driver to Plain (php7 compatibility)
Webiny_Framework
train
php
d0dbea5be7fe49ca004652abe4370ef96a53e4ed
diff --git a/core-bundle/src/Resources/contao/modules/ModuleArticle.php b/core-bundle/src/Resources/contao/modules/ModuleArticle.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/modules/ModuleArticle.php +++ b/core-bundle/src/Resources/contao/modules/ModuleArticle.php @@ -121,7 +121,7 @@ class ModuleArticle extends Module // Add the modification date $this->Template->timestamp = $this->tstamp; - $this->Template->date = Date::parse($objPage->datimFormat, $this->tstamp); + $this->Template->date = Date::parse($objPage->datimFormat ?? Config::get('datimFormat'), $this->tstamp); // Clean the RTE output $this->teaser = StringUtil::toHtml5($this->teaser ?? '');
Fix warning in ModuleArticle if page object is null (see #<I>) Description ----------- Fixes #<I> $objPage is null in back-end requests. In this case I fall back to the default datim format. Commits ------- 2f<I> Fix warning in ModuleArticle if page object is null
contao_contao
train
php
aecf6b0a1467072aa1050da861e62118b78e54f7
diff --git a/tasks/stencil.js b/tasks/stencil.js index <HASH>..<HASH> 100644 --- a/tasks/stencil.js +++ b/tasks/stencil.js @@ -29,7 +29,7 @@ module.exports = function(grunt) { // Prepare the it object for dot options.dot_it_object = utils.prepare_it_obj(options.dot_it_object, - process_src.bind(null, options)); + process_inclusion.bind(null, options)); // Iterate over all specified file groups. // mapping.src already contains only existing files @@ -40,7 +40,7 @@ module.exports = function(grunt) { // Compile the source of the input file var input_file = mapping.src[0]; - var compiled_src = process_src(options, input_file, true); + var compiled_src = process_inclusion(options, input_file, true); // Write the destination file. grunt.file.write(mapping.dest, compiled_src); @@ -50,8 +50,8 @@ module.exports = function(grunt) { }); }); - // Process a single file - function process_src (options, input_file, is_page) { + // Process a single include statement + function process_inclusion (options, input_file, is_page, meta_data_field) { // First make sure we have the full path var base_folder = is_page ? '' : options.partials_folder;
Rename process_file to process_inclusion, as it will need to decide whether to return compiled contents of a file, or a field from it's meta data header
cambridge-healthcare_grunt-stencil
train
js
5b034ad1be7f63212081e5783a387b83b5489976
diff --git a/src/UrlGenerator/UrlGenerator.php b/src/UrlGenerator/UrlGenerator.php index <HASH>..<HASH> 100644 --- a/src/UrlGenerator/UrlGenerator.php +++ b/src/UrlGenerator/UrlGenerator.php @@ -17,16 +17,6 @@ interface UrlGenerator public function getUrl(): string; /** - * Get the temporary url for the profile of a media item. - * - * @param \DateTimeInterface $expiration - * @param array $options - * - * @return string - */ - public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string; - - /** * @param \Spatie\MediaLibrary\Media $media * * @return \Spatie\MediaLibrary\UrlGenerator\UrlGenerator
Remove getTemporaryUrl from UrlGenerator interface
spatie_laravel-medialibrary
train
php
5afea3f4958898375b81a635b83522dd4b28747b
diff --git a/src/Rebing/GraphQL/GraphQL.php b/src/Rebing/GraphQL/GraphQL.php index <HASH>..<HASH> 100644 --- a/src/Rebing/GraphQL/GraphQL.php +++ b/src/Rebing/GraphQL/GraphQL.php @@ -291,7 +291,10 @@ class GraphQL $this->schemas = []; } - public function getTypes() + /** + * @return array<string,string> + */ + public function getTypes(): array { return $this->types; }
Add types to \Rebing\GraphQL\GraphQL::getTypes
rebing_graphql-laravel
train
php
aaf5dcdd3407e60882bfac91a6db9adb3d191efb
diff --git a/activiti-webapp-explorer/src/main/webapp/components/processes/processes.js b/activiti-webapp-explorer/src/main/webapp/components/processes/processes.js index <HASH>..<HASH> 100644 --- a/activiti-webapp-explorer/src/main/webapp/components/processes/processes.js +++ b/activiti-webapp-explorer/src/main/webapp/components/processes/processes.js @@ -65,10 +65,10 @@ this.id + "-datatable", [ this.id + "-paginator" ], [ - {key:"id", sortable:true}, - {key:"key",sortable:true}, - {key:"version",sortable:true}, - {key:"action"} + {key:"name", label: this.msg("processes.name"), sortable:true}, + {key:"key", label: this.msg("processes.key"), sortable:true}, + {key:"version", label: this.msg("processes.version"),sortable:true}, + {key:"action", label: this.msg("processes.action")} ] );
Update to fix for ACT-<I> - replaces incorrect dataTable declaration with the correct one using i<I>n strings and the Name column
camunda_camunda-bpm-platform
train
js
41617187c44d6553dd40fdde3596294f4194bca2
diff --git a/lntest/itest/lnd_test.go b/lntest/itest/lnd_test.go index <HASH>..<HASH> 100644 --- a/lntest/itest/lnd_test.go +++ b/lntest/itest/lnd_test.go @@ -13282,7 +13282,7 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) { // preimage, indicating they are not yet settled. err = lntest.WaitNoError(func() error { req := &lnrpc.ListPaymentsRequest{ - NonSucceeded: true, + IncludeIncomplete: true, } ctxt, _ = context.WithTimeout(ctxt, defaultTimeout) paymentsResp, err := net.Alice.ListPayments(ctxt, req) @@ -13461,7 +13461,7 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) { // Check that Alice's invoices to be shown as settled and failed // accordingly, and preimages matching up. req := &lnrpc.ListPaymentsRequest{ - NonSucceeded: true, + IncludeIncomplete: true, } ctxt, _ = context.WithTimeout(ctxt, defaultTimeout) paymentsResp, err := net.Alice.ListPayments(ctxt, req)
lntest/itest: update itests due to ListPayments API change
lightningnetwork_lnd
train
go
70242688368ced7f91023f51b29ff3c5261a97f3
diff --git a/modeltranslation/translator.py b/modeltranslation/translator.py index <HASH>..<HASH> 100644 --- a/modeltranslation/translator.py +++ b/modeltranslation/translator.py @@ -75,7 +75,7 @@ class TranslationOptions(with_metaclass(FieldsAggregationMetaClass, object)): """ Update with options from a superclass. """ - if other.model._meta.abstract: + if other.model._meta.abstract or self.model._meta.proxy: self.local_fields.update(other.local_fields) self.fields.update(other.fields)
Handle proxy models (close #<I>).
deschler_django-modeltranslation
train
py
b9b4b913841cbfcd6c03fb1191963dd3e0647d75
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -297,7 +297,7 @@ exports.onUIGetSettingsSchema = onUIGetSettingsSchema; async function onUISetSettings(newSettings) { const pi = pluginInterface; if (newSettings.server_port != -1) { - pi.publish('client_settings', {port: newSettings.server_port}); + pi.server.publish('client_settings', {port: newSettings.server_port}); } for (const clName of Object.keys(newSettings.api_filter)) {
Chang from pi.publish to pi.server.publish of the new architecture
KAIT-HEMS_node-picogw-plugin-admin
train
js
86845b4832e9b382673e04ee8d097748e1788c10
diff --git a/lib/gametel/accessors.rb b/lib/gametel/accessors.rb index <HASH>..<HASH> 100644 --- a/lib/gametel/accessors.rb +++ b/lib/gametel/accessors.rb @@ -139,6 +139,7 @@ module Gametel # @param [Hash] locator indicating an id for how the view is found. # The only valid keys are: # * :id + # * :text # def view(name, locator) define_method(name) do @@ -160,6 +161,7 @@ module Gametel # @param [Hash] locator indicating an id for how the progress bar is found. # The only valid keys are: # * :id + # * :index # def progress(name, locator) define_method("#{name}") do @@ -189,6 +191,7 @@ module Gametel # @param [Hash] locator indicating an id for how the spinner is found. # The only valid keys are: # * :id + # * :index # def spinner(name, locator) define_method(name) do
updated rdocs to reflect real capabilities
leandog_gametel
train
rb
8929cd0c005602ca878e8791b3bc8c84d86d185f
diff --git a/test/parser.test.js b/test/parser.test.js index <HASH>..<HASH> 100644 --- a/test/parser.test.js +++ b/test/parser.test.js @@ -240,4 +240,27 @@ describe('Parser: examples', () => { ].join("\n"))).toThrow(/Unexpected comment token/) }) + it('should give accurate line and col counts in error reporting', () => { + var nearley = compile(read("lib/nearley-language-bootstrapped.ne")); + expect(() => + parse(nearley, [ + "", + "", + "@{%", + "", + "%}", + "", + "rule1 -> `", + "", + "", + "`", + "rule2 -> abc", + " {%", + " ([first]) =>", + " first", + " %} ]", + "" + ].join("\n"))).toThrow(/line 15 col 9/) + }) + })
Add a test to validate line and col values in errors
kach_nearley
train
js
e487c4b2b0506e30ee94deb81aed31af90567065
diff --git a/msdfgen.js b/msdfgen.js index <HASH>..<HASH> 100644 --- a/msdfgen.js +++ b/msdfgen.js @@ -22,7 +22,9 @@ module.exports = function (fontPath) { if (err) console.log(err); packer.addArray(results); const spritesheets = packer.bins.map((bin, index) => { - context.clearRect(0, 0, canvas.width, canvas.height); + context.fillStyle = '#ffffff'; + context.fillRect(0, 0, canvas.width, canvas.height); + // context.clearRect(0, 0, canvas.width, canvas.height); bin.rects.forEach(rect => { if (rect.data.imageData) { context.putImageData(rect.data.imageData, rect.x, rect.y);
fixed texture lines, IT TOTALLY WORKS NOW :D
Jam3_msdf-bmfont
train
js
9724e693ed7f68479d3c7c260289e9508177638e
diff --git a/site/src/components/page-header/index.js b/site/src/components/page-header/index.js index <HASH>..<HASH> 100644 --- a/site/src/components/page-header/index.js +++ b/site/src/components/page-header/index.js @@ -59,7 +59,13 @@ export default class PageHeader extends Component { return; } - window.location.href = `https://youzan.github.io/zent-${version}`; + const url = new URL(window.location.href); + const host = + url.hostname === '127.0.0.1' || url.hostname === 'localhost' + ? 'https://youzan.github.io' + : ''; + + window.location.href = `${host}/zent-${version}`; } ); };
use relative link for old doc versions
youzan_zent
train
js
e0c71db13e1d24e31baadb835a512cc31556a383
diff --git a/server/gae-go/app/main.go b/server/gae-go/app/main.go index <HASH>..<HASH> 100644 --- a/server/gae-go/app/main.go +++ b/server/gae-go/app/main.go @@ -1,5 +1,5 @@ /* - * jQuery File Upload Plugin GAE Go Example 2.1 + * jQuery File Upload Plugin GAE Go Example 2.1.1 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2011, Sebastian Tschan @@ -84,7 +84,7 @@ func (fi *FileInfo) CreateUrls(r *http.Request, c appengine.Context) { uString := u.String() fi.Url = uString + escape(string(fi.Key)) + "/" + escape(string(fi.Name)) - fi.DeleteUrl = fi.Url + fi.DeleteUrl = fi.Url + "?delete=true" fi.DeleteType = "DELETE" if imageTypes.MatchString(fi.Type) { servingUrl, err := image.ServingURL( @@ -225,6 +225,7 @@ func post(w http.ResponseWriter, r *http.Request) { ), http.StatusFound) return } + w.Header().Set("Cache-Control", "no-cache") jsonType := "application/json" if strings.Index(r.Header.Get("Accept"), jsonType) != -1 { w.Header().Set("Content-Type", jsonType)
Prevent caching of upload POST requests. Fixes #<I>. Add query string to the DELETE url to workaround a Chrome caching bug: <URL>
blueimp_jQuery-File-Upload
train
go
56c3a841a2f527e7f9420852358aed14698ae665
diff --git a/rundeckapp/web-app/js/executionControl.js b/rundeckapp/web-app/js/executionControl.js index <HASH>..<HASH> 100644 --- a/rundeckapp/web-app/js/executionControl.js +++ b/rundeckapp/web-app/js/executionControl.js @@ -635,7 +635,7 @@ var FollowControl = Class.create({ //remove extra lines this.removeTableRows(this.cmdoutputtbl, rowcount- this.lastlines); } - if(needsScroll){ + if(needsScroll && !this.runningcmd.jobcompleted){ this.scrollToBottom(); } }
Don't autoscroll if job is finished
rundeck_rundeck
train
js
c5338a20bbe7e47045d51d7987bcc965c3180743
diff --git a/config/database.rb b/config/database.rb index <HASH>..<HASH> 100644 --- a/config/database.rb +++ b/config/database.rb @@ -12,9 +12,10 @@ end Mongoid.database = Mongo::Connection.new( host, port, - {:pool_size => Parallel.physical_processor_count, + # NB: this causes problems when deploying to Unicorn +# {:pool_size => Parallel.physical_processor_count, # :logger => Padrino.logger - } +# } ).db(database_name) Mongoid.max_retries_on_connection_failure = 2 diff --git a/config/unicorn.rb b/config/unicorn.rb index <HASH>..<HASH> 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -8,7 +8,7 @@ err_log = "#{rails_root}/log/unicorn_error.log" old_pid = pid_file + '.oldbin' timeout 30 -worker_processes 6 +worker_processes 2 listen socket_file, :backlog => 1024 pid pid_file
Change mongo connection pooling to accomodate Unicorn
ladder_ladder
train
rb,rb
3b5837ebfba0cf6eb64c3cb6a356449e3ece8416
diff --git a/libs/model_prototypes/redis.js b/libs/model_prototypes/redis.js index <HASH>..<HASH> 100644 --- a/libs/model_prototypes/redis.js +++ b/libs/model_prototypes/redis.js @@ -42,8 +42,13 @@ Redis.prototype.connect = function (cb) { this.redis.ping(function () { }); }, this), 60 * 60 * 1000); } else { - if(cluster.isMaster) global.gozy.info('Successfully connected to ' + name); - cb && cb(); + this.redis.ping(function (err, pong) { + if(err && cluster.isMaster) return global.gozy.error('Redis connection failed: ', err); + if(pong != 'PONG' && cluster.isMaster) return global.gozy.error('Redis connection failed: cannot get PONG'); + + if(cluster.isMaster) global.gozy.info('Successfully connected to ' + name); + cb && cb(); + }); } } else { if(cluster.isMaster) global.gozy.error('Redis connection failed');
check "pong" response from redis
newmsz_gozy
train
js
d1a80dd2b2d1d74594f716cc2e9bd622fec44936
diff --git a/question/qbank.js b/question/qbank.js index <HASH>..<HASH> 100644 --- a/question/qbank.js +++ b/question/qbank.js @@ -44,7 +44,7 @@ question_bank = { question_bank.firstcheckbox = document.getElementById(firstcbid); // Add the event handler. - YAHOO.util.Event.addListener(question_bank.headercheckbox, 'change', question_bank.header_checkbox_click); + YAHOO.util.Event.addListener(question_bank.headercheckbox, 'click', question_bank.header_checkbox_click); }, header_checkbox_click: function() {
MDL-<I> mod_quiz: Question bank select/deselect all shows strange behaviour in IE
moodle_moodle
train
js
3315353c20ab224d9308db9df19d83383dba539a
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -5,4 +5,4 @@ package gin // Version is the current gin framework's version. -const Version = "v1.6.1" +const Version = "v1.6.2"
Update version.go (#<I>) sync to tag <I>
gin-gonic_gin
train
go
ea9af891d7b5294f25acaaa188ac52707c5fc2c0
diff --git a/tests/test_data_replay.py b/tests/test_data_replay.py index <HASH>..<HASH> 100644 --- a/tests/test_data_replay.py +++ b/tests/test_data_replay.py @@ -27,9 +27,9 @@ import backtrader as bt import backtrader.indicators as btind chkdatas = 1 -chknext = 112 +chknext = 113 chkvals = [ - ['3843.260333', '3703.107000', '3737.506333'], + ['3836.453333', '3703.962333', '3741.802000'] ] chkmin = 30 # period will be in weeks diff --git a/tests/test_data_resample.py b/tests/test_data_resample.py index <HASH>..<HASH> 100644 --- a/tests/test_data_resample.py +++ b/tests/test_data_resample.py @@ -28,7 +28,7 @@ import backtrader.indicators as btind chkdatas = 1 chkvals = [ - ['3843.260333', '3703.107000', '3737.506333'], + ['3836.453333', '3703.962333', '3741.802000'] ] chkmin = 30 # period will be in weeks
Adapt replay/resample testcases to last changes
backtrader_backtrader
train
py,py
3a7de94854e942da671e0e28b769a9dfdf34f68c
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java index <HASH>..<HASH> 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java @@ -1571,14 +1571,14 @@ public class GQueryCoreTestGwt extends GWTTestCase { .data("string", "foo") .data("object", o); - double d = g.data("number"); + Double d = g.data("number"); assertEquals(3.5d, d); int i = g.data("number", Integer.class); assertEquals(3, i); long l = g.data("number", Long.class); assertEquals(3l, l); - boolean b = g.data("bool"); + Boolean b = g.data("bool"); assertTrue(b); String s = g.data("string");
Fixing test so as they run with java <I>
ArcBees_gwtquery
train
java
3a998f7876309cafc456a17aafca866fc55f8e34
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup(name="bcbio-nextgen", long_description=(open('README.rst').read()), license="MIT", url="https://github.com/chapmanb/bcbio-nextgen", - packages=find_packages(), + packages=find_packages(exclude=["tests"]), zip_safe=zip_safe, scripts=scripts, install_requires=install_requires)
Install: skip putting tests into bcbio egg Avoids conflicts with other packages which also accidentally do this at the top level since `find_packages` behavior changed and will now identify these.
bcbio_bcbio-nextgen
train
py
d467b8382f4978fc226127f712103a5c5a471875
diff --git a/lib/procodile/cli.rb b/lib/procodile/cli.rb index <HASH>..<HASH> 100644 --- a/lib/procodile/cli.rb +++ b/lib/procodile/cli.rb @@ -368,6 +368,31 @@ module Procodile end end + # + # Open up the procodile log if it exists + # + desc "Open a console within the environment" + options do |opts, cli| + opts.on("-f", "Wait for additional data and display it straight away") do + cli.options[:wait] = true + end + + opts.on("-n LINES", "The number of previous lines to return") do |lines| + cli.options[:lines] = lines.to_i + end + end + command def log + if File.exist?(@config.log_path) + opts = [] + opts << "-f" if options[:wait] + opts << "-n #{options[:lines]}" if options[:lines] + exec("tail #{opts.join(' ')} #{@config.log_path}") + else + raise Error, "No log file exists at #{@config.log_path}" + end + end + + private def supervisor_running?
add `procodile log` command to tail the procodile log file
adamcooke_procodile
train
rb
c90dcc52afb51c44c8c8b43b824cb6eb74532b99
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,11 @@ setup( ], classifiers = [ "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3" + "Programming Language :: Python :: 3", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", + ], ) \ No newline at end of file
Add some more classifiers to setup
broadinstitute_fiss
train
py
5642ed20900ff49a417a03ca2aeee92c7f0ba425
diff --git a/datetime_tz/__init__.py b/datetime_tz/__init__.py index <HASH>..<HASH> 100644 --- a/datetime_tz/__init__.py +++ b/datetime_tz/__init__.py @@ -283,12 +283,6 @@ def _detect_timezone_etc_timezone(): except IOError as eo: warnings.warn("Could not access your /etc/timezone file: %s" % eo) -def _tz_cmp_dict(tz): - """Creates a dictionary of values for comparing tzinfo objects""" - attribs = [(attrib, getattr(tz, attrib)) for attrib in dir(tz) if not (attrib.startswith("__") or attrib in ("zone", "_tzinfos"))] - attribs = [(attrib, value) for attrib, value in attribs if not callable(value)] - return dict(attribs) - def _load_local_tzinfo(): tzdir = os.environ.get("TZDIR", "/usr/share/zoneinfo/posix")
Remove the function that makes a cmp_dict as it's not used any more
mithro_python-datetime-tz
train
py
10629d8ffee57c31bc0ace0fd6705e61ff2828b5
diff --git a/lib/lono/command.rb b/lib/lono/command.rb index <HASH>..<HASH> 100644 --- a/lib/lono/command.rb +++ b/lib/lono/command.rb @@ -54,14 +54,28 @@ module Lono def alter_command_description(command) return unless command + + # Add description to beginning of long_description long_desc = if command.long_description "#{command.description}\n\n#{command.long_description}" else command.description end + + # add reference url to end of the long_description + unless website.empty? + full_command = [command.ancestor_name, command.name].compact.join('-') + url = "#{website}/reference/lono-#{full_command}" + long_desc += "\n\nAlso available at: #{url}" + end + command.long_description = long_desc end private :alter_command_description + + def website + "http://lono.cloud" + end end end end
add also available at link to bottom of cli docs
tongueroo_lono
train
rb
52cb44c8cbce75baeb889753284d82cd6fe61279
diff --git a/spyder/plugins/variableexplorer/widgets/collectionseditor.py b/spyder/plugins/variableexplorer/widgets/collectionseditor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/variableexplorer/widgets/collectionseditor.py +++ b/spyder/plugins/variableexplorer/widgets/collectionseditor.py @@ -41,8 +41,7 @@ from spyder_kernels.utils.nsview import ( get_color_name, get_human_readable_type, get_size, Image, MaskedArray, ndarray, np_savetxt, Series, sort_against, try_to_eval, unsorted_unique, value_to_display, get_object_attrs, - get_type_string, int64, int32, int16, int8, uint64, uint32, uint16, uint8, - float64, float32, float16, complex128, complex64, bool_) + get_type_string, NUMERIC_NUMPY_TYPES) # Local imports from spyder.config.base import _, PICKLE_PROTOCOL @@ -67,10 +66,6 @@ MAX_SERIALIZED_LENGHT = 1e6 LARGE_NROWS = 100 ROWS_TO_LOAD = 50 -NUMERIC_NUMPY_TYPES = (int64, int32, int16, int8, uint64, uint32, uint16, - uint8, float64, float32, float16, complex128, - complex64, bool_) - class ProxyObject(object): """Dictionary proxy to an unknown object."""
Variable Explorer: Use numeric numpy types constant from spyder kernels
spyder-ide_spyder
train
py
6f4fef8479d690b9037baa05ab4269f9279e1d80
diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index <HASH>..<HASH> 100755 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -530,8 +530,20 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect } else { matrix.setRotate(rotate, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2); } - bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); - exif.resetOrientation(); + + try + { + bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); + exif.resetOrientation(); + } + catch (OutOfMemoryError oom) + { + // You can run out of memory if the image is very large: + // http://simonmacdonald.blogspot.ca/2012/07/change-to-camera-code-in-phonegap-190.html + // If this happens, simply do not rotate the image and return it unmodified. + // If you do not catch the OutOfMemoryError, the Android app crashes. + } + return bitmap; }
CB-<I> Android: Catch and ignore OutOfMemoryError in getRotatedBitmap() getRotatedBitmap() can run out of memory if the image is very large: <URL>
apache_cordova-plugin-camera
train
java
6d8806ae99141ace02c4e65c29d3cf681d5b97cd
diff --git a/spec/integration/setup_spec.rb b/spec/integration/setup_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/setup_spec.rb +++ b/spec/integration/setup_spec.rb @@ -33,6 +33,8 @@ describe 'Setting up ROM' do describe 'quick setup' do it 'exposes boot DSL inside the setup block' do + User = Class.new { include Virtus.value_object; values { attribute :name, String } } + rom = ROM.setup(memory: 'memory://test') do schema do base_relation(:users) do @@ -53,13 +55,14 @@ describe 'Setting up ROM' do mappers do define(:users) do - model OpenStruct + model User end end end rom.command(:users).create.call(name: 'Jane') - expect(rom.read(:users).by_name('Jane').to_a).to eql([OpenStruct.new(name: 'Jane')]) + + expect(rom.read(:users).by_name('Jane').to_a).to eql([User.new(name: 'Jane')]) end end end
Fix spec for jruby and rbx
rom-rb_rom
train
rb
b5fbd275051ac39c6030f4eb65c5599a7fa1c8ab
diff --git a/chess/syzygy.py b/chess/syzygy.py index <HASH>..<HASH> 100644 --- a/chess/syzygy.py +++ b/chess/syzygy.py @@ -1055,18 +1055,6 @@ class Table(object): def __exit__(self, exc_type, exc_value, traceback): self.close() - def __getstate__(self): - state = self.__dict__.copy() - del state["fd"] - del state["data"] - del state["read_ubyte"] - del state["lock"] - return state - - def __setstate__(self, state): - self.__init__(self.directory, self.filename, self.suffix) - self.__dict__.update(state) - class WdlTable(Table):
Tables are no longer serializable
niklasf_python-chess
train
py
840ee4e5deac49b9f75072cf1277fd2ef5ae90ab
diff --git a/source/application/models/oxmanufacturerlist.php b/source/application/models/oxmanufacturerlist.php index <HASH>..<HASH> 100644 --- a/source/application/models/oxmanufacturerlist.php +++ b/source/application/models/oxmanufacturerlist.php @@ -123,7 +123,7 @@ class oxManufacturerList extends oxList foreach ($this as $sVndId => $oManufacturer) { // storing active manufacturer object - if ($sVndId === $sActCat) { + if ((string)$sVndId === $sActCat) { $this->setClickManufacturer($oManufacturer); }
<I> Ensure sVndId to be string before comparison with category id Resolves #<I>.
OXID-eSales_oxideshop_ce
train
php
8a3ea41b5adc50254f672ef0ed507d935f8b9c64
diff --git a/bookstore/tests/test_handlers.py b/bookstore/tests/test_handlers.py index <HASH>..<HASH> 100644 --- a/bookstore/tests/test_handlers.py +++ b/bookstore/tests/test_handlers.py @@ -69,13 +69,16 @@ def test_collect_handlers_only_version(): handlers = collect_handlers(log, '/', validation) assert expected == handlers [email protected] -def bookstore_settings(): [email protected](scope="class") +def bookstore_settings(request): mock_settings = { "BookstoreSettings": {"s3_access_key_id": "mock_id", "s3_secret_access_key": "mock_access"} } config = Config(mock_settings) - return BookstoreSettings(config=config) + bookstore_settings = BookstoreSettings(config=config) + if request.cls is not None: + request.cls.bookstore_settings = bookstore_settings + return bookstore_settings def test_build_settings_dict(bookstore_settings):
Update fixture to also be accessible via optional class access
nteract_bookstore
train
py
07e7fff431abcbf498aae528b50eeace61a56872
diff --git a/airflow/operators/redshift_to_s3_operator.py b/airflow/operators/redshift_to_s3_operator.py index <HASH>..<HASH> 100644 --- a/airflow/operators/redshift_to_s3_operator.py +++ b/airflow/operators/redshift_to_s3_operator.py @@ -42,6 +42,7 @@ class RedshiftToS3Transfer(BaseOperator): :parame verify: Whether or not to verify SSL certificates for S3 connection. By default SSL certificates are verified. You can provide the following values: + - False: do not validate SSL certificates. SSL will still be used (unless use_ssl is False), but SSL certificates will not be verified. @@ -69,7 +70,6 @@ class RedshiftToS3Transfer(BaseOperator): verify=None, unload_options=tuple(), autocommit=False, - parameters=None, include_header=False, *args, **kwargs): super(RedshiftToS3Transfer, self).__init__(*args, **kwargs) @@ -82,7 +82,6 @@ class RedshiftToS3Transfer(BaseOperator): self.verify = verify self.unload_options = unload_options self.autocommit = autocommit - self.parameters = parameters self.include_header = include_header if self.include_header and \
[AIRFLOW-<I>] Remove unnecessary arg "parameters" in RedshiftToS3Transfer (#<I>) "Parameters" are used to help render the SQL command. But in this operator, only "schema" and "table" are needed. There is no SQL command to render. By checking the code,we can also find argument "parameters" is never really used. (Fix a minor issue in the docstring as well)
apache_airflow
train
py
f3b8c54d2778eeb9c72ee7e4ed98cc3f7fcd2f2e
diff --git a/lib/objects/node/meta_data_loader.rb b/lib/objects/node/meta_data_loader.rb index <HASH>..<HASH> 100644 --- a/lib/objects/node/meta_data_loader.rb +++ b/lib/objects/node/meta_data_loader.rb @@ -34,7 +34,7 @@ module Bcome::Node end def prompt_for_decryption_key - print "Enter your decryption key: ".informational + print "\nEnter your decryption key: ".informational @decryption_key = STDIN.noecho(&:gets).chomp end
Tidied prompt for decryption key
webzakimbo_bcome-kontrol
train
rb
0b089f12e9bfb9f1ae313eababe19d3fb208eab6
diff --git a/lib/ExportsStorage.js b/lib/ExportsStorage.js index <HASH>..<HASH> 100644 --- a/lib/ExportsStorage.js +++ b/lib/ExportsStorage.js @@ -205,7 +205,13 @@ export default class ExportsStorage { reject(err); return; } - resolve(); + this.db.run('DELETE FROM mtimes WHERE (path = ?)', pathToFile, (mErr) => { + if (mErr) { + reject(mErr); + return; + } + resolve(); + }); }); }); }
Remove files from mtimes table as well I had forgot to remove things from the mtimes table when a file was deleted. This resulted in no files ever being fully evicted from storage.
Galooshi_import-js
train
js
0d97497b092c2ac913dfd858cd9098d71550e4ca
diff --git a/src/android/Sync.java b/src/android/Sync.java index <HASH>..<HASH> 100644 --- a/src/android/Sync.java +++ b/src/android/Sync.java @@ -382,6 +382,8 @@ public class Sync extends CordovaPlugin { // Testing //String outputDirectory = cordova.getActivity().getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(); outputDirectory += outputDirectory.endsWith(File.separator) ? "" : File.separator; + outputDirectory += "files"; + outputDirectory += outputDirectory.endsWith(File.separator) ? "" : File.separator; outputDirectory += id; Log.d(LOG_TAG, "output dir = " + outputDirectory);
Work around issue caused by hella broken Android File API plugin
phonegap_phonegap-plugin-contentsync
train
java
bec4767ae9a607e4b97968aa472e80523f45e11c
diff --git a/src/game/store.js b/src/game/store.js index <HASH>..<HASH> 100644 --- a/src/game/store.js +++ b/src/game/store.js @@ -18,16 +18,11 @@ exports.make = function(_runtimeData, _intents, _register, _globals) { var Store = register.wrapFn(function(object) { - Object.defineProperties(this, - C.RESOURCES_ALL.reduce((result, resource) => { - result[resource] = { - value: object.store[resource]||0, - enumerable: object.store[resource], - configurable: true, - writable: true - }; - return result; - }, {})); + Object.entries(object.store).forEach(([resourceType, resourceAmount]) => { + if(resourceAmount) { + this[resourceType] = resourceAmount; + } + }); Object.defineProperties(this, { getCapacity: { @@ -63,6 +58,17 @@ exports.make = function(_runtimeData, _intents, _register, _globals) { } } }); + + return new Proxy(this, { + get(target, name) { + if(target[name]) { + return target[name]; + } + if(C.RESOURCES_ALL.indexOf(name) !== -1) { + return 0; + } + } + }); }); Object.defineProperty(globals, 'Store', {enumerable: true, value: Store});
refact(runtime): replace RESOURCES_ALL loop with a proxy in Store constructor
screeps_engine
train
js
51150bd1a570159bad17121ade4a7978cc18d711
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -114,7 +114,7 @@ metadata = dict( license = "LGPLv2+", long_description = readme, platforms = '', - url = 'https://github.com/taschini/crlibm', + url = 'https://github.com/taschini/pycrlibm', )
Fixed descriptive link in setup.py.
taschini_pycrlibm
train
py
170cf86b2bb2cff743ae62e20acf6f95f9231964
diff --git a/claripy/ast/base.py b/claripy/ast/base.py index <HASH>..<HASH> 100644 --- a/claripy/ast/base.py +++ b/claripy/ast/base.py @@ -420,7 +420,7 @@ class Base(ana.Storable): if variable_set is None: variable_set = {} - hash_key = hash(self) + hash_key = self.cache_key if hash_key in replacements: r = replacements[hash_key] @@ -544,7 +544,7 @@ class Base(ana.Storable): if type(old) is not type(new): raise ClaripyOperationError('cannot replace type %s ast with type %s ast' % (type(old), type(new))) old._check_replaceability(new) - replacements = {hash(old): new} + replacements = {old.cache_key: new} return self._replace(replacements, old.variables) def replace_dict(self, replacements):
use the cache_key as a key in the replacement dict
angr_claripy
train
py
c676be023fd655831647b7787a2d4775f9ebb430
diff --git a/deprecation.py b/deprecation.py index <HASH>..<HASH> 100644 --- a/deprecation.py +++ b/deprecation.py @@ -73,11 +73,11 @@ once Invenio v2.1 has been released. """ -class RemovedInInvenio22Warning(PendingDeprecationWarning): +class RemovedInInvenio23Warning(PendingDeprecationWarning): - """Mark feature that will be removed in Invenio version 2.2.""" + """Mark feature that will be removed in Invenio version 2.3.""" -class RemovedInInvenio21Warning(DeprecationWarning): +class RemovedInInvenio22Warning(DeprecationWarning): - """Mark feature that will be removed in Invenio version 2.1.""" + """Mark feature that will be removed in Invenio version 2.2."""
global: post-release deprecation bump
inveniosoftware-attic_invenio-utils
train
py
bd732e20a5a2ff247a1f9f313e5a14276070517f
diff --git a/jaraco/__init__.py b/jaraco/__init__.py index <HASH>..<HASH> 100644 --- a/jaraco/__init__.py +++ b/jaraco/__init__.py @@ -1,2 +1,10 @@ # this is a namespace package -__import__('pkg_resources').declare_namespace(__name__) \ No newline at end of file +__import__('pkg_resources').declare_namespace(__name__) + +try: + # py2exe support (http://www.py2exe.org/index.cgi/ExeWithEggs) + import modulefinder + for p in __path__: + modulefinder.AddPackagePath(__name__, p) +except ImportError: + pass
Added py2exe support to the package.
jaraco_jaraco.windows
train
py
9378bdffd58b823f11640230f0efad08e4823c35
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,8 @@ var express = require('express'), api = require('./lib/api'), utils = require('./lib/utils'), - proxy = express(); + proxy = express(), + restbus = {}; // Configuration & Middleware if(proxy.get('env') === 'development') { @@ -45,5 +46,10 @@ proxy.get('/agencies/:agency/tuples/:tuples/predictions', api.predictions.tuples proxy.get('/agencies/:agency/routes/:route/stops/:stop/predictions', api.predictions.get); proxy.get('/locations/:latlon/predictions', api.predictions.location); -// Return an object with a 'listen' method to start the proxy on given port. -module.exports = { listen: function(port) { proxy.listen(port || '3535'); } }; \ No newline at end of file +restbus.listen = function(port) { + var p = port || '3535'; + + proxy.listen(p, function() { console.log('restbus started and listening on port ' + p); }); +}; + +module.exports = restbus; \ No newline at end of file
refactored export statement, added listen callback.
morganney_restbus
train
js
f908ce43317bfc5c6ae7f286f7920e6798c0c0fe
diff --git a/salt/states/file.py b/salt/states/file.py index <HASH>..<HASH> 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -6401,7 +6401,6 @@ def rename(name, source, force=False, makedirs=False): if not force: ret['comment'] = ('The target file "{0}" exists and will not be ' 'overwritten'.format(name)) - ret['result'] = False return ret elif not __opts__['test']: # Remove the destination to prevent problems later diff --git a/tests/unit/states/test_file.py b/tests/unit/states/test_file.py index <HASH>..<HASH> 100644 --- a/tests/unit/states/test_file.py +++ b/tests/unit/states/test_file.py @@ -1524,7 +1524,7 @@ class TestFileState(TestCase, LoaderModuleMockMixin): with patch.object(os.path, 'lexists', mock_lex): comt = ('The target file "{0}" exists and will not be ' 'overwritten'.format(name)) - ret.update({'comment': comt, 'result': False}) + ret.update({'comment': comt, 'result': True}) self.assertDictEqual(filestate.rename(name, source), ret) mock_lex = MagicMock(side_effect=[True, True, True])
Porting PR #<I> to <I>
saltstack_salt
train
py,py
1ea26c9a59f52c217f42110b9eb5342a10578308
diff --git a/ara/plugins/callback/ara_default.py b/ara/plugins/callback/ara_default.py index <HASH>..<HASH> 100644 --- a/ara/plugins/callback/ara_default.py +++ b/ara/plugins/callback/ara_default.py @@ -143,7 +143,7 @@ class CallbackModule(CallbackBase): self._load_files(play._loader._FILE_CACHE.keys()) # Create the play - self.play = self.client.post("/api/v1/plays", name=play.name, playbook=self.playbook["id"]) + self.play = self.client.post("/api/v1/plays", name=play.name, uuid=play._uuid, playbook=self.playbook["id"]) # Record all the hosts involved in the play self._load_hosts(play._variable_manager._inventory._restriction)
Save the play uuid provided by Ansible when recording the play This will allow clients and plugins running within Ansible to identify which play they are in and which playbook they are in. Change-Id: I<I>d<I>bb<I>bf<I>acf<I>d1eb8 Depends-On: <URL>
ansible-community_ara
train
py
c4961d828c388e1941d448ecbd33b1d81cd7ac9f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ long_description = ('Ariane CLIP3 (client python 3) is the python implementation ' + IRC on freenode #ariane.echinopsii') setup(name='ariane_clip3', - version='0.1.1-b01', + version='0.1.1', description='Ariane Python API Library', long_description=long_description, author='Mathilde Ffrench', @@ -22,7 +22,7 @@ setup(name='ariane_clip3', maintainer='Mathilde Ffrench', maintainer_email='[email protected]', url='https://github.com/echinopsii/net.echinopsii.ariane.community.cli.python3.git', - download_url='https://github.com/echinopsii/net.echinopsii.ariane.community.cli.python3.git/tarball/0.1.1-b01', + download_url='https://github.com/echinopsii/net.echinopsii.ariane.community.cli.python3.git/tarball/0.1.1', packages=['ariane_clip3', 'ariane_clip3.rabbitmq', 'ariane_clip3.rest'], license='AGPLv3', install_requires=['requests', 'epika-python3', 'pykka'],
[ACC-<I>] delivery <I>
echinopsii_net.echinopsii.ariane.community.cli.python3
train
py
cc0557a82911f7bf5234cbb79060ced0a2ee736a
diff --git a/lib/bibliothecary.rb b/lib/bibliothecary.rb index <HASH>..<HASH> 100644 --- a/lib/bibliothecary.rb +++ b/lib/bibliothecary.rb @@ -13,7 +13,7 @@ module Bibliothecary file_list = [] Find.find(path) do |subpath| Find.prune if FileTest.directory?(subpath) && ignored_dirs.include?(File.basename(subpath)) - file_list.append(subpath) + file_list.push(subpath) end package_managers.map{|pm| pm.analyse(path, file_list) }.flatten.compact end diff --git a/spec/bibliothecary_spec.rb b/spec/bibliothecary_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bibliothecary_spec.rb +++ b/spec/bibliothecary_spec.rb @@ -59,7 +59,7 @@ describe Bibliothecary do it 'searches a folder for manifests and parses them' do Bibliothecary.configure do |config| - config.ignored_dirs.append("fixtures") + config.ignored_dirs.push("fixtures") end analysis = described_class.analyse('./') # empty out any dependencies to make the test more reliable.
Switch to push as I guess append was not available in ruby <I>
librariesio_bibliothecary
train
rb,rb
ce6782a22db8ad038c56b9534d9e1377871cb3b2
diff --git a/routing/dht/routing.go b/routing/dht/routing.go index <HASH>..<HASH> 100644 --- a/routing/dht/routing.go +++ b/routing/dht/routing.go @@ -3,6 +3,7 @@ package dht import ( "bytes" "fmt" + "runtime" "sync" "time" @@ -380,6 +381,16 @@ func (dht *IpfsDHT) findProvidersAsyncRoutine(ctx context.Context, key key.Key, _, err := query.Run(ctx, peers) if err != nil { log.Debugf("Query error: %s", err) + // Special handling for issue: https://github.com/ipfs/go-ipfs/issues/3032 + if fmt.Sprint(err) == "<nil>" { + log.Error("reproduced bug 3032:") + log.Errorf("Errors type information: %#v", err) + log.Errorf("go version: %s", runtime.Version()) + log.Error("please report this information to: https://github.com/ipfs/go-ipfs/issues/3032") + + // replace problematic error with something that won't crash the daemon + err = fmt.Errorf("<nil>") + } notif.PublishQueryEvent(ctx, &notif.QueryEvent{ Type: notif.QueryError, Extra: err.Error(),
dht: add in code to detect and diagnose #<I> License: MIT
ipfs_go-ipfs
train
go
f4b2ed2a92a897f2fc2868a84c14b72d07c56fd1
diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index <HASH>..<HASH> 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -340,7 +340,7 @@ func (web *webAPIHandlers) ListBuckets(r *http.Request, args *WebGenericArgs, re for _, bucket := range buckets { if globalIAMSys.IsAllowed(iampolicy.Args{ AccountName: claims.AccessKey, - Action: iampolicy.ListAllMyBucketsAction, + Action: iampolicy.ListBucketAction, BucketName: bucket.Name, ConditionValues: getConditionValues(r, "", claims.AccessKey, claims.Map()), IsOwner: owner,
fix: filter list buckets operation with ListObjects perm (#<I>) fix regression introduced in #<I>
minio_minio
train
go
d9e43a98736d69e1a4b78d499410b76650589dea
diff --git a/environs/cloudinit/windows_userdata_test.go b/environs/cloudinit/windows_userdata_test.go index <HASH>..<HASH> 100644 --- a/environs/cloudinit/windows_userdata_test.go +++ b/environs/cloudinit/windows_userdata_test.go @@ -862,5 +862,5 @@ values: cmd.exe /C mklink /D C:\Juju\lib\juju\tools\machine-10 1.2.3-win8-amd64 echo 'Starting Juju machine agent (jujud-machine-10)' >&9 New-Service -Credential $jujuCreds -Name 'jujud-machine-10' -DisplayName 'juju agent for machine-10' '''C:\Juju\lib\juju\tools\machine-10\jujud.exe'' machine --data-dir ''C:\Juju\lib\juju'' --machine-id 10 --debug' -cmd.exe /C sc config jujud-machine-10 start=delayed-auto -Start-Service jujud-machine-10` +cmd.exe /C sc config 'jujud-machine-10' start=delayed-auto +Start-Service 'jujud-machine-10'`
Fix the windows cloudinit tests.
juju_juju
train
go
bd727c31795405c5ce1277163156477ad2f50cb5
diff --git a/uptick/__main__.py b/uptick/__main__.py index <HASH>..<HASH> 100755 --- a/uptick/__main__.py +++ b/uptick/__main__.py @@ -731,13 +731,14 @@ def main(): installedKeys = bitshares.wallet.getPublicKeys() if len(installedKeys) == 1: name = bitshares.wallet.getAccountFromPublicKey(installedKeys[0]) + account = Account(name) print("=" * 30) - print("Setting new default user: %s" % name) + print("Setting new default user: %s" % account["name"]) print() print("You can change these settings with:") print(" uptick set default_account <account>") print("=" * 30) - config["default_account"] = name + config["default_account"] = account["name"] elif args.command == "delkey": if confirm(
[wallet] first account name should be properly shown
bitshares_uptick
train
py
e72f75a7670ba2e1d371b14eeffbda7c5c1a84ac
diff --git a/src/ManagedExtension.js b/src/ManagedExtension.js index <HASH>..<HASH> 100644 --- a/src/ManagedExtension.js +++ b/src/ManagedExtension.js @@ -84,7 +84,7 @@ module.exports = function(ScriptEntry, userSocketOptions = {}) { // Run extension - ScriptEntry(socket, { + (ScriptEntry.default || ScriptEntry)(socket, { name: argv.name, configPath: argv.settingsPath, logPath: argv.logPath, diff --git a/src/RemoteExtension.js b/src/RemoteExtension.js index <HASH>..<HASH> 100644 --- a/src/RemoteExtension.js +++ b/src/RemoteExtension.js @@ -99,7 +99,7 @@ module.exports = function(Entry, socketOptions, { packageInfo, dataPath, nameSuf process.on('SIGINT', onSigint); // Launch extension - Entry(socket, { + (Entry.default || Entry)(socket, { name: getExtensionName(), configPath: parseDataDirectory(dataPath, 'settings'), logPath: parseDataDirectory(dataPath, 'logs'),
Handle extension entries with a default export
airdcpp-web_airdcpp-extension-js
train
js,js
d2601ceb04ace2f0a8096874f2eece0cb6cff1c3
diff --git a/gulpfile.js/tasks/html.js b/gulpfile.js/tasks/html.js index <HASH>..<HASH> 100644 --- a/gulpfile.js/tasks/html.js +++ b/gulpfile.js/tasks/html.js @@ -37,7 +37,7 @@ var htmlTask = function() { .on('error', handleErrors) .pipe(gulpif(global.production, htmlmin(config.tasks.html.htmlmin))) .pipe(gulp.dest(paths.dest)) - .pipe(browserSync.stream()) + .on('end', browserSync.reload) }
Fix Browsersync html task reload issue Fixes #<I> Only reload once at the end of the stream to keep browser from reloading too early
vigetlabs_blendid
train
js
d76e61f2a1a6606290346bdce7b2cd1403b6ff09
diff --git a/tests/unit/OxidTestCase.php b/tests/unit/OxidTestCase.php index <HASH>..<HASH> 100644 --- a/tests/unit/OxidTestCase.php +++ b/tests/unit/OxidTestCase.php @@ -696,5 +696,6 @@ class OxidTestCase extends PHPUnit_Framework_TestCase if (!in_array($sTable, $this->_aTableForCleanups)) { $this->_aTableForCleanups[] = $sTable; } + } }
ESDEV-<I> Also add shop relations table for cleanup in addTableForCleanup().
OXID-eSales_oxideshop_ce
train
php
53fd49c65e4ccddebc3f152f61978b7e5f64f67d
diff --git a/fastlane/lib/fastlane/version.rb b/fastlane/lib/fastlane/version.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/version.rb +++ b/fastlane/lib/fastlane/version.rb @@ -1,5 +1,5 @@ module Fastlane - VERSION = '2.60.0'.freeze + VERSION = '2.60.1'.freeze DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze MINIMUM_XCODE_RELEASE = "7.0".freeze end
Version bump to <I> (#<I>)
fastlane_fastlane
train
rb
6485ebd95049e9e1dd2a6d1f5a1e8646646e2348
diff --git a/wayback-core/src/main/java/org/archive/wayback/liveweb/URLtoARCCacher.java b/wayback-core/src/main/java/org/archive/wayback/liveweb/URLtoARCCacher.java index <HASH>..<HASH> 100644 --- a/wayback-core/src/main/java/org/archive/wayback/liveweb/URLtoARCCacher.java +++ b/wayback-core/src/main/java/org/archive/wayback/liveweb/URLtoARCCacher.java @@ -138,8 +138,7 @@ public class URLtoARCCacher { getMethod.setRequestHeader("User-Agent", userAgent); int code = client.executeMethod(getMethod); LOGGER.info("URL(" + url + ") HTTP:" + code); -// ByteOp.discardStream(getMethod.getResponseBodyAsStream()); - ByteOp.copyStream(getMethod.getResponseBodyAsStream(), System.out); + ByteOp.discardStream(getMethod.getResponseBodyAsStream()); getMethod.releaseConnection(); gotUrl = true;
BUGFIX(unreported) last checkin left in "debug" code which dumped original content to STDOUT... git-svn-id: <URL>
iipc_openwayback
train
java
a47b6a9ff6489e5855bfa22f76423e1863bce020
diff --git a/src/main/java/ch/digitalfondue/stampo/command/Serve.java b/src/main/java/ch/digitalfondue/stampo/command/Serve.java index <HASH>..<HASH> 100644 --- a/src/main/java/ch/digitalfondue/stampo/command/Serve.java +++ b/src/main/java/ch/digitalfondue/stampo/command/Serve.java @@ -52,6 +52,13 @@ public class Serve extends Command { public void setDisableAutoReload(boolean flag) { disableAutoReload = flag; } + + @Parameter(description = "block thread on start", names = "--blocking-on-start") + private boolean blockingOnStart = false; + + public void setBlockingOnStart(boolean flag) { + blockingOnStart = flag; + } @Override void runWithPaths(String inputPath, String outputPath) { @@ -65,7 +72,7 @@ public class Serve extends Command { System.out.println("rebuild on change is disabled"); } new ServeAndWatch(hostname, port, !disableRebuildOnChange, !disableAutoReload, - new Stampo(Paths.get(inputPath), Paths.get(outputPath)).getConfiguration(), triggerBuild, false) + new Stampo(Paths.get(inputPath), Paths.get(outputPath)).getConfiguration(), triggerBuild, blockingOnStart) .start(); }
parameterized thread blocking for mvn plugin
digitalfondue_stampo
train
java
aa1b2fed9389c0cbdd01d9f6d3a4f9a1cbb08680
diff --git a/public/jwlib/tests/collection/map.js b/public/jwlib/tests/collection/map.js index <HASH>..<HASH> 100644 --- a/public/jwlib/tests/collection/map.js +++ b/public/jwlib/tests/collection/map.js @@ -246,6 +246,19 @@ JW.Tests.Collection.MapTestCase = JW.Tests.Collection.AbstractMapBase.extend({ }); }, + testReindexPerformance: function() { + this.assertPerformance(20, function() { + var values = {}; + for (var i = 0; i < 1000; ++i) { + values["a" + i] = i; + } + var map = new JW.Map(values, true); + for (var i = 0; i < 1000; ++i) { + map.reindex(JW.Map.single("a" + i, "b" + i)); + } + }); + }, + assertPerformance: function(limit, callback) { var time = new Date().getTime(); callback.call(this);
Added TDD (failing) test for JW.Map.reindex performance.
enepomnyaschih_jwidget
train
js
3434ad9ca0624fe4192f2702fb94307525d05aaa
diff --git a/dbt/main.py b/dbt/main.py index <HASH>..<HASH> 100644 --- a/dbt/main.py +++ b/dbt/main.py @@ -162,8 +162,9 @@ def run_from_args(parsed): task = None cfg = None - if parsed.which == 'init': - # bypass looking for a project file if we're running `dbt init` + if parsed.which in ('init', 'debug'): + # bypass looking for a project file if we're running `dbt init` or + # `dbt debug` task = parsed.cls(args=parsed) else: nearest_project_dir = get_nearest_project_dir()
Bypass project loading in init, we do it anyway
fishtown-analytics_dbt
train
py
d65273a3ae50c00e37c161fb5d55bc79d5423148
diff --git a/enforcer/nfq_linux.go b/enforcer/nfq_linux.go index <HASH>..<HASH> 100644 --- a/enforcer/nfq_linux.go +++ b/enforcer/nfq_linux.go @@ -15,12 +15,14 @@ import ( func errorCallback(err error, data interface{}) { zap.L().Error("Error while processing packets on queue", zap.Error(err)) } -func networkCallback(packet *nfqueue.NFPacket, d interface{}) { +func networkCallback(packet *nfqueue.NFPacket, d interface{}) bool { d.(*Datapath).processNetworkPacketsFromNFQ(packet) + return true } -func appCallBack(packet *nfqueue.NFPacket, d interface{}) { +func appCallBack(packet *nfqueue.NFPacket, d interface{}) bool { d.(*Datapath).processApplicationPacketsFromNFQ(packet) + return true } // startNetworkInterceptor will the process that processes packets from the network
Fixed: Match prototype with new callback APIs
aporeto-inc_trireme-lib
train
go
19801d14e761d2fab897340acb1e0305a1f158cf
diff --git a/nodeserver/src/client/js/corewrapper.js b/nodeserver/src/client/js/corewrapper.js index <HASH>..<HASH> 100644 --- a/nodeserver/src/client/js/corewrapper.js +++ b/nodeserver/src/client/js/corewrapper.js @@ -942,6 +942,9 @@ define(['logManager', this.getAttributeNames = function(){ return core.getAttributeNames(node); }; + this.getRegistryNames = function(){ + return core.getRegistryNames(node); + }; var getClientNodePath = function(){ var path = /*core.getStringPath(node)*/ownpath;
getRegistryNames was added to wrapper functionality Former-commit-id: c<I>b<I>cae5be<I>d<I>a<I>c<I>e1f<I>
webgme_webgme-engine
train
js
b4f29708426c3d059fc4c40a05ad891b96474b7c
diff --git a/warehouse/accounts/views.py b/warehouse/accounts/views.py index <HASH>..<HASH> 100644 --- a/warehouse/accounts/views.py +++ b/warehouse/accounts/views.py @@ -46,7 +46,7 @@ def profile(user, request): .join(Project) .distinct(Project.name) .filter(Project.users.contains(user)) - .order_by(Project.name) + .order_by(Project.name, Release._pypi_ordering.desc()) .all() )
Select latest releases for display on profile pages
pypa_warehouse
train
py
a87aeb201c63313cb6aebc138a09410b4bffa56f
diff --git a/src/base/polyfills.js b/src/base/polyfills.js index <HASH>..<HASH> 100644 --- a/src/base/polyfills.js +++ b/src/base/polyfills.js @@ -10,8 +10,9 @@ */ if (!Array.prototype.find) { Object.defineProperty(Array.prototype, 'find', { + // Note: ES6 arrow function syntax is not used on purpose to avoid this to be undefined value: function(predicate) { - // 1. Let O be ? ToObject(this value). + // 1. Let O be ? ToObject(this value). if (this == null) { throw new TypeError('"this" is null or not defined') }
style(polyfills): fix lint and add comment
clappr_clappr
train
js
7dae439b44d78beae2a34fe26c77dd076829135b
diff --git a/src/persistence/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java b/src/persistence/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java index <HASH>..<HASH> 100644 --- a/src/persistence/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java +++ b/src/persistence/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java @@ -627,7 +627,7 @@ public final class GrailsDomainBinder { if (config != null) { collection.setLazy(config.getLazy()); } else { - collection.setLazy(true); + collection.setLazy(false); } }
fix for GRAILS-<I>: collection elements being proxied
grails_grails-core
train
java
3136686a7e8daa389d8a7621ab818e66de6e0b17
diff --git a/src/main/com/mongodb/MongoClientURI.java b/src/main/com/mongodb/MongoClientURI.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/MongoClientURI.java +++ b/src/main/com/mongodb/MongoClientURI.java @@ -229,7 +229,7 @@ public class MongoClientURI { hosts = Collections.unmodifiableList(all); } - if (nsPart != null && !nsPart.isEmpty()) { // database,_collection + if (nsPart != null && nsPart.length() != 0) { // database,_collection int idx = nsPart.indexOf("."); if (idx < 0) { database = nsPart;
JAVA-<I>: Replaced !String.isEmpty() with String.length() != 0 to remove Java 6 dependency
mongodb_mongo-java-driver
train
java
2543b3b0a32dafc4985a30745e7b81d8f47f5308
diff --git a/lib/mongodb/db.js b/lib/mongodb/db.js index <HASH>..<HASH> 100644 --- a/lib/mongodb/db.js +++ b/lib/mongodb/db.js @@ -1865,7 +1865,7 @@ var __executeInsertCommand = function(self, db_command, options, callback) { connection = specifiedConnection != null ? specifiedConnection : connection; // Validate if we can use this server 2.6 wire protocol - if(!connection.isCompatible()) { + if(connection && !connection.isCompatible()) { return callback(utils.toError("driver is incompatible with this server version"), null); }
NODE-<I> connection is not checked for null before .isCompatible() is called
mongodb_node-mongodb-native
train
js
37900335c33af625e059c5e80b28372c7bd1e4e7
diff --git a/bokeh/charts/builder.py b/bokeh/charts/builder.py index <HASH>..<HASH> 100644 --- a/bokeh/charts/builder.py +++ b/bokeh/charts/builder.py @@ -68,7 +68,7 @@ def create_and_build(builder_class, *data, **kws): chart.start_plot() curdoc()._current_plot = chart # TODO (havocp) store this on state, not doc? - if curstate().autoadd: + if curdoc().autoadd: curdoc().add_root(chart) return chart
changed curstate -> curdoc in check for autoadd
bokeh_bokeh
train
py
a09d60e7d8682c4f0d3a35843d67daca3ae474dd
diff --git a/api/views.py b/api/views.py index <HASH>..<HASH> 100644 --- a/api/views.py +++ b/api/views.py @@ -15,6 +15,7 @@ from rest_framework.authentication import BaseAuthentication from rest_framework.response import Response from rest_framework.status import HTTP_400_BAD_REQUEST, HTTP_201_CREATED import json +from rest_framework.generics import get_object_or_404 class AnonymousAuthentication(BaseAuthentication): @@ -237,7 +238,7 @@ class FormationLayerViewSet(OwnerViewSet): def get_object(self, *args, **kwargs): qs = self.get_queryset(**kwargs) - obj = qs.get(id=self.kwargs['layer']) + obj = get_object_or_404(qs, id=self.kwargs['layer']) return obj def create(self, request, **kwargs):
switch to get_object_or_<I> on layer views
deis_deis
train
py
8569620874b64a2bfeaf5ce6bfd721f9ce54e568
diff --git a/gravatar.py b/gravatar.py index <HASH>..<HASH> 100644 --- a/gravatar.py +++ b/gravatar.py @@ -5,8 +5,14 @@ __author__ = 'Eric Seidel' __version__ = '0.0.5' __email__ = '[email protected]' -from urllib import urlencode -from urllib2 import urlopen + +try: + from urllib import urlencode + from urllib2 import urlopen +except ImportError: + from urllib.parse import urlencode + from urllib.request import urlopen + from hashlib import md5 try:
Fix ImportError's on Python3
gridaphobe_pyGravatar
train
py
54763d2fb0c5e89b53a7672553e7727802de9ac8
diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js index <HASH>..<HASH> 100644 --- a/src/ol/PluggableMap.js +++ b/src/ol/PluggableMap.js @@ -18,11 +18,7 @@ import RenderEventType from './render/EventType.js'; import TileQueue, {getTilePriority} from './TileQueue.js'; import View from './View.js'; import ViewHint from './ViewHint.js'; -import { - DEVICE_PIXEL_RATIO, - IMAGE_DECODE, - PASSIVE_EVENT_LISTENERS, -} from './has.js'; +import {DEVICE_PIXEL_RATIO, PASSIVE_EVENT_LISTENERS} from './has.js'; import {TRUE} from './functions.js'; import { apply as applyTransform, @@ -1047,8 +1043,7 @@ class PluggableMap extends BaseObject { if (frameState) { const hints = frameState.viewHints; if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) { - const lowOnFrameBudget = - !IMAGE_DECODE && Date.now() - frameState.time > 8; + const lowOnFrameBudget = Date.now() - frameState.time > 8; maxTotalLoading = lowOnFrameBudget ? 0 : 8; maxNewLoads = lowOnFrameBudget ? 0 : 2; }
Load less tiles when low on frame budget
openlayers_openlayers
train
js
f872f23589cb99dcbfbcbb2bce04dc1f9eef0072
diff --git a/jaraco/mongodb/oplog.py b/jaraco/mongodb/oplog.py index <HASH>..<HASH> 100644 --- a/jaraco/mongodb/oplog.py +++ b/jaraco/mongodb/oplog.py @@ -102,7 +102,9 @@ def _calculate_start(args): return bson.timestamp.Timestamp(utcnow - args.seconds, 0) day_ago = bson.timestamp.Timestamp(utcnow - 24*60*60, 0) - return read_ts(args.resume_file) or day_ago + saved_ts = read_ts(args.resume_file) + spec_ts = increment_ts(saved_ts) if saved_ts else None + return spec_ts or day_ago def _same_instance(client1, client2): @@ -277,10 +279,17 @@ def read_ts(filename): try: with open(filename, 'r') as f: data = json.load(f)['ts'] - return bson.Timestamp(data['time'], data['inc'] + 1) + return bson.Timestamp(data['time'], data['inc']) except (IOError, KeyError): pass +def increment_ts(ts): + """ + Return a new ts with an incremented .inc. + """ + return bson.Timestamp(ts.time, ts.inc + 1) + + if __name__ == '__main__': main()
Extract timestamp incrementing such that save_ts and read_ts are now complementary.
jaraco_jaraco.mongodb
train
py
7db0d2e8d9a6045106a6a4ebcbb25e1e3eeb27f0
diff --git a/vault/identity_store_entities.go b/vault/identity_store_entities.go index <HASH>..<HASH> 100644 --- a/vault/identity_store_entities.go +++ b/vault/identity_store_entities.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/errwrap" memdb "github.com/hashicorp/go-memdb" "github.com/hashicorp/vault/helper/identity" + "github.com/hashicorp/vault/helper/identity/mfa" "github.com/hashicorp/vault/helper/namespace" "github.com/hashicorp/vault/helper/storagepacker" "github.com/hashicorp/vault/sdk/framework" @@ -649,6 +650,9 @@ func (i *IdentityStore) mergeEntity(ctx context.Context, txn *memdb.Txn, toEntit if ok && !force { return nil, fmt.Errorf("conflicting MFA config ID %q in entity ID %q", configID, fromEntity.ID) } else { + if toEntity.MFASecrets == nil { + toEntity.MFASecrets = make(map[string]*mfa.Secret) + } toEntity.MFASecrets[configID] = configSecret } }
Fix a nil map pointer in mergeEntity. (#<I>)
hashicorp_vault
train
go
bd12cd646d144505df8508a7ea9c6c3de070a482
diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index <HASH>..<HASH> 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -611,7 +611,7 @@ class OEMHandler(generic.OEMHandler): elif self.is_fpc: return nextscale.get_fpc_firmware(bmcver, self.ipmicmd, self._fpc_variant) - return super(OEMHandler, self).get_oem_firmware(bmcver) + return super(OEMHandler, self).get_oem_firmware(bmcver, components) def get_diagnostic_data(self, savefile, progress): if self.has_xcc:
Fix lenovo generic fallback Wrong number of arguments are sent in such a case Change-Id: Icbb<I>b8d3ef<I>e1a<I>baeedf<I>bf<I>fabf
openstack_pyghmi
train
py
8183dc9b4cf31b09d57a15eb112bf349aa7540cc
diff --git a/nion/swift/model/DocumentModel.py b/nion/swift/model/DocumentModel.py index <HASH>..<HASH> 100644 --- a/nion/swift/model/DocumentModel.py +++ b/nion/swift/model/DocumentModel.py @@ -1673,6 +1673,16 @@ class DocumentModel(Observable.Observable, Observable.Broadcaster, Observable.Re buffered_data_source.add_region(rect_region) regions.append((region.name, rect_region, region_params.get("label"))) region_map[region.name] = rect_region + elif region.type == "interval": + if region.region: + interval_region = region.region + else: + interval_region = Region.IntervalRegion() + for k, v in region_params.items(): + setattr(interval_region, k, v) + buffered_data_source.add_region(interval_region) + regions.append((region.name, interval_region, region_params.get("label"))) + region_map[region.name] = interval_region expression = fn_template.format(**dict(zip(src_names, src_texts))) computation = self.create_computation(expression) for src_name, display_specifier, source in zip(src_names, display_specifiers, sources):
Add support for interval to computation make_region.
nion-software_nionswift
train
py
6f3d98ce768f0184f09769c1a5600e149a07ef7b
diff --git a/sos/collector/sosnode.py b/sos/collector/sosnode.py index <HASH>..<HASH> 100644 --- a/sos/collector/sosnode.py +++ b/sos/collector/sosnode.py @@ -817,7 +817,9 @@ class SosNode(): def remove_sos_archive(self): """Remove the sosreport archive from the node, since we have collected it and it would be wasted space otherwise""" - if self.sos_path is None: + if self.sos_path is None or self.local: + # local transport moves the archive rather than copies it, so there + # is no archive at the original location to remove return if 'sosreport' not in self.sos_path: self.log_debug("Node sos report path %s looks incorrect. Not "
[sosnode] Fix removal warning when cleaning up on a local node When `cleanup()` is called for a local node, we were generating a false warning that we couldn't remove the sos report. This removal attempt is unnecessary since local nodes moves the sos archive during collector archive creation, rather than copying it like we do for remote nodes. Closes: #<I>
sosreport_sos
train
py
ea3a24caf3c0be8a85cfd03261c9301fa1653fdf
diff --git a/MatchMakingLobby/GUI/AbstractGUI.php b/MatchMakingLobby/GUI/AbstractGUI.php index <HASH>..<HASH> 100644 --- a/MatchMakingLobby/GUI/AbstractGUI.php +++ b/MatchMakingLobby/GUI/AbstractGUI.php @@ -280,9 +280,9 @@ abstract class AbstractGUI /** * Create the player list to display to a player */ - final function createPlayerList($isReady = false) + final function createPlayerList($login) { - $playerList = Windows\PlayerList::Create(); + $playerList = Windows\PlayerList::Create($login); $playerList->show(); } diff --git a/MatchMakingLobby/Lobby/Plugin.php b/MatchMakingLobby/Lobby/Plugin.php index <HASH>..<HASH> 100644 --- a/MatchMakingLobby/Lobby/Plugin.php +++ b/MatchMakingLobby/Lobby/Plugin.php @@ -148,8 +148,6 @@ class Plugin extends \ManiaLive\PluginHandler\Plugin $this->registerLobby(); - $this->gui->createPlayerList(); - $this->setLobbyInfo(); $this->gui->createWaitingScreen( @@ -250,6 +248,8 @@ class Plugin extends \ManiaLive\PluginHandler\Plugin { return; } + + $this->gui->createPlayerList($login); $this->gui->addToGroup($login, false); $this->gui->showWaitingScreen($login);
Use one instance per player on PlayerList
maniaplanet_matchmaking-lobby
train
php,php
cfa8ed8bfd4d56f0a12290b28d469e7277ab8f83
diff --git a/src/basicFFmpeg.js b/src/basicFFmpeg.js index <HASH>..<HASH> 100644 --- a/src/basicFFmpeg.js +++ b/src/basicFFmpeg.js @@ -4,7 +4,11 @@ var util = require('util'), //creates a new processor object var createProcessor = function (options) { - //TODO: validate options such as niceness, make sure that required options are set + //validate options such as niceness, make sure that required options are set + if (!options.inputStream) throw 'input stream is not set'; + if (!options.outputStream) throw 'output stream is not set'; + if (options.niceness && (options.niceness < -20 || options.niceness > 19)) throw 'niceness cannot be lower than -20 or higher than 19'; + if (!options.arguments) options.arguments = {}; //create new processor, starts as an event emitter var processor = new EventEmitter();
validate options such as niceness, make sure that required options are set
tommedema_NodeBasicFFmpeg
train
js
283879197745a100abdf7635b5c15b4b0adfd2ab
diff --git a/server/lib/data_form.js b/server/lib/data_form.js index <HASH>..<HASH> 100644 --- a/server/lib/data_form.js +++ b/server/lib/data_form.js @@ -7,7 +7,7 @@ var _ = require('underscore'), async = require('async'), url = require('url'), mongoose = require('mongoose'), - debug = true; + debug = false; mongoose.set('debug', debug);
All tests now working. Still quite messy and inefficient (having a copy of the hierarchy attribute in scope.path for instance)
forms-angular_forms-angular
train
js
c6fb0a08f78e21a02f80f850c26a11bb67e82e3d
diff --git a/config/routes.rb b/config/routes.rb index <HASH>..<HASH> 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -75,6 +75,8 @@ Src::Application.routes.draw do get :status end end + resources :errata, :controller => "system_errata", :only => [:index, :update] do + end member do get :edit diff --git a/lib/navigation/systems.rb b/lib/navigation/systems.rb index <HASH>..<HASH> 100644 --- a/lib/navigation/systems.rb +++ b/lib/navigation/systems.rb @@ -80,6 +80,12 @@ module Navigation :if => lambda{@system}, :options => {:class=>"navigation_element"} }, + { :key => :errata, + :name =>N_("Errata"), + :url => lambda{errata_system_path(@system.id)}, + :if => lambda{@system}, + :options => {:class=>"navigation_element"} + }, { :key => :facts, :name =>N_("Facts"), :url => lambda{facts_system_path(@system.id)}, @@ -113,4 +119,4 @@ module Navigation end end -end \ No newline at end of file +end
System Errata: Add initial routes and navigation for system errata.
Katello_katello
train
rb,rb
8461ec0d630c847dd70f97a6348480f0abb1793e
diff --git a/NavigationReact/sample/native/web/SceneNavigator.js b/NavigationReact/sample/native/web/SceneNavigator.js index <HASH>..<HASH> 100644 --- a/NavigationReact/sample/native/web/SceneNavigator.js +++ b/NavigationReact/sample/native/web/SceneNavigator.js @@ -25,10 +25,10 @@ class SceneNavigator extends Component{ var {styleStart, styleMiddle, styleEnd} = this.props; var scenes = crumbs.concat({state, data, url, show: true}) .map(({state, data, url, show}) => - <Motion key={url} defaultStyle={(state.styleStart || styleStart)(!oldState, data)} - style={(state.styleEnd || styleEnd)(!!show, data)}> + <Motion key={url} defaultStyle={styleStart(!oldState, state, data)} + style={styleEnd(!!show, state, data)}> {(interpolatingStyle) => - <div style={(state.styleMiddle || styleMiddle)(interpolatingStyle, !!show, data)}> + <div style={styleMiddle(interpolatingStyle, !!show, state, data)}> {this.state.scenes[url]} </div> }
Passed state into style props instead of overriding
grahammendick_navigation
train
js
a2297f7f408c9ebbd565e91d26332258ed75b922
diff --git a/client/lib/reader-lists/lists.js b/client/lib/reader-lists/lists.js index <HASH>..<HASH> 100644 --- a/client/lib/reader-lists/lists.js +++ b/client/lib/reader-lists/lists.js @@ -15,7 +15,7 @@ function keyForList( owner, slug ) { } function getListURL( list ) { - return '/read/list/' + encodeURIComponent( list.owner ) + '/' + encodeURIComponent( list.slug ) + '/'; + return '/read/list/' + encodeURIComponent( list.owner ) + '/' + encodeURIComponent( list.slug ); } ListStore = { diff --git a/client/lib/reader-tags/tags.js b/client/lib/reader-tags/tags.js index <HASH>..<HASH> 100644 --- a/client/lib/reader-tags/tags.js +++ b/client/lib/reader-tags/tags.js @@ -16,7 +16,7 @@ emitter( TagStore ); function receiveTags( newTags ) { forOwn( newTags, ( sub ) => { - sub.URL = '/tag/' + sub.slug + '/'; + sub.URL = '/tag/' + sub.slug; sub.title = decodeEntities( sub.title ); sub.slug = sub.slug.toLowerCase(); tags[ sub.slug ] = sub;
Fix the URLs on lists and streams
Automattic_wp-calypso
train
js,js
fa108ccae6f824b4b38b7ea1cd8ea5ece87c1d66
diff --git a/lib/opentox.rb b/lib/opentox.rb index <HASH>..<HASH> 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -165,6 +165,7 @@ module OpenTox end end + # @return [String] converts object to turtle-string def to_turtle # redefined to use prefixes (not supported by RDF::Writer) prefixes = {:rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"} ['OT', 'DC', 'XSD', 'OLO'].each{|p| prefixes[p.downcase.to_sym] = eval("RDF::#{p}.to_s") } @@ -174,6 +175,7 @@ module OpenTox end end + # @return [String] converts OpenTox object into html document (by first converting it to a string) def to_html to_turtle.to_html end
commenting to_turtle and to_html
opentox_lazar
train
rb
33000f0d4cbb853b5ffeebe53ab709f3827f9e4d
diff --git a/src/function/init.js b/src/function/init.js index <HASH>..<HASH> 100644 --- a/src/function/init.js +++ b/src/function/init.js @@ -235,7 +235,7 @@ function($, emojione, blankImg, slice, css_class, emojioneSupportMode, invisible if (self.recentEmojis) { updateRecent(self); } - lazyLoading.call(this); + lazyLoading.call(self); }) .on("@tone.click", function(tone) {
Fix lazyLoad when opening
mervick_emojionearea
train
js
4bd91d0bd25ef8f72bdc6b8d345c74cfc8f7c37b
diff --git a/js/coinmarketcap.js b/js/coinmarketcap.js index <HASH>..<HASH> 100644 --- a/js/coinmarketcap.js +++ b/js/coinmarketcap.js @@ -43,7 +43,7 @@ module.exports = class coinmarketcap extends Exchange { ], }, }, - 'currencies': [ + 'currencyCodes': [ 'AUD', 'BRL', 'CAD', @@ -72,7 +72,7 @@ module.exports = class coinmarketcap extends Exchange { let result = []; for (let p = 0; p < markets.length; p++) { let market = markets[p]; - let currencies = Object.keys (this.currencies); + let currencies = this.currencyCodes; for (let i = 0; i < currencies.length; i++) { let quote = currencies[i]; let quoteId = quote.toLowerCase ();
fixed coinmarketcap symbols + currencies #<I>
ccxt_ccxt
train
js
f9d4d01088b00973f80fc997110bde3dedd69b74
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -37,10 +37,11 @@ ghost().then(function (ghostServer) { err = new common.errors.GhostError({err: err}); } + common.logging.error(err); + if (process.send) { process.send({started: false, error: err.message}); } - common.logging.error(err); process.exit(-1); });
Reordered error logging on ghost start (#<I>) no issue - if we trigger the IPC message to the CLI and the process manager is systemd, systemd will restart Ghost too early (same for local process manager) - this is a timing issue - the consequence is that the error log won't happen in Ghost (`content/logs/[domain].error.log` won't contain that error) - let's reorder both executions [See](<URL>) this comment on the CLI PR.
TryGhost_Ghost
train
js
6946a1b56fdaef629a2381965b5d48296bd967f3
diff --git a/system/HTTP/Files/UploadedFile.php b/system/HTTP/Files/UploadedFile.php index <HASH>..<HASH> 100644 --- a/system/HTTP/Files/UploadedFile.php +++ b/system/HTTP/Files/UploadedFile.php @@ -350,7 +350,7 @@ class UploadedFile extends File implements UploadedFileInterface return $this->guessExtension(); } - public function guessExtension(): string + public function guessExtension() : ?string { return \Config\Mimes::guessExtensionFromType($this->getMimeType(), $this->getClientExtension()); }
optional type hinting in guessExtension Null is allowed as the return value of \Config\Mimes::guessExtensionFromType that's why should be allowed in guessExtension either. thx @daljit3 for pointig this out.
codeigniter4_CodeIgniter4
train
php
44160702b104931a06f674ae52c53829589e75e7
diff --git a/src/Token.php b/src/Token.php index <HASH>..<HASH> 100644 --- a/src/Token.php +++ b/src/Token.php @@ -85,7 +85,7 @@ class Token { $parse = self::parser($token, $secret); - if (!self::validateExpiration($parse)) { + if (!self::validateWithExpiration($parse)) { return false; } @@ -148,7 +148,14 @@ class Token return new Parse($jwt, new Validate(), new Encode()); } - private static function validateExpiration(Parse $parse): bool + /** + * Run standard validation and expiration validation against the token. + * Will not return false if the expiration claim is not set. + * + * @param Parse $parse + * @return bool + */ + private static function validateWithExpiration(Parse $parse): bool { try { $parse->validate() @@ -162,6 +169,13 @@ class Token return true; } + /** + * Run not before validation against token. Will not return false if the + * not before claim is not set. + * + * @param Parse $parse + * @return bool + */ private static function validateNotBefore(Parse $parse): bool { try {
In Token class added comments to new validation methods, and amended name of the validateExpiration method to validateWithExpiration as this is slightly clearer.
RobDWaller_ReallySimpleJWT
train
php
a4eed42cf23c265ae6d55b6dff462135de6b240c
diff --git a/dashbuilder-backend/dashbuilder-services/src/main/java/org/dashbuilder/dataset/backend/exception/ExceptionManager.java b/dashbuilder-backend/dashbuilder-services/src/main/java/org/dashbuilder/dataset/backend/exception/ExceptionManager.java index <HASH>..<HASH> 100644 --- a/dashbuilder-backend/dashbuilder-services/src/main/java/org/dashbuilder/dataset/backend/exception/ExceptionManager.java +++ b/dashbuilder-backend/dashbuilder-services/src/main/java/org/dashbuilder/dataset/backend/exception/ExceptionManager.java @@ -24,7 +24,7 @@ public class ExceptionManager { * @return The portable exception to send to the client side. */ public RuntimeException handleException(final Exception e) { - log.debug(e.getMessage(), e); + log.error(e.getMessage(), e); if (e instanceof RuntimeException && EnvUtil.isPortableType(e.getClass()) ) { return (RuntimeException) e; }
Log any backend error caught by the ExceptionManager
dashbuilder_dashbuilder
train
java
0e49e9d004611162c48914589dab28789462dab8
diff --git a/xmantissa/webadmin.py b/xmantissa/webadmin.py index <HASH>..<HASH> 100644 --- a/xmantissa/webadmin.py +++ b/xmantissa/webadmin.py @@ -432,13 +432,24 @@ class REPL(athena.LiveFragment): registerAdapter(REPL, DeveloperApplication, INavigableFragment) + + class Traceback(Item): typeName = 'mantissa_traceback' schemaVersion = 1 - when = timestamp() - traceback = bytes() - collector = reference() + when = timestamp(doc=""" + Time at which the exception occured. + """, indexed=True) + + traceback = bytes(doc=""" + Contents of the traceback. + """) + + collector = reference(doc=""" + Parent L{TracebackCollector} item. + """) + def __init__(self, store, collector, failure): when = extime.Time() @@ -449,6 +460,8 @@ class Traceback(Item): when=when, collector=collector) + + class TracebackCollector(Item, Service): implements(IService)
Author: jonathanj Reviewer: glyph Fixes: #<I> Handle the case, in cookieDomainForRequest, where a request has no "host" header.
twisted_mantissa
train
py
7d26e9d36881fd647dfb14f547c2f52f8823f738
diff --git a/commons-datastore/commons-datastore-core/src/main/java/org/opencb/commons/datastore/core/QueryParam.java b/commons-datastore/commons-datastore-core/src/main/java/org/opencb/commons/datastore/core/QueryParam.java index <HASH>..<HASH> 100644 --- a/commons-datastore/commons-datastore-core/src/main/java/org/opencb/commons/datastore/core/QueryParam.java +++ b/commons-datastore/commons-datastore-core/src/main/java/org/opencb/commons/datastore/core/QueryParam.java @@ -40,4 +40,29 @@ public interface QueryParam { Type type(); + static QueryParam create(String key, String description, Type type) { + return new QueryParamImpl(key, description, type); + } + + class QueryParamImpl implements QueryParam { + + private QueryParamImpl(String key, String description, Type type) { + } + + @Override + public String key() { + return null; + } + + @Override + public String description() { + return null; + } + + @Override + public Type type() { + return null; + } + } + }
datastore: Add factory method for QueryParams
opencb_java-common-libs
train
java
be40cab07b49921e66bb7ba604ee3fa782d64157
diff --git a/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java b/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java index <HASH>..<HASH> 100644 --- a/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java +++ b/annis-service/src/main/java/annis/service/internal/QueryServiceImpl.java @@ -77,6 +77,7 @@ import javax.ws.rs.core.UriInfo; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authz.AuthorizationException; import org.apache.shiro.subject.Subject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -610,6 +611,11 @@ public class QueryServiceImpl implements QueryService return corpusConfig; } + catch (AuthorizationException ex) + { + log.error("authorization error", ex); + throw new WebApplicationException(401); + } catch (Exception ex) { log.error("problems with reading config", ex);
Better handling of authorization exceptions of corpus.properties rest api calls.
korpling_ANNIS
train
java
ca3f2ff1efb70f8cfe7b0aba5dcdfb0fc0fa2aa9
diff --git a/spec/support/fixtures/fixtures.rb b/spec/support/fixtures/fixtures.rb index <HASH>..<HASH> 100644 --- a/spec/support/fixtures/fixtures.rb +++ b/spec/support/fixtures/fixtures.rb @@ -606,7 +606,9 @@ TEST_SINGULARS = { 'trellis' => 'trellises', 'kiss' => 'kisses', # https://github.com/hanami/utils/issues/106 - 'album' => 'albums' + 'album' => 'albums', + # https://github.com/hanami/utils/issues/217 + 'phase' => 'phases' }.merge(TEST_PLURALS) require 'hanami/utils/inflector'
Added missing spec for #<I>
hanami_utils
train
rb