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
2a46add3fa778d26eec2f647c7b874d09a9c858f
diff --git a/lib/ewmh.js b/lib/ewmh.js index <HASH>..<HASH> 100644 --- a/lib/ewmh.js +++ b/lib/ewmh.js @@ -1,5 +1,6 @@ var EventEmitter = require('events').EventEmitter; var util = require('util'); +var os = require('os'); var x11 = require('x11'); var EWMH = function(X, root) { @@ -40,7 +41,12 @@ EWMH.prototype.update_window_list = function(list, cb) { EWMH.prototype.set_pid = function(wid, cb) { var raw = new Buffer(4); raw.writeUInt32LE(process.pid); - this.change_property(wid, '_NET_WM_PID', this.X.atoms.CARDINAL, 32, raw, cb); + this.change_property(wid, '_NET_WM_PID', this.X.atoms.CARDINAL, 32, raw); +}; + +EWMH.prototype.set_hostname = function(wid, cb) { + var hosname = os.hostname(); + this.change_property('WM_CLIENT_MACHINE', X.atoms.STRING, 8, hostname, cb); }; EWMH.prototype._handle_event = function(ev) {
WM_CLIENT_MACHINE setter
santigimeno_node-ewmh
train
js
ab3160a71ff32a23b4ffdc5d6ef9cc1ae388e182
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -32,6 +32,10 @@ function extend ( target ) { return target; } +function normaliseOutput ( code ) { + return code.toString().trim().replace( /\r\n/g, '\n' ); +} + describe( 'rollup', function () { describe( 'sanity checks', function () { it( 'exists', function () { @@ -175,13 +179,13 @@ describe( 'rollup', function () { }); return bundle.write( options ).then( function () { - var actualCode = sander.readFileSync( FORM, dir, '_actual', profile.format + '.js' ).toString().trim(); + var actualCode = normaliseOutput( sander.readFileSync( FORM, dir, '_actual', profile.format + '.js' ) ); var expectedCode; var actualMap; var expectedMap; try { - expectedCode = sander.readFileSync( FORM, dir, '_expected', profile.format + '.js' ).toString().trim(); + expectedCode = normaliseOutput( sander.readFileSync( FORM, dir, '_expected', profile.format + '.js' ) ); } catch ( err ) { expectedCode = 'missing file'; }
normalise test output for benefit of windows
rollup_rollup
train
js
8f44529ed65bc4b9a631a66b16aa9edb84f22868
diff --git a/lib/onebox/engine.rb b/lib/onebox/engine.rb index <HASH>..<HASH> 100644 --- a/lib/onebox/engine.rb +++ b/lib/onebox/engine.rb @@ -38,9 +38,18 @@ module Onebox end def template - File.read(File.join("templates", "#{template_name}.handlebars")) + File.read(template_path) end + def template_path + File.join("templates", "#{template_name}.handlebars") + end + + # returns the gem root directory + # def root + # Gem::Specification.find_by_name("onebox").gem_dir + # end + # calculates handlebars template name for onebox using name of engine def template_name self.class.name.split("::").last.downcase.gsub(/onebox/, "")
refactor #template to use new method #template_path, more modular
discourse_onebox
train
rb
b9c4a0b6c523901d716cb4eabeea45ccc3bf5f88
diff --git a/deploy_stack.py b/deploy_stack.py index <HASH>..<HASH> 100755 --- a/deploy_stack.py +++ b/deploy_stack.py @@ -453,8 +453,9 @@ def _deploy_job(job_name, base_env, upgrade, charm_prefix, new_path, test_upgrade(env) except: if host is not None: - dump_logs(env.client.get_env_client(env), host, - log_dir, bootstrap_id) + dump_env_logs( + env.client.get_env_client(env), host, log_dir, + host_id=bootstrap_id) raise finally: env.destroy_environment()
Use dump_env_logs to call dump_logs for each machine in the env.
juju_juju
train
py
dff3daf32ed3877dcb46d74689d79de0f7bbc0e8
diff --git a/test/common/test_common.py b/test/common/test_common.py index <HASH>..<HASH> 100755 --- a/test/common/test_common.py +++ b/test/common/test_common.py @@ -696,8 +696,8 @@ def start_master_slave_pair(opts, extra_flags, test_dir): if opts["elb"]: server.elb_port = elb_ports[0] - server.start() - + server.start(False) + s_flags = ["--slave-of", "localhost:%d" % repli_port] if opts["elb"]:
Fixed replication test (fixed start_master_slave_pair) so that it actually runs. Previously, we were waiting for the master to start accepting gets, in start_master_slave_pair, which obviously would never happen before we tried starting the slave.
rethinkdb_rethinkdb
train
py
e622dee3c87b89c8eebeff6c59f4d77d8f66864c
diff --git a/lib/board.js b/lib/board.js index <HASH>..<HASH> 100644 --- a/lib/board.js +++ b/lib/board.js @@ -246,19 +246,18 @@ Board = (function(_super) { return this.writeAndWait("RF receive " + pin + "\n"); }; - Board.prototype.rfControlSendMessage = function(pin, protocolName, message) { + Board.prototype.rfControlSendMessage = function(pin, repeats, protocolName, message) { var result; result = rfcontrol.encodeMessage(protocolName, message); - return this.rfControlSendPulses(pin, result.pulseLengths, result.pulses); + return this.rfControlSendPulses(pin, repeats, result.pulseLengths, result.pulses); }; - Board.prototype.rfControlSendPulses = function(pin, pulseLengths, pulses) { + Board.prototype.rfControlSendPulses = function(pin, repeats, pulseLengths, pulses) { var i, pl, pulseLengthsArgs, repeats, _i, _len; assert(typeof pin === "number", "pin should be a number"); assert(Array.isArray(pulseLengths), "pulseLengths should be an array"); assert(pulseLengths.length <= 8, "pulseLengths.length should be <= 8"); assert(typeof pulses === "string", "pulses should be a string"); - repeats = 7; pulseLengthsArgs = ""; i = 0; for (_i = 0, _len = pulseLengths.length; _i < _len; _i++) {
moving amount of repeats to homeduino config
pimatic_homeduinojs
train
js
1fb81602d973ff5f86404557aad301bf0b81130b
diff --git a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/NioSelector.java b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/NioSelector.java index <HASH>..<HASH> 100644 --- a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/NioSelector.java +++ b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/NioSelector.java @@ -43,7 +43,8 @@ public class NioSelector implements AutoCloseable final Class<?> selectorImplClass = Class.forName("sun.nio.ch.SelectorImpl", false, ClassLoader.getSystemClassLoader()); - if (selectorImplClass.isAssignableFrom(Selector.class)) + // grab a selector. This must be the same type we will grab in the constructor. + if (selectorImplClass.isAssignableFrom(Selector.open().getClass())) { selectKeysField = selectorImplClass.getDeclaredField("selectedKeys"); selectKeysField.setAccessible(true);
[Java]: fix determination of usage of NioSelectedKeySet in NioSelector
real-logic_aeron
train
java
53e7953f6a3ffce8628461ab64a745ca12555a57
diff --git a/lib/searchkick/query.rb b/lib/searchkick/query.rb index <HASH>..<HASH> 100644 --- a/lib/searchkick/query.rb +++ b/lib/searchkick/query.rb @@ -525,7 +525,7 @@ module Searchkick def term_filters(field, value) if value.is_a?(Array) # in query if value.any?(&:nil?) - {or: value.map{|v| term_filters(field, v) }} + {or: [term_filters(field, nil), term_filters(field, value.compact)]} else {in: {field => value}} end
More efficient array queries with nil
ankane_searchkick
train
rb
722aeb80774b504bf2b9a0696ac6c67e1ccacbb2
diff --git a/src/org/openscience/cdk/io/PDBWriter.java b/src/org/openscience/cdk/io/PDBWriter.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/io/PDBWriter.java +++ b/src/org/openscience/cdk/io/PDBWriter.java @@ -51,7 +51,8 @@ import org.openscience.cdk.tools.FormatStringBuffer; import org.openscience.cdk.tools.manipulator.ChemModelManipulator; /** - * Saves molecules in a rudimentary PDB format. + * Saves small molecules in a rudimentary PDB format. It does not allow + * writing of PDBProtein data structures. * * @cdk.module io */
Added a statement to say that the current PDBWriter does not write protein structures git-svn-id: <URL>
cdk_cdk
train
java
41233276207450a3062df82107eae8d5c4c814c8
diff --git a/sample_extension.py b/sample_extension.py index <HASH>..<HASH> 100644 --- a/sample_extension.py +++ b/sample_extension.py @@ -8,7 +8,7 @@ class ContainsValidator(validators.AbstractValidator): # Sample validator that verifies a string is contained in the request body contains_string = None - def validate(self, body, context=None): + def validate(self, body=None, context=None): result = self.contains_string in body if result: return True
Fix args issue in sample extension
svanoort_pyresttest
train
py
c5a873f2999f7d6d2307dbc4e334f0a1bd29db65
diff --git a/hazelcast/src/main/java/com/hazelcast/multimap/MultiMap.java b/hazelcast/src/main/java/com/hazelcast/multimap/MultiMap.java index <HASH>..<HASH> 100755 --- a/hazelcast/src/main/java/com/hazelcast/multimap/MultiMap.java +++ b/hazelcast/src/main/java/com/hazelcast/multimap/MultiMap.java @@ -111,7 +111,7 @@ public interface MultiMap<K, V> extends BaseMultiMap<K, V> { * @param key the key to be stored * @param value the value to be stored * @return {@code true} if size of the multimap is increased, - * {@code false} if the multimap already contains the key-value pair + * {@code false} if the multimap already contains the key-value pair and doesn't allow duplicates */ boolean put(@Nonnull K key, @Nonnull V value);
Fix JavaDoc for MultiMap.put method (#<I>)
hazelcast_hazelcast
train
java
c933df15259fd78676920352f5efe50e103ac6a6
diff --git a/structr-core/src/main/java/org/structr/core/script/polyglot/function/GrantFunction.java b/structr-core/src/main/java/org/structr/core/script/polyglot/function/GrantFunction.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/core/script/polyglot/function/GrantFunction.java +++ b/structr-core/src/main/java/org/structr/core/script/polyglot/function/GrantFunction.java @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2010-2020 Structr GmbH + * + * This file is part of Structr <http://structr.org>. + * + * Structr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * Structr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Structr. If not, see <http://www.gnu.org/licenses/>. + */ package org.structr.core.script.polyglot.function; import org.graalvm.polyglot.Value;
Adds missing license file headers to GrantFunction.
structr_structr
train
java
d0363e7b89d2ce82f4033e88377ca66be216d1db
diff --git a/static-files/webpack.config.js b/static-files/webpack.config.js index <HASH>..<HASH> 100644 --- a/static-files/webpack.config.js +++ b/static-files/webpack.config.js @@ -68,7 +68,7 @@ module.exports = (env = {}, options = {}) => { })(), output: (() => { const output = { - path: path.resolve(__dirname, 'dist'), + path: path.resolve('./dist'), filename: '[name].[chunkhash].js' }; @@ -131,8 +131,8 @@ module.exports = (env = {}, options = {}) => { resolve: { extensions: ['.js', '.jsx', '.scss'], alias: { - components: path.resolve(__dirname, 'source/components'), - js: path.resolve(__dirname, 'source/js') + components: path.resolve('./source/components'), + js: path.resolve('./source/js') }, plugins: [ new DirectoryNamedPlugin({
Fixes some weird uses of path.resolve
Creuna-Oslo_create-react-app
train
js
3b8df72cc913282c60010fdfd29c7726b0e39b6e
diff --git a/nessclient/connection.py b/nessclient/connection.py index <HASH>..<HASH> 100644 --- a/nessclient/connection.py +++ b/nessclient/connection.py @@ -38,6 +38,7 @@ class IP232Connection(Connection): loop: asyncio.AbstractEventLoop = asyncio.get_event_loop()): super().__init__() + self._write_lock = asyncio.Lock(loop=loop) self._host = host self._port = port self._loop = loop @@ -79,10 +80,14 @@ class IP232Connection(Connection): return data.strip() async def write(self, data: bytes) -> None: - assert self._writer is not None - - self._writer.write(data) - await self._writer.drain() + _LOGGER.debug("Waiting for write_lock to write data: %s", data) + async with self._write_lock: + _LOGGER.debug("Obtained write_lock to write data: %s", data) + assert self._writer is not None + + self._writer.write(data) + await self._writer.drain() + _LOGGER.debug("Data was written: %s", data) async def close(self) -> None: if self.connected and self._writer is not None:
Wrap connection writing with a lock (#<I>)
nickw444_nessclient
train
py
043df1be5ae2f38ffa119ef5c6c9b2458ca0d14e
diff --git a/packages/vx-geo/test/CustomProjection.test.js b/packages/vx-geo/test/CustomProjection.test.js index <HASH>..<HASH> 100644 --- a/packages/vx-geo/test/CustomProjection.test.js +++ b/packages/vx-geo/test/CustomProjection.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { CustomProjection } from '../src'; -describe('<CustonProjection />', () => { +describe('<CustomProjection />', () => { test('it should be defined', () => { expect(CustomProjection).toBeDefined(); });
[geo] fix typo in test
hshoff_vx
train
js
527aa5f9b21aa4cbcb103a97ea684e0b405d80fb
diff --git a/code/checkout/steps/CheckoutStep_Address.php b/code/checkout/steps/CheckoutStep_Address.php index <HASH>..<HASH> 100644 --- a/code/checkout/steps/CheckoutStep_Address.php +++ b/code/checkout/steps/CheckoutStep_Address.php @@ -41,6 +41,11 @@ class CheckoutStep_Address extends CheckoutStep{ $step = null; if(isset($data['SeperateBilling']) && $data['SeperateBilling']){ $step = "billingaddress"; + }else{ + //ensure billing address = shipping address, when appropriate + $order = $this->shippingconfig()->getOrder(); + $order->BillingAddressID = $order->ShippingAddressID; + $order->write(); } return $this->owner->redirect($this->NextStepLink($step)); }
FIX: shipping address checkout step should update billing address, if "separate billing" is not selected.
silvershop_silvershop-core
train
php
45afecf1f77744ace58bd17385f18e10bdd33c95
diff --git a/addon/models/learner-group.js b/addon/models/learner-group.js index <HASH>..<HASH> 100644 --- a/addon/models/learner-group.js +++ b/addon/models/learner-group.js @@ -161,7 +161,7 @@ export default Model.extend({ * @type {Ember.computed} * @public */ - filterTitle: computed('allDescendants.@each.title', async function(){ + filterTitle: computed('allDescendants.@each.title', 'allParents.@each.title', 'title', async function(){ const allDescendants = await this.get('allDescendants'); const allParents = await this.get('allParents'); const titles = all([
added missing dependent keys to filterTitle CP.
ilios_common
train
js
40a55a640c0448301c12c1d1549353ae02565e09
diff --git a/_pytest/nose.py b/_pytest/nose.py index <HASH>..<HASH> 100644 --- a/_pytest/nose.py +++ b/_pytest/nose.py @@ -41,7 +41,7 @@ def pytest_make_collect_report(collector): def call_optional(obj, name): method = getattr(obj, name, None) - if method is not None and not hasattr(method, "_pytestfixturefunction"): + if method is not None and not hasattr(method, "_pytestfixturefunction") and callable(method): # If there's any problems allow the exception to raise rather than # silently ignoring them method()
nose.py: don't try to call setup if it's not callable
vmalloc_dessert
train
py
b50e941d1d8ea1ce51c24f0e1a4684fe4dab770d
diff --git a/requesting.go b/requesting.go index <HASH>..<HASH> 100644 --- a/requesting.go +++ b/requesting.go @@ -298,7 +298,7 @@ func (p *Peer) applyRequestState(next requestState) bool { if more { p.needRequestUpdate = "" if !current.Requests.IsEmpty() { - p.updateRequestsTimer.Reset(time.Second) + p.updateRequestsTimer.Reset(3 * time.Second) } } return more
Refresh updates after 3s instead of 1s
anacrolix_torrent
train
go
38d56b1a930710ea71acc51b6ca2ce88f1dfe306
diff --git a/mapping.js b/mapping.js index <HASH>..<HASH> 100644 --- a/mapping.js +++ b/mapping.js @@ -43,7 +43,9 @@ var normalize = function(f) { } if(type.isNode){ - return f(dataset, type, dataset.normalizeId(id), null, null, doc); + if(!id) + throw new Error('Must specify id when creating a node!'); + return f(dataset, type, dataset.normalizeId(id), undefined, undefined, doc); } } }
nodes must have id (for now, maybe hash later)
graphmalizer_graphmalizer-core
train
js
b7b6fef98c4837d21e4e76078f7ba5a488839839
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -34,12 +34,13 @@ echo "<LI>$reading"; } } + if ($USER->editing) { + echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$site->id&week=0&add=reading\">Add Reading</A>...</P>"; + } else { + echo "<BR><BR>"; + } } - if ($USER->editing) { - echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$site->id&week=0&add=reading\">Add Reading</A>...</P>"; - echo "<BR>"; - } if (isadmin()) { print_simple_box("Admin", $align="CENTER", $width="100%", $color="$THEME->cellheading");
OK, this is better (sigh)
moodle_moodle
train
php
9c194aa7e2febeab0cbd895067d7d90d82b137f9
diff --git a/blocks/blockstore/bloom_cache.go b/blocks/blockstore/bloom_cache.go index <HASH>..<HASH> 100644 --- a/blocks/blockstore/bloom_cache.go +++ b/blocks/blockstore/bloom_cache.go @@ -142,10 +142,7 @@ func (b *bloomcache) Get(k *cid.Cid) (blocks.Block, error) { } func (b *bloomcache) Put(bl blocks.Block) error { - if has, ok := b.hasCached(bl.Cid()); ok && has { - return nil - } - + // See comment in PutMany err := b.blockstore.Put(bl) if err == nil { b.bloom.AddTS(bl.Cid().Bytes()) @@ -155,7 +152,7 @@ func (b *bloomcache) Put(bl blocks.Block) error { func (b *bloomcache) PutMany(bs []blocks.Block) error { // bloom cache gives only conclusive resulty if key is not contained - // to reduce number of puts we need conclusive infomration if block is contained + // to reduce number of puts we need conclusive information if block is contained // this means that PutMany can't be improved with bloom cache so we just // just do a passthrough. err := b.blockstore.PutMany(bs)
fix: remove bloom filter check on Put call in blockstore To prevent put we need to have conclusive information if item is contained in the repo, bloom filter won't give this information. It only says if it is for sure not contained. License: MIT
ipfs_go-ipfs
train
go
5f61c5db054c6cfaec086182c555518f01545093
diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go index <HASH>..<HASH> 100644 --- a/drivers/overlay/overlay.go +++ b/drivers/overlay/overlay.go @@ -22,7 +22,7 @@ const ( vethPrefix = "veth" vethLen = 7 vxlanIDStart = 256 - vxlanIDEnd = 1000 + vxlanIDEnd = (1 << 24) - 1 vxlanPort = 4789 vxlanVethMTU = 1450 )
Allow maximum possible VNI Right now there is an artificial limitation at <I>.
docker_libnetwork
train
go
dab88cb95cb33a33bf6912005ac5307d0a8ede25
diff --git a/src/Role/ReadModel/Users/RoleUsersProjector.php b/src/Role/ReadModel/Users/RoleUsersProjector.php index <HASH>..<HASH> 100644 --- a/src/Role/ReadModel/Users/RoleUsersProjector.php +++ b/src/Role/ReadModel/Users/RoleUsersProjector.php @@ -76,8 +76,12 @@ class RoleUsersProjector extends RoleProjector */ public function applyRoleCreated(RoleCreated $roleCreated) { - $document = $this->createNewDocument($roleCreated->getUuid()); - $this->repository->save($document); + $this->repository->save( + new JsonDocument( + $roleCreated->getUuid()->toNative(), + json_encode([]) + ) + ); } /** @@ -112,18 +116,4 @@ class RoleUsersProjector extends RoleProjector { return json_decode($document->getRawBody(), true); } - - /** - * @param UUID $uuid - * @return JsonDocument - */ - private function createNewDocument(UUID $uuid) - { - $document = new JsonDocument( - $uuid->toNative(), - json_encode([]) - ); - - return $document; - } }
III-<I>: Simplify the applyRoleCreated() method on RoleUsersProjector.
cultuurnet_udb3-php
train
php
5ba13b60415a196b51133fc8746989361e4a9b04
diff --git a/scraperwiki/sqlite.py b/scraperwiki/sqlite.py index <HASH>..<HASH> 100644 --- a/scraperwiki/sqlite.py +++ b/scraperwiki/sqlite.py @@ -92,11 +92,10 @@ def execute(query, data=None): def select(query, data=None): connection = _State.connection() _State.new_transaction() - if data is None: data = [] - result = connection.execute(query, data) + result = connection.execute('select ' + query, data) rows = [] for row in result:
Prepend select keyword in select method
scraperwiki_scraperwiki-python
train
py
8a16a7c99f1844cb74a7317e9efac363e59f9c37
diff --git a/pyvista/plotting/plotting.py b/pyvista/plotting/plotting.py index <HASH>..<HASH> 100644 --- a/pyvista/plotting/plotting.py +++ b/pyvista/plotting/plotting.py @@ -3352,7 +3352,7 @@ class BasePlotter(PickingHelper, WidgetHelper): -------- >>> import pyvista >>> sphere = pyvista.Sphere() - >>> plotter = pyvista.Plotter() + >>> plotter = pyvista.Plotter(off_screen=True) >>> actor = plotter.add_mesh(sphere) >>> plotter.screenshot('screenshot.png') # doctest:+SKIP @@ -3376,6 +3376,9 @@ class BasePlotter(PickingHelper, WidgetHelper): # Plotter hasn't been rendered or was improperly closed raise AttributeError('This plotter is closed and unable to save a screenshot.') + if self._first_time and not self.off_screen: + raise RuntimeError("Nothing to screenshot - call .show first or " + "use the off_screen argument") self.render() # debug: this needs to be called twice for some reason,
Raise exception instead of producing empty screenshots (#<I>) * Actually render in screenshot() * fix example and add exception
vtkiorg_vtki
train
py
824dbf48acf6c8c664ab978fc5c33405b2d1876e
diff --git a/src/sap.ui.layout/src/sap/ui/layout/form/ColumnLayoutRenderer.js b/src/sap.ui.layout/src/sap/ui/layout/form/ColumnLayoutRenderer.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.layout/src/sap/ui/layout/form/ColumnLayoutRenderer.js +++ b/src/sap.ui.layout/src/sap/ui/layout/form/ColumnLayoutRenderer.js @@ -121,7 +121,7 @@ sap.ui.define([ var oElement = aElements[i]; this.renderElement(oRm, oLayout, oElement); - if (Device.browser.chrome && i < oOptions.XL.Size && aElements.length > 1 && aElements.length <= oOptions.XL.Size) { + if (Device.browser.chrome && i < oOptions.XL.Size - 1 && aElements.length > 1 && aElements.length <= oOptions.XL.Size) { // in Chrome columns are not filled properly for less elements -> an invisible dummy DIV helps // with this logic the result is near to the other browsers // this "work around" don't work for other browsers
[INTERNAL] ColumnLayout: 4 Fields diplayed wrong - chrome in medium size Chrome das issues to arrange fields in a columnLayout if there are only few fields. Therefore "dummy" elements are added. For 4 Fields there was one too much. Change-Id: Ia1c6f<I>f<I>ece<I>ce4f<I>d2d1b5da5f<I>f<I>
SAP_openui5
train
js
68db3a4753ebd4449b03ceeb9445e8e34b020f90
diff --git a/src/transforms/TupleIndex.js b/src/transforms/TupleIndex.js index <HASH>..<HASH> 100644 --- a/src/transforms/TupleIndex.js +++ b/src/transforms/TupleIndex.js @@ -25,8 +25,8 @@ prototype.transform = function(_, pulse) { this.value = index = {}; pulse.visit(pulse.SOURCE, set); } else if (pulse.changed()) { - pulse.visit(pulse.ADD, set); pulse.visit(pulse.REM, function(t) { index[field(t)] = undefined; }); + pulse.visit(pulse.ADD, set); } else { mod = false; }
TupleIndex should process rem before add.
vega_vega-dataflow
train
js
4faa6e79b28db87c5b28f37746d2722f98b9af82
diff --git a/freshroastsr700/__init__.py b/freshroastsr700/__init__.py index <HASH>..<HASH> 100644 --- a/freshroastsr700/__init__.py +++ b/freshroastsr700/__init__.py @@ -447,7 +447,7 @@ class freshroastsr700(object): """Attempts to connect to the roaster every quarter of a second.""" while(self._cont.value): try: - self.connect() + self._connect() self._connected.value = 1 break except exceptions.RoasterLookupError:
Attempting to resolve issue #<I>. Works in Linux, need to test on Windows next.
Roastero_freshroastsr700
train
py
6120a56b72ff116085998f677b010a82c14f6f58
diff --git a/lib/Client.js b/lib/Client.js index <HASH>..<HASH> 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -8,18 +8,32 @@ var redis = require('redis'); module.exports = function (queueName) { var that = this; var client = redis.createClient(); + + client.on('error', function(err) { + console.error(err); + }); + var listKey = queueName+ '_a'; - console.log('listKey', listKey); + console.error('listKey', listKey); var quitting = false; var busyCount = 0; + + function clientQuit() { + if(!client.connected) { + // FIXME: this is to work around a bug in the redis client where it will keep retrying a reconnection just to send the QUIT request + // FIXME: actually go and report bug + client.closing = true; + } + client.quit(); + } + function markDone() { --busyCount; if(busyCount === 0) { if(quitting) { - console.error('quitting now that done'); - client.quit(); + clientQuit(); } } } @@ -38,7 +52,7 @@ module.exports = function (queueName) { that.quit = function() { if(busyCount === 0) { - client.quit(); + clientQuit(); } else { quitting = true; }
callback on error. added quit() command to terminate connection
pconstr_recurrent
train
js
279a7292a769fc8f79f5f53081bf16121d3c9b2d
diff --git a/AlphaTwirl/WritePandasDataFrameToFile.py b/AlphaTwirl/WritePandasDataFrameToFile.py index <HASH>..<HASH> 100755 --- a/AlphaTwirl/WritePandasDataFrameToFile.py +++ b/AlphaTwirl/WritePandasDataFrameToFile.py @@ -6,9 +6,11 @@ class WritePandasDataFrameToFile(object): self._outPath = outPath def deliver(self, results): - if len(results.index) == 0: return f = open(self._outPath, 'w') - results.to_string(f, index = False) + if len(results.index) == 0: + f.write(" ".join([i for i in results.columns]) + "\n") + else: + results.to_string(f, index = False) f.close() ##____________________________________________________________________________||
write the output file when the DaraFrame is empty
alphatwirl_alphatwirl
train
py
4f75cc89a193ee46851937f336fc2668aec80345
diff --git a/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ScmImportPluginFactory.java b/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ScmImportPluginFactory.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ScmImportPluginFactory.java +++ b/core/src/main/java/com/dtolabs/rundeck/plugins/scm/ScmImportPluginFactory.java @@ -8,10 +8,29 @@ import java.util.List; import java.util.Map; /** - * Created by greg on 9/9/15. + * Factory for {@link ScmImportPlugin}, interface for SCMImport plugins. */ public interface ScmImportPluginFactory { - ScmImportPlugin createPlugin(Map<String, ?> input, String project) throws ConfigurationException; + /** + * Create the plugin + * + * @param input setup config + * @param trackedItems tracked items list + * @param project project name + * + * @return plugin instance + * + * @throws ConfigurationException if an error occurs + */ + ScmImportPlugin createPlugin(Map<String, String> input, List<String> trackedItems, String project) + throws ConfigurationException; - List<Property> getSetupPropertiesForBasedir(File basedir) ; + /** + * Setup properties for the base directory + * + * @param basedir project base directory + * + * @return setup properties + */ + List<Property> getSetupPropertiesForBasedir(File basedir); }
add trackeditems in factory creation method
rundeck_rundeck
train
java
0741e5c0a5126c2431cb903ce2a4fc456ae88cae
diff --git a/it/src/test/java/thredds/server/catalog/TestTdsFCcatalogs.java b/it/src/test/java/thredds/server/catalog/TestTdsFCcatalogs.java index <HASH>..<HASH> 100644 --- a/it/src/test/java/thredds/server/catalog/TestTdsFCcatalogs.java +++ b/it/src/test/java/thredds/server/catalog/TestTdsFCcatalogs.java @@ -22,7 +22,7 @@ import java.util.Collection; @RunWith(Parameterized.class) @Category(NeedsCdmUnitTest.class) public class TestTdsFCcatalogs { - @Parameterized.Parameters + @Parameterized.Parameters(name = "{0}{1}") public static Collection<Object[]> getTestParameters() { return Arrays.asList(new Object[][]{ {"catalogGrib", ""}, @@ -42,13 +42,11 @@ public class TestTdsFCcatalogs { } private static final boolean show = false; - String path, query; - - public TestTdsFCcatalogs(String path, String query) { - this.path = path; - this.query = query; - } + @Parameterized.Parameter(value = 0) + public String path; + @Parameterized.Parameter(value = 1) + public String query; @Test public void testOpenXml() {
Improve names for paramterized tests in TestTdsFCcatalogs.
Unidata_thredds
train
java
36d1bbe4ff9a217541a65dbaeef81ced7c8d3c3e
diff --git a/lib/url/endpoint_builder.rb b/lib/url/endpoint_builder.rb index <HASH>..<HASH> 100644 --- a/lib/url/endpoint_builder.rb +++ b/lib/url/endpoint_builder.rb @@ -1,4 +1,3 @@ -# Should probably make this a module instead class URL class Service class EndpointBuilder @@ -24,6 +23,7 @@ class URL # FooService.user(:role => 'admin' ,:user_id => 1) # => get request to http://foo_svc/foobar?role=admin&user_id=1 # FooService.user.admin(:user_id => 1) # => get request to http://foo_svc/foobar?role=admin&user_id=1 def method_missing *args + raise "Method missing calling method missing with #{args.first}" if caller.first =~ /^#{__FILE__}:\d+:in `method_missing'$/ # protect against a typo within this function creating a stack overflow name = args.shift method = args.first.is_a?(Symbol) ? args.shift : :get options = args.shift||{}
protect against stack overflows from method missing
tal_URL
train
rb
bd3b64572c76339c938c63643646d12951e07392
diff --git a/voltron/plugins/view/memory.py b/voltron/plugins/view/memory.py index <HASH>..<HASH> 100644 --- a/voltron/plugins/view/memory.py +++ b/voltron/plugins/view/memory.py @@ -100,10 +100,12 @@ class MemoryView(TerminalView): if self.args.words: if target['byte_order'] =='little': - byte_array.reverse() - for x in byte_array: - yield x - yield (Text, ' ') + byte_array_words = [byte_array[i:i+ target['addr_size']] for i in range(0, self.args.bytes, target['addr_size'])] + for word in byte_array_words: + word.reverse() + for x in word: + yield x + yield (Text, ' ') else: for x in byte_array: yield x @@ -151,7 +153,7 @@ class MemoryView(TerminalView): if t_res and t_res.is_success and len(t_res.targets) > 0: target = t_res.targets[0] - if self.args.deref or self.args.words: + if self.args.deref: self.args.bytes = target['addr_size'] f = pygments.formatters.get_formatter_by_name(self.config.format.pygments_formatter,
Added ability to specify number of bytes to display with args.words
snare_voltron
train
py
772ba36a7230154b0f99957806f715af8d1eccde
diff --git a/federation/pkg/federation-controller/service/dns.go b/federation/pkg/federation-controller/service/dns.go index <HASH>..<HASH> 100644 --- a/federation/pkg/federation-controller/service/dns.go +++ b/federation/pkg/federation-controller/service/dns.go @@ -199,7 +199,7 @@ func (s *ServiceController) ensureDnsRrsets(dnsZoneName, dnsName string, endpoin } } else { // the rrset already exists, so make it right. - glog.V(4).Infof("Recordset %v already exists. Ensuring that it is correct.") + glog.V(4).Infof("Recordset %v already exists. Ensuring that it is correct.", rrset) if len(endpoints) < 1 { // Need an appropriate CNAME record. Check that we have it. newRrset := rrsets.New(dnsName, []string{uplevelCname}, minDnsTtl, rrstype.CNAME)
Fixup debug log line in federation controller
kubernetes_kubernetes
train
go
4590b68f458d843d46e8ef0257820290408166f6
diff --git a/lib/hammer_cli_katello/ping.rb b/lib/hammer_cli_katello/ping.rb index <HASH>..<HASH> 100644 --- a/lib/hammer_cli_katello/ping.rb +++ b/lib/hammer_cli_katello/ping.rb @@ -35,13 +35,6 @@ module HammerCLIKatello end end - label "elasticsearch" do - from "elasticsearch" do - field "status", _("Status") - field "_response", _("Server Response") - end - end - label "foreman_tasks" do from "foreman_tasks" do field "status", _("Status")
refs #<I> - remove elasticsearch from hammer ping
Katello_hammer-cli-katello
train
rb
9421b501fb2aa3fbc9a483644496f3cdaa138f77
diff --git a/src/main/com/mongodb/DBCollection.java b/src/main/com/mongodb/DBCollection.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/DBCollection.java +++ b/src/main/com/mongodb/DBCollection.java @@ -410,14 +410,15 @@ public abstract class DBCollection { /** * Ensures an index on this collection (that is, the index will be created if it does not exist). * @param keys fields to use for index - * @param name an identifier for the index + * @param name an identifier for the index. If null or empty, the default name will be used. * @param unique if the index should be unique * @throws MongoException */ public void ensureIndex( DBObject keys , String name , boolean unique ) throws MongoException { DBObject options = defaultOptions( keys ); - options.put( "name" , name ); + if (name != null && !name.isEmpty()) + options.put( "name" , name ); if ( unique ) options.put( "unique" , Boolean.TRUE ); ensureIndex( keys , options );
improved ensureIndex to use default index name if null is provided, instead of getting mongoexception
mongodb_mongo-java-driver
train
java
8a58d09665eba2ddb12a85424a16442e3e79dac5
diff --git a/lib/artillery-global.js b/lib/artillery-global.js index <HASH>..<HASH> 100644 --- a/lib/artillery-global.js +++ b/lib/artillery-global.js @@ -45,11 +45,11 @@ async function createGlobalObject(opts) { if (typeof opts === 'string') { level = opts; } else { + opts = opts || {}; level = opts.level || 'info'; } opts.level = level; - global.artillery.globalEvents.emit('log', msg, opts); },
fix(global): handle artillery.log() with just one argument
artilleryio_artillery
train
js
5746b3a3c2b3d9a22863f353ff5c0f41eaac5a21
diff --git a/Fields/CaptchaField.php b/Fields/CaptchaField.php index <HASH>..<HASH> 100644 --- a/Fields/CaptchaField.php +++ b/Fields/CaptchaField.php @@ -75,7 +75,7 @@ class CaptchaField extends Field $input_html = parent::getHtml(); $this->value = $temp; - $_SESSION['Formidable_Captcha'] = $this->getCaptchaValue(); + $_SESSION['Formidable_Captcha'] = strtolower($this->getCaptchaValue()); $html = '<img src="'.$this->builder->inline().'" class="Formidable_Captcha" alt="Code visuel" ><br />'.$input_html;
Captcha stored should be lowercase as well
Gregwar_Formidable
train
php
3973424490bcafd21c0498c4ade8c102041edbf3
diff --git a/lib/resource-loader.js b/lib/resource-loader.js index <HASH>..<HASH> 100644 --- a/lib/resource-loader.js +++ b/lib/resource-loader.js @@ -20,7 +20,12 @@ function loadYamls (resourceList, config) { // TODO: Do any string substituion here // Do i parse the result here? or should i wait? const jsonYaml = helpers.yamlToJson(data); + if (!config.definedProperties) { + return resolve(jsonYaml); + } + const stringJSON = JSON.stringify(jsonYaml); + /* eslint prefer-template: "off" */ const reduced = config.definedProperties.reduce((acc, curr) => { return acc.split('${' + curr.key + '}').join(curr.value);
bug: when using the programmable api, there was a failure getting the resource files since defined properties were not, defined
nodeshift_nodeshift
train
js
7a35c9a6ade5a6d8d64d1b0665072b86af714cff
diff --git a/GPy/kern/_src/rbf.py b/GPy/kern/_src/rbf.py index <HASH>..<HASH> 100644 --- a/GPy/kern/_src/rbf.py +++ b/GPy/kern/_src/rbf.py @@ -38,6 +38,15 @@ class RBF(Stationary): def dK_dr(self, r): return -r*self.K_of_r(r) + def __getstate__(self): + dc = super(RBF, self).__getstate__() + if self.useGPU: + dc['psicomp'] = PSICOMP_RBF() + return dc + + def __setstate__(self, state): + return super(RBF, self).__setstate__(state) + #---------------------------------------# # PSI statistics # #---------------------------------------#
fix pickle for RBF GPU kernel
SheffieldML_GPy
train
py
4543b6ef56425734f0b2109a3a1a0a5a40dea193
diff --git a/externs/window.js b/externs/window.js index <HASH>..<HASH> 100644 --- a/externs/window.js +++ b/externs/window.js @@ -121,6 +121,10 @@ var sun; // Identity Protection has been fixed and pushed to most people. var o; +// Used by extensions as $j = jQuery.noConflict();. This overwrites whatever's +// stored in the variable '$j' with a function. +var $j; + /** * @see https://developer.mozilla.org/en/DOM/window.alert */
Have JsCompiler avoid renaming variables to '$j' because extensions which use: $j = jQuery.noConflict(); override the value of '$j' with a function. R=nicksantos DELTA=4 (4 added, 0 deleted, 0 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-compiler
train
js
6ec7cb05ddd256bbc8a10fe5eaf2f51cb6265e0a
diff --git a/gui/tools/designer.py b/gui/tools/designer.py index <HASH>..<HASH> 100644 --- a/gui/tools/designer.py +++ b/gui/tools/designer.py @@ -63,7 +63,7 @@ class BasicDesigner: self.key_press(evt) elif evt.GetEventType() == wx.EVT_LEFT_DOWN.typeId: # calculate time between clicks (is this a double click?) - if not self.timestamp or evt.Timestamp - self.timestamp > 1000: + if not self.timestamp or evt.Timestamp - self.timestamp > 500: # no, process normal mouse click and store obj for later dclick self.mouse_down(evt) self.last_obj = getattr(evt.GetEventObject(), "obj")
fixed dclick time interval in GTK
reingart_gui2py
train
py
e500404ab357056ed0188ae82e1c010cd7b81e03
diff --git a/src/FrontendIntegration/FrontendFilter.php b/src/FrontendIntegration/FrontendFilter.php index <HASH>..<HASH> 100644 --- a/src/FrontendIntegration/FrontendFilter.php +++ b/src/FrontendIntegration/FrontendFilter.php @@ -384,7 +384,7 @@ class FrontendFilter } $arrWidgets = $filterSetting->getParameterFilterWidgets( - $all->getSlugParameters(), + array_merge($all->getSlugParameters(), $all->getGetParameters()), $jumpToInformation, $filterOptions );
Update FrontendFilter.php Parameters are not correct implemented here. @discordier knows more about this ;-)
MetaModels_core
train
php
9257d80f2d24125976ebe8d2f7ee1176e8e19696
diff --git a/hangups/longpoll.py b/hangups/longpoll.py index <HASH>..<HASH> 100644 --- a/hangups/longpoll.py +++ b/hangups/longpoll.py @@ -211,9 +211,9 @@ def _parse_conversation_status(message): return ( 'on_conversation', message[0][0], - # participant list items sometimes can be length 2 or 3 - # ids, name, ? - {tuple(item[0]): item[1] for item in message[13]} + # Participant list: [[id, id], optional_name, optional_???] + {tuple(item[0]): item[1] if len(item) > 1 else None + for item in message[13]}, )
Fix conv status parser assuming name is present Fixes #9
tdryer_hangups
train
py
ee901cc5ecdaac45ab7f4ddcffadeef1969b1dfc
diff --git a/cgjs/process.js b/cgjs/process.js index <HASH>..<HASH> 100644 --- a/cgjs/process.js +++ b/cgjs/process.js @@ -14,11 +14,12 @@ dir.resolve_relative_path(arg).get_path() )); - const env = {}; - GLib.get_environ().forEach(info => { - const i = info.indexOf('='); - env[info.slice(0, i)] = info.slice(i + 1); - }); - this.env = env; + this.env = GLib.listenv().reduce( + (env, key) => { + env[key] = GLib.getenv(key); + return env; + }, + {} + ); })(imports.gi);
better way to retrieve the env
cgjs_cgjs
train
js
f6db624ea638751a4cdc89acc90a401370fdb2bb
diff --git a/src/Magyarjeti/Loripsum/Http/CurlAdapter.php b/src/Magyarjeti/Loripsum/Http/CurlAdapter.php index <HASH>..<HASH> 100644 --- a/src/Magyarjeti/Loripsum/Http/CurlAdapter.php +++ b/src/Magyarjeti/Loripsum/Http/CurlAdapter.php @@ -18,6 +18,10 @@ class CurlAdapter implements AdapterInterface curl_close($ch); + if ($response === false) { + throw new \RuntimeException('Connection timeout.'); + } + return $response; } }
Fix #1 - Throw exception on curl timeout
magyarjeti_loripsum-client
train
php
31bf6b9bef55e9a08afe9dc06f8bf3a15c613cf7
diff --git a/org.jenetics/src/main/java/org/jenetics/ExponentialRankSelector.java b/org.jenetics/src/main/java/org/jenetics/ExponentialRankSelector.java index <HASH>..<HASH> 100644 --- a/org.jenetics/src/main/java/org/jenetics/ExponentialRankSelector.java +++ b/org.jenetics/src/main/java/org/jenetics/ExponentialRankSelector.java @@ -19,6 +19,7 @@ */ package org.jenetics; +import static java.lang.Double.compare; import static java.lang.Math.pow; import static java.lang.String.format; @@ -71,9 +72,9 @@ public final class ExponentialRankSelector< public ExponentialRankSelector(final double c) { super(true); - if (c < 0.0 || c >= 1.0) { + if (compare(c, 0) < 0 || compare(c, 1) >= 0) { throw new IllegalArgumentException(format( - "Value %s is out of range [0..1): ", c + "Value %f is out of range [0..1): ", c )); } _c = c;
Improve pre-condition check of 'ExponentialRankSelector'.
jenetics_jenetics
train
java
84345cd5807a574c49ee633b7e3598ca88806952
diff --git a/rrset.go b/rrset.go index <HASH>..<HASH> 100644 --- a/rrset.go +++ b/rrset.go @@ -196,7 +196,7 @@ type SBPoolProfile struct { MaxServed int `json:"maxServed,omitempty"` RDataInfo []SBRDataInfo `json:"rdataInfo"` BackupRecords []BackupRecord `json:"backupRecords"` - AvailableToServe bool `json:"availableToServe,-"` + AvailableToServe bool `json:"availableToServe,omitempty"` } // SBRDataInfo wraps the rdataInfo object of a SBPoolProfile @@ -224,7 +224,7 @@ type TCPoolProfile struct { MaxToLB int `json:"maxToLB,omitempty"` RDataInfo []SBRDataInfo `json:"rdataInfo"` BackupRecord *BackupRecord `json:"backupRecord,omitempty"` - AvailableToServe bool `json:"availableToServe,-"` + AvailableToServe bool `json:"availableToServe,omitempty"` } // RRSet wraps an RRSet resource
Using - in that manner is undefined behaviour. Switching to omitempty.
terra-farm_udnssdk
train
go
00cae77ec78b683bdf37caacd3f0fbd61d6d3b78
diff --git a/packages/babel-polyfill/src/index.js b/packages/babel-polyfill/src/index.js index <HASH>..<HASH> 100644 --- a/packages/babel-polyfill/src/index.js +++ b/packages/babel-polyfill/src/index.js @@ -1,5 +1,7 @@ import "./noConflict"; +import global from "core-js/library/fn/global"; + if (global._babelPolyfill && typeof console !== "undefined" && console.warn) { console.warn( "@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " +
fix #<I>, add some missed modules to `noConflict` (#<I>)
babel_babel
train
js
243381e588708084f5d8d54966cb8b279305ee50
diff --git a/tests/test_transforms.py b/tests/test_transforms.py index <HASH>..<HASH> 100644 --- a/tests/test_transforms.py +++ b/tests/test_transforms.py @@ -74,8 +74,8 @@ class TestScale: def test_will_shrink_height(self, image): ''' - if specified dimension is larger than image, it shouldn't enlarge - the image + if image is larger than specified dimension, should shrink down + to that dimension ''' transform = simpleimages.transforms.Scale(height=500) @@ -85,3 +85,17 @@ class TestScale: new_width, new_height = get_image_dimensions(new_image) assert new_height == 500 + + def test_will_shrink_proportionally(self, image): + ''' + if one dimension is too large, the other should be shrunk down as well + ''' + + transform = simpleimages.transforms.Scale(height=10) + image.width = 20 + image.height = 2 * image.width + + new_image = transform(image.django_file) + + new_width, new_height = get_image_dimensions(new_image) + assert new_height == 2 * new_width
add test for transforming scale both dimensions
saulshanabrook_django-simpleimages
train
py
6026a9174157a3db4635d194f92b4fbed0b7f9cd
diff --git a/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js b/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js index <HASH>..<HASH> 100644 --- a/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js +++ b/modeltranslation/static/modeltranslation/js/tabbed_translation_fields.js @@ -3,8 +3,7 @@ var google, django, gettext; (function () { - var t = jQuery || $ || django.jQuery; - jQuery = t; // Note: This is not equivalent to "var jQuery = jQuery || ...". + var jQuery = window.jQuery || $ || django.jQuery; /* Add a new selector to jQuery that excludes parent items which match a given selector */ jQuery.expr[':'].parents = function(a, i, m) {
A more elegant solution suggested by zlorf.
deschler_django-modeltranslation
train
js
3781ff7d602e28421ff81f4bc3187487f52a5fe8
diff --git a/RoboFile.php b/RoboFile.php index <HASH>..<HASH> 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -426,14 +426,13 @@ class RoboFile extends Tasks implements LoggerAwareInterface { */ protected function getLastTagOnBranch($current_branch) { $output = $this->taskExecStack() - ->exec("git tag --merged $current_branch") + ->exec("git tag --sort=-v:refname --merged $current_branch") ->interactive(FALSE) ->silent(TRUE) ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE) ->run() ->getMessage(); - $lines = explode("\n", $output); - $tags_on_branch = array_reverse($lines); + $tags_on_branch = explode("\n", $output); $prev_tag = reset($tags_on_branch); return $prev_tag;
Fixed release notes for version numbers above <I>.
acquia_blt
train
php
4fa0d2f5518a3ba463d0cc50b6b0d646980e53f9
diff --git a/sendgrid/helpers/mail/header.py b/sendgrid/helpers/mail/header.py index <HASH>..<HASH> 100644 --- a/sendgrid/helpers/mail/header.py +++ b/sendgrid/helpers/mail/header.py @@ -17,6 +17,7 @@ class Header(object): """ self._key = None self._value = None + self._validator.validate_message_dict(value) if key is not None: self.key = key @@ -45,6 +46,7 @@ class Header(object): @value.setter def value(self, value): + self._validator.validate_message_dict(value) self._value = value def get(self):
Added validations for SendGrid API key
sendgrid_sendgrid-python
train
py
2b5b909529dcb19db3d647acd84887687f8f2dd8
diff --git a/MySQLdb/MySQLdb/cursors.py b/MySQLdb/MySQLdb/cursors.py index <HASH>..<HASH> 100644 --- a/MySQLdb/MySQLdb/cursors.py +++ b/MySQLdb/MySQLdb/cursors.py @@ -166,7 +166,7 @@ class BaseCursor(object): try: r = None r = self._query(query) - except TypeError as m: + except TypeError, m: if m.args[0] in ("not enough arguments for format string", "not all arguments converted"): self.messages.append((ProgrammingError, m.args[0])) @@ -217,7 +217,7 @@ class BaseCursor(object): qv = m.group(1) try: q = [ qv % db.literal(a) for a in args ] - except TypeError as msg: + except TypeError, msg: if msg.args[0] in ("not enough arguments for format string", "not all arguments converted"): self.errorhandler(self, ProgrammingError, msg.args[0])
Revert raise exc as value statements to raise exc, value since it breaks Python < <I>.
PyMySQL_mysqlclient-python
train
py
42b76a27786698800376fc59a02876c552aadda2
diff --git a/ghost/admin/app/components/gh-spin-button.js b/ghost/admin/app/components/gh-spin-button.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/components/gh-spin-button.js +++ b/ghost/admin/app/components/gh-spin-button.js @@ -31,8 +31,8 @@ export default Ember.Component.extend({ this.set('showSpinnerTimeout', Ember.run.later(this, function () { if (!this.get('submitting')) { this.set('showSpinner', false); - this.set('showSpinnerTimeout', null); } + this.set('showSpinnerTimeout', null); }, 1000)); } else if (!submitting && timeout === null) { this.set('showSpinner', false);
Prevent gh-spin-button from infinite spin closes #<I> - Always set showSpinnerTimeout back to null after 1 second.
TryGhost_Ghost
train
js
36dcdcef6bfe99c0cb3f602f724213dc11d9ccef
diff --git a/code/forms/GridFieldSortableRows.php b/code/forms/GridFieldSortableRows.php index <HASH>..<HASH> 100644 --- a/code/forms/GridFieldSortableRows.php +++ b/code/forms/GridFieldSortableRows.php @@ -678,4 +678,3 @@ class GridFieldSortableRows implements GridField_HTMLProvider, GridField_ActionP } } } -?>
Remove closing PHP tag (#<I>) To prevent whitespace being sent after the closing tag
UndefinedOffset_SortableGridField
train
php
daa6445cbaa2dd2ec7c02a2598baafac6fa917bb
diff --git a/kitchen-sink/routes.js b/kitchen-sink/routes.js index <HASH>..<HASH> 100644 --- a/kitchen-sink/routes.js +++ b/kitchen-sink/routes.js @@ -208,7 +208,7 @@ export default [ component: NestedRoutesTabs, tabs: [ { - path: '/tab-1/:id/:post_id', + path: '/', tabId: 'tab1', component: Tab1 }, @@ -218,11 +218,6 @@ export default [ component: Tab2 }, { - path: '/tab-2/:id2/:post_id2', - tabId: 'tab2', - component: Tab2 - }, - { path: '/tab-3/', tabId: 'tab3', routes: [
fix issue with nested routes due to additional params added
framework7io_framework7-vue
train
js
7633329d8288d11ddfc830c79af8a2efed396cfb
diff --git a/lxd/instance/drivers/driver_lxc.go b/lxd/instance/drivers/driver_lxc.go index <HASH>..<HASH> 100644 --- a/lxd/instance/drivers/driver_lxc.go +++ b/lxd/instance/drivers/driver_lxc.go @@ -1301,7 +1301,7 @@ func (d *lxc) IdmappedStorage(path string) idmap.IdmapStorageType { err := unix.Statfs(path, buf) if err != nil { // Log error but fallback to shiftfs - d.logger.Error("Failed to statfs", logger.Ctx{"err": err}) + d.logger.Error("Failed to statfs", logger.Ctx{"path": path, "err": err}) return mode }
lxd/instance/drivers/driver/lxc: Log path in IdmappedStorage
lxc_lxd
train
go
2ef78ede7786fe32996c57166b4e12005d55aaca
diff --git a/gulp-tasks/build-packages.js b/gulp-tasks/build-packages.js index <HASH>..<HASH> 100644 --- a/gulp-tasks/build-packages.js +++ b/gulp-tasks/build-packages.js @@ -23,7 +23,7 @@ async function cleanPackage(packagePath) { if (await fse.pathExists(upath.join(packagePath, 'src', 'index.ts'))) { // Store the list of deleted files, so we can delete directories after. const deletedPaths = await del([ - upath.join(packagePath, '**/*.+(js|mjs|d.ts|tsbuildinfo)'), + upath.join(packagePath, '**/*.+(js|mjs|d.ts)'), // Don't delete files in node_modules. '!**/node_modules', '!**/node_modules/**/*', ]); @@ -39,8 +39,12 @@ async function cleanPackage(packagePath) { } await del([...directoriesToDelete]); } + // Delete build files. await del(upath.join(packagePath, constants.PACKAGE_BUILD_DIRNAME)); + + // Delete tsc artifacts (if present). + await del(upath.join(packagePath, 'tsconfig.tsbuildinfo')); } // Wrap this in a function since it's used multiple times.
Ensure cli's tsbuild gets deleted (#<I>)
GoogleChrome_workbox
train
js
1e2ab564f9680fe8ac4fbd55c36eb420f46498e6
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -20,7 +20,7 @@ module ActiveRecord # be cached. Usually caching only pays off for attributes with expensive conversion # methods, like time related columns (e.g. +created_at+, +updated_at+). def cache_attributes(*attribute_names) - attribute_names.each {|attr| cached_attributes << attr.to_s} + cached_attributes.merge attribute_names.map { |attr| attr.to_s } end # Returns the attributes which are cached. By default time related columns
fewer funcalls to the cached attributes variable
rails_rails
train
rb
9c565b62d5b9c4e7e642fec69bd3272274726310
diff --git a/packages/openneuro-server/datalad/snapshots.js b/packages/openneuro-server/datalad/snapshots.js index <HASH>..<HASH> 100644 --- a/packages/openneuro-server/datalad/snapshots.js +++ b/packages/openneuro-server/datalad/snapshots.js @@ -172,11 +172,15 @@ export const getSnapshot = async (datasetId, tag) => { .findOne({ datasetId, tag }, { files: true }) .then(result => result.files) } + let created = await c.crn.snapshots + .findOne({ datasetId, tag }) + .then(result => result.created) + // If not public, fallback URLs are used const filesWithUrls = body.files.map( addFileUrl(datasetId, tag, externalFiles), ) - const snapshot = { ...body, files: filesWithUrls } + const snapshot = { ...body, created, files: filesWithUrls } redis.set(key, JSON.stringify(snapshot)) return snapshot })
Server: add "created" field to getSnapshot
OpenNeuroOrg_openneuro
train
js
dee8319c1e4a262f860ecea9abfcf90665d38eaa
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/advSearchOptContainer.js b/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/advSearchOptContainer.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/advSearchOptContainer.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/globalSearch/advSearchOptContainer.js @@ -501,8 +501,7 @@ define([ }); this._searchScopeSection.embedExplorer(this._searchScopeExplorer, scopeExplorerNode); -// this._searchScopeExplorer.setCommandsVisible(true, "singleSelection"); //$NON-NLS-0$ //TODO remove "singleSelection" once multiple selection is supported - this._searchScopeExplorer.setCommandsVisible(true); + this._searchScopeExplorer.setCommandsVisible(true, "singleSelection"); //$NON-NLS-0$ //TODO remove "singleSelection" once multiple selection is supported this._searchScopeExplorer.loadRoot(this._rootURL); },
Bug <I> - Search: Add ability to select search scope from within the search page - Disable multiple folder selection until it is supported by the underlying infrastructure
eclipse_orion.client
train
js
c0cd45292631e45b72d3d40e59c15e4d5352328a
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -4,6 +4,6 @@ package ipfs var CurrentCommit string // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.4.23-rc1" +const CurrentVersionNumber = "0.4.23-rc2" const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/"
release: bump to <I>-rc2
ipfs_go-ipfs
train
go
68cbeabf95f74d401a1189c55860490a59b6b2ac
diff --git a/src/Orchestra/Foundation/Processor/Registration.php b/src/Orchestra/Foundation/Processor/Registration.php index <HASH>..<HASH> 100644 --- a/src/Orchestra/Foundation/Processor/Registration.php +++ b/src/Orchestra/Foundation/Processor/Registration.php @@ -119,7 +119,7 @@ class Registration extends AbstractableProcessor $message = new Fluent(array( 'subject' => trans('orchestra/foundation::email.credential.register', array('site' => $site)), - 'view' => 'orchestra/foundation::email.credential.register', + 'view' => 'emails.auth.register', 'data' => $data, ));
Update register email template view to app skeleton. Closes #<I>.
orchestral_foundation
train
php
a394e0a9230fe125ee7c8aa5ccc43e9d03f45a4c
diff --git a/glooey/widget.py b/glooey/widget.py index <HASH>..<HASH> 100644 --- a/glooey/widget.py +++ b/glooey/widget.py @@ -569,7 +569,7 @@ class Widget (pyglet.event.EventDispatcher): self._children_under_mouse = set() def yield_previous_children_then_others(): - yield from previously_under_mouse + yield from self.__children & previously_under_mouse yield from self.__children - previously_under_mouse for child in yield_previous_children_then_others():
Don't count removed children as being "under the mouse".
kxgames_glooey
train
py
1e741d950692127feea47e9ac5c2dde8ed1e9f1b
diff --git a/tests/copulas/bivariate/test_base.py b/tests/copulas/bivariate/test_base.py index <HASH>..<HASH> 100644 --- a/tests/copulas/bivariate/test_base.py +++ b/tests/copulas/bivariate/test_base.py @@ -147,7 +147,6 @@ class TestBivariate(TestCase): # Check assert result == derivative_mock.return_value - derivative_mock.assert_called_once assert len(expected_args) == len(derivative_mock.call_args) assert (derivative_mock.call_args[0][0] == expected_args[0][0]).all()
Make tests compatible with py<I>
DAI-Lab_Copulas
train
py
4b0b777fde8de97e3f3b438b2cbe40745b6cc8e5
diff --git a/allegedb/allegedb/window.py b/allegedb/allegedb/window.py index <HASH>..<HASH> 100644 --- a/allegedb/allegedb/window.py +++ b/allegedb/allegedb/window.py @@ -544,7 +544,7 @@ class WindowDict(MutableMapping): self._past = list(data) self._past.sort() self._future = [] - self._keys = set(map(get0, self._past or ())) + self._keys = set(map(get0, self._past)) def __iter__(self): if not self: @@ -558,7 +558,7 @@ class WindowDict(MutableMapping): return item in self._keys def __len__(self): - return len(self._past or ()) + len(self._future or ()) + return len(self._past) + len(self._future) def __getitem__(self, rev): if not self:
Remove some old hedges from when WindowDict's stacks could be None
LogicalDash_LiSE
train
py
a0f8a7bf8d7d6b4faf4921ff45803942681c052a
diff --git a/oct2py/__init__.py b/oct2py/__init__.py index <HASH>..<HASH> 100644 --- a/oct2py/__init__.py +++ b/oct2py/__init__.py @@ -32,7 +32,11 @@ import imp import functools import os import ctypes -import thread + +try: + import thread +except ImportError: + import _thread as thread if os.name == 'nt':
thread was renamed to _thread on python3
blink1073_oct2py
train
py
f7a3e983d3fff77400d23c8f1032d1d148c5c58f
diff --git a/msm/mycroft_skills_manager.py b/msm/mycroft_skills_manager.py index <HASH>..<HASH> 100644 --- a/msm/mycroft_skills_manager.py +++ b/msm/mycroft_skills_manager.py @@ -253,8 +253,8 @@ class MycroftSkillsManager(object): func.__name__, skill.name )) - with ThreadPool(100) as tp: - return (tp.map(run_item, skills)) + with ThreadPool(20) as tp: + return tp.map(run_item, skills) @save_skills_data def install_defaults(self):
Reduce threadpool to size <I> (fixes #8)
MycroftAI_mycroft-skills-manager
train
py
6e8f66a140e44c42eb1ce53951daa998184e55f0
diff --git a/pgpy/pgp.py b/pgpy/pgp.py index <HASH>..<HASH> 100644 --- a/pgpy/pgp.py +++ b/pgpy/pgp.py @@ -28,7 +28,7 @@ def PGPLoad(pgpbytes): b = [] # now, are there any ASCII PGP blocks at all? - if f.is_ascii(): + if f.is_ascii: # decode/parse ASCII PGP blocks nascii = list(re.finditer(ASCII_BLOCK, f.bytes.decode(), flags=re.MULTILINE | re.DOTALL)) @@ -200,7 +200,7 @@ class PGPBlock(FileLoader): data = self.bytes # if type is bytes, try to decode so re doesn't choke - if self.is_ascii(): + if self.is_ascii: data = data.decode() # this is binary data; skip extracting the block and move on
is_ascii is a property method now
SecurityInnovation_PGPy
train
py
f701573f78428f6c1609b265e0a8f5854f3f66be
diff --git a/wandb/apis/public.py b/wandb/apis/public.py index <HASH>..<HASH> 100644 --- a/wandb/apis/public.py +++ b/wandb/apis/public.py @@ -1444,6 +1444,8 @@ class HistoryScan(object): raise StopIteration() self._load_next() + next = __next__ + @normalize_exceptions @retriable( check_retry_fn=util.no_retry_auth, @@ -1505,6 +1507,8 @@ class SampledHistoryScan(object): raise StopIteration() self._load_next() + next = __next__ + @normalize_exceptions @retriable( check_retry_fn=util.no_retry_auth,
run.scan_history() should return a valid iterable (#<I>)
wandb_client
train
py
e17cd1de914c3b0910e943c75c0de110f030f5f2
diff --git a/openhtf/user_input.py b/openhtf/user_input.py index <HASH>..<HASH> 100644 --- a/openhtf/user_input.py +++ b/openhtf/user_input.py @@ -73,6 +73,7 @@ class PromptManager(object): """ with self._cond: if self._prompt is not None: + self._prompt = None raise MultiplePromptsError self._prompt = Prompt(id=uuid.uuid4(), message=message, @@ -86,6 +87,7 @@ class PromptManager(object): console_prompt.Stop() self._prompt = None if self._response is None: + self._prompt = None raise PromptUnansweredError return self._response
Fix a bug in user_input module that broke the module the first time an exception was raised.
google_openhtf
train
py
1199c31feaef1e0032f3e88eefec5fb29e0e3e9d
diff --git a/leaflet.photon.js b/leaflet.photon.js index <HASH>..<HASH> 100644 --- a/leaflet.photon.js +++ b/leaflet.photon.js @@ -58,6 +58,7 @@ L.PhotonBaseSearch = L.PhotonBase.extend({ minChar: 3, limit: 5, submitDelay: 300, + targetElement: 'body', includePosition: true, noResultLabel: 'No result', feedbackEmail: 'photon@komoot.de', // Set to null to remove feedback box @@ -114,7 +115,7 @@ L.PhotonBaseSearch = L.PhotonBase.extend({ }, createResultsContainer: function () { - this.resultsContainer = L.DomUtil.create('ul', 'photon-autocomplete', document.querySelector('body')); + this.resultsContainer = L.DomUtil.create('ul', 'photon-autocomplete', document.querySelector(this.options.targetElement)); }, resizeContainer: function()
Update leaflet.photon.js
komoot_leaflet.photon
train
js
1baa9dff85176e2eea0f2d56d0787d6f9a842b69
diff --git a/Tests/checkPropTypes.js b/Tests/checkPropTypes.js index <HASH>..<HASH> 100644 --- a/Tests/checkPropTypes.js +++ b/Tests/checkPropTypes.js @@ -3,4 +3,4 @@ import { t } from 'testcafe'; export default async function () { const { error } = await t.getBrowserConsoleMessages(); await t.expect(error[0]).notOk(); -} \ No newline at end of file +}
TASK: Fix linting issues
neos_neos-ui
train
js
69a0eee52da983cfb517deee9b1db9f29bec85f2
diff --git a/vaex/file/other.py b/vaex/file/other.py index <HASH>..<HASH> 100644 --- a/vaex/file/other.py +++ b/vaex/file/other.py @@ -382,7 +382,7 @@ class FitsBinTable(DatasetMemoryMapped): else: for i in range(arraylength): name = column_name+"_" +str(i) - self.addColumn(name, offset=offset+bytessize*i/arraylength, dtype=">" +dtypecode, length=length, stride=arraylength) + self.addColumn(name, offset=offset+bytessize*i//arraylength, dtype=">" +dtypecode, length=length, stride=arraylength) if flatlength > 0: # flatlength can be offset += bytessize * length self._check_null(table, column_name, column, i)
fix: integer division for mmaped columns with arrays
vaexio_vaex
train
py
a77fd16869997fa36eb548c7976004a60063b7bb
diff --git a/salt/beacons/log.py b/salt/beacons/log.py index <HASH>..<HASH> 100644 --- a/salt/beacons/log.py +++ b/salt/beacons/log.py @@ -69,6 +69,12 @@ def beacon(config): file: <path> <tag>: regex: <pattern> + + .. note:: + + regex matching is based on the `re`_ module + + .. _re: https://docs.python.org/3.6/library/re.html#regular-expression-syntax ''' ret = []
Update salt.beacons.log to reflect that re module is used for matching. As more non-python users are starting to use Salt, it would be useful to point out which regular expression engines are in use so that users can adapt accordingly.
saltstack_salt
train
py
c229bacd1775815cb34b7ab2371585e373f7b7d5
diff --git a/lib/gherkin_lint/linter/required_tags_starts_with.rb b/lib/gherkin_lint/linter/required_tags_starts_with.rb index <HASH>..<HASH> 100644 --- a/lib/gherkin_lint/linter/required_tags_starts_with.rb +++ b/lib/gherkin_lint/linter/required_tags_starts_with.rb @@ -7,14 +7,10 @@ module GherkinLint include TagConstraint def match_pattern?(target) - match = false - - target.each do |t| - t.delete! '@' - match = t.start_with?(*@pattern) - break if match + target.each do |t| + return true if t.delete!('@').start_with?(*@pattern) end - match + false end end end
Removing state booleans
funkwerk_gherkin_lint
train
rb
4c2fb7d26b822b7088be05b6acb384fd9d9953c5
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -29,6 +29,15 @@ module.exports = function (redom) { var hello = el('p.hello', 'Hello world!'); t.equals(hello.outerHTML, '<p class="hello">Hello world!</p>'); }); + t.test('append number', function (t) { + t.plan(3); + var one = el('div', 1); + var minus = el('div', -1); + var zero = el('div', 0); + t.equals(one.outerHTML, '<div>1</div>'); + t.equals(minus.outerHTML, '<div>-1</div>'); + t.equals(zero.outerHTML, '<div>0</div>'); + }); t.test('multiple class', function (t) { t.plan(1); var hello = el('p.hello.world', 'Hello world!');
Added faild test test for element creation with number
redom_redom
train
js
98102d43248d27b21de8a4bd7a7722d26bca67f3
diff --git a/test/E2E/AbstractE2ETestCase.php b/test/E2E/AbstractE2ETestCase.php index <HASH>..<HASH> 100644 --- a/test/E2E/AbstractE2ETestCase.php +++ b/test/E2E/AbstractE2ETestCase.php @@ -397,7 +397,14 @@ abstract class AbstractE2ETestCase extends TestCase protected function runCommand(string $action, Process $process) { - $process->inheritEnvironmentVariables(true); + /* + * Method is removed in symfony/process:5.0 + * Still required in older symfony versions though (3.4 -> 4.4) + */ + if (method_exists($process, 'inheritEnvironmentVariables')) { + $process->inheritEnvironmentVariables(true); + } + $process->run(); if (!$process->isSuccessful()) { throw new \RuntimeException(
Fix for removed method in symfony/process:<I>
phpro_grumphp
train
php
d24e40c7ba22c97a3548e5c192aa980af7f0cb83
diff --git a/lib/rack/locale.rb b/lib/rack/locale.rb index <HASH>..<HASH> 100644 --- a/lib/rack/locale.rb +++ b/lib/rack/locale.rb @@ -20,7 +20,9 @@ module Rack locale, q = language_range.split(";q=") - OpenStruct.new(:language => locale.strip, :q => q) + language = locale.strip.split("-").first + + OpenStruct.new(:language => language, :q => q) end.sort {|x, y| y.q <=> x.q}.first.language end end diff --git a/spec/lib/rack/locale_spec.rb b/spec/lib/rack/locale_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/rack/locale_spec.rb +++ b/spec/lib/rack/locale_spec.rb @@ -41,4 +41,9 @@ describe Rack::Locale do get '/', {}, {"HTTP_ACCEPT_LANGUAGE" => "en;q=0.4, de;q=0.7"} last_request.env["locale.language"].should == "de" end + + it "should parse HTTP_ACCEPT_LANGUAGE 'en-US;q=0.7'" do + get '/', {}, {"HTTP_ACCEPT_LANGUAGE" => "en-US;q=0.7"} + last_request.env["locale.language"].should == "en" + end end
Parse the language out of a language tag containing subtags.
wrapp-archive_rack-geo-locale
train
rb,rb
27d2ee74c6b869f547f6d7942d16260396c3ffa1
diff --git a/ava/train.go b/ava/train.go index <HASH>..<HASH> 100644 --- a/ava/train.go +++ b/ava/train.go @@ -64,7 +64,7 @@ func aidedTrain(trainID int) error { if err != nil { return err } - log.Printf("HIT id", hit.HITId) + log.Println("HIT id", hit.HITId) return nil }
Fix logging of MTurk HIT IDs
itsabot_itsabot
train
go
c0d784d9372e57450c29bded1acbc03deba5fbbf
diff --git a/core/Controller/Scaffold.php b/core/Controller/Scaffold.php index <HASH>..<HASH> 100644 --- a/core/Controller/Scaffold.php +++ b/core/Controller/Scaffold.php @@ -184,7 +184,7 @@ abstract class Scaffold_Controller extends Controller implements Login_Required $options ); if (!$items && $page > 1) { - throw new HTTP404_Exception(); + throw new HTTP404_Exception; } return $items; } @@ -194,7 +194,7 @@ abstract class Scaffold_Controller extends Controller implements Login_Required try { return unserialize(base64_decode($key)); } catch (ErrorException $e) { - throw new HTTP404_Exception(); + throw new HTTP404_Exception; } } }
Squashed commit of the following: commit c7ade<I>add<I>cc<I>de<I>df6fb<I>fb<I>b1b
monomelodies_monad
train
php
f9df77dce5862e66568068f7f98950fe70f2b185
diff --git a/src/db/pgsql/PostgresConnector.php b/src/db/pgsql/PostgresConnector.php index <HASH>..<HASH> 100644 --- a/src/db/pgsql/PostgresConnector.php +++ b/src/db/pgsql/PostgresConnector.php @@ -219,7 +219,7 @@ class PostgresConnector extends Connector { */ protected function getSchemaSearchPath() { $options = $this->options; - $path = $rolledBack = null; + $path = null; while ($this->hConnection) { try { @@ -233,10 +233,14 @@ class PostgresConnector extends Connector { break; } catch (\Exception $ex) { - if ($rolledBack || !strContainsI($ex->getMessage(), 'current transaction is aborted, commands ignored until end of transaction block')) - throw $ex; - $rolledBack = true; - $this->rollback(); + if (strContainsI($ex->getMessage(), 'current transaction is aborted, commands ignored until end of transaction block')) { + if ($this->transactionLevel > 0) { + $this->transactionLevel = 1; // immediately skip nested transactions + $this->rollback(); + continue; + } + } + throw $ex; } } return $path;
fix exception handling in nested transactions
rosasurfer_ministruts
train
php
4764db6c2a945371c59bfbc68eedc5c05bd664d8
diff --git a/openquake/calculators/calc.py b/openquake/calculators/calc.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/calc.py +++ b/openquake/calculators/calc.py @@ -240,14 +240,3 @@ def make_uhs(maps): if imt.startswith('SA') or imt == 'PGA'))) hmaps = numpy.array([maps[imt] for imt in sorted_imts]) # I * N * P return hmaps.transpose(1, 0, 2) # N * I * P - - -def build_dict(shape, factory): - """ - Build a dictionary key -> factory(), where the key is a multi-index - obtained from indices of the given shape. For instance - - >>> sorted(build_dict((2, 2), list).items()) - [((0, 0), []), ((0, 1), []), ((1, 0), []), ((1, 1), [])] - """ - return {k: factory() for k in itertools.product(*map(range, shape))}
Removed unused build_dict function
gem_oq-engine
train
py
4a7809960dbd7dd2d57666e73d0d682ab858b77c
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,4 +1,4 @@ module Fastlane - VERSION = '1.84.0'.freeze + VERSION = '1.85.0'.freeze DESCRIPTION = "The easiest way to automate building and releasing your iOS and Android apps" end
[fastlane] Version bump * Added `device_grid` * Removed * from fastlane docs for required parameters * Shell escape git commit / tag messages
fastlane_fastlane
train
rb
0dcbbd4d41d61169408517c947b14a7e7c8000af
diff --git a/packages/posts/test/integration/db/models/post.js b/packages/posts/test/integration/db/models/post.js index <HASH>..<HASH> 100644 --- a/packages/posts/test/integration/db/models/post.js +++ b/packages/posts/test/integration/db/models/post.js @@ -3,6 +3,8 @@ import {expect} from "chai"; import PostModel, {createPost, createPosts, getPost, getPosts} from "../../../../db/models/post"; describe("Post", function () { + this.timeout(60000); + let stubPost; let stubPhoto; let stubPosts;
fix(posts): `Post` model integration tests timeout after <I>s. Seems like they're actually running. Don't think any `sleep`ing is required.
randytarampi_me
train
js
69812cc8cdc823e9a9b10154a37fdc2d349fd719
diff --git a/src/main/java/net/openhft/chronicle/network/VanillaSessionDetails.java b/src/main/java/net/openhft/chronicle/network/VanillaSessionDetails.java index <HASH>..<HASH> 100755 --- a/src/main/java/net/openhft/chronicle/network/VanillaSessionDetails.java +++ b/src/main/java/net/openhft/chronicle/network/VanillaSessionDetails.java @@ -153,6 +153,7 @@ public class VanillaSessionDetails implements SessionDetailsProvider { ", sessionId=" + sessionId + ", sessionMode=" + sessionMode + ", domain=" + domain + + ", clientId=" + clientId + '}'; } }
CE-<I>: improve logging/debugging
OpenHFT_Chronicle-Network
train
java
dd30efaf705fc396cec9b799bc4ac6f73ea352dd
diff --git a/src/helpers.js b/src/helpers.js index <HASH>..<HASH> 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -78,7 +78,7 @@ export function getDependencies(packageName: string): Array<Dependency> { export function promptUser(packageName: string, dependencies: Array<Dependency>): Promise<'Yes' | 'No' | 'Never'> { const configPath = Path.join(atom.getConfigDirPath(), 'package-deps-state.json') const configFile = new ConfigFile(configPath, { ignored: [] }) - if (configFile.get('ignored').indexOf(packageName) !== -1) { + if (configFile.get('ignored').includes(packageName)) { return Promise.resolve('No') }
:art: Address reviewer's comments
steelbrain_package-deps
train
js
ba75defc24f58e70a955f66109fcc71e94b7e224
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import find_packages, setup -VERSION = "0.0.15" +VERSION = "0.0.16" def readme():
version bump (#<I>)
dmulcahey_zha-device-handlers
train
py
ac77a8026ff71fd7ecd5809e851e30045fa2e8ab
diff --git a/lib/linter.js b/lib/linter.js index <HASH>..<HASH> 100644 --- a/lib/linter.js +++ b/lib/linter.js @@ -465,11 +465,10 @@ function resolveParserOptions(parserName, providedOptions, enabledEnvironments) * @returns {Object} The resolved globals object */ function resolveGlobals(providedGlobals, enabledEnvironments) { - return Object.assign.apply( - null, - [{}] - .concat(enabledEnvironments.filter(env => env.globals).map(env => env.globals)) - .concat(providedGlobals) + return Object.assign( + {}, + ...enabledEnvironments.filter(env => env.globals).map(env => env.globals), + providedGlobals ); }
Chore: Fixing a call to Object.assign.apply in Linter (#<I>)
eslint_eslint
train
js
ccf054901718bc225b851152165719f0e44d62bb
diff --git a/pydsl/Memory/File/Python.py b/pydsl/Memory/File/Python.py index <HASH>..<HASH> 100644 --- a/pydsl/Memory/File/Python.py +++ b/pydsl/Memory/File/Python.py @@ -79,5 +79,7 @@ def summary_python_file(modulepath): result["input"] = moduleobject.inputformat if hasattr(moduleobject, "outputformat"): result["output"] = moduleobject.outputformat + if hasattr(moduleobject, "name"): + result["name"] = moduleobject.name return ImmutableDict(result)
added name to python summary dictionary
nesaro_pydsl
train
py
551a79c8e6a64402a6dc0c5bc5d64a5288c17053
diff --git a/dallinger/experiment.py b/dallinger/experiment.py index <HASH>..<HASH> 100644 --- a/dallinger/experiment.py +++ b/dallinger/experiment.py @@ -599,6 +599,9 @@ class Experiment(object): def replay_event(self, event): pass + def replay_start(self): + pass + def replay_finish(self): pass @@ -680,7 +683,9 @@ class Experiment(object): # with experiment.restore_state_from_replay(...): block the configuration # options are correctly set with config.override(configuration_options, strict=True): + self.replay_start() yield go_to + self.replay_finish() # Clear up global state import_session.close()
give experiment a chance to initialize/finish around replaying state
Dallinger_Dallinger
train
py
8803f404ab69aaacc098aed70e79dec2058e7a67
diff --git a/dataviews/collector.py b/dataviews/collector.py index <HASH>..<HASH> 100644 --- a/dataviews/collector.py +++ b/dataviews/collector.py @@ -471,16 +471,17 @@ class Collector(AttrTree): View('example string'...) """ - interval_hook = param.Callable(RunProgress, doc=""" - A callable that advances by the specified time before the next - batch of collection tasks is executed. If set to a subclass of - RunProgress, the class will be instantiated and precent_range - updated to allow a progress bar to be displayed.""") - - time_fn = param.Callable(default=param.Dynamic.time_fn, doc=""" - A callable that returns the time where the time may be the - simulation time or wall-clock time. The time values are - recorded by the Stack keys.""") + # A callable that advances by the specified time before the next + # batch of collection tasks is executed. If set to a subclass of + # RunProgress, the class will be instantiated and precent_range + # updated to allow a progress bar to be displayed + interval_hook = RunProgress + + + # A callable that returns the time where the time may be the + # simulation time or wall-clock time. The time values are + # recorded by the Stack keys + time_fn = param.Dynamic.time_fn type_hooks = {}
Interval hook and time function now class attributes not parameters It is not possible to parameterize AttrTree instances that also pickle correctly as the __setstate__ implemented by param uses __setattr__ before the object is fully initialized.
pyviz_holoviews
train
py
a587add7dad76bc008781ca682085a31de34f26b
diff --git a/app/metal/hostess.rb b/app/metal/hostess.rb index <HASH>..<HASH> 100644 --- a/app/metal/hostess.rb +++ b/app/metal/hostess.rb @@ -13,7 +13,20 @@ class Hostess < Sinatra::Default if redirect redirect File.join("http://s3.amazonaws.com", VaultObject.current_bucket, request.path_info) else - VaultObject.value(request.path_info) + # Query S3 + result = VaultObject.value(request.path_info, + :if_modified_since => env['HTTP_IF_MODIFIED_SINCE'], + :if_none_match => env['HTTP_IF_NONE_MATCH']) + + # These should raise a 304 if either of them match + last_modified(result.response['last-modified']) if result.response['last-modified'] + etag(result.response['etag']) if result.response['etag'] + + # If we got a 304 back, let's give it back to the client + halt 304 if result.response.code == 304 + + # Otherwise return the result back + result end end end
Pass cache headers on to S3 and back to client. This should allow varnish to serve the body of most requests after checking freshness with the authoritative source.
rubygems_rubygems.org
train
rb
aecf79bf06fab34e1a6aa4a091a7301a3ca351de
diff --git a/src/Bonnier/WP/Cxense/Assets/Scripts.php b/src/Bonnier/WP/Cxense/Assets/Scripts.php index <HASH>..<HASH> 100644 --- a/src/Bonnier/WP/Cxense/Assets/Scripts.php +++ b/src/Bonnier/WP/Cxense/Assets/Scripts.php @@ -108,7 +108,7 @@ class Scripts // Only one? Just return it if(count($items) <= 1) { - return $items->name; + return $items[0]->name; }
Now takes name form the first and only array
BenjaminMedia_wp-cxense
train
php
2bcc95b902f14b64ec95a29fc3de9246f8817bce
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ here = path.abspath (path.dirname (__file__)) with open (path.join (here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() -# Get the version number and other params from package.json +# Get the version number and all other params from package.json with open (path.join (here, 'package.json'), encoding = 'utf-8') as f: package = json.load (f) @@ -45,6 +45,7 @@ setup ( 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: JavaScript', 'Programming Language :: PHP', 'Operating System :: OS Independent',
edited setup.py [skip ci]
ccxt_ccxt
train
py
5798215f53a1217a7706c9490b2aa435e0784b8c
diff --git a/lib/braid/commands/list.rb b/lib/braid/commands/list.rb index <HASH>..<HASH> 100644 --- a/lib/braid/commands/list.rb +++ b/lib/braid/commands/list.rb @@ -24,7 +24,7 @@ module Braid local_file_count = git.read_ls_files(mirror.path).split.size if 0 == local_file_count print ' (Removed Locally)' - elsif mirror.diff.empty? + elsif !mirror.diff.empty? print ' (Locally Modified)' end print "\n"
Fix the list command so that it correctly identifies braids with local changes
cristibalan_braid
train
rb
5be5cbbd88c9b3a581ba3d24f798155eca18bc36
diff --git a/lib/sonos.js b/lib/sonos.js index <HASH>..<HASH> 100644 --- a/lib/sonos.js +++ b/lib/sonos.js @@ -554,6 +554,9 @@ Sonos.prototype.getTopology = async function () { let zones, mediaServers zones = info.ZonePlayers.ZonePlayer + if(!Array.isArray(zones)) { + zones = [zones]; + } zones.forEach(zone => { zone.name = zone['_']
Force zones to be an array Should fix #<I>, but only tested it with a single device on the network, as the XML-to-object conversion then causes the Zones property to be a single object instead of an array of zones as is expected on the next line.
bencevans_node-sonos
train
js