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
a7a40ee2afc952d6e4d303dcb149454e0fb08f27
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -155,4 +155,4 @@ exports.styles = _styles exports.vendor = _vendor exports.watch = _watch -exports.default = series(parallel(_styles, _scripts), _serve, _watch) +exports.default = series(parallel(_styles, _scripts), parallel(_serve, _watch))
Run `serve` and `watch` tasks in parallel
GrottoPress_jentil
train
js
0db2b0eb0d506863c865bc6113471f6305d3ecdb
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -176,7 +176,6 @@ func setupRouteFetcher(logger lager.Logger, c *config.Config, registry rregistry uaaClient := newUaaClient(logger, clock, c) - logger.Info("fetching-token-from-uaa") _, err := uaaClient.FetchToken(false) if err != nil { logger.Fatal("unable-to-fetch-token", err) diff --git a/main_test.go b/main_test.go index <HASH>..<HASH> 100644 --- a/main_test.go +++ b/main_test.go @@ -496,8 +496,7 @@ var _ = Describe("Router Integration", func() { // note, this will start with routing api, but will not be able to connect session := startGorouterSession(cfgFile) - Expect(gorouterSession.Out.Contents()).To(ContainSubstring("fetching-token-from-uaa")) - Expect(gorouterSession.Out.Contents()).To(ContainSubstring("using-https-scheme-for-uaa")) + Expect(gorouterSession.Out.Contents()).To(ContainSubstring("started-fetching-token")) stopGorouter(session) }) })
Update log messages in test [#<I>]
cloudfoundry_gorouter
train
go,go
08065c4a9bdb707fd204d009883aaf84493db179
diff --git a/src/adapters/pouch.idb.js b/src/adapters/pouch.idb.js index <HASH>..<HASH> 100644 --- a/src/adapters/pouch.idb.js +++ b/src/adapters/pouch.idb.js @@ -837,6 +837,9 @@ IdbPouch.Changes = (function() { if (opts.filter && !opts.filter.apply(this, [change.doc])) { return; } + if (!opts.include_docs) { + delete change.doc; + } opts.onChange.apply(opts.onChange, [change]); } }
Dont include docs by default for feed
pouchdb_pouchdb
train
js
5a5c1524c9e860fcaf28a5bde17fdf80f4fabf28
diff --git a/LiSE/LiSE/tests/test_character.py b/LiSE/LiSE/tests/test_character.py index <HASH>..<HASH> 100644 --- a/LiSE/LiSE/tests/test_character.py +++ b/LiSE/LiSE/tests/test_character.py @@ -40,6 +40,7 @@ class CharacterSetStorageTest(CharacterTest, allegedb.tests.test_all.SetStorageT def set_in_mapping(mapp, stat, v): + """Sync a value in ``mapp``, having key ``stat``, with ``v``.""" # Mutate the stuff in-place instead of simply replacing it, # because this could trigger side effects if stat == 'name': @@ -70,6 +71,7 @@ def set_in_mapping(mapp, stat, v): def update_char(char, *, stat=(), node=(), portal=()): + """Make a bunch of changes to a character-like object""" def update(d, dd): for k, v in dd.items(): if v is None and k in d: @@ -182,6 +184,7 @@ def character_updates(request): def test_facade(character_updates): + """Make sure you can alter a facade independent of the character it's from""" character, statup, nodeup, edgeup = character_updates start_stat = character.stat.unwrap() start_place = character.place.unwrap()
Add docstrings to tests.test_character
LogicalDash_LiSE
train
py
df5614e0e4f79c10066842e5bc5b571a075ad945
diff --git a/spec/flatiron-lab-generator_spec.rb b/spec/flatiron-lab-generator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/flatiron-lab-generator_spec.rb +++ b/spec/flatiron-lab-generator_spec.rb @@ -61,7 +61,9 @@ describe FlatironLabGenerator::TemplateMaker do end it "creates a sinatra-mvc lab" do - + expect(FlatironLabGenerator::TemplateMaker.run("sinatra-mvc",lab_name, "git repo")).to be_nil + expect(`tree #{lab_name}`).to eq("test_lab\n├── Gemfile\n├── README.md\n├── Rakefile\n├── app\n│   ├── controllers\n│   │   └── application_controller.rb\n│   ├── models\n│   └── views\n│   └── layout.erb\n├── config\n│   └── environment.rb\n├── config.ru\n├── db\n│   ├── migrate\n│   └── seeds.rb\n├── public\n│   └── stylesheets\n└── spec\n ├── controllers\n ├── features\n ├── models\n └── spec_helper.rb\n\n13 directories, 9 files\n") + FileUtils.rm_rf(lab_name) end end
sinatra mvc lab now tested
learn-co_learn-generate
train
rb
dd658bde4c2fdbc8c69aabd691ba2285b0b6b443
diff --git a/src/dpdb/dpdb-cache.js b/src/dpdb/dpdb-cache.js index <HASH>..<HASH> 100644 --- a/src/dpdb/dpdb-cache.js +++ b/src/dpdb/dpdb-cache.js @@ -662,6 +662,17 @@ var DPDB_CACHE = { { "type": "android", "rules": [ + { "mdmh": "samsung/*/SM-N920W8/*" }, + { "ua": "SM-N920W8" } + ], + "dpi": [ 515.1, 518.4 ], + "bw": 3, + "ac": 1000 + }, + + { + "type": "android", + "rules": [ { "mdmh": "samsung/*/GT-I9300I/*" }, { "ua": "GT-I9300I" } ],
Add Note 5 user agent variant to Dpdb cache We found that for one of our devices (a Samsung Note 5) the distortions were not being applied correctly, the reason being that the model number is "SM-N<I>W8" for Canadian devices.
immersive-web_webvr-polyfill
train
js
640d3cb535343b48e88d0a6cb5fe99be7c9e97c3
diff --git a/lib/opskeleton/push.rb b/lib/opskeleton/push.rb index <HASH>..<HASH> 100644 --- a/lib/opskeleton/push.rb +++ b/lib/opskeleton/push.rb @@ -11,7 +11,7 @@ module Opsk class Push < Thor::Group include Thorable, Thor::Actions - class_option :writable_remote, :type=> :string, :desc => 'add remote write repo', :default => 'git@' + class_option :writable_remote, :type=> :string, :desc => 'add remote write repo', :default => 'git@github.com:' class_option :dry, :type=> :boolean, :desc => 'dry mode', :default => false def validate @@ -24,7 +24,9 @@ module Opsk if File.exists?("#{d}/.git") g = Git.init(d) add_writable(g,options['writable_remote']) - g.push('writable') unless options['dry'] + if !options['dry'] and g.diff('writable').stats[:files].keys.length > 0 + g.push('writable') + end end end end
push only if there are local changes to be pushed
opskeleton_opskeleton
train
rb
c1b62823ddb5d41bd7b06b69c909ade39b00fd79
diff --git a/source/git-api.js b/source/git-api.js index <HASH>..<HASH> 100644 --- a/source/git-api.js +++ b/source/git-api.js @@ -610,7 +610,7 @@ exports.registerApi = (env) => { if (config.dev) { app.post(`${exports.pathPrefix}/testing/createtempdir`, ensureAuthenticated, (req, res) => { - temp.mkdir('test-temp-dir', (err, path) => res.json({ path: path })); + temp.mkdir('test-temp-dir', (err, tempPath) => res.json({ path: path.normalize(tempPath) })); }); app.post(`${exports.pathPrefix}/testing/createfile`, ensureAuthenticated, (req, res) => { const content = req.body.content ? req.body.content : (`test content\n${Math.random()}\n`);
returning normalized path for temp dir creation
FredrikNoren_ungit
train
js
d75481bdc07cea3a1a716cbe1b41ee0afa3d2b4e
diff --git a/lib/manager.js b/lib/manager.js index <HASH>..<HASH> 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -3,8 +3,8 @@ var EventEmitter = require('events').EventEmitter; var LessFile = require('./lessfile'); function Manager(srcDir, dstDir) { - this.srcDir = srcDir; - this.dstDir = dstDir; + this.srcDir = srcDir.replace(/^.\//, ''); + this.dstDir = dstDir.replace(/^.\//, ''); this.files = {}; this.dependencies = {}; this.pending = 0;
Remove './' from beginning of file paths, it's unnecessary and breaks the file name creation logic
jgonera_autoless
train
js
6ee6f83a0f80943f923aebf9b097c0a58c643652
diff --git a/rollbar-payload/src/test/java/com/rollbar/payload/data/body/FrameTest.java b/rollbar-payload/src/test/java/com/rollbar/payload/data/body/FrameTest.java index <HASH>..<HASH> 100644 --- a/rollbar-payload/src/test/java/com/rollbar/payload/data/body/FrameTest.java +++ b/rollbar-payload/src/test/java/com/rollbar/payload/data/body/FrameTest.java @@ -15,10 +15,10 @@ import static org.junit.Assert.*; * Created by chris on 11/25/15. */ public class FrameTest { - Frame f; + private Frame f; @Before - public void setUp() throws Exception { + public void setUp() { f = new Frame("com.rollbar.payload.data.Frame.java"); }
unused throws clause, makes var private
rollbar_rollbar-java
train
java
0da5793f24a2c440904dff053d328ceaaf823c6f
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100755 --- a/tests.py +++ b/tests.py @@ -299,6 +299,11 @@ class TestSave(SaveAndCheck): [(unicode(s),)] ) + def test_save_and_drop(self): + scraperwiki.sql.save([], dict(foo=7), table_name="dropper") + scraperwiki.sql.execute("DROP TABLE dropper") + scraperwiki.sql.save([], dict(foo=9), table_name="dropper") + class TestQuestionMark(TestCase): def test_one_question_mark_with_nonlist(self): scraperwiki.sql.execute('create table zhuozi (a text);')
Test that after dropping a table, can still save.
scraperwiki_scraperwiki-python
train
py
b46e61113ee621603d55b5a74098a9d145d4df8a
diff --git a/src/Bootstrap/Drupal.php b/src/Bootstrap/Drupal.php index <HASH>..<HASH> 100644 --- a/src/Bootstrap/Drupal.php +++ b/src/Bootstrap/Drupal.php @@ -4,6 +4,7 @@ namespace Drupal\Console\Bootstrap; use Doctrine\Common\Annotations\AnnotationRegistry; use Symfony\Component\HttpFoundation\Request; +use Drupal\Console\Utils\ArgvInputReader; class Drupal { @@ -31,8 +32,20 @@ class Drupal } try { - $request = Request::createFromGlobals(); - $drupalKernel = DrupalKernel::createFromRequest( + $argvInputReader = new ArgvInputReader(); + if ($argvInputReader->get('uri')) { + $uri = $argvInputReader->get('uri'); + if (substr($uri, -1) != '/') { + $uri .= '/'; + } + $uri .= 'index.php'; + $request = Request::create($uri, 'GET', array() , array(), array(), array('SCRIPT_NAME' => $this->appRoot . '/index.php')); + } + else { + $request = Request::createFromGlobals(); + } + + $drupalKernel = DrupalKernel::createFromRequest ( $request, $this->autoload, 'prod',
[BUGFIX #<I>] uri parameter not used (#<I>) - PB: it looks like the uri parameter is not taken in account anymore and the multisite doesn't work - FIX: read the uri option and generate a symfony request accordingly before initializing the drupal container
hechoendrupal_drupal-console
train
php
fa772bc7ec4e7a949993f4f001bb6ad4acb9927e
diff --git a/examples/usbcat/device.py b/examples/usbcat/device.py index <HASH>..<HASH> 100755 --- a/examples/usbcat/device.py +++ b/examples/usbcat/device.py @@ -37,7 +37,7 @@ def noIntr(func): while True: try: return func() - except IOError, exc: + except (IOError, OSError) as exc: if exc.errno != errno.EINTR: raise
examples/usbcat/device: Also catch OSError to retry after EINTR libaio raises OSError (maybe wrongly ?).
vpelletier_python-functionfs
train
py
61622ba9b23068095e9f0ec8be814b29b8e9d45e
diff --git a/DataFixtures/ORM/LoadProductStatusData.php b/DataFixtures/ORM/LoadProductStatusData.php index <HASH>..<HASH> 100755 --- a/DataFixtures/ORM/LoadProductStatusData.php +++ b/DataFixtures/ORM/LoadProductStatusData.php @@ -13,7 +13,7 @@ namespace WellCommerce\Bundle\ProductStatusBundle\DataFixtures\ORM; use Doctrine\Common\Persistence\ObjectManager; -use WellCommerce\Bundle\CoreBundle\DataFixtures\AbstractDataFixture; +use WellCommerce\Bundle\DoctrineBundle\DataFixtures\AbstractDataFixture; use WellCommerce\Bundle\CoreBundle\Helper\Sluggable; use WellCommerce\Bundle\ProductStatusBundle\Entity\ProductStatus;
Moved AbstractDataFixture to DoctrineBundle (cherry picked from commit <I>e<I>ccffb<I>b<I>b<I>d<I>c<I>a8)
WellCommerce_WishlistBundle
train
php
2732eecaa03844474400940212cc1693b01c8fe7
diff --git a/code/model/EventTicket.php b/code/model/EventTicket.php index <HASH>..<HASH> 100644 --- a/code/model/EventTicket.php +++ b/code/model/EventTicket.php @@ -82,7 +82,7 @@ class EventTicket extends DataObject { * @return RequiredFields */ public function getValidator() { - return new RequiredFields('Title', 'Type', 'StartDate', 'EndDate'); + return new RequiredFields('Title', 'Type'); } public function validate() { @@ -90,13 +90,6 @@ class EventTicket extends DataObject { if ($this->Type == 'Price' && !$this->Price->exists()) { $result->error('You must enter a currency and price for fixed price tickets'); } - if (!$this->StartDate){ - $result->error('You must enter a start date'); - } - if (!$this->EndDate) { - $result->error('You must enter an end date'); - } - return $result; }
Removed StartDate and EndDate validation requirements
registripe_registripe-core
train
php
d9c5543bbb0b1949de208ef96cdbe260ae119b70
diff --git a/src/lib/Behat/PageElement/LanguagePicker.php b/src/lib/Behat/PageElement/LanguagePicker.php index <HASH>..<HASH> 100644 --- a/src/lib/Behat/PageElement/LanguagePicker.php +++ b/src/lib/Behat/PageElement/LanguagePicker.php @@ -22,8 +22,8 @@ class LanguagePicker extends Element { parent::__construct($context); $this->fields = [ - 'languagePickerSelector' => '#content_edit_language', - 'languageSelector' => '#content_edit_language .form-check-label', + 'languagePickerSelector' => '.ez-extra-actions--edit:not(.ez-extra-actions--hidden) #content_edit_language', + 'languageSelector' => '.ez-extra-actions--edit:not(.ez-extra-actions--hidden) #content_edit_language .form-check-label', ]; $this->loadingTimeout = 5; }
[Behat] Adjusted language picker selector
ezsystems_ezplatform-admin-ui
train
php
83ca8763a828b4821323e802cdf399a560c9c15c
diff --git a/src/Engine/Elasticsearch/ElasticsearchAdapter.php b/src/Engine/Elasticsearch/ElasticsearchAdapter.php index <HASH>..<HASH> 100644 --- a/src/Engine/Elasticsearch/ElasticsearchAdapter.php +++ b/src/Engine/Elasticsearch/ElasticsearchAdapter.php @@ -44,7 +44,7 @@ class ElasticsearchAdapter implements AdapterInterface throw new EmptyDataException('Empty data for insert.'); } - $this->client->setIndex($collectionName)->setMethod(self::METHOD_POST)->setId($data['id'])->setBody([$data])->execute(); + $this->client->setIndex($collectionName)->setMethod(self::METHOD_POST)->setId($data['id'])->setBody($data)->execute(); } /**
<I> - Removed array brackets.
g4code_data-mapper
train
php
cd94bce348fd9acb03d930d0b902ed184add3957
diff --git a/lib/pay_dirt/use_case.rb b/lib/pay_dirt/use_case.rb index <HASH>..<HASH> 100644 --- a/lib/pay_dirt/use_case.rb +++ b/lib/pay_dirt/use_case.rb @@ -1,4 +1,3 @@ -require_relative "result" module PayDirt module UseCase def self.included(base)
Don't need to require this here
rthbound_pay_dirt
train
rb
b7d84d53b0cffbb55d3baab27f408724461a402f
diff --git a/cmd/kubeadm/app/master/selfhosted.go b/cmd/kubeadm/app/master/selfhosted.go index <HASH>..<HASH> 100644 --- a/cmd/kubeadm/app/master/selfhosted.go +++ b/cmd/kubeadm/app/master/selfhosted.go @@ -219,6 +219,7 @@ func getAPIServerDS(cfg *kubeadmapi.MasterConfiguration, volumes []v1.Volume, vo }, }, Tolerations: []v1.Toleration{kubeadmconstants.MasterToleration}, + DNSPolicy: v1.DNSClusterFirstWithHostNet, }, }, }, @@ -270,7 +271,7 @@ func getControllerManagerDeployment(cfg *kubeadmapi.MasterConfiguration, volumes }, }, Tolerations: []v1.Toleration{kubeadmconstants.MasterToleration}, - DNSPolicy: v1.DNSDefault, + DNSPolicy: v1.DNSClusterFirstWithHostNet, }, }, }, @@ -322,6 +323,7 @@ func getSchedulerDeployment(cfg *kubeadmapi.MasterConfiguration, volumes []v1.Vo }, }, Tolerations: []v1.Toleration{kubeadmconstants.MasterToleration}, + DNSPolicy: v1.DNSClusterFirstWithHostNet, }, }, },
kubeadm: When self-hosting, cluster DNS should be used
kubernetes_kubernetes
train
go
ab74f2bf747936b796f71062e64f092c2d7dcb99
diff --git a/src/frontend/org/voltdb/messaging/InitiateTaskMessage.java b/src/frontend/org/voltdb/messaging/InitiateTaskMessage.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/messaging/InitiateTaskMessage.java +++ b/src/frontend/org/voltdb/messaging/InitiateTaskMessage.java @@ -135,6 +135,7 @@ public class InitiateTaskMessage extends TransactionInfoBaseMessage { m_lastSafeTxnID = buf.getLong(); m_isSinglePartition = buf.get() == 1; + m_invocation = new StoredProcedureInvocation(); m_invocation.initFromBuffer(buf); }
We're gonna need an actual SPI() before we can fill it.
VoltDB_voltdb
train
java
e1f765655b4d050bfbecbb8a19519dbf94604c1b
diff --git a/flusher.go b/flusher.go index <HASH>..<HASH> 100644 --- a/flusher.go +++ b/flusher.go @@ -94,6 +94,12 @@ func (s *Server) FlushLocal(interval time.Duration, metricLimit int) { // since not everything in tempMetrics is safe for sharing go s.flushForward(tempMetrics) + go func() { + for _, p := range s.getPlugins() { + go p.Flush(finalMetrics, s.Hostname) + } + }() + s.flushRemote(finalMetrics, metricLimit) }
Enable plugins on local veneur (fleet) instances
stripe_veneur
train
go
8f9266a6838d990a863c5e16cedab0bbc3adeea0
diff --git a/client/my-sites/hosting/web-server-settings-card/index.js b/client/my-sites/hosting/web-server-settings-card/index.js index <HASH>..<HASH> 100644 --- a/client/my-sites/hosting/web-server-settings-card/index.js +++ b/client/my-sites/hosting/web-server-settings-card/index.js @@ -136,7 +136,7 @@ const WebServerSettingsCard = ( { const getStaticFile404Settings = () => [ { - label: translate( 'Default (recommended)', { + label: translate( 'Default', { comment: 'The default way to handle requests for nonexistent static files.', } ), value: 'default',
WoA: Stop recommending default static file <I> (#<I>)
Automattic_wp-calypso
train
js
f89f2f6d0aaaa77f4a064ce2547c013d53195218
diff --git a/rivescript/rivescript.py b/rivescript/rivescript.py index <HASH>..<HASH> 100644 --- a/rivescript/rivescript.py +++ b/rivescript/rivescript.py @@ -182,12 +182,13 @@ class RiveScript(object): self._warn("Error: " + directory + " is not a directory.") return - for item in os.listdir(directory): - for extension in ext: - if item.lower().endswith(extension): - # Load this file. - self.load_file(os.path.join(directory, item)) - break + for root, subdirs, files in os.walk(rs_directory): + for file in files: + for extension in ext: + if file.lower().endswith(extension): + # Load this file. + self.load_file(os.path.join(root, file)) + break def load_file(self, filename): """Load and parse a RiveScript document.
Added recursive loading to load_directory
aichaos_rivescript-python
train
py
be64eed59d5e5bb4e20a4e92e119f944c49a46bd
diff --git a/src/Window.js b/src/Window.js index <HASH>..<HASH> 100644 --- a/src/Window.js +++ b/src/Window.js @@ -1361,8 +1361,7 @@ const _normalizeUrl = utils._makeNormalizeUrl(options.baseUrl); GlobalContext.clearGamepads(); }; const _onmakeswapchain = context => { - const windowHandle = context.getWindowHandle(); - nativeWindow.setCurrentWindowContext(windowHandle); + context.setTopLevel(false); vrPresentState.glContext = context; vrPresentState.fbo = context.createFramebuffer().id;
Perform XR context setTopLevel set in Window.js
exokitxr_exokit
train
js
129ac80d9c7d790ea69f151c9ec637c0d51ab850
diff --git a/mode/cobol/cobol.js b/mode/cobol/cobol.js index <HASH>..<HASH> 100644 --- a/mode/cobol/cobol.js +++ b/mode/cobol/cobol.js @@ -195,7 +195,7 @@ CodeMirror.defineMode("cobol", function () { case "string": // multi-line string parsing mode var next = false; while ((next = stream.next()) != null) { - if (next == "\"" || next == "\'") { + if ((next == "\"" || next == "\'") && !stream.match(/['"]/, false)) { state.mode = false; break; }
[cobol mode] Highlight single or double quote inside single quotes as closed string
codemirror_CodeMirror
train
js
23c32ed6d3e980114eeaf9193fe378620ec39de6
diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index <HASH>..<HASH> 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -248,7 +248,7 @@ EOT } else { $latestPackage = null; if ($input->getOption('latest')) { - $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo); + $latestPackage = $this->findLatestPackage($package, $composer, $platformRepo, $input->getOption('minor-only')); } if ($input->getOption('outdated') && $input->getOption('strict') && $latestPackage && $latestPackage->getFullPrettyVersion() !== $package->getFullPrettyVersion() && !$latestPackage->isAbandoned()) { $exitCode = 1;
Fix #<I> - inconsistent behavior with minor-only flag
composer_composer
train
php
8ad0ed5b5f2a6dc0eebb6bcdd3f5d37bbceaa69e
diff --git a/test/karma.browserstack.js b/test/karma.browserstack.js index <HASH>..<HASH> 100644 --- a/test/karma.browserstack.js +++ b/test/karma.browserstack.js @@ -8,7 +8,7 @@ module.exports = { bs_firefox_latest_supported: { base: 'BrowserStack', browser: 'firefox', - browser_version: '50',// TODO: Upgrade to test IndexedDB 2.0 + browser_version: '55', os: 'Windows', os_version: 7 }, @@ -50,7 +50,7 @@ module.exports = { bs_chrome_latest_supported: { base: 'BrowserStack', browser: "Chrome", - browser_version: "57", // TODO: Upgrade to test IndexedDB 2.0 + browser_version: "60", os: 'Windows', os_version: 10 }
Upgrade browser tests to browsers supporting IndexedDB <I>
dfahlander_Dexie.js
train
js
1d256ea66fc1318ac12c19d5e526abf6fa25876b
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -141,7 +141,7 @@ function tunnelProxy(server, proxy) { delete headers[pluginMgr.HOST_PORT_HEADER]; } - var realUrl = _rules.rule && _rules.rule.url; + var realUrl = _rules.rule && _rules.rule.url.replace('https:', 'tunnel:'); if (/^tunnel:\/\//.test(realUrl) && realUrl != tunnelUrl) { tunnelUrl = realUrl; data.realUrl = realUrl.replace('tunnel://', '');
refactor: Change https: to tunnel:
avwo_whistle
train
js
9f451e56327be42fd4ba4390be2433202b43dd76
diff --git a/Kwf/Util/Update/Runner.php b/Kwf/Util/Update/Runner.php index <HASH>..<HASH> 100644 --- a/Kwf/Util/Update/Runner.php +++ b/Kwf/Util/Update/Runner.php @@ -101,7 +101,7 @@ class Kwf_Util_Update_Runner $this->_executeUpdatesAction('postUpdate'); if (!$this->_skipClearCache) { if ($this->_verbose) echo "\n"; - Kwf_Util_ClearCache::getInstance()->clearCache('all', !$this->_verbose, true, array('skipMaintenanceBootstrap'=>true)); + Kwf_Util_ClearCache::getInstance()->clearCache('all', $this->_verbose, true, array('skipMaintenanceBootstrap'=>true)); if ($this->_verbose) echo "\n"; } $this->_executeUpdatesAction('postClearCache');
fix logic, verbose means output
koala-framework_koala-framework
train
php
e8fb8693c127c17e4de9bbff752a1759031510ff
diff --git a/languagetool-language-modules/uk/src/main/java/org/languagetool/rules/uk/UkrainianWordRepeatRule.java b/languagetool-language-modules/uk/src/main/java/org/languagetool/rules/uk/UkrainianWordRepeatRule.java index <HASH>..<HASH> 100644 --- a/languagetool-language-modules/uk/src/main/java/org/languagetool/rules/uk/UkrainianWordRepeatRule.java +++ b/languagetool-language-modules/uk/src/main/java/org/languagetool/rules/uk/UkrainianWordRepeatRule.java @@ -28,6 +28,11 @@ public class UkrainianWordRepeatRule extends WordRepeatRule { } @Override + public String getId() { + return "UKRAINIAN_WORD_REPEAT_RULE"; + } + + @Override public boolean ignore(AnalyzedTokenReadings[] tokens, int position) { AnalyzedTokenReadings analyzedTokenReadings = tokens[position]; String token = analyzedTokenReadings.getToken();
[uk] Give the rule unique id
languagetool-org_languagetool
train
java
f2dfda0c572a425f707e7352cc207c716b29bcae
diff --git a/master/buildbot/test/__init__.py b/master/buildbot/test/__init__.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/__init__.py +++ b/master/buildbot/test/__init__.py @@ -126,3 +126,9 @@ warnings.filterwarnings('ignore', "'U' mode is deprecated", DeprecationWarning) # sqlalchemy.migrate is calling inspect.getargspec() # https://bugs.launchpad.net/sqlalchemy-migrate/+bug/1662472 warnings.filterwarnings('ignore', r"inspect.getargspec\(\) is deprecated") + +# twisted.python.filepath and trial are using bytes file paths when +# the "native" file path (Unicode) should be used on Windows. +warnings.filterwarnings('ignore', + "The Windows bytes API has been " + "deprecated, use Unicode filenames instead")
Ignore warnings about bytes filepaths on Windows with Python 3.
buildbot_buildbot
train
py
d4a29586dc59540333e135fff07a0588994175db
diff --git a/lib/specinfra/version.rb b/lib/specinfra/version.rb index <HASH>..<HASH> 100644 --- a/lib/specinfra/version.rb +++ b/lib/specinfra/version.rb @@ -1,3 +1,3 @@ module Specinfra - VERSION = "2.33.0" + VERSION = "2.33.1" end
Bump up version [skip ci]
mizzy_specinfra
train
rb
856a524c5c25fdb6b8222ca031be078d8f78ba95
diff --git a/tests/integration/adapters/pouch-test.js b/tests/integration/adapters/pouch-test.js index <HASH>..<HASH> 100644 --- a/tests/integration/adapters/pouch-test.js +++ b/tests/integration/adapters/pouch-test.js @@ -20,6 +20,17 @@ module('adapter:pouch [integration]', { // issue. (new PouchDB('ember-pouch-test')).destroy().then(() => { App = startApp(); + var bootPromise; + Ember.run(() => { + if (App.boot) { + App.advanceReadiness(); + bootPromise = App.boot(); + } else { + bootPromise = Ember.RSVP.Promise.resolve(); + } + }); + return bootPromise; + }).then(() => { done(); }); },
Wait for app boot in integration test. In ember-data beta<I> and later, with ember <I> and later, the store is configured in an instance initializer. You have to wait for the app to boot in order for all the instance initializers to have been run.
pouchdb-community_ember-pouch
train
js
612e0b676058105a4c1cbcd867e5c2724a23af4b
diff --git a/src/main/java/skadistats/clarity/processor/runner/ControllableRunner.java b/src/main/java/skadistats/clarity/processor/runner/ControllableRunner.java index <HASH>..<HASH> 100644 --- a/src/main/java/skadistats/clarity/processor/runner/ControllableRunner.java +++ b/src/main/java/skadistats/clarity/processor/runner/ControllableRunner.java @@ -75,7 +75,8 @@ public class ControllableRunner extends AbstractRunner<ControllableRunner> { return Command.FALLTHROUGH; } else { if (tick == -1) { - wantedTick = 0; tick = 0; + wantedTick = 0; + setTick(0); return Command.FALLTHROUGH; } if (demandedTick == null && resetPhase == ResetPhase.FORWARD_TO_WANTED) {
fix bug with end of tick 0 not properly emitted sometimes
skadistats_clarity
train
java
0288333c0bc08aa70df4fff725bb59d2010a8603
diff --git a/blog/classes/privacy/provider.php b/blog/classes/privacy/provider.php index <HASH>..<HASH> 100644 --- a/blog/classes/privacy/provider.php +++ b/blog/classes/privacy/provider.php @@ -212,7 +212,7 @@ class provider implements // Loop over each blog entry in context. $sql = "userid = :userid AND module IN (:blog, :blogext) AND id $insql"; $params = array_merge($inparams, ['userid' => $contextuserid, 'blog' => 'blog', 'blogext' => 'blog_external']); - $recordset = $DB->get_recordset_select('post', $sql, $params); + $recordset = $DB->get_recordset_select('post', $sql, $params, 'id'); foreach ($recordset as $record) { $subject = format_string($record->subject);
MDL-<I> core_blog: Prevent randomness in comments order
moodle_moodle
train
php
8d0bec5728fd502b708e87f4735729be93086317
diff --git a/terraform/eval_validate.go b/terraform/eval_validate.go index <HASH>..<HASH> 100644 --- a/terraform/eval_validate.go +++ b/terraform/eval_validate.go @@ -208,10 +208,8 @@ func (n *EvalValidateProvisioner) validateConnConfig(ctx EvalContext, config *co // exactly what is expected for a given connection type. var connectionBlockSupersetSchema = &configschema.Block{ Attributes: map[string]*configschema.Attribute{ - "type": { - Type: cty.String, - Required: true, - }, + // NOTE: "type" is not included here because it's treated special + // by the config loader and stored away in a separate field. // Common attributes for both connection types "user": {
core: Don't include "type" in connection block schema The config loader already extracts this during its initial pass and saves it as a separate field in a configs.Connection value, so requiring it again here causes confusing errors about this attribute being provided but not set.
hashicorp_terraform
train
go
a6a5e272bb45193605e851d4fb9475a762f231c2
diff --git a/test/kamerling/logging_test.rb b/test/kamerling/logging_test.rb index <HASH>..<HASH> 100644 --- a/test/kamerling/logging_test.rb +++ b/test/kamerling/logging_test.rb @@ -83,6 +83,7 @@ module Kamerling end it 'logs UDP server receives' do + run_all_threads 100.times { udp_client.send 'PING', 0, *udp_server.addr } udp_addr = Addr['127.0.0.1', udp_client.addr[1], :UDP] run_all_threads
The need to rewrite logging to synced: <I>%
chastell_kamerling
train
rb
b3cc7c4badd7c53e477eebba6fdba15f5294590d
diff --git a/src/saml2/saml.py b/src/saml2/saml.py index <HASH>..<HASH> 100644 --- a/src/saml2/saml.py +++ b/src/saml2/saml.py @@ -166,11 +166,16 @@ class AttributeValueBase(SamlBase): try: self.extension_attributes[XSI_TYPE] = typ - self.extension_attributes['xmlns:xs'] = XS_NAMESPACE except AttributeError: - self._extatt['xmlns:xs'] = XS_NAMESPACE self._extatt[XSI_TYPE] = typ + if typ.startswith('xs:'): + try: + self.extension_attributes['xmlns:xs'] = XS_NAMESPACE + except AttributeError: + self._extatt['xmlns:xs'] = XS_NAMESPACE + + def get_type(self): try: return self.extension_attributes[XSI_TYPE]
It's cleaner to conditionally add this attribute As per @jgehrcke's comment
IdentityPython_pysaml2
train
py
c60e1161215592d8098776d0bb024647d29eac64
diff --git a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +++ b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb @@ -156,8 +156,6 @@ module Vagrant new_port: repaired_port.to_s)) end end - - @app.call(env) end def lease_check(port)
Remove redundant app call from action "handle_forwarded_port_collisions" This call should not be in the `handle` helper method. It is specified in the `call` method already.
hashicorp_vagrant
train
rb
7bef236860784171c43b186dfd5d3af466a9d416
diff --git a/lib/sup/colormap.rb b/lib/sup/colormap.rb index <HASH>..<HASH> 100644 --- a/lib/sup/colormap.rb +++ b/lib/sup/colormap.rb @@ -213,7 +213,7 @@ class Colormap add symbol, fg, bg, attrs end - BufferManager.flash error if error + warn error if error end def self.instance; @@instance; end
send color errors to the log instead of flashing During startup, when these errors are most likely to occur, not enough buffer initialization has been done for BufferManager.flash to work.
sup-heliotrope_sup
train
rb
d676d24de986e8da600c1e1b11e7089b3d6a89e0
diff --git a/src/Route.php b/src/Route.php index <HASH>..<HASH> 100644 --- a/src/Route.php +++ b/src/Route.php @@ -374,10 +374,9 @@ class Route implements QueryRouteInterface { throw new \InvalidArgumentException; } $callback = $this->get( $which ); - if ( ! is_callable( $callback ) ) { - throw new \DomainException; + if ( is_callable( $callback ) ) { + return call_user_func_array( $callback, $args ); } - return call_user_func_array( $callback, $args ); } } \ No newline at end of file diff --git a/tests/Unit/RouteTest.php b/tests/Unit/RouteTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/RouteTest.php +++ b/tests/Unit/RouteTest.php @@ -13,13 +13,10 @@ class RouteTest extends TestCase { return $route; } - /** - * @expectedException \DomainException - */ - function testAfterFailsIfBadCallbable() { + function testAfterNullIfNotCallbable() { $route = $this->get(); $route->set( 'after', 'foo' ); - $route->runAfter(); + assertNull( $route->runAfter() ); } function testAfter() {
Do not throw if no callable runAfter/Before
Brain-WP_Cortex
train
php,php
27b2fc33a83415822680369783eb7c77a73c6b45
diff --git a/packages/wdio-cli/src/index.js b/packages/wdio-cli/src/index.js index <HASH>..<HASH> 100644 --- a/packages/wdio-cli/src/index.js +++ b/packages/wdio-cli/src/index.js @@ -19,6 +19,17 @@ for (const param of CLI_PARAMS) { } const params = pickBy(argv.argv) + +/** + * fail execution if more than one wdio config file was specified + */ +if (params._.length > 1) { + argv.showHelp() + console.error(`More than one config file was specified: ${params._.join(', ')}`) // eslint-disable-line + console.error('Error: You can only run one wdio config file!') // eslint-disable-line + process.exit(1) +} + const localConf = path.join(process.cwd(), 'wdio.conf.js') const wdioConf = params._[0] || (fs.existsSync(localConf) ? localConf : null)
wdio-cli: make sure only one conf file was specified
webdriverio_webdriverio
train
js
4419527c65fb1912aa9d26e922586ce428aa8202
diff --git a/lib/Models/GlobeOrMap.js b/lib/Models/GlobeOrMap.js index <HASH>..<HASH> 100644 --- a/lib/Models/GlobeOrMap.js +++ b/lib/Models/GlobeOrMap.js @@ -246,12 +246,14 @@ GlobeOrMap.prototype._highlightFeature = function(feature) { 'marker-color': this.terria.baseMapContrastColor }; + var that = this; var removeCallback = this._removeHighlightCallback = function() { - catalogItem._hide(); - catalogItem._disable(); + that._highlightPromise.then(function() { + catalogItem._hide(); + catalogItem._disable(); + }); }; - var that = this; that._highlightPromise = catalogItem.load().then(function() { if (removeCallback !== that._removeHighlightCallback) { return;
Wait for GeoJSON region selection layer to load before hiding it
TerriaJS_terriajs
train
js
4f2f37705f88f459c6707e2f88b4c6b0188c157f
diff --git a/lib/backup/cli/helpers.rb b/lib/backup/cli/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/backup/cli/helpers.rb +++ b/lib/backup/cli/helpers.rb @@ -23,6 +23,10 @@ module Backup begin out, err = '', '' + # popen4 doesn't work in 1.8.7 with stock versions of ruby shipped + # with major OSs. Hack to make it stop segfaulting. + # See: https://github.com/engineyard/engineyard/issues/115 + GC.disable if RUBY_VERSION < '1.9' ps = Open4.popen4(command) do |pid, stdin, stdout, stderr| stdin.close out, err = stdout.read.strip, stderr.read.strip @@ -32,6 +36,8 @@ module Backup Failed to execute system command on #{ RUBY_PLATFORM } Command was: #{ command } EOS + ensure + GC.enable if RUBY_VERSION < '1.9' end if ps.success?
Fix segfaults with Popen4 and Ruby <I>
backup_backup
train
rb
5ec1eb1a779c700a7abd88f4cc51940b036c50b8
diff --git a/tasklib/serializing.py b/tasklib/serializing.py index <HASH>..<HASH> 100644 --- a/tasklib/serializing.py +++ b/tasklib/serializing.py @@ -178,8 +178,8 @@ class SerializingObject(object): def deserialize_tags(self, tags): if isinstance(tags, six.string_types): - return tags.split(',') if tags else [] - return tags or [] + return set(tags.split(',')) if tags else set() + return set(tags or []) def serialize_depends(self, value): # Return the list of uuids
SerializingObject: Serialize tags into sets, not lists
robgolding_tasklib
train
py
5dfa80dd30fb2cee567062e359993cf80fa05b27
diff --git a/confutils/__init__.py b/confutils/__init__.py index <HASH>..<HASH> 100644 --- a/confutils/__init__.py +++ b/confutils/__init__.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals __author__ = "Raphaël Barrois <raphael.barrois+confutils@polytechnique.org>" -__version__ = '0.3.0' +__version__ = '0.3.1' from .configfile import ConfigFile, ConfigLine, Parser from .configfile import ConfigError, ConfigReadingError, ConfigWritingError
Version bump to <I>.
rbarrois_confutils
train
py
af62b77f4f2ee7b85efdb74f5d9635da0ac490d9
diff --git a/core-bundle/src/Resources/contao/library/Contao/Input.php b/core-bundle/src/Resources/contao/library/Contao/Input.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/library/Contao/Input.php +++ b/core-bundle/src/Resources/contao/library/Contao/Input.php @@ -462,6 +462,12 @@ class Input $varValue = strip_tags($varValue, $strAllowedTags); $varValue = str_replace(array('&lt;!--', '&lt;![', '--&gt;'), array('<!--', '<![', '-->'), $varValue); + // Recheck for encoded null bytes + while (strpos($varValue, '\\0') !== false) + { + $varValue = str_replace('\\0', '', $varValue); + } + return $varValue; }
[Core] Fix another weakness in the `Input` class and further harden the `deserialize()` function Fix another weakness in the `Input` class and further harden the `deserialize()` function. Thanks to Martin Auswöger for his input.
contao_contao
train
php
f71aa354bee1909c8cd3e5872db90bc43d662b7f
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -69,7 +69,8 @@ class Class # To opt out of both instance methods, pass <tt>instance_accessor: false</tt>. def class_attribute(*attrs) options = attrs.extract_options! - instance_reader = options.fetch(:instance_accessor, true) && options.fetch(:instance_reader, true) + # double assignment is used to avoid "assigned but unused variable" warning + instance_reader = instance_reader = options.fetch(:instance_accessor, true) && options.fetch(:instance_reader, true) instance_writer = options.fetch(:instance_accessor, true) && options.fetch(:instance_writer, true) # We use class_eval here rather than define_method because class_attribute
Remove 'assigned but unused variable' warning
rails_rails
train
rb
218c2c9f90c9fc9db229ed6cf516631ae00ada64
diff --git a/store_memory.go b/store_memory.go index <HASH>..<HASH> 100644 --- a/store_memory.go +++ b/store_memory.go @@ -67,7 +67,7 @@ func (s *MemoryStore) Get(key string, rate Rate) (Context, error) { return Context{ Limit: rate.Limit, Remaining: remaining, - Reset: time.Now().Add(time.Duration(item.Expiration.Second()) * time.Second).Unix(), + Reset: time.Now().Add(time.Duration(item.Expiration) * time.Second).Unix(), Reached: count > rate.Limit, }, nil }
deal with change of go-cache
ulule_limiter
train
go
428798066937e680bd8d2ce70148e21581f6215a
diff --git a/tools/nni_cmd/config_schema.py b/tools/nni_cmd/config_schema.py index <HASH>..<HASH> 100644 --- a/tools/nni_cmd/config_schema.py +++ b/tools/nni_cmd/config_schema.py @@ -1,8 +1,9 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. -import os import json +import logging +import os import netifaces from schema import Schema, And, Optional, Regex, Or, SchemaError from nni.package_utils import create_validator_instance, get_all_builtin_names, get_builtin_algo_meta @@ -78,6 +79,7 @@ class AlgoSchema: if meta and 'accept_class_args' in meta and meta['accept_class_args'] == False: raise SchemaError('classArgs is not allowed.') + logging.getLogger('nni.protocol').setLevel(logging.ERROR) # we know IPC is not there, don't complain validator = create_validator_instance(algo_type+'s', builtin_name) if validator: try:
shut validator ipc warning (#<I>)
Microsoft_nni
train
py
2f127fab680c44977190e45af82ce23215369a96
diff --git a/configure.py b/configure.py index <HASH>..<HASH> 100755 --- a/configure.py +++ b/configure.py @@ -133,7 +133,9 @@ class Bootstrap: return self.writer.newline() def variable(self, key, val): - self.vars[key] = self._expand(val) + # In bootstrap mode, we have no ninja process to catch /showIncludes + # output. + self.vars[key] = self._expand(val).replace('/showIncludes', '') return self.writer.variable(key, val) def rule(self, name, **kwargs): @@ -308,10 +310,6 @@ if platform.is_msvc(): '/DNOMINMAX', '/D_CRT_SECURE_NO_WARNINGS', '/D_HAS_EXCEPTIONS=0', '/DNINJA_PYTHON="%s"' % options.with_python] - if options.bootstrap: - # In bootstrap mode, we have no ninja process to catch /showIncludes - # output. - cflags.remove('/showIncludes') if platform.msvc_needs_fs(): cflags.append('/FS') ldflags = ['/DEBUG', '/libpath:$builddir']
win: Only drop /showIncludes in bootstrap builds. Fixes #<I>.
ninja-build_ninja
train
py
cfc2ab2fcb9987e18ae746d2947a887e6f44d5f8
diff --git a/views/widget/header-logo.blade.php b/views/widget/header-logo.blade.php index <HASH>..<HASH> 100644 --- a/views/widget/header-logo.blade.php +++ b/views/widget/header-logo.blade.php @@ -1,6 +1,6 @@ @extends('widget.header-widget') @section('widget') - <div class="c-header__logo t-header__logo"> + <div class="c-header__logo"> <a href="{{$home}}"> {!! $logotype !!} </a>
Removes t-class from logo
helsingborg-stad_Municipio
train
php
ea892fce179c51ed7eb0a7c267655dc0cf312234
diff --git a/channeldb/channel.go b/channeldb/channel.go index <HASH>..<HASH> 100644 --- a/channeldb/channel.go +++ b/channeldb/channel.go @@ -1239,11 +1239,11 @@ func syncNewChannel(tx *bbolt.Tx, c *OpenChannel, addrs []net.Addr) error { return putLinkNode(nodeInfoBucket, linkNode) } -// UpdateCommitment updates the commitment state for the specified party -// (remote or local). The commitment stat completely describes the balance -// state at this point in the commitment chain. This method its to be called on -// two occasions: when we revoke our prior commitment state, and when the -// remote party revokes their prior commitment state. +// UpdateCommitment updates the local commitment state. It locks in the pending +// local updates that were received by us from the remote party. The commitment +// state completely describes the balance state at this point in the commitment +// chain. This method its to be called when we revoke our prior commitment +// state. func (c *OpenChannel) UpdateCommitment(newCommitment *ChannelCommitment) error { c.Lock() defer c.Unlock()
channeldb: update UpdateCommitment description This method is only used to update the local commitment transaction. Updated comment accordingly.
lightningnetwork_lnd
train
go
dfb975131d69e4e83394eea2d503b611107eeeb2
diff --git a/cli/github/release_notes.py b/cli/github/release_notes.py index <HASH>..<HASH> 100644 --- a/cli/github/release_notes.py +++ b/cli/github/release_notes.py @@ -47,7 +47,8 @@ class BaseReleaseNotesGenerator(object): class BaseChangeNotesParser(object): - def __init__(self): + def __init__(self, title): + self.title = title self.content = [] def parse(self): @@ -65,8 +66,7 @@ class BaseChangeNotesParser(object): class ChangeNotesLinesParser(BaseChangeNotesParser): def __init__(self, title, start_line): - super(ChangeNotesLinesParser, self).__init__() - self.title = title + super(ChangeNotesLinesParser, self).__init__(title) if not start_line: raise ValueError('start_line cannot be empty') self.start_line = start_line
title is required in init of BaseChangeNotesParser
SFDO-Tooling_CumulusCI
train
py
ebe0de897ba8e291f89e47eb7484a384123881bc
diff --git a/src/directives/schema-form.js b/src/directives/schema-form.js index <HASH>..<HASH> 100644 --- a/src/directives/schema-form.js +++ b/src/directives/schema-form.js @@ -147,6 +147,18 @@ angular.module('schemaForm') // let it be. scope.externalDestructionInProgress = true; }); + + /** + * Evaluate an expression, i.e. scope.$eval + * but do it in parent scope + * + * @param {String} expression + * @param {Object} locals (optional) + * @return {Any} the result of the expression + */ + scope.evalExpr = function(expression, locals) { + return $scope.$parent.$eval(expression, locals); + }; } }; }
Eval expression in man sf-schema directive Needed for new bootrstrap decorators condition
json-schema-form_angular-schema-form
train
js
3597e0032bffdc024bc006b9cc4fb2b4d7e0e941
diff --git a/src/Gitonomy/Git/Commit.php b/src/Gitonomy/Git/Commit.php index <HASH>..<HASH> 100644 --- a/src/Gitonomy/Git/Commit.php +++ b/src/Gitonomy/Git/Commit.php @@ -191,6 +191,14 @@ class Commit } /** + * Returns a fixed-with short hash. + */ + public function getFixedShortHash($length = 6) + { + return substr($this->hash, 0, $length); + } + + /** * Returns parent hashes. * * @return array An array of SHA1 hashes
add a method to get fixed with commit hash
gitonomy_gitlib
train
php
d2665c1f6daf7a17ef13558780433e79a6cccba9
diff --git a/bcbio/install.py b/bcbio/install.py index <HASH>..<HASH> 100644 --- a/bcbio/install.py +++ b/bcbio/install.py @@ -724,7 +724,7 @@ def add_subparser(subparsers): action="append", default=[], type=_check_toolplus) parser.add_argument("--datatarget", help="Data to install. Allows customization or install of extra data.", action="append", default=[], - choices=["variation", "rnaseq", "smallrna", "gemini", "cadd", "vep", "dbnsfp", + choices=["variation", "rnaseq", "smallrna", "gemini", "cadd", "vep", "dbnsfp", "dbscsnv" "battenberg", "kraken"]) parser.add_argument("--genomes", help="Genomes to download", action="append", default=[], choices=SUPPORTED_GENOMES)
added remaining modification for dbscsnv
bcbio_bcbio-nextgen
train
py
edacd8f81f2b662792360a7144190c3e783c2933
diff --git a/src/Service/Config/Fallback.php b/src/Service/Config/Fallback.php index <HASH>..<HASH> 100644 --- a/src/Service/Config/Fallback.php +++ b/src/Service/Config/Fallback.php @@ -126,21 +126,21 @@ abstract class Fallback implements ConfigConstInterface * * @var string */ - protected const CHUNKS_FOLDER = 'chunks'; + public const CHUNKS_FOLDER = 'chunks'; /** * Name of the log folder. * * @var string */ - protected const LOG_FOLDER = 'log'; + public const LOG_FOLDER = 'log'; /** * Name of the config folder. * * @var string */ - protected const CONFIG_FOLDER = 'config'; + public const CONFIG_FOLDER = 'config'; /** * Name of the smokygrey skin.
Made the folder constants public, so plugins could use them.
brainworxx_kreXX
train
php
a37d6a22bc004e470cfa1759317d902e461adedf
diff --git a/src/base/head.js b/src/base/head.js index <HASH>..<HASH> 100644 --- a/src/base/head.js +++ b/src/base/head.js @@ -1,7 +1,7 @@ import { take } from './take' ; /** - * @function head * Same as {@link take}. + * @function head */ export const head = take ; diff --git a/src/map/filter.js b/src/map/filter.js index <HASH>..<HASH> 100644 --- a/src/map/filter.js +++ b/src/map/filter.js @@ -22,7 +22,7 @@ export function* filter ( predicate , iterable ) { } /** - * @function filtertrue * Same as {@link filter}. + * @function filtertrue */ export const filtertrue = filter ;
fix order in documentation of head and filtertrue
aureooms_js-itertools
train
js,js
9e40d76be03034dfd048f33f2231eb27a01e2587
diff --git a/pysd/py_backend/vensim/vensim2py.py b/pysd/py_backend/vensim/vensim2py.py index <HASH>..<HASH> 100644 --- a/pysd/py_backend/vensim/vensim2py.py +++ b/pysd/py_backend/vensim/vensim2py.py @@ -48,7 +48,7 @@ def get_file_sections(file_str): main = !":MACRO:" ~r".+(?!:MACRO:)" name = basic_id / escape_group - basic_id = ~r"[a-zA-Z][a-zA-Z0-9_\s]*" + basic_id = ~r"[a-zA-Z][a-zA-Z0-9_\'\$\s]*" # between quotes, either escaped quote or character that is not a quote escape_group = "\"" ( "\\\"" / ~r"[^\"]" )* "\""
Fix missing grammar definition for identifiers.
JamesPHoughton_pysd
train
py
17ece745117b213c50de7d17c767a5cd8acd4022
diff --git a/version/info.go b/version/info.go index <HASH>..<HASH> 100644 --- a/version/info.go +++ b/version/info.go @@ -26,7 +26,6 @@ var ( Branch string BuildUser string BuildDate string - GoVersion = runtime.Version() ) // Map provides the iterable version information. @@ -36,7 +35,7 @@ var Map = map[string]string{ "branch": Branch, "buildUser": BuildUser, "buildDate": BuildDate, - "goVersion": GoVersion, + "goVersion": runtime.Version(), } func init() {
Simplify runtime version code more It's no longer a build-time injected variable (as the comment above its block indicates), so move it to the map below.
prometheus_prometheus
train
go
f1c799655b867efc4802018a10cfb7c9d8c2ea8a
diff --git a/build-test.js b/build-test.js index <HASH>..<HASH> 100755 --- a/build-test.js +++ b/build-test.js @@ -1,3 +1,15 @@ #!/usr/bin/env node -require('./')() +process.env.NODE_ENV = 'test' + +var path = require('path') +var test = null + +try { + test = require(path.join(process.cwd(), 'package.json')).prebuild.test +} catch (err) { + // do nothing +} + +if (test) require(path.join(process.cwd(), test)) +else require('./')()
support prebuild.test for test script setup
prebuild_node-gyp-build
train
js
07521a91242ce5947f600538e3ad34495b5f42fb
diff --git a/src/js/mep-feature-tracks.js b/src/js/mep-feature-tracks.js index <HASH>..<HASH> 100644 --- a/src/js/mep-feature-tracks.js +++ b/src/js/mep-feature-tracks.js @@ -589,7 +589,8 @@ type: 'GET', dataType: 'jsonp', success: function(d) { - callback(d.responseData.translatedText); + + callback((d.responseData !== null) ? d.responseData.translatedText : 'No translation'); }, error: function(e) { callback(null);
Fixes errors that come when Google translate is over capacity
mediaelement_mediaelement
train
js
29362b1720cf9c8f773b41c7eb5739743a162ea6
diff --git a/backtrader/utils/autodict.py b/backtrader/utils/autodict.py index <HASH>..<HASH> 100644 --- a/backtrader/utils/autodict.py +++ b/backtrader/utils/autodict.py @@ -43,7 +43,13 @@ class AutoDict(dict): if isinstance(val, (AutoDict, AutoOrderedDict)): val._close() + def _open(self): + self._closed = False + def __missing__(self, key): + if self._closed: + raise KeyError + value = self[key] = type(self)() return value
Add exception raising to AutoDict if closed and _open method
backtrader_backtrader
train
py
6502d778601d06b5b0c3b730d4ba3d172a68eb15
diff --git a/lib/dxruby_sdl/font.rb b/lib/dxruby_sdl/font.rb index <HASH>..<HASH> 100644 --- a/lib/dxruby_sdl/font.rb +++ b/lib/dxruby_sdl/font.rb @@ -19,6 +19,7 @@ module DXRubySDL private + # :nocov: if /darwin/ =~ RUBY_PLATFORM FONTS = { 'osaka' => '/Library/Fonts/osaka.ttf', @@ -31,5 +32,6 @@ module DXRubySDL 'IPA Pゴシック' => '/usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf', } end + # :nocov: end end
added :nocov: in Font.
takaokouji_dxruby_sdl
train
rb
56a795df88cfb7b747f9ef061ec14da9136065b9
diff --git a/cmd/jujud/agent/machine.go b/cmd/jujud/agent/machine.go index <HASH>..<HASH> 100644 --- a/cmd/jujud/agent/machine.go +++ b/cmd/jujud/agent/machine.go @@ -720,6 +720,7 @@ func (a *MachineAgent) startAPIWorkers(apiConn api.Connection) (_ worker.Worker, IsFatal: agenterrors.ConnectionIsFatal(logger, apiConn), MoreImportant: agenterrors.MoreImportant, RestartDelay: jworker.RestartDelay, + Logger: logger.Child("runner"), }) defer func() { // If startAPIWorkers exits early with an error, stop the
Add logger to runner for api workers. These run inside the unconverted-api-workers and their state changes are not always obvious. Allow for more detail from the runner.
juju_juju
train
go
b5b64ab8d68f7957722fc1c55e9443c2f6351668
diff --git a/Query/Builder.php b/Query/Builder.php index <HASH>..<HASH> 100755 --- a/Query/Builder.php +++ b/Query/Builder.php @@ -1289,7 +1289,7 @@ class Builder $this->wheres[] = compact('type', 'query', 'boolean'); - $this->addBinding($query->getBindings(), 'where'); + $this->addBinding($query->getRawBindings()['where'], 'where'); } return $this;
Ignore non-where bindings in nested where() constraints (#<I>)
illuminate_database
train
php
caf90aa7f5518cbe96650e11233afa5faed8059a
diff --git a/test/common.js b/test/common.js index <HASH>..<HASH> 100644 --- a/test/common.js +++ b/test/common.js @@ -18,7 +18,7 @@ var Stormpath = require('../lib'); chai.use(sinonChai); function u(){} -u.BASE_URL = 'https://api.stormpath.com/v1'; +u.BASE_URL = 'https://api.stormpath.com'; /** adds '/v1' to relative URL, to work with nock request mocker */ u.v1 = function(s){return '/v1' + s;};
`u.BASE_URL` should not contain `/v1` as this will be added by `u.v1()`
stormpath_stormpath-sdk-node
train
js
3f58fb3fa9109be49e854e9d3c0c901ea8666bc4
diff --git a/lib/active_merchant/billing/gateways/adyen.rb b/lib/active_merchant/billing/gateways/adyen.rb index <HASH>..<HASH> 100644 --- a/lib/active_merchant/billing/gateways/adyen.rb +++ b/lib/active_merchant/billing/gateways/adyen.rb @@ -14,8 +14,6 @@ module ActiveMerchant #:nodoc: def initialize(options = {}) requires!(options, :company, :password) - @company = options[:company] - @password = options[:password] super end @@ -113,7 +111,7 @@ module ActiveMerchant #:nodoc: def headers { - 'Authorization' => 'Basic ' + Base64.encode64("ws@Company.#{@company}:#{@password}").strip + 'Authorization' => 'Basic ' + Base64.encode64("ws@Company.#{@options[:company]}:#{@options[:password]}").strip } end
Reduce the reliance on instance variables.
activemerchant_active_merchant
train
rb
429594b79322f0a31f6190e23cfa34efc8c09233
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -88,7 +88,9 @@ class Application extends BaseApplication )); } - $this['sandstone.push.event_forwarder']->forwardAllEvents($eventName); + $this->before(function () { + $this['sandstone.push.event_forwarder']->forwardAllEvents($eventName); + }); return $this; } @@ -110,7 +112,9 @@ class Application extends BaseApplication )); } - $this['sandstone.push.event_forwarder']->forwardAllEvents($eventsNames); + $this->before(function () { + $this['sandstone.push.event_forwarder']->forwardAllEvents($eventsNames); + }); return $this; }
forward events once application is booting to avoid to use dispatcher prematurely
eole-io_sandstone
train
php
95336d0803c9530798801d6ce5b30200529490a8
diff --git a/templates/ubuntu-10.04.3-server-amd64/definition.rb b/templates/ubuntu-10.04.3-server-amd64/definition.rb index <HASH>..<HASH> 100644 --- a/templates/ubuntu-10.04.3-server-amd64/definition.rb +++ b/templates/ubuntu-10.04.3-server-amd64/definition.rb @@ -7,7 +7,7 @@ Veewee::Session.declare( { "<Esc><Esc><Enter>", "/install/vmlinuz ", "noapic ", - "auto-install/enable", + "auto-install/enable ", "console-setup/ask_detect=false ", "console-setup/modelcode=pc105 ", "console-setup/layoutcode=us ",
Add missing space so auto-install/enable isn't concatenated with next option.
jedi4ever_veewee
train
rb
69e1a82b8a4fb3183a4f3d65f31bcce684672fd7
diff --git a/lib/beetle/client.rb b/lib/beetle/client.rb index <HASH>..<HASH> 100644 --- a/lib/beetle/client.rb +++ b/lib/beetle/client.rb @@ -352,7 +352,7 @@ module Beetle end def queue_name_for_tracing(queue) - "trace-#{queue}-#{Beetle.hostname}-#{$$}" + "trace-#{queue}-#{Beetle.hostname}" end def load_brokers_from_config
don't add process id to trace queues to allow testing dedup
xing_beetle
train
rb
ea427459d849f35cb6e7276596d0e70c8a9b839e
diff --git a/nomad/job_endpoint.go b/nomad/job_endpoint.go index <HASH>..<HASH> 100644 --- a/nomad/job_endpoint.go +++ b/nomad/job_endpoint.go @@ -1213,10 +1213,10 @@ func validateJobUpdate(old, new *structs.Job) error { // Transitioning to/from periodic is disallowed if old.IsPeriodic() && !new.IsPeriodic() { - return fmt.Errorf("cannot update non-periodic job to being periodic") + return fmt.Errorf("cannot update periodic job to being non-periodic") } if new.IsPeriodic() && !old.IsPeriodic() { - return fmt.Errorf("cannot update periodic job to being non-periodic") + return fmt.Errorf("cannot update non-periodic job to being periodic") } // Transitioning to/from parameterized is disallowed
Fix error messages for transitioning jobs to/from periodic The error messages are flipped; when you transition a job from _not_ being periodic to being periodic you get the message "cannot update periodic job to being non-periodic", and vice versa.
hashicorp_nomad
train
go
4ce5ec42d2ba5ad6fb0d2afda173f48d0eb38e90
diff --git a/tests/cli_test.py b/tests/cli_test.py index <HASH>..<HASH> 100644 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -26,7 +26,10 @@ def test_exits_invalid_with_invalid_args(): proc = Popen(('dumb-init', '--yolo', '/bin/true'), stderr=PIPE) _, stderr = proc.communicate() assert proc.returncode == 1 - assert stderr == b"dumb-init: unrecognized option '--yolo'\n" + assert stderr in ( + b"dumb-init: unrecognized option '--yolo'\n", # glibc + b'dumb-init: unrecognized option: yolo\n', # musl + ) @pytest.mark.parametrize('flag', ['-h', '--help'])
Loosen assertion a bit for musl
Yelp_dumb-init
train
py
104458bbaa71a8fb32e4eb73cb050fb4d6ae4eb4
diff --git a/generator/templates/tests-mocha/tests/unit/electron.spec.js b/generator/templates/tests-mocha/tests/unit/electron.spec.js index <HASH>..<HASH> 100644 --- a/generator/templates/tests-mocha/tests/unit/electron.spec.js +++ b/generator/templates/tests-mocha/tests/unit/electron.spec.js @@ -1,4 +1,5 @@ -import spectron from 'spectron' +// eslint-disable-next-line no-undef +const spectron = __non_webpack_require__('spectron') import testWithSpectron from 'vue-cli-plugin-electron-builder/lib/testWithSpectron' import chai from 'chai' import chaiAsPromised from 'chai-as-promised'
fix(generator/mocha): non webpack require spectron
nklayman_vue-cli-plugin-electron-builder
train
js
5926485d1100506f3f7a75e726d75a2358c23369
diff --git a/mysqldef/time.go b/mysqldef/time.go index <HASH>..<HASH> 100644 --- a/mysqldef/time.go +++ b/mysqldef/time.go @@ -51,9 +51,8 @@ const ( // MaxTime is the maximum for mysql time type. MaxTime = time.Duration(838*3600+59*60+59) * time.Second - zeroDatetimeStr = "0000-00-00 00:00:00" - zeroTimestampStr = "0000-00-00 00:00:00" - zeroDateStr = "0000-00-00" + zeroDatetimeStr = "0000-00-00 00:00:00" + zeroDateStr = "0000-00-00" ) // Zero values for different types.
mysqldef: Remove zeroTimestampStr
pingcap_tidb
train
go
2158010362c18eb6b6bcb23e1994a6130e279a22
diff --git a/test_proj/manage.py b/test_proj/manage.py index <HASH>..<HASH> 100755 --- a/test_proj/manage.py +++ b/test_proj/manage.py @@ -1,9 +1,15 @@ #!/usr/bin/env python + +import os +import sys + +path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +sys.path.insert(0, path) + from django.core.management import execute_manager try: import settings # Assumed to be in the same directory. except ImportError: - import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) sys.exit(1)
Fixed issue #<I>: more robust test running (thanks to Tom von Schwerdtner for the idea)
django-admin-tools_django-admin-tools
train
py
71685dc97821b3d26d656e83ea3dd50392ca42c6
diff --git a/Testing/Fakes/MailFake.php b/Testing/Fakes/MailFake.php index <HASH>..<HASH> 100644 --- a/Testing/Fakes/MailFake.php +++ b/Testing/Fakes/MailFake.php @@ -24,6 +24,10 @@ class MailFake implements Mailer */ public function assertSent($mailable, $callback = null) { + if(is_array($mailable)) { + return $this->assertSentTimes($mailable[0], $mailable[1], $callback); + } + PHPUnit::assertTrue( $this->sent($mailable, $callback)->count() > 0, "The expected [{$mailable}] mailable was not sent." diff --git a/Testing/Fakes/QueueFake.php b/Testing/Fakes/QueueFake.php index <HASH>..<HASH> 100644 --- a/Testing/Fakes/QueueFake.php +++ b/Testing/Fakes/QueueFake.php @@ -24,6 +24,10 @@ class QueueFake extends QueueManager implements Queue */ public function assertPushed($job, $callback = null) { + if(is_array($job)) { + return $this->assertPushedTimes($mailable[0], $mailable[1], $callback); + } + PHPUnit::assertTrue( $this->pushed($job, $callback)->count() > 0, "The expected [{$job}] job was not pushed."
allow number of times to be specified in normal methods
illuminate_support
train
php,php
9029e496d99e7ffe09446ba9b7f1c40e495660ab
diff --git a/core/lib/refinery/application_controller.rb b/core/lib/refinery/application_controller.rb index <HASH>..<HASH> 100644 --- a/core/lib/refinery/application_controller.rb +++ b/core/lib/refinery/application_controller.rb @@ -56,7 +56,7 @@ module Refinery end def home_page? - main_app.root_path =~ /^#{request.path}\/?/ + main_app.root_path =~ /^#{Regexp.escape(request.path)}\/?/ end def just_installed?
home_page?(): Escape special characters in request.path Prevents an exception being thrown when the request path evaluates to an invalid regular expression (i.e. unmatched brackets). This should also fix a possible security issue in the sense that we were previously permitting a user to define an arbitrarily complex regex inside the application.
refinery_refinerycms
train
rb
6f3b31a27f1ec656d30d9e9e04bf550aa6f19e2d
diff --git a/phoebe/frontend/io.py b/phoebe/frontend/io.py index <HASH>..<HASH> 100644 --- a/phoebe/frontend/io.py +++ b/phoebe/frontend/io.py @@ -446,6 +446,11 @@ def load_legacy(filename, add_compute_legacy=True, add_compute_phoebe=True): if pnew == 'ld_model': val = val.split(' ')[0] d['value'] = val[0].lower()+val[1::] + # since ld_coeffs is dataset specific make sure there is at least one dataset + if lcno != 0 or rvno != 0: + eb.set_value_all(check_relevant=False, **d) + #now change to take care of bolometric values + d['qualifier'] = d['qualifier']+'_bol' if pnew == 'pot': #print "dict", d d['method'] = 'star' @@ -492,7 +497,6 @@ def load_legacy(filename, add_compute_legacy=True, add_compute_phoebe=True): d['qualifier'] = 'delta' d['value'] = val if len(d) > 0: - eb.set_value_all(check_relevant=False, **d) #print "before", eb['pot@secondary'] #print "rpole before", eb['rpole@secondary']
fixed bug. ld_func and ld_func_bol will now load correctly.
phoebe-project_phoebe2
train
py
79e837952ae0bfc0983d583fac5b4a5fbad77410
diff --git a/lib/Session/Redis.php b/lib/Session/Redis.php index <HASH>..<HASH> 100644 --- a/lib/Session/Redis.php +++ b/lib/Session/Redis.php @@ -108,7 +108,7 @@ class Redis implements Driver { $promisor->fail(new Exception("couldn't acquire lock for new session id", 0, $error)); } else { $this->locks[$newId] = $token; - $promisor->succeed($this->unlock($oldId)); + $promisor->succeed($this->save($oldId, [], 0)); } });
Delete old session on regenerate instead of just unlocking it
amphp_http-server-session
train
php
0ae0ea5f22deeadb84fdeb0a746e3879625e4baf
diff --git a/src/engine/runtime.js b/src/engine/runtime.js index <HASH>..<HASH> 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -77,7 +77,7 @@ util.inherits(Runtime, EventEmitter); /** * How rapidly we try to step threads, in ms. */ -Runtime.THREAD_STEP_INTERVAL = 1000 / 30; +Runtime.THREAD_STEP_INTERVAL = 1000 / 60; // -----------------------------------------------------------------------------
Run threads for <I>fps
LLK_scratch-vm
train
js
42c9a8c518bd5158a5f99b6710e2602c03e45d54
diff --git a/HTML/Directives/Wrap.php b/HTML/Directives/Wrap.php index <HASH>..<HASH> 100644 --- a/HTML/Directives/Wrap.php +++ b/HTML/Directives/Wrap.php @@ -12,8 +12,9 @@ use Gregwar\RST\Nodes\WrapperNode; class Wrap extends SubDirective { protected $class; + protected $uniqid; - public function __construct($class) + public function __construct($class, $uniqid=false) { $this->class = $class; } @@ -25,6 +26,10 @@ class Wrap extends SubDirective public function processSub(Parser $parser, $document, $variable, $data, array $options) { - return new WrapperNode($document, '<div class="'.$this->class.'">', '</div>'); + $class = $this->class; + if ($this->uniqid) { + $class .= ' '.uniqid($this->class); + } + return new WrapperNode($document, '<div class="'.$class.'">', '</div>'); } }
Adding uniqid option to Wrap
doctrine_rst-parser
train
php
fac1b0fe5e14372602a3f2c35f2d41b1a88bcf9e
diff --git a/nydus/db/routers/__init__.py b/nydus/db/routers/__init__.py index <HASH>..<HASH> 100644 --- a/nydus/db/routers/__init__.py +++ b/nydus/db/routers/__init__.py @@ -16,6 +16,9 @@ class BaseRouter(object): retryable = False def get_db(self, cluster, func, *args, **kwargs): - """Return the first entry in the cluster""" + """ + Return the first entry in the cluster + The return value must be iterable + """ return range(len(cluster))
added clarification on the return type for a router
disqus_nydus
train
py
e79ff42662e1bd6fdb5facc890488c2df5b9629c
diff --git a/src/Autosuggest.js b/src/Autosuggest.js index <HASH>..<HASH> 100644 --- a/src/Autosuggest.js +++ b/src/Autosuggest.js @@ -525,7 +525,8 @@ export default class Autosuggest extends Component { } }, onKeyDown: (event, data) => { - switch (event.key) { + const keyCode = event.key || event.code; + switch (keyCode) { case 'ArrowDown': case 'ArrowUp': if (isCollapsed) {
Use event.code as a fallback to event.key (#<I>)
moroshko_react-autosuggest
train
js
d1987351a07798c98c9abb6e00da261b99c6e374
diff --git a/src/main/java/me/corsin/javatools/string/JEmoji.java b/src/main/java/me/corsin/javatools/string/JEmoji.java index <HASH>..<HASH> 100644 --- a/src/main/java/me/corsin/javatools/string/JEmoji.java +++ b/src/main/java/me/corsin/javatools/string/JEmoji.java @@ -21,7 +21,8 @@ public enum JEmoji { FIRE(":fire:", 0xF0, 0x9F, 0x94, 0xA5), NOTES(":notes:", 0xF0, 0x9F, 0x8E, 0xB6), SPARKLES(":sparkles:", 0xE2, 0x9C, 0xA8), - WINK(":wink:", 0xF0, 0x9F, 0x98, 0x89); + WINK(":wink:", 0xF0, 0x9F, 0x98, 0x89), + SPEECH_BALLOON(":speech_balloon:", 0xF0, 0x9F, 0x92, 0xAC); private final String shortCode; private final String utf8HexStr;
Adding the "speech balloon" emoji
rFlex_SCJavaTools
train
java
6a864e07a6800241c88239d58b056d982bad43c1
diff --git a/lib/kafka/consumer_group.rb b/lib/kafka/consumer_group.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/consumer_group.rb +++ b/lib/kafka/consumer_group.rb @@ -113,9 +113,12 @@ module Kafka Protocol.handle_error(response.error_code) end - rescue ConnectionError, UnknownMemberId, RebalanceInProgress, IllegalGeneration => e + rescue ConnectionError, UnknownMemberId, IllegalGeneration => e @logger.error "Error sending heartbeat: #{e}" raise HeartbeatError, e + rescue RebalanceInProgress => e + @logger.warn "Error sending heartbeat: #{e}" + raise HeartbeatError, e rescue NotCoordinatorForGroup @logger.error "Failed to find coordinator for group `#{@group_id}`; retrying..." sleep 1
log RebalanceInProgress in ConsumerGroup#heartbeat as warning Resolves #<I>
zendesk_ruby-kafka
train
rb
026d028171bd0ad83899879e0511c0197c37a5c9
diff --git a/registration/models.py b/registration/models.py index <HASH>..<HASH> 100644 --- a/registration/models.py +++ b/registration/models.py @@ -141,11 +141,14 @@ class RegistrationManager(models.Manager): """ for profile in self.all(): - if profile.activation_key_expired(): - user = profile.user - if not user.is_active: - user.delete() - + try: + if profile.activation_key_expired(): + user = profile.user + if not user.is_active: + user.delete() + profile.delete() + except User.DoesNotExist: + profile.delete() class RegistrationProfile(models.Model): """
RegistrationProfile actually deletes a profile and not only user in delete_expired_users in it's manager, as documented
ubernostrum_django-registration
train
py
5615350a499ccf6966a17b6c98a1ad527e3ee6fb
diff --git a/karaage/cache/usage.py b/karaage/cache/usage.py index <HASH>..<HASH> 100644 --- a/karaage/cache/usage.py +++ b/karaage/cache/usage.py @@ -125,8 +125,5 @@ def get_machine_usage(machine, start, end): date__range=(start, end)).aggregate(usage=Sum('cpu_usage'), jobs=Count('id')) cache = MachineCache.objects.create(machine=machine, start=start, end=end, cpu_hours=data['usage'], no_jobs=data['jobs']) - except MachineCache.MultipleObjectsReturned: - MachineCache.objects.filter(machine=machine, date=datetime.date.today(), start=start, end=end).delete() - return get_machine_usage(machine, start, end) - + return cache.cpu_hours, cache.no_jobs
Simplify. Constraints introduced in cd<I>a<I>e5c2d<I>e<I>ca<I>e<I>c3be<I> should mean that MultipleObjectsReturned never is generated. Change-Id: I<I>ab0c<I>af<I>d<I>e<I>fa5f6d<I>
Karaage-Cluster_karaage
train
py
ae6338577323fad8a6c1c8945a040af747f1f2ba
diff --git a/src/Exscript/workqueue/Job.py b/src/Exscript/workqueue/Job.py index <HASH>..<HASH> 100644 --- a/src/Exscript/workqueue/Job.py +++ b/src/Exscript/workqueue/Job.py @@ -42,12 +42,8 @@ class Job(threading.Thread): self.local_data) except Exception, e: self.exception = e - if self.debug: - name = self.action.name or 'no name' - print 'Job "%s" (%s) failed: %s' % (self.getName(), name, e) - traceback.print_exc() - if self.exception is not None: - self.action.signal_emit('aborted', self.action, e) - else: - self.action.signal_emit('succeeded', self.action) + self.action.signal_emit('aborted', self.action, e) + self.action.signal_emit('completed', self.action) + raise + self.action.signal_emit('succeeded', self.action) self.action.signal_emit('completed', self.action)
Fix: error reporting when debug level is 0.
knipknap_exscript
train
py
036ea3eaf518d9b631717a6583821065f6e23d27
diff --git a/tests/Unit/CommandBuilderTest.php b/tests/Unit/CommandBuilderTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/CommandBuilderTest.php +++ b/tests/Unit/CommandBuilderTest.php @@ -22,7 +22,7 @@ class CommandBuilderTest extends ptlisShellCommandTestcase { private function readAttribute($object, string $property) { - $reflectionObject = new \ReflectionClass($object::class); + $reflectionObject = new \ReflectionClass(get_class($object)); $property = $reflectionObject->getProperty($property); $property->setAccessible(true); return $property->getValue($object);
Fix retrieval of class name in older PHP versions
ptlis_shell-command
train
php
46b7be4834cf759dc003faadc28980e14a232c12
diff --git a/closure/goog/ui/container.js b/closure/goog/ui/container.js index <HASH>..<HASH> 100644 --- a/closure/goog/ui/container.js +++ b/closure/goog/ui/container.js @@ -103,7 +103,7 @@ goog.ui.Container.Orientation = { /** - * Allows an alternative element to be set to recieve key events, otherwise + * Allows an alternative element to be set to receive key events, otherwise * defers to the renderer's element choice. * @type {Element|undefined} * @private @@ -455,6 +455,7 @@ goog.ui.Container.prototype.disposeInternal = function() { this.keyHandler_ = null; } + this.keyEventTarget_ = null; this.childElementIdMap_ = null; this.openItem_ = null; this.renderer_ = null;
Cleaned up keyEventTarget_ member of goog.ui.Container on disposal. R=nicksantos DELTA=2 (1 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-library
train
js
cf156ab045a880ddc71ff474433c2bee1aec13a5
diff --git a/question/editlib.php b/question/editlib.php index <HASH>..<HASH> 100644 --- a/question/editlib.php +++ b/question/editlib.php @@ -215,9 +215,6 @@ function question_list($course, $categoryid, $quizid=0, <th nowrap=\"nowrap\" class=\"header\">$strtype</th>"; echo "</tr>\n"; foreach ($questions as $question) { - if ($question->qtype == RANDOM) { - //continue; - } echo "<tr>\n<td nowrap=\"nowrap\">\n"; if ($quizid) { echo "<a title=\"$straddtoquiz\" href=\"edit.php?addquestion=$question->id&amp;sesskey=$USER->sesskey\"><img
Taking out random question hack that is no longer needed.
moodle_moodle
train
php
0dfb61159f0ff23047d3f974a44a85b0a05fb424
diff --git a/src/MigrationTool/SqlMigrationTool.php b/src/MigrationTool/SqlMigrationTool.php index <HASH>..<HASH> 100644 --- a/src/MigrationTool/SqlMigrationTool.php +++ b/src/MigrationTool/SqlMigrationTool.php @@ -178,7 +178,10 @@ abstract class SqlMigrationTool extends AbstractMigrationTool $this->getPhpDataObject()->beginTransaction(); try { - $result = $this->getPhpDataObject()->exec($migrationData); + $statement = $this->getPhpDataObject()->prepare($migrationData); + $result = $statement->execute(); + while ($statement->nextRowset()); + $statement->closeCursor(); } catch (\Exception $e) { $result = $e; } @@ -205,7 +208,7 @@ abstract class SqlMigrationTool extends AbstractMigrationTool self::MESSAGE__YOU_HAVE_AN_ERROR_IN_YOUR_SQL_SYNTAX__PATH, $context ), - $result->getCode(), + intval($result->getCode()), $result ); }
WIP hot-fixes for MySQL
petrknap_php-migrationtool
train
php
b90c6021508ec5cab6fa0e75f84d039341c48f34
diff --git a/widgets/map/src/main/javascript/mapcore.js b/widgets/map/src/main/javascript/mapcore.js index <HASH>..<HASH> 100644 --- a/widgets/map/src/main/javascript/mapcore.js +++ b/widgets/map/src/main/javascript/mapcore.js @@ -528,6 +528,10 @@ coreMap.Map.prototype.redrawOnResize = function () { $(window).resize(function () { me.width = me.determineWidth(me.mapSelector); me.height = me.determineHeight(me.mapSelector); + + $("canvas").css("height", me.height); + $("canvas").css("width", me. width); + _.debounce(drawChart, 100); });
NEON-<I> layers now match the reactivity of the map and are not cut off when the window's size changes
NextCenturyCorporation_neon
train
js
dc614a2aa15e27a8a8347238e29468cd386d7d8e
diff --git a/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java b/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java index <HASH>..<HASH> 100755 --- a/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java +++ b/src/main/java/net/openhft/chronicle/network/WireTcpHandler.java @@ -94,6 +94,7 @@ public abstract class WireTcpHandler implements TcpHandler { long limit = in.readLimit(); long end = in.readPosition() + length + SIZE_OF_SIZE; + assert end <= limit; long outPos = out.writePosition(); try { @@ -115,11 +116,17 @@ public abstract class WireTcpHandler implements TcpHandler { if (written > 0) return false; - } catch (Exception e) { + } catch (Throwable e) { LOG.error("", e); } finally { in.readLimit(limit); - in.readPosition(end); + try { + in.readPosition(end); + } catch (Exception e) { + throw new IllegalStateException("position: " + end + + ", readLimit: " + in.readLimit() + " " + in.toDebugString(), e); + + } } return true;
CE-<I> Add more diagnostics.
OpenHFT_Chronicle-Network
train
java
34c3e17ee54a6995fbd0008b9c63f3d1539ce299
diff --git a/test/engine_test.rb b/test/engine_test.rb index <HASH>..<HASH> 100644 --- a/test/engine_test.rb +++ b/test/engine_test.rb @@ -20,6 +20,20 @@ class EngineTest < Test::Unit::TestCase assert_match /Unsupported file type/, error.message end + should_eventually 'stop as soon as the error threshold is reached' do + engine = ETL::Engine.new + + assert_equal 0, engine.errors.size + + engine.process ETL::Control::Control.parse_text <<CTL + set_error_threshold 1 + source :in, { :type => :enumerable, :enumerable => (1..100) } + after_read { |row| raise "Failure" } +CTL + + assert_equal 1, engine.errors.size + end + end context 'connection' do
Save test-case for issue #<I>.
activewarehouse_activewarehouse-etl
train
rb
4e3412c52a292f53df96eac0b89ec61a64c5a9aa
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java index <HASH>..<HASH> 100644 --- a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java +++ b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java @@ -368,6 +368,7 @@ public class LottieAnimationView extends AppCompatImageView { lottieDrawable.setCallback(this); boolean isNewComposition = lottieDrawable.setComposition(composition); + enableOrDisableHardwareLayer(); if (!isNewComposition) { // We can avoid re-setting the drawable, and invalidating the view, since the composition // hasn't changed.
Update hardware layer when setComposition is set When the `LottieDrawable` composition is set, it may autoplay the animation so we need to update the layer type. Fixes #<I>
airbnb_lottie-android
train
java
d69b713de52c4f9fd510dfe8cd992502fa46947c
diff --git a/pysnmp/entity/rfc3413/ntforg.py b/pysnmp/entity/rfc3413/ntforg.py index <HASH>..<HASH> 100644 --- a/pysnmp/entity/rfc3413/ntforg.py +++ b/pysnmp/entity/rfc3413/ntforg.py @@ -1,4 +1,8 @@ import time +try: + from sys import version_info +except ImportError: + version_info = ( 0, 0 ) # a really early version from pysnmp.entity.rfc3413 import config from pysnmp.proto.proxy import rfc2576 from pysnmp.proto.api import v2c @@ -160,6 +164,8 @@ class NotificationOriginator: varBinds.append((mibNode.name + (0,), mibNode.syntax)) if additionalVarBinds: + if version_info < (1, 6): + additionalVarBinds = list(additionalVarBinds) varBinds.extend(additionalVarBinds) for varName, varVal in varBinds:
python<I> compatibility fix: [].extend() expects a list, not tuple
etingof_pysnmp
train
py
ca7f3c337fe05237e8d2deeec7ac72d5947809fe
diff --git a/nodeGame.js b/nodeGame.js index <HASH>..<HASH> 100644 --- a/nodeGame.js +++ b/nodeGame.js @@ -6,7 +6,7 @@ var node = exports; - node.version = '0.7.1'; + node.version = '0.7.3'; node.verbosity = 0;
Document refactored. Seems working ok
nodeGame_nodegame-client
train
js