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
47847416093c39fd369c63b8d9471b49d6df9eb9
diff --git a/lavalink/websocket.py b/lavalink/websocket.py index <HASH>..<HASH> 100644 --- a/lavalink/websocket.py +++ b/lavalink/websocket.py @@ -120,6 +120,9 @@ class WebSocket: 'indicates that the remote server is a webserver ' 'and not Lavalink. Check your ports, and try again.' .format(self._node.name, ce.status)) + else: + self._lavalink._logger.warning('[Node:{}] An unknown error occurred whilst trying to establish ' + 'a connection to Lavalink'.format(self._node.name), ce) backoff = min(10 * attempt, 60) await asyncio.sleep(backoff) else:
Log the connection error if it's not handled
Devoxin_Lavalink.py
train
py
275f8ce0c77ca79c32359d8780849684ed44bedb
diff --git a/samples/people/me.js b/samples/people/me.js index <HASH>..<HASH> 100644 --- a/samples/people/me.js +++ b/samples/people/me.js @@ -16,19 +16,22 @@ const {google} = require('googleapis'); const sampleClient = require('../sampleclient'); -const plus = google.plus({ +const people = google.people({ version: 'v1', auth: sampleClient.oAuth2Client, }); async function runSample() { - const res = await plus.people.get({userId: 'me'}); + // See documentation of personFields at + // https://developers.google.com/people/api/rest/v1/people/get + const res = await people.people.get({ + resourceName: 'people/me', + personFields: 'emailAddresses,names,photos', + }); console.log(res.data); } const scopes = [ - 'https://www.googleapis.com/auth/plus.login', - 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', ];
Use people API instead of plus API Use people API instead of plus API The plus API is being deprecated. This updates the sample code to use the people API instead. Fixes #<I>. - [x] Tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) #<I> automerged by dpebot
googleapis_google-api-nodejs-client
train
js
c321e64fa5c1050e104733d0ad6cf7ce2ff0b207
diff --git a/lib/util/prelude.js b/lib/util/prelude.js index <HASH>..<HASH> 100644 --- a/lib/util/prelude.js +++ b/lib/util/prelude.js @@ -49,11 +49,13 @@ // cache jump to the current global require ie. the last bundle // that was added to the page. var currentRequire = typeof require == "function" && require; - if (!jumped && currentRequire && currentRequire.length === 2) { - return currentRequire(name, true); - } - else { - return currentRequire(name); + if (!jumped && currentRequire) { + if (currentRequire.length === 2) { + return currentRequire(name, true); + } + else { + return currentRequire(name); + } } // If there are other bundles on this page the require from the
Correctly check for require arity AND presence
smclab_titaniumifier
train
js
d1a374f1f1871716d7391fbbb38cca6c5ffd89d3
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,13 @@ #!/usr/bin/env python -from distutils.core import setup from os.path import abspath, join, dirname +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + + setup( name='ccm', version='1.1',
Use setuptools to run with install_requires
riptano_ccm
train
py
1835b8de532e603091b4b0afbe8eeb95e8b04a1a
diff --git a/src/main/java/com/vmware/vim25/ws/SoapClient.java b/src/main/java/com/vmware/vim25/ws/SoapClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/vmware/vim25/ws/SoapClient.java +++ b/src/main/java/com/vmware/vim25/ws/SoapClient.java @@ -237,7 +237,9 @@ public abstract class SoapClient implements Client { */ public String marshall(String methodName, Argument[] paras) { String soapMsg = XmlGen.toXML(methodName, paras, vimNameSpace); - log.trace("Marshalled Payload String xml: " + soapMsg); + if (log.isTraceEnabled()) { + log.trace("Marshalled Payload String xml: " + soapMsg); + } return soapMsg; }
Performance improvement - don't issue a log.trace with a huge string content concatnation, without first checking if trace is enabled
yavijava_yavijava
train
java
f559546226111be780001d6fae215064bfd957eb
diff --git a/src/Framework/Hal/Strategy/JsonResponseStrategy.php b/src/Framework/Hal/Strategy/JsonResponseStrategy.php index <HASH>..<HASH> 100644 --- a/src/Framework/Hal/Strategy/JsonResponseStrategy.php +++ b/src/Framework/Hal/Strategy/JsonResponseStrategy.php @@ -62,6 +62,9 @@ class JsonResponseStrategy implements StrategyInterface continue; } + /** + * @var $link Link + */ $data['_links'][$link->getRel()] = $this->handleLink($link); }
Added type-hint comment to remove warning of 'method not found'
phOnion_framework
train
php
07bb766f03bb1067d105a4714fd6fe14984b059a
diff --git a/tests/test_vapor_pressure.py b/tests/test_vapor_pressure.py index <HASH>..<HASH> 100644 --- a/tests/test_vapor_pressure.py +++ b/tests/test_vapor_pressure.py @@ -134,7 +134,14 @@ def test_VaporPressure(): assert_close(w.T_dependent_property(305.), 4715.122890601165) w.extrapolation = 'interp1d' assert_close(w.T_dependent_property(200.), 0.5364148240126076) - + + Ts_bad = [300, 325, 350] + Ps_bad = [1, -1, 1j] + with pytest.raises(ValueError): + w.add_tabular_data(Ts=Ts_bad, properties=Ps_bad) + Ts_rev = list(reversed(Ts)) + with pytest.raises(ValueError): + w.add_tabular_data(Ts=Ts_rev, properties=Ps) # Get a check for Antoine Extended cycloheptane = VaporPressure(Tb=391.95, Tc=604.2, Pc=3820000.0, omega=0.2384, CASRN='291-64-5')
More test coverage of bad tabular inputs
CalebBell_thermo
train
py
64a576cb4a7a926bd5cadb7f7e1516ee74053dde
diff --git a/source/Core/VirtualNameSpaceClassMap.php b/source/Core/VirtualNameSpaceClassMap.php index <HASH>..<HASH> 100644 --- a/source/Core/VirtualNameSpaceClassMap.php +++ b/source/Core/VirtualNameSpaceClassMap.php @@ -27,6 +27,9 @@ namespace OxidEsales\EshopCommunity\Core; * Each edition has its own map file. The map files will be merged like this: CE <- PE <- EE * So the mapping to a concrete class will be overwritten, if a class exists in a different edition. * + * NOTE: exceptions aren't working at the moment with the virtual namespaces (throwing them is the problem). + * Use the OxidEsales\EshopCommunity namespace instead! + * * @inheritdoc */ class VirtualNameSpaceClassMap extends \OxidEsales\EshopCommunity\Core\Edition\ClassMap
ESDEV-<I> Add notes about the exceptions to the virtual namespace class maps The throwing of virtual namepsaced exceptions isn't working yet. So we add a note here about the why.
OXID-eSales_oxideshop_ce
train
php
51208a12511189701a455981fd6216f6c8e3bd95
diff --git a/lib/app/models/open_object_resource.rb b/lib/app/models/open_object_resource.rb index <HASH>..<HASH> 100644 --- a/lib/app/models/open_object_resource.rb +++ b/lib/app/models/open_object_resource.rb @@ -316,7 +316,7 @@ module Ooor if self.class.associations_keys.index(skey) || value.is_a?(Array) #FIXME may miss m2o with inherits! @associations[skey] = value #the association because we want the method to load the association through method missing else - @attributes[skey] = value + @attributes[skey] = (value == false)? nil : value end end self
initialize attributes to nil rather than false to play nice with user interfaces
akretion_ooor
train
rb
05baa7da268437edfc1db104ac59a0e1b821874f
diff --git a/did/plugins/trello.py b/did/plugins/trello.py index <HASH>..<HASH> 100644 --- a/did/plugins/trello.py +++ b/did/plugins/trello.py @@ -49,7 +49,7 @@ from did.utils import log, pretty, listed, split from did.stats import Stats, StatsGroup DEFAULT_FILTERS = [ - "createCard", "updateCard", + "commentCard", "createCard", "updateCard", "updateCard:idList", "updateCard:closed", "updateCheckItemStateOnCard"] @@ -256,6 +256,7 @@ class TrelloStatsGroup(StatsGroup): 'Boards': {}, 'Lists': {}, 'Cards': { + 'commentCard': TrelloCards, 'updateCard': TrelloCards, 'updateCard:closed': TrelloCardsClosed, 'updateCard:idList': TrelloCardsMoved,
Add commentCard to trello DEFAULT_FILTERS It is not sufficient to customize the trello plugin 'filters' to make it display the commentCard objects too, because there is no mapping for such a card action into a python class. This change updates the DEFAULT_FILTERS list to include commentCard and adds the matching filter_map item.
psss_did
train
py
b14cf9d6377c213950faf83213e263bb59c28079
diff --git a/controller/src/main/java/org/jboss/as/controller/ReadOnlyContext.java b/controller/src/main/java/org/jboss/as/controller/ReadOnlyContext.java index <HASH>..<HASH> 100644 --- a/controller/src/main/java/org/jboss/as/controller/ReadOnlyContext.java +++ b/controller/src/main/java/org/jboss/as/controller/ReadOnlyContext.java @@ -30,6 +30,7 @@ import org.jboss.as.controller.access.AuthorizationResult; import org.jboss.as.controller.access.ResourceAuthorization; import org.jboss.as.controller.client.MessageSeverity; import org.jboss.as.controller.logging.ControllerLogger; +import org.jboss.as.controller.notification.Notification; import org.jboss.as.controller.persistence.ConfigurationPersistenceException; import org.jboss.as.controller.persistence.ConfigurationPersister; import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; @@ -321,6 +322,11 @@ class ReadOnlyContext extends AbstractOperationContext { return primaryContext.authorizeResource(attributes, isDefaultResource); } + @Override + public void emit(Notification notification) { + throw readOnlyContext(); + } + Resource getModel() { return primaryContext.getModel(); }
override emit(Notification) to delegate the notification emission to the primary context
wildfly_wildfly-core
train
java
5f10caa4af6df4d39e86be8f8101b4a7d90cad28
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -179,7 +179,8 @@ function OtrEventHandler( otrChannel ){ case "log_message": emit(o.EVENT,o.message);break; case "new_fingerprint": emit(o.EVENT,o.fingerprint);break; case "write_fingerprints": - otrChannel.user.writeFingerprints(); + //otrChannel.user.writeFingerprints(); + emit(o.EVENT);//app will decide to write fringerprints or not. break; case "is_logged_in": return 1;break;//assume remote buddy is logged in. case "policy":
fix for start_smp, app decides to write_fingerprints or not..
mnaamani_node-otr-v2
train
js
72e0d04a4bdb56db85e7c5fe4bd61d2162c7ffe5
diff --git a/actionview/lib/action_view/renderer/object_renderer.rb b/actionview/lib/action_view/renderer/object_renderer.rb index <HASH>..<HASH> 100644 --- a/actionview/lib/action_view/renderer/object_renderer.rb +++ b/actionview/lib/action_view/renderer/object_renderer.rb @@ -4,8 +4,15 @@ module ActionView class ObjectRenderer < PartialRenderer # :nodoc: include ObjectRendering + def initialize(lookup_context, options) + super + @object = nil + @local_name = nil + end + def render_object_with_partial(object, partial, context, block) - @object = object + @object = object + @local_name = local_variable(partial) render(partial, context, block) end @@ -16,12 +23,11 @@ module ActionView private def template_keys(path) - super + [local_variable(path)] + super + [@local_name] end def render_partial_template(view, locals, template, layout, block) - as = template.variable - locals[as] = @object + locals[@local_name || template.variable] = @object super(view, locals, template, layout, block) end end
Fix issue in ActionText ActionText was using `render` in a way that ActionView didn't have tests for. This is a fix for it.
rails_rails
train
rb
94da4cfd29fd5951ef710b4cda4c73ee6d81a5fa
diff --git a/avrgirl-arduino.js b/avrgirl-arduino.js index <HASH>..<HASH> 100644 --- a/avrgirl-arduino.js +++ b/avrgirl-arduino.js @@ -153,11 +153,36 @@ Avrgirl_arduino.prototype._uploadSTK500v2 = function (eggs, callback) { Avrgirl_arduino.prototype._resetAVR109 = function (callback) { var self = this; var resetFile = __dirname + '/lib/leo-reset.js'; + var tries = 0; + var cb = callback; childProcess.execFile('node', [resetFile, self.options.port], function() { - // replace this timeout with a port poll instead. - setTimeout(callback, 600); + tryConnect(function(connected) { + var status = connected ? null : new Error('could not complete reset.'); + cb(status); + }); }); + + function tryConnect (callback) { + function checkList() { + Serialport.list(function (error, ports) { + // iterate through ports + for (var i = 0; i < ports.length; i++) { + // iterate through all possible pid's + if (ports[i].comName === self.options.port) { + return callback(true); + } + } + tries += 1; + if (tries < 4) { + setTimeout(checkList, 300); + } else { + return callback(false); + } + }); + } + setTimeout(checkList, 300); + } };
add port polling after reset for board sleep allowance
noopkat_avrgirl-arduino
train
js
18ec788bbe4592b2baad10c709b27aaf155895c8
diff --git a/test/functional/associations/test_one_proxy.rb b/test/functional/associations/test_one_proxy.rb index <HASH>..<HASH> 100644 --- a/test/functional/associations/test_one_proxy.rb +++ b/test/functional/associations/test_one_proxy.rb @@ -24,6 +24,18 @@ class OneProxyTest < Test::Unit::TestCase post.author.object_id.should == post.author.target.object_id end + + should "allow assignment of associated document using a hash" do + @post_class.one :author, :class => @author_class + + post = @post_class.new('author' => { 'name' => 'Frank' }) + post.author.name.should == 'Frank' + + post.save.should be_true + post.reload + + post.author.name.should == 'Frank' + end context "replacing the association" do context "with an object of the class" do
add a similar test that many documents and many embedded documents proxies have
mongomapper_mongomapper
train
rb
b4af9a6e0f61abd665864acf85024c382b097932
diff --git a/sockjsclient/xhr.go b/sockjsclient/xhr.go index <HASH>..<HASH> 100644 --- a/sockjsclient/xhr.go +++ b/sockjsclient/xhr.go @@ -256,7 +256,7 @@ type doResult struct { } func (x *XHRSession) do(req *http.Request) <-chan doResult { - ch := make(chan doResult) + ch := make(chan doResult, 1) go func() { var res doResult
sockjsclient: do not block on sending do() method Result
koding_kite
train
go
d44042453c4b3e115f18bcc527cfecd3e07fbb6c
diff --git a/tenant_schemas_celery/registry_test.py b/tenant_schemas_celery/registry_test.py index <HASH>..<HASH> 100644 --- a/tenant_schemas_celery/registry_test.py +++ b/tenant_schemas_celery/registry_test.py @@ -33,7 +33,6 @@ def test_get_schema_from_class_task_registration(transactional_db): task = app._tasks[name] assert not inspect.isclass(task) assert task.__class__.__name__ == 'get_schema_from_class_task' - assert isinstance(task, TenantTask) assert isinstance(task, SchemaClassTask)
verified we are of the specified base class and ignore tenanttask
maciej-gol_tenant-schemas-celery
train
py
e1c153cbaa2f4dc6fa10aec8e3afb38c1b437947
diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index <HASH>..<HASH> 100644 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -2068,7 +2068,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix model_to_load = getattr(model, cls.base_model_prefix) if any(key in expected_keys_not_prefixed for key in loaded_keys): raise ValueError( - "The state dictionary of the model you are training to load is corrupted. Are you sure it was " + "The state dictionary of the model you are trying to load is corrupted. Are you sure it was " "properly saved?" )
[Typo] Fix typo in modeling utils (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
21fff04ec86f4d3b6eab79114f8aae2a007bb123
diff --git a/src/main/java/org/codelibs/fess/FessBoot.java b/src/main/java/org/codelibs/fess/FessBoot.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/codelibs/fess/FessBoot.java +++ b/src/main/java/org/codelibs/fess/FessBoot.java @@ -82,7 +82,7 @@ public class FessBoot extends TomcatBoot { if (fessLogPath == null) { fessLogPath = "../../logs"; } - op.replace("fess.log.path", fessLogPath); + op.replace("fess.log.path", fessLogPath.replace("\\", "/")); }) // uses jdk14logger .asDevelopment(isNoneEnv()).bootAwait(); }
fix fess.log.path on windows
codelibs_fess
train
java
716fb31ae6a11ad6d243a0d69d9535adf2410da3
diff --git a/tests/main.js b/tests/main.js index <HASH>..<HASH> 100644 --- a/tests/main.js +++ b/tests/main.js @@ -24,6 +24,24 @@ exports.defineAutoTests = function () { fail("Write Boolean Failed"); }); }); + it('Ints', function (done) { + var dummyData = 154243; + NativeStorage.set("dummy_ref_int", + dummyData, + function (result) { + NativeStorage.getInt("dummy_ref_int", + function (result) { + expect(result).toEqual(dummyData); + done(); + }, + function (e) { + fail("Read Int Failed"); + }); + }, + function (e) { + fail("Write Int Failed"); + }); + }); it('Objects', function (done) { var dummyData = { data1: "", data2: 2, data3: 3.0 }; NativeStorage.set("dummy_ref_obj",
Added Integers Write-Read to Test Suite Coverage
TheCocoaProject_cordova-plugin-nativestorage
train
js
27ebb1ddb5037cfe46e5e4d1274be957db7e1eda
diff --git a/lib/Predis.php b/lib/Predis.php index <HASH>..<HASH> 100644 --- a/lib/Predis.php +++ b/lib/Predis.php @@ -1511,6 +1511,8 @@ class RedisServer_vNext extends RedisServer_v1_2 { /* publish - subscribe */ 'subscribe' => '\Predis\Commands\Subscribe', 'unsubscribe' => '\Predis\Commands\Unsubscribe', + 'psubscribe' => '\Predis\Commands\SubscribeByPattern', + 'punsubscribe' => '\Predis\Commands\UnsubscribeByPattern', 'publish' => '\Predis\Commands\Publish', /* remote server control commands */ @@ -2348,6 +2350,16 @@ class Unsubscribe extends \Predis\MultiBulkCommand { public function getCommandId() { return 'UNSUBSCRIBE'; } } +class SubscribeByPattern extends \Predis\MultiBulkCommand { + public function canBeHashed() { return false; } + public function getCommandId() { return 'PSUBSCRIBE'; } +} + +class UnsubscribeByPattern extends \Predis\MultiBulkCommand { + public function canBeHashed() { return false; } + public function getCommandId() { return 'PUNSUBSCRIBE'; } +} + class Publish extends \Predis\MultiBulkCommand { public function canBeHashed() { return false; } public function getCommandId() { return 'PUBLISH'; }
New commands: PSUBSCRIBE and PUNSUBSCRIBE (Redis <I>-dev).
imcj_predis
train
php
c134dc17017b6b83018c1052d0fbcec2adfb68d8
diff --git a/lib/src/ChainWebSocket.js b/lib/src/ChainWebSocket.js index <HASH>..<HASH> 100644 --- a/lib/src/ChainWebSocket.js +++ b/lib/src/ChainWebSocket.js @@ -50,7 +50,12 @@ class ChainWebSocket { this.recv_life --; if( this.recv_life == 0){ console.error('keep alive timeout.'); - this.ws.terminate(); + if( this.ws.terminate ) { + this.ws.terminate(); + } + else{ + this.ws.close(); + } clearInterval(this.keepalive_timer); this.keepalive_timer = undefined; return;
fix an issue in browser which doesn't have terminate method on WebSocket.
bitshares_bitsharesjs-ws
train
js
c4e14ae4fa372f52c2cdebe0d63acd0c7830d3c4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from __future__ import print_function from codecs import open from setuptools import setup, find_packages -VERSION = '0.2.0' +VERSION = '0.3.0' DEPENDENCIES = [ 'argcomplete',
Change version to <I> (#<I>)
Microsoft_knack
train
py
e1e2942f51e6cc57b422d547b8a43327bf95d8ae
diff --git a/generators/generator-constants.js b/generators/generator-constants.js index <HASH>..<HASH> 100644 --- a/generators/generator-constants.js +++ b/generators/generator-constants.js @@ -28,7 +28,7 @@ const DOCKER_COUCHBASE = 'couchbase:6.0.1'; const DOCKER_CASSANDRA = 'cassandra:3.11.4'; const DOCKER_MSSQL = 'microsoft/mssql-server-linux:latest'; const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:3.12'; -const DOCKER_MEMCACHED = 'memcached:1.5.12-alpine'; +const DOCKER_MEMCACHED = 'memcached:1.5.15-alpine'; const DOCKER_KEYCLOAK = 'jboss/keycloak:6.0.1'; const DOCKER_ELASTICSEARCH = 'docker.elastic.co/elasticsearch/elasticsearch:6.4.3'; // The version should be coerent with the one from spring-data-elasticsearch project const DOCKER_KAFKA = 'wurstmeister/kafka:2.11-2.0.1';
Update memcached docker image to <I>-alpine
jhipster_generator-jhipster
train
js
021cc4c2bd132ce89cfd08cbb3a97ed95b14e2ec
diff --git a/lib/init-archive.js b/lib/init-archive.js index <HASH>..<HASH> 100644 --- a/lib/init-archive.js +++ b/lib/init-archive.js @@ -125,9 +125,12 @@ module.exports = function (opts, cb) { } function tryOtherKey () { - debug('Bad Key. Trying other key.') - archive = drive.createArchive(keys[0], opts) - doneArchive() + archive.close(function (err) { + if (err) debug(err) // Hopefully no error but we just want this thing closed! + debug('Bad Key. Trying other key.') + archive = drive.createArchive(keys[0], opts) + doneArchive() + }) } }) }
close old archive before opening new (#<I>)
datproject_dat-node
train
js
d89de7479007a05442ea1906c696d9b1ffc57d21
diff --git a/lib/class_methods.js b/lib/class_methods.js index <HASH>..<HASH> 100644 --- a/lib/class_methods.js +++ b/lib/class_methods.js @@ -394,7 +394,12 @@ ClassMethods.many = function(associatedModel) { ClassMethods.one = function(associatedModel, opts) { this.hasOne = this.hasOne || {} - this.hasOne[_.singularize(associatedModel.collectionName())] = { model: associatedModel, opts: opts } + var name = _.singularize(associatedModel.collectionName()) + if(opts && opts.as) { + opts.foreignKey = opts.foreignKey || opts.as + "Id" + name = opts.as + } + this.hasOne[name] = { model: associatedModel, opts: opts } return this } diff --git a/lib/instance_methods.js b/lib/instance_methods.js index <HASH>..<HASH> 100644 --- a/lib/instance_methods.js +++ b/lib/instance_methods.js @@ -445,5 +445,14 @@ var InstanceMethods = { keys.push("_id") return keys } + +, assocs: function() { + var assocs = _.union( + _.keys(this.constructor.hasMany || {}) + , _.keys(this.constructor.hasOne || {}) + , _.keys(this.constructor.belongingTo || {}) + ) + return assocs + } } module.exports = InstanceMethods
get a list of assocs
xcoderzach_LiveDocument
train
js,js
88ea06930c53ce5a386f27d03e4df533bb572eb0
diff --git a/packages/webchannel-wrapper/gulpfile.js b/packages/webchannel-wrapper/gulpfile.js index <HASH>..<HASH> 100644 --- a/packages/webchannel-wrapper/gulpfile.js +++ b/packages/webchannel-wrapper/gulpfile.js @@ -52,7 +52,9 @@ const closureDefines = [ // Disables IE8-specific event fallback code (saves 523 bytes). 'goog.events.CAPTURE_SIMULATION_MODE=0', // Disable IE-Specific ActiveX fallback for XHRs (saves 524 bytes). - 'goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR=true' + 'goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR=true', + // Disable Origin Trials code for WebChannel (saves 1786 bytes). + 'goog.net.webChannel.ALLOW_ORIGIN_TRIAL_FEATURES=false', ]; /**
Disable Origin Trial code in WebChannel to reduce JS bundle size. (#<I>)
firebase_firebase-js-sdk
train
js
88971f95f38574279411c3397108550fb2320a88
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -49,6 +49,8 @@ export { default as BootstrapProvider } from './components/BootstrapProvider'; export { default as Breadcrumb } from './components/Breadcrumb'; export { default as Button } from './components/Button'; export { default as ButtonGroup } from './components/ButtonGroup'; +export { default as ButtonCheckbox } from './components/ButtonCheckbox'; +export { default as ButtonRadio } from './components/ButtonRadio'; export { default as Caption } from './components/Caption'; export { default as Clearfix } from './components/Clearfix'; export { default as Close } from './components/Close';
Update export for ButtonRadio and ButtonCheckbox
bootstrap-styled_v4
train
js
9236c9725ba5a419abd7112cf57cdb97c975c4b0
diff --git a/lib/adp-downloader/http_client.rb b/lib/adp-downloader/http_client.rb index <HASH>..<HASH> 100644 --- a/lib/adp-downloader/http_client.rb +++ b/lib/adp-downloader/http_client.rb @@ -9,8 +9,10 @@ module ADPDownloader end def get(url) - contents = download(url) - contents.to_s.empty? ? {} : JSON.parse(contents) + res = agent.get(url) + _raise_on_error(res) + contents = res.body + contents.body.to_s.empty? ? {} : JSON.parse(contents) end def post(url, data) @@ -41,7 +43,8 @@ module ADPDownloader def _raise_on_error(res) uri = res.uri.to_s.downcase if not uri.start_with? TARGET_URL or uri.include? "login" - raise "Unable to authenticate: make sure your username and password are correct" + #raise "Unable to authenticate: make sure your username and password are correct" + raise "Unable to authenticate: make sure the file cookie.txt is up to date" end end end
Display better error message on auth error Since we're using the cookie based auth, there's no more validation of auth credentials during http client instantiation. This sort of validades it on every get request. It's a pretty ugly solution just to temporarily get around the issue of not being able to authenticate with username and password.
andersonvom_adp-downloader
train
rb
7ae590a0ba1b8fba8eb6643c9a44fe848fe9c5ee
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,17 @@ +import sys from setuptools import setup, find_packages install_requires = [ 'prompt_toolkit', - 'pathlib', 'python-keystoneclient' ] -test_requires = [ - 'mock' -] +test_requires = [] + +if sys.version_info[0] == 2: + install_requires.append('pathlib') + test_requires.append('mock') + setup( name='contrail-api-cli',
Install requirements depending on python version
eonpatapon_contrail-api-cli
train
py
68b13d679e7ba25c8891076ff50c0f40d64cdd7c
diff --git a/libraries/lithium/console/command/Help.php b/libraries/lithium/console/command/Help.php index <HASH>..<HASH> 100644 --- a/libraries/lithium/console/command/Help.php +++ b/libraries/lithium/console/command/Help.php @@ -33,12 +33,12 @@ class Help extends \lithium\console\Command { $this->_renderCommands(); return true; } - $command = Inflector::classify($command); - if (!$class = Libraries::locate('command', $command)) { $this->error("Command `{$command}` not found"); return false; } + $command = Inflector::classify($command); + if (strpos($command, '\\') !== false) { $command = join('', array_slice(explode("\\", $command), -1)); }
Updating `Help` command to classify passed command name later. This is so the previous error message shouldn't contain the already classified command but the one actually literally given.
UnionOfRAD_framework
train
php
1c5a8bb9cb32d094a3ab97ad704850309d78810b
diff --git a/kie-internal/src/main/java/org/kie/internal/task/api/model/TaskEvent.java b/kie-internal/src/main/java/org/kie/internal/task/api/model/TaskEvent.java index <HASH>..<HASH> 100644 --- a/kie-internal/src/main/java/org/kie/internal/task/api/model/TaskEvent.java +++ b/kie-internal/src/main/java/org/kie/internal/task/api/model/TaskEvent.java @@ -43,6 +43,8 @@ public interface TaskEvent { String getCorrelationKey(); Integer getProcessType(); + + String getCurrentOwner(); void setCorrelationKey(String correlationKey);
[JBPM-<I>] Adding actual owner to TaskEvent With this addition, code retrieving the event can determine which was the actual owner after the operation was applied.
kiegroup_droolsjbpm-knowledge
train
java
4f4a2d08c10c189da56e740e270d7146ec8a8251
diff --git a/addon/remote/route-mixin.js b/addon/remote/route-mixin.js index <HASH>..<HASH> 100644 --- a/addon/remote/route-mixin.js +++ b/addon/remote/route-mixin.js @@ -2,10 +2,13 @@ import Ember from 'ember'; import PagedRemoteArray from './paged-remote-array'; export default Ember.Mixin.create({ + perPage: 10, + startingPage: 1, + findPaged: function(name, params) { return PagedRemoteArray.create({ - page: params.page || 1, - perPage: params.perPage || 10, + page: params.page || this.get('startingPage'), + perPage: params.perPage || this.get('perPage'), modelName: name, store: this.store });
allow setting perPage as route property
mharris717_ember-cli-pagination
train
js
c6151103b476ab3de3ebe0dfc71a7039a941ffca
diff --git a/packages/@vue/cli-shared-utils/lib/module.js b/packages/@vue/cli-shared-utils/lib/module.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-shared-utils/lib/module.js +++ b/packages/@vue/cli-shared-utils/lib/module.js @@ -61,6 +61,11 @@ exports.resolveModule = function (request, context) { } exports.loadModule = function (request, context, force = false) { + // createRequire doesn't work with jest mock modules (which we used in migrator, for inquirer) + if (process.env.VUE_CLI_TEST && request.endsWith('migrator')) { + return require(request) + } + try { return createRequire(path.resolve(context, 'package.json'))(request) } catch (e) {
test: fix mock module in upgrader test
vuejs_vue-cli
train
js
bd69d4f8387c4428822a6f69bc51418d6651a8ee
diff --git a/mixins.py b/mixins.py index <HASH>..<HASH> 100755 --- a/mixins.py +++ b/mixins.py @@ -423,10 +423,10 @@ class SimpleTreeMixin(object): # started with; you will get a copy of the same data # from the database in a new Python object. # - def get_parents(self, oldest_first = False): + def get_parents(self, oldest_first = False, stop_at_id = None): ancestors = [] node = self - while node.parent is not None: + while node.parent is not None and (stop_at_id is None or stop_at_id != node.pk): node = node.parent ancestors.append(node) @@ -435,6 +435,18 @@ class SimpleTreeMixin(object): else: return ancestors + # and a simpler, related question: is node A a + # child of node B? + def is_child_of(self, candidate_id, allow_self = True): + # something is often considered a child of itself; + # we test this first because get_parents will NOT + # include self in the list, but WILL stop (with + # an empty list) if self is the candidate + if self.pk == candidate_id: + return allow_self + ancestors = self.get_parents(stop_at_id = candidate_id) + return len(ancestors) > 0 and ancestors[-1].pk == candidate_id + # get the root node # # Similar parent-then-child fetching caveat as
Added ability to test ancestorship in SimpleTreeMixin.
damienjones_sculpt-model-tools
train
py
b20c8bf12fd668e77ebab2e36e8d9fb28f66e890
diff --git a/src/League/Fractal/Manager.php b/src/League/Fractal/Manager.php index <HASH>..<HASH> 100644 --- a/src/League/Fractal/Manager.php +++ b/src/League/Fractal/Manager.php @@ -42,6 +42,4 @@ class Manager return $scopeInstance; } - - } diff --git a/src/League/Fractal/Scope.php b/src/League/Fractal/Scope.php index <HASH>..<HASH> 100644 --- a/src/League/Fractal/Scope.php +++ b/src/League/Fractal/Scope.php @@ -110,7 +110,7 @@ class Scope { $data = $this->runAppropriateTransformer(); - $output = []; + $output = array(); if ($this->availableEmbeds) { $output['embeds'] = $this->availableEmbeds; @@ -166,7 +166,8 @@ class Scope $data = $this->transformPaginator(); } else { throw new \InvalidArgumentException( - 'Argument $resource should be an instance of Resource\Item, Resource\Collection or Resource\PaginatedCollection' + 'Argument $resource should be an instance of Resource\Item, Resource\Collection' + . ' or Resource\PaginatedCollection' ); }
Every time you convert a short array to a long one, a fairy dies.
thephpleague_fractal
train
php,php
06b8fcdbd8923333aa308a11bf69126fd38408da
diff --git a/tests/integration/shell/test_call.py b/tests/integration/shell/test_call.py index <HASH>..<HASH> 100644 --- a/tests/integration/shell/test_call.py +++ b/tests/integration/shell/test_call.py @@ -9,7 +9,6 @@ # Import python libs from __future__ import absolute_import -import getpass import os import sys import re @@ -25,7 +24,6 @@ from tests.support.mixins import ShellCaseCommonTestsMixin from tests.support.helpers import ( destructiveTest, flaky, - requires_system_grains, skip_if_not_root, ) from tests.integration.utils import testprogram
Appease the mighty linter
saltstack_salt
train
py
fa150109b736d2337c385e03bdf2a6fb77b9efd2
diff --git a/projects/samskivert/src/java/com/samskivert/jdbc/jora/Table.java b/projects/samskivert/src/java/com/samskivert/jdbc/jora/Table.java index <HASH>..<HASH> 100644 --- a/projects/samskivert/src/java/com/samskivert/jdbc/jora/Table.java +++ b/projects/samskivert/src/java/com/samskivert/jdbc/jora/Table.java @@ -173,6 +173,14 @@ public class Table { return new Cursor(this, session, 1, query); } + /** Like {@link #join} but does a straight join with the specified + * table. */ + public final Cursor straightJoin(String table, String condition) { + String query = "select " + listOfFields + + " from " + name + " straight_join " + table + " " + condition; + return new Cursor(this, session, 1, query); + } + /** Select records from database table according to search condition * * @param condition valid SQL condition expression started with WHERE
Added straightJoin() for those times when you know you gotta be a straight shooter. git-svn-id: <URL>
samskivert_samskivert
train
java
31ed57432232da47f697fe8bc0a9e4789558d5f2
diff --git a/source/partialObject.js b/source/partialObject.js index <HASH>..<HASH> 100644 --- a/source/partialObject.js +++ b/source/partialObject.js @@ -29,5 +29,5 @@ import _curry2 from './internal/_curry2.js'; * sayHelloToMs({ firstName: 'Jane', lastName: 'Jones' }); //=> 'Hello, Ms. Jane Jones!' * @symb R.partialObject(f, { a, b })({ c, d }) = f({ a, b, c, d }) */ - -export default _curry2((f, o) => (props) => f.call(this, mergeDeepRight(o, props))); +var partialObject = _curry2((f, o) => (props) => f.call(this, mergeDeepRight(o, props))); +export default partialObject;
refactor: assign partialObject function to var so that JSDoc can infer its name (#<I>) fix ramda/ramda.github.io#<I>
ramda_ramda
train
js
9e3152be4a2c9bc97fead6be0d487c7e35984dbc
diff --git a/webapps/client/scripts/task/directives/cam-tasklist-task-meta.js b/webapps/client/scripts/task/directives/cam-tasklist-task-meta.js index <HASH>..<HASH> 100644 --- a/webapps/client/scripts/task/directives/cam-tasklist-task-meta.js +++ b/webapps/client/scripts/task/directives/cam-tasklist-task-meta.js @@ -55,6 +55,7 @@ define([ }); $scope.groupsState = taskMetaData.observe('groups', function(groups) { + groups = groups || []; var groupIds = []; for (var i = 0, group; !!(group = groups[i]); i++) { groupIds.push(group.groupId);
fix(groups): initialize array of groups
camunda_camunda-bpm-platform
train
js
2665c3860aa44dd00f76059f29c6e77d17895630
diff --git a/raiden/transfer/node.py b/raiden/transfer/node.py index <HASH>..<HASH> 100644 --- a/raiden/transfer/node.py +++ b/raiden/transfer/node.py @@ -433,6 +433,7 @@ def maybe_add_tokennetwork( ids_to_tokens[token_network_address] = token_network_state addresses_to_ids[token_address] = token_network_address + token_network_registry_state.token_network_list.append(token_network_state) mapping = chain_state.tokennetworkaddresses_to_tokennetworkregistryaddresses mapping[token_network_address] = token_network_registry_address
Fix inconsistent token network registry TNs that were registered were included in all attributes but `token_network_list`. The class should be refactored to disallow inconsistent states.
raiden-network_raiden
train
py
9e81aff817bf7a29c7a4782ddbdedc33bc3bace2
diff --git a/test/runtime/monitor.go b/test/runtime/monitor.go index <HASH>..<HASH> 100644 --- a/test/runtime/monitor.go +++ b/test/runtime/monitor.go @@ -113,6 +113,7 @@ var _ = Describe("RuntimeMonitorTest", func() { }) It("Cilium monitor event types", func() { + Skip("Disabled flake: https://github.com/cilium/cilium/issues/7872") monitorConfig()
CI: Disable RuntimeMonitorTest With Sample Containers Cilium monitor event types This began failing often sometime around April <I>. See <URL>
cilium_cilium
train
go
9e3a3336a1d64ee3d7d636fd1e8261155be7c03a
diff --git a/spec/element_spec.rb b/spec/element_spec.rb index <HASH>..<HASH> 100644 --- a/spec/element_spec.rb +++ b/spec/element_spec.rb @@ -45,7 +45,7 @@ describe Watir::Element do describe "#hover" do not_compliant_on [:webdriver, :firefox, :synthesized_events], - [:webdriver, :ie], + [:webdriver, :internet_explorer], [:webdriver, :iphone], [:webdriver, :safari] do it "should hover over the element" do
Rename :ie guard to :internet_explorer.
watir_watir
train
rb
6e0983ebbd68d86ed0851b406c1ed9a3ae8b7e66
diff --git a/xiaomi_gateway/__init__.py b/xiaomi_gateway/__init__.py index <HASH>..<HASH> 100644 --- a/xiaomi_gateway/__init__.py +++ b/xiaomi_gateway/__init__.py @@ -70,7 +70,7 @@ class XiaomiGatewayDiscovery(object): (self.MULTICAST_ADDRESS, self.GATEWAY_DISCOVERY_PORT)) while True: - data, _ = _socket.recvfrom(1024) + data, (ip_add, _) = _socket.recvfrom(1024) if len(data) is None: continue @@ -83,7 +83,6 @@ class XiaomiGatewayDiscovery(object): _LOGGER.error("Response must be gateway model") continue - ip_add = resp["ip"] if ip_add in self.gateways: continue
Consistently use IP from package sender and not from data in packet. (#<I>) This fixes issues with "Unknown gateway ip" when using Multicast forwarders
Danielhiversen_PyXiaomiGateway
train
py
17d5955b9803779e2d5b29e439a348290b1f33f1
diff --git a/tests/CarbonInterval/CascadeTest.php b/tests/CarbonInterval/CascadeTest.php index <HASH>..<HASH> 100644 --- a/tests/CarbonInterval/CascadeTest.php +++ b/tests/CarbonInterval/CascadeTest.php @@ -312,4 +312,16 @@ class CascadeTest extends AbstractTestCase $this->assertSame(28, CarbonInterval::getFactor('day', 'month')); $this->assertSame(28, CarbonInterval::getFactor('dayz', 'months')); } + + public function testComplexInterval() + { + $this->markTestIncomplete('To be fixed in 2.37.x'); + + $interval = CarbonInterval::create() + ->years(-714)->months(-101)->days(-737) + ->seconds(442)->microseconds(-19); + + $this->assertFalse($interval->cascade()->hasNegativeValues()); + $this->assertTrue($interval->cascade()->hasPositiveValues()); + } }
Add unit test to be fixed in <I>.x
briannesbitt_Carbon
train
php
d84c5ea74091ba3e850ca6248e242695c3931692
diff --git a/saltapi/netapi/rest_cherrypy.py b/saltapi/netapi/rest_cherrypy.py index <HASH>..<HASH> 100644 --- a/saltapi/netapi/rest_cherrypy.py +++ b/saltapi/netapi/rest_cherrypy.py @@ -187,7 +187,7 @@ class Login(LowDataAdapter): def GET(self): cherrypy.response._tmpl = self.tmpl cherrypy.response.status = '401 Unauthorized' - cherrypy.response.headers['WWW-Authenticate'] = 'HTML' + cherrypy.response.headers['WWW-Authenticate'] = 'Session' return { 'status': cherrypy.response.status,
Changed value of authentication header; still arbitrary and custom
saltstack_salt
train
py
a09b879b784c14c37833f2d87ac6924c2f04db9a
diff --git a/DrdPlus/Properties/Derived/FatigueBoundary.php b/DrdPlus/Properties/Derived/FatigueBoundary.php index <HASH>..<HASH> 100644 --- a/DrdPlus/Properties/Derived/FatigueBoundary.php +++ b/DrdPlus/Properties/Derived/FatigueBoundary.php @@ -10,7 +10,6 @@ class FatigueBoundary extends AbstractDerivedProperty { const FATIGUE_BOUNDARY = PropertyCode::FATIGUE_BOUNDARY; - // TODO PPH page 117 left column little catty Mrrr and its less-than-one fatigue boundary... /** * @param Endurance $endurance * @param Tables $tables
A todo moved to more related library
drdplusinfo_drdplus-properties
train
php
c282d90044617eafa12a772af4d748293c0a1025
diff --git a/src/common/api.js b/src/common/api.js index <HASH>..<HASH> 100644 --- a/src/common/api.js +++ b/src/common/api.js @@ -49,13 +49,6 @@ module.exports.version = sre.System.getInstance().version; /** * Exporting method to return an aural rendered speech string. - * @deprecated Use toSpeech(). - */ -module.exports.processExpression = sre.Api.toSpeech; - - -/** - * Exporting method to return an aural rendered speech string. */ module.exports.toSpeech = sre.Api.toSpeech; @@ -109,13 +102,6 @@ module.exports.file.toSpeech = sre.System.getInstance().fileToSpeech; /** - * Exporting method to aural render an expression from a file. - * @deprecated Use file.toSpeech() - */ -module.exports.processFile = sre.System.getInstance().fileToSpeech; - - -/** * Exporting method to compute the semantic tree for an expression from a file. */ module.exports.file.toSemantic = sre.System.getInstance().fileToSemantic;
Removes deprecated API functions ``processExpression`` and ``processFile``.
zorkow_speech-rule-engine
train
js
be9c3d1a82ceded3779355daa0eb2e2dd0712fa3
diff --git a/ansible/plugins/lookup/hashivault.py b/ansible/plugins/lookup/hashivault.py index <HASH>..<HASH> 100755 --- a/ansible/plugins/lookup/hashivault.py +++ b/ansible/plugins/lookup/hashivault.py @@ -46,6 +46,7 @@ class LookupModule(LookupBase): key = None default = kwargs.get('default', None) version = kwargs.get('version') + mount_point = kwargs.get('mount_point', 'secret') params = { 'url': self._get_url(environments), 'verify': self._get_verify(environments), @@ -53,7 +54,7 @@ class LookupModule(LookupBase): 'key': key, 'default': default, 'version': version, - 'mount_point': 'secret', + 'mount_point': mount_point, } authtype = self._get_environment(environments, 'VAULT_AUTHTYPE', 'token') params['authtype'] = authtype
Add `mount_point` option to the lookup plugin The `mount_point` option is recognized by `hashivault_read` module, which can be used to override default `secret`. This commit gives similar capability to `hashivault` lookup plugin.
TerryHowe_ansible-modules-hashivault
train
py
9303a761de16cd552dea2105703795e8d2c45633
diff --git a/plugin/acts_as_ferret/lib/class_methods.rb b/plugin/acts_as_ferret/lib/class_methods.rb index <HASH>..<HASH> 100644 --- a/plugin/acts_as_ferret/lib/class_methods.rb +++ b/plugin/acts_as_ferret/lib/class_methods.rb @@ -94,8 +94,16 @@ module ActsAsFerret # Used by the DRb server when switching to a new index version. def index_dir=(dir) logger.debug "changing index dir to #{dir}" + # get a handle to the index before changing the directory (which serves + # as the key to retrieve the index instance in aaf_index method below) + idx = aaf_index + old_dir = aaf_configuration[:index_dir] aaf_configuration[:index_dir] = aaf_configuration[:ferret][:path] = dir - aaf_index.reopen! + # store index reference with new directory + ActsAsFerret::ferret_indexes[aaf_configuration[:index_dir]] = idx + # clean old reference to index + ActsAsFerret::ferret_indexes.delete old_dir + idx.reopen! logger.debug "index dir is now #{dir}" end
fix file handle leakage in rebuild_index via DRb,
jkraemer_acts_as_ferret
train
rb
6a6a2aa7dc26164d1d55f4b13cafefc0e92cb55c
diff --git a/tests/index.spec.js b/tests/index.spec.js index <HASH>..<HASH> 100644 --- a/tests/index.spec.js +++ b/tests/index.spec.js @@ -573,7 +573,7 @@ describe('GET OG', function () { expect(error).to.be(false); expect(result.success).to.be(true); expect(result.requestUrl).to.be('https://www.namecheap.com/'); - expect(result.data.ogTitle).to.be('\n\tDomain Names Starting at $0.48 - Namecheap.com\n'); + expect(result.data.ogTitle).to.be('\n\tDomain Name Registration - Buy Domain Names from $0.48 - Namecheap\n'); done(); }); });
update changed page title in test 'Valid Call - Test Name Cheap Page That Dose Not Have content-type=text/html - Should Return correct Open Graph Info'
jshemas_openGraphScraper
train
js
b901cec5a6fd42475d47ab8242c803112e80affa
diff --git a/i3pystatus/temp.py b/i3pystatus/temp.py index <HASH>..<HASH> 100644 --- a/i3pystatus/temp.py +++ b/i3pystatus/temp.py @@ -11,6 +11,7 @@ class Temperature(IntervalModule): settings = ( ("format", "format string used for output. {temp} is the temperature in degrees celsius"), + ('display_if', 'snippet that gets evaluated. if true, displays the module output'), "color", "file", "alert_temp", @@ -21,12 +22,14 @@ class Temperature(IntervalModule): file = "/sys/class/thermal/thermal_zone0/temp" alert_temp = 90 alert_color = "#FF0000" + display_if = 'True' def run(self): with open(self.file, "r") as f: temp = float(f.read().strip()) / 1000 - self.output = { - "full_text": self.format.format(temp=temp), - "color": self.color if temp < self.alert_temp else self.alert_color, - } + if eval(self.display_if): + self.output = { + "full_text": self.format.format(temp=temp), + "color": self.color if temp < self.alert_temp else self.alert_color, + }
temp: add a "display_if" setting Adds a "display_if" setting to temp module. This is a snippet that will be evaulated, and if the result is true, it will display the module's output.
enkore_i3pystatus
train
py
089a251aa4964b69492ed324602f8f69bb9e2f99
diff --git a/jquery.popupoverlay.js b/jquery.popupoverlay.js index <HASH>..<HASH> 100644 --- a/jquery.popupoverlay.js +++ b/jquery.popupoverlay.js @@ -663,8 +663,7 @@ } // Click outside of popup - if ($(el).data('popupoptions').blur && !$(event.target).closest('#' + elementId).length && event.which !== 2) { - + if ($(el).data('popupoptions').blur && !$(event.target).closest('#' + elementId).length && event.which !== 2 && $(event.target).is(':visible')) { methods.hide(el); if ($(el).data('popupoptions').type === 'overlay') {
Prevent popup from closing unintentionally if it's HTML is modified. Make sure that the popup doesn't close (with "blur" option set to true) when clicked inside of it, if HTML of the popup is dynamically replaced. E.g. $(document).on('click', '#basic #some_button', function(event) { $('#basic').html('test'); });
vast-engineering_jquery-popup-overlay
train
js
dc6ce6c9e91ebd99a136cdb9c262f088c5add342
diff --git a/lib/Widget/Resource/i18n/validator/zh-CN.php b/lib/Widget/Resource/i18n/validator/zh-CN.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Resource/i18n/validator/zh-CN.php +++ b/lib/Widget/Resource/i18n/validator/zh-CN.php @@ -20,8 +20,10 @@ return array( 'equal' => '指定的值不相等', 'exists' => '指定的路径不存在', 'file' => '指定的文件不存在', - 'file.blackExts' => '文件后缀名非法', - 'file.maxSize' => '文件太大了({{ size }}),允许的最大大小为{{ maxSize }}', + 'file.exts' => '该文件扩展名({{ ext }})不合法,允许的扩展名为:{{ exts }}', + 'file.excludeExts' => '该文件扩展名({{ ext }})不合法,不允许扩展名为:{{ excludeExts }}', + 'file.minSize' => '该文件太小了({{ size }}字节),允许的最小文件大小为{{ minSize }}字节', + 'file.maxSize' => '该文件太大了({{ size }}字节),允许的最大文件大小为{{ maxSize }}字节', 'image' => '该项必须是有效的图片', 'image.notFound' => '该图片不存在,或不可读', 'image.notDetected' => '该文件不是有效的图片,或是无法检测到图片的尺寸',
added zh-CN message for file validator
twinh_wei
train
php
5c6d25cbbe3de021806408f3cff6cb1e139c0a25
diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index <HASH>..<HASH> 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -3011,8 +3011,9 @@ * @return {Object} Returns the instance of the Gridster class. */ fn.get_widgets_from_DOM = function() { - this.$widgets.each($.proxy(function(i, widget) { - this.register_widget($(widget)); + var widgets_coords = this.$widgets.map($.proxy(function(i, widget) { + var $w = $(widget); + return this.dom_to_coords($w); }, this)); widgets_coords = Gridster.sort_by_row_and_col_asc(widgets_coords);
fix(gridster): sort widgets appropriately when reading them from DOM
ducksboard_gridster.js
train
js
488cb7a3ea061b95d197b7d2549aa1c7aaf55097
diff --git a/tests/unit/phpDocumentor/Infrastructure/FlySystemFactoryTest.php b/tests/unit/phpDocumentor/Infrastructure/FlySystemFactoryTest.php index <HASH>..<HASH> 100644 --- a/tests/unit/phpDocumentor/Infrastructure/FlySystemFactoryTest.php +++ b/tests/unit/phpDocumentor/Infrastructure/FlySystemFactoryTest.php @@ -60,7 +60,7 @@ class FlySystemFactoryTest extends \Mockery\Adapter\Phpunit\MockeryTestCase /** @var AbstractAdapter $adapter */ $adapter = $result->getAdapter(); $pathPrefix = $adapter->getPathPrefix(); - $this->assertEquals('/tmp' . DIRECTORY_SEPARATOR, $pathPrefix); + $this->assertEquals(realpath('/tmp') . DIRECTORY_SEPARATOR, $pathPrefix); } /**
Ensure that the test works on both Mac and Linux
phpDocumentor_phpDocumentor2
train
php
46d5de6de7d8c1bcb6f5bdd98addaff5ecd2052d
diff --git a/jbxapi.py b/jbxapi.py index <HASH>..<HASH> 100644 --- a/jbxapi.py +++ b/jbxapi.py @@ -31,7 +31,7 @@ except ImportError: print("Please install the Python 'requests' package via pip", file=sys.stderr) sys.exit(1) -__version__ = "2.5.1" +__version__ = "2.5.2" # API URL. API_URL = "https://jbxcloud.joesecurity.org/api" @@ -370,9 +370,9 @@ class JoeSandbox(object): # urllib3 (via python-requests) and our server # https://github.com/requests/requests/issues/2117 # Internal Ticket #3090 - acceptable_chars = "0123456789" + "abcdefghijklmnopqrstuvwxyz" + \ - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + " _-.,()[]{}" - if "files" in kwargs and kwargs["files"] != None: + if "files" in kwargs and kwargs["files"] is not None: + acceptable_chars = "0123456789" + "abcdefghijklmnopqrstuvwxyz" + \ + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + " _-.,()[]{}" for param_name, fp in kwargs["files"].items(): filename = requests.utils.guess_filename(fp) or param_name
code improvement, use the identity instead of the equality
joesecurity_jbxapi
train
py
3c0277ef197191bddb651f014b8c93786cf464a1
diff --git a/helpers/update_helpers.py b/helpers/update_helpers.py index <HASH>..<HASH> 100644 --- a/helpers/update_helpers.py +++ b/helpers/update_helpers.py @@ -7,7 +7,7 @@ import re import codecs from functools import partial from collections import defaultdict -from cablemap.core import cables_from_directory +from cablemap.core import cables_from_source import logging import sys @@ -81,7 +81,7 @@ def run_update(in_dir, predicate=None): acronyms = set(_ACRONYMS) subjects = set() tags = defaultdict(list) - for cable in cables_from_directory(in_dir, predicate): + for cable in cables_from_source(in_dir, predicate): update_acronyms(cable, acronyms) update_missing_subjects(cable, subjects) update_tags(cable, tags)
Usage of ``cables_from_source``
heuer_cablemap
train
py
273eef2b3bb55d183938d4e1c5d1e4308b361c7b
diff --git a/documentation/samples/src/main/resources/assets/socket.js b/documentation/samples/src/main/resources/assets/socket.js index <HASH>..<HASH> 100644 --- a/documentation/samples/src/main/resources/assets/socket.js +++ b/documentation/samples/src/main/resources/assets/socket.js @@ -27,7 +27,10 @@ if (window.WebSocket) { // Compute the web socket url. // window.location.host includes the port - var url = "ws://" + window.location.host + "/ws/websocket"; + var url = "ws://" + window.location.host + "/ws/websocket"; + if (window.location.protocol == "https:") { + url = "wss://" + window.location.host + "/ws/websocket"; + } socket = new WebSocket(url); socket.onopen = onopen; socket.onmessage = onmessage;
Compute the right web socket url wss:// is used when the page is loaded with https://
wisdom-framework_wisdom
train
js
a742584481b34e6ddb96654b2345d68bff6e01ee
diff --git a/core.js b/core.js index <HASH>..<HASH> 100644 --- a/core.js +++ b/core.js @@ -890,9 +890,9 @@ class VRDisplay extends MRDisplay { frameData.copy(this._frameData); } } -class FakeDisplay extends MRDisplay { constructor(window, displayId) { super('FAKE', window, displayId); +class FakeVRDisplay extends MRDisplay { this.position = new THREE.Vector3(); this.quaternion = new THREE.Quaternion(); @@ -3382,7 +3382,7 @@ const _makeWindow = (options = {}, parent = null, top = null) => { return Promise.resolve(this.getVRDisplaysSync()); }, createVRDisplay() { - const display = new FakeDisplay(window, 2); + const display = new FakeVRDisplay(window, 2); fakeVrDisplays.push(display); return display; }, @@ -3578,7 +3578,7 @@ const _makeWindow = (options = {}, parent = null, top = null) => { window.VRStageParameters = VRStageParameters; window.VRDisplay = VRDisplay; window.MLDisplay = MLDisplay; - window.FakeDisplay = FakeDisplay; + window.FakeVRDisplay = FakeVRDisplay; // window.ARDisplay = ARDisplay; window.VRFrameData = VRFrameData; window.btoa = btoa;
Rename FakeDisplay to FakeVRDisplay
exokitxr_exokit
train
js
3ac7cf93de9a197069e7bb46a059c6020f26d692
diff --git a/src/Http/Controllers/UserController.php b/src/Http/Controllers/UserController.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/UserController.php +++ b/src/Http/Controllers/UserController.php @@ -24,7 +24,9 @@ class UserController extends BaseController */ public function index() { - return $this->appShellView('user.index'); + return $this->appShellView('user.index', [ + 'users' => UserProxy::all() + ]); } /** @@ -34,11 +36,9 @@ class UserController extends BaseController */ public function create() { - return $this->appShellView('user.create', - [ + return $this->appShellView('user.create', [ 'user' => app(User::class) - ] - ); + ]); } /**
Fixed user index action (no data was sent)
artkonekt_appshell
train
php
f99468dfc8a20505ee1a374a347c26012972ca01
diff --git a/raiden/tests/utils/__init__.py b/raiden/tests/utils/__init__.py index <HASH>..<HASH> 100644 --- a/raiden/tests/utils/__init__.py +++ b/raiden/tests/utils/__init__.py @@ -18,8 +18,8 @@ def wait_blocks(web3: Web3, blocks: int): def dicts_are_equal(a: dict, b: dict) -> bool: - """Compare dicts, but allows ignoring specific values through the - dicts_are_equal.IGNORE_VALUE identifier""" + """Compares dicts, but allows ignoring specific values through the + dicts_are_equal.IGNORE_VALUE object""" if set(a.keys()) != set(b.keys()): return False for k in a.keys():
Fix wording [skip ci]
raiden-network_raiden
train
py
35556bbba73722950508440fb64397fd12bf58f3
diff --git a/lib/laziness/api/channels.rb b/lib/laziness/api/channels.rb index <HASH>..<HASH> 100644 --- a/lib/laziness/api/channels.rb +++ b/lib/laziness/api/channels.rb @@ -1,9 +1,15 @@ module Slack module API class Channels < Base - def all(exclude_archived=false) - response = request :get, 'channels.list', exclude_archived: exclude_archived ? 1 : 0 - Slack::Channel.parse response, 'channels' + def all(exclude_archived=false, page: nil) + responses = with_paging(page) do |pager| + request :get, + 'channels.list', + exclude_archived: exclude_archived ? 1 : 0, + **pager.to_h + end + + Slack::Channel.parse_all responses, 'channels' end def archive(id)
Add paging to channels.list
brilliantfantastic_laziness
train
rb
03de3448a0705358ff664465da5513d7c46eadd5
diff --git a/eventbinder/src/main/java/com/google/web/bindery/event/shared/binder/impl/GenericEventType.java b/eventbinder/src/main/java/com/google/web/bindery/event/shared/binder/impl/GenericEventType.java index <HASH>..<HASH> 100644 --- a/eventbinder/src/main/java/com/google/web/bindery/event/shared/binder/impl/GenericEventType.java +++ b/eventbinder/src/main/java/com/google/web/bindery/event/shared/binder/impl/GenericEventType.java @@ -41,7 +41,7 @@ public class GenericEventType extends Type<GenericEventHandler> { * called directly by users. */ public static <T extends GenericEvent> GenericEventType getTypeOf(Class<T> clazz) { - if (!TYPE_MAP.containsKey(clazz)) { + if (TYPE_MAP.get(clazz)==null) { TYPE_MAP.put(clazz, new GenericEventType()); } return TYPE_MAP.get(clazz);
Improved the performance by switching from containKey to get method
google_gwteventbinder
train
java
00a756bf810f1142d0316822cedbe9669779129e
diff --git a/owncloud/owncloud.py b/owncloud/owncloud.py index <HASH>..<HASH> 100644 --- a/owncloud/owncloud.py +++ b/owncloud/owncloud.py @@ -881,7 +881,7 @@ class Client(): if res.status_code == 200: tree = ET.fromstring(res.text) - self.__check_ocs_status(tree, [100, 102]) + self.__check_ocs_status(tree, [100]) return True raise HTTPResponseError(res)
only accept OCS return code <I> in add_user_to_group <I> means here "group does not exist", we really should not return True in that case but raise and OCSResponseError
owncloud_pyocclient
train
py
362e8d97f1628529deddc24580ebfc0a65ca5b8c
diff --git a/lib/ecstatic.js b/lib/ecstatic.js index <HASH>..<HASH> 100755 --- a/lib/ecstatic.js +++ b/lib/ecstatic.js @@ -255,7 +255,7 @@ function shouldCompress(req) { // See: https://github.com/jesusabdullah/node-ecstatic/issues/109 function decodePathname(pathname) { - var pieces = pathname.split('/'); + var pieces = pathname.replace(/\\/g,"/").split('/'); return pieces.map(function (piece) { piece = decodeURIComponent(piece);
Fix path splitting to account for Windows paths
jfhbrook_node-ecstatic
train
js
76aab576a2e7531b93ce5473e8204c567d0a46b9
diff --git a/bang/config.py b/bang/config.py index <HASH>..<HASH> 100644 --- a/bang/config.py +++ b/bang/config.py @@ -14,6 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with bang. If not, see <http://www.gnu.org/licenses/>. +import collections import os import os.path import tempfile @@ -225,7 +226,11 @@ class Config(dict): for server in self.get(R.SERVERS, []): svars = {A.STACK: stack} for scope in server.get(A.server.SCOPES, []): - svars[scope] = self[scope] + # allow scopes to be defined inline + if isinstance(scope, collections.Mapping): + svars.update(scope) + else: + svars[scope] = self[scope] server[A.server.VARS] = svars def prepare(self):
Allow scopes to be defined inline. This allows playbooks to reference a single config scope name while allowing for server-specific values. Note that inline scopes trump scopes that are defined in the top-level config.
fr33jc_bang
train
py
303a78756886b1c71266b6914a3c1e7b79b6bfc8
diff --git a/library/Garp/Application/Resource/Router.php b/library/Garp/Application/Resource/Router.php index <HASH>..<HASH> 100644 --- a/library/Garp/Application/Resource/Router.php +++ b/library/Garp/Application/Resource/Router.php @@ -89,7 +89,8 @@ class Garp_Application_Resource_Router extends Zend_Application_Resource_Router $lang = $this->_getCurrentLanguage(); $territory = Garp_I18n::languageToTerritory($lang); - setlocale(LC_ALL, $territory); + $utf8_extension = PHP_OS === 'Linux' ? '.utf8' : '.UTF-8'; + setlocale(LC_ALL, $territory . $utf8_extension); if ( $this->_localeIsEnabled() &&
-n utf8 added to locale by platform
grrr-amsterdam_garp3
train
php
5d0a4e0cb6134b86fc2795047aacb335c978e02e
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -588,7 +588,7 @@ module ActiveRecord SQL else result = execute(<<-SQL, 'SCHEMA') - SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput + SELECT t.oid, t.typname, t.typelem, t.typdelim, t.typinput, t.typtype, t.typbasetype FROM pg_type as t SQL end @@ -630,10 +630,11 @@ module ActiveRecord # populate domain types domains.each do |row| - if base_type = type_map[row["typbasetype"].to_i] + base_type_oid = row["typbasetype"].to_i + if base_type = type_map[base_type_oid] type_map[row['oid'].to_i] = base_type else - warn "unknown base type (OID: #{row["typbasetype"].to_i}) for domain #{row["typname"]}." + warn "unknown base type (OID: #{base_type_oid}) for domain #{row["typname"]}." end end end
fix, adjust OID query without range support to include required fields. This is a follow-up fix to f7a6b<I>fea9f<I>a<I>b<I>c<I>f<I> and <I>f<I>d<I>e<I>bbac3bc<I>bace3f<I>
rails_rails
train
rb
9f30e46b3adb2362e01d0dcc76bbabca815545ce
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -197,6 +197,25 @@ describe('sourcemap-concat', function() { }); }); + it('inputFiles are sorted lexicographically (improve stability of build output)', function() { + var final = concat(firstFixture, { + outputFile: '/staged.js', + inputFiles: ['inner/second.js', 'inner/first.js'], + sourceMapConfig: { + enabled: false + } + }); + + builder = new broccoli.Builder(final); + return builder.build().then(function(result) { + var first = fs.readFileSync(path.join(firstFixture, 'inner/first.js'), 'UTF-8'); + var second = fs.readFileSync(path.join(firstFixture, 'inner/second.js'), 'UTF-8'); + + var expected = first + '\n' + second; + expect(file(result.directory + '/staged.js')).to.equal(expected); + }); + }); + it('dedupe uniques in inputFiles (with simpleconcat)', function() { var final = concat(firstFixture, { outputFile: '/staged.js',
Add test ensuring inputFiles are sorted lexicographically This improves stability of concat output. related: <URL>
broccolijs_broccoli-concat
train
js
38952eaba934df10117b0d0fc26390c30c244051
diff --git a/receive_test.go b/receive_test.go index <HASH>..<HASH> 100644 --- a/receive_test.go +++ b/receive_test.go @@ -62,6 +62,8 @@ func TestInvalidExcludePatterns(t *testing.T) { } func TestCopyWithSubDir(t *testing.T) { + requiresRoot(t) + d, err := tmpDir(changeStream([]string{ "ADD foo dir", "ADD foo/bar file data1", diff --git a/stat_test.go b/stat_test.go index <HASH>..<HASH> 100644 --- a/stat_test.go +++ b/stat_test.go @@ -10,6 +10,8 @@ import ( ) func TestStat(t *testing.T) { + requiresRoot(t) + d, err := tmpDir(changeStream([]string{ "ADD foo file data1", "ADD zzz dir",
- [*] skip tests that would fail in Debian-build
tonistiigi_fsutil
train
go,go
08ef53f65d5843c433e3697991254e48c801f53a
diff --git a/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java b/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java index <HASH>..<HASH> 100644 --- a/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java +++ b/drools-planner-core/src/main/java/org/drools/planner/config/solver/SolverConfig.java @@ -235,7 +235,7 @@ public class SolverConfig { RuleBaseConfiguration ruleBaseConfiguration = new RuleBaseConfiguration(); RuleBase ruleBase = RuleBaseFactory.newRuleBase(ruleBaseConfiguration); if (packageBuilder.hasErrors()) { - throw new IllegalStateException("There are errors in the scoreDrl's:" + throw new IllegalStateException("There are errors in the scoreDrl's:\n" + packageBuilder.getErrors().toString()); } ruleBase.addPackage(packageBuilder.getPackage());
make the first compilation error clearer (avoid misleading that the second error is the first)
kiegroup_optaplanner
train
java
994520858105e10157171c7b6a9344b8f76b2d86
diff --git a/benchmark/index.js b/benchmark/index.js index <HASH>..<HASH> 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -260,6 +260,25 @@ suite.on('complete', function() { console.table(headers, results) }) -suite.run({ - async: false +console.log('comma-number benchmark (' + process.pid + ')') + +const ask = require('readline').createInterface({ + input : process.stdin, + output: process.stdout +}) + +ask.question('Begin benchmark? (y/N) ', function(answer) { + + ask.close() + + if ((answer != null) && (answer[0] === 'y' || answer[0] === 'Y')) { + suite.run({ + async: false + }) + } + + else { + console.log('quitting') + } + })
tell PID and ask to begin so it can be set to high priority
elidoran_comma-number
train
js
74b2f471b27b609e94673ed9c842186b219c4585
diff --git a/escope.js b/escope.js index <HASH>..<HASH> 100644 --- a/escope.js +++ b/escope.js @@ -128,7 +128,8 @@ function defaultOptions() { return { optimistic: false, - directive: false + directive: false, + ecmaVersion: 5 }; }
Prepare for adding ecmaVersion 6
estools_escope
train
js
bce53f3e30896ae0edbc1517c23d880b9929c421
diff --git a/insights/specs/core3_archive.py b/insights/specs/core3_archive.py index <HASH>..<HASH> 100644 --- a/insights/specs/core3_archive.py +++ b/insights/specs/core3_archive.py @@ -14,3 +14,4 @@ simple_file = partial(simple_file, context=SerializedArchiveContext) class Core3Specs(Specs): branch_info = simple_file("/branch_info", kind=RawFileProvider) + display_name = simple_file("display_name")
fix(specs): add spec for display_name to core3_archive (#<I>) There are issues with display_name in core3 archives RHCLOUD-<I>
RedHatInsights_insights-core
train
py
bfb6b11539336aca873e654173ac8123a20b429e
diff --git a/Makefile b/Makefile index <HASH>..<HASH> 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: test test-mocha test: test-mocha - ./node_modules/.bin/mocha + JENKINS_HOME=true ./node_modules/.bin/mocha build: man diff --git a/test/config.js b/test/config.js index <HASH>..<HASH> 100644 --- a/test/config.js +++ b/test/config.js @@ -22,4 +22,4 @@ exports.strongops = { email: 'edmond@stdarg.com' }, getFileSync: getFileSyncFile, -}; \ No newline at end of file +}; diff --git a/test/strongops.js b/test/strongops.js index <HASH>..<HASH> 100644 --- a/test/strongops.js +++ b/test/strongops.js @@ -87,7 +87,7 @@ describe('getFileSync', function() { describe('getFileSync', function() { it('Should return the contents of a file when file is present.', function() { - console.log('getFileSync:', test.getFileSync); + //console.log('getFileSync:', test.getFileSync); assert.ok(is.nonEmptyStr(strops.test.getFileSync(test.getFileSync)) === true); }); });
Always set JENKINS_HOME to use test environment Without this, tests run against the current users actual environment, which is different for each user (though can be configured manually using test/config.js).
strongloop_strongloop
train
Makefile,js,js
b761dcde4504dd02fc8fd54cc499da91efa7a56e
diff --git a/src/app/directives/bodyClass.js b/src/app/directives/bodyClass.js index <HASH>..<HASH> 100644 --- a/src/app/directives/bodyClass.js +++ b/src/app/directives/bodyClass.js @@ -15,7 +15,7 @@ function (angular, app, _) { var lastPulldownVal; var lastHideControlsVal; - $scope.$watch('dashboard.pulldowns', function() { + $scope.$watchCollection('dashboard.pulldowns', function() { if (!$scope.dashboard) { return; } @@ -26,7 +26,7 @@ function (angular, app, _) { elem.toggleClass('submenu-controls-visible', panelEnabled); lastPulldownVal = panelEnabled; } - }, true); + }); $scope.$watch('dashboard.hideControls', function() { if (!$scope.dashboard) { @@ -49,4 +49,4 @@ function (angular, app, _) { }; }); -}); \ No newline at end of file +});
Switch from watch to watchCollection for bodyclass directive
grafana_grafana
train
js
a221c79bb5d7909278586a2c9d321dccba88f434
diff --git a/src/api.js b/src/api.js index <HASH>..<HASH> 100644 --- a/src/api.js +++ b/src/api.js @@ -16,7 +16,26 @@ function api(baseUrl, config, method, params) { const queryParams = Object.keys(params).map(generateQueryParam); url = `${url}?${queryParams.join('&')}`; } - return helper.fetch(url, options).then((res) => res.json()); + let response = null; + return helper.fetch(url, options).then((res) => { + response = res; + return res.json(); + }).catch((e) => { + if (e instanceof SyntaxError) { + // We probably got a non-JSON response from the server. + // We should inform the user of the same. + let message = 'Server Returned a non-JSON response.'; + if (response.status === 404) { + message += ` Maybe endpoint: ${method} ${response.url.replace(config.apiURL, '')} doesn't exist.`; + } else { + message += ' Please check the API documentation.'; + } + const error = new Error(message); + error.res = response; + throw error; + } + throw e; + }); } module.exports = api;
api: Gracefully handle HTML <I> pages returned by server. Previously, calling a non-existent endpoint would result in getting a JSON.parse SyntaxError, which isn't informative of the main cause of the error. This change allows zulip-js to tell the API user about probable causes for the server returning a non-JSON response.
zulip_zulip-js
train
js
93644ba1850186eabcfea6bdab47e3e3d223becf
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,10 @@ with open('README.rst') as readme_file: readme = readme_file.read() with open('requirements.txt') as req_file: - requires = req_file.read().split('\n') + requires = [req for req in req_file.read().split('\n') if req] with open('requirements-dev.txt') as req_file: - requires_dev = req_file.read().split('\n') + requires_dev = [req for req in req_file.read().split('\n') if req] with open('VERSION') as fp: version = fp.read().strip()
Remove empty string from requirements list When we moved to Python 3 we used this simpler method to read the requirements file. However we need to remove the empty/Falsey elements from the list. This fixes the error: ``` Failed building wheel for molo.yourwords ```
praekeltfoundation_molo.yourwords
train
py
75ccfe1c5543d072aef3f941e9612536b59b9001
diff --git a/src/components/lists/index.js b/src/components/lists/index.js index <HASH>..<HASH> 100755 --- a/src/components/lists/index.js +++ b/src/components/lists/index.js @@ -46,23 +46,25 @@ const List = { const ListTileAction = { name: 'list-tile-action', + data () { + return { + stack: false + } + }, + computed: { classes () { return { 'list__tile__action': true, 'list__tile__action--stack': this.stack } - }, - - stack () { - if (!this.$el) { - return false - } - - return this.$el.childElementCount > 1 } }, + mounted () { + this.stack = this.$el.childElementCount > 1 + }, + render (createElement) { let data = { 'class': this.classes
fixed bug where list tile actions may not apply stack class
vuetifyjs_vuetify
train
js
921d1dbf4ec1bae9f4d6d17aa7fa806f81e71a53
diff --git a/lib/gir_ffi/builders/argument_builder.rb b/lib/gir_ffi/builders/argument_builder.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/builders/argument_builder.rb +++ b/lib/gir_ffi/builders/argument_builder.rb @@ -1,6 +1,6 @@ require 'gir_ffi/builders/base_argument_builder' require 'gir_ffi/builders/closure_to_pointer_convertor' -require 'gir_ffi/builders/c_to_ruby_convertor' +require 'gir_ffi/builders/full_c_to_ruby_convertor' require 'gir_ffi/builders/ruby_to_c_convertor' require 'gir_ffi/builders/null_convertor' @@ -66,12 +66,7 @@ module GirFFI def output_value base = "#{call_argument_name}.to_value" if needs_out_conversion? - conversion = CToRubyConvertor.new(@type_info, base, length_argument_name).conversion - if @type_info.argument_class_name == 'GObject::Value' - "#{conversion}.get_value" - else - conversion - end + FullCToRubyConvertor.new(@type_info, base, length_argument_name).conversion elsif allocated_by_them? "GirFFI::InOutPointer.new(#{type_info.tag_or_class[1].inspect}, #{base}).to_value" else
Use FullCToRubyConvertor for both GValue conversions
mvz_gir_ffi
train
rb
2339a5abae98d199147deea92eb6301ca5be2ac2
diff --git a/tests/test_baselens.py b/tests/test_baselens.py index <HASH>..<HASH> 100644 --- a/tests/test_baselens.py +++ b/tests/test_baselens.py @@ -101,7 +101,7 @@ def test_DecodeLens_get_with_args(): def test_DecodeLens_set(): - assert b.DecodeLens('ascii', 'replace').set(b'', '\xe9') == b'?' + assert b.DecodeLens('ascii', 'replace').set(b'', u'\xe9') == b'?' def test_EachLens_get_all():
str in py3 is unicode in py2
ingolemo_python-lenses
train
py
7375e01cff045b7d0fa6361ed454fe2f17f6dc11
diff --git a/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/scm/api/AbstractMultiBranchCreateRequest.java b/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/scm/api/AbstractMultiBranchCreateRequest.java index <HASH>..<HASH> 100644 --- a/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/scm/api/AbstractMultiBranchCreateRequest.java +++ b/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/scm/api/AbstractMultiBranchCreateRequest.java @@ -74,7 +74,7 @@ public abstract class AbstractMultiBranchCreateRequest extends AbstractPipelineC validateInternal(getName(), scmConfig, organization); MultiBranchProject project = createMultiBranchProject(organization); assignCredentialToProject(scmConfig, project); - SCMSource source = createSource(project, scmConfig); + SCMSource source = createSource(project, scmConfig).withId("blueocean"); project.setSourcesList(ImmutableList.of(new BranchSource(source))); project.save(); final boolean hasJenkinsfile = repoHasJenkinsFile(source);
JENKINS-<I># Create MBP SCMSource with Id (#<I>)
jenkinsci_blueocean-plugin
train
java
39767ed7a27c185436a8b9e5d6dc306e090317f5
diff --git a/src/xopen/__init__.py b/src/xopen/__init__.py index <HASH>..<HASH> 100644 --- a/src/xopen/__init__.py +++ b/src/xopen/__init__.py @@ -295,8 +295,6 @@ class PipedCompressionReader(Closing): self._file: IO = io.TextIOWrapper(self.process.stdout) else: self._file = self.process.stdout - assert self.process.stderr is not None - self._stderr = io.TextIOWrapper(self.process.stderr) self.closed = False self._wait_for_output_or_process_exit() self._raise_if_error() @@ -375,6 +373,10 @@ class PipedCompressionReader(Closing): # terminated with another exit code, but message is allowed return + assert self.process.stderr is not None + if not stderr_message: + stderr_message = self.process.stderr.read() + self._file.close() raise OSError("{!r} (exit code {})".format(stderr_message, retcode))
Add error message if process exits early.
marcelm_xopen
train
py
aafbda28c52218f05fbd80c9b06901088f2ad3db
diff --git a/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb b/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb index <HASH>..<HASH> 100644 --- a/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb +++ b/rails_event_store_active_record/lib/rails_event_store_active_record/event_repository.rb @@ -16,7 +16,7 @@ module RailsEventStoreActiveRecord expected_version end in_stream = events.flat_map.with_index do |event, index| - position = if expected_version == :any + position = if expected_version.equal?(:any) nil else expected_version + index + 1
More strong check I am not sure if `equal` will always work, but I think it will as two identical symbols must be the same object, no matter how constructed.
RailsEventStore_rails_event_store
train
rb
9b236d37bb88555506ddaadcb03fe1e4b2d02306
diff --git a/src/QueryInterpreter/Type/UpdateInterpreter.php b/src/QueryInterpreter/Type/UpdateInterpreter.php index <HASH>..<HASH> 100644 --- a/src/QueryInterpreter/Type/UpdateInterpreter.php +++ b/src/QueryInterpreter/Type/UpdateInterpreter.php @@ -13,7 +13,7 @@ class UpdateInterpreter extends AbstractSqlQueryTypeInterpreter { public function supportedQueryType() { - TokenSequencerInterface::TYPE_UPDATE; + return TokenSequencerInterface::TYPE_UPDATE; } public function interpretQuery(TokenSequencerInterface $query)
Fix update interpreter to actually return the query type it supports - DUH!!!!!!
silktide_reposition-sql
train
php
49844d85033118285a1c625815b14681c26d9763
diff --git a/lib/github_cli.rb b/lib/github_cli.rb index <HASH>..<HASH> 100644 --- a/lib/github_cli.rb +++ b/lib/github_cli.rb @@ -12,7 +12,6 @@ require_relative 'github_cli/formatter' require_relative 'github_cli/terminal' require_relative 'github_cli/ui' require_relative 'github_cli/version' -require_relative 'github_cli/thor_ext' # Base module which adds Github API to the command line module GithubCLI diff --git a/lib/github_cli/vendor.rb b/lib/github_cli/vendor.rb index <HASH>..<HASH> 100644 --- a/lib/github_cli/vendor.rb +++ b/lib/github_cli/vendor.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - if defined?(Thor) GithubCLI.ui.warn "Thor has already been required. " end @@ -10,3 +8,5 @@ $:.unshift(vendor_dir) unless $:.include?(vendor_dir) require 'thor' require 'thor/group' require 'thor/actions' + +require_relative 'thor_ext'
Change to load thor extension after thro itself to fix dependency issue
piotrmurach_github_cli
train
rb,rb
a5d896f49e0fddff0bc25b14f56475b3480aa7dd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -85,8 +85,8 @@ function callPromise(fn, args) { function callback(err,other) { // check if the 'err' is boolean, if so then this is a 'exists' callback special case if (err && !(typeof err === 'boolean')) return reject(err); - // convert arguments to proper array - let args = Array.prototype.slice.call(arguments); + // convert arguments to proper array, ignoring error argument + let args = Array.prototype.slice.call(arguments, 1); // if arguments length is one or more resolve arguments as array, // otherwise resolve the argument as is. return resolve(args.length < 2 ? args[0] : args.slice(1));
Fix error argument not ignored in resolve call
hakovala_node-fse-promise
train
js
53b97621dccdef8f9f2e15e2f4f31045b46970e2
diff --git a/lib/Serverless.js b/lib/Serverless.js index <HASH>..<HASH> 100644 --- a/lib/Serverless.js +++ b/lib/Serverless.js @@ -445,7 +445,7 @@ class Serverless { // Only for internal use _logDeprecation(code, message) { - return logDeprecation(code, message, { serviceConfig: this.service }); + return logDeprecation(code, message, { serviceConfig: this.configurationInput }); } // To be used by external plugins
fix: Ensure early access to configuration in logDeprecation method
serverless_serverless
train
js
abc490a78e1dac28ad172c0756051224bc3c67b1
diff --git a/salt/states/git.py b/salt/states/git.py index <HASH>..<HASH> 100644 --- a/salt/states/git.py +++ b/salt/states/git.py @@ -289,7 +289,7 @@ def latest(name, depth Defines depth in history when git a clone is needed in order to ensure - latest. E.g. ``depth: 1`` is usefull when deploying from a repository + latest. E.g. ``depth: 1`` is useful when deploying from a repository with a long history. Use rev to specify branch. This is not compatible with tags or revision IDs.
Fix typo an usefull -> useful
saltstack_salt
train
py
683100cc1242182290423c94fe49243d938f220b
diff --git a/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java b/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java +++ b/src/main/java/org/jboss/wsf/spi/deployment/Endpoint.java @@ -30,6 +30,7 @@ import org.jboss.ws.api.monitoring.RecordProcessor; import org.jboss.wsf.spi.invocation.InvocationHandler; import org.jboss.wsf.spi.invocation.RequestHandler; import org.jboss.wsf.spi.management.EndpointMetrics; +import org.jboss.wsf.spi.metadata.config.EndpointConfig; import org.jboss.wsf.spi.security.SecurityDomainContext; /** @@ -137,4 +138,9 @@ public interface Endpoint extends Extensible /** Set instance provider */ void setInstanceProvider(InstanceProvider provider); + /** Get endpoint config */ + EndpointConfig getEndpointConfig(); + + /** Set endpoint config */ + void setEndpointConfig(EndpointConfig config); }
[JBWS-<I>] Adding EndpointConfig into Endpoint
jbossws_jbossws-spi
train
java
3b737114b24482e4ab8f2cd9ea924551a4a2447e
diff --git a/concrete/views/image-editor/editor.php b/concrete/views/image-editor/editor.php index <HASH>..<HASH> 100644 --- a/concrete/views/image-editor/editor.php +++ b/concrete/views/image-editor/editor.php @@ -87,7 +87,7 @@ $controls = $editor->getControlList() </div> <?php -if (!$settings) { +if (empty($settings)) { $settings = array(); } $fnames = array();
Avoid accessing undefined var in image-editor/editor
concrete5_concrete5
train
php
6b55211c038cd10411b50ac4adc246884b5c2673
diff --git a/lib/fluent/config/section.rb b/lib/fluent/config/section.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/config/section.rb +++ b/lib/fluent/config/section.rb @@ -68,7 +68,7 @@ module Fluent def respond_to?(symbol, include_all=false) case symbol - when :inspect, :nil?, :to_h, :+, :instance_of?, :kind_of?, :[], :respond_to?, :respond_to_missing?, :method_missing, + when :inspect, :nil?, :to_h, :+, :instance_of?, :kind_of?, :[], :respond_to?, :respond_to_missing? true when :!, :!= , :==, :equal?, :instance_eval, :instance_exec true
Remove duplicate `method_missing?` and trailing comma
fluent_fluentd
train
rb
bd72134200579ba87395843f348cd1a827a69af6
diff --git a/galpy/potential_src/interpRZPotential.py b/galpy/potential_src/interpRZPotential.py index <HASH>..<HASH> 100644 --- a/galpy/potential_src/interpRZPotential.py +++ b/galpy/potential_src/interpRZPotential.py @@ -81,8 +81,6 @@ class interpRZPotential(Potential): self._interpepifreq= interpepifreq self._interpverticalfreq= interpverticalfreq self._enable_c= enable_c*ext_loaded - if enable_c and rgrid[2] != zgrid[2]: - raise NotImplementedError("Unequal R and z grid sizes not implemented with enable_c") self._zsym= zsym if interpPot: if use_c*ext_loaded: @@ -578,7 +576,7 @@ def eval_potential_c(pot,R,z): pot_args, out, ctypes.byref(err)) - + #Reset input arrays if f_cont[0]: R= numpy.asfortranarray(R) if f_cont[1]: z= numpy.asfortranarray(z)
remove Error for unequal grid sizes
jobovy_galpy
train
py
f65bd6f633a6630c4f397b98a866016039c9fd77
diff --git a/lib/webgroup_regression_tests.py b/lib/webgroup_regression_tests.py index <HASH>..<HASH> 100644 --- a/lib/webgroup_regression_tests.py +++ b/lib/webgroup_regression_tests.py @@ -19,6 +19,8 @@ ## along with CDS Invenio; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +# pylint: disable-msg=E1102 + """Unit tests for the user handling library.""" __revision__ = "$Id$"
Disable false positive E<I> pylint warnings due to the use of mechanize.Browser().
inveniosoftware-contrib_invenio-groups
train
py
cf966743acd2ce87998c2bfdbb462ef5db588e08
diff --git a/fctx-compiler.js b/fctx-compiler.js index <HASH>..<HASH> 100755 --- a/fctx-compiler.js +++ b/fctx-compiler.js @@ -175,10 +175,9 @@ function packFont(font) { /* Pack the glyph table. */ packedGlyphTable = new Buffer(6 * glyphCount); glyphTable.reduce(function (offset, glyph, index) { - var horizAdvX = Math.floor(glyph.horizAdvX * metadata.emScale * 16 + 0.5); packedGlyphTable.writeUIntLE(glyph.pathDataOffset, offset + 0, 2); packedGlyphTable.writeUIntLE(glyph.pathData.length, offset + 2, 2); - packedGlyphTable.writeUIntLE(horizAdvX, offset + 4, 2); + packedGlyphTable.writeUIntLE(glyph.horizAdvX, offset + 4, 2); return offset + 6; }, 0);
Removed extra scale factor being applied to horizontal advance.
jrmobley_pebble-fctx-compiler
train
js
072e46d6cafc26d3c39eb7c965bf37bddb914039
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php index <HASH>..<HASH> 100644 --- a/core/SettingsPiwik.php +++ b/core/SettingsPiwik.php @@ -198,7 +198,7 @@ class SettingsPiwik // if URL changes, always update the cache || $currentUrl != $url ) { - $host = Url::getHostFromUrl($url); + $host = Url::getHostFromUrl($currentUrl); if (strlen($currentUrl) >= strlen('http://a/') && !Url::isLocalHost($host)) {
Improve detection of piwik/matomo URL (#<I>) refs a couple of issues I think. Eg <URL>. If it checked whether the actual host is a local host, it would have updated it.
matomo-org_matomo
train
php
995f47ffc363de892295f11b711b0829c4262690
diff --git a/lib/html_mockup/rack/html_mockup.rb b/lib/html_mockup/rack/html_mockup.rb index <HASH>..<HASH> 100644 --- a/lib/html_mockup/rack/html_mockup.rb +++ b/lib/html_mockup/rack/html_mockup.rb @@ -31,12 +31,21 @@ module HtmlMockup if template_path = search_files.find{|p| File.exist?(p)} env["rack.errors"].puts "Rendering template #{template_path.inspect} (#{path.inspect})" - templ = ::HtmlMockup::Template.open(template_path, :partial_path => @partial_path) - resp = ::Rack::Response.new do |res| - res.status = 200 - res.write templ.render + begin + templ = ::HtmlMockup::Template.open(template_path, :partial_path => @partial_path) + resp = ::Rack::Response.new do |res| + res.status = 200 + res.write templ.render + end + resp.finish + rescue StandardError => e + env["rack.errors"].puts " #{e.message}" + resp = ::Rack::Response.new do |res| + res.status = 500 + res.write "An error occurred" + end + resp.finish end - resp.finish else env["rack.errors"].puts "Invoking file handler for #{path.inspect}" @file_server.call(env)
Log exceptions and render "An error has occured" with status <I>.
DigitPaint_roger
train
rb
3f89a18cfe092eb22612eae6c76d032cfd5bb717
diff --git a/Auth/OpenID/Server.php b/Auth/OpenID/Server.php index <HASH>..<HASH> 100644 --- a/Auth/OpenID/Server.php +++ b/Auth/OpenID/Server.php @@ -182,8 +182,8 @@ class Auth_OpenID_ServerError { } return Auth_OpenID::appendArgs($return_to, - array('openid.mode' => 'error', - 'error' => $this->toString())); + array('openid.mode' => 'error', + 'openid.error' => $this->toString())); } /** diff --git a/Tests/Auth/OpenID/Server.php b/Tests/Auth/OpenID/Server.php index <HASH>..<HASH> 100644 --- a/Tests/Auth/OpenID/Server.php +++ b/Tests/Auth/OpenID/Server.php @@ -46,7 +46,7 @@ class Tests_Auth_OpenID_Test_ServerError extends PHPUnit_TestCase { $this->assertTrue($e->hasReturnTo()); $expected_args = array( 'openid.mode' => 'error', - 'error' => 'plucky'); + 'openid.error' => 'plucky'); $encoded = $e->encodeToURL(); if (_isError($encoded)) {
[project @ BUGFIX: Fixed error reporting in server request encoding]
openid_php-openid
train
php,php
c990fe9d459f050b7aa5eb420d1eae53863955f9
diff --git a/addr.go b/addr.go index <HASH>..<HASH> 100644 --- a/addr.go +++ b/addr.go @@ -44,6 +44,18 @@ func init() { SupportedTransportProtocols = transports } +// AddTransport adds a transport protocol combination to the list of supported transports +func AddTransport(s string) error { + t, err := ma.ProtocolsWithString(s) + if err != nil { + return err + } + + SupportedTransportStrings = append(SupportedTransportStrings, s) + SupportedTransportProtocols = append(SupportedTransportProtocols, t) + return nil +} + // FilterAddrs is a filter that removes certain addresses, according the given filters. // if all filters return true, the address is kept. func FilterAddrs(a []ma.Multiaddr, filters ...func(ma.Multiaddr) bool) []ma.Multiaddr {
AddTransport: dynamically extend supported transport protocols Necessary to implement a Transport in go-libp2p-circuit.
libp2p_go-addr-util
train
go