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
45c8773374bf9df4277a18f1d24f8578d039ea87
diff --git a/Swat/exceptions/SwatException.php b/Swat/exceptions/SwatException.php index <HASH>..<HASH> 100644 --- a/Swat/exceptions/SwatException.php +++ b/Swat/exceptions/SwatException.php @@ -173,6 +173,34 @@ class SwatException extends Exception } // }}} + // {{{ public function processAndContinue() + + /** + * Processes this exception and continues execution + * + * Processing involves displaying errors, logging errors and sending + * error message emails + */ + public function processAndContinue() + { + $this->process(false, true); + } + + // }}} + // {{{ public function processAndExit() + + /** + * Processes this exception and stops execution + * + * Processing involves displaying errors, logging errors and sending + * error message emails + */ + public function processAndExit() + { + $this->process(true, true); + } + + // }}} // {{{ public function log() /**
Convenience methods for SwatException. svn commit r<I>
silverorange_swat
train
php
e352541825234abd3459d9cdc247333ed2f0acba
diff --git a/src/port-manager.js b/src/port-manager.js index <HASH>..<HASH> 100644 --- a/src/port-manager.js +++ b/src/port-manager.js @@ -92,6 +92,12 @@ fdom.port.Manager.prototype.onMessage = function(flow, message) { } this.createLink(origin, message.name, new fdom.port[message.service](message.args)); + } else if (message.request === 'bindport') { + this.createLink({id: message.id}, + 'custom' + message.port, + new fdom.port[message.service](message.args), + 'default', + true); } else if (message.request === 'delegate') { // Initate Delegation. if (this.delegate === null) {
add back in bind-port command. it's in use by the runtime.
freedomjs_freedom
train
js
8a7a40e809dc36a05eb759d7f5bc8ffe9a4f40f0
diff --git a/tests/data/ar/Customer.php b/tests/data/ar/Customer.php index <HASH>..<HASH> 100644 --- a/tests/data/ar/Customer.php +++ b/tests/data/ar/Customer.php @@ -51,6 +51,11 @@ class Customer extends ActiveRecord return $this->hasMany(OrderWithNullFK::className(), ['customer_id' => 'id'])->orderBy('created_at'); } + public function getOrdersWithItems() + { + return $this->hasMany(Order::className(), ['customer_id' => 'id'])->with('orderItems'); + } + public function afterSave($insert, $changedAttributes) { ActiveRecordTest::$afterSaveInsert = $insert;
Added test/data/ar/Customer::getOrderWithItems in order to fix test compatibility
yiisoft_yii2-elasticsearch
train
php
b3cac59bac6f7757b81beb183e9d3e357e23c803
diff --git a/test/server.test.js b/test/server.test.js index <HASH>..<HASH> 100644 --- a/test/server.test.js +++ b/test/server.test.js @@ -60,18 +60,18 @@ async function checkOut (name, args) { let result = await check(name, args, { }, 'kill') let out = result[0] let exit = result[1] + expect(out).toMatchSnapshot() if (exit !== 0) { throw new Error(`Fall with:\n${ out }`) } - expect(out).toMatchSnapshot() } async function checkError (name, args) { let result = await check(name, args) let out = result[0] let exit = result[1] - expect(exit).toEqual(1) expect(out).toMatchSnapshot() + expect(exit).toEqual(1) } afterEach(() => {
Improve server test debuggability on Travis CI
logux_server
train
js
16c491b4c4065645cf4b0c89218d82ee9888f25a
diff --git a/lib/janky/build.rb b/lib/janky/build.rb index <HASH>..<HASH> 100644 --- a/lib/janky/build.rb +++ b/lib/janky/build.rb @@ -243,6 +243,10 @@ module Janky self.class.base_url + "#{repo_name}/#{branch_name}" end + def room_id + repository.room_id + end + def repo_id repository.id end
Fix Chat Notifications Previously `room_id` was being passed to `speak` as undefined and the notification send was failing.
github_janky
train
rb
3cbad151afb17ab0a2fe6f43b63523dedb66ced6
diff --git a/lib/cronlib.php b/lib/cronlib.php index <HASH>..<HASH> 100644 --- a/lib/cronlib.php +++ b/lib/cronlib.php @@ -208,7 +208,7 @@ function cron_run() { if ($DB->count_records('user_preferences', array('name'=>'create_password', 'value'=>'1'))) { mtrace('Creating passwords for new users...'); $newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email, u.firstname, - u.lastname, u.username, + u.lastname, u.username, u.lang, p.id as prefid FROM {user} u JOIN {user_preferences} p ON u.id=p.userid
MDL-<I> use user's lang when sending new emails
moodle_moodle
train
php
bf8e2bb7b0d1da27ed727c333c61500a985da4d1
diff --git a/test/helpers/cons.go b/test/helpers/cons.go index <HASH>..<HASH> 100644 --- a/test/helpers/cons.go +++ b/test/helpers/cons.go @@ -318,7 +318,7 @@ var ciliumCLICommands = map[string]string{ "cilium status --all-controllers": "status.txt", "cilium kvstore get cilium --recursive": "kvstore_get.txt", - "hubble observe --since 4h -o json": "hubble_observe.txt", + "hubble observe --since 4h -o jsonpb": "hubble_observe.json", } // ciliumKubCLICommands these commands are the same as `ciliumCLICommands` but @@ -333,7 +333,7 @@ var ciliumKubCLICommands = map[string]string{ "cilium policy get": "policy_get.txt", "cilium status --all-controllers": "status.txt", - "hubble observe --since 4h -o json": "hubble_observe.txt", + "hubble observe --since 4h -o jsonpb": "hubble_observe.json", } // ciliumKubCLICommandsKVStore contains commands related to querying the kvstore.
test: Use hubble's jsonpb output in artifacts hubble observe now supports [1] reading flows from stdin if they are in jsonpb format. We should therefore emit jsonpb artifact files for tests, to be able to feed those files back into hubble observe. That will allow us to use hubble observe's filters and different output format. 1 - <URL>
cilium_cilium
train
go
ca6c07eb538fabe3d30c3fcbc3c2754878f1cdb6
diff --git a/test/core/cache.js b/test/core/cache.js index <HASH>..<HASH> 100644 --- a/test/core/cache.js +++ b/test/core/cache.js @@ -118,7 +118,7 @@ describe('Core: Cache', function(){ should.equal(null, load_resp); done(); }); - }, 1001); + }, 2001); }); }); });
ensure that loading from api.cache will re-set the key to expire
actionhero_actionhero
train
js
bfd85fdb76b672fc519cfe635e3334316be9d42d
diff --git a/flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java b/flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java index <HASH>..<HASH> 100755 --- a/flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java +++ b/flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/MesosResourceManager.java @@ -839,7 +839,7 @@ public class MesosResourceManager extends ResourceManager<RegisteredMesosWorkerN @Override public void disconnected(SchedulerDriver driver) { - runAsyncWithoutFencing(new Runnable() { + runAsync(new Runnable() { @Override public void run() { MesosResourceManager.this.disconnected(new Disconnected());
[FLINK-<I>] Remove unfenced execution of Disconnected message from MesosResourceManager This closes #<I>.
apache_flink
train
java
3577c2e6821464bb078f3bf7a6639c55cdeceb46
diff --git a/bcbio/pipeline/merge.py b/bcbio/pipeline/merge.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/merge.py +++ b/bcbio/pipeline/merge.py @@ -64,7 +64,8 @@ def merge_bam_files(bam_files, work_dir, config): out_file = os.path.join(work_dir, os.path.basename(sorted(bam_files)[0])) picard = broad.runner_from_config(config) if len(bam_files) == 1: - os.symlink(bam_files[0], out_file) + if not os.path.exists(out_file): + os.symlink(bam_files[0], out_file) else: picard.run_fn("picard_merge", bam_files, out_file) for b in bam_files:
Avoid merging BAM files when only one file present during no alignment processing
bcbio_bcbio-nextgen
train
py
92340432797d02c7167da2d61c1f9c2734d6c0c6
diff --git a/cassiopeia/datastores/kernel/common.py b/cassiopeia/datastores/kernel/common.py index <HASH>..<HASH> 100644 --- a/cassiopeia/datastores/kernel/common.py +++ b/cassiopeia/datastores/kernel/common.py @@ -38,7 +38,15 @@ class KernelSource(DataSource): url = f"{self._server_url}:{self._port}/{endpoint}" try: result, headers = self._client.get(url=url, parameters=parameters, connection=connection) - result = json.loads(result.decode()) + + # Ensure compatibility with both Curl and Requests based clients + if isinstance(result, bytes): + result = json.loads(result.decode()) + elif isinstance(result, str): + result = json.loads(result) + + if not isinstance(result, dict): + raise ValueError("Unexpected type returned from HTTPClient: {}".format(type(result))) except HTTPError as error: # The error handlers didn't work, so raise an appropriate error. new_error_type = _ERROR_CODES[error.code]
Ensure Kernel pipeline is compatible with all HTTPClients
meraki-analytics_cassiopeia
train
py
1783e0cad98c2d2457e24f4a10ef2913e447ad71
diff --git a/lib/detector.js b/lib/detector.js index <HASH>..<HASH> 100644 --- a/lib/detector.js +++ b/lib/detector.js @@ -136,14 +136,27 @@ Detector.prototype._detectMagicNumbers = function(syntaxTree, contents) { return; } + var line = lines[node.loc.start.line - 1]; + var startColumn = node.loc.start.column; + var endColumn = node.loc.end.column; + + // fix columns, since acorn counts parens in their location + if (line.slice(startColumn, startColumn + 1) === '(') { + startColumn += 1; + } + + if (line.slice(endColumn - 1, endColumn) === ')') { + endColumn -= 1; + } + self.emit('found', { value: node.value, file: node.loc.source, fileLength: fileLength, lineNumber: node.loc.start.line, - lineSource: lines[node.loc.start.line - 1], - startColumn: node.loc.start.column, - endColumn: node.loc.end.column, + lineSource: line, + startColumn: startColumn, + endColumn: endColumn, surroundingLines: utils.getSurroundingLines(node, lines) }); };
Fix columns when surrounded by parens
danielstjules_buddy.js
train
js
277415e6f9ee50c8abd8d9b131e93df716a289f0
diff --git a/tests/unit/src/Engine/Solr/SolrMapperTest.php b/tests/unit/src/Engine/Solr/SolrMapperTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/src/Engine/Solr/SolrMapperTest.php +++ b/tests/unit/src/Engine/Solr/SolrMapperTest.php @@ -67,4 +67,30 @@ class SolrMapperTest extends PHPUnit_Framework_TestCase $this->mapper->delete($identityStub); } + + public function testFind() + { + $rawDataStub = $this->getMockBuilder('\G4\DataMapper\Common\RawData') + ->disableOriginalConstructor() + ->getMock(); + + $this->adapterMock + ->expects($this->once()) + ->method('select') + ->willReturn($rawDataStub); + + $this->assertSame($rawDataStub, $this->mapper->find($this->getMock('\G4\DataMapper\Common\Identity'))); + } + + public function testFindException() + { + $this->adapterMock + ->expects($this->once()) + ->method('select') + ->will($this->throwException(new \Exception())); + + $this->expectException('\Exception'); + + $this->mapper->find($this->getMock('\G4\DataMapper\Common\Identity')); + } } \ No newline at end of file
<I> - Added methods to test find method in SolrMapper.
g4code_data-mapper
train
php
0fd494b7f0f08ebddba502f9079d2e83f8a4d6db
diff --git a/lib/flipper/cloud/dsl.rb b/lib/flipper/cloud/dsl.rb index <HASH>..<HASH> 100644 --- a/lib/flipper/cloud/dsl.rb +++ b/lib/flipper/cloud/dsl.rb @@ -17,6 +17,11 @@ module Flipper def sync_secret @cloud_configuration.sync_secret end + + def inspect + inspect_id = ::Kernel::format "%x", (object_id * 2) + %(#<#{self.class}:0x#{inspect_id} @cloud_configuration=#{cloud_configuration.inspect}, flipper=#{__getobj__.inspect}>) + end end end end
Make dsl inspect more accurately Before it would show inspect for the flipper instance
jnunemaker_flipper
train
rb
a226b3f2dc480d86b5780aa586a27a46ff74382c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ required = ['args'] setup( name='clint', version=clint.__version__, - description='Python Command-line Application Tools', + description='Python Command Line Interface Tools', long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(), author='Kenneth Reitz',
Update setup.py clint = "Command Line Interface Tools" tells me the README
kennethreitz_clint
train
py
ef6c1828c7b64e1cf99b98e27600d0b63308cad3
diff --git a/modules/casper.js b/modules/casper.js index <HASH>..<HASH> 100644 --- a/modules/casper.js +++ b/modules/casper.js @@ -742,9 +742,14 @@ Casper.prototype.getPageContent = function getPageContent() { */ Casper.prototype.getCurrentUrl = function getCurrentUrl() { "use strict"; - return decodeURIComponent(this.evaluate(function _evaluate() { + var url = this.evaluate(function _evaluate() { return document.location.href; - })); + }); + try { + return decodeURIComponent(url); + } catch (e) { + return url; + } }; /**
fixed edge case when current url couldn't be decoded
casperjs_casperjs
train
js
86abfd477523c6de7bb7a3e18c6fa83b8a5eb7e8
diff --git a/lib/poleica/version.rb b/lib/poleica/version.rb index <HASH>..<HASH> 100644 --- a/lib/poleica/version.rb +++ b/lib/poleica/version.rb @@ -1,5 +1,5 @@ # -*- encoding: utf-8 -*- # Poleica namespace module Poleica - VERSION = '0.10.0' + VERSION = '0.10.1.fix1' end # module Poleica
Bump to <I>.fix1
antoinelyset_poleica
train
rb
2a0c1d42e3227fc0c4a551c46dd84771fb31e773
diff --git a/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyService.java b/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyService.java index <HASH>..<HASH> 100644 --- a/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyService.java +++ b/service/http.proxy/src/main/java/org/kaazing/gateway/service/http/proxy/HttpProxyService.java @@ -25,6 +25,7 @@ import javax.annotation.Resource; import org.kaazing.gateway.resource.address.uri.URIUtils; import org.kaazing.gateway.service.ServiceContext; import org.kaazing.gateway.service.proxy.AbstractProxyService; +import org.kaazing.gateway.util.feature.EarlyAccessFeatures; /** * Http proxy service @@ -42,6 +43,7 @@ public class HttpProxyService extends AbstractProxyService<HttpProxyServiceHandl @Override public void init(ServiceContext serviceContext) throws Exception { + EarlyAccessFeatures.HTTP_PROXY_SERVICE.assertEnabled(configuration, serviceContext.getLogger()); super.init(serviceContext); Collection<String> connectURIs = serviceContext.getConnects(); if (connectURIs == null || connectURIs.isEmpty()) {
Added back the EarlyAccessFeature for ProxyService
kaazing_gateway
train
java
c82e8c19f60aee4568f1607b0dc20b577e664bfb
diff --git a/js/acx.js b/js/acx.js index <HASH>..<HASH> 100644 --- a/js/acx.js +++ b/js/acx.js @@ -163,12 +163,12 @@ module.exports = class acx extends Exchange { request['limit'] = limit; // default = 300 } const orderbook = await this.publicGetDepth (this.extend (request, params)); - const timestamp = this.safeIntegerProduct (orderbook, 'timestamp', 1000); + const timestamp = this.safeTimestamp (orderbook, 'timestamp'); return this.parseOrderBook (orderbook, timestamp); } parseTicker (ticker, market = undefined) { - const timestamp = this.safeIntegerProduct (ticker, 'at', 1000); + const timestamp = this.safeTimestamp (ticker, 'at'); ticker = ticker['ticker']; let symbol = undefined; if (market) {
acx safeTimestamp
ccxt_ccxt
train
js
7f80fd8187610b55e14763e18bab6bd4e42cd61d
diff --git a/springfox-swagger2/src/main/java/springfox/documentation/swagger2/web/Swagger2ControllerWebFlux.java b/springfox-swagger2/src/main/java/springfox/documentation/swagger2/web/Swagger2ControllerWebFlux.java index <HASH>..<HASH> 100644 --- a/springfox-swagger2/src/main/java/springfox/documentation/swagger2/web/Swagger2ControllerWebFlux.java +++ b/springfox-swagger2/src/main/java/springfox/documentation/swagger2/web/Swagger2ControllerWebFlux.java @@ -88,7 +88,7 @@ public class Swagger2ControllerWebFlux { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } Swagger swagger = mapper.mapDocumentation(documentation); - swagger.basePath("/"); + swagger.basePath(isEmpty(request.getPath().contextPath().value()) ? "/" : request.getPath().contextPath().value()); if (isEmpty(swagger.getHost())) { swagger.host(request.getURI().getAuthority()); }
Set the basePath using the request context path if present This allows the X-Forwarded-Prefix header to work correctly
springfox_springfox
train
java
00f6978c24c23957fc1f435fc552401e9b32951c
diff --git a/shillelagh/src/main/java/shillelagh/internal/ShillelaghInjector.java b/shillelagh/src/main/java/shillelagh/internal/ShillelaghInjector.java index <HASH>..<HASH> 100644 --- a/shillelagh/src/main/java/shillelagh/internal/ShillelaghInjector.java +++ b/shillelagh/src/main/java/shillelagh/internal/ShillelaghInjector.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.Iterator; /** Class in charge of creating all the code injected into other classes */ -public class ShillelaghInjector { +public final class ShillelaghInjector { // I'm not really happy with the code in here, but then again, I'm writing Java in Strings...
made ShillelaghInjector final
AndrewReitz_shillelagh
train
java
0b583c063bf09af539e5ac1b598a27b8f0d49b0a
diff --git a/es7/index.js b/es7/index.js index <HASH>..<HASH> 100644 --- a/es7/index.js +++ b/es7/index.js @@ -16,6 +16,7 @@ require('../modules/es7.object.lookup-getter'); require('../modules/es7.object.lookup-setter'); require('../modules/es7.map.to-json'); require('../modules/es7.set.to-json'); +require('../modules/es7.global'); require('../modules/es7.system.global'); require('../modules/es7.error.is-error'); require('../modules/es7.math.clamp'); diff --git a/library/es7/index.js b/library/es7/index.js index <HASH>..<HASH> 100644 --- a/library/es7/index.js +++ b/library/es7/index.js @@ -16,6 +16,7 @@ require('../modules/es7.object.lookup-getter'); require('../modules/es7.object.lookup-setter'); require('../modules/es7.map.to-json'); require('../modules/es7.set.to-json'); +require('../modules/es7.global'); require('../modules/es7.system.global'); require('../modules/es7.error.is-error'); require('../modules/es7.math.clamp');
add `global` to one missed entry point
zloirock_core-js
train
js,js
f9a7851c44696258ed5e31990d4be1df7ec9f2d0
diff --git a/src/main/java/stormpot/qpool/QAllocThread.java b/src/main/java/stormpot/qpool/QAllocThread.java index <HASH>..<HASH> 100644 --- a/src/main/java/stormpot/qpool/QAllocThread.java +++ b/src/main/java/stormpot/qpool/QAllocThread.java @@ -73,7 +73,10 @@ class QAllocThread<T extends Poolable> extends Thread { dealloc(slot); } else if (slot != null) { dealloc(slot); - alloc(slot); // TODO not covered + alloc(slot); + // mutation testing might note that the above alloc() call can be + // removed... that's okay, it's really just an optimisation that + // prevents us from creating new slots all the time - we reuse them. } } } catch (InterruptedException _) { diff --git a/src/test/java/stormpot/basicpool/BasicPool.java b/src/test/java/stormpot/basicpool/BasicPool.java index <HASH>..<HASH> 100644 --- a/src/test/java/stormpot/basicpool/BasicPool.java +++ b/src/test/java/stormpot/basicpool/BasicPool.java @@ -238,7 +238,7 @@ implements LifecycledPool<T>, ResizablePool<T> { public void release(Poolable obj) { bpool.lock.lock(); if (!claimed) { - bpool.lock.unlock(); // TODO not covered + bpool.lock.unlock(); return; } expired();
deal with the TODOs from the mutation testing.
chrisvest_stormpot
train
java,java
864092fc7cd5fc1b80a9502f373ebecdd07177b9
diff --git a/dallinger/experiment_server/gunicorn.py b/dallinger/experiment_server/gunicorn.py index <HASH>..<HASH> 100644 --- a/dallinger/experiment_server/gunicorn.py +++ b/dallinger/experiment_server/gunicorn.py @@ -60,7 +60,7 @@ class StandaloneServer(Application): config = get_config() workers = config.get("threads") if workers == "auto": - workers = str(multiprocessing.cpu_count() * 2 + 1) + workers = str(multiprocessing.cpu_count() + 1) host = config.get("host") mode = config.get("mode")
Reduce default gunicorn worker count.
Dallinger_Dallinger
train
py
7a34d22b3759c050243150f2d9c5324952f28f8e
diff --git a/test/spec/ol/interaction/modifyinteraction.test.js b/test/spec/ol/interaction/modifyinteraction.test.js index <HASH>..<HASH> 100644 --- a/test/spec/ol/interaction/modifyinteraction.test.js +++ b/test/spec/ol/interaction/modifyinteraction.test.js @@ -243,6 +243,7 @@ goog.require('ol.Feature'); goog.require('ol.Map'); goog.require('ol.MapBrowserPointerEvent'); goog.require('ol.View'); +goog.require('ol.events.condition'); goog.require('ol.geom.Point'); goog.require('ol.geom.Polygon'); goog.require('ol.interaction.Modify');
interaction/modify: Add missing goog.require() to test
openlayers_openlayers
train
js
e37790abf94f947100056b9502fddaa6e7a14fb5
diff --git a/source/Core/Edition/EditionSelector.php b/source/Core/Edition/EditionSelector.php index <HASH>..<HASH> 100644 --- a/source/Core/Edition/EditionSelector.php +++ b/source/Core/Edition/EditionSelector.php @@ -62,10 +62,10 @@ class EditionSelector $edition = static::COMMUNITY; - if (OXID_VERSION_EE) { + if (defined('OXID_VERSION_EE') && OXID_VERSION_EE) { $edition = static::ENTERPRISE; } - if (OXID_VERSION_PE_PE) { + if (defined('OXID_VERSION_PE_PE') && OXID_VERSION_PE_PE) { $edition = static::PROFESSIONAL; }
Check if constants is defined If constants was not yet defined, professional edition will be enabled.
OXID-eSales_oxideshop_ce
train
php
74cbdd053940bce46fd303bcfc95b8ce563e3a8b
diff --git a/iamport/client.py b/iamport/client.py index <HASH>..<HASH> 100644 --- a/iamport/client.py +++ b/iamport/client.py @@ -134,6 +134,10 @@ class Iamport(object): return self._post(url, kwargs) + def pay_schedule_get(self, merchant_id=''): + url = '{}subscribe/payments/schedule{}'.format(self.imp_url, merchant_id) + return self._get(url) + def pay_unschedule(self, **kwargs): url = '{}subscribe/payments/unschedule'.format(self.imp_url) if 'customer_uid' not in kwargs:
Implement pay_schedule_get function for checking scheduled payments
iamport_iamport-rest-client-python
train
py
95590217a6bd9c19cf7e2129e222672b8d4ec4fd
diff --git a/charmhelpers/contrib/charmsupport/nrpe.py b/charmhelpers/contrib/charmsupport/nrpe.py index <HASH>..<HASH> 100644 --- a/charmhelpers/contrib/charmsupport/nrpe.py +++ b/charmhelpers/contrib/charmsupport/nrpe.py @@ -210,7 +210,7 @@ class NRPE(object): super(NRPE, self).__init__() self.config = config() self.nagios_context = self.config['nagios_context'] - if 'nagios_servicegroups' in self.config and self.config['nagios_servicegroups'] != '': + if 'nagios_servicegroups' in self.config and not self.config['nagios_servicegroups']: self.nagios_servicegroups = self.config['nagios_servicegroups'] else: self.nagios_servicegroups = self.nagios_context
[bradm] Nicer way of expressing the nagios servicegroup fix, thanks to gnuoy
juju_charm-helpers
train
py
ad27fccf70cbc775e719c7f305464ba1d8ea4ba8
diff --git a/app/computed/debounce.js b/app/computed/debounce.js index <HASH>..<HASH> 100644 --- a/app/computed/debounce.js +++ b/app/computed/debounce.js @@ -1,8 +1,6 @@ -import { run } from '@ember/runloop'; +import { debounce } from '@ember/runloop'; import { computed } from '@ember/object'; -const { debounce } = run; - // Use this if you want a property to debounce // another property with a certain delay. // This means that every time this prop changes,
Fix deprecated use of `run.debounce` (#<I>)
emberjs_ember-inspector
train
js
41ffffbd31e899e6030b15c416e0e0ec15c1a027
diff --git a/src/spec.js b/src/spec.js index <HASH>..<HASH> 100644 --- a/src/spec.js +++ b/src/spec.js @@ -387,6 +387,19 @@ test("createInstance allows setting default props", async () => { expect(onResolve).toHaveBeenCalledWith("done") }) +test("custom instances also have helper components", async () => { + const promiseFn = () => resolveTo("done") + const CustomAsync = createInstance({ promiseFn }) + const { getByText } = render( + <CustomAsync> + <CustomAsync.Loading>loading</CustomAsync.Loading> + <CustomAsync.Resolved>resolved</CustomAsync.Resolved> + </CustomAsync> + ) + await waitForElement(() => getByText("loading")) + await waitForElement(() => getByText("resolved")) +}) + test("an unrelated change in props does not update the Context", async () => { let one let two
Add test for compound components on custom instance.
ghengeveld_react-async
train
js
170c89407dfe54ed72711687362ee0a358f5d604
diff --git a/ue4cli/UnrealManagerBase.py b/ue4cli/UnrealManagerBase.py index <HASH>..<HASH> 100644 --- a/ue4cli/UnrealManagerBase.py +++ b/ue4cli/UnrealManagerBase.py @@ -36,7 +36,9 @@ class UnrealManagerBase(object): """ # Set the new root directory - ConfigurationManager.setConfigKey('rootDirOverride', os.path.abspath(rootDir)) + rootDir = os.path.abspath(rootDir) + ConfigurationManager.setConfigKey('rootDirOverride', rootDir) + print('Set engine root path override: {}'.format(rootDir)) # Check that the specified directory is valid and warn the user if it is not try:
Print specified path in setroot to make errors easier to spot
adamrehn_ue4cli
train
py
932b9d0b8e432ec1a7ff175c8716c8948b0beddd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ deps = ['fxos-appgen>=0.2.10', 'marionette_client>=0.7.1.1', 'marionette_extension >= 0.4', 'mozdevice >= 0.33', - 'mozlog >= 1.8', + 'mozlog == 1.8', 'moznetwork >= 0.24', 'mozprocess >= 0.18', 'wptserve >= 1.0.1',
Freeze mozlog version because of proposed API changes.
mozilla-b2g_fxos-certsuite
train
py
79da3ad9321567a91ac910941f74327ae167933d
diff --git a/client/lib/wpcom-undocumented/lib/undocumented.js b/client/lib/wpcom-undocumented/lib/undocumented.js index <HASH>..<HASH> 100644 --- a/client/lib/wpcom-undocumented/lib/undocumented.js +++ b/client/lib/wpcom-undocumented/lib/undocumented.js @@ -902,23 +902,6 @@ Undocumented.prototype.getPaymentMethods = function ( query, fn ) { }; /** - * Return a list of third-party services that WordPress.com can integrate with - * - * @param {Function} fn The callback function - * @returns {Promise} A Promise to resolve when complete - */ -Undocumented.prototype.metaKeyring = function ( fn ) { - debug( '/meta/external-services query' ); - return this.wpcom.req.get( - { - path: '/meta/external-services/', - apiVersion: '1.1', - }, - fn - ); -}; - -/** * Return a list of third-party services that WordPress.com can integrate with for a specific site * * @param {number|string} siteId The site ID or domain
WPCOM Undocumented: Remove metaKeyring (#<I>)
Automattic_wp-calypso
train
js
fc5d4438f85dd763336a0527ffcc73e518b10e82
diff --git a/src/client/voice/receiver/VoiceReceiver.js b/src/client/voice/receiver/VoiceReceiver.js index <HASH>..<HASH> 100644 --- a/src/client/voice/receiver/VoiceReceiver.js +++ b/src/client/voice/receiver/VoiceReceiver.js @@ -161,6 +161,25 @@ class VoiceReceiver extends EventEmitter { return; } data = Buffer.from(data); + + // Strip RTP Header Extensions (one-byte only) + if (data[0] === 0xBE && data[1] === 0xDE && data.length > 4) { + const headerExtensionLength = data.readUInt16BE(2); + let offset = 4; + for (let i = 0; i < headerExtensionLength; i++) { + const byte = data[offset]; + offset++; + if (byte === 0) { + continue; + } + offset += 1 + (0b1111 & (byte >> 4)); + } + while (data[offset] === 0) { + offset++; + } + data = data.slice(offset); + } + if (this.opusStreams.get(user.id)) this.opusStreams.get(user.id)._push(data); /** * Emitted whenever voice data is received from the voice connection. This is _always_ emitted (unlike PCM).
backporting the fix for RTP header extensions (#<I>)
discordjs_discord.js
train
js
6c9bc492dc03be56c43493146531bb0a8759b44c
diff --git a/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php b/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php +++ b/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php @@ -128,6 +128,16 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint } /** + * Gets the options associated with this constraint + * + * @return array + */ + public function getOptions() + { + return $this->_options; + } + + /** * Foreign Key onUpdate status * * @return string|null
Added getter for ForeignKeyConstraint
doctrine_dbal
train
php
725f515c74c387af212493df9f22af56f65d6d78
diff --git a/application/configs/deploy.rb b/application/configs/deploy.rb index <HASH>..<HASH> 100644 --- a/application/configs/deploy.rb +++ b/application/configs/deploy.rb @@ -7,7 +7,10 @@ set :linked_dirs, %w{ } set :keep_releases, 3 + load "application/configs/deploy.rb" Dir.glob("garp/deploy/tasks/*.cap").each { |r| load r } load "garp/deploy/garp3.cap" + +set :tmp_dir, "/tmp/#{fetch(:application)}-#{fetch(:stage)}"
Added environment to temp path, to prevent permission problems between environments
grrr-amsterdam_garp3
train
rb
c5c0e72a35e47e88e38df608cfa0cf21510f8cd4
diff --git a/src/sdk/pynni/nni/compression/torch/builtin_quantizers.py b/src/sdk/pynni/nni/compression/torch/builtin_quantizers.py index <HASH>..<HASH> 100644 --- a/src/sdk/pynni/nni/compression/torch/builtin_quantizers.py +++ b/src/sdk/pynni/nni/compression/torch/builtin_quantizers.py @@ -5,7 +5,7 @@ import logging import torch from .compressor import Quantizer, QuantGrad, QuantType -__all__ = ['NaiveQuantizer', 'QAT_Quantizer', 'DoReFaQuantizer'] +__all__ = ['NaiveQuantizer', 'QAT_Quantizer', 'DoReFaQuantizer', 'BNNQuantizer'] logger = logging.getLogger(__name__)
export for default (#<I>)
Microsoft_nni
train
py
7b232b606594bf05b7b08c15bdead2aa617690d8
diff --git a/src/Codeception/Module/PhpBrowser.php b/src/Codeception/Module/PhpBrowser.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/PhpBrowser.php +++ b/src/Codeception/Module/PhpBrowser.php @@ -134,9 +134,9 @@ class PhpBrowser extends InnerBrowser implements Remote, MultiSession * * @param string $name the name of the header to delete. */ - public function deleteHeader($header) + public function deleteHeader($name) { - $this->client->deleteHeader($header); + $this->client->deleteHeader($name); } public function amHttpAuthenticated($username, $password)
Parameter changed to $name deleteHeader was supposed to have $name instead of $header
Codeception_base
train
php
24db1f29fe930df680b6f79503f463ebb01e044e
diff --git a/lib/classes/persistent.php b/lib/classes/persistent.php index <HASH>..<HASH> 100644 --- a/lib/classes/persistent.php +++ b/lib/classes/persistent.php @@ -274,12 +274,13 @@ abstract class persistent { final public static function properties_definition() { global $CFG; - static $def = null; - if ($def !== null) { - return $def; + static $cachedef = []; + if (isset($cachedef[static::class])) { + return $cachedef[static::class]; } - $def = static::define_properties(); + $cachedef[static::class] = static::define_properties(); + $def = &$cachedef[static::class]; $def['id'] = array( 'default' => 0, 'type' => PARAM_INT,
MDL-<I> core: make static cache compatible with PHP<I>
moodle_moodle
train
php
e92f75183762b20e9ea0e5290f56cf8beae15faa
diff --git a/src/Generator/ProductToImageSitemapArrayGenerator.php b/src/Generator/ProductToImageSitemapArrayGenerator.php index <HASH>..<HASH> 100644 --- a/src/Generator/ProductToImageSitemapArrayGenerator.php +++ b/src/Generator/ProductToImageSitemapArrayGenerator.php @@ -36,7 +36,7 @@ final class ProductToImageSitemapArrayGenerator /** @var ProductImageInterface $image */ foreach ($product->getImages() as $image) { - if (!$image->hasFile() || !$image->getPath()) { + if (!$image->getPath()) { continue; }
Add image when path is set, not only when SplInfo is present
stefandoorn_sitemap-plugin
train
php
89505a9515d704ad614ebc05e80983a2a35f0a3c
diff --git a/src/Behat/Mink/Driver/GoutteDriver.php b/src/Behat/Mink/Driver/GoutteDriver.php index <HASH>..<HASH> 100644 --- a/src/Behat/Mink/Driver/GoutteDriver.php +++ b/src/Behat/Mink/Driver/GoutteDriver.php @@ -44,6 +44,10 @@ class GoutteDriver extends BrowserKitDriver } /** + * Gets the Goutte client. + * + * The method is overwritten only to provide the appropriate return type hint. + * * @return Client */ public function getClient()
Added the reason to overwrite getClient
minkphp_MinkGoutteDriver
train
php
f349803f0eb5e695b138da15baac8aab31b9d65d
diff --git a/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/edit.js b/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/edit.js index <HASH>..<HASH> 100644 --- a/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/edit.js +++ b/apps/editing-toolkit/editing-toolkit-plugin/event-countdown-block/blocks/src/edit.js @@ -55,6 +55,7 @@ const edit = ( { attributes, setAttributes, className } ) => { onClick={ onToggle } aria-expanded={ isOpen } aria-live="polite" + isSecondary > { label } </Button>
Event Countdown Block: Update date picker button to use secondary styling (#<I>)
Automattic_wp-calypso
train
js
b3430cbeb1d774c92a225bd24643aa90dbcdf71a
diff --git a/package/yapsy/__init__.py b/package/yapsy/__init__.py index <HASH>..<HASH> 100644 --- a/package/yapsy/__init__.py +++ b/package/yapsy/__init__.py @@ -36,7 +36,18 @@ should get you a fully working plugin management system:: for pluginInfo in simplePluginManager.getAllPlugins(): simplePluginManager.activatePluginByName(pluginInfo.name) - +.. note:: The ``plugin_info`` object (typically an instance of +``IPlugin``) plays as *the entry point of each plugin*. That's also +where |yapsy| ceases to guide you: it's up to you to define what your +plugins can do and how you want to talk to them ! Talking to your +plugin will then look very much like the following:: + + # Trigger 'some action' from the loaded plugins + for pluginInfo in simplePluginManager.getAllPlugins(): + pluginInfo.plugin_object.doSomething(...) + + + .. _extend: Extensibility @@ -74,7 +85,14 @@ the manager about that before collecting plugins:: "Visualization" : IVisualisation, }) +.. note:: Communicating with the plugins belonging to a given category +might then be achieved with some code looking like the following:: + + # Trigger 'some action' from the "Visualization" plugins + for pluginInfo in simplePluginManager.getPluginsOfCategory("Visualization"): + pluginInfo.plugin_object.doSomething(...) + Enhance the manager's interface -------------------------------
Add some more code samples and explicit notes about how to communicate with a plugin once it is loaded
benhoff_pluginmanager
train
py
baec443ed652741982d3ff29099f8458addfb370
diff --git a/test/specs/dom_components/model/Symbols.js b/test/specs/dom_components/model/Symbols.js index <HASH>..<HASH> 100644 --- a/test/specs/dom_components/model/Symbols.js +++ b/test/specs/dom_components/model/Symbols.js @@ -43,7 +43,14 @@ describe('Symbols', () => { wrapper.components().reset(); }); - // TODO check that clone itself doesn't create symbols + test("Simple clone doesn't create any symbol", () => { + const comp = wrapper.append(simpleComp)[0]; + const cloned = comp.clone(); + [comp, cloned].forEach(item => { + expect(item.__getSymbol()).toBeFalsy(); + expect(item.__getSymbols()).toBeFalsy(); + }); + }); test('Create symbol from a component', () => { const comp = wrapper.append(simpleComp)[0];
Add test for the clone against symbols
artf_grapesjs
train
js
974fc4890badc50656c5c4aba663c5b490195820
diff --git a/mautrix/util/message_send_checkpoint.py b/mautrix/util/message_send_checkpoint.py index <HASH>..<HASH> 100644 --- a/mautrix/util/message_send_checkpoint.py +++ b/mautrix/util/message_send_checkpoint.py @@ -70,6 +70,7 @@ CHECKPOINT_TYPES = { EventType.ROOM_REDACTION, EventType.ROOM_MESSAGE, EventType.ROOM_ENCRYPTED, + EventType.ROOM_MEMBER, EventType.STICKER, EventType.REACTION, EventType.CALL_INVITE,
Add m.room.member to checkpoint types
tulir_mautrix-python
train
py
fa3665e31c9e4dc24b00e0ff1c8a187a5abed49d
diff --git a/karma.conf.js b/karma.conf.js index <HASH>..<HASH> 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -2,11 +2,17 @@ // Generated on Thu Aug 11 2016 22:09:45 GMT+0200 (CEST) module.exports = function(config) { - config.set({ + var configuration = { // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter @@ -69,5 +75,12 @@ module.exports = function(config) { // Concurrency level // how many browser should be started simultaneous concurrency: Infinity - }) + }; + + if (process.env.TRAVIS) { + configuration.browsers = ['Chrome_travis_ci']; + } + + config.set(configuration); + }
Added custom browser for travis
jellekralt_angular-drag-scroll
train
js
a7d21948ecfdd984c6b1a06968d99edb53ed5dd2
diff --git a/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java b/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java +++ b/src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java @@ -1699,16 +1699,16 @@ public class COSAPIClient implements IStoreClient { LOG.debug("ProgressEvent received: " + progressEvent.toString()); if (progressEvent.getEventType() - == ProgressEventType.TRANSFER_STARTED_EVENT) { + == ProgressEventType.CLIENT_REQUEST_STARTED_EVENT) { LOG.debug("Started to copy: " + src + " -> " + dst); } if (progressEvent.getEventType() - == ProgressEventType.TRANSFER_COMPLETED_EVENT) { + == ProgressEventType.CLIENT_REQUEST_SUCCESS_EVENT) { LOG.debug("Completed copy: " + src + " -> " + dst); doneSignal.countDown(); } if (progressEvent.getEventType() - == ProgressEventType.TRANSFER_FAILED_EVENT) { + == ProgressEventType.CLIENT_REQUEST_FAILED_EVENT) { LOG.debug("Failed upload: " + src + " -> " + dst); doneSignal.countDown(); }
fix progressEvent received to align with aws s3 behavior
CODAIT_stocator
train
java
73ea5892ceb93564325f7eca296a680845ec3b2b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -96,13 +96,16 @@ Texture.prototype.paint = function(geom) { var self = this; geom.faces.forEach(function(face, i) { var c = face.vertexColors[0]; - var index = self.materialIndex[Math.floor(c.b*255 + c.g*255*255 + c.r*255*255*255) - 1][0]; + var index = Math.floor(c.b*255 + c.g*255*255 + c.r*255*255*255); + index = self.materialIndex[Math.floor(Math.max(0, index - 1) % self.materialIndex.length)][0]; + // BACK, FRONT, TOP, BOTTOM, LEFT, RIGHT if (face.normal.z === 1) index += 1; else if (face.normal.y === 1) index += 2; else if (face.normal.y === -1) index += 3; else if (face.normal.x === -1) index += 4; else if (face.normal.x === 1) index += 5; + face.materialIndex = index; }); };
Fix for paint and force publish, whoops :)
deathcap_voxel-texture-shader
train
js
152dc34b6cd73a54cc739a3074a006ffed918dc4
diff --git a/lib/rails_admin/engine.rb b/lib/rails_admin/engine.rb index <HASH>..<HASH> 100644 --- a/lib/rails_admin/engine.rb +++ b/lib/rails_admin/engine.rb @@ -11,7 +11,7 @@ require 'rails_admin' module RailsAdmin class Engine < Rails::Engine isolate_namespace RailsAdmin - initializer "RailsAdmin precompile hook" do |app| + initializer "RailsAdmin precompile hook", :group => :assets do |app| app.config.assets.precompile += ['rails_admin/rails_admin.js', 'rails_admin/rails_admin.css', 'rails_admin/jquery.colorpicker.js', 'rails_admin/jquery.colorpicker.css'] end
Trigger asset precompile hook even if initialize_on_precompile is set to false
sferik_rails_admin
train
rb
44108078bcc24db2ac1fa0d5a5c12a9782a77d98
diff --git a/lib/contextual_link_helpers.rb b/lib/contextual_link_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/contextual_link_helpers.rb +++ b/lib/contextual_link_helpers.rb @@ -27,7 +27,7 @@ module ContextualLinkHelpers # Link generation case action when 'new' - return icon_link_to(action, send("new_#{model_name}_path"), :remote => true) + return icon_link_to(action, send("new_#{model_name}_path")) when 'show' return icon_link_to(action, send("#{model_name}_path", resource)) when 'edit'
Don't use AJAX for context_action 'new'.
huerlisi_i18n_rails_helpers
train
rb
6a7dfe80bc99ba7cb23cf1daa6a25de406e6d965
diff --git a/okhttp/src/main/java/com/squareup/okhttp/Headers.java b/okhttp/src/main/java/com/squareup/okhttp/Headers.java index <HASH>..<HASH> 100644 --- a/okhttp/src/main/java/com/squareup/okhttp/Headers.java +++ b/okhttp/src/main/java/com/squareup/okhttp/Headers.java @@ -19,7 +19,6 @@ package com.squareup.okhttp; import com.squareup.okhttp.internal.http.HttpDate; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.List; @@ -118,7 +117,7 @@ public final class Headers { public Builder newBuilder() { Builder result = new Builder(); - result.namesAndValues.addAll(Arrays.asList(namesAndValues)); + Collections.addAll(result.namesAndValues, namesAndValues); return result; }
Skip allocating a wrapper list for copying.
square_okhttp
train
java
fd65172934d88520cf02abef6980faeefcff8215
diff --git a/spec/job/adapters/torque_spec.rb b/spec/job/adapters/torque_spec.rb index <HASH>..<HASH> 100644 --- a/spec/job/adapters/torque_spec.rb +++ b/spec/job/adapters/torque_spec.rb @@ -193,7 +193,7 @@ describe OodCore::Job::Adapters::Torque do end context "with :start_time" do - before { adapter.submit(script: build_script(start_time: 1478631234)) } + before { adapter.submit(script: build_script(start_time: Time.new(2016, 11, 8, 13, 53, 54).to_i)) } it { expect(pbs).to have_received(:submit_string).with(content, queue: nil, headers: {Execution_Time: "201611081353.54"}, resources: {}, envvars: {}) } end
dynamically set timestamp Fixes #6
OSC_ood_core
train
rb
1974aa5277c28150463e6d31135b091818291112
diff --git a/lib/handlebars/vm.js b/lib/handlebars/vm.js index <HASH>..<HASH> 100644 --- a/lib/handlebars/vm.js +++ b/lib/handlebars/vm.js @@ -615,7 +615,9 @@ Handlebars.VM = { return new Handlebars.JavaScriptCompiler().compile(environment); }, invokePartial: function(partial, name, context, helpers, partials) { - if(partial instanceof Function) { + if(partial === undefined) { + throw new Handlebars.Exception("The partial " + name + " could not be found"); + } else if(partial instanceof Function) { return partial(context, helpers, partials); } else { partials[name] = Handlebars.VM.compile(partial);
If the partial is not found, an exception should be thrown
wycats_handlebars.js
train
js
69cc5e8be1348ddd636d45b04524c070fa348d27
diff --git a/findbugs/src/java/edu/umd/cs/findbugs/ba/obl/ObligationSet.java b/findbugs/src/java/edu/umd/cs/findbugs/ba/obl/ObligationSet.java index <HASH>..<HASH> 100644 --- a/findbugs/src/java/edu/umd/cs/findbugs/ba/obl/ObligationSet.java +++ b/findbugs/src/java/edu/umd/cs/findbugs/ba/obl/ObligationSet.java @@ -53,8 +53,18 @@ public class ObligationSet { public void remove(Obligation obligation) throws NonexistentObligationException { short count = countList[obligation.getId()]; - if (count <= 0) - throw new NonexistentObligationException(obligation); + + // It is possible to remove a nonexistent obligation. + // Generally this indicates buggy code, e.g. + // InputStream in = null; + // try { + // in = new FileInputStream(...); + // } catch (IOException e) { + // in.close(); // in might be null! + // } +// if (count <= 0) +// throw new NonexistentObligationException(obligation); + invalidate(); countList[obligation.getId()] = (short)(count - 1); }
Don't throw exception indicating that a nonexistent obligation is being removed. This can arise, possibly because of buggy code that tries to close a resource that has not been opened. git-svn-id: <URL>
spotbugs_spotbugs
train
java
47d78db19f5bc8807f1784d63e2ed3a47c89cf2b
diff --git a/Locale.php b/Locale.php index <HASH>..<HASH> 100644 --- a/Locale.php +++ b/Locale.php @@ -27,22 +27,16 @@ class Locale extends \Locale { /** * Caches the countries in different locales. - * - * @var array */ protected static $countries = array(); /** * Caches the languages in different locales. - * - * @var array */ protected static $languages = array(); /** * Caches the different locales. - * - * @var array */ protected static $locales = array();
[DI] minor docblock fixes
symfony_locale
train
php
b9b48e11ef5c90831511e28a435ea45a47eb74fa
diff --git a/fedmsg/consumers/ircbot.py b/fedmsg/consumers/ircbot.py index <HASH>..<HASH> 100644 --- a/fedmsg/consumers/ircbot.py +++ b/fedmsg/consumers/ircbot.py @@ -172,6 +172,9 @@ class IRCBotConsumer(FedmsgConsumer): super(IRCBotConsumer, self).__init__(hub) + if not getattr(self, '_initialized', False): + return + irc_settings = hub.config.get('irc') for settings in irc_settings: network = settings.get('network', 'irc.freenode.net')
Fix regression in ircbot.
fedora-infra_fedmsg
train
py
57c1d7de51b43c2a8a2e567d1e7d8d2fe7ba94e2
diff --git a/src/Modus/Template/Helper/Messages.php b/src/Modus/Template/Helper/Messages.php index <HASH>..<HASH> 100644 --- a/src/Modus/Template/Helper/Messages.php +++ b/src/Modus/Template/Helper/Messages.php @@ -22,12 +22,16 @@ class Messages extends AbstractHelper { protected function getErrors() { $message = $this->segment->getFlash('failure'); - return '<div class="failure">' . $message . '</div>'; + if($message) { + return '<div class="failure">' . $message . '</div>'; + } } protected function getMessages() { $message = $this->segment->getFlash('success'); - return '<div class="success">' . $message . '</div>'; + if($message) { + return '<div class="success">' . $message . '</div>'; + } } } \ No newline at end of file
Checking that a message exists before returning the HTML.
modusphp_framework
train
php
4965df175c44e7de9e673703ed182cf367fee817
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,5 @@ require 'simplecov' require 'coveralls' -require 'squib' SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter, @@ -8,12 +7,15 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ ] SimpleCov.start +require 'squib' + RSpec.configure do |config| config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end end + def test_file(str) "#{File.expand_path(File.dirname(__FILE__))}/data/#{str}" end
Fixing overzealous coverage issue
andymeneely_squib
train
rb
d9613e099168c543451fc4efbb6c8813960619e4
diff --git a/src/org/parosproxy/paros/network/ConnectionParam.java b/src/org/parosproxy/paros/network/ConnectionParam.java index <HASH>..<HASH> 100644 --- a/src/org/parosproxy/paros/network/ConnectionParam.java +++ b/src/org/parosproxy/paros/network/ConnectionParam.java @@ -360,7 +360,7 @@ public class ConnectionParam extends AbstractParam { String host = sub.getString(AUTH_HOST_NAME_KEY, ""); if ("".equals(host)) { - break; + continue; } HostAuthentication auth = new HostAuthentication(
Changed ConnectionParam to keep trying loading other authentication credentials even if one is wrong.
zaproxy_zaproxy
train
java
7590e479c09234e2415e2b2202da7bf03095941c
diff --git a/lib/kamerling.rb b/lib/kamerling.rb index <HASH>..<HASH> 100644 --- a/lib/kamerling.rb +++ b/lib/kamerling.rb @@ -1,3 +1,5 @@ +require 'logger' + require_relative 'kamerling/core_extensions' include Kamerling::CoreExtensions::Main diff --git a/lib/kamerling/server.rb b/lib/kamerling/server.rb index <HASH>..<HASH> 100644 --- a/lib/kamerling/server.rb +++ b/lib/kamerling/server.rb @@ -1,6 +1,3 @@ -require 'gserver' -require 'logger' - module Kamerling class Server def initialize addrs: req(:addrs), logger: Logger.new('/dev/null'), servers: servers_from(addrs, logger)
Server: promote dependencies to global file
chastell_kamerling
train
rb,rb
1ef7284591e2888b3fbb3f261bff0de9ff79e39b
diff --git a/languages/de/tl_module.php b/languages/de/tl_module.php index <HASH>..<HASH> 100644 --- a/languages/de/tl_module.php +++ b/languages/de/tl_module.php @@ -34,7 +34,7 @@ $GLOBALS['TL_LANG']['tl_module']['mobile_menu_disableNavigation'] = [ ]; $GLOBALS['TL_LANG']['tl_module']['mobile_menu_parentTogglers'] = [ 'Eltern-Menüpunkte nur als Toggler verwenden', - 'Bewirkt, daß die Menüpunkte mit Untermenüs nur als Toggler verwendet werden können. Damit ist es nicht möglich, eine Seite mit Untermenüs durch Klick auszuwählen.', + 'Bewirkt, dass die Menüpunkte mit Untermenüs nur als Toggler verwendet werden können. Damit ist es nicht möglich, eine Seite mit Untermenüs durch Klick auszuwählen.', ]; $GLOBALS['TL_LANG']['tl_module']['mobile_menu_closeOnLinkClick'] = [ 'Menü beim Klick auf einen Link schließen.',
Fixed a typo in the German labels
codefog_contao-mobile_menu
train
php
33883c04e4272a2c1e43d5a55ba7fe3eefdeb2bd
diff --git a/requesting.go b/requesting.go index <HASH>..<HASH> 100644 --- a/requesting.go +++ b/requesting.go @@ -132,6 +132,11 @@ func (p *Peer) applyNextRequestState() bool { } } for req := range next.Requests { + // This could happen if the peer chokes us between the next state being generated, and us + // trying to transmit the state. + if p.peerChoking && !p.peerAllowedFast.Contains(bitmap.BitIndex(req.Index)) { + continue + } more, err := p.request(req) if err != nil { panic(err)
Filter next requests application for peer state changes
anacrolix_torrent
train
go
78f9cc7290265cbd65a17150b791ece2e8e02dec
diff --git a/src/test/java/io/humble/video/SourceFormatTest.java b/src/test/java/io/humble/video/SourceFormatTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/io/humble/video/SourceFormatTest.java +++ b/src/test/java/io/humble/video/SourceFormatTest.java @@ -17,7 +17,7 @@ public class SourceFormatTest { assertEquals("aiff", f.getName()); assertEquals("Audio IFF", f.getLongName()); List<Codec.ID> l = f.getSupportedCodecs(); - assertEquals(17, l.size()); + assertTrue(17 < l.size()); } @Test
fix test and make more robust to future ffmpeg changes.
artclarke_humble-video
train
java
5f444853d0ad47c9d206a71b52e8c599ecfaf5e7
diff --git a/CKEditorAsset.php b/CKEditorAsset.php index <HASH>..<HASH> 100644 --- a/CKEditorAsset.php +++ b/CKEditorAsset.php @@ -9,7 +9,7 @@ use yii\web\View; * @author MrAnger */ class CKEditorAsset extends AssetBundle { - public $sourcePath = "@bower/ckeditor#full"; + public $sourcePath = "@vendor/ckeditor"; public $js = [ 'ckeditor.js',
Change require ckeditor package version
MrAnger_yii2-ckeditor
train
php
b0d92a226f1d33070a094a79bbc53b68a4003e4c
diff --git a/vyper/old_codegen/context.py b/vyper/old_codegen/context.py index <HASH>..<HASH> 100644 --- a/vyper/old_codegen/context.py +++ b/vyper/old_codegen/context.py @@ -244,12 +244,11 @@ class Context: # more sanity check, that the types match # _check(all(l.typ == r.typ for (l, r) in zip(args_lll, sig.args)) - num_provided_args = len(args_lll) - total_args = len(sig.args) + num_provided_kwargs = len(args_lll) - len(sig.base_args) num_kwargs = len(sig.default_args) - args_needed = total_args - num_provided_args + kwargs_needed = num_kwargs - num_provided_kwargs - kw_vals = list(sig.default_values.values())[: num_kwargs - args_needed] + kw_vals = list(sig.default_values.values())[:kwargs_needed] return sig, kw_vals
fix calculation of kwargs needed
ethereum_vyper
train
py
a3754ac6d53f74d0e8025e6e385944a949e143ea
diff --git a/src/View.php b/src/View.php index <HASH>..<HASH> 100644 --- a/src/View.php +++ b/src/View.php @@ -1002,6 +1002,8 @@ class View implements jsExpressionable /** @var array Cached stickyGet arguments */ public $_stickyArgsCached = null; + public $_triggerBy = null; + /** * Build an URL which this view can use for call-backs. It should * be guaranteed that requesting returned URL would at some point call @@ -1021,8 +1023,9 @@ class View implements jsExpressionable * * @return array */ - public function _getStickyArgs() + public function _getStickyArgs($triggerBy) { + $this->_triggerBy = $triggerBy; if ($this->_stickyArgsCached === null) { if ($this->owner && $this->owner instanceof self) { $this->_stickyArgsCached = array_merge($this->owner->_getStickyArgs($triggerBy), $this->stickyArgs); @@ -1046,7 +1049,8 @@ class View implements jsExpressionable if ($this->_stickyArgsCached) { throw new Exception([ 'Unable to set stickyGet after url() has been used here or by a child', - 'name' => $name, + 'urlBy'=>$this->_triggerBy, + 'stickyBy' => $name, ]); }
record which view had url() called on it (for debugging)
atk4_ui
train
php
52153e5011512fb66e453312ecae539a70834697
diff --git a/python/ppo/trainer.py b/python/ppo/trainer.py index <HASH>..<HASH> 100755 --- a/python/ppo/trainer.py +++ b/python/ppo/trainer.py @@ -71,7 +71,7 @@ class Trainer(object): idx = info.agents.index(agent) if not info.local_done[idx]: if self.use_observations: - history['observations'].append(info.observations[idx]) + history['observations'].append([info.observations[0][idx]]) if self.use_states: history['states'].append(info.states[idx]) if self.is_continuous:
Fix for multi-agent with observations
Unity-Technologies_ml-agents
train
py
a01ed86dc01a3fb0008bd311537e1eee22f57a5a
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -170,6 +170,22 @@ exports.static = function(directory, options) { console.warn(`Snockets skipping ${filePath}:\n ${err}`); } + // Snockets (watcher) + if (watcher) { + try { + // Get all files in the snockets chain + const compiledChain = snockets.getCompiledChain(filePath, options.snockets); + + // Add each file of the snockets chain to the watcher + compiledChain.forEach(c => { + watcher.add(c.filename); + }); + } catch(err) { + // Snockets can't parse, so just pass the js file along + console.warn(`Snockets skipping watch for ${filePath}:\n ${err}`); + } + } + // Babel try { let result = babel.transformSync(data, {
Watch all files in the snockets chain
mediocre_electricity
train
js
0724fedc78ee9a3e56653e2b66020bef870fe7db
diff --git a/mautrix/util/formatter/parser.py b/mautrix/util/formatter/parser.py index <HASH>..<HASH> 100644 --- a/mautrix/util/formatter/parser.py +++ b/mautrix/util/formatter/parser.py @@ -166,6 +166,9 @@ class MatrixParser(Generic[T]): async def color_to_fstring(self, node: HTMLNode, ctx: RecursionContext, color: str) -> T: return await self.tag_aware_parse_node(node, ctx) + async def spoiler_to_fstring(self, node: HTMLNode, ctx: RecursionContext, reason: str) -> T: + return await self.tag_aware_parse_node(node, ctx) + async def node_to_fstring(self, node: HTMLNode, ctx: RecursionContext) -> T: custom = await self.custom_node_to_fstring(node, ctx) if custom: @@ -190,6 +193,13 @@ class MatrixParser(Generic[T]): return (await self.tag_aware_parse_node(node, ctx)).append("\n") elif node.tag in ("font", "span"): try: + spoiler = node.attrib["data-mx-spoiler"] + except KeyError: + pass + else: + return await self.spoiler_to_fstring(node, ctx, spoiler) + + try: color = node.attrib["color"] except KeyError: try:
Add support for parsing spoilers
tulir_mautrix-python
train
py
e99ed47c09d681a5f6d80e886cd2ca038c16e361
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ try: from setuptools.command.develop import develop as _develop class develop(_develop): def run(self, *args): - #self.execute(_build_sim_unicorn, (), msg='Building sim_unicorn') + self.execute(_build_sim_unicorn, (), msg='Building sim_unicorn') _develop.run(self, *args) cmdclass['develop'] = develop
I accidentally commented out the build line for sim_unicorn and then committed it. undo that.
angr_angr
train
py
10000dd9a75f8e4594f25401029ee9a52d15891a
diff --git a/lib/flint.js b/lib/flint.js index <HASH>..<HASH> 100644 --- a/lib/flint.js +++ b/lib/flint.js @@ -507,7 +507,7 @@ Flint.prototype.auditBots = function() { // exit rooms where bot is only member if(this.auditCounter === (this.auditDelay - 1)) { _.forEach(this.bots, bot => { - if(bot.memberships.length === 0 && bot.isGroup) { + if(bot.memberships.length === 0 && bot.isGroup && !bot.isTeam) { bot.exit(); } });
Tweaked audit of empty rooms to ignore team rooms
flint-bot_flint
train
js
6d963e31f50028e6ea7337dce615f8aa6381959c
diff --git a/netpyne/analysis/spikes.py b/netpyne/analysis/spikes.py index <HASH>..<HASH> 100644 --- a/netpyne/analysis/spikes.py +++ b/netpyne/analysis/spikes.py @@ -31,7 +31,7 @@ from .utils import exception #, getInclude, getSpktSpkid from .tools import getInclude, getSpktSpkid from .tools import saveData as saveFigData from ..support.scalebar import add_scalebar - +from ..specs import Dict # ADDED TO CSD BRANCH TO TRY TO RESOLVE popAvgRates() Dict() ERROR! @exception def prepareSpikeData(
imported Dict from specs in analysis/spikes.py to try to resolve popAvgRates() Dict() error
Neurosim-lab_netpyne
train
py
b24a157d37cb7f1bafcd34315a859e7fb95b7f87
diff --git a/mailjet/api.py b/mailjet/api.py index <HASH>..<HASH> 100644 --- a/mailjet/api.py +++ b/mailjet/api.py @@ -30,6 +30,11 @@ class ApiMethodFunction(object): def __call__(self, **kwargs): if kwargs.pop('method', 'GET') == 'POST': postdata = kwargs + for key in postdata: + if type(postdata[key])==tuple: + for idx, item in enumerate(postdata[key]): + postdata['%s[%d]' % (key, idx)] = item + del postdata[key] options = None else: options = kwargs
Workarround to pass tuple as argument in the form that mailjet api understand : Ex food=('chocolate', 'cookie') is now transform in request to food[0]=chocolate&food[1]=cookie
WoLpH_mailjet
train
py
7ceb664c8ddb2b920e3084c4b58b2e6ca1b83b07
diff --git a/panoptes_client/utils.py b/panoptes_client/utils.py index <HASH>..<HASH> 100644 --- a/panoptes_client/utils.py +++ b/panoptes_client/utils.py @@ -24,6 +24,8 @@ def isiterable(v): def split(to_batch, batch_size): + if type(to_batch) == set: + to_batch = tuple(to_batch) for batch in [ to_batch[i:i + batch_size] for i in range(0, len(to_batch), batch_size)
Convert sets to tuples before trying to split them
zooniverse_panoptes-python-client
train
py
0e0d672bcba51a6efc75656de37659e85edd234b
diff --git a/hugolib/filesystems/basefs.go b/hugolib/filesystems/basefs.go index <HASH>..<HASH> 100644 --- a/hugolib/filesystems/basefs.go +++ b/hugolib/filesystems/basefs.go @@ -68,7 +68,7 @@ type BaseFs struct { // This usually maps to /my-project/public. PublishFs afero.Fs - // A read-only filesystem from the project workDir (no theme here). + // A read-only filesystem starting from the project workDir. WorkDir afero.Fs theBigFs *filesystemsCollector @@ -438,7 +438,9 @@ func NewBase(p *paths.Paths, logger loggers.Logger, options ...func(*BaseFs) err publishFs := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(fs.Destination, p.AbsPublishDir)) sourceFs := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(fs.Source, p.WorkingDir)) - workDir := hugofs.NewBaseFileDecorator(afero.NewBasePathFs(afero.NewReadOnlyFs(fs.Source), p.WorkingDir)) + + // Same as sourceFs, but no decoration. This is what's used by os.ReadDir etc. + workDir := afero.NewBasePathFs(afero.NewReadOnlyFs(fs.Source), p.WorkingDir) b := &BaseFs{ SourceFs: sourceFs,
Remove the decorator from the fs used in ReadDir There have been a site breakage reported in the wild after <I>. With this commit we shoudl be back to how it behaved in <I>. Closes #<I>
gohugoio_hugo
train
go
d1a06f3c207ac2c09c37e718c89386022872adcf
diff --git a/cake/tests/cases/libs/debugger.test.php b/cake/tests/cases/libs/debugger.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/libs/debugger.test.php +++ b/cake/tests/cases/libs/debugger.test.php @@ -189,6 +189,8 @@ class DebuggerTest extends CakeTestCase { '/error' ); $this->assertTags($result, $data, true); + + restore_error_handler(); } /**
Adding a restore_error_handler() so the Debugger test doesn't interfere with other tests.
cakephp_cakephp
train
php
7400323135870b5e8a751c9ed4686a06ab29d83c
diff --git a/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementclient.py b/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementclient.py index <HASH>..<HASH> 100644 --- a/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementclient.py +++ b/azure-servicemanagement-legacy/azure/servicemanagement/servicemanagementclient.py @@ -397,10 +397,12 @@ class _ServiceManagementClient(object): return None - def _get_path(self, resource, name): + def _get_path(self, resource, name, suffix=None): path = '/' + self.subscription_id + '/' + resource if name is not None: path += '/' + _str(name) + if suffix is not None: + path += '/' + suffix return path def _get_cloud_services_path(self, cloud_service_id, resource=None, name=None):
Extend get_path to handle more granular endpoints Publishing details, for example, are nested below a typical endpoint path. An optional suffix on the path makes more granular endpoints reachable without requiring any change to existing code.
Azure_azure-sdk-for-python
train
py
b59fc9ca9edb0bf3dc8647502b985d7add727894
diff --git a/src/utils/tenant-cache.js b/src/utils/tenant-cache.js index <HASH>..<HASH> 100644 --- a/src/utils/tenant-cache.js +++ b/src/utils/tenant-cache.js @@ -1,6 +1,6 @@ 'use strict'; -const deepClone = require('./deep-clone'); +const { deepClone } = require('./deep-clone'); let TenantClient; let TenantsOrPromisesById = {}; @@ -26,6 +26,9 @@ module.exports = { if (newClient.context['user-claims']) { delete newClient.context['user-claims']; } + if (newClient.context['jwt']) { + delete newClient.context['jwt']; + } return TenantsOrPromisesById[tenantId] = new TenantClient(newClient).getTenant(null, { scope: scope }); } }
minor fixes (#<I>) * since there is never a reason to pass user-claims when getting tenant data, remove them if they exist so as to not cause a <I> * add support for JWT authentication * bug fix in tenant-cache (typo) * remove jwt from context in tenant-cache
Mozu_mozu-node-sdk
train
js
d8e28f37c2740913e4b2725d00fc52a04d823442
diff --git a/test/test_roo.rb b/test/test_roo.rb index <HASH>..<HASH> 100644 --- a/test/test_roo.rb +++ b/test/test_roo.rb @@ -75,7 +75,7 @@ class TestRoo < Test::Unit::TestCase fixture_filename(options[:name], format))) end rescue => e - raise e, "#{e.message} for #{format}" + raise e, "#{e.message} for #{format}", e.backtrace end end end
Preserve the original backtrace on with_each_spreadsheet re-raise.
roo-rb_roo
train
rb
174cc0e183c07fe04e5acb50dbd44596f08e2e6b
diff --git a/connection.go b/connection.go index <HASH>..<HASH> 100644 --- a/connection.go +++ b/connection.go @@ -542,7 +542,7 @@ func (cn *connection) updatePiecePriority(piece int) { default: panic(tpp) } - prio += piece / 2 + prio += piece / 3 cn.pieceRequestOrder.Set(piece, prio) cn.updateRequests() }
Reduce the priority given to earlier pieces. Maximum priority reads at the end of the file aren’t getting enough attention.
anacrolix_torrent
train
go
18e008a8589044f7a263c56a55d7f71287f65b5c
diff --git a/allennlp/data/fields/label_field.py b/allennlp/data/fields/label_field.py index <HASH>..<HASH> 100644 --- a/allennlp/data/fields/label_field.py +++ b/allennlp/data/fields/label_field.py @@ -78,4 +78,4 @@ class LabelField(Field[numpy.ndarray]): @overrides def empty_field(self): - return LabelField(0, self._label_namespace) + return LabelField(-1, self._label_namespace, skip_indexing=True) diff --git a/tests/data/fields/label_field_test.py b/tests/data/fields/label_field_test.py index <HASH>..<HASH> 100644 --- a/tests/data/fields/label_field_test.py +++ b/tests/data/fields/label_field_test.py @@ -32,3 +32,8 @@ class TestLabelField(AllenNlpTestCase): def test_label_field_raises_with_incorrect_label_type(self): with pytest.raises(ConfigurationError): _ = LabelField([], skip_indexing=False) + + def test_label_field_empty_field_works(self): + label = LabelField("test") + empty_label = label.empty_field() + assert empty_label.label == -1
Fixes empty_field method of LabelField and adds a test (#<I>) * fixed empty_field method of label_field and added a test * Changed empty_field test for LabelField to test value of padding
allenai_allennlp
train
py,py
eef87615a42735ac69dffdd88912cf507a8d72fb
diff --git a/src/Kunstmaan/SeoBundle/Tests/Entity/SeoTest.php b/src/Kunstmaan/SeoBundle/Tests/Entity/SeoTest.php index <HASH>..<HASH> 100644 --- a/src/Kunstmaan/SeoBundle/Tests/Entity/SeoTest.php +++ b/src/Kunstmaan/SeoBundle/Tests/Entity/SeoTest.php @@ -132,18 +132,6 @@ class SeoTest extends \PHPUnit_Framework_TestCase } /** - * @covers Kunstmaan\SeoBundle\Entity\Seo::getCimKeyword - * @covers Kunstmaan\SeoBundle\Entity\Seo::setCimKeyword - */ - public function testGetSetCimKeyword() - { - $this->object->setCimKeyword('CIM keyword'); - $this->assertEquals('CIM keyword', $this->object->getCimKeyword()); - $this->object->setCimKeyword('CIM keyword should be limited to 24 characters'); - $this->assertEquals('CIM keyword should be li', $this->object->getCimKeyword()); - } - - /** * @covers Kunstmaan\SeoBundle\Entity\Seo::getDefaultAdminType */ public function testGetDefaultAdminType()
Since the CIM keyword was removed, remove the tests as well.
Kunstmaan_KunstmaanBundlesCMS
train
php
e089b35de9fdc5ea6fa61803be77daaa00d22107
diff --git a/driver/src/test/java/org/neo4j/driver/util/Neo4jSettings.java b/driver/src/test/java/org/neo4j/driver/util/Neo4jSettings.java index <HASH>..<HASH> 100644 --- a/driver/src/test/java/org/neo4j/driver/util/Neo4jSettings.java +++ b/driver/src/test/java/org/neo4j/driver/util/Neo4jSettings.java @@ -30,7 +30,7 @@ public class Neo4jSettings { public static final String DATA_DIR = "dbms.directories.data"; public static final String IMPORT_DIR = "dbms.directories.import"; - public static final String LISTEN_ADDR = "dbms.connectors.default_listen_address"; + public static final String LISTEN_ADDR = "dbms.default_listen_address"; public static final String IPV6_ENABLED_ADDR = "::"; public static final String BOLT_TLS_LEVEL = "dbms.connector.bolt.tls_level";
Fix server configuration affecting <I> builds (#<I>)
neo4j_neo4j-java-driver
train
java
215892e7513584c203c12f580d55ca6fdff55d06
diff --git a/packages/node_modules/@webex/internal-plugin-ediscovery/src/report-generator.js b/packages/node_modules/@webex/internal-plugin-ediscovery/src/report-generator.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/internal-plugin-ediscovery/src/report-generator.js +++ b/packages/node_modules/@webex/internal-plugin-ediscovery/src/report-generator.js @@ -18,7 +18,7 @@ const ReportGenerator = SparkPlugin.extend({ folder: 'object', spaces: 'object', size: {type: 'number', default: 0}, - maxSize: {type: 'number', default: 1000000} + maxSize: {type: 'number', default: 104857600} // 100 Mb max size }, /** @@ -128,7 +128,7 @@ const ReportGenerator = SparkPlugin.extend({ * @returns {Promise} A promise on the generated report */ generate() { - if (!this.zip) { + if (!this.zip || !this.spaces) { return Promise.resolve(); }
feat(ediscovery): bump maxsize to <I> mb
webex_spark-js-sdk
train
js
4334710c62d10c069bb14665f9a5b3c7b6ffc105
diff --git a/tests/engine_test.py b/tests/engine_test.py index <HASH>..<HASH> 100644 --- a/tests/engine_test.py +++ b/tests/engine_test.py @@ -341,29 +341,6 @@ class CreateRiskCalculationTestCase(unittest.TestCase): '-0.5000000000000000 0.5000000000000000))')) -class ReadJobProfileFromConfigFileTestCase(unittest.TestCase): - """Integration test for basic engine functions. - - Test reading/generating a hazard job profile from a config file, then run - through the validation form. - """ - - def test_read_and_validate_hazard_config(self): - cfg = helpers.get_data_path('simple_fault_demo_hazard/job.ini') - job = engine.prepare_job(getpass.getuser()) - params, files = engine.parse_config(open(cfg, 'r')) - calculation = engine.create_hazard_calculation( - job.owner.user_name, params, files.values() - ) - job.hazard_calculation = calculation - job.save() - - form = validation.ClassicalHazardForm( - instance=calculation, files=files - ) - self.assertTrue(form.is_valid()) - - class OpenquakeCliTestCase(unittest.TestCase): """ Run "openquake --version" as a separate
tests/engine_test: Removed a useless test case.
gem_oq-engine
train
py
5589965641769c0b16bf0a38aa3608b1993ed260
diff --git a/src/renderer-enhancer.js b/src/renderer-enhancer.js index <HASH>..<HASH> 100644 --- a/src/renderer-enhancer.js +++ b/src/renderer-enhancer.js @@ -45,7 +45,7 @@ module.exports = overrides => storeCreator => (reducer, providedInitialState) => if (!getInitialState) throw new Error('Could not find electronEnhanced redux store in main process'); const storeData = JSON.parse(getInitialState()); const preload = params.excludeUnfilteredState ? fillShape(storeData, params.filter) : storeData; - const initialState = objectMerge(providedInitialState || {}, preload); + const initialState = objectMerge(preload, providedInitialState || {}); // Forward update to the main process so that it can forward the update to all other renderers const forwarder = (action) =>
Fix InitialState bug. (#<I>) This commit fixes the issue where electronEnhancer returns the preloadedState of an application instead of the provided initial state.
samiskin_redux-electron-store
train
js
6e44c70ed82d746e88ccc19b05c65e373477754c
diff --git a/lib/caracal/document.rb b/lib/caracal/document.rb index <HASH>..<HASH> 100644 --- a/lib/caracal/document.rb +++ b/lib/caracal/document.rb @@ -196,7 +196,7 @@ module Caracal def render_media(zip) images = relationships.select { |r| r.relationship_type == :image } images.each do |rel| - if rel.relationship_data + if rel.relationship_data.to_s.size > 0 content = rel.relationship_data else content = open(rel.relationship_target).read
Actually fixed issue with image media rendering.
trade-informatics_caracal
train
rb
14ab460f8efa9d259cce0b9fa51ce87dc5687207
diff --git a/tasks/release.rb b/tasks/release.rb index <HASH>..<HASH> 100644 --- a/tasks/release.rb +++ b/tasks/release.rb @@ -186,7 +186,7 @@ task :announce do raise "Only valid for patch releases" end - sums = "$ shasum *-#{version}.gem\n" + `shasum *-#{version}.gem` + sums = "$ shasum -a 256 *-#{version}.gem\n" + `shasum -a 256 *-#{version}.gem` puts "Hi everyone," puts @@ -232,7 +232,7 @@ GitHub](https://github.com/rails/rails/compare/v#{previous_version}...v#{version ## SHA-1 If you'd like to verify that your gem is the same as the one I've uploaded, -please use these SHA-1 hashes. +please use these SHA-256 hashes. Here are the checksums for #{version}:
Use shasum <I> on the release
rails_rails
train
rb
5e7f2ac9795600dab4ae7ffebd53bbda96bc2386
diff --git a/cordova-js-src/confighelper.js b/cordova-js-src/confighelper.js index <HASH>..<HASH> 100644 --- a/cordova-js-src/confighelper.js +++ b/cordova-js-src/confighelper.js @@ -25,7 +25,7 @@ var utils = require('cordova/utils'); var isPhone = (cordova.platformId === 'windows') && WinJS.Utilities.isPhone; var isWin10UWP = navigator.appVersion.indexOf('MSAppHost/3.0') !== -1; -var splashScreenTagName = isWin10UWP ? 'SplashScreen' : (isPhone ? 'm3:SplashScreen' : 'm2:SplashScreen'); +var splashScreenTagName = isWin10UWP ? "uap:SplashScreen" : (isPhone ? "m3:SplashScreen" : "m2:SplashScreen"); function XmlFile (text) { this.text = text;
fix(win<I>): read splashscreen correctly from manifest (#<I>)
apache_cordova-windows
train
js
1ea478d19d6a18ca8e8d48ee29b31a143ce5dc5b
diff --git a/sendgrid/sendgrid.py b/sendgrid/sendgrid.py index <HASH>..<HASH> 100644 --- a/sendgrid/sendgrid.py +++ b/sendgrid/sendgrid.py @@ -20,7 +20,6 @@ class SendGridAPIClient(object): headers = { "Authorization": 'Bearer {0}'.format(self._apikey), - "Content-Type": "application/json", "User-agent": self.useragent } diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ if os.path.exists('README.txt'): long_description = open('README.txt').read() def getRequires(): - deps = ['python_http_client>=2.0.0'] + deps = ['python_http_client>=2.1.0'] if sys.version_info < (2, 7): deps.append('unittest2') elif (3, 0) <= sys.version_info < (3, 2):
Udpdated dependency, content-type now gets set in the client automatically
sendgrid_sendgrid-python
train
py,py
52a63ac5ade10f6c398104add51f4310ec7e5a00
diff --git a/src/Zephyrus/Application/RouterEngine.php b/src/Zephyrus/Application/RouterEngine.php index <HASH>..<HASH> 100644 --- a/src/Zephyrus/Application/RouterEngine.php +++ b/src/Zephyrus/Application/RouterEngine.php @@ -122,6 +122,7 @@ abstract class RouterEngine return $route; } } + throw new RouteNotFoundException($this->requestedUri, $this->requestedMethod); } @@ -174,8 +175,8 @@ abstract class RouterEngine * methods if they are available. * * @param $route - * @return Response | null * @throws \Exception + * @return Response | null */ private function createResponse($route): ?Response {
Light refactoring for StyleCI
dadajuice_zephyrus
train
php
1b392234f7fb46f7277ed0561859551099a254d1
diff --git a/test/test_motor_grid_file.py b/test/test_motor_grid_file.py index <HASH>..<HASH> 100644 --- a/test/test_motor_grid_file.py +++ b/test/test_motor_grid_file.py @@ -55,8 +55,9 @@ class MotorGridFileTest(MotorTest): yield motor.Op( self.check_optional_callback, partial(f.writelines, [b('a')])) - yield motor.Op(self.check_optional_callback, f.close) - + self.assertRaises(TypeError, f.close, callback='foo') + self.assertRaises(TypeError, f.close, callback=1) + f.close(callback=None) # No error done() @async_test_engine()
Fix race condition in test_motor_grid_file
mongodb_motor
train
py
bb88c0757626d831e1da1554da6bd7cafee755b6
diff --git a/examples/simple_agent.py b/examples/simple_agent.py index <HASH>..<HASH> 100755 --- a/examples/simple_agent.py +++ b/examples/simple_agent.py @@ -147,12 +147,16 @@ firstTable = agent.Table( agent.DisplayString() ], columns = [ + # Columns begin with an index of 2 here because 1 is actually + # used for the single index column above. + # We must explicitly specify that the columns should be SNMPSETable. (2, agent.DisplayString("Unknown place"), True), (3, agent.Integer32(0), True) ], counterobj = agent.Unsigned32( oidstr = "SIMPLE-MIB::firstTableNumber" ), + # Allow adding new records extendable = True )
simple_agent.py: Add additional explanatory comments
pief_python-netsnmpagent
train
py
11da1ca2fe4cd8f9e4a55e766d6323558052aa8d
diff --git a/core/src/main/java/com/google/common/truth/Correspondence.java b/core/src/main/java/com/google/common/truth/Correspondence.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/common/truth/Correspondence.java +++ b/core/src/main/java/com/google/common/truth/Correspondence.java @@ -317,8 +317,12 @@ public abstract class Correspondence<A, E> { * Constructor. Creating subclasses (anonymous or otherwise) of this class is <i>not * recommended</i>, but is possible via this constructor. The recommended approach is to use the * factory methods instead (see {@linkplain Correspondence class-level documentation}). + * + * @deprecated Construct an instance with the static factory methods instead. The most mechanical + * migration is usually to {@link #from}. */ - protected Correspondence() {} + @Deprecated + Correspondence() {} /** * Returns a new correspondence which is like this one, except that the given formatter may be
Deprecate the constructor of Correspondence internally, and hide it externally. RELNOTES=Hid constuctor of `Correspondence`. Use the class's static factory methods instead. The most mechanical migration is usually to `Correspondence.from`. ------------- Created by MOE: <URL>
google_truth
train
java
a154f8ca7a15313ab48ce0b2faae908b2665e636
diff --git a/plugin/wavesurfer.timeline.js b/plugin/wavesurfer.timeline.js index <HASH>..<HASH> 100644 --- a/plugin/wavesurfer.timeline.js +++ b/plugin/wavesurfer.timeline.js @@ -106,8 +106,8 @@ var width = this.drawer.getWidth(); var pixelsPerSecond = width/duration; } else { - var width = backend.getDuration() * this.wavesurfer.minPxPerSec; - var pixelsPerSecond = this.wavesurfer.minPxPerSec; + var width = backend.getDuration() * wsParams.minPxPerSec; + var pixelsPerSecond = wsParams.minPxPerSec; } pixelsPerSecond = pixelsPerSecond / this.wavesurfer.drawer.pixelRatio;
fix to timeline.js drawing bug
katspaugh_wavesurfer.js
train
js
c22df3273a55c81dadd15b7de2687e1ce7c098d8
diff --git a/lib/rfuse/version.rb b/lib/rfuse/version.rb index <HASH>..<HASH> 100644 --- a/lib/rfuse/version.rb +++ b/lib/rfuse/version.rb @@ -1,3 +1,3 @@ module RFuse - VERSION = "1.2.2" + VERSION = "1.2.3" end
Bump rfuse to <I>
lwoggardner_rfuse
train
rb
0a5b4beb8111f70017bda71f786aaa92afdd86a4
diff --git a/hendrix/facilities/services.py b/hendrix/facilities/services.py index <HASH>..<HASH> 100644 --- a/hendrix/facilities/services.py +++ b/hendrix/facilities/services.py @@ -161,7 +161,7 @@ class HendrixTCPServiceWithTLS(internet.SSLServer): context_factory = context_factory or ssl.DefaultOpenSSLContextFactory context_factory_kwargs = context_factory_kwargs or {} - sslContext = context_factory( + self.tls_context = context_factory( private_key, cert, **context_factory_kwargs @@ -170,7 +170,7 @@ class HendrixTCPServiceWithTLS(internet.SSLServer): self, port, # integer port site, # our site object, see the web howto - contextFactory=sslContext, + contextFactory=self.tls_context ) self.site = site
Preserving tls_context for use with websocket factory.
hendrix_hendrix
train
py
ecfdf998b92b291375037afaaafb2d2d5eb5d036
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -123,7 +123,7 @@ setup( 'rejester', 'protobuf', 'requests', - 'streamcorpus>=0.3.38', + 'streamcorpus>=0.3.39', 'pyyaml', 'nltk', 'lxml',
requiring streamcorpus>=<I>, i.e. cbor>=<I> with the fixes for sigsgv and bigname leak
trec-kba_streamcorpus-pipeline
train
py
07ffaec132cc9f530f9c65e06ceab67426a32c36
diff --git a/src/inputmask.js b/src/inputmask.js index <HASH>..<HASH> 100644 --- a/src/inputmask.js +++ b/src/inputmask.js @@ -100,6 +100,16 @@ function init(Survey) { surveyElement.customWidgetData.isNeedRender = true; }; + $(el).on('focusout change', function () { + + if ($(el).inputmask('isComplete')) { + surveyElement.value = $(el).val(); + } else { + surveyElement.value = null; + } + + }); + var updateHandler = function() { el.value = typeof surveyElement.value === "undefined" ? "" : surveyElement.value;
Fix for the T<I> - Survey Creator - Currency InputMask value not saving in the JSON
surveyjs_widgets
train
js
fb6828957fd30484cd5f06a50b6be9f22c739bd8
diff --git a/lib/server/plugins/api/index.js b/lib/server/plugins/api/index.js index <HASH>..<HASH> 100644 --- a/lib/server/plugins/api/index.js +++ b/lib/server/plugins/api/index.js @@ -77,7 +77,7 @@ var internals = { } // hapi eats newlines. We like newlines. For POSIX and such. - data = data + '\n'; + // data = data + '\n'; resp = reply(data).code(res.statusCode).hold(); resp.headers = res.headers;
fix(api): do not force newlines * * * This commit was sponsored by The Hoodie Firm. You can hire The Hoodie Firm: <URL>
hoodiehq_hoodie-server
train
js