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
55f303cbf2287d3b529ef16626e1c5b661d6755e
diff --git a/app/scripts/tests/globals.js b/app/scripts/tests/globals.js index <HASH>..<HASH> 100644 --- a/app/scripts/tests/globals.js +++ b/app/scripts/tests/globals.js @@ -1,8 +1,8 @@ var sandbox, xhr, requests var wysihtml5 = { - Editor() { + Editor: function() { return { - on() {} + on: function() {} } } }
Changes globals.js to old syntax to try to fix travis
nossas_bonde-client
train
js
283cf6ec6fa5f3d6bce979020a806403b479293d
diff --git a/repository/filepicker.js b/repository/filepicker.js index <HASH>..<HASH> 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -434,7 +434,7 @@ M.core_filepicker.init = function(Y, options) { draggable: true, close: true, underlay: 'none', - zindex: 9999999, + zindex: 9999990, monitorresize: false, xy: [50, YAHOO.util.Dom.getDocumentScrollTop()+20] }); @@ -917,12 +917,12 @@ M.core_filepicker.init = function(Y, options) { search_dialog.cancel(); } - var search_dialog = new YAHOO.widget.Dialog("fp-search-dlg", { + search_dialog = new YAHOO.widget.Dialog("fp-search-dlg", { postmethod: 'async', draggable: true, width : "30em", fixedcenter : true, - zindex: 766667, + zindex: 9999991, visible : false, constraintoviewport : true, buttons: [
"MDL-<I>, fixed zindex value for search dialog"
moodle_moodle
train
js
a6ce4ee1d3abb15b633ee01b779aa92317ea3aa9
diff --git a/lib/ohai/plugins/network_listeners.rb b/lib/ohai/plugins/network_listeners.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/plugins/network_listeners.rb +++ b/lib/ohai/plugins/network_listeners.rb @@ -16,8 +16,6 @@ # limitations under the License. # -require 'sigar' - Ohai.plugin(:NetworkListeners) do provides "network/listeners" diff --git a/lib/ohai/runner.rb b/lib/ohai/runner.rb index <HASH>..<HASH> 100644 --- a/lib/ohai/runner.rb +++ b/lib/ohai/runner.rb @@ -42,13 +42,17 @@ module Ohai return false end - case plugin.version - when :version7 - run_v7_plugin(plugin, force) - when :version6 - run_v6_plugin(plugin, force) - else - raise ArgumentError, "Invalid plugin version #{plugin.version} for plugin #{plugin}" + begin + case plugin.version + when :version7 + run_v7_plugin(plugin, force) + when :version6 + run_v6_plugin(plugin, force) + else + raise ArgumentError, "Invalid plugin version #{plugin.version} for plugin #{plugin}" + end + rescue Exception,Errno::ENOENT => e + Ohai::Log.debug("Plugin #{plugin.name} threw exception #{e.inspect} #{e.backtrace.join("\n")}") end end
rescue exceptions thrown collecting data back out the require 'sigar' hack
chef_ohai
train
rb,rb
3c4763d6fc92be79d8776c2832598e50919a750d
diff --git a/src/parser.js b/src/parser.js index <HASH>..<HASH> 100644 --- a/src/parser.js +++ b/src/parser.js @@ -380,10 +380,30 @@ export default class Parser { this.handleSwaggerMethod(resource, href, pathObjectParameters, methodValue, method); }); + this.handleSwaggerVendorExtensions(resource, pathValue); + return resource; }); } + // Converts all unknown Swagger vendor extensions from an object into a API Element extension + handleSwaggerVendorExtensions(element, object) { + const extensions = _.chain(object) + .pick(isExtension) + .omit('x-description', 'x-summary', 'x-group-name') + .value(); + + if (Object.keys(extensions).length > 0) { + const {Link, Extension} = this.minim.elements; + const link = new Link(); + link.relation = 'profile'; + link.href = 'http://swagger.io/specification/#vendorExtensions'; + const extension = new Extension(extensions); + extension.links = [link]; + element.content.push(extension); + } + } + // Convert a Swagger method into a Refract transition. handleSwaggerMethod(resource, href, resourceParameters, methodValue, method) { const {Copy, Transition} = this.minim.elements;
Translate Swagger path-info extensions to resource extensions
apiaryio_fury-adapter-swagger
train
js
23285fbac059de585df7e80d25457a5f70eb2278
diff --git a/tests/test_potential.py b/tests/test_potential.py index <HASH>..<HASH> 100644 --- a/tests/test_potential.py +++ b/tests/test_potential.py @@ -160,7 +160,6 @@ def test_TwoPowerSphericalPotentialIntegerSelf(): def test_ZIsNone(): # TODO replace manual additions with an automatic method # that checks the signatures all methods in all potentials - kw = dict(amp=1.,a=1.,normalize=False,ro=None,vo=None) Rs= numpy.array([0.5,1.,2.])
retriggering codecov I don’t believe the results.
jobovy_galpy
train
py
fa438fad3da4b52044aefd14bc889cdede131926
diff --git a/lib/gettext_i18n_rails/ruby_gettext_extractor.rb b/lib/gettext_i18n_rails/ruby_gettext_extractor.rb index <HASH>..<HASH> 100644 --- a/lib/gettext_i18n_rails/ruby_gettext_extractor.rb +++ b/lib/gettext_i18n_rails/ruby_gettext_extractor.rb @@ -44,7 +44,11 @@ module RubyGettextExtractor end def run(content) - self.parse(content) + # ruby parser has an ugly bug which causes that several \000's take + # ages to parse. This avoids this probelm by stripping them away (they probably wont appear in keys anyway) + # See bug report: http://rubyforge.org/tracker/index.php?func=detail&aid=26898&group_id=439&atid=1778 + safe_content = content.gsub(/\\\d\d\d/, '') + self.parse(safe_content) return @results end
Workaround for a problem in the ruby parser A bug in the ruby parser can cause gettext:find to hang. The workaround removes all \<I> from the input before parsing. See bug report: <URL>
grosser_gettext_i18n_rails
train
rb
21b0a62fc4cd2856e016263b6abce783f7be94d1
diff --git a/admin/tool/generator/tests/maketestcourse_test.php b/admin/tool/generator/tests/maketestcourse_test.php index <HASH>..<HASH> 100644 --- a/admin/tool/generator/tests/maketestcourse_test.php +++ b/admin/tool/generator/tests/maketestcourse_test.php @@ -112,7 +112,6 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase { * Creates an small test course with fixed data set and checks the used sections and users. */ public function test_fixed_data_set() { - global $DB; $this->resetAfterTest(); $this->setAdminUser(); @@ -127,14 +126,12 @@ class tool_generator_maketestcourse_testcase extends advanced_testcase { // Check module instances belongs to section 1. $instances = $modinfo->get_instances_of('page'); - $npageinstances = count($instances); foreach ($instances as $instance) { $this->assertEquals(1, $instance->sectionnum); } // Users that started discussions are the same. $forums = $modinfo->get_instances_of('forum'); - $nforuminstances = count($forums); $discussions = forum_get_discussions(reset($forums), 'd.timemodified ASC'); $lastusernumber = 0; $discussionstarters = array();
MDL-<I> tool_generator: Removing unused vars
moodle_moodle
train
php
786b5c7fab4f960d6a24dfc582e7d5bc1a57bc35
diff --git a/lxd/devlxd_test.go b/lxd/devlxd_test.go index <HASH>..<HASH> 100644 --- a/lxd/devlxd_test.go +++ b/lxd/devlxd_test.go @@ -11,6 +11,7 @@ import ( "testing" "github.com/lxc/lxd/lxd/sys" + "github.com/lxc/lxd/lxd/ucred" ) var testDir string @@ -103,13 +104,13 @@ func TestCredsSendRecv(t *testing.T) { } defer conn.Close() - cred, err := getCred(conn) + cred, err := ucred.GetCred(conn) if err != nil { t.Log(err) result <- -1 return } - result <- cred.pid + result <- cred.PID }() conn, err := connect(fmt.Sprintf("%s/test-devlxd-sock", testDir))
test: Updates devlxd tests to use ucred package
lxc_lxd
train
go
bc5da5208da57a64223e664bf3b28c392304f6f8
diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index <HASH>..<HASH> 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -956,8 +956,7 @@ class BootstrapTable { return } - const s = this.searchText && (this.fromHtml ? - Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase() + const s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase() const f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns // Check filter @@ -1041,7 +1040,7 @@ class BootstrapTable { } } else { const largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm - const matches = largerSmallerEqualsRegex.exec(s) + const matches = largerSmallerEqualsRegex.exec(this.searchText) let comparisonCheck = false if (matches) {
Use the original search text instead of the (maybe) escaped one, to prevent issues with tables based on html
wenzhixin_bootstrap-table
train
js
79268587578c4ffd392d90ac09798d5255ac6004
diff --git a/pygubudesigner/widgets/imageentry.py b/pygubudesigner/widgets/imageentry.py index <HASH>..<HASH> 100644 --- a/pygubudesigner/widgets/imageentry.py +++ b/pygubudesigner/widgets/imageentry.py @@ -58,10 +58,11 @@ class ImagePropertyEditor(PropertyEditor): fname = tk.filedialog.askopenfilename(**options) if fname: base, name = os.path.split(fname) - self._set_value(name) - self._on_variable_changed(event=None) + # Register image before change event is generated: if not StockImage.is_registered(name): StockImage.register(name, fname) + self._set_value(name) + self._on_variable_changed(event=None) register_editor('imageentry', ImagePropertyEditor)
Register image before change event is generated.
alejandroautalan_pygubu
train
py
9ffabb481cce40575a998ec8b5e597a1a3abffd8
diff --git a/src/ol/interaction/draginteraction.js b/src/ol/interaction/draginteraction.js index <HASH>..<HASH> 100644 --- a/src/ol/interaction/draginteraction.js +++ b/src/ol/interaction/draginteraction.js @@ -39,12 +39,12 @@ ol.interaction.Drag = function() { /** * @type {number} */ - this.offsetX = 0; + this.deltaX = 0; /** * @type {number} */ - this.offsetY = 0; + this.deltaY = 0; /** * @type {ol.Coordinate}
Rename offset* attributes to delta*
openlayers_openlayers
train
js
af964fe0da0fcfc9c0132eda1cf3f38e8ee5954c
diff --git a/pipe_test.go b/pipe_test.go index <HASH>..<HASH> 100644 --- a/pipe_test.go +++ b/pipe_test.go @@ -12,7 +12,10 @@ func TestPipe(t *testing.T) { go func() { for i := 0; i < 10; i++ { - w.Write([]byte(fmt.Sprintf("%d", i))) + if _, err := w.Write([]byte(fmt.Sprintf("%d", i))); err != nil { + t.Error(err.Error()) + return + } } w.Close() }()
Added break into test if Write fails
djherbis_nio
train
go
b9315d03553f43720875fdb4fc178890f82cf5e3
diff --git a/lib/netsuite/actions/search.rb b/lib/netsuite/actions/search.rb index <HASH>..<HASH> 100644 --- a/lib/netsuite/actions/search.rb +++ b/lib/netsuite/actions/search.rb @@ -120,14 +120,18 @@ module NetSuite else if condition[:value].is_a?(Array) && condition[:value].first.respond_to?(:to_record) # TODO need to update to the latest savon so we don't need to duplicate the same workaround above again + # TODO it's possible that this might break, not sure if platformCore:SearchMultiSelectField is the right type in every situation - # h[element_name] = { - # "platformCore:searchValue" => { - # :content! => condition[:value].map(&:to_record), - # '@internalId' => condition[:value].internal_id, - # '@operator' => condition[:operator] - # } - # } + h[element_name] = { + '@operator' => condition[:operator], + '@xsi:type' => 'platformCore:SearchMultiSelectField', + "platformCore:searchValue" => { + :content! => condition[:value].map(&:to_record), + '@internalId' => condition[:value].map(&:internal_id), + '@xsi:type' => 'platformCore:RecordRef', + '@type' => 'account' + } + } else h[element_name] = { "platformCore:searchValue" => condition[:value]
Handle anyOf searches outside the customFieldList and join context
NetSweet_netsuite
train
rb
20a1ad5f521f1245ffc509f1f032441963041e96
diff --git a/km3pipe/pumps/daq.py b/km3pipe/pumps/daq.py index <HASH>..<HASH> 100644 --- a/km3pipe/pumps/daq.py +++ b/km3pipe/pumps/daq.py @@ -47,7 +47,10 @@ class DAQPump(Pump): except struct.error: raise StopIteration - data_type = DATA_TYPES[preamble.data_type] + try: + data_type = DATA_TYPES[preamble.data_type] + except KeyError: + data_type = 'Unknown' blob = Blob() blob[data_type] = None
Handle exception if data type is unknown
tamasgal_km3pipe
train
py
fd06f8637d3c98489ac8a95261f43a66049d2445
diff --git a/tests/ember_debug/object-inspector-test.js b/tests/ember_debug/object-inspector-test.js index <HASH>..<HASH> 100644 --- a/tests/ember_debug/object-inspector-test.js +++ b/tests/ember_debug/object-inspector-test.js @@ -772,14 +772,8 @@ module('Ember Debug - Object Inspector', function (hooks) { 'Correctly merges properties' ); - const hasChildren = A(message.details[3].properties).findBy( - 'name', - 'hasChildren' - ); - const expensiveProperty = A(message.details[3].properties).findBy( - 'name', - 'expensiveProperty' - ); + const hasChildren = message.details[3].properties.find((p) => p.name === 'hasChildren'); + const expensiveProperty = message.details[3].properties.find((p) => p.name === 'expensiveProperty'); assert.equal(hasChildren.name, 'hasChildren'); assert.equal( expensiveProperty.name,
Update tests/ember_debug/object-inspector-test.js
emberjs_ember-inspector
train
js
e24934bcef5a1956199751215e8562eac73f4b63
diff --git a/packages/create-razzle-app/templates/default/src/index.js b/packages/create-razzle-app/templates/default/src/index.js index <HASH>..<HASH> 100644 --- a/packages/create-razzle-app/templates/default/src/index.js +++ b/packages/create-razzle-app/templates/default/src/index.js @@ -19,7 +19,7 @@ if (module.hot) { const noErrors = () => { try { - require('./server.js').default; + require('./server').default; } catch (error) { console.error(error); return false;
cleanup: remove .js extensions from require
jaredpalmer_razzle
train
js
da3a8617efb59f7aff51240fd3b016f40f54dcd6
diff --git a/src/Routing/Route/Route.php b/src/Routing/Route/Route.php index <HASH>..<HASH> 100644 --- a/src/Routing/Route/Route.php +++ b/src/Routing/Route/Route.php @@ -265,8 +265,6 @@ class Route */ public function parse($url) { - $request = Router::getRequest(true) ?: Request::createFromGlobals(); - if (empty($this->_compiledRoute)) { $this->compile(); } @@ -277,6 +275,7 @@ class Route } if (isset($this->defaults['_method'])) { + $request = Router::getRequest(true) ?: Request::createFromGlobals(); $method = $request->env('REQUEST_METHOD'); if (!in_array($method, (array)$this->defaults['_method'], true)) { return false;
Micro-optimization in route parsing. Save a few function calls when parsing routes. Only fetch the request when we actually need it.
cakephp_cakephp
train
php
1026d11524ef4b576a1efe74a7efba4bf9f7560d
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -29,6 +29,14 @@ var deep = { } }; +test('missing arguments', function (t) { + t.deepEqual(extend(undefined, { a: 1 }), { a: 1 }, 'missing first argument is second argument'); + t.deepEqual(extend({ a: 1 }), { a: 1 }, 'missing second argument is first argument'); + t.deepEqual(extend(true, undefined, { a: 1 }), { a: 1 }, 'deep: missing first argument is second argument'); + t.deepEqual(extend(true, { a: 1 }), { a: 1 }, 'deep: missing second argument is first argument'); + t.deepEqual(extend(), {}, 'no arguments is object'); + t.end(); +}); test('merge string with string', function (t) { var ori = 'what u gonna say';
Adding test cases for missing arguments.
justmoon_node-extend
train
js
a286f044ef041523fb5df6b1ce9dd5b2b11690ca
diff --git a/jquery.flot.js b/jquery.flot.js index <HASH>..<HASH> 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -2544,13 +2544,8 @@ Licensed under the MIT license. // fill the bar if (fillStyleCallback) { - c.beginPath(); - c.moveTo(left, bottom); - c.lineTo(left, top); - c.lineTo(right, top); - c.lineTo(right, bottom); c.fillStyle = fillStyleCallback(bottom, top); - c.fill(); + c.fillRect(left, top, right - left, bottom - top) } // draw outline
Draw bars using fillRect instead of paths. This is up to 2x faster and appears to work around issues in Chrome's canvas implementation that sometimes result in bars not being filled. Resolves #<I>.
ni-kismet_engineering-flot
train
js
3922f7d3825bade9f9c08953f8e4819cf0048930
diff --git a/trace/agent.js b/trace/agent.js index <HASH>..<HASH> 100644 --- a/trace/agent.js +++ b/trace/agent.js @@ -139,7 +139,7 @@ Agent.prototype.setupNewSpan = function setupNewSpan(options) { parentSpan = self.getCurrentSpan(); } else { parentSpan = options.parentSpan; - if (options.outgoing) { + if (options.outgoing && !parentSpan && !options.topLevelRequest) { self.logger.warn("TChannel tracer: parent span not specified " + "for outgoing request!", options); }
trace: allowing parentSpan warning to be ignored
uber_tchannel-node
train
js
5fb71ae0a373b2bccb4d094443276eb296d3d0c8
diff --git a/src/System/SysProperties.php b/src/System/SysProperties.php index <HASH>..<HASH> 100644 --- a/src/System/SysProperties.php +++ b/src/System/SysProperties.php @@ -82,4 +82,15 @@ class SysProperties { } return $ini; } + + /** + * @return int + * @throws FileNotFoundException + * @throws InvalidPropertyStructureException + * @throws NoPathException + */ + public function size(): int { + $properties = $this->getProperties(); + return \count($properties); + } } \ No newline at end of file
size method in SysProperties
doganoo_PHPUtil
train
php
5a39c90d82ca47bbe508e8200bb052a031c8a30e
diff --git a/scripts/babel-relay-plugin/src/GraphQLPrinter.js b/scripts/babel-relay-plugin/src/GraphQLPrinter.js index <HASH>..<HASH> 100644 --- a/scripts/babel-relay-plugin/src/GraphQLPrinter.js +++ b/scripts/babel-relay-plugin/src/GraphQLPrinter.js @@ -10,12 +10,12 @@ var util = require('util'); * This is part of the Babel transform to convert embedded GraphQL RFC to * JavaScript. It converts from GraphQL AST to a string of JavaScript code. */ -function RQLPrinter2(schema, rqlFunctionName) { +function GraphQLPrinter(schema, rqlFunctionName) { this.rqlFunctionName = rqlFunctionName; this.schema = schema; } -RQLPrinter2.prototype.getCode = function(ast, substitutions) { +GraphQLPrinter.prototype.getCode = function(ast, substitutions) { var options = { rqlFunctionName: this.rqlFunctionName, schema: this.schema, @@ -724,4 +724,4 @@ function getSelections(node) { return []; } -module.exports = RQLPrinter2; +module.exports = GraphQLPrinter;
Rename GraphQLPrinter internal functions
facebook_relay
train
js
43b58b0fa0193d2172e1d5ef8c1db6e2a076ef42
diff --git a/components/Migrate-Packages/ui/wizard.php b/components/Migrate-Packages/ui/wizard.php index <HASH>..<HASH> 100644 --- a/components/Migrate-Packages/ui/wizard.php +++ b/components/Migrate-Packages/ui/wizard.php @@ -12,7 +12,7 @@ <?php echo PodsForm::field( '_wpnonce', wp_create_nonce( 'pods-component-' . $component . '-' . $method ), 'hidden' ); ?> <?php echo PodsForm::field( 'import_export', 'export', 'hidden' ); ?> - <h2 class="italicized"><?php _e( 'Import Pods 1.x Packages', 'pods' ); ?></h2> + <h2 class="italicized"><?php _e( 'Migrate: Packages', 'pods' ); ?></h2> <img src="<?php echo PODS_URL; ?>ui/images/pods-logo-notext-rgb-transparent.png" class="pods-leaf-watermark-right" />
Tweak heading text for new Packages component
pods-framework_pods
train
php
2dddcef1bebff3ea316c99f8cee57c4612f6d928
diff --git a/library/src/main/java/com/github/clans/fab/FloatingActionMenu.java b/library/src/main/java/com/github/clans/fab/FloatingActionMenu.java index <HASH>..<HASH> 100755 --- a/library/src/main/java/com/github/clans/fab/FloatingActionMenu.java +++ b/library/src/main/java/com/github/clans/fab/FloatingActionMenu.java @@ -862,6 +862,19 @@ public class FloatingActionMenu extends ViewGroup { mButtonsCount--; } + public void addMenuButton(FloatingActionButton fab, int index) { + int size = mButtonsCount - 2; + if (index < 0) { + index = 0; + } else if (index > size) { + index = size; + } + + addView(fab, index); + mButtonsCount++; + addLabel(fab); + } + public void removeAllMenuButtons() { close(true);
Added option to add button to the menu at position. Closes #<I>.
Clans_FloatingActionButton
train
java
1b1903bc0b60d3e685a706206440a5ad2cc4d82b
diff --git a/pysle/isletool.py b/pysle/isletool.py index <HASH>..<HASH> 100644 --- a/pysle/isletool.py +++ b/pysle/isletool.py @@ -202,9 +202,9 @@ def _prepRESearchStr(matchStr, wordInitial='ok', wordFinal='ok', matchStr = matchStr.replace(charB, charA) # Replace special characters - replDict = {"D": u"[tdsz]", # dentals + replDict = {"D": u"(?:t(?!ʃ)|d(?!ʒ)|[sz])", # dentals "F": u"[ʃʒfvszɵðh]", # fricatives - "S": u"[pbtdkg]", # stops + "S": u"(?:t(?!ʃ)|d(?!ʒ)|[pbkg])", # stops "N": u"[nmŋ]", # nasals "R": u"[rɝɚ]", # rhotics "V": u"(?:aʊ|ei|oʊ|ɑɪ|ɔi|[iuæɑɔəɛɪʊʌ]):?", # vowels
BUGFIX: Dental and Stop special keys don't match multichar sounds like tʃ So 't' will be matched but not 'tʃ'
timmahrt_pysle
train
py
95b74bd9efee7e3c63e08bb9f983cfdec72c3cb2
diff --git a/lib/Cake/Controller/ComponentCollection.php b/lib/Cake/Controller/ComponentCollection.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Controller/ComponentCollection.php +++ b/lib/Cake/Controller/ComponentCollection.php @@ -55,6 +55,16 @@ class ComponentCollection extends ObjectCollection implements CakeEventListener } /** + * Set the controller associated with the collection. + * + * @param Controller $Controller Controller to set + * @return void + */ + public function setController(Controller $Controller) { + $this->_Controller = $Controller; + } + +/** * Get the controller associated with the collection. * * @return Controller Controller instance diff --git a/lib/Cake/TestSuite/ControllerTestCase.php b/lib/Cake/TestSuite/ControllerTestCase.php index <HASH>..<HASH> 100644 --- a/lib/Cake/TestSuite/ControllerTestCase.php +++ b/lib/Cake/TestSuite/ControllerTestCase.php @@ -334,6 +334,7 @@ abstract class ControllerTestCase extends CakeTestCase { $request = $this->getMock('CakeRequest'); $response = $this->getMock('CakeResponse', array('_sendHeader')); $controllerObj->__construct($request, $response); + $controllerObj->Components->setController($controllerObj); $config = ClassRegistry::config('Model'); foreach ($mocks['models'] as $model => $methods) {
Make sure ComponentCollection has the controller dependency. Add setter method as changing ComponentCollection's constructor now is not possible. This fixes issues where components that rely on Collection->getController() in their constructor can work properly. Fixes #<I>
cakephp_cakephp
train
php,php
0e8b4a121201c3ed5677d7440d4e8d85ad399fcd
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -6,6 +6,9 @@ Bundler.require(*Rails.groups) # require the engine being tested. In a non-dummy app this would be handled by the engine's gem being in the Gemfile # for real app and Bundler.require requiring the gem. require 'metasploit_data_models' +require 'metasploit_data_models/engine' +require 'metasploit/concern/engine' +require 'metasploit/model/engine' module Dummy class Application < Rails::Application
Add the proper engine requires to the dummy app MSP-<I>
rapid7_metasploit_data_models
train
rb
d702f7d265d92e312f152f03ff2b436b6d4f9492
diff --git a/jsonschema/cli.py b/jsonschema/cli.py index <HASH>..<HASH> 100644 --- a/jsonschema/cli.py +++ b/jsonschema/cli.py @@ -77,7 +77,7 @@ def main(args=sys.argv[1:]): def run(arguments, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin): - error_delimiter = "———|ERROR|—————————————————————————\n" + error_delimiter = "===[ERROR]====================================\n" error_format = arguments["error_format"] validator = arguments["validator"](schema=arguments["schema"])
[CLI] Remove incompatible character, replaced by '='
Julian_jsonschema
train
py
0ab9ffef9ed47529bf9debc13e20ed5b80041623
diff --git a/code/SubsitesVirtualPage.php b/code/SubsitesVirtualPage.php index <HASH>..<HASH> 100644 --- a/code/SubsitesVirtualPage.php +++ b/code/SubsitesVirtualPage.php @@ -11,6 +11,7 @@ class SubsitesVirtualPage extends VirtualPage { $fields = parent::getCMSFields(); $subsites = DataObject::get('Subsite'); + if(!$subsites) $subsites = new DataObjectSet(); $subsites->push(new ArrayData(array('Title' => 'Main site', 'ID' => 0))); $subsiteSelectionField = new DropdownField(
MINOR: Don't throw an error if no subsites are defined. (from r<I>)
silverstripe_silverstripe-subsites
train
php
aebe4413e6b7bca0c5c9c61865191f34b5bb7df1
diff --git a/subnuker.py b/subnuker.py index <HASH>..<HASH> 100644 --- a/subnuker.py +++ b/subnuker.py @@ -12,7 +12,7 @@ Python package. """ __program__ = 'subnuker' -__version__ = '0.3' +__version__ = '0.4' # --- BEGIN CODE --- #
Bump up to version <I> (so that the changes can be uploaded to PyPi)
brbsix_subnuker
train
py
2b3a4d4ead8f15568114f037d1171ead7d433d41
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ setup( "fabric>=1.8.0,<1.11.0", "PyYAML<4.0.0", "requests-futures>0.9.0", - "kafka-python==1.3.2", + "kafka-python>=1.3.2,<1.4.0", "requests<3.0.0", 'retrying' ],
Update kafka-python requirement in kafka utils Let's not pin it down to an exact version so it is compatible with post version from our kafka-python fork
Yelp_kafka-utils
train
py
186c9148a83fb62b16bd46d25a68064a3ac044ab
diff --git a/lib/weary/resource.rb b/lib/weary/resource.rb index <HASH>..<HASH> 100644 --- a/lib/weary/resource.rb +++ b/lib/weary/resource.rb @@ -9,11 +9,11 @@ module Weary def initialize(method, uri) @method = method - @uri = Addressable::Template.new(uri) + self.url uri end def url(uri=nil) - @uri = Addressable::Template.new(uri) unless uri.nil? + @uri = Addressable::Template.new(uri.gsub(/:(\w+)/) { "{#{$1}}" }) unless uri.nil? @uri end diff --git a/spec/weary/resource_spec.rb b/spec/weary/resource_spec.rb index <HASH>..<HASH> 100644 --- a/spec/weary/resource_spec.rb +++ b/spec/weary/resource_spec.rb @@ -20,6 +20,18 @@ describe Weary::Resource do resource.url url resource.url.pattern.should eql url end + + it "accepts variables in the url" do + url = "http://github.com/api/v2/json/repos/show/{user}/{repo}" + resource = Weary::Resource.new "GET", url + resource.url.variables.should include 'user' + end + + it "accepts variables in the sinatra style" do + url = "http://github.com/api/v2/json/repos/show/:user/:repo" + resource = Weary::Resource.new "GET", url + resource.url.variables.should include 'user' + end end describe "#optional" do
Allow Sinatra-style url variables in resource paths
mwunsch_weary
train
rb,rb
b9d81695c1ba45dc00b7804628726f3313fa035c
diff --git a/lib/librarian/resolver/implementation.rb b/lib/librarian/resolver/implementation.rb index <HASH>..<HASH> 100644 --- a/lib/librarian/resolver/implementation.rb +++ b/lib/librarian/resolver/implementation.rb @@ -65,8 +65,7 @@ module Librarian dependencies << dependency scope_resolving_dependency dependency do related_dependencies = dependencies.select{|d| d.name == dependency.name} - debug { "Checking manifests" } - scope do + scope_checking_manifests do resolution = nil dependency.manifests.each do |manifest| break if resolution @@ -110,6 +109,13 @@ module Librarian resolution end + def scope_checking_manifests + debug { "Checking manifests" } + scope do + yield + end + end + def scope @level += 1 yield
Move some scope work into a helper method in the resolver impl.
applicationsonline_librarian
train
rb
d07d423d4f26ad56ba82440c935e9c625541004b
diff --git a/ontrack-web/src/app/view/view.search.js b/ontrack-web/src/app/view/view.search.js index <HASH>..<HASH> 100644 --- a/ontrack-web/src/app/view/view.search.js +++ b/ontrack-web/src/app/view/view.search.js @@ -9,7 +9,7 @@ angular.module('ot.view.search', [ controller: 'SearchCtrl' }); }) - .controller('SearchCtrl', function ($stateParams, $scope, $http, ot) { + .controller('SearchCtrl', function ($location, $stateParams, $scope, $http, ot) { // Search token $scope.token = $stateParams.token; @@ -23,6 +23,10 @@ angular.module('ot.view.search', [ ot.pageCall($http.post('search', {token: $scope.token})).then(function (results) { $scope.searchDone = true; $scope.results = results; + // If only one result, switches directly to the correct page + if (results.length == 1) { + $location.path(results[0].hint); + } }); })
Search: redirect to the page in case of only one result
nemerosa_ontrack
train
js
219c79e726bdae6a99064f06cc07856153b1328b
diff --git a/rpcserver.go b/rpcserver.go index <HASH>..<HASH> 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -718,10 +718,8 @@ func (r *rpcServer) ListChannels(ctx context.Context, // With the channel point known, retrieve the network channel // ID from the database. - chanID, err := graph.ChannelID(chanPoint) - if err != nil { - return nil, err - } + var chanID uint64 + chanID, _ = graph.ChannelID(chanPoint) channel := &lnrpc.ActiveChannel{ RemotePubkey: nodeID,
rpcserver: don't error out in ListChannels if unable to retrieve chanID
lightningnetwork_lnd
train
go
8ca3d59e37eb0501f709554d31bfb986db5349a8
diff --git a/kmip/__init__.py b/kmip/__init__.py index <HASH>..<HASH> 100644 --- a/kmip/__init__.py +++ b/kmip/__init__.py @@ -17,6 +17,7 @@ import logging.config import os import re import sys +import warnings # Dynamically set __version__ version_path = os.path.join(os.path.dirname( @@ -63,3 +64,11 @@ else: logging.basicConfig() __all__ = ['core', 'demos', 'services'] + +if sys.version_info[:2] == (2, 6): + warnings.simplefilter("always") + warnings.warn( + ("Please use a newer version of Python (2.7.9+ preferred). PyKMIP " + "support for Python 2.6 will be abandoned in the future."), + PendingDeprecationWarning) + warnings.simplefilter("default")
Adding pending deprecation warning for Python<I> This change add a simple warning that is triggered whenever Python <I> is used with PyKMIP. It simply advises the user to use a newer version of Python. For now, Python <I> can still be used with PyKMIP.
OpenKMIP_PyKMIP
train
py
61eb3ed63c1d004d8dbdf11f8f7080672b6a9886
diff --git a/lib/adminable/resource.rb b/lib/adminable/resource.rb index <HASH>..<HASH> 100644 --- a/lib/adminable/resource.rb +++ b/lib/adminable/resource.rb @@ -28,7 +28,7 @@ module Adminable end def ==(other) - name == other.name + other.is_a?(Adminable::Resource) && name == other.name end end end
Add check for class for resource == method
droptheplot_adminable
train
rb
549ceae0d581da162dabdb90dfc92b74283a1b97
diff --git a/admin/langdoc.php b/admin/langdoc.php index <HASH>..<HASH> 100755 --- a/admin/langdoc.php +++ b/admin/langdoc.php @@ -33,6 +33,9 @@ admin_externalpage_print_header(); + notify('NOTICE: This interface is obsolete now and will be removed. You should use + improved <a href="lang.php?mode=helpfiles">lang.php</a> interface.'); + $currentlang = current_language(); $langdir = "$CFG->dataroot/lang/$currentlang"; $enlangdir = "$CFG->dirroot/lang/en_utf8";
MDL-<I> Merged from stable. Print an obsolete message.
moodle_moodle
train
php
a7144d10258068d4c375e80484297ca8f075bbd2
diff --git a/packer/rpc/muxconn.go b/packer/rpc/muxconn.go index <HASH>..<HASH> 100644 --- a/packer/rpc/muxconn.go +++ b/packer/rpc/muxconn.go @@ -146,6 +146,8 @@ func (m *MuxConn) Accept(id uint32) (io.ReadWriteCloser, error) { // Dial opens a connection to the remote end using the given stream ID. // An Accept on the remote end will only work with if the IDs match. func (m *MuxConn) Dial(id uint32) (io.ReadWriteCloser, error) { + log.Printf("[TRACE] %p: Dial on stream ID: %d", m, id) + m.muDial.Lock() // If we have any streams with this ID, then it is a failure. The
packer/rpc: a little more logging
hashicorp_packer
train
go
535464b247cabb78aed25cd0df4751322db081e3
diff --git a/pkg/bgpv1/gobgp/workdiff.go b/pkg/bgpv1/gobgp/workdiff.go index <HASH>..<HASH> 100644 --- a/pkg/bgpv1/gobgp/workdiff.go +++ b/pkg/bgpv1/gobgp/workdiff.go @@ -88,9 +88,9 @@ func (wd *reconcileDiff) empty() bool { // since registerOrReconcileDiff populates the `seen` field of a diff, this method should always // be called first when computing a reconcileDiff. func (wd *reconcileDiff) registerOrReconcileDiff(m LocalASNMap, policy *v2alpha1api.CiliumBGPPeeringPolicy) error { - for _, config := range policy.Spec.VirtualRouters { + for i, config := range policy.Spec.VirtualRouters { if _, ok := wd.seen[config.LocalASN]; !ok { - wd.seen[config.LocalASN] = &config + wd.seen[config.LocalASN] = &policy.Spec.VirtualRouters[i] } else { return fmt.Errorf("encountered duplicate local ASNs") }
bgp-cp: fix taking address of of loop variable this commit fixes a bug in computing a work diff when reconciliating BGP virtual routers. this bug would take an address of the loop variable and store this which is not the correct reference when utilized later. to fix this, just take the address of the slice's index.
cilium_cilium
train
go
4d1e2d351832a9bfc6ee380a2aeef9e61adbf378
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -324,7 +324,7 @@ func (c *Client) doRequest(req *http.Request, emptyResponse bool) (interface{}, var values []interface{} for { values = append(values, responsePaginated.Values...) - if responsePaginated.Pagelen == 0 || responsePaginated.Size/responsePaginated.Pagelen <= responsePaginated.Page { + if len(responsePaginated.Next) == 0 { break } newReq, err := http.NewRequest(req.Method, responsePaginated.Next, nil) @@ -336,6 +336,8 @@ func (c *Client) doRequest(req *http.Request, emptyResponse bool) (interface{}, if err != nil { return resBody, err } + + responsePaginated = &Response{} json.NewDecoder(resp).Decode(responsePaginated) } responsePaginated.Values = values
Don't reuse response struct for multiple requests (#<I>) A fix was added in <URL>). The actual problem was that the `responsePaginated` variable was being reused in the loop, and the json decoder doesn't overwrite fields that aren't present in the response, so it was the `Next` field would end up with the value from the previous page, causing the same page to be requested forever.
ktrysmt_go-bitbucket
train
go
96f74293028da9b80cc9301a743e2908e858998c
diff --git a/src/Database/Rules.php b/src/Database/Rules.php index <HASH>..<HASH> 100644 --- a/src/Database/Rules.php +++ b/src/Database/Rules.php @@ -54,6 +54,9 @@ class Rules { if (array_key_exists($k, $rules)) { + // (Re)set rule variable + $rule = null; + if (is_callable($rules[$k])) { if ($error = call_user_func_array($rules[$k], [$data]))
Reset rule var to prevent false positives when looping
hubzero_framework
train
php
6f36566e8f34b7c140e34567c8ba9e4ece9899b5
diff --git a/aiortc/contrib/media.py b/aiortc/contrib/media.py index <HASH>..<HASH> 100644 --- a/aiortc/contrib/media.py +++ b/aiortc/contrib/media.py @@ -12,6 +12,29 @@ from ..mediastreams import AUDIO_PTIME, MediaStreamError, MediaStreamTrack logger = logging.getLogger('media') +REAL_TIME_FORMATS = [ + 'alsa', + 'android_camera', + 'avfoundation', + 'bktr', + 'decklink', + 'dshow', + 'fbdev', + 'gdigrab', + 'iec61883', + 'jack', + 'kmsgrab', + 'openal', + 'oss', + 'pulse', + 'sndio', + 'rtsp', + 'v4l2', + 'vfwcap', + 'x11grab', +] + + async def blackhole_consume(track): while True: try: @@ -197,8 +220,7 @@ class MediaPlayer: # check whether we need to throttle playback container_format = set(self.__container.format.name.split(',')) - self._throttle_playback = not container_format.intersection([ - 'avfoundation', 'dshow', 'rtsp', 'v4l2', 'vfwcap']) + self._throttle_playback = not container_format.intersection(REAL_TIME_FORMATS) @property def audio(self):
[media player] list more real-time acquisition sources
aiortc_aiortc
train
py
11951743bd8071b9115f711daa4b9da752dccd2c
diff --git a/go/libkb/check_tracking.go b/go/libkb/check_tracking.go index <HASH>..<HASH> 100644 --- a/go/libkb/check_tracking.go +++ b/go/libkb/check_tracking.go @@ -4,9 +4,12 @@ package libkb func CheckTracking(g *GlobalContext) error { - // LoadUser automatically fires off UserChanged notifications when it - // discovers new track or untrack chain links. - arg := NewLoadUserArg(g).WithAbortIfSigchainUnchanged() - _, err := LoadMe(arg) + // If we load a UPAK with the ForcePoll(true) flag, we're going to + // check our local UPAK against the live Merkle tree. On the case of + // a fresh UPAK, then no op. On the case of a stale UPAK then we trigger + // a LoadUser, which will send UserChanged as it refreshes. + m := NewMetaContextBackground(g) + arg := NewLoadUserArgWithMetaContext(m).WithUID(m.CurrentUID()).WithSelf(true).WithForcePoll(true) + _, _, err := g.GetUPAKLoader().LoadV2(arg) return err }
use UPAK loads in hourly check tracking (#<I>) * use UPAK loads in hourly check tracking * fix it
keybase_client
train
go
e5b87f61732ac9d9d04ea9c3cb2daa42fd195329
diff --git a/src/util/browser.js b/src/util/browser.js index <HASH>..<HASH> 100644 --- a/src/util/browser.js +++ b/src/util/browser.js @@ -17,7 +17,7 @@ export let safari = /Apple Computer/.test(navigator.vendor) export let mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent) export let phantom = /PhantomJS/.test(userAgent) -export let ios = !edge && /AppleWebKit/.test(userAgent) && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2) +export let ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2) export let android = /Android/.test(userAgent) // This is woefully incomplete. Suggestions for alternative methods welcome. export let mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
Try to refine iPadOS/iOS detection Issue #<I>
codemirror_CodeMirror
train
js
6935654da23ead63cf4734a149a26b93fc9a14cd
diff --git a/Kwc/Form/Component.php b/Kwc/Form/Component.php index <HASH>..<HASH> 100644 --- a/Kwc/Form/Component.php +++ b/Kwc/Form/Component.php @@ -137,7 +137,7 @@ class Kwc_Form_Component extends Kwc_Abstract_Composite_Component $this->_postData = $postData; if (isset($postData[$this->getData()->componentId])) { ignore_user_abort(true); - $this->_errors = array_merge($this->_errors, $this->_form->validate(null, $postData)); + $this->_errors = array_merge($this->_errors, $this->_validate($postData)); if (!$this->_errors) { try { $this->_form->prepareSave(null, $postData); @@ -181,6 +181,12 @@ class Kwc_Form_Component extends Kwc_Abstract_Composite_Component } } + //can be overriden to implement custom validation logic + protected function _validate($postData) + { + return $this->_form->validate(null, $postData); + } + //can be overriden to *not* log specific exceptions or adapt error protected function _handleProcessException(Exception $e) {
Move logic to get error-messages from separate function This way it's possible to generate error-messages in Kwc_Form_Component
koala-framework_koala-framework
train
php
bd19d67e5826d00042084238ab35bb0c9aa1d419
diff --git a/test/eth/Cdp.spec.js b/test/eth/Cdp.spec.js index <HASH>..<HASH> 100644 --- a/test/eth/Cdp.spec.js +++ b/test/eth/Cdp.spec.js @@ -225,7 +225,7 @@ const sharedTests = (openCdp, proxy = false) => { await promiseWait(1100); await cdpService._drip(); //drip() updates _rhi and thus all cdp fees - nonceService._counts[proxyAccount] = transactionCount; + nonceService._counts[currentAccount] = transactionCount; }); afterEach(async () => { @@ -327,6 +327,7 @@ const sharedTests = (openCdp, proxy = false) => { }); test('wipe debt with non-zero stability fee', async () => { + // if (!proxy) nonceService._counts[currentAccount] -= 1; const mkr = cdpService.get('token').getToken(MKR); const debt1 = await cdp.getDebtValue(); const balance1 = await mkr.balanceOf(currentAccount); @@ -433,7 +434,7 @@ describe('non-proxy cdp', () => { }); }); -describe.only('proxy cdp', () => { +describe('proxy cdp', () => { let ethToken; beforeAll(async () => {
Fix side effects in non-proxy tests
makerdao_dai.js
train
js
d28a96f5460c3d9ca42449710464e1e7582cb1e9
diff --git a/lib/aruba/platforms/announcer.rb b/lib/aruba/platforms/announcer.rb index <HASH>..<HASH> 100644 --- a/lib/aruba/platforms/announcer.rb +++ b/lib/aruba/platforms/announcer.rb @@ -196,37 +196,6 @@ module Aruba nil end - - # @deprecated - def stdout(content) - warn('The announcer now has a new api to activate channels. Please use this one: announce(:stdout, message)') - announce :stdout, content - end - - # @deprecated - def stderr(content) - warn('The announcer now has a new api to activate channels. Please use this one: announce(:stderr, message)') - announce :stderr, content - end - - # @deprecated - def dir(dir) - warn('The announcer now has a new api to activate channels. Please use this one announce(:directory, message)') - announce :directory, dir - end - - # @deprecated - def cmd(cmd) - warn('The announcer now has a new api to activate channels. Please use this one announce(:command, message)') - announce :command, cmd - end - - # @deprecated - def env(name, value) - warn('The announcer now has a new api to activate channels. Please use this one: announce(:changed_environment, key, value)') - - announce :changed_environment, name, value - end end end end
Remove deprecated method from Announcer
cucumber_aruba
train
rb
975a480ef45b322c687064d2efbc857bd543decd
diff --git a/tests/test_transformer.py b/tests/test_transformer.py index <HASH>..<HASH> 100644 --- a/tests/test_transformer.py +++ b/tests/test_transformer.py @@ -180,4 +180,4 @@ class TransformerTest(TestCase): ) with patcher: response = CustomProxyView.as_view(html5=True)(request, '/') - self.assertIn('<!DOCTYPE html>', response.content) + self.assertIn(b'<!DOCTYPE html>', response.content)
Updated html5 transform test to support python3
TracyWebTech_django-revproxy
train
py
b8462283ad876430579208f89e95817066f037c8
diff --git a/lib/roxml/xml.rb b/lib/roxml/xml.rb index <HASH>..<HASH> 100644 --- a/lib/roxml/xml.rb +++ b/lib/roxml/xml.rb @@ -200,7 +200,7 @@ module ROXML value.each do |v| xml.child_add(v.to_xml(name)) end - elsif value.respond_to? :tag_refs + elsif value.is_a?(ROXML) xml.child_add(value.to_xml(name)) else node = XML::Node.new_element(name)
Cleaner way of differentiating between ROXML and self-defined #to_xml types
Empact_roxml
train
rb
4704beea52fbd56f29b60bb09064a2c0bdd19d04
diff --git a/napalm_junos/junos.py b/napalm_junos/junos.py index <HASH>..<HASH> 100644 --- a/napalm_junos/junos.py +++ b/napalm_junos/junos.py @@ -535,7 +535,7 @@ class JunOSDriver(NetworkDriver): if 'router_id' not in bgp_neighbor_data[instance_name]: # we only need to set this once bgp_neighbor_data[instance_name]['router_id'] = \ - py23_compat.text_type(neighbor_details['local_id']) + py23_compat.text_type(neighbor_details.get('local_id', '')) peer = { key: self._parse_value(value) for key, value in neighbor_details.items()
FIXES #<I>, no exception for missing local_id key
napalm-automation_napalm
train
py
21a577b06610ef8412b2937c5ca26cd3e7bcb021
diff --git a/src/lib/server/index.js b/src/lib/server/index.js index <HASH>..<HASH> 100644 --- a/src/lib/server/index.js +++ b/src/lib/server/index.js @@ -21,7 +21,7 @@ app.use(compression()); addProxies(app, config.proxies); if (isProduction) { - app.use("/assets", express.static("build")); + app.use("/assets", express.static("build", { maxAge: 315360000 } )); logger.info("Server side rendering server running"); } else {
update max age now that we include file hashes
TrueCar_gluestick
train
js
3a2f6659a6a06e9b37ae40e04e3a4c9192b69d35
diff --git a/src/diagrams/class/classDb.js b/src/diagrams/class/classDb.js index <HASH>..<HASH> 100644 --- a/src/diagrams/class/classDb.js +++ b/src/diagrams/class/classDb.js @@ -163,7 +163,7 @@ export const cleanupLabel = function (label) { if (label.substring(0, 1) === ':') { return common.sanitizeText(label.substr(1).trim(), configApi.getConfig()); } else { - return label.trim(); + return sanitizeText(label.trim()); } };
fix: one more sanitization
knsv_mermaid
train
js
b95586562a133b788e256979fd1552ed686c92e7
diff --git a/photutils/segmentation/deblend.py b/photutils/segmentation/deblend.py index <HASH>..<HASH> 100644 --- a/photutils/segmentation/deblend.py +++ b/photutils/segmentation/deblend.py @@ -224,11 +224,8 @@ def _deblend_source(data, segment_img, npixels, nlevels=32, contrast=0.001, raise ValueError('Invalid connectivity={0}. ' 'Options are 4 or 8'.format(connectivity)) - # Work on a copy of the data to avoid modifying the input image - data = data.copy() segm_mask = (segment_img.data > 0) source_values = data[segm_mask] - data[~segm_mask] = 0 source_min = np.min(source_values) source_max = np.max(source_values) if source_min == source_max: @@ -255,9 +252,10 @@ def _deblend_source(data, segment_img, npixels, nlevels=32, contrast=0.001, # create top-down tree of local peaks segm_tree = [] + mask = ~segm_mask for level in thresholds[::-1]: segm_tmp = detect_sources(data, level, npixels=npixels, - connectivity=connectivity) + connectivity=connectivity, mask=mask) if segm_tmp.nlabels >= 2: fluxes = [] for i in segm_tmp.labels:
Use the new mask keyword for detect_sources
astropy_photutils
train
py
ce387ea8f2df3141e884305ac3ff50e1b8ed8f15
diff --git a/lib/hatchet/logger.rb b/lib/hatchet/logger.rb index <HASH>..<HASH> 100644 --- a/lib/hatchet/logger.rb +++ b/lib/hatchet/logger.rb @@ -5,14 +5,13 @@ module Hatchet # Internal: Class that handles logging calls and distributes them to all its # appenders. # - # Each logger has 6 methods. Those are, in decreasing order of severity: + # Each logger has 5 methods. Those are, in decreasing order of severity: # # * fatal # * error # * warn # * info # * debug - # * trace # # All the methods have the same signature. You can either provide a message as # a direct string, or as a block to the method is lazily evaluated (this is @@ -38,7 +37,7 @@ module Hatchet @appenders = appenders end - [:trace, :debug, :info, :warn, :error, :fatal].each do |level| + [:debug, :info, :warn, :error, :fatal].each do |level| # Public: Logs a message at the given level. # @@ -76,7 +75,6 @@ module Hatchet # * warn # * info # * debug - # * trace # # message - The message that will be logged by an appender when it is # configured to log at the given level or lower.
Removed additional mentions of a trace level
gshutler_hatchet
train
rb
8a01106ea432dcb68c16d866fe05643df4e41a5a
diff --git a/src/django_future/models.py b/src/django_future/models.py index <HASH>..<HASH> 100644 --- a/src/django_future/models.py +++ b/src/django_future/models.py @@ -54,8 +54,8 @@ class ScheduledJob(models.Model): def run(self): # TODO: logging? - args = self.args - kwargs = self.kwargs + args = self.args or [] + kwargs = self.kwargs or {} if '.' in self.callable_name: module_name, function_name = self.callable_name.rsplit('.', 1) module = __import__(module_name, fromlist=[function_name]) @@ -82,9 +82,9 @@ class ScheduledJob(models.Model): if content_object is None: content_object = self.content_object if args is None: - args = self.args + args = self.args or [] if kwargs is None: - kwargs = self.kwargs + kwargs = self.kwargs or {} from django_future import schedule_job return schedule_job(date, callable_name, content_object=content_object, expires=expires, args=args, kwargs=kwargs)
Make sure args and kwargs passed to the callable are correctly typed (as list and dict).
shrubberysoft_django-future
train
py
2b69f430e69ce3afac9880bfb23ce51d59442fd4
diff --git a/squad/frontend/views.py b/squad/frontend/views.py index <HASH>..<HASH> 100644 --- a/squad/frontend/views.py +++ b/squad/frontend/views.py @@ -1,8 +1,9 @@ +from django.http import HttpResponse from django.shortcuts import render def home(request): - pass + return HttpResponse('hello world') def group(request, group_slug):
/: provide an empty but successful response
Linaro_squad
train
py
cec60d39891650c96f008aadcb49c249626da3f5
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index <HASH>..<HASH> 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -26,8 +26,6 @@ module ActiveModel raw_value = value end - return if options[:allow_nil] && raw_value.nil? - unless is_number?(raw_value) record.errors.add(attr_name, :not_a_number, filtered_options(raw_value)) return
validate_each in NumericalityValidator is never called in this case. NumericalityValidator#validate_each is never called when allow_nil is true and the value is nil because it is already skipped in EachValidator#validate.
rails_rails
train
rb
173991a5059ac0ee70ac4ca6f6fad11e4dc44144
diff --git a/lib/addressable/template.rb b/lib/addressable/template.rb index <HASH>..<HASH> 100644 --- a/lib/addressable/template.rb +++ b/lib/addressable/template.rb @@ -649,7 +649,7 @@ module Addressable private def ordered_variable_defaults - @ordered_variable_defaults ||= ( + @ordered_variable_defaults ||= begin expansions, _ = parse_template_pattern(pattern) expansions.map do |capture| _, _, varlist = *capture.match(EXPRESSION) @@ -657,7 +657,7 @@ module Addressable varspec[VARSPEC, 1] end end.flatten - ) + end end
This should be a begin..end block.
sporkmonger_addressable
train
rb
0832972fa74a85b040df34cb7e00812d098a0bb9
diff --git a/src/com/google/javascript/jscomp/JSDocInfoPrinter.java b/src/com/google/javascript/jscomp/JSDocInfoPrinter.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/JSDocInfoPrinter.java +++ b/src/com/google/javascript/jscomp/JSDocInfoPrinter.java @@ -168,7 +168,7 @@ public final class JSDocInfoPrinter { // Print suppressions in sorted order to avoid non-deterministic output. String[] arr = suppressions.toArray(new String[0]); Arrays.sort(arr, Ordering.<String>natural()); - parts.add("@suppress {" + Joiner.on(',').join(Arrays.asList(arr)) + "}"); + parts.add("@suppress {" + Joiner.on(',').join(arr) + "}"); multiline = true; }
Joiners can join on arrays directly, so remove the extra conversion. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
fb3f4af3b240c763e65cc6179c760d8a6b42b6e4
diff --git a/core/src/main/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilter.java b/core/src/main/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilter.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilter.java +++ b/core/src/main/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilter.java @@ -263,8 +263,8 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean, UserDetails originalUser = null; Object obj = original.getPrincipal(); - if ((obj != null) && obj instanceof User) { - originalUser = (User) obj; + if ((obj != null) && obj instanceof UserDetails) { + originalUser = (UserDetails) obj; } // publish event
when extracting the original user, fix by referencing by the interface (UserDetail) rather than the concrete class (User)
spring-projects_spring-security
train
java
a450311936b5eb6fe23189fb1a5def311ab5ae4a
diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index <HASH>..<HASH> 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -1098,6 +1098,10 @@ class grade_category extends grade_object { * @return object grade_category instance for course grade */ function fetch_course_category($courseid) { + if (empty($courseid)) { + debugging('Missing course id!'); + return false; + } // course category has no parent if ($course_category = grade_category::fetch(array('courseid'=>$courseid, 'parent'=>null))) {
add debug code for missing course id when getting course grading category; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
2d18e1b6fb53ac8a1ea498e80b756b46bd4bc26a
diff --git a/src/guake.py b/src/guake.py index <HASH>..<HASH> 100644 --- a/src/guake.py +++ b/src/guake.py @@ -912,7 +912,6 @@ class Guake(SimpleGladeApp): box.terminal.connect('child-exited', self.on_terminal_exited, box) box.show() - pagenum = self.notebook.page_num(box) last_added = len(self.term_list) self.term_list.append(box.terminal) @@ -928,15 +927,17 @@ class Guake(SimpleGladeApp): bnt.set_property('can-focus', False) bnt.set_property('draw-indicator', False) bnt.connect('button-press-event', self.show_tab_menu) - bnt.connect('clicked', lambda *x: - self.notebook.set_current_page(pagenum)) + bnt.connect('clicked', + lambda *x: self.notebook.set_current_page( + self.notebook.page_num(box) + )) bnt.show() self.tabs.pack_start(bnt, expand=False, padding=1) self.tab_counter += 1 self.notebook.append_page(box, None) - self.notebook.set_current_page(last_added) + self.notebook.set_current_page(self.notebook.page_num(box)) self.load_config() def delete_tab(self, pagepos, kill=True):
Fixing a scope problem Caused by a "fix" made by me in a patch...
Guake_guake
train
py
9189756d328e873eaa9a4083ed1113edab41b5cc
diff --git a/protocol/signalfx/signalfxforwarder.go b/protocol/signalfx/signalfxforwarder.go index <HASH>..<HASH> 100644 --- a/protocol/signalfx/signalfxforwarder.go +++ b/protocol/signalfx/signalfxforwarder.go @@ -103,12 +103,14 @@ func NewSignalfxJSONForwarer(url string, timeout time.Duration, defaultAuthToken string, drainingThreads uint32, defaultSource string, sourceDimensions string, proxyVersion string) *Forwarder { tr := &http.Transport{ + Proxy: http.ProxyFromEnvironment, TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, MaxIdleConnsPerHost: int(drainingThreads) * 2, ResponseHeaderTimeout: timeout, Dial: func(network, addr string) (net.Conn, error) { return net.DialTimeout(network, addr, timeout) }, + TLSHandshakeTimeout: timeout, } ret := &Forwarder{ url: url,
Support HTTP_PROXY env variable for proxy use with metricproxy
signalfx_gateway
train
go
5c8fae45129c8fa52c942fe822ed2ba4c3a78782
diff --git a/cobra/core/Model.py b/cobra/core/Model.py index <HASH>..<HASH> 100644 --- a/cobra/core/Model.py +++ b/cobra/core/Model.py @@ -207,7 +207,9 @@ class Model(Object): except Exception: # pragma: no cover new._solver = copy(self.solver) # pragma: no cover - new.solution = deepcopy(self.solution) + # No use in copying it, also circular dependencies + new._timestamp_last_optimization = None + new.solution = LazySolution(self) return new def add_metabolites(self, metabolite_list):
feat: do not deepcopy solution object in model.copy() (HT @cdiener)
opencobra_cobrapy
train
py
6cd2fbb828232943f7fda3b581e203ad6c3967cc
diff --git a/jks/jks.py b/jks/jks.py index <HASH>..<HASH> 100644 --- a/jks/jks.py +++ b/jks/jks.py @@ -44,7 +44,7 @@ try: except ImportError: from io import BytesIO # python3 -__version_info__ = (17, 0, 1, 'dev') +__version_info__ = (17, 1, 0, '') __version__ = ".".join(str(x) for x in __version_info__ if str(x)) MAGIC_NUMBER_JKS = b4.pack(0xFEEDFEED) diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ from setuptools import setup, find_packages setup( name='pyjks', - version='17.0.1dev', + version='17.1.0', author="Kurt Rose, Jeroen De Ridder", author_email="kurt@kurtrose.com", description='Pure-Python Java Keystore (JKS) library',
bumping version for <I> release
kurtbrose_pyjks
train
py,py
7d87672a561986825f08104b09b6294b649a3f12
diff --git a/block.go b/block.go index <HASH>..<HASH> 100644 --- a/block.go +++ b/block.go @@ -171,11 +171,13 @@ func (b *block) write(revision uint64, w io.Writer) error { if err := writeString(w, columnType); err != nil { return err } - if err := b.offsetBuffers[i].writeTo(w); err != nil { - return err - } - if err := b.buffers[i].writeTo(w); err != nil { - return err + if len(b.buffers) != 0 { + if err := b.offsetBuffers[i].writeTo(w); err != nil { + return err + } + if err := b.buffers[i].writeTo(w); err != nil { + return err + } } } return nil
fix: index out of renge when close tx without data
kshvakov_clickhouse
train
go
18b7308b83b01466b17003b40510b766869f586f
diff --git a/lib/activeuuid/uuid.rb b/lib/activeuuid/uuid.rb index <HASH>..<HASH> 100644 --- a/lib/activeuuid/uuid.rb +++ b/lib/activeuuid/uuid.rb @@ -71,7 +71,7 @@ module ActiveUUID def uuids(*attributes) attributes.each do |attribute| - serialize "#{attribute}_id".intern, ActiveUUID::UUIDSerializer.new + serialize attribute.intern, ActiveUUID::UUIDSerializer.new #class_eval <<-eos # # def #{@association_name} # # @_#{@association_name} ||= self.class.associations[:#{@association_name}].new_proxy(self)
API Breaking Change. #uuids directive must now be explicit. this allows us to have uuid attributes that don't end in _id
jashmenn_activeuuid
train
rb
e1f4cd4adfc1cf67e0737ca3b14cf08d8195656f
diff --git a/lib/beaker-hostgenerator/data/vmpooler.rb b/lib/beaker-hostgenerator/data/vmpooler.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-hostgenerator/data/vmpooler.rb +++ b/lib/beaker-hostgenerator/data/vmpooler.rb @@ -2,7 +2,7 @@ module BeakerHostGenerator module Data module Vmpooler - OSINFO_BGHv0 = { + OSINFO = { 'arista4-32' => { 'platform' => 'eos-4-i386', 'template' => 'arista-4-i386' @@ -506,9 +506,9 @@ module BeakerHostGenerator def get_osinfo(bgh_version=0) case bgh_version when '0' - osinfo = OSINFO_BGHv0 + osinfo = OSINFO when '1' - osinfo = OSINFO_BGHv0 + osinfo = OSINFO osinfo.deep_merge! OSINFO_BGHv1 else raise "Invalid beaker-hostgenerator version: #{bgh_version}"
(QENG-<I>) Actually, don't change the original datastructure name.
puppetlabs_beaker-hostgenerator
train
rb
84ccc451842aee2fdf93472eac52324727ca36e4
diff --git a/plugins/spf.js b/plugins/spf.js index <HASH>..<HASH> 100644 --- a/plugins/spf.js +++ b/plugins/spf.js @@ -114,9 +114,10 @@ exports.hook_helo = exports.hook_ehlo = function (next, connection, helo) { exports.hook_mail = function (next, connection, params) { var plugin = this; - // For inbound message from a private IP, skip MAIL FROM check - if (!connection.relaying && connection.remote.is_private) { - return next(); + // For messages from private IP space... + if (connection.remote.is_private) { + if (!connection.relaying) return next(); + if (connection.relaying && plugin.cfg.relay.context !== 'myself') return next(); } var txn = connection.transaction;
Skip SPF check for outbound mail when context is not 'myself' (#<I>) Fixes #<I>
haraka_Haraka
train
js
57cd2e01bb8b15436f7fc83c2ba8b66c21518ef4
diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php @@ -117,7 +117,8 @@ class SchemaValidator "field " . $assoc->targetEntityName . "#" . $assoc->inversedBy . " which does not exist."; } - if ($targetMetadata->associationMappings[$assoc->mappedBy]->mappedBy == null) { + if (isset($targetMetadata->associationMappings[$assoc->mappedBy]) && + $targetMetadata->associationMappings[$assoc->mappedBy]->mappedBy == null) { $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". "bi-directional relationship, but the specified mappedBy association on the target-entity ". $assoc->targetEntityName . "#" . $assoc->mappedBy . " does not contain the required ".
DDC-<I> - Fixed a notice occuring in certain scenarios of the new Validate Schema Tool
doctrine_annotations
train
php
8bf0712ad9b0a00baf55a3142e97b5af0190b93d
diff --git a/install/class/ReadDirLoadModule.php b/install/class/ReadDirLoadModule.php index <HASH>..<HASH> 100755 --- a/install/class/ReadDirLoadModule.php +++ b/install/class/ReadDirLoadModule.php @@ -4,16 +4,19 @@ namespace BFW\Install; class ReadDirLoadModule extends ReadDirectory { + /** + * {@inheritdoc} + */ protected function fileAction($fileName, $pathToFile) { $parentAction = parent::fileAction($fileName, $pathToFile); - if ($parentAction !== '') { + if ($parentAction !== null) { return $parentAction; } - if (file_exists($pathToFile.'/bfwModulesInfos.json')) { - $this->itemList[] = $pathToFile; + if ($fileName === 'bfwModulesInfos.json') { + $this->list[] = $pathToFile; return 'break'; }
ReadDirLoadModule : Update docblock and fix on action and check file name
bfw-systems_bfw
train
php
87ca394edfe611eba7ff1d43dc9e23a331bace43
diff --git a/worker/setup.py b/worker/setup.py index <HASH>..<HASH> 100755 --- a/worker/setup.py +++ b/worker/setup.py @@ -125,15 +125,27 @@ else: 'twisted >= 8.0.0', 'future', ] + + # Unit test hard dependencies. + test_deps = [ + 'mock', + ] + + setup_args['tests_require'] = test_deps + setup_args['extras_require'] = { 'test': [ - 'mock', 'pep8', 'pylint==1.1.0', 'pyflakes', - ], + ] + test_deps, } + if '--help-commands' in sys.argv or 'trial' in sys.argv or 'test' in sys.argv: + setup_args['setup_requires'] = [ + 'setuptools_trial', + ] + if os.getenv('NO_INSTALL_REQS'): setup_args['install_requires'] = None setup_args['extras_require'] = None
set proper tests_require in worker
buildbot_buildbot
train
py
a94dfd8c9dd69f6527f102659df1fd5b9d28e408
diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/readinput.py +++ b/openquake/commonlib/readinput.py @@ -214,7 +214,9 @@ def get_mesh(oqparam): elif 'site_model' in oqparam.inputs: coords = [(param.lon, param.lat, param.depth) for param in get_site_model(oqparam)] - return geo.Mesh.from_coords(coords, from_site_model=True) + mesh = geo.Mesh.from_coords(coords, from_site_model=True) + mesh.from_site_model = True + return mesh def get_site_model(oqparam): @@ -249,7 +251,7 @@ def get_site_collection(oqparam, mesh=None, site_model_params=None): return if oqparam.inputs.get('site_model'): sitecol = [] - if mesh.from_site_model: + if getattr(mesh, 'from_site_model', False): for param in get_site_model(oqparam): pt = geo.Point(param.lon, param.lat) sitecol.append(site.Site(
Changed management of mesh.from_site_model
gem_oq-engine
train
py
11594a74b07223964604fe40c9da121315fc74a1
diff --git a/txzmq/test/test_reactor_shutdown.py b/txzmq/test/test_reactor_shutdown.py index <HASH>..<HASH> 100644 --- a/txzmq/test/test_reactor_shutdown.py +++ b/txzmq/test/test_reactor_shutdown.py @@ -3,8 +3,6 @@ Tests for L{txzmq.factory} automatic shutdown. The _z_ infix is used to have this test a last-called one. """ -from twisted.trial import unittest - from txzmq.factory import ZmqFactory from twisted.internet.test.reactormixins import ReactorBuilder
Fixes for pyflakes
smira_txZMQ
train
py
56531e8365f58e78b0e93a3408816e26398a78ca
diff --git a/src/main/java/org/dita/dost/util/Constants.java b/src/main/java/org/dita/dost/util/Constants.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dita/dost/util/Constants.java +++ b/src/main/java/org/dita/dost/util/Constants.java @@ -556,6 +556,7 @@ public final class Constants { public static final DitaClass TOPIC_FN = new DitaClass("- topic/fn "); public static final DitaClass TOPIC_FOREIGN = new DitaClass("- topic/foreign "); public static final DitaClass TOPIC_IMAGE = new DitaClass("- topic/image "); + public static final DitaClass TOPIC_INCLUDE = new DitaClass("- topic/include "); public static final DitaClass TOPIC_INDEX_BASE = new DitaClass("- topic/index-base "); public static final DitaClass TOPIC_INDEXTERM = new DitaClass("- topic/indexterm "); public static final DitaClass TOPIC_INDEXTERMREF = new DitaClass("- topic/indextermref ");
Add DITA <I> include class
dita-ot_dita-ot
train
java
b20b9c6c9227e6356eb737c3522377dcbf61cd57
diff --git a/lib/fudge/tasks/composite_task.rb b/lib/fudge/tasks/composite_task.rb index <HASH>..<HASH> 100644 --- a/lib/fudge/tasks/composite_task.rb +++ b/lib/fudge/tasks/composite_task.rb @@ -25,13 +25,24 @@ module Fudge end def output_message(t) - args_text = join_arguments(t) + message = [] + message << running_coloured + message << task_name_coloured(t) + message << args_coloured(t) + puts message.join(' ') + end + + def running_coloured + "Running task".foreground(:blue) + end + + def task_name_coloured(t) + t.class.name.to_s.foreground(:yellow).bright + end - puts [ - "Running task".foreground(:blue), - t.class.name.to_s.foreground(:yellow).bright, - args_text.foreground(:yellow).bright - ].join(' ') + def args_coloured(t) + args_text = join_arguments(t) + args_text.foreground(:yellow).bright end end end
tidied up composite task
Sage_fudge
train
rb
ec613ee03307fde5678ce0568942b229b4513ef6
diff --git a/wagtailmenus/templatetags/menu_tags.py b/wagtailmenus/templatetags/menu_tags.py index <HASH>..<HASH> 100644 --- a/wagtailmenus/templatetags/menu_tags.py +++ b/wagtailmenus/templatetags/menu_tags.py @@ -530,14 +530,9 @@ def prime_menu_items( allow_repeating_parents and use_specific and has_children_in_menu ): - if type(page) is Page: - page = page.specific if getattr(page, 'repeat_in_subnav', False): active_class = ACTIVE_ANCESTOR_CLASS - elif( - page.depth >= SECTION_ROOT_DEPTH and - page.pk in current_page_ancestor_ids - ): + elif page.pk in current_page_ancestor_ids: active_class = ACTIVE_ANCESTOR_CLASS setattr(item, 'active_class', active_class)
Don't include ids for pages above SECTION_ROOT_DEPTH in ancestor IDs, eliminating the need to check page depth in prime_menu_items
rkhleics_wagtailmenus
train
py
17364e72ecb9f3145d45fd47936bb921b2dce289
diff --git a/.eslintrc.js b/.eslintrc.js index <HASH>..<HASH> 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,6 +9,10 @@ module.exports = { env: { browser: true, node: true, + + // babel's transform-runtime converts references to ES6 globals such as + // Promise and Map to core-js polyfills, so we can use ES6 globals. + es6: true, }, extends: ["eslint:recommended", "google"], rules: {
Add es6 to eslint environments
matrix-org_matrix-js-sdk
train
js
1bf9ac921a34f13586e2be422468104127c4ad3b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( long_description=open('README.md').read(), author = u'Juan Pedro Fisanotti', author_email = 'fisadev@gmail.com', - url='', + url='http://github.com/fisadev/simpleai', packages=['simpleai', 'simpleai.tests'], license='LICENSE.txt', classifiers = [
Url filled on setup.py
simpleai-team_simpleai
train
py
1d9706d047851dcff510d44e5be57dc3e19a2f94
diff --git a/dcos/nodeutil/util.go b/dcos/nodeutil/util.go index <HASH>..<HASH> 100644 --- a/dcos/nodeutil/util.go +++ b/dcos/nodeutil/util.go @@ -355,17 +355,9 @@ func (d *dcosInfo) MesosID(ctx context.Context) (string, error) { return "", ErrNodeInfo{fmt.Sprintf("Local node's IP %s not found in mesos state response %+v", localIP, state)} } -// ClusterID returns a UUID of a specific cluster. +// ClusterID returns a UUID of a specific cluster. The file containing the UUID +// is available on every node at d.clusterIDLocation. func (d *dcosInfo) ClusterID() (string, error) { - role, err := d.Role() - if err != nil { - return "", err - } - - if role != dcos.RoleMaster { - return "", ErrNodeInfo{"cluster ID info supported on master nodes only. Current node's role " + role} - } - d.Lock() defer d.Unlock()
(fix) dc/os cluster id is available on all nodes Prior to this commit, the dcos-go nodeutil only returned a cluster ID for master nodes. In fact, this UUID file is present on all nodes in the cluster. This commit removes the check for the master role.
dcos_dcos-go
train
go
0111d796dd995576fcde203f8d4abb405a8b4cf6
diff --git a/textx/textx.py b/textx/textx.py index <HASH>..<HASH> 100644 --- a/textx/textx.py +++ b/textx/textx.py @@ -550,7 +550,8 @@ def str_match_SA(parser, node, children): match = parser.keyword_regex.match(to_match) if match and match.span() == (0, len(to_match)): regex_match = RegExMatch(r'{}\b'.format(to_match), - ignore_case=parser.ignore_case) + ignore_case=parser.ignore_case, + str_repr=to_match) regex_match.compile() return regex_match else:
Better reporting of expected matches for keyword-like matches.
textX_textX
train
py
bf77464347172738860e87455ea501be1c886085
diff --git a/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/PersistenceManager.php b/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/PersistenceManager.php index <HASH>..<HASH> 100644 --- a/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/PersistenceManager.php +++ b/TYPO3.Flow/Classes/TYPO3/Flow/Persistence/Doctrine/PersistenceManager.php @@ -162,7 +162,7 @@ class PersistenceManager extends AbstractPersistenceManager try { $this->entityManager->flush(); - } catch (\Exception $exception) { + } catch (\Doctrine\DBAL\DBALException $exception) { $this->systemLogger->logException($exception); /** @var Connection $connection */ $connection = $this->entityManager->getConnection();
TASK: Adjust exception being caught to DBALException
neos_flow-development-collection
train
php
e767f98e8a4b8d66973fdb2867e847f0bf0b9504
diff --git a/host.go b/host.go index <HASH>..<HASH> 100644 --- a/host.go +++ b/host.go @@ -3,6 +3,7 @@ package host import ( "context" + connmgr "github.com/libp2p/go-libp2p-connmgr" inet "github.com/libp2p/go-libp2p-net" peer "github.com/libp2p/go-libp2p-peer" pstore "github.com/libp2p/go-libp2p-peerstore" @@ -61,4 +62,7 @@ type Host interface { // Close shuts down the host, its Network, and services. Close() error + + // ConnManager returns this hosts connection manager + ConnManager() connmgr.ConnManager }
WIP: add ConnManager interface method
libp2p_go-libp2p-host
train
go
e950ecb97f26f9adc5a83113212703863653fc80
diff --git a/src/Model.php b/src/Model.php index <HASH>..<HASH> 100644 --- a/src/Model.php +++ b/src/Model.php @@ -367,6 +367,9 @@ abstract class Model implements \JsonSerializable { $this->changes = []; $this->data = null; + foreach ($this->foreign as $model) { + $model->reset(); + } } /**
Fix reseted Model with Foreigns Foreigns where kept intact, and where accesible even when the corresponding column was set to null.
aryelgois_Medools
train
php
71613125ea2216e935e5cd46f642ef0e1cb9bdbe
diff --git a/src/Console/Application.php b/src/Console/Application.php index <HASH>..<HASH> 100644 --- a/src/Console/Application.php +++ b/src/Console/Application.php @@ -17,7 +17,7 @@ class Application extends BaseApplication /** * @var string */ - const VERSION = '0.7.9'; + const VERSION = '0.7.10'; /** * @var bool */
Update version number to <I>
hechoendrupal_drupal-console
train
php
6a5f1b915cd05973f67c675f47e6393fbb01bebb
diff --git a/conda_manager/api/conda_api.py b/conda_manager/api/conda_api.py index <HASH>..<HASH> 100644 --- a/conda_manager/api/conda_api.py +++ b/conda_manager/api/conda_api.py @@ -14,6 +14,7 @@ import platform import re import sys import yaml +import time # Third party imports from qtpy.QtCore import QByteArray, QObject, QProcess, QTimer, Signal @@ -107,10 +108,10 @@ class ProcessWorker(QObject): self._timer = QTimer() self._process = QProcess() - self._timer.setInterval(50) + self._timer.setInterval(150) self._timer.timeout.connect(self._communicate) - self._process.finished.connect(self._communicate) + # self._process.finished.connect(self._communicate) self._process.readyReadStandardOutput.connect(self._partial) def _partial(self):
Enforce <I>ms delay when starting conda qprocess
spyder-ide_conda-manager
train
py
eb59e78ecfcc44eb66e9399a07716c280fa0f8ab
diff --git a/lib/Profile.php b/lib/Profile.php index <HASH>..<HASH> 100644 --- a/lib/Profile.php +++ b/lib/Profile.php @@ -33,9 +33,9 @@ class Profile { $data = array( 'elapsed' => $elapsed(), - 'memory before' => $memory_before, - 'memory after' => $memory_after, - 'memory peak' => $memory_peak, + 'memory_before' => $memory_before, + 'memory_after' => $memory_after, + 'memory_peak' => $memory_peak, 'marks' => $marks );
We don't want spaces in the arrays we are creating for the profile information. Figured it was best to just fix it at the source.
mover-io_belt
train
php
e81fecf9ccd936f70c73c6afd02bf999677e1f6f
diff --git a/lib/hocon/version.rb b/lib/hocon/version.rb index <HASH>..<HASH> 100644 --- a/lib/hocon/version.rb +++ b/lib/hocon/version.rb @@ -1,5 +1,5 @@ module Hocon module Version - STRING = '1.2.1' + STRING = '1.2.2.SNAPSHOT' end end
(MAINT) Update version for release
puppetlabs_ruby-hocon
train
rb
e160af8da8795e02bdfdd3291cc558fe061fa45a
diff --git a/tests/downscaling/conftest.py b/tests/downscaling/conftest.py index <HASH>..<HASH> 100644 --- a/tests/downscaling/conftest.py +++ b/tests/downscaling/conftest.py @@ -62,3 +62,27 @@ def qds_month(): coords={"quantile": [0, 0.3, 5.0, 7, 1], "month": range(1, 13)}, attrs={"group": "time.month", "window": 1}, ) + + +@pytest.fixture +def obs_sim_fut_tuto(): + def _obs_sim_fut_tuto(fut_offset=3, delta=0.1, smth_win=3, trend=True): + ds = xr.tutorial.open_dataset("air_temperature") + obs = ds.air.resample(time="D").mean() + sim = obs.rolling(time=smth_win, min_periods=1).mean() + delta + fut_time = sim.time + np.timedelta64(730 + fut_offset * 365, "D").astype( + "<m8[ns]" + ) + fut = sim + ( + 0 + if not trend + else xr.DataArray( + np.linspace(0, 2, num=sim.time.size), + dims=("time",), + coords={"time": sim.time}, + ) + ) + fut["time"] = fut_time + return obs, sim, fut + + return _obs_sim_fut_tuto
New simple fixture to get obs, sim, fut from xr tuto
Ouranosinc_xclim
train
py
dbb6d548ad7852a83aa7a84fa62df5dccff51e6d
diff --git a/addScript.js b/addScript.js index <HASH>..<HASH> 100644 --- a/addScript.js +++ b/addScript.js @@ -3,15 +3,25 @@ Author Tobias Koppers @sokra */ module.exports = function(src) { + function log(error) { + (typeof console !== "undefined") + && (console.error || console.log)("[Script Loader]", error); + } + + // Check for IE =< 8 + function isIE() { + return typeof attachEvent !== "undefined" && typeof addEventListener === "undefined"; + } + try { - if (typeof eval !== "undefined") { - eval.call(null, src); - } else if (typeof execScript !== "undefined") { + if (typeof execScript !== "undefined" && isIE()) { execScript(src); + } else if (typeof eval !== "undefined") { + eval.call(null, src); } else { - console.error("[Script Loader] EvalError: No eval function available"); + log("EvalError: No eval function available"); } } catch (error) { - console.error("[Script Loader] ", error.message); + log(error); } }
fix: IE =< 8 incompatibility regression (#<I>)
webpack-contrib_script-loader
train
js
45ec38d2e63ee7b576e32e5addc5fb962a6c46c4
diff --git a/hack/preload-images/generate.go b/hack/preload-images/generate.go index <HASH>..<HASH> 100644 --- a/hack/preload-images/generate.go +++ b/hack/preload-images/generate.go @@ -87,7 +87,7 @@ func generateTarball(kubernetesVersion, containerRuntime, tarballFilename string kcfg := config.KubernetesConfig{ KubernetesVersion: kubernetesVersion, } - runner := command.NewKICRunner(profile, driver.OCIBinary) + runner := command.NewKICRunner(profile, driver.OCIPrefix, driver.OCIBinary) sm := sysinit.New(runner) if err := bsutil.TransferBinaries(kcfg, runner, sm); err != nil {
Fix hack binary, as pointed out by golangci-lint
kubernetes_minikube
train
go
f55c1a0678407997852991daab1024ca39794648
diff --git a/ontrack-delivery/publish.py b/ontrack-delivery/publish.py index <HASH>..<HASH> 100755 --- a/ontrack-delivery/publish.py +++ b/ontrack-delivery/publish.py @@ -77,7 +77,7 @@ def github_publish(options): print "[publish] Release ID is %d" % releaseid # Attach artifacts to the release github.uploadGithubArtifact(options, releaseid, 'ontrack-ui.jar', 'application/zip', - "%s/ontrack-ui/build/libs/ontrack-ui-%s.jar" % (options.dir, options.release)) + "ontrack-ui/build/libs/ontrack-ui-%s.jar" % options.release) # Gets the change log since last release changeLog = ontrack.getChangeLog(options.ontrack_url, 'master', 'RELEASE') # Attach change log to the release
Release: Not using the `dir` option any longer (current directory is fine)
nemerosa_ontrack
train
py
80a64f417b1a05fcfd2a3f6b342ab4b79d776e36
diff --git a/lib/race.js b/lib/race.js index <HASH>..<HASH> 100644 --- a/lib/race.js +++ b/lib/race.js @@ -4,7 +4,7 @@ import once from './internal/once'; /** * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` completed or pass an + * previous function has completed. Once any of the `tasks` complete or pass an * error to its callback, the main `callback` is immediately called. It's * equivalent to `Promise.race()`. *
fix second minor typo in race docs
caolan_async
train
js
329fe129fe185d860d22e3f6aeb184e9e11f73b7
diff --git a/framework/db/Connection.php b/framework/db/Connection.php index <HASH>..<HASH> 100644 --- a/framework/db/Connection.php +++ b/framework/db/Connection.php @@ -571,8 +571,12 @@ class Connection extends Component } elseif (($pos = strpos($this->dsn, ':')) !== false) { $driver = strtolower(substr($this->dsn, 0, $pos)); } - if (isset($driver) && ($driver === 'mssql' || $driver === 'dblib' || $driver === 'sqlsrv')) { - $pdoClass = 'yii\db\mssql\PDO'; + if (isset($driver)) { + if ($driver === 'mssql' || $driver === 'dblib') { + $pdoClass = 'yii\db\mssql\PDO'; + } else if ($driver === 'sqlsrv'){ + $pdoClass = 'yii\db\mssql\SqlsrvPDO'; + } } }
Fixed #<I>: changed sqlsrv pdo class selection
yiisoft_yii2
train
php
21174cb497a83747596073e64aefd0dd631f15a0
diff --git a/sys/reaper/reaper_unix.go b/sys/reaper/reaper_unix.go index <HASH>..<HASH> 100644 --- a/sys/reaper/reaper_unix.go +++ b/sys/reaper/reaper_unix.go @@ -31,7 +31,7 @@ import ( // ErrNoSuchProcess is returned when the process no longer exists var ErrNoSuchProcess = errors.New("no such process") -const bufferSize = 2048 +const bufferSize = 32 type subscriber struct { sync.Mutex
Change bufferSize back to <I> Shim use non-blocking send now, there is no need to set bufferSize to <I>, it's a waste.
containerd_containerd
train
go
b1071e0870793797dff363dfdb5946ce8b0ac1f9
diff --git a/subliminal/services/__init__.py b/subliminal/services/__init__.py index <HASH>..<HASH> 100644 --- a/subliminal/services/__init__.py +++ b/subliminal/services/__init__.py @@ -83,9 +83,11 @@ class ServiceBase(object): def query(self, *args): """Make the actual query""" + pass def list(self, video, languages): """List subtitles""" + pass def download(self, subtitle): """Download a subtitle"""
Add pass to some ServiceBase methods
Diaoul_subliminal
train
py
3179b7312b7160906eeeee271bdc5266b488e219
diff --git a/resources/lang/sv-SE/cachet.php b/resources/lang/sv-SE/cachet.php index <HASH>..<HASH> 100644 --- a/resources/lang/sv-SE/cachet.php +++ b/resources/lang/sv-SE/cachet.php @@ -53,7 +53,7 @@ return [ // Service Status 'service' => [ - 'good' => '[0,1] Systemet fungerar |[2,Inf] Alla system fungerar', + 'good' => '[0,1]System operational|[2,*]All systems are operational', 'bad' => '[0,1] Systemet har för närvarande problem|[2,Inf] Vissa system har problem', 'major' => '[0,1] Stora störningar på tjänsten [2,Inf] Stora störningar på vissa system', ],
New translations cachet.php (Swedish)
CachetHQ_Cachet
train
php
316750d8228d815732834531bc27a8382110c8d6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup from codado import _version
switch to setuptools.setup() so wheels will build
corydodt_Codado
train
py
82248865fae2b8953d393dbeb19cbcbbf35f2d81
diff --git a/src/Analyzer/ModelAnalyzer.php b/src/Analyzer/ModelAnalyzer.php index <HASH>..<HASH> 100644 --- a/src/Analyzer/ModelAnalyzer.php +++ b/src/Analyzer/ModelAnalyzer.php @@ -15,7 +15,9 @@ use Czim\CmsModels\Support\Enums\RelationType; use Exception; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\BelongsToMany; use Illuminate\Database\Eloquent\Relations\MorphTo; +use Illuminate\Database\Eloquent\Relations\MorphToMany; use Illuminate\Database\Eloquent\Relations\Relation; use LimitIterator; use phpDocumentor\Reflection\DocBlockFactory;
Fixed missing imports for modelanalyzer relation types
czim_laravel-cms-models
train
php