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
ade3a316166d3c4c362becd7880e60bd9387b259
diff --git a/courriers/management/commands/mailjet_sync_unsubscribed.py b/courriers/management/commands/mailjet_sync_unsubscribed.py index <HASH>..<HASH> 100644 --- a/courriers/management/commands/mailjet_sync_unsubscribed.py +++ b/courriers/management/commands/mailjet_sync_unsubscribed.py @@ -29,11 +29,11 @@ class Command(BaseCommand): .values_list('email', flat=True) .order_by('-unsubscribed_at')) - mailjet_contacts = backend.mailjet_api.contact.list() + mailjet_contacts = backend.mailjet_api.contact.list(unsub=1) mailjet_users = [contact['email'] for contact in mailjet_contacts['result']] - diff = list(set(unsubscribed_users) - set(mailjet_users)) + diff = list(set(mailjet_users) - set(unsubscribed_users)) print "%d contacts to unsubscribe" % len(diff)
Select only unsubscribed contacts from mailjet on sync script
ulule_django-courriers
train
py
68a6a72aaa3095c5a51a62d97ff41eebfa22ebf4
diff --git a/lib/normalize.js b/lib/normalize.js index <HASH>..<HASH> 100644 --- a/lib/normalize.js +++ b/lib/normalize.js @@ -30,7 +30,7 @@ var toplevel = [ 'integrations', 'anonymousId', 'timestamp', - 'context', + 'context' ]; /**
normalize: remove trailing comma
segmentio_analytics.js-core
train
js
a0aa15a41efb55144ce14bbeba0ac22e72bd9869
diff --git a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php +++ b/src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php @@ -299,7 +299,8 @@ class ReflectionExtractorTest extends TestCase */ public function testExtractTypeConstructor(string $class, string $property, array $type) { - // check that constructor extractions works by default, and if passed in via context. Check that null is returned if constructor extraction is disabled + /* Check that constructor extractions works by default, and if passed in via context. + Check that null is returned if constructor extraction is disabled */ $this->assertEquals($type, $this->extractor->getTypes($class, $property, [])); $this->assertEquals($type, $this->extractor->getTypes($class, $property, ['enable_constructor_extraction' => true])); $this->assertNull($this->extractor->getTypes($class, $property, ['enable_constructor_extraction' => false]));
Update src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php
symfony_symfony
train
php
7ef0b83c0cc7c4f9093e2a8fc0303e875d35c15c
diff --git a/pkg/codegen/docs/gen.go b/pkg/codegen/docs/gen.go index <HASH>..<HASH> 100644 --- a/pkg/codegen/docs/gen.go +++ b/pkg/codegen/docs/gen.go @@ -117,7 +117,9 @@ func titleLookup(shortName string) (string, bool) { "mongodbatlas": "MongoDB Atlas", "mysql": "MySQL", "newrelic": "New Relic", - "nginx-ingress-controller-helm": "NGINX Ingress Controller (Helm)", + "kubernetes-ingress-nginx": "NGINX Ingress Controller (Helm)", + "kubernetes-coredns": "CoreDNS (Helm)", + "kubernetes-cert-manager": "Jetstack Cert Manager (Helm)", "nomad": "Nomad", "ns1": "NS1", "okta": "Okta",
Ensuring Helm based components for CodeDNS and Cert Manager are available in title Lookups" (#<I>)
pulumi_pulumi
train
go
109cdcc6f914540d20a94ce8f55dd44b0955cb54
diff --git a/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py index <HASH>..<HASH> 100755 --- a/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py +++ b/api/src/opentrons/drivers/smoothie_drivers/driver_3_0.py @@ -500,11 +500,7 @@ class SmoothieDriver_3_0_0: if res is None: raise ValueError( f'{key} was not updated to {value} on {axis} axis') - # ensure smoothie received code and changed value through - # return message. Format of return message: - # <Axis> (or E for endstop) updated <Value> - arr_result = res.strip().split(' ') - res_msg[axis][str(arr_result[0])] = float(arr_result[2]) + res_msg[axis][key] = value return res_msg
fix(api): dont parse the smoothie response to udpate_pipette_config (#<I>) This parsing is unreliable because we have the smoothie's echo mode on and our multiple new lines sometimes stomp the actual response from the smoothie. This raises an IndexError and breaks pipette config updating and makes the system unreliable.
Opentrons_opentrons
train
py
7b40ac53a61be7a614a2c52754b6d5faaa3fe165
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ config = dict(name='scraperwiki', try: from setuptools import setup - config['install_requires'] = ['requests', + config['install_requires'] = ['requests', 'six', 'sqlalchemy', 'alembic'], except ImportError: pass
Add six to install requirements in setup.py
scraperwiki_scraperwiki-python
train
py
5163269eb24594efddfa423326e089da4057f393
diff --git a/test/filters_test.rb b/test/filters_test.rb index <HASH>..<HASH> 100644 --- a/test/filters_test.rb +++ b/test/filters_test.rb @@ -117,7 +117,7 @@ class FiltersTest < Haml::TestCase end end - test "interpolated code should use be escaped in escape_html is set" do + test "interpolated code should be escaped if escape_html is set" do assert_equal "&lt;script&gt;evil&lt;/script&gt;\n", render(":plain\n \#{'<script>evil</script>'}", :escape_html => true) end
Is this what you mean? [ci skip]
haml_haml
train
rb
16801a3106a2dedbcb45d1e153a1ef7e7d321b2a
diff --git a/lib/linux_admin/disk.rb b/lib/linux_admin/disk.rb index <HASH>..<HASH> 100644 --- a/lib/linux_admin/disk.rb +++ b/lib/linux_admin/disk.rb @@ -69,8 +69,8 @@ module LinuxAdmin size = nil out = run!(cmd(:fdisk), :params => {"-l" => nil}).output out.each_line { |l| - if l =~ /Disk #{path}: ([0-9\.]*) ([KMG])B.*/ - size = str_to_bytes($1, $2) + if l =~ /Disk #{path}: .*B, (\d+) bytes/ + size = $1.to_f break end }
Changed Disk#size to parse the bytes value directly from the fdisk(8) output. Parsing the converted value was causing an issue as fdisk was using SI units and the rails methods were expecting binary units. For example, 5MB was being converted to 5 * <I> * <I> bytes by rails when fdisk intended the value to be 5 * <I> * <I> bytes. This change avoids the confusion by parsing the bytes value directly. <URL>
ManageIQ_linux_admin
train
rb
c753a3be38ca33c9c99882b2078c02513f42ca94
diff --git a/src/main/java/org/osgl/util/Token.java b/src/main/java/org/osgl/util/Token.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/osgl/util/Token.java +++ b/src/main/java/org/osgl/util/Token.java @@ -91,10 +91,22 @@ public class Token implements Serializable { private long due; private List<String> payload = new ArrayList<String>(); + /** + * Return the ID of the token + * @return the token ID + */ public String id() { return id; } + /** + * Return the payload of the token + * @return the token payload + */ + public List<String> payload() { + return C.list(payload); + } + public boolean expired() { return due <= $.ms(); }
add payload() method to Token
osglworks_java-tool-ext
train
java
675c7b542f05865da96b738ae7574b46244b7f8c
diff --git a/cas/backends.py b/cas/backends.py index <HASH>..<HASH> 100644 --- a/cas/backends.py +++ b/cas/backends.py @@ -181,8 +181,8 @@ _verify = _PROTOCOLS[settings.CAS_VERSION] def _get_pgt_iou_mapping(pgt_iou): """ Returns the instance of PgtIou -> Pgt mapping which is associated with the provided pgt_iou token. - Because this mapping is created in a different request which the CAS server makes to the proxy callback url which - has completed before this call it may not be found in the database by this calling thread, hence the attempt to get + Because this mapping is created in a different request which the CAS server makes to the proxy callback url, the + PGTIOU->PGT mapping might not be found yet in the database by this calling thread, hence the attempt to get the ticket is retried for up to 5 seconds. This should be handled some better way.
Tidied up the grammar in the _get_pgt_iou_mapping documentation.
kstateome_django-cas
train
py
078490dfb824defbae0d5a68b0bce3139731519d
diff --git a/core/src/test/java/com/orientechnologies/orient/core/sql/executor/OUpdateStatementExecutionTest.java b/core/src/test/java/com/orientechnologies/orient/core/sql/executor/OUpdateStatementExecutionTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/com/orientechnologies/orient/core/sql/executor/OUpdateStatementExecutionTest.java +++ b/core/src/test/java/com/orientechnologies/orient/core/sql/executor/OUpdateStatementExecutionTest.java @@ -241,7 +241,7 @@ public class OUpdateStatementExecutionTest { } @Test public void testSetOnMap() { - String className = "testSetOnList2"; + String className = "testSetOnMap"; db.getMetadata().getSchema().createClass(className); for (int i = 0; i < 10; i++) { ODocument doc = db.newInstance(className); @@ -278,7 +278,7 @@ public class OUpdateStatementExecutionTest { found = true; }else{ Map<String, String> tags = new HashMap<>(); - tags.put("foo", "foox"); + tags.put("foo", "foo"); tags.put("bar", "bar"); tags.put("baz", "baz"); Assert.assertEquals(tags, item.getProperty("tags"));
Fix test case for UPDATE statement
orientechnologies_orientdb
train
java
ba2730fce3bb8d15005dd79fd4ccccde55831427
diff --git a/haproxy_exporter.go b/haproxy_exporter.go index <HASH>..<HASH> 100644 --- a/haproxy_exporter.go +++ b/haproxy_exporter.go @@ -212,6 +212,7 @@ func NewExporter(uri string, sslVerify bool, selectedServerMetrics map[int]*prom 16: newBackendMetric("redispatch_warnings_total", "Total of redispatch warnings.", nil), 17: newBackendMetric("up", "Current health status of the backend (1 = UP, 0 = DOWN).", nil), 18: newBackendMetric("weight", "Total weight of the servers in the backend.", nil), + 19: newBackendMetric("current_server", "Current number of active servers", nil), 33: newBackendMetric("current_session_rate", "Current number of sessions per second over last elapsed second.", nil), 35: newBackendMetric("max_session_rate", "Maximum number of sessions per second.", nil), 39: newBackendMetric("http_responses_total", "Total of HTTP responses.", prometheus.Labels{"code": "1xx"}),
Export current number of active servers (#<I>)
prometheus_haproxy_exporter
train
go
bbee0a8f72759df333d655de7e6cb583227a3477
diff --git a/confit.py b/confit.py index <HASH>..<HASH> 100644 --- a/confit.py +++ b/confit.py @@ -750,13 +750,18 @@ class Configuration(RootView): os.makedirs(appdir) return appdir - def dump(self, filename): + def dump(self, filename, full=True): """ Dump the Configuration object to a YAML file. The order of the keys is determined from the default configuration file. All keys not in the default configuration will be appended to the end of the file. + :param filename: The file to dump the configuration to + :type filename: unicode + :param full: Dump settings that don't differ from the defaults + as well + """ out_dict = OrderedDict() default_conf = next(x for x in self.sources if x.default) @@ -767,6 +772,10 @@ class Configuration(RootView): new_keys = [x for x in self.keys() if not x in default_keys] out_keys = default_keys + new_keys for key in out_keys: + # Skip entries unchanged from default config + if (not full and key in default_keys + and self[key].get() == default_conf[key]): + continue try: out_dict[key] = self[key].as_ordereddict() except ConfigTypeError:
Add option to toggle dumping of settings unchanged from defaults
sampsyo_confuse
train
py
2ecb5527c11f30e833be53c06118f57e3d73a62d
diff --git a/tests/test_apps/matviewbenchmark/src/matviewbenchmark/MaterializedViewBenchmark.java b/tests/test_apps/matviewbenchmark/src/matviewbenchmark/MaterializedViewBenchmark.java index <HASH>..<HASH> 100644 --- a/tests/test_apps/matviewbenchmark/src/matviewbenchmark/MaterializedViewBenchmark.java +++ b/tests/test_apps/matviewbenchmark/src/matviewbenchmark/MaterializedViewBenchmark.java @@ -264,7 +264,6 @@ public class MaterializedViewBenchmark { stats.getStartTimestamp(), savedThroughput, savedExecute)); - savedThroughput = savedExecute = 0; } else { savedThroughput = newThroughput; savedExecute = newExecute; @@ -589,6 +588,9 @@ public class MaterializedViewBenchmark { System.out.print(HORIZONTAL_RULE); runHalf("noMatView", fw); System.out.print(HORIZONTAL_RULE); + + // reset class variables so that diff is not written to the csv file + insertThroughput = insertExecute = deleteThroughput = deleteExecute = 0; runHalf("minMatView", fw); benchmarkActive = false;
ENG-<I> Moved class var reset location for clarity
VoltDB_voltdb
train
java
5b5bab9650e00bb5f7c2920a5e3d4174a37ad6c2
diff --git a/spec/sinatra-mongo_spec.rb b/spec/sinatra-mongo_spec.rb index <HASH>..<HASH> 100644 --- a/spec/sinatra-mongo_spec.rb +++ b/spec/sinatra-mongo_spec.rb @@ -21,16 +21,14 @@ describe "Sinatra::MongoExtension" do context 'mongo_url is set' do before(:each) do - #@app.mongo = 'mongo://127.0.0.1:1111/test' - #@connection = mock('connection') - #@mongo = mock('mongo') - #Mongo::Connection.stub!(:new).and_return(@connection) - #@connection.stub!(:db).with('test').and_return(@mongo) + @mongo_url = 'mongo://127.0.0.1:27017/test' + @app.mongo = @mongo_url end it 'creates the Mongo::DB instance with the supplied uri' do - pending - #@app.mongo.connection.port.should == 1111 + @app.mongo.connection.host.should == '127.0.0.1' + @app.mongo.connection.port.should == 27017 + @app.mongo.name.should == 'test' end end end
Spec out that mongo uses the mongo_url when it's set
technicalpickles_sinatra-mongo
train
rb
54553f9f59ed38798e6dc3270a77dd39b91c3184
diff --git a/salt/minion.py b/salt/minion.py index <HASH>..<HASH> 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1198,10 +1198,7 @@ class Minion(MinionBase): 'the worker_threads value.').format(jid) log.warn(msg) return '' - if isinstance(ret_val, string_types) and not ret_val: - # The master AES key has changed, reauth - self.authenticate() - ret_val = channel.send(load) + log.trace('ret_val = {0}'.format(ret_val)) return ret_val
Since this was changed to use channels this is no longer necessary, since the channel does this under the hood
saltstack_salt
train
py
c04872d00a26e9bf0f48eeacb360b37ce0fba01e
diff --git a/semantic_release/pypi.py b/semantic_release/pypi.py index <HASH>..<HASH> 100644 --- a/semantic_release/pypi.py +++ b/semantic_release/pypi.py @@ -1,6 +1,7 @@ """PyPI """ from invoke import run +from twine import settings from twine.commands import upload as twine_upload @@ -20,17 +21,11 @@ def upload_to_pypi( """ run('python setup.py {}'.format(dists)) twine_upload.upload( - dists=['dist/*'], - sign=False, - identity=None, - username=username, - password=password, - comment=None, - sign_with='gpg', - config_file='~/.pypirc', - skip_existing=skip_existing, - cert=None, - client_cert=None, - repository_url=None + settings.Settings( + username=username, + password=password, + skip_existing=skip_existing, + ), + ['dist/*'], ) run('rm -rf build dist')
fix: Use new interface for twine
relekang_python-semantic-release
train
py
8233e0c15eb6bd32c3ff8351fa399524dbb603e2
diff --git a/lib/instrumentation/transaction.js b/lib/instrumentation/transaction.js index <HASH>..<HASH> 100644 --- a/lib/instrumentation/transaction.js +++ b/lib/instrumentation/transaction.js @@ -58,7 +58,7 @@ function Transaction (agent, name, type) { this.type = type || 'custom' this.result = 'success' this.traces = [] - this._buildTraces = [] + this._builtTraces = [] this.ended = false this._abortTime = 0 this._agent = agent @@ -95,7 +95,7 @@ Transaction.prototype.buildTrace = function () { } var trace = new Trace(this) - this._buildTraces.push(trace) + this._builtTraces.push(trace) return trace } @@ -141,7 +141,7 @@ Transaction.prototype.end = function () { if (!this._defaultName && this.req) this.setDefaultNameFromRequest() - this._buildTraces.forEach(function (trace) { + this._builtTraces.forEach(function (trace) { if (trace.ended || !trace.started) return trace.truncate() })
refactor(transaction): fix typo
elastic_apm-agent-nodejs
train
js
549113a449458facfd72cb9f383bb82869540052
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ CHANGELOG = read_file("CHANGELOG.rst") setup( name="django-tinymce", - version="3.0.0", + version="3.0.1", packages=find_packages(), include_package_data=True, author="Aljosa Mohorovic",
Preparing release <I>
aljosa_django-tinymce
train
py
2f4acfd8219c317593ffaaed5b69d8542c0bef2b
diff --git a/src/main/java/org/asteriskjava/pbx/internal/core/ChannelProxy.java b/src/main/java/org/asteriskjava/pbx/internal/core/ChannelProxy.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/asteriskjava/pbx/internal/core/ChannelProxy.java +++ b/src/main/java/org/asteriskjava/pbx/internal/core/ChannelProxy.java @@ -125,13 +125,17 @@ public class ChannelProxy implements Channel, ChannelHangupListener @Override public void addHangupListener(ChannelHangupListener listener) { - this.listeners.add(listener); + if (!listeners.contains(listener)) + { + this.listeners.add(listener); + } } @Override public void removeListener(ChannelHangupListener listener) { + this.listeners.remove(listener); }
protect channely proxy from duplicate listeners
asterisk-java_asterisk-java
train
java
78870f04a7823a03cf1c642b0e111187293f49b1
diff --git a/markdownlint.js b/markdownlint.js index <HASH>..<HASH> 100755 --- a/markdownlint.js +++ b/markdownlint.js @@ -13,11 +13,27 @@ var markdownlint = require('markdownlint'); var path = require('path'); var glob = require('glob'); +function readJSONFrom(file) { + return JSON.parse(fs.readFileSync(file)); +} + function readConfiguration(args) { var config = rc('markdownlint', {}); - if (args.config) { + var projectConfigFile = '.markdownlint.json'; + var userConfigFile = args.config; + try { + fs.accessSync(projectConfigFile, fs.R_OK); + var projectConfig = readJSONFrom(projectConfigFile); + config = extend(config, projectConfig); + } catch (err) { + } + // Normally parsing this file is not needed, + // because it is already parsed by rc package. + // However I have to do it to overwrite configuration + // from .markdownlint.json. + if (userConfigFile) { try { - var userConfig = JSON.parse(fs.readFileSync(args.config)); + var userConfig = readJSONFrom(userConfigFile); config = extend(config, userConfig); } catch (e) { console.warn('Cannot read or parse config file', args.config);
Fix #3. Read configuration also from .markdownlint.json
igorshubovych_markdownlint-cli
train
js
99185f00045df71b080746b1d0a3fc0abdf36af2
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -639,8 +639,6 @@ module ActiveRecord if association.options[:through] add_join_records(rows, row, HasManyThroughProxy.new(association)) end - when :has_and_belongs_to_many - add_join_records(rows, row, HABTMProxy.new(association)) end end end @@ -674,16 +672,6 @@ module ActiveRecord end end - class HABTMProxy < ReflectionProxy # :nodoc: - def rhs_key - @association.association_foreign_key - end - - def lhs_key - @association.foreign_key - end - end - private def primary_key_name @primary_key_name ||= model_class && model_class.primary_key
remove HABTM special cases from the fixtures
rails_rails
train
rb
58f8232f2b553a8dd0c70c39320e5d134375adc9
diff --git a/packages/heroku-ci/commands/ci/debug.js b/packages/heroku-ci/commands/ci/debug.js index <HASH>..<HASH> 100644 --- a/packages/heroku-ci/commands/ci/debug.js +++ b/packages/heroku-ci/commands/ci/debug.js @@ -7,7 +7,7 @@ const source = require('../../lib/source') const TestRun = require('../../lib/test-run') // Default command. Run setup, source profile.d scripts and open a bash session -const SETUP_COMMAND = 'sprettur setup && for f in .profile.d/*; do source $f; done' +const SETUP_COMMAND = 'ci setup && eval $(ci env)' const COMMAND = `${SETUP_COMMAND} && bash` function* run (context, heroku) {
Merge pull request #<I> from heroku/nicer-commands Use ci commands for debug
heroku_cli
train
js
3150b5a9887a04804184c6674a153ee020ddb849
diff --git a/src/aria/utils/SynEvents.js b/src/aria/utils/SynEvents.js index <HASH>..<HASH> 100644 --- a/src/aria/utils/SynEvents.js +++ b/src/aria/utils/SynEvents.js @@ -1452,7 +1452,13 @@ require("./Dom"); // gets the selection of an input or textarea getSelection = function( el ) { // use selectionStart if we can - if ( el.selectionStart !== undefined ) { + var selectionStart; + try { + selectionStart = el.selectionStart; + } catch (e) { + // selectionStart not available, nothing to do + } + if ( selectionStart !== undefined ) { // this is for opera, so we don't have to focus to type how we think we would if ( Aria.$window.document.activeElement && Aria.$window.document.activeElement != el && el.selectionStart == el.selectionEnd && el.selectionStart === 0 ) { return {
fix #<I> Prevent SynEvent from crashing FF test on getSelection
ariatemplates_ariatemplates
train
js
d44cc1e312d3d3546f2cd837aefa0b7c1fece26f
diff --git a/tests/test_naxxramas.py b/tests/test_naxxramas.py index <HASH>..<HASH> 100644 --- a/tests/test_naxxramas.py +++ b/tests/test_naxxramas.py @@ -280,6 +280,29 @@ def test_nerubar_weblord(): assert perdition1.cost == perdition2.cost == 3 +def test_poison_seeds(): + game = prepare_game() + abomination = game.player1.give("EX1_097") + abomination.play() + game.player1.give(WISP).play() + game.player1.give(WISP).play() + game.player1.give(WISP).play() + game.end_turn() + + game.player2.give(WISP).play() + game.player2.give(WISP).play() + game.player2.give(WISP).play() + game.player2.give(WISP).play() + seeds = game.player2.give("FP1_019") + seeds.play() + + assert len(game.board) == 4 + 4 + assert game.player1.hero.health == 30 - 2 + assert game.player2.hero.health == 30 - 2 + assert game.player1.field == ["FP1_019t"] * 4 + assert game.player2.field == ["FP1_019t"] * 4 + + def test_reincarnate(): game = prepare_game()
Add a test for Poison Seeds
jleclanche_fireplace
train
py
42ae2218b3dbe925618e447d8945ad1fbff4bce6
diff --git a/bika/lims/adapters/referencewidgetvocabulary.py b/bika/lims/adapters/referencewidgetvocabulary.py index <HASH>..<HASH> 100644 --- a/bika/lims/adapters/referencewidgetvocabulary.py +++ b/bika/lims/adapters/referencewidgetvocabulary.py @@ -54,6 +54,8 @@ class DefaultReferenceWidgetVocabulary(object): schema = instance.Schema() if fieldname in schema: value = schema[fieldname].get(instance) + if callable(value): + value = value() if value and value.lower().find(searchTerm) > -1: _brains.append(p) break
ReferenceWidget "SearchableText" index failure fixed Adding SearchableText as a ReferenceWidget combogrid search field caused failure because SearchableText was a method not an attribute.
senaite_senaite.core
train
py
7aeae0d4c3304a54f493e0827bb32dce945f0fb0
diff --git a/src/java/com/threerings/media/MediaPanel.java b/src/java/com/threerings/media/MediaPanel.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/media/MediaPanel.java +++ b/src/java/com/threerings/media/MediaPanel.java @@ -1,5 +1,5 @@ // -// $Id: MediaPanel.java,v 1.31 2003/04/01 03:38:03 mdb Exp $ +// $Id: MediaPanel.java,v 1.32 2003/04/15 00:39:20 mdb Exp $ package com.threerings.media; @@ -158,7 +158,8 @@ public class MediaPanel extends JComponent } /** - * Adds an animation to this panel. + * Adds an animation to this panel. Animations are automatically + * removed when they finish. */ public void addAnimation (Animation anim) { @@ -166,9 +167,11 @@ public class MediaPanel extends JComponent } /** - * Removes an animation from this panel. + * Aborts a currently running animation and removes it from this + * panel. Animations are normally automatically removed when they + * finish. */ - public void removeAnimation (Animation anim) + public void abortAnimation (Animation anim) { _animmgr.unregisterAnimation(anim); }
Change removeAnimation() to abortAnimation(); that's what is happening. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
fad06ec5059a1641637750ab1bb4eb4a7492825f
diff --git a/Product/ProductPriceManager.php b/Product/ProductPriceManager.php index <HASH>..<HASH> 100644 --- a/Product/ProductPriceManager.php +++ b/Product/ProductPriceManager.php @@ -79,28 +79,6 @@ class ProductPriceManager implements ProductPriceManagerInterface } /** - * Returns the special price for the product by a given currency - * - * @param ProductInterface $product - * @param null|string $currency - * - * @return null|\Sulu\Bundle\ProductBundle\Entity\ProductPrice - */ - public function getSpecialPriceForCurrency(ProductInterface $product, $currency = null) - { - $currency = $currency ?: $this->defaultCurrency; - if ($prices = $product->getSpecialPrices()) { - foreach ($prices as $price) { - if ($price->getCurrency()->getCode() == $currency) { - return $price; - } - } - } - - return null; - } - - /** * Helper function to get a formatted price for a given currency and locale * * @param Integer $price
delete last commit (getSpecialPriceForCurrency)
sulu_SuluProductBundle
train
php
efe4aa7e52a54a49d18377bc4501d9f2b4562cd2
diff --git a/spec/support/concerns/content_type.rb b/spec/support/concerns/content_type.rb index <HASH>..<HASH> 100644 --- a/spec/support/concerns/content_type.rb +++ b/spec/support/concerns/content_type.rb @@ -15,6 +15,6 @@ shared_examples_for :content_type do end it '#respond_to?' do - expect(build(klass)).to respond_to(:column) + expect(build(klass)).to respond_to(:column, :parent, :content_type_is?) end end
Add more respond_to checks for the content type shared examples.
udongo_udongo
train
rb
9122c3cc55cf4c0218d954fa22a678e89e60782e
diff --git a/integration-test/src/test/java/org/jboss/pnc/integration/BuildTasksRestTest.java b/integration-test/src/test/java/org/jboss/pnc/integration/BuildTasksRestTest.java index <HASH>..<HASH> 100644 --- a/integration-test/src/test/java/org/jboss/pnc/integration/BuildTasksRestTest.java +++ b/integration-test/src/test/java/org/jboss/pnc/integration/BuildTasksRestTest.java @@ -39,6 +39,7 @@ import org.jboss.pnc.test.category.ContainerTest; import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -73,6 +74,7 @@ public class BuildTasksRestTest { return enterpriseArchive; } + @Ignore //TODO fails on CI due to missing Auth token @Test @RunAsClient public void shouldTriggerBuildExecution() {
Ignore test. It fails due to missing auth.
project-ncl_pnc
train
java
4606aa3b7effe610952e9ae35f563fe5b25df992
diff --git a/aws/resource_aws_ec2_fleet.go b/aws/resource_aws_ec2_fleet.go index <HASH>..<HASH> 100644 --- a/aws/resource_aws_ec2_fleet.go +++ b/aws/resource_aws_ec2_fleet.go @@ -239,10 +239,7 @@ func resourceAwsEc2Fleet() *schema.Resource { return false } totalTargetCapacityO, _ := d.GetChange("target_capacity_specification.0.total_target_capacity") - if oldInt != totalTargetCapacityO.(int) { - return false - } - return true + return oldInt != totalTargetCapacityO.(int) }, }, "spot_target_capacity": { @@ -270,10 +267,7 @@ func resourceAwsEc2Fleet() *schema.Resource { return false } totalTargetCapacityO, _ := d.GetChange("target_capacity_specification.0.total_target_capacity") - if oldInt != totalTargetCapacityO.(int) { - return false - } - return true + return oldInt != totalTargetCapacityO.(int) }, }, "total_target_capacity": {
Fix gosimple ec2 issues
terraform-providers_terraform-provider-aws
train
go
f2e1830fafb7e85bfed955636989112f0ec308d2
diff --git a/src/Administration/Resources/administration/src/module/sw-settings-custom-field/page/sw-settings-custom-field-set-create/index.js b/src/Administration/Resources/administration/src/module/sw-settings-custom-field/page/sw-settings-custom-field-set-create/index.js index <HASH>..<HASH> 100644 --- a/src/Administration/Resources/administration/src/module/sw-settings-custom-field/page/sw-settings-custom-field-set-create/index.js +++ b/src/Administration/Resources/administration/src/module/sw-settings-custom-field/page/sw-settings-custom-field-set-create/index.js @@ -29,11 +29,13 @@ Component.extend('sw-settings-custom-field-set-create', 'sw-settings-custom-fiel }); }, onSave() { + const superRef = this.$super; + // Check if a set with the same name exists const criteria = CriteriaFactory.equals('name', this.set.name); return this.customFieldSetStore.getList({ criteria }).then((res) => { if (res.total === 0) { - this.$super('onSave'); + superRef('onSave'); return; }
NTR - Fixes create custom field set issue
shopware_platform
train
js
41b8ba0ddd91d0b9d65d97a983deca71877bcb7d
diff --git a/lib/mongo_mapper/document.rb b/lib/mongo_mapper/document.rb index <HASH>..<HASH> 100644 --- a/lib/mongo_mapper/document.rb +++ b/lib/mongo_mapper/document.rb @@ -52,7 +52,8 @@ module MongoMapper if updating_multiple update_multiple(args[0]) else - update_single(args[0], args[1]) + id, attributes = args + update_single(id, attributes) end end
A little more explicit in Document#update with a single doc.
mongomapper_mongomapper
train
rb
849ddb750eb94eb05f1731fdd738b45c9ecb7673
diff --git a/lib/commands/gesture.js b/lib/commands/gesture.js index <HASH>..<HASH> 100644 --- a/lib/commands/gesture.js +++ b/lib/commands/gesture.js @@ -2,6 +2,7 @@ import { errors } from 'appium-base-driver'; import { util } from 'appium-support'; import { iosCommands } from 'appium-ios-driver'; import { retryInterval } from 'asyncbox'; +import log from '../logger'; let helpers = {}, extensions = {}, commands = {}; @@ -192,7 +193,11 @@ commands.nativeClick = async function (el) { throw new Error(`could not scroll into view`); } }; - await retryInterval(5, 1, scrollIntoView); + try { + await retryInterval(5, 1, scrollIntoView); + } catch (err) { + log.warn('Scrolling failed after five retries. Proceeding with click.'); + } let endpoint = `/element/${el}/click`; return await this.proxyCommand(endpoint, 'POST', {}); };
Make sure scroll failure does not ruin click
appium_appium-xcuitest-driver
train
js
46da2e91d2274cb922740e5f88b629a9fd9217b3
diff --git a/dockermap/map/policy/utils.py b/dockermap/map/policy/utils.py index <HASH>..<HASH> 100644 --- a/dockermap/map/policy/utils.py +++ b/dockermap/map/policy/utils.py @@ -120,16 +120,18 @@ def get_port_bindings(container_config, client_config): :return: Dictionary of ports with mapped port, and if applicable, with bind address :rtype: dict """ - def _get_port_bind(port_binding): - exposed_port, bind_port, interface = port_binding - if interface: - bind_addr = client_config.interfaces.get(interface) - if not bind_addr: - raise ValueError("Address for interface '{0}' not found in client configuration.".format(interface)) - return exposed_port, (bind_addr, bind_port) - return exposed_port, bind_port - - return dict(map(_get_port_bind, container_config.publishes)) + def _gen_port_binds(): + for port_binding in container_config.publishes: + exposed_port, bind_port, interface = port_binding + if interface: + bind_addr = client_config.interfaces.get(interface) + if not bind_addr: + raise ValueError("Address for interface '{0}' not found in client configuration.".format(interface)) + yield exposed_port, (bind_addr, bind_port) + elif bind_port: + yield exposed_port, bind_port + + return dict(_gen_port_binds()) def is_initial(container_state):
Publish only ports with assigned public port.
merll_docker-map
train
py
ee9e1c7ca762d2e52e8f54930c047522764f9541
diff --git a/lib/anaconda/anaconda_for.rb b/lib/anaconda/anaconda_for.rb index <HASH>..<HASH> 100644 --- a/lib/anaconda/anaconda_for.rb +++ b/lib/anaconda/anaconda_for.rb @@ -136,7 +136,8 @@ module Anaconda logger.debug(options) filename = nil if options[:filename].present? - filename = "filename=#{options[:filename]}" + logger.debug "Cleaned Filename: #{clean_filename}" + filename = "filename=#{clean_filename}" end aws_options = {query: {"response-content-disposition" => "attachment;#{filename}"}}
Clean the filename passed to anaconda_download_url
ForgeApps_anaconda
train
rb
a6d95016e62ca8679763881cd380b611b6f9a57a
diff --git a/lib/vagrant/util/checkpoint_client.rb b/lib/vagrant/util/checkpoint_client.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/util/checkpoint_client.rb +++ b/lib/vagrant/util/checkpoint_client.rb @@ -48,14 +48,6 @@ module Vagrant self end - # Start checkpoint check - # - # @return [self] - def check - start_check - self - end - # Check has completed def complete? !@checkpoint_thread.nil? && !@checkpoint_thread.alive? @@ -78,7 +70,7 @@ module Vagrant # Run check # # @return [self] - def start_check + def check if enabled && @checkpoint_thread.nil? logger.debug("starting plugin check") @checkpoint_thread = Thread.new do @@ -169,6 +161,15 @@ module Vagrant end end + # @private + # Reset the cached values for platform. This is not considered a public + # API and should only be used for testing. + def reset! + logger = @logger + instance_variables.each(&method(:remove_instance_variable)) + @logger = logger + @enabled = false + end end end end
Remove duplicate method. Add testing helper method to reset.
hashicorp_vagrant
train
rb
da1af3d8b01ac6928447593f055d6476bbbc03f4
diff --git a/src/ORM/Connect/PDOStatementHandle.php b/src/ORM/Connect/PDOStatementHandle.php index <HASH>..<HASH> 100644 --- a/src/ORM/Connect/PDOStatementHandle.php +++ b/src/ORM/Connect/PDOStatementHandle.php @@ -47,6 +47,7 @@ class PDOStatementHandle 'float8' => 'float', 'float16' => 'float', 'numeric' => 'float', + 'bool' => 'int', // Bools should be ints // MySQL 'NEWDECIMAL' => 'float', diff --git a/tests/php/ORM/DatabaseTest.php b/tests/php/ORM/DatabaseTest.php index <HASH>..<HASH> 100644 --- a/tests/php/ORM/DatabaseTest.php +++ b/tests/php/ORM/DatabaseTest.php @@ -267,5 +267,9 @@ class DatabaseTest extends SapphireTest // Dates are returned as strings $this->assertInternalType('string', $record['Created'], 'DBDatetime fields should be string (non-prepared)'); + + // Booleans selected directly are ints + $result = DB::query('SELECT TRUE')->first(); + $this->assertInternalType('int', reset($result)); } }
FIX Postgres booleans should return as int for consistency
silverstripe_silverstripe-framework
train
php,php
ad8e6ddc1c304fdfd56344bdc234ae874aa7eef1
diff --git a/workbench/workers/mem_pslist.py b/workbench/workers/mem_pslist.py index <HASH>..<HASH> 100644 --- a/workbench/workers/mem_pslist.py +++ b/workbench/workers/mem_pslist.py @@ -21,9 +21,11 @@ class MemoryImagePSList(mem_base.MemoryImageBase): output = super(MemoryImagePSList, self).execute(input_data) # Special processing for Offset (V) + ''' for row in output['sections']['Info']: sub_offset = re.search('@ (.*)\n', row['Offset (V)']) row['Offset (V)'] = sub_offset.group(1) + ''' # Organize the output a bit output['tables'] = ['pslist']
taking out special processing for Offset(V)
SuperCowPowers_workbench
train
py
2a50148d4f038d4e7cb17a91592649baf20ef4a5
diff --git a/apps/config.rb b/apps/config.rb index <HASH>..<HASH> 100644 --- a/apps/config.rb +++ b/apps/config.rb @@ -2,6 +2,6 @@ require 'rho' Rho::RhoConfig.start_path = '/' -Rho::RhoConfig.rhobundle_zip_url = 'http://89.113.219.245:8080/admin/rhobundle.zip' +Rho::RhoConfig.rhobundle_zip_url = nil Rho::RhoConfig.rhobundle_zip_pwd = nil \ No newline at end of file
remove my own url to rhobumdle zip file
rhomobile_rhodes
train
rb
ff35328d4029a1f28512d5bde1c3c20e1fe9549d
diff --git a/rtv/docs.py b/rtv/docs.py index <HASH>..<HASH> 100644 --- a/rtv/docs.py +++ b/rtv/docs.py @@ -51,7 +51,6 @@ https://github.com/michael-lazar/rtv ? : Show the help screen q : Quit Q : Force quit - x : Hide/unhide a : Upvote z : Downvote c : Compose a new submission/comment @@ -64,7 +63,7 @@ https://github.com/michael-lazar/rtv l : View comments, or open comment in pager h : Return to subreddit o : Open the submission or comment url - SPACE : Fold or expand the selected comment tree + SPACE : Hide a submission, or fold/expand the selected comment tree b : Display urls with urlview y : Copy submission permalink to clipboard Y : Copy submission link to clipboard @@ -98,7 +97,7 @@ BANNER_SEARCH = """ """ FOOTER_SUBREDDIT = """ -[?]Help [q]Quit [l]Comments [/]Prompt [u]Login [o]Open [c]Post [a/z]Vote [x] hide/unhide +[?]Help [q]Quit [l]Comments [/]Prompt [u]Login [o]Open [c]Post [a/z]Vote """ FOOTER_SUBMISSION = """
Fixing docs that weren't updated
michael-lazar_rtv
train
py
0617c934bf6ef25d3152504ffcd120b0e1ad19b8
diff --git a/h2o-py/h2o/estimators/gbm.py b/h2o-py/h2o/estimators/gbm.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/estimators/gbm.py +++ b/h2o-py/h2o/estimators/gbm.py @@ -122,7 +122,7 @@ class H2OGradientBoostingEstimator(H2OEstimator): r2_stopping : float Stop making trees when the R^2 metric equals or exceeds this - Default: 0.999999 + Default: 1.79769313486e+308 stopping_rounds : int Early stopping based on convergence of stopping_metric. Stop if simple moving average of length k of the diff --git a/h2o-py/h2o/estimators/random_forest.py b/h2o-py/h2o/estimators/random_forest.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/estimators/random_forest.py +++ b/h2o-py/h2o/estimators/random_forest.py @@ -118,7 +118,7 @@ class H2ORandomForestEstimator(H2OEstimator): r2_stopping : float Stop making trees when the R^2 metric equals or exceeds this - Default: 0.999999 + Default: 1.79769313486e+308 stopping_rounds : int Early stopping based on convergence of stopping_metric. Stop if simple moving average of length k of the
[PUBDEV-<I>] Disabling stopping on R^2: client code updated
h2oai_h2o-3
train
py,py
ab4d375010220c4dac97116e2f1bffeca2f0bedc
diff --git a/brownant/app.py b/brownant/app.py index <HASH>..<HASH> 100644 --- a/brownant/app.py +++ b/brownant/app.py @@ -83,15 +83,19 @@ class BrownAnt(object): try: endpoint, kwargs = url_adapter.match() - handler = import_string(endpoint) - request = Request(url=url, args=query_args) - return handler(request, **kwargs) except NotFound: raise NotSupported(url_string) except RequestRedirect as e: new_url = "{0.new_url}?{1}".format(e, url_encode(query_args)) return self.dispatch_url(new_url) + try: + handler = import_string(endpoint) + request = Request(url=url, args=query_args) + return handler(request, **kwargs) + except RequestRedirect as e: + return self.dispatch_url(e.new_url) + def mount_site(self, site): """Mount a supported site to this app instance.
use another handler for user-created redirecting to fix up the test.
douban_brownant
train
py
f12ca1f20d272907e5b25bcbc9e0853bb709f417
diff --git a/backend/memory/message.go b/backend/memory/message.go index <HASH>..<HASH> 100644 --- a/backend/memory/message.go +++ b/backend/memory/message.go @@ -31,7 +31,6 @@ func (m *Message) Metadata(items []string) (metadata *imap.Message) { metadata.Uid = m.Uid default: section, err := imap.NewBodySectionName(item) - item = "" if err != nil { break }
backend/memory: removes useless assignment
emersion_go-imap
train
go
322d5826627ba74a188f381e37a1365fe390baa2
diff --git a/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js b/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js index <HASH>..<HASH> 100644 --- a/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js +++ b/packages/pob/lib/generators/core/yarn/CoreYarnGenerator.js @@ -112,6 +112,7 @@ export default class CoreYarnGenerator extends Generator { } end() { + this.fs.delete(this.destinationPath('.yarn/build-state.yml')); if (this.options.enable) { if (this.options.yarnNodeLinker === 'pnp') { this.spawnCommandSync('yarn', ['dlx', '@yarnpkg/sdks', 'vscode']);
fix(pob): make sure build-state.yml doesnt exists
christophehurpeau_pob-lerna
train
js
f603431ab6a0eb2afe5bca3b6394bfbdf83755b4
diff --git a/lib/rest_my_case/judge/base.rb b/lib/rest_my_case/judge/base.rb index <HASH>..<HASH> 100644 --- a/lib/rest_my_case/judge/base.rb +++ b/lib/rest_my_case/judge/base.rb @@ -62,7 +62,7 @@ module RestMyCase begin run_method(method_name, use_case) - use_case.options[:should_abort] + use_case.options[:should_abort] && @use_case_that_aborted = use_case rescue Errors::Skip => exception false rescue Errors::Abort => exception diff --git a/lib/rest_my_case/version.rb b/lib/rest_my_case/version.rb index <HASH>..<HASH> 100644 --- a/lib/rest_my_case/version.rb +++ b/lib/rest_my_case/version.rb @@ -1,5 +1,5 @@ module RestMyCase - VERSION = "1.3.4" + VERSION = "1.3.5" end
@use_case_that_aborted wasn't being populated at the right time
goncalvesjoao_rest_my_case
train
rb,rb
b294ae30bf575927c966450c71eb213376bc6fc8
diff --git a/src/OrangePaymentSlip.php b/src/OrangePaymentSlip.php index <HASH>..<HASH> 100644 --- a/src/OrangePaymentSlip.php +++ b/src/OrangePaymentSlip.php @@ -23,6 +23,7 @@ namespace SwissPaymentSlip\SwissPaymentSlip; * * @link https://www.postfinance.ch/content/dam/pf/de/doc/consult/templ/example/44218_templ_de_fr_it.pdf ESR layouting * template. + * @link https://www.postfinance.ch/binp/postfinance/public/dam.7nf77hU5mnlo7r15PkmudMtCOvznYc0RFUecjFJued4.spool/content/dam/pf/de/doc/consult/templ/example/44205_templ_de_fr_it.pdf Payment slip ESR bank in CHF * @uses OrangePaymentSlipData To store the slip data. */ class OrangePaymentSlip extends PaymentSlip diff --git a/src/PaymentSlip.php b/src/PaymentSlip.php index <HASH>..<HASH> 100644 --- a/src/PaymentSlip.php +++ b/src/PaymentSlip.php @@ -22,6 +22,7 @@ use InvalidArgumentException; * * The data of the fields is organized by its sister class PaymentSlipData. * + * @link https://www.postfinance.ch/en/cust/download/bizdoc.html Various documents for Post business customers * @uses PaymentSlipData To store the slip data. * * @todo Include EUR framed slip image (701) --> back side!
Added link two links to Post resources documenting ESRs
ravage84_SwissPaymentSlip
train
php,php
3fa81109ccde408cabf515014fde1952d8039904
diff --git a/soundcloud/client.py b/soundcloud/client.py index <HASH>..<HASH> 100644 --- a/soundcloud/client.py +++ b/soundcloud/client.py @@ -142,6 +142,8 @@ class Client(object): return '%s.json' % (name,) return name name = name.rstrip('/').lstrip('/') + if name[-13:] == 'contributions': + return '%s%s/%s' % (self.scheme, self.host, name) return '%s%s/%s.json' % (self.scheme, self.host, name) def _redirect_uri(self):
Update client.py Group contributions are giving <I> errors with the appended `.json` extension, hence this crude hack. Once this issue is fixed, we can remove this hack: <URL>
soundcloud_soundcloud-python
train
py
6b1b737acbfd22cde62e6fe320fc39ea1ac35a28
diff --git a/Tests/Functional/UseCasesTest.php b/Tests/Functional/UseCasesTest.php index <HASH>..<HASH> 100644 --- a/Tests/Functional/UseCasesTest.php +++ b/Tests/Functional/UseCasesTest.php @@ -201,6 +201,7 @@ class UseCasesTest extends WebTestCase 'key' => getenv('AWS_SQS_KEY'), 'secret' => getenv('AWS_SQS_SECRET'), 'region' => getenv('AWS_SQS_REGION'), + 'endpoint' => getenv('AWS_SQS_ENDPOINT'), ], ], ]];
Add SQS endpoint spec to functional test
php-enqueue_enqueue-bundle
train
php
bf10f8fbea4631a0c6a33f83947c839fd203d178
diff --git a/dropwizard/src/main/java/com/bazaarvoice/ostrich/dropwizard/healthcheck/ContainsHealthyEndPointCheck.java b/dropwizard/src/main/java/com/bazaarvoice/ostrich/dropwizard/healthcheck/ContainsHealthyEndPointCheck.java index <HASH>..<HASH> 100644 --- a/dropwizard/src/main/java/com/bazaarvoice/ostrich/dropwizard/healthcheck/ContainsHealthyEndPointCheck.java +++ b/dropwizard/src/main/java/com/bazaarvoice/ostrich/dropwizard/healthcheck/ContainsHealthyEndPointCheck.java @@ -19,7 +19,10 @@ import static com.google.common.base.Preconditions.checkNotNull; public class ContainsHealthyEndPointCheck extends HealthCheck { private final ServicePool<?> _pool; - protected ContainsHealthyEndPointCheck(ServicePool<?> pool, String name) { + /** + * @deprecated Use {@link #forPool(com.bazaarvoice.ostrich.ServicePool, String)} instead. + */ + public ContainsHealthyEndPointCheck(ServicePool<?> pool, String name) { super(name); checkArgument(!Strings.isNullOrEmpty(name)); _pool = checkNotNull(pool);
Make constructor public, but marked deprecated, like it was in Ostrich <I>.x.
bazaarvoice_ostrich
train
java
2e55b679ac6fa454345fe9dc484c1f2b6df32386
diff --git a/chacha20.go b/chacha20.go index <HASH>..<HASH> 100644 --- a/chacha20.go +++ b/chacha20.go @@ -107,12 +107,15 @@ func (c *Cipher) XORKeyStream(dst, src []byte) { limit = max } + o := c.offset for j := i; j < limit; j++ { - dst[j] = src[j] ^ c.block[c.offset] - c.offset++ + dst[j] = src[j] ^ c.block[o] + o++ } i += gap + c.offset = o + if c.offset == blockSize { c.advance() }
Only increment local variables in inner loop. This pushes it from ~<I> MB/sec to ~<I> MB/sec on my laptop, which means it's now as fast as or faster than AES-NI in CTR mode.
codahale_chacha20
train
go
5544962294e07654f96f45b44b23c90c69ac189e
diff --git a/src/Input/Textarea.js b/src/Input/Textarea.js index <HASH>..<HASH> 100644 --- a/src/Input/Textarea.js +++ b/src/Input/Textarea.js @@ -150,7 +150,6 @@ class Textarea extends Component { classes, className, defaultValue, - disabled, hintText, onChange, onHeightChange,
[TextField] Fix textarea disabled support (#<I>)
mui-org_material-ui
train
js
ac95613cbdc99b07f34ad992c6d3b91ee8b78642
diff --git a/lib/servizio/service.rb b/lib/servizio/service.rb index <HASH>..<HASH> 100644 --- a/lib/servizio/service.rb +++ b/lib/servizio/service.rb @@ -18,7 +18,7 @@ class Servizio::Service attr_accessor :ability # a cancan(can) ability attr_accessor :result - @@states = %i(denied error invalid success) + @@states = %i(denial error invalid success) # this is only to dry things up @@states.each do |state| @@ -34,7 +34,7 @@ class Servizio::Service end def authorized?; can?(:call, self); end - def denied?; !authorized?; end + def denial?; !authorized?; end def called?; @called == true; end def error?; called? && errors.present?; end def i18n_scope; model_name.i18n_key.to_s.gsub("/", "."); end @@ -60,7 +60,7 @@ class Servizio::Service def execute_callback(callback) if - denied? && callback[:queue] == :on_denied || + denial? && callback[:queue] == :on_denial || error? && callback[:queue] == :on_error || !called? && invalid? && callback[:queue] == :on_invalid || # don't call invalid? here, it might erase the errors object success? && callback[:queue] == :on_success
Renamed state "denied" to "denail" to meet other states naming convention
servizio-rb_servizio
train
rb
26921285ed83d41e6c0670a9b31ab6607955b262
diff --git a/clients/web/src/views/widgets/EditCollectionWidget.js b/clients/web/src/views/widgets/EditCollectionWidget.js index <HASH>..<HASH> 100644 --- a/clients/web/src/views/widgets/EditCollectionWidget.js +++ b/clients/web/src/views/widgets/EditCollectionWidget.js @@ -50,7 +50,6 @@ girder.views.EditCollectionWidget = Backbone.View.extend({ error: null // don't do default error behavior }).done(_.bind(function (resp) { this.$el.modal('hide'); - console.log('here'); this.trigger('g:saved', resp); }, this)).error(_.bind(function (err) { this.$('.g-validation-failed-message').text(err.responseJSON.message); @@ -67,7 +66,6 @@ girder.views.EditCollectionWidget = Backbone.View.extend({ error: null // don't do default error behavior }).done(_.bind(function (resp) { this.$el.modal('hide'); - console.log('here now'); this.trigger('g:saved', resp); }, this)).error(_.bind(function (err) { this.$('.g-validation-failed-message').text(err.responseJSON.message);
Removing some errant console.log statements.
girder_girder
train
js
9b9029cf4bbb09a81c4f96587bc46f3c6392bc26
diff --git a/routing/chainview/btcd.go b/routing/chainview/btcd.go index <HASH>..<HASH> 100644 --- a/routing/chainview/btcd.go +++ b/routing/chainview/btcd.go @@ -12,6 +12,7 @@ import ( "github.com/btcsuite/btcd/rpcclient" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" + "github.com/lightningnetwork/lnd/channeldb" ) // BtcdFilteredChainView is an implementation of the FilteredChainView @@ -447,11 +448,18 @@ type filterUpdate struct { // rewound to ensure all relevant notifications are dispatched. // // NOTE: This is part of the FilteredChainView interface. -func (b *BtcdFilteredChainView) UpdateFilter(ops []wire.OutPoint, updateHeight uint32) error { +func (b *BtcdFilteredChainView) UpdateFilter(ops []channeldb.EdgePoint, + updateHeight uint32) error { + + newUtxos := make([]wire.OutPoint, len(ops)) + for i, op := range ops { + newUtxos[i] = op.OutPoint + } + select { case b.filterUpdates <- filterUpdate{ - newUtxos: ops, + newUtxos: newUtxos, updateHeight: updateHeight, }: return nil
routing/chainview: ensure btcd impl meets new interface requirements
lightningnetwork_lnd
train
go
bb2c3b2f0282e214d7739b875b63f4a3ea8955c8
diff --git a/libfs/fs_test.go b/libfs/fs_test.go index <HASH>..<HASH> 100644 --- a/libfs/fs_test.go +++ b/libfs/fs_test.go @@ -641,6 +641,9 @@ func TestFileLockingExpiration(t *testing.T) { err = f.Lock() require.NoError(t, err) + _, err = fs.Create("b") + require.NoError(t, err) + clock.Add(2 * time.Minute) // Close/Unlock should fail because the clock expired.
libfs: fix lock expiration test by giving it something to flush Issue: KBFS-<I>
keybase_client
train
go
2895b0accaad4465128e4b950bf048494de36a9f
diff --git a/cmd/client-fs.go b/cmd/client-fs.go index <HASH>..<HASH> 100644 --- a/cmd/client-fs.go +++ b/cmd/client-fs.go @@ -241,8 +241,10 @@ func (f *fsClient) Put(reader io.Reader, size int64, contentType string, progres // Current file offset. var currentOffset = partSt.Size() - // Verify if incoming reader implements ReaderAt. Standard IO streams are excluded since their ReadAt() return illegal seek error - if readerAt, ok := reader.(io.ReaderAt); ok && !isStdIO(reader) { + // Use ReadAt() capability when reader implements it, but also avoid it in two cases: + // *) reader represents a standard input/output stream since they return illegal seek error when ReadAt() is invoked + // *) we know in advance that reader will provide zero length data + if readerAt, ok := reader.(io.ReaderAt); ok && !isStdIO(reader) && size > 0 { // Notify the progress bar if any till current size. if progress != nil { if _, e = io.CopyN(ioutil.Discard, progress, currentOffset); e != nil {
Put() in client fs avoids reading from input reader when data is zero lengthy (#<I>)
minio_mc
train
go
d306d4312f5ec9fd8554fb12a0625500ba654a73
diff --git a/lib/guruby/model.rb b/lib/guruby/model.rb index <HASH>..<HASH> 100644 --- a/lib/guruby/model.rb +++ b/lib/guruby/model.rb @@ -11,6 +11,16 @@ module Guruby ObjectSpace.define_finalizer self, self.class.finalize(@ptr) end + # Add a new variable to the model + def add_var(lb, ub, obj, vtype, varname = '') + Gurobi.GRBaddvar @ptr, 0, nil, nil, obj, lb, ub, vtype.ord, varname + end + + # Update the model + def update + Gurobi.GRBupdatemodel @ptr + end + # Free the model def self.finalize(ptr) proc { Gurobi.GRBfreemodel ptr } diff --git a/test.rb b/test.rb index <HASH>..<HASH> 100644 --- a/test.rb +++ b/test.rb @@ -3,4 +3,5 @@ require_relative 'lib/guruby' env = Guruby::Environment.new model = Guruby::Model.new env -Gurobi.GRBaddvar model.ptr, 0, nil, nil, 0, 0, 1, 'I'.ord, 'var' +model.add_var 0, 1, 0, GRB_INTEGER, 'var' +model.update
Add functions to add vars and update model
michaelmior_mipper
train
rb,rb
4d73bacba0b3ab6edefc6c88cd827fc05b1ecd40
diff --git a/drivers/ris.php b/drivers/ris.php index <HASH>..<HASH> 100644 --- a/drivers/ris.php +++ b/drivers/ris.php @@ -36,8 +36,10 @@ class RefLib_ris { 'SE' => 'section', 'SN' => 'isbn', 'ST' => 'title-short', - 'TI' => 'title', + 'T1' => 'title', // The spec is publidshed in san-serif; T[ONE] is correct + 'TI' => 'title', // The spec is publidshed in san-serif 'VL' => 'volume', + 'PY' => 'year', 'IS' => 'number' // Issue # );
Import title, year in RIS
hash-bang_RefLib
train
php
f805ddd9540242b9a0e90d62df50c343fb09d166
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,12 +31,12 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.2.0-BETA'; - public const VERSION_ID = '10200'; + public const VERSION = '1.3.0-DEV'; + public const VERSION_ID = '10300'; public const MAJOR_VERSION = '1'; - public const MINOR_VERSION = '2'; + public const MINOR_VERSION = '3'; public const RELEASE_VERSION = '0'; - public const EXTRA_VERSION = 'BETA'; + public const EXTRA_VERSION = 'DEV'; /** * {@inheritdoc}
Change application's version to <I>-DEV
Sylius_Sylius
train
php
d8e2afb2c625fdd7efbeb152bd97aba9fd9de250
diff --git a/lazyconf/lazy/prompt.py b/lazyconf/lazy/prompt.py index <HASH>..<HASH> 100644 --- a/lazyconf/lazy/prompt.py +++ b/lazyconf/lazy/prompt.py @@ -1,18 +1,35 @@ from fabric.api import * from fabric.colors import green, red, blue -# Prompt -# This class contains several helper functions for getting data between end-user's input and a schema.Schema object. +### Prompt ### +### This class contains several helper functions for getting data between end-user's input and a schema.Schema object. +### It also containers several formatting functions, which are currently just a convenience wrapper around printing Fabric colors. class Prompt(): def __init__(self): pass + ### Formatting ### + + # Prints a success message. def success(self, msg): pass + # Prints an error message. def error(self, msg): pass + # Prints a notice message. def notice(self, msg): - pass \ No newline at end of file + pass + + ### Parsing ### + + # Takes a python bool and returns it as y|n. + def prompt_bool(self, b): + pass + + # Takes y|n and returns a python bool. + def deprompt_bool(self, s): + pass +
Added comments and defined some functions in prompt
fmd_lazyconf
train
py
51f340abcf2b923df6fb0564ef395b4b520687f1
diff --git a/lib/Nails.js b/lib/Nails.js index <HASH>..<HASH> 100644 --- a/lib/Nails.js +++ b/lib/Nails.js @@ -462,12 +462,12 @@ Nails.prototype.start = function startServers(callback) { if(num) tLog.info('Purged %i old jobs', cyan(num)); }); - // Start scheduler after 1-10 seconds + // Start scheduler after 0-5 seconds // So all servers don't run at the same time setTimeout(function() { - self.task.start.bind(self.task); + self.task.start(); self.log.info('Started task scheduler'); - }, utils.random(1000, 10000)); + }, utils.random(0, 5000)); }
Nails: Start scheduler after 0-5 seconds
jameswyse_nails-framework
train
js
4862d1e8d74a1b82e91932d66245eb4219a83c5e
diff --git a/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/JetSqlSerializerHook.java b/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/JetSqlSerializerHook.java index <HASH>..<HASH> 100644 --- a/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/JetSqlSerializerHook.java +++ b/hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/JetSqlSerializerHook.java @@ -35,14 +35,10 @@ public class JetSqlSerializerHook implements DataSerializerHook { public static final int F_ID = FactoryIdHelper.getFactoryId(JET_SQL_DS_FACTORY, JET_SQL_DS_FACTORY_ID); - public static final int MAPPING = 1; - public static final int MAPPING_FIELD = 2; - // reserved for mapping related stuff + public static final int MAPPING = 0; + public static final int MAPPING_FIELD = 1; - // Reserved for index scan processor - // public static final int IMAP_INDEX_SCAN_PROCESSOR = 10; - // public static final int IMAP_INDEX_SCAN_PROCESSOR_META_SUPPLIER = 11; - // public static final int IMAP_INDEX_SCAN_PROCESSOR_SUPPLIER = 12; + // reserved for mapping related stuff public static final int LEN = MAPPING_FIELD + 1;
Fix SQL serialization class ids (#<I>)
hazelcast_hazelcast
train
java
9f06c940ee60f20ed7552b80f9e796b554e0f83b
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java @@ -1027,6 +1027,8 @@ public class JDBCStorableIntrospector extends StorableIntrospector { dt = TIMESTAMP; } else if (dataTypeName.toUpperCase().contains("TIMESTAMP")) { dt = TIMESTAMP; + } else if (dataTypeName.equalsIgnoreCase("INT UNSIGNED")) { + dt = BIGINT; } } else if (dt == LONGVARBINARY && "BLOB".equalsIgnoreCase(dataTypeName)) { // Workaround MySQL bug.
Add workaround for MySQL int unsigned type.
Carbonado_Carbonado
train
java
aaa9326673198ab6f40f6399125765fc7310fa63
diff --git a/lib/connection.js b/lib/connection.js index <HASH>..<HASH> 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -566,7 +566,7 @@ function Connection(options) { this.emit("error", err); end(); } - } else if (_status !== Status.CLOSING) { + } else if (_status !== Status.CLOSING && _status !== Status.CLOSED) { let err = Errors.createError( "receiving packet from server without active commands\n" + "conn:" +
[misc] discard packet cache when closing
MariaDB_mariadb-connector-nodejs
train
js
84f4ecb4d7bf33e707c4b48b956c03c7b1e0d411
diff --git a/server/standalone.js b/server/standalone.js index <HASH>..<HASH> 100644 --- a/server/standalone.js +++ b/server/standalone.js @@ -304,6 +304,9 @@ define(['logManager', if(modul){ __logger.info('adding RExtraST ['+CONFIG.rextrast[keys[i]]+'] to - /rest/external/'+keys[i]); __app.use('/rest/external/'+keys[i],modul); + } else { + console.log("Loading " + CONFIG.rextrast[keys[i]] + " failed."); + process.exit(2); } } }
Failing to load is a fatal error Former-commit-id: 2d0b3e6e<I>b<I>c<I>d8adf1e0d6a<I>
webgme_webgme-engine
train
js
b597f241c332681e505d4f491bae3aeecb751a8a
diff --git a/pyhocon/config_tree.py b/pyhocon/config_tree.py index <HASH>..<HASH> 100644 --- a/pyhocon/config_tree.py +++ b/pyhocon/config_tree.py @@ -580,6 +580,9 @@ class ConfigSubstitution(object): self.instring = instring self.loc = loc + def raw_str(self): + return self.variable + def __repr__(self): # pragma: no cover return '[ConfigSubstitution: ' + self.variable + ']'
String substitution (#<I>) Fix STR_SUBSTITUTION, because ConfigSubstitution has no function raw_str
chimpler_pyhocon
train
py
6c9ef0107a184cc83382ed3155c6534693d0629e
diff --git a/tests/ParserTest.php b/tests/ParserTest.php index <HASH>..<HASH> 100755 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -525,6 +525,22 @@ class ParserTest extends \PHPUnit_Framework_TestCase ), ), + // Testing nicks with ~ + array( + "MODE #Finnish +o :Kilroy~\r\n", + array( + 'command' => 'MODE', + 'params' => array( + 'channel' => '#Finnish', + 'mode' => '+o', + 'params' => 'Kilroy~', + 'user' => 'Kilroy~', + 'all' => '#Finnish +o :Kilroy~', + ), + 'targets' => array('#Finnish'), + ), + ), + array( "MODE #Finnish +v :Wiz\r\n", array(
Adding test to check nicks with ~ on MODE message.
phergie_phergie-irc-parser
train
php
9eeff8da9060c8b1ff494fd3f56260c3025425f0
diff --git a/public/src/Helpers/Template.php b/public/src/Helpers/Template.php index <HASH>..<HASH> 100644 --- a/public/src/Helpers/Template.php +++ b/public/src/Helpers/Template.php @@ -166,6 +166,7 @@ class Template if (defined('VERSION')) $this->smart->assign("version", VERSION); if (defined('DOMINIO')) $this->smart->assign("dominio", DOMINIO); if (defined('VENDOR')) $this->smart->assign("vendor", VENDOR); + if (defined('AUTOSYNC')) $this->smart->assign("autosync", AUTOSYNC); if (file_exists(PATH_HOME . "public/assets/theme.min.css")) {
include AUTOSYNC variable to templates
edineibauer_uebHelpers
train
php
4029a4a33182b588270d663f7b49bbae2bf41ef0
diff --git a/bcbio/ngsalign/tophat.py b/bcbio/ngsalign/tophat.py index <HASH>..<HASH> 100644 --- a/bcbio/ngsalign/tophat.py +++ b/bcbio/ngsalign/tophat.py @@ -148,7 +148,7 @@ def align(fastq_file, pair_file, ref_file, out_base, align_dir, config, exit(1) out_files = tophat_align(fastq_file, pair_file, ref_file, out_base, - align_dir, config, names=None) + align_dir, config, names) return out_files diff --git a/bcbio/pipeline/alignment.py b/bcbio/pipeline/alignment.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/alignment.py +++ b/bcbio/pipeline/alignment.py @@ -95,10 +95,11 @@ def _align_from_fastq(fastq1, fastq2, aligner, align_ref, sam_ref, names, """ align_fn = _tools[aligner].align_fn sam_file = align_fn(fastq1, fastq2, align_ref, names["lane"], align_dir, config, - names=names) + names) if fastq2 is None and aligner in ["bwa", "bowtie2"]: fastq1 = _remove_read_number(fastq1, sam_file) sort_method = config["algorithm"].get("bam_sort", "coordinate") + if sort_method == "queryname": return sam_to_querysort_bam(sam_file, config) else:
Fixing passing the names attribute to the aligners.
bcbio_bcbio-nextgen
train
py,py
58910919cff382e63f2282bc1f651c057f2e3ada
diff --git a/cwltool/job.py b/cwltool/job.py index <HASH>..<HASH> 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -19,6 +19,8 @@ class Job(object): runtime = [] if self.container and self.container.get("type") == "docker": + if "uri" in self.container: + subprocess.call("docker", "pull", self.container["uri"]) runtime = ["docker", "run", "-i"] for d in self.pathmapper.dirs: runtime.append("--volume=%s:%s:ro" % (d, self.pathmapper.dirs[d]))
Fix uri in bwa example. Cwltool now runs "docker pull" before running the job.
common-workflow-language_cwltool
train
py
92320ffa289383f9c5ca616502f71ea835ce833d
diff --git a/rope/refactor/patchedast.py b/rope/refactor/patchedast.py index <HASH>..<HASH> 100644 --- a/rope/refactor/patchedast.py +++ b/rope/refactor/patchedast.py @@ -277,6 +277,7 @@ class _PatchingASTWalker: "Div": "/", "Mod": "%", "Pow": "**", + "MatMul": "@", "LShift": "<<", "RShift": ">>", "BitOr": "|",
Add MatMul operator to patchedast
python-rope_rope
train
py
7cde22d3be32c0c4ec41f495514b986c0a6c326c
diff --git a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java +++ b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/CallManager.java @@ -1277,7 +1277,13 @@ public final class CallManager extends RestcommUntypedActor { IExtensionFeatureAccessRequest far = new FeatureAccessRequest(FeatureAccessRequest.Feature.INBOUND_VOICE, number.getAccountSid()); ExtensionResponse er = ec.executePreInboundAction(far, extensions); - if (er.isAllowed()) { + if (er == null) { + if (logger.isDebugEnabled()) { + logger.debug("Extension Response is null"); + } + } + + if (er == null || er.isAllowed()) { if (logger.isDebugEnabled()) { logger.debug("Extension response allowed the execution"); }
Add more log statements during the method `redirectToHostedApp`
RestComm_Restcomm-Connect
train
java
d4e350d95162ce39cca7ceb07da497ac90eb8bb6
diff --git a/src/Module.php b/src/Module.php index <HASH>..<HASH> 100644 --- a/src/Module.php +++ b/src/Module.php @@ -54,16 +54,6 @@ class Module } - if($uri == '/melis' || $uri == '/melis/login') { - - // proceed on setup if there is no platform configuration file available - if(!file_exists($platformFile)) { - header('location: ' . $setupRoute); - die; - } - - } - if($uri == $setupRoute) { if(file_exists($platformFile)) unlink($platformFile); @@ -82,6 +72,13 @@ class Module } + else { + if(preg_match('/(\/?)(melis*.?)/', $uri) || ($uri == '/')) { + header('location: ' . $setupRoute); + die; + + } + }
fixed issue on melis installer routing
melisplatform_melis-installer
train
php
2f4505a9f6ea1923202e50b04e0d2f4c70d3b519
diff --git a/Thru/ActiveRecord/Search.php b/Thru/ActiveRecord/Search.php index <HASH>..<HASH> 100644 --- a/Thru/ActiveRecord/Search.php +++ b/Thru/ActiveRecord/Search.php @@ -104,8 +104,6 @@ class Search } } - var_dump($results); - foreach($results as $result){ $result->field_fix(); }
Whoops, shouldn't have left a var_dump there. Thanks Travis, thanks tests\Utils\SanityTest::testOutputEmpty
Thruio_ActiveRecord
train
php
d02302854f1020d03ca85e36b5500596dc7963e6
diff --git a/src/Purl/Url.php b/src/Purl/Url.php index <HASH>..<HASH> 100644 --- a/src/Purl/Url.php +++ b/src/Purl/Url.php @@ -41,7 +41,7 @@ class Url extends AbstractPart private $url; /** - * @var Purl\ParserInterface + * @var ParserInterface */ private $parser;
Fix type hint Should either be an FQN starting with \ or the relative name.
jwage_purl
train
php
5e65788e6b36fa4931e2c3514d54ef3dc6235908
diff --git a/holoviews/core/pprint.py b/holoviews/core/pprint.py index <HASH>..<HASH> 100644 --- a/holoviews/core/pprint.py +++ b/holoviews/core/pprint.py @@ -35,6 +35,7 @@ class InfoPrinter(object): """ Get parameter information from the supplied class or object. """ + if self.ppager is None: return '' param_info = cls.ppager._get_param_info(obj) value_table = cls.ppager._build_table(param_info, cls.ppager.order,
Allowed suppressing InfoPrinter output by setting ppager to None
pyviz_holoviews
train
py
bf7de75ac38685d3a30d065c1f558fa96a8e4209
diff --git a/tests/integration/components/ui-dropdown-test.js b/tests/integration/components/ui-dropdown-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/components/ui-dropdown-test.js +++ b/tests/integration/components/ui-dropdown-test.js @@ -796,10 +796,11 @@ test('The correct number of items get selected when array is modified', function assert.ok(this.$('.item[data-id=2]').hasClass('active')); assert.equal(this.get('selected').join(','), ['2'].join(',')); + Ember.run.begin(); this.set('selected', ['2', '4']); // Have to clear the queue to ensure that property change gets notified // Doesn't clear in time on tests occasionally - Ember.run.sync(); + Ember.run.end(); assert.ok(this.$('.item[data-id=4]').hasClass('active')); assert.equal(this.get('selected').join(','), ['2', '4'].join(','));
fix: Ember.run.sync() is deprecated, use begin() and end()
Semantic-Org_Semantic-UI-Ember
train
js
00bf03f1b06552fc1c9a0c4b72e902d51e306eed
diff --git a/service.go b/service.go index <HASH>..<HASH> 100644 --- a/service.go +++ b/service.go @@ -213,7 +213,7 @@ func (s ServiceSpec) AsID() (ServiceID, error) { type ImageSpec string func ParseImageSpec(s string) (ImageSpec, error) { - if s == string(ImageSpecLatest) { + if s == string(ImageSpecLatest) || s == string(ImageSpecNone) { return ImageSpec(s), nil } id := ParseImageID(s)
Add no-update to valid image spec.
weaveworks_flux
train
go
b4a5eb41e79a51f4144748912d2b14d5e96550df
diff --git a/simuvex/procedures/libc___so___6/__libc_start_main.py b/simuvex/procedures/libc___so___6/__libc_start_main.py index <HASH>..<HASH> 100644 --- a/simuvex/procedures/libc___so___6/__libc_start_main.py +++ b/simuvex/procedures/libc___so___6/__libc_start_main.py @@ -27,5 +27,5 @@ class __libc_start_main(simuvex.SimProcedure): new_state.stack_push(symexec.BitVecVal(0, word_len)) new_state.stack_push(retn_addr_expr) - self.add_exits(simuvex.s_exit.SimExit(expr=main_addr.expr, state=new_state)) + self.add_exits(simuvex.s_exit.SimExit(expr=main_addr.expr, state=new_state, jumpkind='Ijk_Call')) self.add_refs(simuvex.SimCodeRef(self.addr, self.stmt_from, main_addr, [], []))
properly set jk for libc_start_main's call to main
angr_angr
train
py
63b3b10181ffd20e3ce6f391610ac0956db98685
diff --git a/providence-storage/src/main/java/net/morimekta/providence/storage/DirectoryMessageStore.java b/providence-storage/src/main/java/net/morimekta/providence/storage/DirectoryMessageStore.java index <HASH>..<HASH> 100644 --- a/providence-storage/src/main/java/net/morimekta/providence/storage/DirectoryMessageStore.java +++ b/providence-storage/src/main/java/net/morimekta/providence/storage/DirectoryMessageStore.java @@ -70,9 +70,10 @@ public class DirectoryMessageStore<K, M extends PMessage<M,F>, F extends PField> this.directory = directory; this.tempDir = new File(directory, TMP_DIR); - this.tempDir.mkdirs(); - if (!tempDir.isDirectory()) { + if (!tempDir.exists() && !tempDir.mkdirs()) { throw new IllegalStateException("Unable to create temp directory: " + tempDir.toString()); + } else if (!tempDir.isDirectory()) { + throw new IllegalStateException("File blocking temp directory: " + tempDir.toString()); } this.keyBuilder = keyBuilder; this.keyParser = keyParser;
Better temp dir checks in DirectoryMessageStore.
morimekta_providence
train
java
d7c40d232f72df18bbef1f048f09ba6c50bdefdc
diff --git a/lib/mandown/tools.rb b/lib/mandown/tools.rb index <HASH>..<HASH> 100644 --- a/lib/mandown/tools.rb +++ b/lib/mandown/tools.rb @@ -8,6 +8,19 @@ module Mandown def get_root(uri) @root = ::URI::join(uri, "/").to_s[0..-2] end + + def to_s + "<#{self.class}::#{self.object_id} : #{@name} : #{@uri}>" + end + + def eql?(other) + (@name == other.name) and (@uri == other.uri) + end + + def ==(other) + puts 'You may want to use :eql?' + super + end end end
added #to_s, #eql? and == to tools
jphager2_mangdown
train
rb
33d7d61f974ee267b0806b5024669ab78513c332
diff --git a/stanza/tests/test_langid.py b/stanza/tests/test_langid.py index <HASH>..<HASH> 100644 --- a/stanza/tests/test_langid.py +++ b/stanza/tests/test_langid.py @@ -2,10 +2,14 @@ Basic tests of langid module """ +import pytest + from stanza.models.common.doc import Document from stanza.pipeline.core import Pipeline from stanza.pipeline.multilingual import MultilingualPipeline +pytestmark = pytest.mark.skip + def test_langid(): """ Basic test of language identification
skip langid tests until resources set up
stanfordnlp_stanza
train
py
5f79ce1c5ceda449f577237a405e00e3912c1a37
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -613,7 +613,7 @@ Jimp.diff = function (img1, img2, threshold) { } } - threshold = threshold || 0.1; + threshold = isDef(threshold) ? threshold : 0.1; if (typeof threshold !== "number" || threshold < 0 || threshold > 1) return throwError.call(this, "threshold must be a number between 0 and 1"); diff --git a/test/compare.test.js b/test/compare.test.js index <HASH>..<HASH> 100644 --- a/test/compare.test.js +++ b/test/compare.test.js @@ -81,4 +81,13 @@ describe("Compare image difference", ()=> { }); }); + it('allows to set a different threshold', ()=> { + Jimp.diff(imgs[0], imgs[3], 0.1).percent.should.be.equal(0); + Jimp.diff(imgs[0], imgs[3], 0).percent.should.be.equal(0.25); + }); + + it('throws an error if threshold is invalid', ()=> { + (()=> Jimp.diff(imgs[0], imgs[3], 'invalid')).should.throw('threshold must be a number between 0 and 1'); + }); + });
Fix - Allow for 0 threshold in Jimp.diff
oliver-moran_jimp
train
js,js
b5049d5e9c466dcec8a7b4b24e6fa489a17bade0
diff --git a/src/Magniloquent/Magniloquent/Magniloquent.php b/src/Magniloquent/Magniloquent/Magniloquent.php index <HASH>..<HASH> 100644 --- a/src/Magniloquent/Magniloquent/Magniloquent.php +++ b/src/Magniloquent/Magniloquent/Magniloquent.php @@ -438,7 +438,7 @@ class Magniloquent extends Model { break; } // put everything back together - $temp_rule = implode(',', $rule_params); + $temp_rule[$rule_key] = implode(',', $rule_params); $this->mergedRules[$index] = $temp_rule; } }
Fixed bug where unique check would overwrite all rules except unique rules
philipbrown_magniloquent
train
php
c09b5e468becedd9d450e7e190aec15d9c9dd039
diff --git a/src/main/java/com/jayway/maven/plugins/android/phase09package/ApkMojo.java b/src/main/java/com/jayway/maven/plugins/android/phase09package/ApkMojo.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/jayway/maven/plugins/android/phase09package/ApkMojo.java +++ b/src/main/java/com/jayway/maven/plugins/android/phase09package/ApkMojo.java @@ -50,7 +50,6 @@ import java.io.File; import java.io.FileFilter; import java.io.FileNotFoundException; import java.io.FileOutputStream; -import java.io.FileInputStream; import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream;
remove unused import to comply to enforced style
simpligility_android-maven-plugin
train
java
cee38eb2065c4965f50cf3a0dd145a022a297ea9
diff --git a/cleverhans/attacks_tf.py b/cleverhans/attacks_tf.py index <HASH>..<HASH> 100644 --- a/cleverhans/attacks_tf.py +++ b/cleverhans/attacks_tf.py @@ -1539,14 +1539,14 @@ class LBFGS_attack(object): class UnrolledOptimizer(object): - """Functional-stype optimizer which does not use TF Variables. + """Optimizer for Tensors rather than tf.Variables. UnrolledOptimizers implement optimizers where the values being optimized are ordinary Tensors, rather than Variables. TF Variables can have strange behaviors when being assigned multiple times within a single sess.run() call, particularly in Distributed TF, so this avoids thinking about those issues. In cleverhans, these are helper classes for the `pgd_attack` - method. + method. Otherwise, they follow the same interface as tf.Optimizer. """ def _compute_gradients(self, loss_fn, x, unused_optim_state):
Update UnrolledOptimizer docstring
tensorflow_cleverhans
train
py
087b7a21bb6967bf49b6051e838c593ea6fcf2b8
diff --git a/cmd/shell.go b/cmd/shell.go index <HASH>..<HASH> 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -393,7 +393,15 @@ func ProfileCmd(profileName string, stats statsd.Statter) { // Gather various GC related metrics if memoryStats.NumGC > 0 { - gcPauseAvg := (int64(memoryStats.PauseTotalNs) / int64(memoryStats.NumGC)) + totalRecentGC := uint64(0) + buffSize := 0 + for _, pause := range memoryStats.PauseNs { + if pause != 0 { + totalRecentGC += pause + buffSize++ + } + } + gcPauseAvg := int64(totalRecentGC) / int64(buffSize) lastGC := int64(memoryStats.PauseNs[(memoryStats.NumGC+255)%256]) stats.Timing(fmt.Sprintf("%s.Gostats.Gc.PauseAvg", profileName), gcPauseAvg, 1.0) stats.Gauge(fmt.Sprintf("%s.Gostats.Gc.LastPause", profileName), lastGC, 1.0)
Collect recent average instead of average since start
letsencrypt_boulder
train
go
489c8084dd34f93a8d336cf33bac367c22252389
diff --git a/lib/crabfarm/modes/publisher.rb b/lib/crabfarm/modes/publisher.rb index <HASH>..<HASH> 100644 --- a/lib/crabfarm/modes/publisher.rb +++ b/lib/crabfarm/modes/publisher.rb @@ -88,7 +88,7 @@ module Crabfarm end def validate_remote(_url) - return true if /^\w+\/\w+$/i === _url + return true if /^[\w\-]+\/[\w\-]+$/i === _url puts "Invalid remote syntax: #{_url}".color :red return false end
fix(publisher): fixes remote validation expression to accept dashes
platanus_crabfarm-gem
train
rb
77e2e8a4be77063a3112b19184c2ee2a8b751c29
diff --git a/Twig/Extension/NetworkingHelperExtension.php b/Twig/Extension/NetworkingHelperExtension.php index <HASH>..<HASH> 100644 --- a/Twig/Extension/NetworkingHelperExtension.php +++ b/Twig/Extension/NetworkingHelperExtension.php @@ -451,6 +451,9 @@ class NetworkingHelperExtension extends \Twig_Extension switch ($fieldDescription->getType()) { + case 'hidden': + $value = $fieldDescription->getValue($object); + break; case 'boolean': if($fieldDescription->getValue($object)){ $value = 'positive';
show value if field is hidden in admin area text block
networking_init-cms-bundle
train
php
8b2224cd2e76c6566b5074c292c5a947f43b6a38
diff --git a/Command/NotifyDeploymentCommand.php b/Command/NotifyDeploymentCommand.php index <HASH>..<HASH> 100644 --- a/Command/NotifyDeploymentCommand.php +++ b/Command/NotifyDeploymentCommand.php @@ -45,15 +45,21 @@ class NotifyDeploymentCommand extends AbstractWebhookCommand 'The name of the project that is being deployed' ); $this->addArgument( - 'revision', + 'target', InputArgument::REQUIRED, - 'A revision number (e.g., git commit SHA)' + 'The target/servername on which the project was deployed' ); $this->addOption( - 'target', - 't', + 'revision-before', + 'rb', InputOption::VALUE_REQUIRED, - 'The target/servername on which the project was deployed' + 'The revision number before deployment (e.g., git commit SHA)' + ); + $this->addOption( + 'revision-after', + 'ra', + InputOption::VALUE_REQUIRED, + 'The revision number after deployment (e.g., git commit SHA)' ); $this->addOption( 'changelog',
changed some options into arguments since they are going to be required
cleentfaar_CLSlackBundle
train
php
5ee322684e237b751290f15aa0c293db0718bb79
diff --git a/lib/arjdbc/mssql/adapter.rb b/lib/arjdbc/mssql/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/mssql/adapter.rb +++ b/lib/arjdbc/mssql/adapter.rb @@ -386,6 +386,10 @@ module ArJdbc def charset select_value "SELECT SERVERPROPERTY('SqlCharSetName')" end + + def collation + select_value "SELECT SERVERPROPERTY('Collation')" + end def current_database select_value 'SELECT DB_NAME()' @@ -418,6 +422,10 @@ module ArJdbc def create_database(name, options = {}) execute "CREATE DATABASE #{quote_table_name(name)}" end + + def database_exists?(name) + select_value "SELECT name FROM sys.databases WHERE name = '#{name}'" + end def rename_table(table_name, new_table_name) clear_cached_table(table_name)
[mssql] collation and database_exists? helpers for SQLServer
jruby_activerecord-jdbc-adapter
train
rb
721b64053af015f8e09c6cf5917cc76c5ee1152c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,5 +22,5 @@ setup(name='fxapom', url='https://github.com/mozilla/fxapom', license='MPL 2.0', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), - install_requires=['PyFxA==0.1.1'], + install_requires=['PyFxA==0.1.3'], include_package_data=True)
Update pyfxa (#<I>) * Update PyFxA -> <I> * Update PyFxA to <I>
mozilla_fxapom
train
py
68bda4b69850bdca2faf468121561c7ceb7d8b89
diff --git a/lib/waterline/utils/query/normalize-criteria.js b/lib/waterline/utils/query/normalize-criteria.js index <HASH>..<HASH> 100644 --- a/lib/waterline/utils/query/normalize-criteria.js +++ b/lib/waterline/utils/query/normalize-criteria.js @@ -871,6 +871,10 @@ module.exports = function normalizeCriteria(criteria, modelIdentity, orm) { // TODO + // If not `['*']`, ensure the primary key is included in the `select`. + // TODO + + // Loop through array and check each attribute name. _.each(criteria.select, function (attrNameToKeep){
Add note about ensuring that the primary key is included in the 'select' (if it is not ['*'])
balderdashy_waterline
train
js
99d1211c88d6741fe25e2b7d51e195b1291fccac
diff --git a/unleash/plugins/pypi.py b/unleash/plugins/pypi.py index <HASH>..<HASH> 100644 --- a/unleash/plugins/pypi.py +++ b/unleash/plugins/pypi.py @@ -20,6 +20,10 @@ def setup(cli): ['--identity', '-i'], help='Identity to use when signing.' )) + cli.commands['publish'].params.append(Option( + ['--upload-docs/--no-upload-docs', '-d/-D'], default=True, + help='Upload documentation to PyPI.' + )) def collect_info(ctx): @@ -68,6 +72,10 @@ def publish_release(ctx): else: log.info('Uploading unsigned source distribution to PyPI') + if opts['upload_docs']: + args.append('upload_docs') + log.info('Building and uploading documentation to PyPI') + log.debug('Running {}'.format(args)) subprocess.check_output( args,
Added upload_docs options.
mbr_unleash
train
py
c5237d5b9d685e22c842273098af9d0d18745811
diff --git a/stmt.go b/stmt.go index <HASH>..<HASH> 100644 --- a/stmt.go +++ b/stmt.go @@ -403,6 +403,10 @@ func (a *stmtCompiler) compileImportDecl(decl *ast.GenDecl) { } } +func (a *stmtCompiler) compileConstDecl(decl *ast.GenDecl) { + log.Panicf("%v not implemented", decl.Tok) +} + func (a *stmtCompiler) compileDecl(decl ast.Decl) { switch d := decl.(type) { case *ast.BadDecl: @@ -438,11 +442,13 @@ func (a *stmtCompiler) compileDecl(decl ast.Decl) { case token.IMPORT: a.compileImportDecl(d) case token.CONST: - log.Panicf("%v not implemented", d.Tok) + a.compileConstDecl(d) case token.TYPE: a.compileTypeDecl(a.block, d) case token.VAR: a.compileVarDecl(d) + default: + log.Panicf("unknown ast.GenDecl token: %v\n", d.Tok) } default:
stmt: stubs for compileConstDecl
sbinet_go-eval
train
go
702d642ae6b0ceb8014dc08d1109b65617a3da08
diff --git a/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java b/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java index <HASH>..<HASH> 100644 --- a/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java +++ b/services-api/src/main/java/io/scalecube/services/api/ServiceMessage.java @@ -28,11 +28,13 @@ public final class ServiceMessage { /** Error type header. */ public static final String HEADER_ERROR_TYPE = "errorType"; - private Map<String, String> headers = new HashMap<>(1); + private final Map<String, String> headers; private Object data; /** Instantiates empty message for deserialization purpose. */ - ServiceMessage() {} + ServiceMessage() { + headers = new HashMap<>(2); + } private ServiceMessage(Builder builder) { this.data = builder.data; @@ -192,7 +194,7 @@ public final class ServiceMessage { public static class Builder { - private Map<String, String> headers = new HashMap<>(); + private final Map<String, String> headers = new HashMap<>(2); private Object data; private Builder() {}
Make headers as final in ServiceMessage and increase initial size
scalecube_scalecube-services
train
java
7d963253992260647b8f9a7b7df925805ee4c237
diff --git a/packages/NodeTypeResolver/PHPStan/Type/TypeFactory.php b/packages/NodeTypeResolver/PHPStan/Type/TypeFactory.php index <HASH>..<HASH> 100644 --- a/packages/NodeTypeResolver/PHPStan/Type/TypeFactory.php +++ b/packages/NodeTypeResolver/PHPStan/Type/TypeFactory.php @@ -153,7 +153,8 @@ final class TypeFactory foreach ($flattenItemTypes as $position => $nestedFlattenItemType) { /** @var Type|null $nestedFlattenKeyType */ - $nestedFlattenKeyType = $flattenKeyTypes[$position]; + $nestedFlattenKeyType = $flattenKeyTypes[$position] ?? null; + if ($nestedFlattenKeyType === null) { $nestedFlattenKeyType = new MixedType(); }
Fix Undefined offset in TypeFactory around flattenTypes calls (#<I>)
rectorphp_rector
train
php
d5094e3b9ea2ff62483093e3415dee1044fd9974
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open(path.join(here, "README.md"), encoding="utf-8") as f: setup( name="pdf2image", - version="1.9.0", + version="1.9.1", description="A wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list.", long_description=long_description, long_description_content_type="text/markdown", @@ -33,6 +33,7 @@ setup( "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", ], keywords="pdf image png jpeg jpg convert", packages=find_packages(exclude=["contrib", "docs", "tests"]),
Add Python <I> to supported versions
Belval_pdf2image
train
py
fc4c4bee739a8bc2dbe7f726cb9c6bc358440c9d
diff --git a/packages/eslint-midway-contrib/base.js b/packages/eslint-midway-contrib/base.js index <HASH>..<HASH> 100644 --- a/packages/eslint-midway-contrib/base.js +++ b/packages/eslint-midway-contrib/base.js @@ -3,6 +3,7 @@ module.exports = { browser: true, commonjs: true, es6: true, + mocha: true, node: true, }, extends: ['./plugins/import.yml'],
chore(eslint-midway-contrib): add mocha into env (#<I>) to solve "'describe' is not defined no-undef" (cherry picked from commit a<I>ca<I>ef<I>c6ca4b<I>de6c<I>bce<I>ab2)
midwayjs_midway
train
js