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
bc51f9225cb138b009128c6f84950f9434b7ebe8
diff --git a/generate.go b/generate.go index <HASH>..<HASH> 100644 --- a/generate.go +++ b/generate.go @@ -6,4 +6,5 @@ //go:generate praxisgen -metadata=ss/ssd/restful_doc -output=ss/ssd -pkg=ssd -target=1.0 -client=Api //go:generate praxisgen -metadata=ss/ssc/restful_doc -output=ss/ssc -pkg=ssc -target=1.0 -client=Api //go:generate praxisgen -metadata=ss/ssm/restful_doc -output=ss/ssm -pkg=ssm -target=1.0 -client=Api + package main
Cleanup godoc output Prevent godoc from using the "go generate" commands as package documentation.
rightscale_rsc
train
go
40e0a86315f18283a625883e6d0e29e8b125afec
diff --git a/pkg/fileembed/genfileembed/genfileembed.go b/pkg/fileembed/genfileembed/genfileembed.go index <HASH>..<HASH> 100644 --- a/pkg/fileembed/genfileembed/genfileembed.go +++ b/pkg/fileembed/genfileembed/genfileembed.go @@ -169,6 +169,7 @@ func main() { func writeFileIfDifferent(filename string, contents []byte) error { fi, err := os.Stat(filename) if err == nil && fi.Size() == int64(len(contents)) && contentsEqual(filename, contents) { + os.Chtimes(filename, time.Now(), time.Now()) return nil } return ioutil.WriteFile(filename, contents, 0644)
genfileembed: touch the file modtime, even if contents are same, but it's old Change-Id: I<I>d<I>da6e<I>e4aebc0e<I>e4ca8f0dd<I>
perkeep_perkeep
train
go
6adedacaf8c7bdcb3bef5f3a6c3dce1329246a3e
diff --git a/src/ol/interaction/dragpaninteraction.js b/src/ol/interaction/dragpaninteraction.js index <HASH>..<HASH> 100644 --- a/src/ol/interaction/dragpaninteraction.js +++ b/src/ol/interaction/dragpaninteraction.js @@ -106,7 +106,7 @@ ol.interaction.DragPan.prototype.handleDragEnd = function(mapBrowserEvent) { */ ol.interaction.DragPan.prototype.handleDragStart = function(mapBrowserEvent) { var browserEvent = mapBrowserEvent.browserEvent; - if (this.condition_(browserEvent)) { + if (browserEvent.isMouseActionButton() && this.condition_(browserEvent)) { if (this.kinetic_) { this.kinetic_.begin(); this.kinetic_.update(browserEvent.clientX, browserEvent.clientY);
Only pan the map when the mouse action button is pressed
openlayers_openlayers
train
js
ec0fa777a7171dbcaf98735c0a93cde4ab5f04f4
diff --git a/lib/invitation/version.rb b/lib/invitation/version.rb index <HASH>..<HASH> 100644 --- a/lib/invitation/version.rb +++ b/lib/invitation/version.rb @@ -1,3 +1,3 @@ module Invitation - VERSION = '0.4.2'.freeze + VERSION = '0.4.3'.freeze end
bumped version to <I>, prep for release
tomichj_invitation
train
rb
435481a3effd283b1c1597ef7e8c07cf83485be8
diff --git a/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystem14Parser.java b/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystem14Parser.java index <HASH>..<HASH> 100644 --- a/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystem14Parser.java +++ b/transactions/src/main/java/org/jboss/as/txn/subsystem/TransactionSubsystem14Parser.java @@ -218,7 +218,7 @@ class TransactionSubsystem14Parser implements XMLStreamConstants, XMLElementRead break; case PATH: TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.parseAndSetParameter(value, operation, reader); - if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue())) { + if (!value.equals(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH.getDefaultValue().asString())) { needsDefaultRelativeTo = false; } break;
[WFLY-<I>] Update to fix the incompatible types for equality
wildfly_wildfly
train
java
57d770417e7aa9cc98e420081c85820a3e2f653c
diff --git a/lib/route_translator/route_set/translator.rb b/lib/route_translator/route_set/translator.rb index <HASH>..<HASH> 100644 --- a/lib/route_translator/route_set/translator.rb +++ b/lib/route_translator/route_set/translator.rb @@ -94,7 +94,11 @@ module RouteTranslator new_name = "#{route.name}_#{locale_suffix(locale)}" if route.name - [route.app, conditions, requirements, defaults, new_name] + if route.path.respond_to?(:anchored) + [route.app, conditions, requirements, defaults, new_name, route.path.anchored] + else + [route.app, conditions, requirements, defaults, new_name] + end end def untranslated_route route @@ -106,7 +110,11 @@ module RouteTranslator conditions[:request_method] = request_method_array(conditions[:request_method]) if conditions[:request_method] - [route.app, conditions, route.requirements.dup, route.defaults.dup, route.name] + if route.path.respond_to?(:anchored) + [route.app, conditions, route.requirements.dup, route.defaults.dup, route.name, route.path.anchored] + else + [route.app, conditions, route.requirements.dup, route.defaults.dup, route.name] + end end #In Rails 3.0 the request_method used to construct the route needs to be a Regexp
Fixes mounted apps not working, only on rails<I>
enriclluelles_route_translator
train
rb
09728d292edf17f9485b6632dbcb49fd631f8acd
diff --git a/extensions/apidoc/templates/bootstrap/layouts/main.php b/extensions/apidoc/templates/bootstrap/layouts/main.php index <HASH>..<HASH> 100644 --- a/extensions/apidoc/templates/bootstrap/layouts/main.php +++ b/extensions/apidoc/templates/bootstrap/layouts/main.php @@ -80,7 +80,16 @@ $this->beginPage(); </div> </div> <?php - $this->registerJsFile('./jssearch.index.js', 'yii\apidoc\templates\bootstrap\assets\JsSearchAsset'); + \yii\apidoc\templates\bootstrap\assets\JsSearchAsset::register($this); + + // defer loading of the search index: https://developers.google.com/speed/docs/best-practices/payload?csw=1#DeferLoadingJS + $this->registerJs(<<<JS +var element = document.createElement("script"); +element.src = "./jssearch.index.js"; +document.body.appendChild(element); +JS +); + $this->registerJs(<<<JS var searchBox = $('#searchbox');
defer loading of search index in api doc fixes #<I>
yiisoft_yii-core
train
php
4b2b14fccff3fc5329bb1deda6c722abfedf6f64
diff --git a/frasco_models/backends/sqlalchemy.py b/frasco_models/backends/sqlalchemy.py index <HASH>..<HASH> 100644 --- a/frasco_models/backends/sqlalchemy.py +++ b/frasco_models/backends/sqlalchemy.py @@ -64,6 +64,16 @@ class SqlalchemyBackend(Backend): app.cli.command('drop_db')(self.db.drop_all) + if app.features.exists('tasks'): + from celery.signals import task_postrun + def handle_celery_postrun(retval=None, *args, **kwargs): + if app.config.get('SQLALCHEMY_COMMIT_ON_TEARDOWN'): + if not isinstance(retval, Exception): + self.db.session.commit() + if not app.config.get('CELERY_ALWAYS_EAGER'): + self.db.session.remove() + task_postrun.connect(handle_celery_postrun, weak=False) + def ensure_model(self, name): if isinstance(name, self.db.Model): return name
added closing session after a celery task run (if frasco_tasks in use) in sqlalchemy backend
frascoweb_frasco-models
train
py
8517e5e30535393ac073bb41c50f66939f21a2fd
diff --git a/lib/statistrano/deployment.rb b/lib/statistrano/deployment.rb index <HASH>..<HASH> 100644 --- a/lib/statistrano/deployment.rb +++ b/lib/statistrano/deployment.rb @@ -19,7 +19,6 @@ module Statistrano def initialize name @name = name @config = Config.new - yield(@config) if block_given? end end diff --git a/spec/statistrano/deployment_spec.rb b/spec/statistrano/deployment_spec.rb index <HASH>..<HASH> 100644 --- a/spec/statistrano/deployment_spec.rb +++ b/spec/statistrano/deployment_spec.rb @@ -9,12 +9,11 @@ describe Statistrano::Deployment::Base do deployment.name.should == "name" end - it "creates a configuration if a block is given" do - deployment = Statistrano::Deployment::Base.new("name") do |config| - config.remote_dir = "hello" - config.local_dir = "world" - config.remote = "foo" - end + it "configuration is configurable" do + deployment = Statistrano::Deployment::Base.new("name") + deployment.config.remote_dir = "hello" + deployment.config.local_dir = "world" + deployment.config.remote = "foo" deployment.config.remote_dir.should == "hello" deployment.config.local_dir.should == "world"
a deployment class doesn't need to concern itself with the syntax of configuration
mailchimp_statistrano
train
rb,rb
44b10aed822c0e6ccfba967849ea989918bbd6d3
diff --git a/src/components/simplecheckbox/simplecheckbox.js b/src/components/simplecheckbox/simplecheckbox.js index <HASH>..<HASH> 100644 --- a/src/components/simplecheckbox/simplecheckbox.js +++ b/src/components/simplecheckbox/simplecheckbox.js @@ -56,8 +56,12 @@ export default Component.extend({ updateView() { this.translator = this.model.locale.getTFunction(); - this.labelEl.text(this.translator("check/" + this.checkbox)); - this.checkEl.property("checked", !!this.parentModel[this.checkbox]); + const modelExists = this.parentModel && (this.parentModel[this.checkbox] || this.parentModel[this.checkbox] === false); + this.labelEl.classed("vzb-hidden", !modelExists); + if (modelExists) { + this.labelEl.text(this.translator("check/" + this.checkbox)); + this.checkEl.property("checked", !!this.parentModel[this.checkbox]); + } }, _setModel(value) {
Add checkbox protection against a missing model
vizabi_vizabi
train
js
85b50864833c99308167313a77c238b9f158f748
diff --git a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampTradeHistoryParams.java b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampTradeHistoryParams.java index <HASH>..<HASH> 100644 --- a/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampTradeHistoryParams.java +++ b/xchange-bitstamp/src/main/java/org/knowm/xchange/bitstamp/service/BitstampTradeHistoryParams.java @@ -122,5 +122,7 @@ public class BitstampTradeHistoryParams } @Override - public void setEndId(String endId) {} + public void setEndId(String endId) { + throw new UnsupportedOperationException("Bitstamp doesn't support end id."); + } }
Extended trade history with sinceId param.
knowm_XChange
train
java
0bd928945f94b860c3d3be83c192479892ca083d
diff --git a/lib/discordrb/api.rb b/lib/discordrb/api.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/api.rb +++ b/lib/discordrb/api.rb @@ -100,6 +100,9 @@ module Discordrb::API sync_wait(delta, mutex) end rescue RestClient::TooManyRequests => e + # If the 429 is from the global RL, then we have to use the global mutex instead. + mutex = @global_mutex if e.response.headers[:x_ratelimit_global] == 'true' + unless mutex.locked? response = JSON.parse(e.response) wait_seconds = response['retry_after'].to_i / 1000.0
Implement global ratelimiting It works identically to the regular <I> handling, except that the global mutex is used instead of the method one.
meew0_discordrb
train
rb
80580aa6e3fc7e0db869235d22e734db83ceb514
diff --git a/src/main/kernels.js b/src/main/kernels.js index <HASH>..<HASH> 100644 --- a/src/main/kernels.js +++ b/src/main/kernels.js @@ -25,9 +25,6 @@ export function condaInfoObservable() { .map(info => JSON.parse(info)); } -// var condak = require('./src/notebook/epics/conda-kernel-provider-epic'); -// var envy = condak.condaEnvsObservable(condak.condaInfoObservable()); - export function condaEnvsObservable(condaInfo$) { return condaInfo$.map(info => { const envs = info.envs.map(env => ({ name: path.basename(env), prefix: env }));
chore(rm): clean up misc. commented out code
nteract_nteract
train
js
e390381402503e641dcd4bafa705de32c68f2e35
diff --git a/test/test_meters.py b/test/test_meters.py index <HASH>..<HASH> 100644 --- a/test/test_meters.py +++ b/test/test_meters.py @@ -76,6 +76,17 @@ class TestMeters(unittest.TestCase): err = mtr.value() self.assertEqual(err, [50.0], "Half should be correct") + def testClassErrorMeteri_batch1(self): + mtr = meter.ClassErrorMeter(topk=[1]) + output = torch.tensor([1, 0, 0]) + if hasattr(torch, "arange"): + target = torch.arange(0, 1) + else: + target = torch.range(0, 0) + mtr.add(output, target) + err = mtr.value() + self.assertEqual(err, [0], "All should be correct") + def testConfusionMeter(self): mtr = meter.ConfusionMeter(k=3)
ClassErrorMeter has issue with batchsize=1 (#<I>) * Proposed fix of ClassErrorMeter to avoid issue with batchsize=1. The use of squeeze is problematic. A new test was added to illustrate this in test_meters.py
pytorch_tnt
train
py
fb06cc4aeffc08630c32a5af7e79dcdc4d19729b
diff --git a/src/index.esm.js b/src/index.esm.js index <HASH>..<HASH> 100644 --- a/src/index.esm.js +++ b/src/index.esm.js @@ -14,6 +14,7 @@ export default { export { Store, + install, mapState, mapMutations, mapGetters,
refactor: export `install` as named export for tree shaking (#<I>)
vuejs_vuex
train
js
ee212acd3045ef37c4110ce07afc7642ab9f472e
diff --git a/lib/aasm/core/event.rb b/lib/aasm/core/event.rb index <HASH>..<HASH> 100644 --- a/lib/aasm/core/event.rb +++ b/lib/aasm/core/event.rb @@ -131,13 +131,13 @@ module AASM::Core if to_state == ::AASM::NO_VALUE to_state = nil - elsif to_state.respond_to?(:to_sym) && transitions.map(&:to).flatten.include?(to_state.to_sym) - # nop, to_state is a valid to-state - else + elsif !(to_state.respond_to?(:to_sym) && transitions.map(&:to).flatten.include?(to_state.to_sym)) # to_state is an argument args.unshift(to_state) to_state = nil end + + # nop, to_state is a valid to-state transitions.each do |transition| next if to_state and !Array(transition.to).include?(to_state)
Fix: _fire method is too long issue
aasm_aasm
train
rb
c989c50a26fbb88671fa56276455f3e252fb81ef
diff --git a/src/AbstractNestingElement.php b/src/AbstractNestingElement.php index <HASH>..<HASH> 100644 --- a/src/AbstractNestingElement.php +++ b/src/AbstractNestingElement.php @@ -88,7 +88,7 @@ abstract class AbstractNestingElement extends AbstractElement { } /** - * @param $index + * @param integer $index * @return AbstractElement|null */ public function childAtIndex( $index ) {
Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on <URL>
donatj_mddom
train
php
e7099faf4de76c85fb15f6899d2c785b6e555b6e
diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index <HASH>..<HASH> 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -44,6 +44,7 @@ class PostsControllerTest < ActionController::TestCase end should_respond_with :success should_assign_to :user, :class => User + should_render_template :index should_assign_to(:user) { users(:first) } should_fail do should_assign_to :user, :class => Post
Added a functional test for should_render_template [#<I> state:resolved]
thoughtbot_shoulda-matchers
train
rb
936fa31d7c755d7c1acc5f11181b1f41ea9369b3
diff --git a/lib/hay/task.rb b/lib/hay/task.rb index <HASH>..<HASH> 100644 --- a/lib/hay/task.rb +++ b/lib/hay/task.rb @@ -27,6 +27,14 @@ module Hay self.class.task_name end + def process(dispatcher) + raise NotImplementedError + end + + def dehydrate + raise NotImplementedError + end + def to_hay Hay::Task::Decorator.new(self) end
Adding a couple of method breadcrumbs, for things includers need to implement.
azanar_hay
train
rb
fc4af8e45474e63c0dc5c2701a1a7f3b48fd1764
diff --git a/envs/dev/views/layouts/main.php b/envs/dev/views/layouts/main.php index <HASH>..<HASH> 100644 --- a/envs/dev/views/layouts/main.php +++ b/envs/dev/views/layouts/main.php @@ -1,3 +1,4 @@ +<? $this->beginPage(); ?> <html> <head> <title>Luya &mdash; <?= $this->title; ?></title>
added beginPage function to main template
luyadev_luya
train
php
fa8da0a6b08c261f2226cb99302a9196708d149f
diff --git a/tests/metamorphosis/morph.to.html.preprocessor.spec.js b/tests/metamorphosis/morph.to.html.preprocessor.spec.js index <HASH>..<HASH> 100644 --- a/tests/metamorphosis/morph.to.html.preprocessor.spec.js +++ b/tests/metamorphosis/morph.to.html.preprocessor.spec.js @@ -4,7 +4,7 @@ describe("Metamorphosis (to html preprocessor)", function() { api.morph("html"); - it("should accept and compile html", function(done) { + xit("should accept and compile html", function(done) { api.add({ _raw:'<!DOCTYPE html>', html: {
Metamorphosis test skipping
krasimir_absurd
train
js
f81297a0517c8be9c1faf0960ba3efd40b9cb7d7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -121,7 +121,7 @@ setup( zip_safe=False, install_requires=[ "django-picklefield", - "celery>=2.1.0", + "celery", ], cmdclass = {"test": RunTests, "quicktest": QuickRunTests}, classifiers=[
setup.py: can't use version match celery>=<I> yet...
celery_django-celery
train
py
1c93a0b48b465f30f630fa6cb7490d0242db599b
diff --git a/crispy_forms/layout.py b/crispy_forms/layout.py index <HASH>..<HASH> 100644 --- a/crispy_forms/layout.py +++ b/crispy_forms/layout.py @@ -111,7 +111,7 @@ class Submit(BaseInput): .. note:: The first argument is also slugified and turned into the id for the submit button. """ input_type = 'submit' - field_classes = 'submit submitButton' + field_classes = 'submit submitButton' if TEMPLATE_PACK == 'uni_form' else 'btn' class Button(BaseInput):
Submit layout object, has different classes depending on the template pack
django-crispy-forms_django-crispy-forms
train
py
ce138700e6136f7d5dddd3836d95e3f4944fddc1
diff --git a/remote.go b/remote.go index <HASH>..<HASH> 100644 --- a/remote.go +++ b/remote.go @@ -5,7 +5,6 @@ import ( "io" "net/http" "net/url" - "os" "regexp" "strings" ) @@ -236,7 +235,7 @@ func deduceRemoteRepo(path string) (rr *remoteRepo, err error) { // We have a real URL. Set the other values and return. rr.Base = importroot - rr.RelPkg = strings.TrimPrefix(path[len(importroot):], string(os.PathSeparator)) + rr.RelPkg = strings.TrimPrefix(path[len(importroot):], "/") rr.VCS = []string{vcs} if rr.CloneURL.Scheme != "" {
See where trying to be Windows-friendly gets you
sdboyer_gps
train
go
243ea2fe401c85aef7401b139d5462c77cb2a536
diff --git a/python/dllib/src/bigdl/dllib/utils/nest.py b/python/dllib/src/bigdl/dllib/utils/nest.py index <HASH>..<HASH> 100644 --- a/python/dllib/src/bigdl/dllib/utils/nest.py +++ b/python/dllib/src/bigdl/dllib/utils/nest.py @@ -21,7 +21,11 @@ def flatten(seq): return seq if isinstance(seq, tuple): - return flatten(seq[0]) + flatten(seq[1]) + seq = list(seq) + results = [] + for item in seq: + results.extend(flatten(item)) + return results if isinstance(seq, dict): sorted_keys = sorted(seq.keys())
Add TFPark Estimator API (#<I>) * add estimator training * add evaluate * add predict and evaluate * address comments * change to metrics to string type * add unit test * fix style
intel-analytics_BigDL
train
py
fb4ed9a39b1a43def6b9f3d31dd19ce5ef928ff2
diff --git a/results_test.go b/results_test.go index <HASH>..<HASH> 100644 --- a/results_test.go +++ b/results_test.go @@ -142,4 +142,8 @@ func (s *RethinkSuite) TestEmptyResults(c *test.C) { c.Assert(err, test.IsNil) rows.Next() c.Assert(rows.IsNil(), test.Equals, true) + + rows, err = Db("test").Table("test").GetAll("missing value", "another missing value").Run(sess) + c.Assert(err, test.IsNil) + c.Assert(rows.Next(), test.Equals, false) }
Add test on GetAll with missing keys
rethinkdb_rethinkdb-go
train
go
109da440ede552b60fb65a1ca8a7e88028ae12a0
diff --git a/src/main/java/net/malisis/core/MalisisCore.java b/src/main/java/net/malisis/core/MalisisCore.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/malisis/core/MalisisCore.java +++ b/src/main/java/net/malisis/core/MalisisCore.java @@ -69,10 +69,9 @@ import com.google.common.collect.Ordering; /** * The Class MalisisCore. */ -@Mod(modid = MalisisCore.modid, name = MalisisCore.modname, version = MalisisCore.version) +@Mod(modid = MalisisCore.modid, name = MalisisCore.modname, version = MalisisCore.version, acceptedMinecraftVersions = "[1.9.4,1.10.2]") public class MalisisCore implements IMalisisMod { - public static final int malisisRenderType = 4; /** Mod ID. */ public static final String modid = "malisiscore"; /** Mod name. */
Removed unused field Added acceptableMinecraftVersion for <I>
Ordinastie_MalisisCore
train
java
395e8c22a82d5d3d02ac022232ff5e33e113de69
diff --git a/lib/manioc/railtie.rb b/lib/manioc/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/manioc/railtie.rb +++ b/lib/manioc/railtie.rb @@ -20,11 +20,23 @@ module Manioc _app.config.container = Manioc::Container.new end + reset = ->{ _app.config.container.reset! } + config.to_prepare do if _app.config.eager_load _app.config.container.preload! else - _app.config.container.reset! + reset.call + end + end + + if ActiveSupport.const_defined?(:Reloader) && ActiveSupport::Reloader.respond_to?(:to_complete) + ActiveSupport::Reloader.to_complete do + reset.call + end + elsif ActionDispatch.const_defined?(:Reloader) && ActionDispatch::Reloader.respond_to?(:to_cleanup) + ActionDispatch::Reloader.to_cleanup do + reset.call end end end diff --git a/lib/manioc/version.rb b/lib/manioc/version.rb index <HASH>..<HASH> 100644 --- a/lib/manioc/version.rb +++ b/lib/manioc/version.rb @@ -1,3 +1,3 @@ module Manioc - VERSION = '0.1.4' + VERSION = '0.1.5'.freeze end
Add ActiveSupport::Reloader support `reload!` should now reset the container in a Rails console
jamesdabbs_manioc
train
rb,rb
9f2109d3310ca6d8ee7777f40296eb9ad1348a56
diff --git a/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample/src/test/java/org/kie/server/springboot/samples/KafkaProducerHappyPathTest.java b/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample/src/test/java/org/kie/server/springboot/samples/KafkaProducerHappyPathTest.java index <HASH>..<HASH> 100644 --- a/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample/src/test/java/org/kie/server/springboot/samples/KafkaProducerHappyPathTest.java +++ b/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample/src/test/java/org/kie/server/springboot/samples/KafkaProducerHappyPathTest.java @@ -144,6 +144,9 @@ public class KafkaProducerHappyPathTest extends KafkaFixture { @After public void cleanup() { cleanup(deploymentService, unit); + if (kieServicesClient != null) { + kieServicesClient.disposeContainer(SEND_PROJECT); + } } @AfterClass
[JBPM-<I>] - KieServerTest failing after adding Kafka tests (#<I>)
kiegroup_droolsjbpm-integration
train
java
58999bdec1a0da1cdf54e31436dcdb75b3e44f14
diff --git a/Tests/Cases/Orm/QueryTest.php b/Tests/Cases/Orm/QueryTest.php index <HASH>..<HASH> 100644 --- a/Tests/Cases/Orm/QueryTest.php +++ b/Tests/Cases/Orm/QueryTest.php @@ -159,4 +159,25 @@ abstract class QueryTest extends OrmDatabaseTestCase $this->assertEquals(3, User::objects()->sum('id')); $this->assertEquals(1, User::objects()->filter(['username' => 'Anton'])->sum('id')); } + + public function testCreate() + { + $user = User::objects()->get(['pk' => 1]); + + Customer::objects()->create([ + 'user' => $user, + 'address' => 'Broadway' + ]); + + Customer::objects()->create([ + 'user_id' => $user->id, + 'address' => 'Broadway' + ]); + + $address1 = Customer::objects()->get(['pk' => 3]); + $address2 = Customer::objects()->get(['pk' => 4]); + + $this->assertEquals($user->id, $address1->user->id); + $this->assertEquals($user->id, $address2->user_id); + } }
Test for issue <I> from mindy repository
MindyPHP_Orm
train
php
9cc322f198b1bf56a6bfd33bcd17df81568c2a00
diff --git a/lib/updates-ajax.php b/lib/updates-ajax.php index <HASH>..<HASH> 100644 --- a/lib/updates-ajax.php +++ b/lib/updates-ajax.php @@ -10,7 +10,6 @@ function seravo_change_php_version() { $php_version_string = ( '"set \$mode php' . $_REQUEST['version'] . ';"' ); exec('echo ' . $php_version_string . ' | tee /data/wordpress/nginx/php_version.conf'); exec('wp-restart-nginx'); - exec('wp-restart-php'); exec('wp-purge-cache'); }
Remove wp-restart-php
Seravo_seravo-plugin
train
php
aa98308650946cd5c4b864610d2c13390cd657fd
diff --git a/lib/valanga/error.rb b/lib/valanga/error.rb index <HASH>..<HASH> 100644 --- a/lib/valanga/error.rb +++ b/lib/valanga/error.rb @@ -2,4 +2,5 @@ module Valanga class Error < ::StandardError; end class LoginError < Error; end + class NoMusicInformationError < Error; end end diff --git a/lib/valanga/music_attribute.rb b/lib/valanga/music_attribute.rb index <HASH>..<HASH> 100644 --- a/lib/valanga/music_attribute.rb +++ b/lib/valanga/music_attribute.rb @@ -80,7 +80,15 @@ module Valanga end def music_bk - @music_bk ||= @document.css("div.music_bk dl") + return @music_bk if defined? @music_bk + + music_bk = @document.css("div.music_bk dl") + + unless music_bk.size == 8 || music_bk.size == 9 + raise NoMusicInformationError, "Not found music informations" + end + + @music_bk = music_bk end end end
If not found music information, raise error
mgi166_valanga
train
rb,rb
f4a45b84e632601cfb0e3398a6af16c6c77217c0
diff --git a/reactfx/src/main/java/org/reactfx/EventStream.java b/reactfx/src/main/java/org/reactfx/EventStream.java index <HASH>..<HASH> 100644 --- a/reactfx/src/main/java/org/reactfx/EventStream.java +++ b/reactfx/src/main/java/org/reactfx/EventStream.java @@ -199,7 +199,7 @@ public interface EventStream<T> extends Observable<Consumer<? super T>> { * <pre> * {@code * EventStream<Integer> A = ...; - * EventStream<Integer> B = A.supple(5); + * EventStream<Integer> B = A.supply(5); * } * </pre> * <p>Returns B. When A emits an event, B emits the supplied value.</p>
Fixed spelling error in javadoc for `supply`
TomasMikula_ReactFX
train
java
3b6436c36d7fdf927c5f53c916dbd9dded6cb0ed
diff --git a/internal/example-cli/example-cli.go b/internal/example-cli/example-cli.go index <HASH>..<HASH> 100644 --- a/internal/example-cli/example-cli.go +++ b/internal/example-cli/example-cli.go @@ -7,5 +7,5 @@ import ( ) func main() { - (&cli.App{}).Run([]string{}) + (&cli.App{}).Run([]string{""}) }
Pass non-empty string slice to example app `Run` (#<I>) so that it does not panic when run.
urfave_cli
train
go
6585d4e0bf04914290ba18750c30f09753ab111e
diff --git a/lib/sunspot.rb b/lib/sunspot.rb index <HASH>..<HASH> 100644 --- a/lib/sunspot.rb +++ b/lib/sunspot.rb @@ -38,7 +38,16 @@ module Sunspot NoSetupError = Class.new(Exception) IllegalSearchError = Class.new(Exception) + class <<self + # + # Clients can inject a session proxy, allowing them to implement custom + # session-management logic while retaining the Sunspot singleton API as + # an available interface. The object assigned to this attribute must + # respond to all of the public methods of the Sunspot::Session class. + # + attr_writer :session + # Configures indexing and search for a given class. # # ==== Parameters diff --git a/spec/api/session_spec.rb b/spec/api/session_spec.rb index <HASH>..<HASH> 100644 --- a/spec/api/session_spec.rb +++ b/spec/api/session_spec.rb @@ -198,6 +198,17 @@ describe 'Session' do end end + context 'session proxy' do + it 'should send messages to manually assigned session proxy' do + stub_session = stub!('session') + Sunspot.session = stub_session + post = Post.new + stub_session.should_receive(:index).with(post) + Sunspot.index(post) + Sunspot.reset! + end + end + def connection @connection_factory.instance end
Allow clients to inject a singleton session proxy
sunspot_sunspot
train
rb,rb
ae5c9d79c74d591b77d589961741a8f1a247491f
diff --git a/vex/make.py b/vex/make.py index <HASH>..<HASH> 100644 --- a/vex/make.py +++ b/vex/make.py @@ -60,10 +60,11 @@ def handle_make(environ, options, make_path): raise exceptions.VirtualenvNotMade("error creating virtualenv") if os.name != 'nt': pydoc_path = os.path.join(make_path, 'bin', 'pydoc') - with open(pydoc_path, 'wb') as out: - out.write(PYDOC_SCRIPT) - perms = os.stat(pydoc_path).st_mode - os.chmod(pydoc_path, perms | 0o0111) + if os.path.exists(os.path.dirname(pydoc_path)): + with open(pydoc_path, 'wb') as out: + out.write(PYDOC_SCRIPT) + perms = os.stat(pydoc_path).st_mode + os.chmod(pydoc_path, perms | 0o0111) else: pydoc_path = os.path.join(make_path, 'Scripts', 'pydoc.bat') with open(pydoc_path, 'wb') as out:
skip writing PYDOC_SCRIPT if pydoc_path parent doesn't exist there will be bigger fish to fry in this case
sashahart_vex
train
py
ee5ee4325899e983bb3c21608f55d05e11b96d5f
diff --git a/locksmith/media/scripts/analytics-common.js b/locksmith/media/scripts/analytics-common.js index <HASH>..<HASH> 100644 --- a/locksmith/media/scripts/analytics-common.js +++ b/locksmith/media/scripts/analytics-common.js @@ -126,6 +126,9 @@ ['internal.keys', 'ik'], ['time.period', 'tp'], + ['apis', 'a'], + ['endpoints', 'e'], + ['year', 'yr'] ];
Added key profile keys to analytics vocab list.
sunlightlabs_django-locksmith
train
js
f5ae9ddfcc6b35723a24f96d11366b6223974818
diff --git a/ember-cli-build.js b/ember-cli-build.js index <HASH>..<HASH> 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -159,7 +159,10 @@ module.exports = function() { destDir: '/assets' }); - var es6Tree = find(packagesTree, { + var es6Tree = find(merge([ + packagesTree, + testTree + ]), { destDir: 'es6' });
temp, include tests in output * we will introduce environments, and this will occur during test/development builds, but not production builds
glimmerjs_glimmer-vm
train
js
b1d2f95e310c04d09e2cc609a90698354338df23
diff --git a/src/Browser/Casper.php b/src/Browser/Casper.php index <HASH>..<HASH> 100644 --- a/src/Browser/Casper.php +++ b/src/Browser/Casper.php @@ -454,7 +454,7 @@ FRAGMENT; $this->_script .= $fragment; - $filename = '/tmp/php-casperjs-' . uniqid() . '.js'; + $filename = tempnam(null,'php-casperjs-'); file_put_contents($filename, $this->_script); // options parsing
Make it /tmp directory agnostic /tmp is *nix location for temporary files, but on windows its c:/windows/Temp. This make it crossplatform.
alwex_php-casperjs
train
php
d8f1d09b57f74c6ed4abb490c3d10fa48632cbaa
diff --git a/src/validations/base.js b/src/validations/base.js index <HASH>..<HASH> 100644 --- a/src/validations/base.js +++ b/src/validations/base.js @@ -103,11 +103,6 @@ export default class BaseValidation { } listener (e) { - if (e.relatedTarget - && (e.relatedTarget.tagName === 'A' || e.relatedTarget.tagName === 'BUTTON')) { - return - } - if (this.guardValidate(e.target, e.type)) { return }
fix(validation): touched property issues Closes #<I>
kazupon_vue-validator
train
js
795539c7f1bae156e3918f1240c8d4b973299822
diff --git a/shopify/resources.py b/shopify/resources.py index <HASH>..<HASH> 100644 --- a/shopify/resources.py +++ b/shopify/resources.py @@ -230,27 +230,11 @@ class Customer(ShopifyResource, mixins.Metafields): class CustomerGroup(ShopifyResource): def customers(cls, **kwargs): - """Get a list of customers matching a customer group - - Args: - page: Page to show (default: 1) - limit: Maximum number of results to show (default: 50, maximum: 250) - Returns: - An array of customers. - """ return Customer._build_list(cls.get("customers", **kwargs)) class CustomerSavedSearch(ShopifyResource): def customers(cls, **kwargs): - """Get a list of customers matching a customer saved search - - Args: - page: Page to show (default: 1) - limit: Maximum number of results to show (default: 50, maximum: 250) - Returns: - An array of customers. - """ return Customer._build_list(cls.get("customers", **kwargs))
removed comments in the code which could fall out of date with the api
Shopify_shopify_python_api
train
py
373de9b1da41567735acaa3a46e7d2e3fa68855b
diff --git a/app/mixins/has-action-models.js b/app/mixins/has-action-models.js index <HASH>..<HASH> 100644 --- a/app/mixins/has-action-models.js +++ b/app/mixins/has-action-models.js @@ -4,17 +4,13 @@ import Ember from 'ember'; // export default Ember.Mixin.create({ - expireActionModels: function () { - this.set('actionModelsExpiredAt', new Date()); - }, - createAccountAction: function () { return this.get('store').createRecord('actionCreateAccount'); - }.property('actionModelsExpiredAt'), + }.property(), createSessionAction: function () { return this.get('store').createRecord('actionCreateSession'); - }.property('actionModelsExpiredAt'), + }.property(), createSubscriptionAction: function () { @@ -36,6 +32,6 @@ export default Ember.Mixin.create({ giftCard: store.createRecord('giftCard') }); - }.property('actionModelsExpiredAt') + }.property(), });
Persist cart on signUpSuccess to avoid losing it if user refreshes page on step 3B
dollarshaveclub_ember-uni-form
train
js
54aa1f959532af28b2e0fe354faea8023fac3560
diff --git a/boolean/boolean.py b/boolean/boolean.py index <HASH>..<HASH> 100644 --- a/boolean/boolean.py +++ b/boolean/boolean.py @@ -26,7 +26,8 @@ from __future__ import print_function import inspect import itertools -from operator import and_ as and_operator, or_ as or_operator +from operator import and_ as and_operator +from operator import or_ as or_operator try: @@ -34,6 +35,12 @@ try: except NameError: basestring = str # Python 3 +try: + reduce # Python 2 +except NameError: + from functools import reduce # Python 3 + + # Set to True to enable tracing for parsing TRACE_PARSE = False
splits import, fixed reduce NameError for python3
bastikr_boolean.py
train
py
462047a36b1ab901d6cda6247c3ccf7a3f5c0ed1
diff --git a/src/effector/createNode.js b/src/effector/createNode.js index <HASH>..<HASH> 100644 --- a/src/effector/createNode.js +++ b/src/effector/createNode.js @@ -15,6 +15,17 @@ const arrifyNodes = (list: Graphite | Graphite[] = []): Graph[] => { } return result.map(getGraph) } +export const addToReg = ({hasRef, type, data}, reg) => { + let store + if (hasRef) { + store = data.store + reg[store.id] = store + } + if (type === 'mov' && data.to === 'store') { + store = data.target + reg[store.id] = store + } +} export function createNode({ node = [], from, @@ -53,14 +64,7 @@ export function createNode({ const item = node[i] if (!item) continue seq.push(item) - if (item.hasRef) { - const store = item.data.store - reg[store.id] = store - } - if (item.type === 'mov' && item.data.to === 'store') { - const store = item.data.target - reg[store.id] = store - } + addToReg(item, reg) } const result: Graph = { seq,
extract addToReg from createNode
zerobias_effector
train
js
6a756499ba71b35977d0efba2ab2e24472248a0d
diff --git a/tasks/typings.js b/tasks/typings.js index <HASH>..<HASH> 100644 --- a/tasks/typings.js +++ b/tasks/typings.js @@ -19,7 +19,7 @@ module.exports = function(grunt) { cwd: process.cwd() }); - var typings = require('typings'); + var typings = require('typings-core'); var done = this.async();
Changed to typings-core.
typings_grunt-typings
train
js
d04ec3c3399883aa84ed7493c0e2e49160a9f6ec
diff --git a/flask_appbuilder/security/manager.py b/flask_appbuilder/security/manager.py index <HASH>..<HASH> 100644 --- a/flask_appbuilder/security/manager.py +++ b/flask_appbuilder/security/manager.py @@ -618,13 +618,14 @@ class BaseSecurityManager(AbstractSecurityManager): # for Okta if provider == "okta": me = self.appbuilder.sm.oauth_remotes[provider].get("userinfo") - log.debug("User info from Okta: {0}".format(me.data)) + data = me.json() + log.debug("User info from Okta: %s", data) return { - "username": "okta_" + me.data.get("sub", ""), - "first_name": me.data.get("given_name", ""), - "last_name": me.data.get("family_name", ""), - "email": me.data.get("email", ""), - "role_keys": me.data.get("groups", []), + "username": "okta_" + data.get("sub", ""), + "first_name": data.get("given_name", ""), + "last_name": data.get("family_name", ""), + "email": data.get("email", ""), + "role_keys": data.get("groups", []), } else: return {}
fix: load user info for okta (#<I>)
dpgaspar_Flask-AppBuilder
train
py
418c2a6ea39b3871b6b4f64b0a23ee059c04967d
diff --git a/go/engine/passphrase_recover.go b/go/engine/passphrase_recover.go index <HASH>..<HASH> 100644 --- a/go/engine/passphrase_recover.go +++ b/go/engine/passphrase_recover.go @@ -59,6 +59,15 @@ func (e *PassphraseRecover) SubConsumers() []libkb.UIConsumer { func (e *PassphraseRecover) Run(mctx libkb.MetaContext) (err error) { defer mctx.Trace("PassphraseRecover#Run", func() error { return err })() + // If no username was passed, ask for one + if e.arg.Username == "" { + res, err := mctx.UIs().LoginUI.GetEmailOrUsername(mctx.Ctx(), 0) + if err != nil { + return err + } + e.arg.Username = res + } + // Look up the passed username against the list of configured users if err := e.processUsername(mctx); err != nil { return err
fix passphrase recovery if no username is passed (#<I>)
keybase_client
train
go
6cb66b6695d9c252ba0421ccc9ffca397e2fb97a
diff --git a/pkg/auth/authorizer/abac/abac.go b/pkg/auth/authorizer/abac/abac.go index <HASH>..<HASH> 100644 --- a/pkg/auth/authorizer/abac/abac.go +++ b/pkg/auth/authorizer/abac/abac.go @@ -104,7 +104,7 @@ func NewFromFile(path string) (policyList, error) { } if unversionedLines > 0 { - glog.Warningf(`Policy file %s contained unversioned rules. See docs/admin/authorization.md#abac-mode for ABAC file format details.`, path) + glog.Warningf("Policy file %s contained unversioned rules. See docs/admin/authorization.md#abac-mode for ABAC file format details.", path) } if err := scanner.Err(); err != nil {
check using single quote in cmd/pkg/plugin
kubernetes_kubernetes
train
go
df3708b5cc7212a302ede62e05ba8f499d9d1908
diff --git a/src/org/jenetics/util/XMLSerializer.java b/src/org/jenetics/util/XMLSerializer.java index <HASH>..<HASH> 100644 --- a/src/org/jenetics/util/XMLSerializer.java +++ b/src/org/jenetics/util/XMLSerializer.java @@ -33,7 +33,7 @@ import javolution.xml.stream.XMLStreamException; /** * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> - * @version $Id: XMLSerializer.java,v 1.3 2008-09-23 18:17:24 fwilhelm Exp $ + * @version $Id: XMLSerializer.java,v 1.4 2009-09-13 21:14:21 fwilhelm Exp $ */ public class XMLSerializer { @@ -55,12 +55,18 @@ public class XMLSerializer { Validator.notNull(out, "Output stream"); Validator.notNull(object, "Object"); - final XMLObjectWriter writer = XMLObjectWriter.newInstance( - new NonClosableOutputStream(out) - ); - writer.setIndentation("\t"); - writer.write(object); - writer.close(); + XMLObjectWriter writer = null; + try { + writer = XMLObjectWriter.newInstance( + new NonClosableOutputStream(out) + ); + writer.setIndentation("\t"); + writer.write(object); + } finally { + if (writer != null) { + writer.close(); + } + } } /**
Close the XML writer within a finally block.
jenetics_jenetics
train
java
210ec943606cac6defd7f406b4d75a16aab6b092
diff --git a/src/main/java/org/asteriskjava/manager/action/MuteAudioAction.java b/src/main/java/org/asteriskjava/manager/action/MuteAudioAction.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/manager/action/MuteAudioAction.java +++ b/src/main/java/org/asteriskjava/manager/action/MuteAudioAction.java @@ -41,7 +41,7 @@ public class MuteAudioAction extends AbstractManagerAction private String channel; /** The audio direct (relative to the pbx) which is to be muted. */ - enum Direction + public enum Direction { IN, OUT, ALL } @@ -49,7 +49,7 @@ public class MuteAudioAction extends AbstractManagerAction private Direction direction; /** Controls whether to mute (on) or unmute (off) the call **/ - enum State + public enum State { MUTE("on"), UNMUTE("off"); //$NON-NLS-1$//$NON-NLS-2$
Made the State and Direction enums public so that they can actually be used when creating a MuteAudioAction.
asterisk-java_asterisk-java
train
java
a01dad283fea07b68878d93b09c5cf7a6e1821f6
diff --git a/discord/http.py b/discord/http.py index <HASH>..<HASH> 100644 --- a/discord/http.py +++ b/discord/http.py @@ -650,6 +650,19 @@ class HTTPClient: # Banned by Cloudflare more than likely. raise HTTPException(response, data) + if ratelimit.remaining > 0: + # According to night + # https://github.com/discord/discord-api-docs/issues/2190#issuecomment-816363129 + # Remaining > 0 and 429 means that a sub ratelimit was hit. + # It is unclear what should happen in these cases other than just using the retry_after + # value in the body. + _log.debug( + '%s %s received a 429 despite having %s remaining requests. This is a sub-ratelimit.', + method, + url, + ratelimit.remaining, + ) + retry_after: float = data['retry_after'] if self.max_ratelimit_timeout and retry_after > self.max_ratelimit_timeout: _log.warning(
Add extraneous debug logging to sub ratelimits being detected
Rapptz_discord.py
train
py
0f423f38885e2b199cffe0139a470bf63ae1fa43
diff --git a/src/Command/ProjectBuildCommand.php b/src/Command/ProjectBuildCommand.php index <HASH>..<HASH> 100644 --- a/src/Command/ProjectBuildCommand.php +++ b/src/Command/ProjectBuildCommand.php @@ -29,7 +29,7 @@ class ProjectBuildCommand extends PlatformCommand 'Use absolute links.' ); $projectRoot = $this->getProjectRoot(); - if ($projectRoot && Drupal::isDrupal($projectRoot . '/repository')) { + if (!$projectRoot || Drupal::isDrupal($projectRoot . '/repository')) { $this->addOption( 'working-copy', 'wc', @@ -39,7 +39,7 @@ class ProjectBuildCommand extends PlatformCommand 'concurrency', null, InputOption::VALUE_OPTIONAL, - 'Drush: set the number of concurrent projects that will be processed at the same time. The default is 3.', + 'Drush: set the number of concurrent projects that will be processed at the same time.', 3 ); }
Consistency - platform build -h should show all options if there is no projectRoot.
platformsh_platformsh-cli
train
php
dd90b78e8a4222ae4f09420dc1f3476fd70bcac6
diff --git a/thermo/viscosity.py b/thermo/viscosity.py index <HASH>..<HASH> 100644 --- a/thermo/viscosity.py +++ b/thermo/viscosity.py @@ -1078,11 +1078,20 @@ class ViscosityLiquidMixture(MixtureProperty): else: mus = [i.T_dependent_property(T) for i in self.ViscosityLiquids] if method == MIXING_LOG_MOLAR: - return mixing_logarithmic(zs, mus) + ln_mu = 0.0 + for i in range(len(zs)): + ln_mu += zs[i]*log(mus[i]) + return exp(ln_mu) elif method == MIXING_LOG_MASS: - return mixing_logarithmic(ws, mus) + ln_mu = 0.0 + for i in range(len(ws)): + ln_mu += ws[i]*log(mus[i]) + return exp(ln_mu) elif method == SIMPLE: - return mixing_simple(zs, mus) + mu = 0.0 + for i in range(len(zs)): + mu += zs[i]*mus[i] + return mu else: raise Exception('Method not valid')
Inline viscosity of liquid calculation for mixtures
CalebBell_thermo
train
py
a55f8df17486d556d6b37fa8fd942e88c7e9eca7
diff --git a/pymodeler/parameter.py b/pymodeler/parameter.py index <HASH>..<HASH> 100644 --- a/pymodeler/parameter.py +++ b/pymodeler/parameter.py @@ -12,8 +12,14 @@ def asscalar(a): https://github.com/numpy/numpy/issues/4701 """ # First check for numeric values - if isinstance(a, (int, long, float)): - return a + if isinstance(a, (int, float)): + return a + # Long == int in python 3. + # FIXME, find a better way of dealing with this + try: + isinstance(a, (long)) + except NameError: + pass try: return np.asscalar(a) except AttributeError:
Deal with long not being defined in python 3
kadrlica_pymodeler
train
py
222b5cf69b0175f86612f1b9ce9688a8fa687774
diff --git a/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java b/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java +++ b/core/src/main/java/hudson/node_monitors/AbstractNodeMonitorDescriptor.java @@ -85,12 +85,12 @@ public abstract class AbstractNodeMonitorDescriptor<T> extends Descriptor<NodeMo * * Once set to non-null, never be null. */ - private volatile Record record = null; + private transient volatile Record record = null; /** * Represents the update activity in progress. */ - private volatile Record inProgress = null; + private transient volatile Record inProgress = null; /** * Performs monitoring of the given computer object. @@ -270,7 +270,7 @@ public abstract class AbstractNodeMonitorDescriptor<T> extends Descriptor<NodeMo } } - private final Logger LOGGER = Logger.getLogger(getClass().getName()); + private static final Logger LOGGER = Logger.getLogger(AbstractNodeMonitorDescriptor.class.getName()); private static final long HOUR = 1000*60*60L; }
Had some inappropriately nontransient fields.
jenkinsci_jenkins
train
java
6a435418e16daa998b8f3c18322079b0e3305204
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -437,10 +437,10 @@ func (c *client) disconnect() { done := c.stopCommsWorkers() if done != nil { <-done // Wait until the disconect is complete (to limit chance that another connection will be started) + c.messageIds.cleanUp() + DEBUG.Println(CLI, "disconnected") + c.persist.Close() } - c.messageIds.cleanUp() - DEBUG.Println(CLI, "disconnected") - c.persist.Close() } // internalConnLost cleanup when connection is lost or an error occurs
disconnect only cleanup when commsworkers stopped
eclipse_paho.mqtt.golang
train
go
dfa81e52032716c29d60940042333f3d1b683520
diff --git a/URLFinder.py b/URLFinder.py index <HASH>..<HASH> 100644 --- a/URLFinder.py +++ b/URLFinder.py @@ -26,7 +26,7 @@ class URLFinder: self.tlds = sorted(tmp_idna_tlds.union(tmp_tlds), key=len, reverse=True) # escaped = [re.escape(tld) for tld in self.tlds] self.tlds_re = re.compile('|'.join([re.escape(tld) for tld in self.tlds])) - self.stop_chars = list(string.whitespace) + ['\"', '\''] + self.stop_chars = list(string.whitespace) + ['\"', '\'', '<', '>'] self.after_tld_chars = list(string.whitespace) + ['/'] def _complete_url(self, text, tld_pos):
Added < and > as stop chars
lipoja_URLExtract
train
py
2b21bfb96bfb24d17a7ae5d4df8332de0acbcead
diff --git a/rpc_util.go b/rpc_util.go index <HASH>..<HASH> 100644 --- a/rpc_util.go +++ b/rpc_util.go @@ -519,6 +519,6 @@ const SupportPackageIsVersion3 = true const SupportPackageIsVersion4 = true // Version is the current grpc version. -const Version = "1.5.0-dev" +const Version = "1.6.0-dev" const grpcUA = "grpc-go/" + Version
Change version to <I>.x (#<I>)
grpc_grpc-go
train
go
d0b38597623118b272ca95843b1f7eef2b7d1d09
diff --git a/salt/modules/apt.py b/salt/modules/apt.py index <HASH>..<HASH> 100644 --- a/salt/modules/apt.py +++ b/salt/modules/apt.py @@ -92,7 +92,7 @@ def _pkgname_without_arch(name): Check for ':arch' appended to pkg name (i.e. 32 bit installed on 64 bit machine is ':i386') ''' - return name.rpartition(':')[0] + return name.split(':')[0] def _get_repo(**kwargs):
Fix regression in apt.py This fixes a regression introduced in a<I>a2af a few days ago.
saltstack_salt
train
py
61d7170d13fb990e5d9a7a07eef8cddab6a166c9
diff --git a/views/emails/newPost.blade.php b/views/emails/newPost.blade.php index <HASH>..<HASH> 100644 --- a/views/emails/newPost.blade.php +++ b/views/emails/newPost.blade.php @@ -7,7 +7,7 @@ To view the new activity, check out the following link: --- -{!! strip_tags($blueprint->post->contentHtml) !!} +{!! $blueprint->post->content !!} ---
Rely on TextFormatter to unparse the post content Fixes flarum/core#<I>.
flarum_subscriptions
train
php
f8520c6fc23e8762b8cb1089821efb7d61f3c691
diff --git a/niworkflows/__about__.py b/niworkflows/__about__.py index <HASH>..<HASH> 100644 --- a/niworkflows/__about__.py +++ b/niworkflows/__about__.py @@ -52,6 +52,8 @@ CLASSIFIERS = [ REQUIRES = [ 'nipype>=1.1.0', 'nilearn>=0.2.6', + 'grabbit==0.2.3', + 'pybids==0.6.5', 'sklearn', 'pandas', 'matplotlib',
add pybids as a dependency
poldracklab_niworkflows
train
py
3de88b628d852ab0d686166ba79fb4bd42705ee3
diff --git a/lib/authem/role.rb b/lib/authem/role.rb index <HASH>..<HASH> 100644 --- a/lib/authem/role.rb +++ b/lib/authem/role.rb @@ -48,7 +48,7 @@ module Authem end def setup_view_helpers - controller.helper_method *%I[current_#{name} #{name}_signed_in?] + controller.helper_method *%I[current_#{name} #{name}_signed_in? #{name}_sign_in_path] end def define_controller_method(*args, &block) diff --git a/spec/controller_spec.rb b/spec/controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controller_spec.rb +++ b/spec/controller_spec.rb @@ -128,6 +128,7 @@ describe Authem::Controller do it "defines view helpers" do expect(view_helpers).to include(:current_user) expect(view_helpers).to include(:user_signed_in?) + expect(view_helpers).to include(:user_sign_in_path) end it "raises error when calling clear_all_sessions_for with nil" do
Expose user_sign_in_path to views
paulelliott_authem
train
rb,rb
e8ef4a46d5dbc9bb6d629ecd0b02721d6bdf2f87
diff --git a/spacy/language.py b/spacy/language.py index <HASH>..<HASH> 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -1,4 +1,5 @@ -from typing import Optional, Any, Dict, Callable, Iterable, Union, List, Pattern +from typing import Iterator, Optional, Any, Dict, Callable, Iterable, TypeVar +from typing import Union, List, Pattern, overload from typing import Tuple from dataclasses import dataclass import random @@ -1431,6 +1432,21 @@ class Language: except StopIteration: pass + _AnyContext = TypeVar("_AnyContext") + + @overload + def pipe( + self, + texts: Iterable[Tuple[str, _AnyContext]], + *, + as_tuples: bool = ..., + batch_size: Optional[int] = ..., + disable: Iterable[str] = ..., + component_cfg: Optional[Dict[str, Dict[str, Any]]] = ..., + n_process: int = ..., + ) -> Iterator[Tuple[Doc, _AnyContext]]: + ... + def pipe( self, texts: Iterable[str], @@ -1440,7 +1456,7 @@ class Language: disable: Iterable[str] = SimpleFrozenList(), component_cfg: Optional[Dict[str, Dict[str, Any]]] = None, n_process: int = 1, - ): + ) -> Iterator[Doc]: """Process texts as a stream, and yield `Doc` objects in order. texts (Iterable[str]): A sequence of texts to process.
Add the right return type for Language.pipe and an overload for the as_tuples case (#<I>) * Add the right return type for Language.pipe and an overload for the as_tuples version * Reformat, tidy up
explosion_spaCy
train
py
c2bf5a3907640e31a357c8962d83c028c8910222
diff --git a/webpack.config.dev.babel.js b/webpack.config.dev.babel.js index <HASH>..<HASH> 100644 --- a/webpack.config.dev.babel.js +++ b/webpack.config.dev.babel.js @@ -328,8 +328,6 @@ module.exports = (env) => { support_library: process.env.JQUERY ? path.join('lib', 'jquery.js'): path.join('lib', 'zepto.js') }), - new MinifyPlugin, - new BrowserSyncPlugin({ files: "dist/**/*.*", hostname: "localhost", @@ -341,6 +339,10 @@ module.exports = (env) => { reloadOnRestart: true, }), - ] : [])), + ] : [ + + new MinifyPlugin, + + ])), } }
Minify should be active only on build, not dev.
golden-layout_golden-layout
train
js
f76e9e9da3e5f27497e653b9bdc7e568b1cb829f
diff --git a/src/l10n/Translator/Translator.php b/src/l10n/Translator/Translator.php index <HASH>..<HASH> 100644 --- a/src/l10n/Translator/Translator.php +++ b/src/l10n/Translator/Translator.php @@ -46,8 +46,8 @@ class Translator { * @param int $plural */ protected function checkPlural($plural) { - if ($plural > $this->plural->getPluralsCount() - 1) { - throw new \RangeException('The plural is bigger than is allowed'); + if ($plural > ($max = $this->plural->getPluralsCount() - 1)) { + throw new \RangeException(sprintf('The plural (%d) is bigger than is allowed (%d)', $plural, $max)); } } diff --git a/tests/TranslatorTest.php b/tests/TranslatorTest.php index <HASH>..<HASH> 100644 --- a/tests/TranslatorTest.php +++ b/tests/TranslatorTest.php @@ -89,7 +89,7 @@ class TranslatorTest extends PHPUnit_Framework_TestCase { $translator->setText('key', 'text %n%', 0); $translator->setText('key', 'text %n%', 1); - $this->setExpectedException('RangeException', 'The plural is bigger than is allowed'); + $this->setExpectedException('RangeException', 'The plural (2) is bigger than is allowed (1)'); $translator->setText('key', 'text %n%', 2); }
Improved RangeException message in checkPlural method
Zemistr_l10n
train
php,php
3e7ab4ff331df0699ac8aec7540fe4b587242568
diff --git a/lib/PHPRtfLite/Container/Base.php b/lib/PHPRtfLite/Container/Base.php index <HASH>..<HASH> 100644 --- a/lib/PHPRtfLite/Container/Base.php +++ b/lib/PHPRtfLite/Container/Base.php @@ -319,14 +319,21 @@ abstract class PHPRtfLite_Container_Base $lastKey = $this->countElements() - 1; foreach ($this->_elements as $key => $element) { + $cellAlignment = ''; if ($this instanceof PHPRtfLite_Table_Cell && !($element instanceof PHPRtfLite_Table)) { // table cell initialization $stream->write('\intbl\itap' . $this->getTable()->getNestDepth() . "\r\n"); - $stream->write($this->getCellAlignment()); + $cellAlignment = $this->getCellAlignment(); + if ($cellAlignment) { + $stream->write('{' . $cellAlignment); + } } if ($element instanceof PHPRtfLite_Element_Plain) { $element->render(); + if ($cellAlignment) { + $stream->write('}'); + } continue; } @@ -361,6 +368,10 @@ abstract class PHPRtfLite_Container_Base if ($parFormat && $this instanceof PHPRtfLite_Table_Cell && $lastKey != $key) { $stream->write('}'); } + + if ($cellAlignment) { + $stream->write('}'); + } } }
Fixed cell text alignment does not interfere following cells
phprtflite_PHPRtfLite
train
php
01c5f4aac283fae154bfec0b1f36ca6d3ae266bf
diff --git a/lib/cobweb_crawler.rb b/lib/cobweb_crawler.rb index <HASH>..<HASH> 100644 --- a/lib/cobweb_crawler.rb +++ b/lib/cobweb_crawler.rb @@ -128,7 +128,7 @@ class CobwebCrawler links = content[:links].keys.map{|key| content[:links][key]}.flatten links.reject!{|link| link.cobweb_starts_with?("javascript:")} links = links.map{|link| UriHelper.join_no_fragment(content[:url], link) } - links.select!{|link| link.scheme == "http" || link.scheme == "https"} + links = links.select{|link| link.scheme == "http" || link.scheme == "https"} links.uniq links end
fixed calling select! on array for ruby <I>r
stewartmckee_cobweb
train
rb
e2774db29cf28837f27a5f1bc807fdd0cee0521f
diff --git a/DependencyInjection/SyliusResourceExtension.php b/DependencyInjection/SyliusResourceExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/SyliusResourceExtension.php +++ b/DependencyInjection/SyliusResourceExtension.php @@ -31,7 +31,7 @@ final class SyliusResourceExtension extends Extension */ public function load(array $config, ContainerBuilder $container) { - $config = $this->processConfiguration($this->getConfiguration($config, $container), $config); + $config = $this->processConfiguration($this->getConfiguration([], $container), $config); $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml');
Simplify getConfiguration() call in extensions
Sylius_SyliusResourceBundle
train
php
8a5a6798d1ad1ca7f2182858977c3414312e40d9
diff --git a/salt/client.py b/salt/client.py index <HASH>..<HASH> 100644 --- a/salt/client.py +++ b/salt/client.py @@ -227,7 +227,8 @@ class LocalClient(object): # Prep zmq context = zmq.Context() socket = context.socket(zmq.REQ) - socket.connect('tcp://127.0.0.1:' + self.opts['ret_port']) + socket.connect('tcp://' + self.opts['interface'] + ':'\ + + str(self.opts['ret_port'])) socket.send(package) payload = salt.payload.unpackage(socket.recv()) return {'jid': payload['load']['jid'], diff --git a/salt/config.py b/salt/config.py index <HASH>..<HASH> 100644 --- a/salt/config.py +++ b/salt/config.py @@ -34,7 +34,8 @@ def minion_config(path): except Exception: pass - opts['master_uri'] = 'tcp://' + opts['master'] + ':' + opts['master_port'] + opts['master_uri'] = 'tcp://' + opts['master'] + ':'\ + + str(opts['master_port']) # Enableing open mode requires that the value be set to True, and nothing # else!
Merge patch from mtg with style changes
saltstack_salt
train
py,py
2db815088c8486fd8168e1da0c553d1c0cc1ff07
diff --git a/closure/goog/labs/useragent/util.js b/closure/goog/labs/useragent/util.js index <HASH>..<HASH> 100644 --- a/closure/goog/labs/useragent/util.js +++ b/closure/goog/labs/useragent/util.js @@ -18,6 +18,7 @@ * * @visibility {//closure/goog/bin/sizetests:__pkg__} * @visibility {//closure/goog/testing:__pkg__} + * @visibility {//testing/puppet/modules:__pkg__} * * * @author [email protected] (Nathan Naze) */
Allow puppet to access goog.labs.userAgent.util. ------------- Created by MOE: <URL>
google_closure-library
train
js
f564bf74109b95f1c6c5510b26ce3c210607de5d
diff --git a/plugins/provisioners/ansible/provisioner.rb b/plugins/provisioners/ansible/provisioner.rb index <HASH>..<HASH> 100644 --- a/plugins/provisioners/ansible/provisioner.rb +++ b/plugins/provisioners/ansible/provisioner.rb @@ -104,6 +104,10 @@ module VagrantPlugins included_groups = [] config.groups.each_pair do |gname, gmembers| + # Require that gmembers be an array + # (easier to be tolerant and avoid error management of few value) + gmembers = [gmembers] if !gmembers.is_a?(Array) + if gname.end_with?(":children") groups_of_groups[gname] = gmembers else
Ansible Groups: Accept single item as String Syntax errors in `ansible.groups` definition are not well handled: Error returned: undefined method `each' for "machine1":String (NoMethodError) Being tolerant here doesn't hurt and may avoid people get confused/annoyed.
hashicorp_vagrant
train
rb
c6e45b7c7f0f6415f278bc989949ae941b1fe24c
diff --git a/openquake/commonlib/source_reader.py b/openquake/commonlib/source_reader.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/source_reader.py +++ b/openquake/commonlib/source_reader.py @@ -158,14 +158,6 @@ def get_csm(oq, source_model_lt, gsim_lt, h5=None): groups[eri].extend(dic['src_groups']) for sg in dic['src_groups']: changes += sg.changes - gsim_file = oq.inputs.get('gsim_logic_tree') - if gsim_file: # check TRTs - for src_group in dic['src_groups']: - if src_group.trt not in gsim_lt.values: - raise ValueError( - "Found in the source models a tectonic region type %r " - "inconsistent with the ones in %r" % - (src_group.trt, gsim_file)) for sm_rlz in full_lt.sm_rlzs: # check applyToSources source_ids = set(src.source_id for grp in groups[sm_rlz.ordinal]
Removed the late check on TRTs [skip hazardlib]
gem_oq-engine
train
py
39c2ab9eda9f6e8a81e857101122b7c36e01da8c
diff --git a/core/test/com/google/inject/KeyTest.java b/core/test/com/google/inject/KeyTest.java index <HASH>..<HASH> 100644 --- a/core/test/com/google/inject/KeyTest.java +++ b/core/test/com/google/inject/KeyTest.java @@ -250,6 +250,7 @@ public class KeyTest extends TestCase { @BindingAnnotation @interface Foo {} + @SuppressWarnings("ScopeOrQualifierAnnotationRetention") // intentional, to check failure mode @Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD}) @BindingAnnotation @interface Bar {} diff --git a/core/test/com/google/inject/ScopesTest.java b/core/test/com/google/inject/ScopesTest.java index <HASH>..<HASH> 100644 --- a/core/test/com/google/inject/ScopesTest.java +++ b/core/test/com/google/inject/ScopesTest.java @@ -505,6 +505,7 @@ public class ScopesTest extends TestCase { } }; + @SuppressWarnings("ScopeOrQualifierAnnotationRetention") // intentional, to check failure mode @Target({ElementType.TYPE, ElementType.METHOD}) @ScopeAnnotation public @interface NotRuntimeRetainedScoped {}
Suppress warnings for the scope/qualifier annotations intentionally used w/o RUNTIME retention. ------------- Created by MOE: <URL>
google_guice
train
java,java
65b5f1786877a5f25d86e72cd8571b899136b250
diff --git a/src/REST/keywords.py b/src/REST/keywords.py index <HASH>..<HASH> 100644 --- a/src/REST/keywords.py +++ b/src/REST/keywords.py @@ -267,7 +267,7 @@ class Keywords(object): else: json = self._find_by_field(what, also_schema=False)['reality'] if not file_path: - return self.print(json, "\n\n") + return self.print(json, "\n\nJSON for '{}' is:\n".format(what)) try: with open(path.join(getcwd(), file_path), 'w') as file: dump(json, file, ensure_ascii=False, indent=4)
Show the field name in `Output`
asyrjasalo_RESTinstance
train
py
97327d655939dd1d098064a08930aa6cf47dbbf5
diff --git a/packages/theme-data/src/__stories__/stories.js b/packages/theme-data/src/__stories__/stories.js index <HASH>..<HASH> 100644 --- a/packages/theme-data/src/__stories__/stories.js +++ b/packages/theme-data/src/__stories__/stories.js @@ -74,6 +74,11 @@ export default [ readme: undefined }, { + description: "Component - Forms", + schema: filterMatchByKey(schema, /^FORM_FIELD./), + readme: undefined + }, + { description: "Component - Input", schema: filterMatchByKey(schema, /^INPUT./), readme: undefined @@ -87,5 +92,10 @@ export default [ description: "Component - Menu", schema: filterMatchByKey(schema, /^MENU./), readme: undefined + }, + { + description: "Component - Text area", + schema: filterMatchByKey(schema, /^TEXT_AREA./), + readme: undefined } ];
Add text area and forms sections to docs
Autodesk_hig
train
js
e0cf23c4b3bfc9fede82b3bf5104163584269f10
diff --git a/pbxproj/__init__.py b/pbxproj/__init__.py index <HASH>..<HASH> 100644 --- a/pbxproj/__init__.py +++ b/pbxproj/__init__.py @@ -27,4 +27,4 @@ from pbxproj.PBXRootObject import rootObject from pbxproj.XcodeProject import XcodeProject from pbxproj.pbxsections import * -__version__ = '2.1.2' +__version__ = '2.2.0' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ setup(name='pbxproj', ] }, url="http://github.com/kronenthaler/mod-pbxproj", - version='2.1.2', + version='2.2.0', license='MIT License', install_requires=['openstep_parser', 'docopt', 'future'], packages=find_packages(exclude=['tests']),
chore: pump version <I>
kronenthaler_mod-pbxproj
train
py,py
512126d5b34db9e286d5f1bb056a9f7258e5f431
diff --git a/tools/repl.js b/tools/repl.js index <HASH>..<HASH> 100644 --- a/tools/repl.js +++ b/tools/repl.js @@ -12,7 +12,7 @@ var path = require('path'); var vm = require('vm'); var readline = require('readline'); var util = require('util'); -var colored = require('./utils').colored; +var colored = require('./utils').safe_colored; var RapydScript = require('./compiler'); function create_ctx(baselib, show_js, console) {
Use safe_colored() in the REPL code as well
kovidgoyal_rapydscript-ng
train
js
97efc268e204a0ddaee2468a51f734eb3a314d05
diff --git a/src/Controller/CrudController.php b/src/Controller/CrudController.php index <HASH>..<HASH> 100644 --- a/src/Controller/CrudController.php +++ b/src/Controller/CrudController.php @@ -63,10 +63,7 @@ class CrudController extends Base * An array of fields which should be ignored when reading * @var array */ - const IGNORE_FIELDS_READ = [ - 'id', - 'token', - ]; + const IGNORE_FIELDS_READ = []; /** * An array of fields which should be ignored when writing
No longer ignoring id & token fields when looking up CRUD resources
nails_module-api
train
php
89bc76de07ac195c6d4f57d7a36c88350c471ef8
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() + return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8").read() tests_require = ["mock", "unittest2"]
(1) Add utf-8 encoding. Fix UnicodeDecodeError while installing on Ubuntu server.
olucurious_PyFCM
train
py
2c62e6eac326b60aa6804769311faa104624fd3d
diff --git a/tests/config/base.php b/tests/config/base.php index <HASH>..<HASH> 100644 --- a/tests/config/base.php +++ b/tests/config/base.php @@ -9,7 +9,7 @@ $settings = [ 'dbAuth.returnedColumns' => 'id,username,password', 'jwtAuth.mode' => 'optional', 'jwtAuth.time' => '1538207605', - 'jwtAuth.secret' => 'axpIrCGNGqxzx2R9dtXLIPUSqPo778uhb8CA0F4Hx', + 'jwtAuth.secrets' => 'axpIrCGNGqxzx2R9dtXLIPUSqPo778uhb8CA0F4Hx', 'basicAuth.mode' => 'optional', 'basicAuth.passwordFile' => __DIR__ . DIRECTORY_SEPARATOR . '.htpasswd', 'reconnect.databaseHandler' => function () {
Add support for multiple keys as proposed in #<I>
mevdschee_php-crud-api
train
php
2d3edd2a027ed015b9358c0560164a874bed0b14
diff --git a/Swat/SwatNumericCellRenderer.php b/Swat/SwatNumericCellRenderer.php index <HASH>..<HASH> 100644 --- a/Swat/SwatNumericCellRenderer.php +++ b/Swat/SwatNumericCellRenderer.php @@ -39,6 +39,16 @@ class SwatNumericCellRenderer extends SwatCellRenderer */ public $null_display_value = null; + /** + * Show Thousands Seperator + * + * Whether or not to show a thousands separator (shown depending on + * locale). + * + * @var boolean + */ + public $show_thousands_separator = true; + // }}} // {{{ public function render() @@ -82,7 +92,10 @@ class SwatNumericCellRenderer extends SwatCellRenderer if (is_numeric($this->value)) { $locale = SwatI18NLocale::get(); - $value = $locale->formatNumber($this->value, $this->precision); + $thousands_separator = $this->show_thousands_separator ? null : ''; + $value = $locale->formatNumber($this->value, $this->precision, [ + 'thousands_separator' => $thousands_separator + ]); } return $value;
Add flag to toggle showing thousands separator Matches the property already available on SwatNumericEntry
silverorange_swat
train
php
032b2f3e22ea15d700114f51ace260784caff455
diff --git a/spinoff/actor/_actor.py b/spinoff/actor/_actor.py index <HASH>..<HASH> 100644 --- a/spinoff/actor/_actor.py +++ b/spinoff/actor/_actor.py @@ -26,6 +26,7 @@ from spinoff.util.pattern_matching import IS_INSTANCE, ANY from spinoff.util.async import call_when_idle_unless_already, with_timeout, Timeout from spinoff.util.pattern_matching import Matcher from spinoff.util.logging import Logging, logstring +from spinoff.actor.events import Error TESTING = True @@ -1123,7 +1124,8 @@ class Cell(_BaseCell, Logging): else: exc, tb = exc_and_tb try: - # Events.log(Error(self, e, sys.exc_info()[2])), + traceback.print_exception(type(exc), exc, tb, file=sys.stderr) + Events.log(Error(self.ref, exc, tb)), self._do_suspend() # XXX: might make sense to make it async by default for better latency self.parent.send(('_error', self.ref, exc, tb), force_async=True)
Always print error traceback and log Error events
eallik_spinoff
train
py
540c717f4757c5feffc8498ae09a43013ef59d7c
diff --git a/src/components/application-shell/application-shell.js b/src/components/application-shell/application-shell.js index <HASH>..<HASH> 100644 --- a/src/components/application-shell/application-shell.js +++ b/src/components/application-shell/application-shell.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import { Router, Redirect, Route, Switch } from 'react-router-dom'; import { ApolloProvider } from 'react-apollo'; import { ReconfigureFlopFlip } from '@flopflip/react-broadcast'; -import { ConfigurationProvider } from '@commercetools-local/core/components/configuration'; import { joinPaths } from '@commercetools-local/utils/url'; import * as storage from '@commercetools-local/utils/storage'; import { DOMAINS, LOGOUT_REASONS } from '@commercetools-local/constants'; @@ -35,6 +34,7 @@ import IntercomUserTracker from '../intercom-user-tracker'; import IntercomBooter from '../intercom-booter'; // import VersionCheckSubscriber from '../version-check-subscriber'; import RequestsInFlightLoader from '../requests-in-flight-loader'; +import { ConfigurationProvider } from '../configuration-provider'; import PageRedirect from '../page-redirect'; import GtmUserTracker from '../gtm-user-tracker'; import GtmBooter from '../gtm-booter';
refactor(app-shell): re-wire configuration provider import
commercetools_merchant-center-application-kit
train
js
6133df067439859a1a2b4f40eecce2fea4e62d09
diff --git a/resumable.js b/resumable.js index <HASH>..<HASH> 100644 --- a/resumable.js +++ b/resumable.js @@ -310,6 +310,7 @@ } ); }; + readDir(entry.fullPath); } } };
Call readDir when dropping folders into Chrome When dropping folders into Chrome, the function readDir is defined in order to be able to recursively call the function. readDir is then never actually called, the upshot of which being no folders ever get added from a drop into Chrome.
23_resumable.js
train
js
07495ab26dd415f127afa57b6a608c34118f9f81
diff --git a/components/form/formItem.js b/components/form/formItem.js index <HASH>..<HASH> 100644 --- a/components/form/formItem.js +++ b/components/form/formItem.js @@ -218,6 +218,7 @@ export default class FormItem extends Intact { // for select, the focusout event triggers before select // so we put off validating it setTimeout(() => { + if (this.destroyed) return; this.validate() }, 100); }
fix(Form): disable validate on destroyed, close #<I>
ksc-fe_kpc
train
js
c73d2b9c8ee65326fe6c1b76a05a6b6cdcf223b9
diff --git a/p2p/host/relay/autorelay_test.go b/p2p/host/relay/autorelay_test.go index <HASH>..<HASH> 100644 --- a/p2p/host/relay/autorelay_test.go +++ b/p2p/host/relay/autorelay_test.go @@ -169,6 +169,9 @@ func TestAutoRelay(t *testing.T) { t.Fatal(err) } h4, err := libp2p.New(ctx, libp2p.EnableRelay()) + if err != nil { + t.Fatal(err) + } // verify that we don't advertise relay addrs initially for _, addr := range h3.Addrs() {
Added missing error check in test (#<I>)
libp2p_go-libp2p
train
go
9c4f4ac8c23ffb16cb0eecd7b9d3b69fee0e44d4
diff --git a/lib/parser.js b/lib/parser.js index <HASH>..<HASH> 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -623,6 +623,10 @@ Parser.prototype = { if(!uf.properties.url) { value = domUtils.getAttrValFromTagList(dom, node, ['a'], 'href'); if(value) { + // relative to absolute URL + if(value !== '' && this.options.baseUrl !== '' && value.indexOf(':') === -1) { + value = urlParser.resolve(this.options.baseUrl, value); + } uf.properties.url = [utils.trim(value)]; } }
Resolve implied URL to an absolute URL Just like an implied photo is resolved to an absolute URL an implied URL should be resolved to one
glennjones_microformat-node
train
js
ccc4e63abbb1f49dfdbe5d8bc6e40cd98c75580f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ setup( 'enum-compat', 'toml', 'argparse', - 'algorithmia-api-client>=1.3,<2', + 'algorithmia-api-client>=1.3,<1.4', 'algorithmia-adk>=1.0.2,<1.1' ], include_package_data=True,
reverted change to setup.py (#<I>)
algorithmiaio_algorithmia-python
train
py
ad325377b5b370d3f7a77181e382c9c662d4c563
diff --git a/test/e2e/scheduling/priorities.go b/test/e2e/scheduling/priorities.go index <HASH>..<HASH> 100644 --- a/test/e2e/scheduling/priorities.go +++ b/test/e2e/scheduling/priorities.go @@ -637,7 +637,7 @@ func createRC(ns, rsName string, replicas int32, rcPodLabels map[string]string, func getRandomTaint() v1.Taint { return v1.Taint{ - Key: fmt.Sprintf("kubernetes.io/scheduling-priorities-e2e-taint-key-%s", string(uuid.NewUUID())), + Key: fmt.Sprintf("kubernetes.io/e2e-scheduling-priorities-%s", string(uuid.NewUUID()[:23])), Value: fmt.Sprintf("testing-taint-value-%s", string(uuid.NewUUID())), Effect: v1.TaintEffectPreferNoSchedule, }
shorten scheduling priorities taint key
kubernetes_kubernetes
train
go
d142612c016d8a9c9dc9cc986c6e1fce8aff5bac
diff --git a/lib/dynflow/world.rb b/lib/dynflow/world.rb index <HASH>..<HASH> 100644 --- a/lib/dynflow/world.rb +++ b/lib/dynflow/world.rb @@ -21,7 +21,7 @@ module Dynflow @executor = config_for_world.executor @action_classes = config_for_world.action_classes @auto_rescue = config_for_world.auto_rescue - @exit_on_terminate = config_for_world.exit_on_terminate + @exit_on_terminate = Concurrent::AtomicBoolean.new(config_for_world.exit_on_terminate) @connector = config_for_world.connector @middleware = Middleware::World.new @middleware.use Middleware::Common::Transaction if @transaction_adapter @@ -48,7 +48,7 @@ module Dynflow if config_for_world.auto_terminate at_exit do - @exit_on_terminate = false # make sure we don't terminate twice + @exit_on_terminate.make_false # make sure we don't terminate twice self.terminate.wait end end @@ -239,7 +239,7 @@ module Dynflow logger.fatal(e) end end.on_completion do - Kernel.exit if @exit_on_terminate + Thread.new { Kernel.exit } if @exit_on_terminate.true? end end
Fix world auto-termination Due to too general rescue in concurrent ruby, we need to call the exit in separate thread, otherwise the SystemExit error gets caught and nothing happens. Also, I've made the work with `@exit_on_terminate` thread-safe, which should not be a case in MRI, but it's potentially unsynchronized in future Ruby implementations.
Dynflow_dynflow
train
rb
dba2a150d21d9022a665edf661b5465b2a572b26
diff --git a/src/frontend/org/voltdb/utils/CatalogUtil.java b/src/frontend/org/voltdb/utils/CatalogUtil.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/utils/CatalogUtil.java +++ b/src/frontend/org/voltdb/utils/CatalogUtil.java @@ -124,7 +124,7 @@ public abstract class CatalogUtil { private static final VoltLogger hostLog = new VoltLogger("HOST"); // The minimum version of catalog that's compatible with this version of Volt - public static final int[] minCompatibleVersion = {3, 5}; + public static final int[] minCompatibleVersion = {3, 6, 1}; public static final String CATALOG_FILENAME = "catalog.txt"; public static final String CATALOG_BUILDINFO_FILENAME = "buildinfo.txt";
ENG-<I>: Make compatible catalog version > <I>. Using <I> for now.
VoltDB_voltdb
train
java
1be42436dcce24c096efa4f4a6fd287beaa63ade
diff --git a/vyper/context/types/value/array_value.py b/vyper/context/types/value/array_value.py index <HASH>..<HASH> 100644 --- a/vyper/context/types/value/array_value.py +++ b/vyper/context/types/value/array_value.py @@ -66,7 +66,9 @@ class _ArrayValueDefinition(ValueTypeDefinition): # enough additional slots to store the data if it uses the max available length # because this data type is single-bytes, we make it so it takes the max 32 byte # boundary as it's size, instead of giving it a size that is not cleanly divisble by 32 - return 32 + math.ceil(self.length / 32) * 32 + + # TODO adding 64 here instead of 32 to be compatible with parser - fix this! + return 64 + math.ceil(self.length / 32) * 32 @property def canonical_type(self) -> str:
fix: add <I> bytes to size of Bytes and String for `parser` compatibility
ethereum_vyper
train
py
466f7517bdc1f9ce473f08d06da6fb5d14c2a6d0
diff --git a/lib/URLUtil.php b/lib/URLUtil.php index <HASH>..<HASH> 100644 --- a/lib/URLUtil.php +++ b/lib/URLUtil.php @@ -110,7 +110,7 @@ class URLUtil { static function splitPath($path) { $matches = array(); - if(preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u',$path,$matches)) { + if(preg_match('/^(?:(.*)\/+)?([^\/]+)\/?$/u',$path,$matches)) { return array($matches[1],$matches[2]); } else { return array(null,null);
Simplify the `splitPath` regular expression.
sabre-io_http
train
php
a0d87989cf53c070f971b0c46a44ede70a6d89f9
diff --git a/modules/ve/ce/nodes/ve.ce.TextNode.js b/modules/ve/ce/nodes/ve.ce.TextNode.js index <HASH>..<HASH> 100644 --- a/modules/ve/ce/nodes/ve.ce.TextNode.js +++ b/modules/ve/ce/nodes/ve.ce.TextNode.js @@ -103,13 +103,13 @@ ve.ce.TextNode.annotationRenderers = { }, 'link/extLink': { 'open': function( data ) { - return '<a href="' + mw.html.escape( data.href || '#' ) + '">'; + return '<a href="#">'; }, 'close': '</a>' }, 'link/wikiLink': { 'open': function( data ) { - return '<a href="' + mw.html.escape( mw.util.wikiGetLink( data.title || '' ) ) + '">'; + return '<a href="#">'; }, 'close': '</a>' },
You know what, just don't render hrefs, these links aren't clickable anyway Change-Id: If5f0c9a2fa<I>f<I>fe<I>aba9a<I>a3c9
wikimedia_parsoid
train
js
10a53b7f5dc54032fbaa5a73b04da3b9801953fe
diff --git a/superset-frontend/src/middleware/loggerMiddleware.js b/superset-frontend/src/middleware/loggerMiddleware.js index <HASH>..<HASH> 100644 --- a/superset-frontend/src/middleware/loggerMiddleware.js +++ b/superset-frontend/src/middleware/loggerMiddleware.js @@ -116,7 +116,7 @@ const loggerMiddleware = store => next => action => { }; } - if (eventData.target_id && dashboardLayout.present) { + if (eventData.target_id && dashboardLayout?.present?.[eventData.target_id]) { const { meta } = dashboardLayout.present[eventData.target_id]; // chart name or tab/header text eventData.target_name = meta.chartId ? meta.sliceName : meta.text;
fix: Add extra check to loggerMiddleware (#<I>) * Add extra check * Update superset-frontend/src/middleware/loggerMiddleware.js
apache_incubator-superset
train
js
6095a348e1b15a1dc23e3d70c2f7956b22f80c3f
diff --git a/src/main/java/com/goebl/david/Webb.java b/src/main/java/com/goebl/david/Webb.java index <HASH>..<HASH> 100755 --- a/src/main/java/com/goebl/david/Webb.java +++ b/src/main/java/com/goebl/david/Webb.java @@ -50,7 +50,7 @@ public class Webb { HostnameVerifier hostnameVerifier; RetryManager retryManager; - private Webb() {} + protected Webb() {} /** * Create an instance which can be reused for multiple requests in the same Thread. diff --git a/src/main/java/com/goebl/david/WebbUtils.java b/src/main/java/com/goebl/david/WebbUtils.java index <HASH>..<HASH> 100755 --- a/src/main/java/com/goebl/david/WebbUtils.java +++ b/src/main/java/com/goebl/david/WebbUtils.java @@ -31,7 +31,7 @@ import java.util.zip.InflaterInputStream; */ public class WebbUtils { - private WebbUtils() {} + protected WebbUtils() {} /** * Convert a Map to a query string.
Change Webb and WebbUtils to provide a protected constructor. Private constructor does not allow these classes to be inherited. There are valid cases for extending the behaviour, but having a private constructor does not allow it.
hgoebl_DavidWebb
train
java,java
c4a3c5b2ef86bb1d1dc3a56d13515c143ed8b057
diff --git a/upup/pkg/fi/cloudup/dns.go b/upup/pkg/fi/cloudup/dns.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/cloudup/dns.go +++ b/upup/pkg/fi/cloudup/dns.go @@ -67,6 +67,11 @@ func findZone(cluster *api.Cluster, cloud fi.Cloud) (dnsprovider.Zone, error) { } if len(matches) > 1 { + glog.Infof("Found multiple DNS Zones matching %q, please specify --dns-zone=<id> to indicate the one you want", cluster.Spec.DNSZone) + for _, zone := range zones { + id := zone.ID() + glog.Infof("\t--dns-zone=%s", id) + } return nil, fmt.Errorf("found multiple DNS Zones matching %q", cluster.Spec.DNSZone) }
Suggest the --dns-zone flag when we have multiple zones Issue #<I>
kubernetes_kops
train
go
db00c874e04f8cc1daa4259b374781089d753bad
diff --git a/service/ImageUploader.php b/service/ImageUploader.php index <HASH>..<HASH> 100644 --- a/service/ImageUploader.php +++ b/service/ImageUploader.php @@ -137,7 +137,10 @@ class ImageUploader */ private function getUniqueName($fileName) { - return microtime(true) . strtolower(preg_replace('/([A-Z]+)/', "-$1", urlencode($fileName))); + $prefix = preg_replace('/[^0-9]/', '', microtime(true)); + $name = preg_replace('/([A-Z]+)/', "-$1", pathinfo($fileName, PATHINFO_FILENAME)); + $extension = pathinfo($fileName, PATHINFO_EXTENSION); + return $prefix . strtolower($name . '.' . $extension); }
fix: get unique name (fixes uppercased file extensions & creates nicer file name)
fluid-cms_admin-module
train
php
98dca51d6da6857fa6f3942d3bc9e2e5f6bfeb1d
diff --git a/molgenis-gavin/src/main/resources/js/gavin.js b/molgenis-gavin/src/main/resources/js/gavin.js index <HASH>..<HASH> 100644 --- a/molgenis-gavin/src/main/resources/js/gavin.js +++ b/molgenis-gavin/src/main/resources/js/gavin.js @@ -24,7 +24,7 @@ $(function () { var annotator = $(e.target).data('name'); React.unmountComponentAtNode(formNode); React.render(molgenis.ui.Form({ - entity: 'settings_' + annotator, + entity: 'sys_set_' + annotator, entityInstance: annotator, mode: 'edit', modal: true,
FIX Gavin settings entity name (#<I>)
molgenis_molgenis
train
js
31105e47d39cf09ff906ddc30e87861d5b752ee9
diff --git a/src/completer.js b/src/completer.js index <HASH>..<HASH> 100644 --- a/src/completer.js +++ b/src/completer.js @@ -176,6 +176,7 @@ // strategy - The Strategy object. // e - Click or keydown event object. select: function (value, strategy, e) { + this._term = null; this.adapter.select(value, strategy, e); this.fire('change').fire('textComplete:select', value, strategy); this.adapter.focus();
Reset _term after selected. Conflicts: src/completer.js Closes #<I>
yuku_textcomplete
train
js