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
ac6188c6763333af9b1826d0c445edac93c8cc32
diff --git a/test/e2e/deployment.go b/test/e2e/deployment.go index <HASH>..<HASH> 100644 --- a/test/e2e/deployment.go +++ b/test/e2e/deployment.go @@ -183,8 +183,9 @@ func stopDeployment(c *clientset.Clientset, oldC client.Interface, ns, deploymen Expect(err).NotTo(HaveOccurred()) Expect(rss.Items).Should(HaveLen(0)) Logf("ensuring deployment %s pods were deleted", deploymentName) + var pods *api.PodList if err := wait.PollImmediate(time.Second, wait.ForeverTestTimeout, func() (bool, error) { - pods, err := c.Core().Pods(ns).List(api.ListOptions{}) + pods, err = c.Core().Pods(ns).List(api.ListOptions{}) if err != nil { return false, err } @@ -193,7 +194,7 @@ func stopDeployment(c *clientset.Clientset, oldC client.Interface, ns, deploymen } return false, nil }); err != nil { - Failf("Failed to remove deployment %s pods!", deploymentName) + Failf("Err : %s\n. Failed to remove deployment %s pods : %+v", deploymentName, pods) } }
Print the remaining pods to debug test flake
kubernetes_kubernetes
train
go
bbb8d6af29d8197237fdee2241eca1dfc061f566
diff --git a/src/transports/flash_transport.js b/src/transports/flash_transport.js index <HASH>..<HASH> 100644 --- a/src/transports/flash_transport.js +++ b/src/transports/flash_transport.js @@ -35,7 +35,11 @@ try { return !!(new ActiveXObject('ShockwaveFlash.ShockwaveFlash')); } catch (e) { - return navigator.mimeTypes["application/x-shockwave-flash"] !== undefined; + return Boolean( + navigator && + navigator.mimeTypes && + navigator.mimeTypes["application/x-shockwave-flash"] !== undefined + ); } };
Change the Flash check if mimeTypes are absent
pusher_pusher-js
train
js
d764b09c8450cb4d53fc8b4f0bd2cae511738443
diff --git a/src/main/java/de/btobastian/javacord/utils/DiscordWebSocketAdapter.java b/src/main/java/de/btobastian/javacord/utils/DiscordWebSocketAdapter.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/btobastian/javacord/utils/DiscordWebSocketAdapter.java +++ b/src/main/java/de/btobastian/javacord/utils/DiscordWebSocketAdapter.java @@ -616,6 +616,11 @@ public class DiscordWebSocketAdapter extends WebSocketAdapter { } @Override + public void handleCallbackError(WebSocket websocket, Throwable cause) throws Exception { + logger.error("Websocket callback error!", cause); + } + + @Override public void onUnexpectedError(WebSocket websocket, WebSocketException cause) throws Exception { logger.warn("Websocket onUnexpected error!", cause); }
Log an error that happens during invocation of callback methods
Javacord_Javacord
train
java
cf52ba771cbe48a4758f24a737807dbbdeb33f2f
diff --git a/lib/yql_query.rb b/lib/yql_query.rb index <HASH>..<HASH> 100644 --- a/lib/yql_query.rb +++ b/lib/yql_query.rb @@ -131,6 +131,10 @@ module YqlQuery self.query.conditions << conditions elsif conditions.kind_of?(Array) self.query.conditions += conditions + elsif conditions.kind_of?(Hash) + conditions.each { |key, value| + self.query.conditions << "#{key} = '#{value}'" + } end self end diff --git a/spec/yql_query_builder_spec.rb b/spec/yql_query_builder_spec.rb index <HASH>..<HASH> 100644 --- a/spec/yql_query_builder_spec.rb +++ b/spec/yql_query_builder_spec.rb @@ -92,6 +92,12 @@ describe YqlQuery::Builder do @builder.query.conditions.include?("name = 'greg'").should be_true @builder.query.conditions.include?("age = 34").should be_true end + + it "should accept conditions as a hash" do + @builder.conditions({ :genre => 'jazz', :type => 'bebop'}) + @builder.query.conditions.include?("genre = 'jazz'").should be_true + @builder.query.conditions.include?("type = 'bebop'").should be_true + end end describe "#sort()" do
allow conditions to be passed as a hash
stve_yql-query
train
rb,rb
c1c2436f490c36619aec8cd16b43fba319161c9f
diff --git a/indra/biopax/processor.py b/indra/biopax/processor.py index <HASH>..<HASH> 100644 --- a/indra/biopax/processor.py +++ b/indra/biopax/processor.py @@ -24,11 +24,16 @@ class BiopaxProcessor(object): bpe = cast_biopax_element(obj) if not is_complex(bpe): continue + citation = self._get_citation(bpe) + source_id = bpe.getUri() members = self._get_complex_members(bpe) if members is not None: complexes = get_combinations(members) for c in complexes: - self.statements.append(Complex(c)) + ev = Evidence(source_api='biopax', + pmid=citation, + source_id=source_id) + self.statements.append(Complex(c, ev)) def get_phosphorylation(self, force_contains=None): stmts = self._get_generic_modification('phospho',
Fill Evidence object for Complex statements in BioPAX
sorgerlab_indra
train
py
9750817bf02a1228369c962a0ae2dcdd13a8ffb5
diff --git a/test/request.test.js b/test/request.test.js index <HASH>..<HASH> 100644 --- a/test/request.test.js +++ b/test/request.test.js @@ -61,10 +61,23 @@ module.exports = { res.send('ok'); }); + app.get('/type', function(req, res){ + assert.strictEqual(true, req.accepts('html')); + assert.strictEqual(true, req.accepts('text/html')); + assert.strictEqual(true, req.accepts('json')); + assert.strictEqual(true, req.accepts('application/json')); + assert.strictEqual(false, req.accepts('svg')); + assert.strictEqual(false, req.accepts('image/svg')); + res.send('ok'); + }); + assert.response(app, { url: '/all', headers: { Accept: '*/*' }}, { body: 'ok' }); assert.response(app, + { url: '/type', headers: { Accept: 'text/*; application/*' }}, + { body: 'ok' }); + assert.response(app, { url: '/', headers: { Accept: 'text/html; application/json; text/*' }}, { body: 'ok' }); },
Added more tests for req.accepts()
expressjs_express
train
js
b523b605b0c68f6cde99d3081b5db59839c2c507
diff --git a/cmd/juju/constraints.go b/cmd/juju/constraints.go index <HASH>..<HASH> 100644 --- a/cmd/juju/constraints.go +++ b/cmd/juju/constraints.go @@ -37,8 +37,8 @@ precedence. Examples: - set-constraints mem=8G (all new machines in the environment must have at least 8GB of RAM) - set-constraints wordpress mem=4G (all new wordpress machines can ignore the 8G constraint above, and require only 4G) + set-constraints mem=8G (all new machines in the environment must have at least 8GB of RAM) + set-constraints --service wordpress mem=4G (all new wordpress machines can ignore the 8G constraint above, and require only 4G) See Also: juju help constraints
fix for bug <I>: bad set-constraints example.
juju_juju
train
go
8f8280efd6f6b59447a7340704fc7792296eb6e1
diff --git a/lib/memcached/rails.rb b/lib/memcached/rails.rb index <HASH>..<HASH> 100644 --- a/lib/memcached/rails.rb +++ b/lib/memcached/rails.rb @@ -1,7 +1,8 @@ - class Memcached alias :get_multi :get #:nodoc: + alias :servers= :set_servers #:nodoc: + public :servers= # A legacy compatibility wrapper for the Memcached class. It has basic compatibility with the <b>memcache-client</b> API. class Rails < ::Memcached
memcache-client allows (forces?) you to set servers with a `servers=` setter
arthurnn_memcached
train
rb
4faec9440167b016c41406db5dd84d08e7cdba0f
diff --git a/features/step_definitions/cli_steps.rb b/features/step_definitions/cli_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/cli_steps.rb +++ b/features/step_definitions/cli_steps.rb @@ -3,8 +3,9 @@ Given /^the environment variable (.+) is "(.+)"$/ do |variable, value| end Then /^the exit status will be "(.+)"$/ do |error| - code = Stove.const_get(error).exit_code - assert_exit_status(code) + # Ruby 1.9.3 sucks + klass = error.split('::').inject(Stove) { |c, n| c.const_get(n) } + assert_exit_status(klass.exit_code) end When /^the CLI options are all off$/ do
Wow Ruby <I>, you suck
tas50_stove
train
rb
0aca065b4fc282e6787ec2f35e80edc6382f752d
diff --git a/fi/validation.php b/fi/validation.php index <HASH>..<HASH> 100644 --- a/fi/validation.php +++ b/fi/validation.php @@ -28,10 +28,10 @@ return array( "array" => "The :attribute must have between :min - :max items." ), "confirmed" => ":attribute vahvistus ei täsmää.", - "date" => "The :attribute is not a valid date.", - "date_format" => "The :attribute does not match the format :format.", + "date" => ":attribute ei ole kelvollinen päivämäärä.", + "date_format" => ":attribute ei vastaa muotoa :format.", "different" => ":attribute ja :other tulee olla eri arvoisia.", - "digits" => "The :attribute must be :digits digits.", + "digits" => ":attribute on oltava :digits numeroin.", "digits_between" => "The :attribute must be between :min and :max digits.", "email" => ":attribute muoto on virheellinen.", "exists" => "valittu :attribute on virheellinen.",
Update validation.php Fixing some lines in the fi lang file.
caouecs_Laravel-lang
train
php
34df3097a288550f77b84c52aa039e285cdcc745
diff --git a/test/browser/routes-test.js b/test/browser/routes-test.js index <HASH>..<HASH> 100644 --- a/test/browser/routes-test.js +++ b/test/browser/routes-test.js @@ -630,3 +630,18 @@ createTest('setRoute with a single parameter should change location correctly', self.finish(); }, 14) }); + +createTest('route should accept _ and . within parameters', { + '/:a': { + on: function root() { + shared.fired.push(location.hash); + } + } +}, function() { + shared.fired = []; + this.navigate('/a_complex_route.co.uk', function root() { + deepEqual(shared.fired, ['#/a_complex_route.co.uk']); + this.finish(); + }); +}); +
[test] Test `_` and `.` in browser routes test
flatiron_director
train
js
ca64ec34edcfd04bef4e87554b7cb28d646094f3
diff --git a/lib/wiston-honeybadger.js b/lib/wiston-honeybadger.js index <HASH>..<HASH> 100644 --- a/lib/wiston-honeybadger.js +++ b/lib/wiston-honeybadger.js @@ -63,7 +63,11 @@ Honey.prototype.log = function(level, msg, meta, callback) { } if (level === 'error') { - callback(null, true); + + this.remote.once('sent', function(){ + callback(null, true); + }); + return this.remote.send(new Error(message.message), meta); } };
LIB: Update how we handle post updates
goliatone_winston-honeybadger
train
js
31e530b37c217b5bbe23bdc95c0f9953ddacc1c0
diff --git a/src/Admin/AbstractAdmin.php b/src/Admin/AbstractAdmin.php index <HASH>..<HASH> 100644 --- a/src/Admin/AbstractAdmin.php +++ b/src/Admin/AbstractAdmin.php @@ -2914,7 +2914,7 @@ EOT; $mapper = new ListMapper($this->getListBuilder(), $this->list, $this); - if (\count($this->getBatchActions()) > 0) { + if (\count($this->getBatchActions()) > 0 && !$this->getRequest()->isXmlHttpRequest()) { $fieldDescription = $this->getModelManager()->getNewFieldDescriptionInstance( $this->getClass(), 'batch',
Fix batch checkbox display when list page is loaded through Ajax
sonata-project_SonataAdminBundle
train
php
1953280da4aad34614e3248c8c7caa9ab9c02bcd
diff --git a/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php b/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php @@ -11,7 +11,7 @@ namespace Symfony\Bridge\Monolog\Handler; -use Monolog\Handler\ChromePhpHandler as BaseChromePhpHandler; +use Monolog\Handler\ChromePHPHandler as BaseChromePhpHandler; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\HttpKernelInterface;
[MonologBridge] updated the class name from Monolog
symfony_symfony
train
php
249b4f51ec9ade57ee4320d9d8395ed443cde722
diff --git a/lib/fernet/token.rb b/lib/fernet/token.rb index <HASH>..<HASH> 100644 --- a/lib/fernet/token.rb +++ b/lib/fernet/token.rb @@ -92,13 +92,12 @@ module Fernet if valid_base64? if unknown_token_version? errors.add :version, "is unknown" + elsif enforce_ttl? && !issued_recent_enough? + errors.add :issued_timestamp, "is too far in the past: token expired" else unless signatures_match? errors.add :signature, "does not match" end - if enforce_ttl? && !issued_recent_enough? - errors.add :issued_timestamp, "is too far in the past: token expired" - end if unacceptable_clock_slew? errors.add :issued_timestamp, "is too far in the future" end
Check TTL as soon as possible during validation
fernet_fernet-rb
train
rb
81cfa9072b79fee57ba8fe1b9ddf8d774aa41f2e
diff --git a/lib/suite.js b/lib/suite.js index <HASH>..<HASH> 100644 --- a/lib/suite.js +++ b/lib/suite.js @@ -102,6 +102,7 @@ Suite.prototype.clone = function() { var suite = new Suite(this.title); debug('clone'); suite.ctx = this.ctx; + suite.root = this.root; suite.timeout(this.timeout()); suite.retries(this.retries()); suite.enableTimeouts(this.enableTimeouts()); diff --git a/test/unit/suite.spec.js b/test/unit/suite.spec.js index <HASH>..<HASH> 100644 --- a/test/unit/suite.spec.js +++ b/test/unit/suite.spec.js @@ -23,7 +23,7 @@ describe('Suite', function() { describe('.clone()', function() { beforeEach(function() { - this.suite = new Suite('To be cloned'); + this.suite = new Suite('To be cloned', {}, true); this.suite._timeout = 3043; this.suite._slow = 101; this.suite._bail = true; @@ -74,6 +74,10 @@ describe('Suite', function() { it('should not copy the values from the _afterAll array', function() { expect(this.suite.clone()._afterAll, 'to be empty'); }); + + it('should copy the root property', function() { + expect(this.suite.clone().root, 'to be', true); + }); }); describe('.timeout()', function() {
Copy Suite property "root" when cloning; closes #<I> (#<I>)
mochajs_mocha
train
js,js
6cac4df0f66a8624eb553169291c2f09842120e1
diff --git a/tests/Notifications/NotificationMailChannelTest.php b/tests/Notifications/NotificationMailChannelTest.php index <HASH>..<HASH> 100644 --- a/tests/Notifications/NotificationMailChannelTest.php +++ b/tests/Notifications/NotificationMailChannelTest.php @@ -294,7 +294,7 @@ class NotificationMailChannelTestNotificationWithMailableContract extends Notifi $mock = Mockery::mock(Illuminate\Contracts\Mail\Mailable::class); $mock->shouldReceive('send')->once()->with(Mockery::on(function ($mailer) { - if (! ($mailer instanceof \Illuminate\Contracts\Mail\Mailer)) { + if (! $mailer instanceof Illuminate\Contracts\Mail\Mailer) { return false; }
remove leading slash and extra brackets
laravel_framework
train
php
838cc9f3971d628157b47ba868d582fe4c26ba84
diff --git a/alarmdecoder/decoder.py b/alarmdecoder/decoder.py index <HASH>..<HASH> 100644 --- a/alarmdecoder/decoder.py +++ b/alarmdecoder/decoder.py @@ -793,7 +793,7 @@ class AlarmDecoder(object): exit = self._exit if self.mode == DSC: - if "QUICK EXIT" in messageUp: + if any(s in messageUp for s in ("QUICK EXIT", "EXIT DELAY")): exit = True else: exit = False
Added 'EXIT DELAY' pattern test to DSC arming panel state logic
nutechsoftware_alarmdecoder
train
py
3420052176195d03f416ceb7f4c370111719e679
diff --git a/jss/jss.py b/jss/jss.py index <HASH>..<HASH> 100755 --- a/jss/jss.py +++ b/jss/jss.py @@ -1458,7 +1458,7 @@ class Package(JSSContainerObject): feu = ElementTree.SubElement(self, "fill_existing_users") feu.text = "false" boot_volume = ElementTree.SubElement(self, "boot_volume_required") - boot_volume.text = "false" + boot_volume.text = "true" allow_uninstalled = ElementTree.SubElement(self, "allow_uninstalled") allow_uninstalled.text = "false" ElementTree.SubElement(self, "os_requirements")
Set all packages to install on reboot.
jssimporter_python-jss
train
py
94be0ea4532bac64d3ff4466618eb0d3b93f6b19
diff --git a/src/Awjudd/FeedReader/FeedReader.php b/src/Awjudd/FeedReader/FeedReader.php index <HASH>..<HASH> 100644 --- a/src/Awjudd/FeedReader/FeedReader.php +++ b/src/Awjudd/FeedReader/FeedReader.php @@ -66,6 +66,13 @@ class FeedReader // Grab the cache location $cache_location = storage_path($this->read_config($configuration, 'cache.location', 'rss-feeds')); + // Is the last character a slash? + if(substr($cache_location, -1) != DIRECTORY_SEPARATOR) + { + // Add in the slash at the end + $cache_location .= DIRECTORY_SEPARATOR; + } + // Check if the folder is available if(!file_exists($cache_location)) {
Fixing a minor bug where the feed reader wasn't dropping the .gitignore file into the storage folder
awjudd_l4-feed-reader
train
php
0ce868ff144528d95aeee50e86dc20467d6fd646
diff --git a/tests/src/ApiTest.php b/tests/src/ApiTest.php index <HASH>..<HASH> 100644 --- a/tests/src/ApiTest.php +++ b/tests/src/ApiTest.php @@ -155,9 +155,11 @@ class ApiTest extends PHPUnit_Framework_TestCase { $api_mock = new Mock\Api_Uri('POSTMARK_API_TEST'); + // Either: Postmark delivery failed: couldn't connect to host + // Or: Postmark delivery failed: Failed to connect to 127.0.0.1 port 80: Connection refused $this->setExpectedException( 'Exception', - 'Postmark delivery failed: Failed to connect to 127.0.0.1 port 80: Connection refused' + 'connect to' ); $response = $api_mock->send(
Fix wrong URI test to work both locally and on Travis
OpenBuildings_postmark
train
php
1f568554dc719b6034528da5cd82e5ee54cc00f3
diff --git a/tests/karma.conf.js b/tests/karma.conf.js index <HASH>..<HASH> 100644 --- a/tests/karma.conf.js +++ b/tests/karma.conf.js @@ -14,10 +14,9 @@ module.exports = function (config) { // list of files / patterns to load in the browser - // TODO: changing this to .ts files causes the test to become lest from 126 to 106. ~20 tests are cutoff by something. Needs a future research files: [ - 'app/tests/test-main.js', - 'app/**/*.js' + 'app/tests/test-main.ts', + 'app/**/*.ts' ], // list of files to exclude @@ -34,7 +33,7 @@ module.exports = function (config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['mocha'], // web server port
tests: mocha reporter and include ts files (#<I>)
NativeScript_nativescript-angular
train
js
12e9853d23a683b6a052da7c10a9eb7f1abb33a4
diff --git a/spyder/plugins/ipythonconsole/widgets/control.py b/spyder/plugins/ipythonconsole/widgets/control.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/ipythonconsole/widgets/control.py +++ b/spyder/plugins/ipythonconsole/widgets/control.py @@ -113,6 +113,7 @@ class ControlWidget(TracebackLinksMixin, GetHelpMixin, QApplication.setOverrideCursor(Qt.PointingHandCursor) else: QApplication.restoreOverrideCursor() + super(ControlWidget, self).mouseMoveEvent(event) def mouseReleaseEvent(self, event): """Ooen anchors when clicked."""
IPython console: Process mouseMoveEvent's in control widget Without this it was not possible to select text in the console.
spyder-ide_spyder
train
py
cb2c9b3bbc29a89eb84f92f6c9e047f7e4f14f60
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/keyAssist.js b/bundles/org.eclipse.orion.client.ui/web/orion/keyAssist.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/keyAssist.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/keyAssist.js @@ -70,16 +70,11 @@ define([ keyAssistContents.addEventListener(util.isFirefox ? "DOMMouseScroll" : "mousewheel", function (e) { //$NON-NLS-2$ //$NON-NLS-1$ this._scrollWheel(e); }.bind(this)); - document.addEventListener("keydown", function (e) { //$NON-NLS-1$ + keyAssistDiv.addEventListener("keydown", function (e) { //$NON-NLS-1$ if (e.keyCode === lib.KEY.ESCAPE) { this.hide(); } }.bind(this)); - document.addEventListener("keypress", function (e) { //$NON-NLS-1$ - if (e.key === "Escape") { - this.hide(); - } - }.bind(this)); lib.addAutoDismiss([keyAssistDiv], function () { this.hide(); }.bind(this));
BCD & DI AVT - Some popup panels can't be closed by keyboard org-ids/web-ide-issues#<I>
eclipse_orion.client
train
js
e084353d7c23f0b2c6727395c48ee1869ab3706a
diff --git a/database/migrations/2018_08_25_102000_create_uploads_table.php b/database/migrations/2018_08_25_102000_create_uploads_table.php index <HASH>..<HASH> 100644 --- a/database/migrations/2018_08_25_102000_create_uploads_table.php +++ b/database/migrations/2018_08_25_102000_create_uploads_table.php @@ -11,6 +11,10 @@ class CreateUploadsTable extends Migration Schema::create('uploads', function (Blueprint $table) { $table->increments('id'); + $table->unsignedBigInteger('file_id')->nullable(); + $table->foreign('file_id')->references('id')->on('files') + ->onUpdate('restrict')->onDelete('cascade'); + $table->timestamps(); }); }
adds file_id in uploads table;
laravel-enso_FileManager
train
php
d781ec4985c312d8f77c5da0dd660836e2defc0c
diff --git a/segments/cwd.py b/segments/cwd.py index <HASH>..<HASH> 100644 --- a/segments/cwd.py +++ b/segments/cwd.py @@ -47,6 +47,8 @@ def get_fg_bg(name): def add_cwd_segment(): cwd = powerline.cwd or os.getenv('PWD') + if not py3: + cwd = cwd.decode("utf-8") cwd = replace_home_dir(cwd) if powerline.args.cwd_mode == 'plain':
fix unicode issue in cwd
b-ryan_powerline-shell
train
py
1df80ba111f0234686a1a35e2544ab7154ef3870
diff --git a/libmachine/provision/utils.go b/libmachine/provision/utils.go index <HASH>..<HASH> 100644 --- a/libmachine/provision/utils.go +++ b/libmachine/provision/utils.go @@ -95,7 +95,7 @@ func ConfigureAuth(p Provisioner) error { // TODO: Switch to passing just authOptions to this func // instead of all these individual fields err = cert.GenerateCert( - []string{ip}, + []string{ip, "localhost"}, authOptions.ServerCertPath, authOptions.ServerKeyPath, authOptions.CaCertPath,
Adding localhost to the list of alt_names When attempting to connect to the docker api from the machine itself, the TLS verification of the certificate checked against the public IP address of the primary interface. This is undesirable on hosts which have NAT rules that block access to that address by default. Adding "localhost" to the list of alt_names allows the cert to be verified and connections to localhost (either <I> or [::1]) to the port to pass verification. Otherwise one would need to disable verification just to connect to the local docker instance.
docker_machine
train
go
839a5f6029d43a28f73bf61086986888c285d5b3
diff --git a/chainer_ui/register.py b/chainer_ui/register.py index <HASH>..<HASH> 100644 --- a/chainer_ui/register.py +++ b/chainer_ui/register.py @@ -24,7 +24,7 @@ def main(): arguments = parser.parse_args() - result_path = arguments.result + result_path = os.path.abspath(arguments.result) if contain_log_file(result_path): new_result_path = Result(result_path)
allow logs to be aliased
chainer_chainerui
train
py
e97f7edda27aa3909672e04a1c4376d3680ef4e2
diff --git a/lib/sailthru.rb b/lib/sailthru.rb index <HASH>..<HASH> 100644 --- a/lib/sailthru.rb +++ b/lib/sailthru.rb @@ -126,7 +126,7 @@ module Sailthru # http://docs.sailthru.com/api/send def send(template_name, email, vars={}, options = {}, schedule_time = nil) warn "[DEPRECATION] `send` is deprecated. Please use `send_email` instead." - send_email(template_name, email, vars={}, options = {}, schedule_time = nil) + send_email(template_name, email, vars, options, schedule_time) end # params:
Removing assignment of vars in deprecated #send method
sailthru_sailthru-ruby-client
train
rb
b8da856c971739196bef8c088895d07da1e06b2e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -4,13 +4,14 @@ var xml2js = require('xml2js'); var xmlParser = new xml2js.Parser({explicitArray: false}); module.exports = function (callback) { - return function xmlHttpResponse(res) { + return function xmlHttpResponse(req, res) { var body = ''; - res.setEncoding('utf8'); - res.on('data', function (chunk) { + req.setEncoding('utf8'); + req.on('data', function (chunk) { body += chunk; }); - res.on('end', function () { + req.on('end', function () { + res.end() xmlParser.parseString(body, callback); }); };
Added `res.end()` call to the `req.on('end', ...` call to close the connection instantly instead of after a (long) timeout period.
bazwilliams_parsexmlresponse
train
js
6584c8b7849502ba34ee8309481e555c7cb7a76c
diff --git a/src/InfoViz/Native/HistogramSelector/index.js b/src/InfoViz/Native/HistogramSelector/index.js index <HASH>..<HASH> 100644 --- a/src/InfoViz/Native/HistogramSelector/index.js +++ b/src/InfoViz/Native/HistogramSelector/index.js @@ -674,8 +674,7 @@ function histogramSelector(publicAPI, model) { model.container = element; if (model.container !== null) { - const cSel = d3.select(model.container) - .style('overflow-y', 'hidden'); + const cSel = d3.select(model.container); createHeader(cSel); // wrapper height is set insize resize() const wrapper = cSel.append('div')
fix(HistogramSelector): Prevent HistogramSelector from editing its container style element
Kitware_paraviewweb
train
js
293d929dd2e628a11bd14d447ec1eeecba80c9d1
diff --git a/comments-bundle/src/Resources/contao/Comments.php b/comments-bundle/src/Resources/contao/Comments.php index <HASH>..<HASH> 100644 --- a/comments-bundle/src/Resources/contao/Comments.php +++ b/comments-bundle/src/Resources/contao/Comments.php @@ -94,7 +94,7 @@ class Comments extends Frontend { $objPartial->setData($objComments->row()); - $objPartial->comment = trim(preg_replace('/{{([^}]+)}}/', '', $objComments->comment)); + $objPartial->comment = trim(str_replace(array('{{', '}}'), array('&#123;&#123;', '&#125;&#125;'), $objComments->comment)); $objPartial->datim = $this->parseDate($GLOBALS['TL_CONFIG']['datimFormat'], $objComments->date); $objPartial->date = $this->parseDate($GLOBALS['TL_CONFIG']['dateFormat'], $objComments->date); $objPartial->class = (($count < 1) ? ' first' : '') . (($count >= ($total - 1)) ? ' last' : '') . (($count % 2 == 0) ? ' even' : ' odd');
[Comments] Various minor issues
contao_contao
train
php
9f1223bdf5733ea2289b5d87940cfcae69aec8b6
diff --git a/rundeckapp/grails-app/assets/javascripts/optionEditKO.js b/rundeckapp/grails-app/assets/javascripts/optionEditKO.js index <HASH>..<HASH> 100644 --- a/rundeckapp/grails-app/assets/javascripts/optionEditKO.js +++ b/rundeckapp/grails-app/assets/javascripts/optionEditKO.js @@ -25,9 +25,10 @@ function OptionEditor(data) { self.showDefaultValue = ko.observable(data.showDefaultValue); self.defaultValue = ko.observable(data.defaultValue); self.optionType = ko.observable(data.optionType); - self.name=ko.observable(data.name); + self.name = ko.observable(data.name); self.bashVarPrefix= data.bashVarPrefix? data.bashVarPrefix:''; self.enforceType = ko.observable(data.enforceType); + self.originalIsNonSecure = data.showDefaultValue; self.tofilebashvar = function (str) { return self.bashVarPrefix + "FILE_" + str.toUpperCase().replace(/[^a-zA-Z0-9_]/g, '_').replace(/[{}$]/, ''); }; @@ -73,4 +74,7 @@ function OptionEditor(data) { self.isNonSecure = ko.computed(function(){ return JSON.parse(self.showDefaultValue()); }); + var subscription = this.optionType.subscribe(function(newValue) { + self.showDefaultValue(self.originalIsNonSecure); + }); }
when playing around with option type, original input type and default value type is holded
rundeck_rundeck
train
js
2dcf71c8bc550d33087a3e76727ada47683d44d2
diff --git a/src/Factory/MetamorphFactory.php b/src/Factory/MetamorphFactory.php index <HASH>..<HASH> 100644 --- a/src/Factory/MetamorphFactory.php +++ b/src/Factory/MetamorphFactory.php @@ -10,7 +10,7 @@ final class MetamorphFactory { public function __invoke(ContainerInterface $container): Metamorph { - $config = (new MetamorphConfigFactory)($container->get('genData')); + $config = (new MetamorphConfigFactory)($container->get('config')); return new Metamorph($config); }
fix what gets grabbed from the container
MetamorphPHP_metamorph
train
php
e53b73fcfb6df36c1a40b6a9961e11bfadf6128a
diff --git a/syn/base/b/wrapper.py b/syn/base/b/wrapper.py index <HASH>..<HASH> 100644 --- a/syn/base/b/wrapper.py +++ b/syn/base/b/wrapper.py @@ -65,7 +65,10 @@ class ListWrapper(Base, Harvester): attrs = super(ListWrapper, self)._istr_attrs(base, pretty, indent) strs = [istr(val, pretty, indent) for val in self] ret = base.join(strs) - ret = base.join([ret, attrs]) + if ret: + ret = base.join([ret, attrs]) + else: + ret = attrs return ret def __iter__(self):
Fixing ListWrapper display when there are no list elements
mbodenhamer_syn
train
py
47b00937694e66f6093e43abc91621db63270e65
diff --git a/server.go b/server.go index <HASH>..<HASH> 100644 --- a/server.go +++ b/server.go @@ -86,6 +86,33 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) { s.logger.Println("Responding:", fuseResp) typed.Respond(fuseResp) + case *bazilfuse.LookupRequest: + // Convert the request. + req := &LookUpInodeRequest{ + Parent: InodeID(typed.Header.Node), + Name: typed.Name, + } + + // Call the file system. + resp, err := s.fs.LookUpInode(ctx, req) + if err != nil { + s.logger.Print("Responding:", err) + typed.RespondError(err) + return + } + + // Convert the response. + fuseResp := &bazilfuse.LookupResponse{ + Node: bazilfuse.NodeID(resp.Child), + Generation: uint64(resp.Generation), + Attr: convertAttributes(resp.Child, resp.Attributes), + AttrValid: resp.AttributesExpiration.Sub(s.clock.Now()), + EntryValid: resp.EntryExpiration.Sub(s.clock.Now()), + } + + s.logger.Print("Responding:", fuseResp) + typed.Respond(fuseResp) + case *bazilfuse.GetattrRequest: // Convert the request. req := &GetInodeAttributesRequest{
Added server support for lookup.
jacobsa_fuse
train
go
b9d7d5228336efaa411c11c431442476d9e3c24e
diff --git a/src/section/SectionBuilder.php b/src/section/SectionBuilder.php index <HASH>..<HASH> 100644 --- a/src/section/SectionBuilder.php +++ b/src/section/SectionBuilder.php @@ -47,7 +47,7 @@ class SectionBuilder extends AbstractBuilder if (($content instanceof SafeString) === false) { $content = htmlentities($content); } - $content = nl2br($content); + $content = SafeString::fromString(nl2br($content)); $content = FieldBuilder::begin() ->setType(Field::FIELD_TYPE_LITERAL) diff --git a/src/table/TableForm.php b/src/table/TableForm.php index <HASH>..<HASH> 100644 --- a/src/table/TableForm.php +++ b/src/table/TableForm.php @@ -73,7 +73,7 @@ class TableForm implements TableFormInterface { $row = $this->getPrototypicalRow(); - if ($row !== null) { + if ($row === null) { $row = $this->getRows()[0]; }
Designate content as safe after nl2br.
AthensFramework_Core
train
php,php
4aef635965e0c0d129076a4242a0e1e3ae9aed41
diff --git a/Kwf/Util/Setup.php b/Kwf/Util/Setup.php index <HASH>..<HASH> 100644 --- a/Kwf/Util/Setup.php +++ b/Kwf/Util/Setup.php @@ -86,10 +86,8 @@ class Kwf_Util_Setup $ret .= "if (!defined('KWF_PATH')) define('KWF_PATH', '".KWF_PATH."');\n"; $ret .= "if (!defined('VENDOR_PATH')) define('VENDOR_PATH', 'vendor');\n"; - $ip = array( - '.', - self::_getZendPath() - ); + $ip = include VENDOR_PATH.'/composer/include_paths.php'; + $ip[] = '.'; $ip[] = 'cache/generated'; foreach (Kwf_Config::getValueArray('includepath') as $t=>$p) { if ($p) $ip[] = $p;
don't just add zf to include_path, add all libraries from composer include_paths fixes phpunit autoloading
koala-framework_koala-framework
train
php
82e020ed3adcf0be840d8bba4af7f059a49e438f
diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py index <HASH>..<HASH> 100644 --- a/salt/modules/iptables.py +++ b/salt/modules/iptables.py @@ -507,6 +507,9 @@ def check(table='filter', chain=None, rule=None, family='ipv4'): ipt_cmd = _iptables_cmd(family) if _has_option('--check', family): + cmd = '{0} -t {1} -C {2} {3}'.format(ipt_cmd, table, chain, rule) + out = __salt__['cmd.run'](cmd) + else: _chain_name = hex(uuid.getnode()) # Create temporary table @@ -525,9 +528,6 @@ def check(table='filter', chain=None, rule=None, family='ipv4'): return True return False - else: - cmd = '{0} -t {1} -C {2} {3}'.format(ipt_cmd, table, chain, rule) - out = __salt__['cmd.run'](cmd) if not out: return True
check for check then check, not check twice fixes #<I>; if --check is available, use it rather than use the more elaborate logic in the check function to workaround older iptables that don't have --check.
saltstack_salt
train
py
a0d8432db284eb47b14e66ca83f9820c40e382d2
diff --git a/lib/grizzly.js b/lib/grizzly.js index <HASH>..<HASH> 100644 --- a/lib/grizzly.js +++ b/lib/grizzly.js @@ -3,7 +3,7 @@ const {promisify} = require('util'); const path = require('path'); -const github = require('@octokit/rest')(); +const Octokit= require('@octokit/rest'); const log = require('debug')('grizzly'); const readjson = promisify(require('readjson')); @@ -27,12 +27,11 @@ module.exports = async (token, options) => { async function release(token, options) { log(token, options); - github.authenticate({ - type: 'oauth', - token, - }); + const octokit = new Octokit({ + auth: `token ${token}`, + }); - await github.repos.createRelease({ + await octokit.repos.createRelease({ owner : options.user, repo : options.repo, tag_name : options.tag,
feature(grizzly) octokit
coderaiser_node-grizzly
train
js
09bfb0df0dbfd317ddc20285c41c5856015d069a
diff --git a/src/expressions/sceneExpression.js b/src/expressions/sceneExpression.js index <HASH>..<HASH> 100644 --- a/src/expressions/sceneExpression.js +++ b/src/expressions/sceneExpression.js @@ -73,12 +73,13 @@ export function evaluateScene(_sceneId, _dynamicState, _context) { } } - // Add reference to scene descriptor. - scene.desc = sceneDesc; - } else { _context.reportError('Scene \'' + _sceneId + '\' has no content field.'); } + + // Add reference to scene descriptor. + scene.desc = sceneDesc; + } else { _context.reportError('Unknown scene \'' + _sceneId + '\'.'); }
Set desc even if scene has no content.
jhorneman_choba-engine
train
js
f6c852018a98773679df02c5571b4336d6c3249b
diff --git a/ucms_tree/src/Form/TreeEditForm.php b/ucms_tree/src/Form/TreeEditForm.php index <HASH>..<HASH> 100644 --- a/ucms_tree/src/Form/TreeEditForm.php +++ b/ucms_tree/src/Form/TreeEditForm.php @@ -76,6 +76,18 @@ class TreeEditForm extends FormBase $form['is_creation'] = ['#type' => 'value', '#value' => $isCreation]; + if ($roles = variable_get('umenu_allowed_roles', [])) { + $form['role'] = [ + '#type' => 'select', + '#title' => $this->t("Role"), + '#options' => $roles, + '#default_value' => $menu->getRole(), + '#empty_option' => $this->t("None"), + '#required' => true, + '#maxlength' => 255, + ]; + } + $form['title'] = [ '#type' => 'textfield', '#title' => $this->t("Title"),
tree: added support for umenu.role property if configured for
makinacorpus_drupal-ucms
train
php
6400d8c934e2245915ee7a58e43a85f75028f619
diff --git a/hpcbench/benchmark/iossd.py b/hpcbench/benchmark/iossd.py index <HASH>..<HASH> 100644 --- a/hpcbench/benchmark/iossd.py +++ b/hpcbench/benchmark/iossd.py @@ -31,6 +31,9 @@ class IOSSDExtractor(MetricsExtractor): BANDWIDTH_OSX_RE = \ re.compile(r'^\s*\d+\s\w+\s\w+\s\w+\s\d*\.?\d+\s\w+\s[(](\d+)') + def __init__(self): + self.s_bandwidth = set() + @property def metrics(self): """ The metrics to be extracted. @@ -82,15 +85,11 @@ class IOSSDExtractor(MetricsExtractor): class IOSSDWriteExtractor(IOSSDExtractor): - def __init__(self): - super(IOSSDWriteExtractor, self).__init__() - self.s_bandwidth = set() + pass class IOSSDReadExtractor(IOSSDExtractor): - def __init__(self): - super(IOSSDReadExtractor, self).__init__() - self.s_bandwidth = set() + pass class IOSSD(Benchmark):
Fix: Initialize member variable in class the uses it.
BlueBrain_hpcbench
train
py
91c898018fce2102e3e400f25e9cb4b01e65927b
diff --git a/jira/exceptions.py b/jira/exceptions.py index <HASH>..<HASH> 100644 --- a/jira/exceptions.py +++ b/jira/exceptions.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals import os import tempfile
added unicode literals to exceptions
pycontribs_jira
train
py
1ddb5e00b7122df7cec134e2e4424f3533159984
diff --git a/hitch/key.py b/hitch/key.py index <HASH>..<HASH> 100644 --- a/hitch/key.py +++ b/hitch/key.py @@ -215,6 +215,20 @@ def bdd(*keywords): .shortcut(*keywords).play() + +@expected(HitchStoryException) +def rbdd(*keywords): + """ + Run stories matching keywords. + """ + settings = _personal_settings().data + settings['engine']['rewrite'] = True + _storybook(settings['engine'])\ + .with_params(**{"python version": settings['params']['python version']})\ + .only_uninherited()\ + .shortcut(*keywords).play() + + @expected(HitchStoryException) def regressfile(filename): """
HITCH : Rewrite bdd command.
crdoconnor_strictyaml
train
py
8d6d73071c0b23e76230aa0879bdfb370588f6b7
diff --git a/openquake/baselib/parallel.py b/openquake/baselib/parallel.py index <HASH>..<HASH> 100644 --- a/openquake/baselib/parallel.py +++ b/openquake/baselib/parallel.py @@ -841,9 +841,8 @@ def qsub(func, allargs, authkey=None): listener = Listener((host, 0), backlog=5, authkey=authkey) try: hostport = listener._listener._socket.getsockname() - subprocess.run( - ['qsub', '-b', 'y', '-t', '1-%d' % len(allargs), - sys.executable, thisfile, '%s:%d' % hostport]) + subprocess.call(['qsub', '-b', 'y', '-t', '1-%d' % len(allargs), + sys.executable, thisfile, '%s:%d' % hostport]) conndict = {} for i, args in enumerate(allargs, 1): monitor = args[-1]
Used subprocess.call for compatibility with Python 2
gem_oq-engine
train
py
1e006407a07d0cf07d8f73ceafa78c515c806020
diff --git a/src/acdhOeaw/schema/file/File.php b/src/acdhOeaw/schema/file/File.php index <HASH>..<HASH> 100644 --- a/src/acdhOeaw/schema/file/File.php +++ b/src/acdhOeaw/schema/file/File.php @@ -187,7 +187,10 @@ class File extends SchemaObject { $meta->addLiteral(RC::titleProp(), basename($this->path)); $meta->addLiteral('http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#filename', basename($this->path)); if (is_file($this->path)) { - $meta->addLiteral('http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasMimeType', mime_content_type($this->path)); + $mime = @mime_content_type($this->path); + if ($mime) { + $meta->addLiteral('http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasMimeType', $mime); + } $meta->addLiteral(RC::get('fedoraSizeProp'), filesize($this->path)); }
File class hardened against mime_content_type() returning a warning
acdh-oeaw_repo-php-util
train
php
fbd915622b24f9e15e3ce294ef0a088e523b319f
diff --git a/src/commands/sites/sites-create.js b/src/commands/sites/sites-create.js index <HASH>..<HASH> 100644 --- a/src/commands/sites/sites-create.js +++ b/src/commands/sites/sites-create.js @@ -50,7 +50,7 @@ const getSiteNameInput = async (name, user, api) => { validate: (input) => /^[a-zA-Z\d-]+$/.test(input) || 'Only alphanumeric characters and hyphens are allowed', }, ]) - name = nameInput + name = nameInput || siteSuggestion } return { name, siteSuggestion }
fix: make site suggestion flow consistent (#<I>)
netlify_cli
train
js
de96916c8f2a071e0177f9e6f5c8f9fd0d5ef37c
diff --git a/ocupy/measures.py b/ocupy/measures.py index <HASH>..<HASH> 100644 --- a/ocupy/measures.py +++ b/ocupy/measures.py @@ -344,7 +344,7 @@ def faster_roc(actuals, controls): # (add the missing triangle) if false_pos_rate[-2] == 1: auc += ((1-true_pos_rate[-3])*.5*(1-false_pos_rate[-3])) - return (auc, true_pos_rate, false_pos_rate, actuals, controls, thresholds) + return (auc, true_pos_rate, false_pos_rate) def exact_roc(actuals, controls): """
Return only auc, tpr and fpr for faster_roc
nwilming_ocupy
train
py
6efe2a50492e92579bfac3748597d03ae527e656
diff --git a/lib/core/src/server/manager/manager-webpack.config.js b/lib/core/src/server/manager/manager-webpack.config.js index <HASH>..<HASH> 100644 --- a/lib/core/src/server/manager/manager-webpack.config.js +++ b/lib/core/src/server/manager/manager-webpack.config.js @@ -10,7 +10,7 @@ import { version } from '../../../package.json'; import { getManagerHeadHtml } from '../utils/template'; import { loadEnv, getBabelRuntimePath } from '../config/utils'; -const r = require.resolve('@storybook/core/package.json').replace('package.json', ''); +const coreDirName = path.dirname(require.resolve('@storybook/core/package.json')); const context = path.join(r, '../../node_modules'); const cacheDir = findCacheDir({ name: 'storybook' });
Update lib/core/src/server/manager/manager-webpack.config.js
storybooks_storybook
train
js
d5268c090a9a5ff1062d5e9952819ca91f7cd613
diff --git a/peewee.py b/peewee.py index <HASH>..<HASH> 100644 --- a/peewee.py +++ b/peewee.py @@ -1266,8 +1266,9 @@ class SelectQuery(BaseQuery): if model not in q: continue - if q[model] == ['*']: - q[model] = model._meta.get_field_names() + if '*' in q[model]: + idx = q[model].index('*') + q[model] = q[model][:idx] + model._meta.get_field_names() + q[model][idx+1:] for col in q[model]: model_cols.append((model, col))
Smarter replacement of '*' in query
coleifer_peewee
train
py
72ca0fd1d0b8557102ff8719039b444c8ea0e9e6
diff --git a/src/js/components/Topology.js b/src/js/components/Topology.js index <HASH>..<HASH> 100644 --- a/src/js/components/Topology.js +++ b/src/js/components/Topology.js @@ -312,7 +312,7 @@ export default class Topology extends Component { let cp1xDelta = Math.max(linkOffset, (delta[0] / 2) + (linkIndex * 2)); if (p1[0] > p2[0]) { - cp1 = [Math.min(p2[0] + cp1xDelta, width), p1[1]]; + cp1 = [Math.min(p2[0] + cp1xDelta, rect.width), p1[1]]; } else { cp1 = [Math.max(0, p1[0] - cp1xDelta), p1[1]]; }
Fixed undefined variable issue in Topology.
grommet_grommet
train
js
83ced3537c21a19db98df1abc539944c1c5dfaa1
diff --git a/monascaclient/common/http.py b/monascaclient/common/http.py index <HASH>..<HASH> 100644 --- a/monascaclient/common/http.py +++ b/monascaclient/common/http.py @@ -221,8 +221,8 @@ class HTTPClient(object): resp = self._make_request(method, url, allow_redirects, timeout, **kwargs) self._check_status_code(resp, method, **kwargs) - except exc.KeystoneException as e: - raise e + except exc.KeystoneException: + raise else: self._check_status_code(resp, method, **kwargs) return resp
Correct reraising of exception When an exception was caught and rethrown, it should call 'raise' without any arguments because it shows the place where an exception occured initially instead of place where the exception re-raised Change-Id: Ida<I>fc<I>eebea<I>c3caa0efc8f7f4c9b<I>f2
openstack_python-monascaclient
train
py
b9e6beaf95c76e83eeff9312eb1c279f65f378bd
diff --git a/app/helpers/binco/bootstrap_form_builder.rb b/app/helpers/binco/bootstrap_form_builder.rb index <HASH>..<HASH> 100644 --- a/app/helpers/binco/bootstrap_form_builder.rb +++ b/app/helpers/binco/bootstrap_form_builder.rb @@ -34,8 +34,8 @@ module Binco # Since select2 support multiple choices (checkboxes) def collection_check_boxes2(method, collection, value_method, text_method, options = {}, html_options = {}) - options ||= {} - options[:multiple] = 'multiple' + html_options ||= {} + html_options[:multiple] = 'multiple' collection_select2 method, collection, value_method, text_method, options, html_options end
Update collection_select2 html_options
codn_binco
train
rb
1a864de9724aebbc809d9ccd042c396b88e4d515
diff --git a/pkg/auth/ldaputil/query_test.go b/pkg/auth/ldaputil/query_test.go index <HASH>..<HASH> 100644 --- a/pkg/auth/ldaputil/query_test.go +++ b/pkg/auth/ldaputil/query_test.go @@ -21,8 +21,8 @@ const ( DefaultQueryAttribute string = "uid" ) -var DefaultAttributes []string = []string{"dn", "cn", "uid"} -var DefaultControls []ldap.Control = nil +var DefaultAttributes = []string{"dn", "cn", "uid"} +var DefaultControls []ldap.Control func TestNewSearchRequest(t *testing.T) { var testCases = []struct { diff --git a/pkg/auth/ldaputil/url.go b/pkg/auth/ldaputil/url.go index <HASH>..<HASH> 100644 --- a/pkg/auth/ldaputil/url.go +++ b/pkg/auth/ldaputil/url.go @@ -205,7 +205,7 @@ func SplitLDAPQuery(query string) (attributes, scope, filter, extensions string, } } -// DeterminmeLDAPScope determines the LDAP search scope. Scope is one of "sub", "one", or "base" +// DetermineLDAPScope determines the LDAP search scope. Scope is one of "sub", "one", or "base" // Default to "sub" to match mod_auth_ldap func DetermineLDAPScope(scope string) (Scope, error) { switch scope {
fix typo and drop = nil drop []string
openshift_origin
train
go,go
f57b91fdbfb24d52dbf8eb973c516eba663e0611
diff --git a/src/terminal-utils.js b/src/terminal-utils.js index <HASH>..<HASH> 100644 --- a/src/terminal-utils.js +++ b/src/terminal-utils.js @@ -1,11 +1,19 @@ const readline = require('readline'); +const isCI = !!process.env.CI; + const utils = { clearLine() { + if (isCI) { + return; + } readline.clearLine(process.stdout, 0); readline.cursorTo(process.stdout, 0, null); }, writeLine(msg) { + if (isCI) { + return; + } this.clearLine(); process.stdout.write(`${msg}`); },
skip logging on CI In a CI env the logging on same line is not reported correctly in ui
qlik-oss_after-work.js
train
js
8c955d439f623fdb462e74f44ff3500e19104121
diff --git a/src/Trident/Module/FrameworkModule/Listener/ExceptionListener.php b/src/Trident/Module/FrameworkModule/Listener/ExceptionListener.php index <HASH>..<HASH> 100644 --- a/src/Trident/Module/FrameworkModule/Listener/ExceptionListener.php +++ b/src/Trident/Module/FrameworkModule/Listener/ExceptionListener.php @@ -220,7 +220,7 @@ TRC; } .pre-message { - font: 18px/30px "Ubuntu Mono", monospace; + font: 16px/24px "Ubuntu Mono", monospace; position: relative; margin-left: -75px; }
Changed pre-esque font size.
strident_Trident
train
php
c82b86d7c76c91aae631ce1e0722d4fc8dc23c34
diff --git a/lib/speakerdeck-scraper.js b/lib/speakerdeck-scraper.js index <HASH>..<HASH> 100644 --- a/lib/speakerdeck-scraper.js +++ b/lib/speakerdeck-scraper.js @@ -25,7 +25,7 @@ function fetchPath(path) { function getUser(userId, page) { if(!userId) { throw new Error("User id needed to scrape"); } - page = page || 1; + page = parseInt(page) || 1; var path = baseUrl + normalisePath(userId) + "?page=" + page; return fetchPath(path).then(function(data){
Ensure page param is a Number
phamann_speakerdeck-scraper
train
js
baaa339151ee31837b7875396b425410bb039eb1
diff --git a/lib/component.js b/lib/component.js index <HASH>..<HASH> 100644 --- a/lib/component.js +++ b/lib/component.js @@ -58,7 +58,7 @@ */ Backbone.React.Component.extend = function () { var Clazz = arguments[0]; - var ReactComponent = React.createClass(_.extend({}, Backbone.React.Component.prototype, Clazz)); + var ReactComponent; var ComponentFactory = function () { var component = new ReactComponent(arguments[0], arguments[1]); Backbone.React.Component.apply(component, arguments); @@ -67,6 +67,8 @@ ComponentFactory.extend = function () { return Backbone.React.Component.extend(_.extend({}, Clazz, arguments[0])); }; + _.extend(ComponentFactory.prototype, Backbone.React.Component.prototype, Clazz); + ReactComponent = React.createClass(ComponentFactory.prototype); return ComponentFactory; }; _.extend(Backbone.React.Component.prototype, Backbone.Events, @@ -98,6 +100,13 @@ this.stopListening(); }, /** + * Crawls to the owner of the component and gets the model. + * @returns {Backbone.Model} + */ + getModel: function () { + return this.getOwner().model; + }, + /** * Crawls this.props.__owner__ recursively until it finds the owner of this component. In case of being a parent component (no owners) it returns itself. * @returns {Backbone.React.Component}
getModel method that crawls to the owner and gets the model
magalhas_backbone-react-component
train
js
4810fc17fb27fb1b63a721ce7f9f731539ea0e39
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -22,8 +22,8 @@ function hash(filepath, bits, format) { resolve(imageFromBuffer(content)); }); }) - .then(image => hashRaw(getImageData(image), bits)) - .then(hexHash => { + .then((image) => hashRaw(getImageData(image), bits)) + .then((hexHash) => { if (format === "hex") return hexHash; if (format === "binary") return hexToBinary(hexHash); }); @@ -56,7 +56,7 @@ function hexToBinary(s) { C: "1100", D: "1101", E: "1110", - F: "1111" + F: "1111", }; let ret = ""; for (let i = 0; i < s.length; i++) { @@ -82,7 +82,7 @@ function binaryToHex(s) { "1100": "c", "1101": "d", "1110": "e", - "1111": "f" + "1111": "f", }; let ret = ""; for (let i = 0; i < s.length; i += 4) { @@ -96,5 +96,5 @@ module.exports = { hash, hashRaw, hexToBinary, - binaryToHex + binaryToHex, };
fix(chore): prettier check
pwlmaciejewski_imghash
train
js
915ea60174cafce7baf376977e3afb910c781fe1
diff --git a/django_libs/raven_default_settings.py b/django_libs/raven_default_settings.py index <HASH>..<HASH> 100644 --- a/django_libs/raven_default_settings.py +++ b/django_libs/raven_default_settings.py @@ -2,6 +2,7 @@ RAVEN_IGNORABLE_USER_AGENTS = [ r'^.*AhrefsBot.*$', r'^.*EasouSpider.*$', + r'^.*FacebookBot.*$', r'^.*Feedfetcher-Google.*$', r'^.*Googlebot.*$', r'^.*Test Certificate Info.*$',
Added FacebookBot to ignorable user agents
bitlabstudio_django-libs
train
py
8196cbf0b6fdb739b331045feb81a404aec9a587
diff --git a/fish_crawler/fish_crawler/items.py b/fish_crawler/fish_crawler/items.py index <HASH>..<HASH> 100644 --- a/fish_crawler/fish_crawler/items.py +++ b/fish_crawler/fish_crawler/items.py @@ -8,11 +8,13 @@ import scrapy -class FishCrawlerItem(scrapy.Item): +class CommonItem(scrapy.Item): title = scrapy.Field() description = scrapy.Field() keywords = scrapy.Field() + p_texts = scrapy.Field() # Text content in each tag <p> url = scrapy.Field() + date = scrapy.Field() # Current page date,general get from Last-Modified in the response links = scrapy.Field() link_texts = scrapy.Field() # Text content in each tag <a> - simhash = scrapy.Field() # Simhash code,depend title,description,keywords and link_texts + simhash = scrapy.Field() # Simhash code,depend title,description,keywords,p_texts and link_texts
Alter fish_crawler module: amend field of CommonItem in the items.py
SylvanasSun_FishFishJump
train
py
fdf3885693ff194157b76d1f2b2c67601af4c2b7
diff --git a/LiSE/character.py b/LiSE/character.py index <HASH>..<HASH> 100644 --- a/LiSE/character.py +++ b/LiSE/character.py @@ -126,13 +126,15 @@ class StatSet(object): def _stat_set(self, k, v): if hasattr(self, '_on_stat_set'): + (branch, tick) = self.engine.time for fun in self._on_stat_set: - fun(self, k, v) + fun(self, branch, tick, k, v) def _stat_del(self, k): if hasattr(self, '_on_stat_set'): + (branch, tick) = self.engine.time for fun in self._on_stat_set: - fun(self, k) + fun(self, branch, tick, k) class ThingPlace(Node, StatSet):
more informative way to call the callbacks
LogicalDash_LiSE
train
py
6aa20f81df05d668db8e6191f59ee5d60cd836c6
diff --git a/usbiss/spi.py b/usbiss/spi.py index <HASH>..<HASH> 100644 --- a/usbiss/spi.py +++ b/usbiss/spi.py @@ -75,14 +75,18 @@ class SPI(USBISS): self.sck_divisor = self.iss_spi_divisor(val) def xfer(self, data): - """Spidev function for transferring bytes to port + """ + Perform SPI transaction. + + The first received byte is either ACK or NACK. + TODO: enforce rule that up to 63 bytes of data can be sent. TODO: enforce rule that there is no gaps in data bytes (what define a gap?) """ self.iss_write([self.SPI_CMD] + data) response = self.iss_read(1 + len(data)) if len(response) != 0: - status = response[0] + status = response.pop(0) if status == 0: raise RuntimeError('USB-ISS: Transmission Error')
Enforce the rule that first element of received SPIS data is ACK and discard it if it is 0.
DancingQuanta_pyusbiss
train
py
f9a3688be185b51dea56d3adeb4abc5bd57400ce
diff --git a/src/de/mrapp/android/preference/activity/view/ToolbarLarge.java b/src/de/mrapp/android/preference/activity/view/ToolbarLarge.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/preference/activity/view/ToolbarLarge.java +++ b/src/de/mrapp/android/preference/activity/view/ToolbarLarge.java @@ -362,6 +362,8 @@ public class ToolbarLarge extends FrameLayout { : R.dimen.bread_crumb_text_size); breadCrumbTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, breadCrumbTextSize); + overlayView.setBackgroundColor(navigationHidden ? Color.TRANSPARENT + : getResources().getColor(R.color.overlay)); if (navigationHidden) { RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) overlayView
The removed the dark overlay of the toolbar on tablets, when the navigation is hidden.
michael-rapp_AndroidPreferenceActivity
train
java
d29e5269ed80fb75afa4e6e31d44049187de9697
diff --git a/src/playbacks/hls/hls.js b/src/playbacks/hls/hls.js index <HASH>..<HASH> 100644 --- a/src/playbacks/hls/hls.js +++ b/src/playbacks/hls/hls.js @@ -115,7 +115,7 @@ export default class HLS extends HTML5VideoPlayback { this._extrapolatedWindowNumSegments = !this.options.playback || typeof (this.options.playback.extrapolatedWindowNumSegments) === 'undefined' ? 2 : this.options.playback.extrapolatedWindowNumSegments this._playbackType = Playback.VOD - this._lastTimeUpdate = null + this._lastTimeUpdate = { current: 0, total: 0 } this._lastDuration = null // for hls streams which have dvr with a sliding window, // the content at the start of the playlist is removed as new @@ -143,7 +143,6 @@ export default class HLS extends HTML5VideoPlayback { // #EXT-X-PLAYLIST-TYPE this._playlistType = null this._recoverAttemptsRemaining = this.options.hlsRecoverAttempts || 16 - this._startTimeUpdateTimer() } _setup() { @@ -354,6 +353,7 @@ export default class HLS extends HTML5VideoPlayback { this._setup() super.play() + this._startTimeUpdateTimer() } pause() {
refactor(hls): change _lasTimeUpdate initial value
clappr_clappr
train
js
734e95fb86be9194fff173d46130cf717d719dd1
diff --git a/public_methods.go b/public_methods.go index <HASH>..<HASH> 100644 --- a/public_methods.go +++ b/public_methods.go @@ -17,6 +17,18 @@ func (fig figure) Print() { } } +// returns a colored string +func (fig figure) ColorString() string { + s := "" + for _, printRow := range fig.Slicify() { + if fig.color != "" { + printRow = colors[fig.color] + printRow + colors["reset"] + } + s += fmt.Sprintf("%s\n", printRow) + } + return s +} + func (fig figure) String() string { s := "" for _, printRow := range fig.Slicify() {
Add a ColorString method (#<I>) Example use cases - Use the colored string and use it in a template
common-nighthawk_go-figure
train
go
9b45b973e1d6063bae6b595fe7bfeaeb09e3f8c9
diff --git a/gwpy/timeseries/core.py b/gwpy/timeseries/core.py index <HASH>..<HASH> 100644 --- a/gwpy/timeseries/core.py +++ b/gwpy/timeseries/core.py @@ -1159,15 +1159,17 @@ class TimeSeriesBaseDict(OrderedDict): # -- find frametype(s) if frametype is None: - frametypes = dict() - for chan in channels: - ftype = datafind.find_best_frametype( - chan, start, end, frametype_match=frametype_match, - allow_tape=allow_tape) + matched = datafind.find_best_frametype( + channels, start, end, frametype_match=frametype_match, + allow_tape=allow_tape) + frametypes = {} + # flip dict to frametypes with a list of channels + for name, ftype in matched.items(): try: - frametypes[ftype].append(chan) + frametypes[ftype].append(name) except KeyError: - frametypes[ftype] = [chan] + frametypes[ftype] = [name] + if verbose and len(frametypes) > 1: gprint("Determined %d frametypes to read" % len(frametypes)) elif verbose:
TimeSeriesDict.find: use multi-channel find_frametype most of the time a user wants to find many channels in a single type, so should optimise to search for all in one
gwpy_gwpy
train
py
ee806a6b30e760f55fe992a2ca2d0fb6bf7e5937
diff --git a/vendor/shims/chai.js b/vendor/shims/chai.js index <HASH>..<HASH> 100644 --- a/vendor/shims/chai.js +++ b/vendor/shims/chai.js @@ -1,5 +1,9 @@ /* global self, define */ +// Declare `expect` as a global here instead of as a var in individual tests. +// This avoids jshint warnings re: `Redefinition of 'expect'`. +self.expect = self.chai.expect; + (function() { function vendorModule() { 'use strict';
shims/chai: Create "expect" global "ember-cli-mocha" does this as well, and while I don't agree with it we should keep it for legacy reasons for now and eventually deprecate.
ember-cli_ember-cli-chai
train
js
cf56e433ccec17b7d57898d8a857885244db64e4
diff --git a/pyani/pyani_graphics.py b/pyani/pyani_graphics.py index <HASH>..<HASH> 100644 --- a/pyani/pyani_graphics.py +++ b/pyani/pyani_graphics.py @@ -235,16 +235,19 @@ def add_mpl_colorbar(dfr, fig, dend, params, orientation='row'): cblist.append(classdict[name]) cbar = pd.Series(cblist) - # Create colourbar axis + # Create colourbar axis - could capture if needed if orientation == 'row': cbaxes = fig.add_subplot(dend['gridspec'][0, 1]) + cbaxes.imshow([[bar] for bar in cbar.values], + cmap=plt.get_cmap(pyani_config.MPL_CBAR), + interpolation='nearest', aspect='auto', + origin='lower') else: cbaxes = fig.add_subplot(dend['gridspec'][1, 0]) - # Could capture returned axis from cbaxes.imshow in variable if required - cbaxes.imshow([cbar], - cmap=plt.get_cmap(pyani_config.MPL_CBAR), - interpolation='nearest', aspect='auto', - origin='lower') + cbaxes.imshow([cbar], + cmap=plt.get_cmap(pyani_config.MPL_CBAR), + interpolation='nearest', aspect='auto', + origin='lower') clean_axis(cbaxes) return cbar
fix colorbar bug introduced in refactor
widdowquinn_pyani
train
py
63089592edf461aca2fd7c98802c2865bd83ef96
diff --git a/IPython/html/tests/widgets/widget.js b/IPython/html/tests/widgets/widget.js index <HASH>..<HASH> 100644 --- a/IPython/html/tests/widgets/widget.js +++ b/IPython/html/tests/widgets/widget.js @@ -216,7 +216,7 @@ casper.notebook_test(function () { ' self.msg = [content, buffers]', 'x=TestWidget()', 'display(x)', - 'print x.model_id'].join('\n'), function(index){ + 'print(x.model_id)'].join('\n'), function(index){ testwidget.index = index; testwidget.model_id = this.get_output_cell(index).text.trim(); }); @@ -239,7 +239,7 @@ casper.notebook_test(function () { this.test.assertEquals(result, ["1.5", "2", "3.1"], "JSON custom serializer kernel -> js"); }); - this.assert_output_equals('print x.array_list.tolist() == [1.51234, 25678.0, 3.1]', + this.assert_output_equals('print(x.array_list.tolist() == [1.51234, 25678.0, 3.1])', 'True', 'JSON custom serializer js -> kernel'); if (this.slimerjs) {
Convert some test code to python2/3 (add parens for print)
jupyter-widgets_ipywidgets
train
js
f68cadaf2b43d16d85b55697d39365ccc9534e49
diff --git a/oauth.go b/oauth.go index <HASH>..<HASH> 100644 --- a/oauth.go +++ b/oauth.go @@ -550,7 +550,7 @@ func (c *Consumer) httpExecute( req.Header.Set("Content-Length", strconv.Itoa(len(body))) if c.debug { - fmt.Printf("Request: %v", req) + fmt.Printf("Request: %v\n", req) } resp, err := c.HttpClient.Do(req) if err != nil {
Add a newline to the debugging output for the HTTP request.
mrjones_oauth
train
go
1e1f8999b9b86dd109a4b39810e3b8727b7f5a93
diff --git a/extract_toc/extract_toc.py b/extract_toc/extract_toc.py index <HASH>..<HASH> 100644 --- a/extract_toc/extract_toc.py +++ b/extract_toc/extract_toc.py @@ -41,6 +41,8 @@ def extract_toc(content): toc.extract() content._content = soup.decode() content.toc = toc.decode() + if content.toc.startswith('<html>'): + content.toc = content.toc[12:-14] def register():
remove undesired <html> and <body> tags from bsoup
getpelican_pelican-plugins
train
py
dd57d6f8705880ba686399440ca295c301b41e30
diff --git a/lib/chef/knife/xargs.rb b/lib/chef/knife/xargs.rb index <HASH>..<HASH> 100644 --- a/lib/chef/knife/xargs.rb +++ b/lib/chef/knife/xargs.rb @@ -62,6 +62,11 @@ class Chef :short => '-t', :description => "Print command to be run on the command line" + option :null_separator, + :short => '-0', + :boolean => true, + :description => "Use the NULL character (\0) as a separator, instead of whitespace" + def run error = false # Get the matches (recursively) @@ -134,8 +139,11 @@ class Chef def get_patterns if config[:patterns] [ config[:patterns] ].flatten + elsif config[:null_separator] + stdin.binmode + stdin.read.split("\000") else - stdin.lines.map { |line| line.chomp } + stdin.read.split(/\s+/) end end
Add xargs -0 for null separator, split on space as well as newline
chef_chef
train
rb
034023730a7dd4b8fb040b11dc2abbf8d4849b71
diff --git a/src/test/java/co/aurasphere/botmill/fb/test/autoreply/template/AnnotatedTemplatedBehaviourTest.java b/src/test/java/co/aurasphere/botmill/fb/test/autoreply/template/AnnotatedTemplatedBehaviourTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/co/aurasphere/botmill/fb/test/autoreply/template/AnnotatedTemplatedBehaviourTest.java +++ b/src/test/java/co/aurasphere/botmill/fb/test/autoreply/template/AnnotatedTemplatedBehaviourTest.java @@ -96,12 +96,6 @@ public class AnnotatedTemplatedBehaviourTest extends BaseFbBotMillMessageTest { reply(new MessageAutoReply("simple text message")); } - @FbBotMillController(eventType=FbBotMillEventType.MESSAGE, text="text message1", caseSensitive = true) - public void replyText1() { - System.out.println(">>>"); - System.out.println("no reply"); - logger.info(">>>"); - } @FbBotMillController(eventType = FbBotMillEventType.MESSAGE_PATTERN, pattern = "(?i:hi)|(?i:hello)|(?i:hey)|(?i:good day)|(?i:home)") public void initialGreeting() {
Fixed test case for Annotated Example
BotMill_fb-botmill
train
java
078a0dcebd2fac975bc3e35ddc64b9847092b0c4
diff --git a/multiqc/modules/seqyclean/seqyclean.py b/multiqc/modules/seqyclean/seqyclean.py index <HASH>..<HASH> 100644 --- a/multiqc/modules/seqyclean/seqyclean.py +++ b/multiqc/modules/seqyclean/seqyclean.py @@ -97,8 +97,7 @@ class MultiqcModule(BaseMultiqcModule): ) self.add_section ( name = 'Seqyclean Results Breakdown', - anchor = 'seqyclean-first', + anchor = 'seqyclean-second', description = 'This shows the breakdown results of the seqyclean process', - helptext = "If you're not sure _how_ to interpret the data, we can help!", plot = bargraph.plot(data_breakdown) ) \ No newline at end of file
modified bar graph ID's to be different
ewels_MultiQC
train
py
c90e8384955c4e73a94ce2a5976cdff2e4960149
diff --git a/agent/http.go b/agent/http.go index <HASH>..<HASH> 100644 --- a/agent/http.go +++ b/agent/http.go @@ -892,7 +892,7 @@ func (s *HTTPServer) parseTokenInternal(req *http.Request, token *string) { value := strings.TrimSpace(strings.Join(parts[1:], " ")) // <Scheme> must be "Bearer" - if scheme == "Bearer" { + if strings.ToLower(scheme) == "bearer" { // Since Bearer tokens shouldnt contain spaces (rfc6750#section-2.1) // "value" is tokenized, only the first item is used tok = strings.TrimSpace(strings.Split(value, " ")[0])
Case sensitive Authorization header with lower-cased scheme in… (#<I>)
hashicorp_consul
train
go
3d2142247ab8d036dc178b0c166aeb21e44d41a7
diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLHelper.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLHelper.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLHelper.java +++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OSQLHelper.java @@ -118,7 +118,7 @@ public class OSQLHelper { if (iValue.startsWith("'") && iValue.endsWith("'")) // STRING fieldValue = stringContent(iValue); - if (iValue.charAt(0) == OStringSerializerHelper.COLLECTION_BEGIN + else if (iValue.charAt(0) == OStringSerializerHelper.COLLECTION_BEGIN && iValue.charAt(iValue.length() - 1) == OStringSerializerHelper.COLLECTION_END) { // COLLECTION/ARRAY final List<String> items = OStringSerializerHelper.smartSplit(iValue.substring(1, iValue.length() - 1),
Fixed issue <I> with the contribution of Konrad
orientechnologies_orientdb
train
java
94e3bd0ee31ede4f14b37e5e642a55a99b7c3890
diff --git a/lib/travis/model/repository.rb b/lib/travis/model/repository.rb index <HASH>..<HASH> 100644 --- a/lib/travis/model/repository.rb +++ b/lib/travis/model/repository.rb @@ -94,7 +94,7 @@ class Repository < ActiveRecord::Base end def admin - @admin ||= Travis::Github::Admin.for_repository(self) + @admin ||= Travis::Services::Github::FindAdmin.for_repository(self) end def slug
Travis::Github was moved to Services
travis-ci_travis-core
train
rb
d400854644b22f015923df9eb6f708ccacfbea0d
diff --git a/mama_cas/tests/views.py b/mama_cas/tests/views.py index <HASH>..<HASH> 100644 --- a/mama_cas/tests/views.py +++ b/mama_cas/tests/views.py @@ -612,6 +612,21 @@ class ProxyViewTests(TestCase): self.assertEqual(response.status_code, 405) + def test_proxy_view_no_service(self): + """ + When called with no service identifier, a ``GET`` request to the view + should return a validation failure. + """ + query_str = "?pgt=%s" % (self.pgt.ticket) + response = self.client.get(reverse('cas_proxy') + query_str) + tree = ElementTree(fromstring(response.content)) + elem = tree.find(XMLNS + 'proxyFailure') + + self.assertIsNotNone(elem) + self.assertEqual(elem.get('code'), 'INVALID_REQUEST') + self.assertEqual(response.status_code, 200) + self.assertEqual(response.get('Content-Type'), 'text/xml') + def test_proxy_view_invalid_ticket(self): """ When called with an invalid ticket identifier, a ``GET`` request to
Add test for no service provided to /proxy
jbittel_django-mama-cas
train
py
dbb2322e620f69bf44271e8600e701a389ca1c9a
diff --git a/lang/fr/error.php b/lang/fr/error.php index <HASH>..<HASH> 100755 --- a/lang/fr/error.php +++ b/lang/fr/error.php @@ -25,6 +25,7 @@ $string['modulerequirementsnotmet'] = 'Le module $string['mustbeteacher'] = 'Vous devez �tre enseignant pour voir cette page'; $string['noinstances'] = 'Il n\'a y aucune instance de $a dans ce cours&nbsp;! '; $string['nonmeaningfulcontent'] = 'Le contenu ne fait pas de sens'; +$string['noparticipatorycms'] = 'D�sol�, aucun module de participation pour lequel faire un rapport.'; $string['notavailable'] = 'Ceci n\'est actuellement pas disponible'; $string['onlyeditown'] = 'Vous ne pouvez modifier que vos propres informations'; $string['onlyeditingteachers'] = 'Seuls les enseignants avec droit de modification peuvent faire ceci.';
Participation report - check for course modules and print an error if there are none.
moodle_moodle
train
php
d09e8e6f500d0c6b237ec1979d5fa64025fbc152
diff --git a/plugins/guests/redhat/cap/nfs_client.rb b/plugins/guests/redhat/cap/nfs_client.rb index <HASH>..<HASH> 100644 --- a/plugins/guests/redhat/cap/nfs_client.rb +++ b/plugins/guests/redhat/cap/nfs_client.rb @@ -15,12 +15,12 @@ module VagrantPlugins protected - def self.systemd? - `ps -o comm= 1`.chomp == 'systemd' + def self.systemd?(machine) + machine.communicate.test("test $(ps -o comm= 1) == 'systemd'") end def self.restart_nfs(machine) - if systemd? + if systemd?(machine) machine.communicate.sudo("/bin/systemctl restart rpcbind nfs") else machine.communicate.sudo("/etc/init.d/rpcbind restart; /etc/init.d/nfs restart")
guests/redhat: Fixed the NFS detection on guest, not host [GH-<I>]
hashicorp_vagrant
train
rb
6bfeea942dac63d5402ad8af3a802468b2a54af2
diff --git a/build/debug.js b/build/debug.js index <HASH>..<HASH> 100644 --- a/build/debug.js +++ b/build/debug.js @@ -24,6 +24,7 @@ write( '\n' + syscall.predicate ); + write( './packages/@glimmer/interfaces/lib/vm-opcodes.d.ts', machine.enumString + '\n\n' + syscall.enumString @@ -62,6 +63,10 @@ ${contents} ); } +/* + Formats the string in accordance with our prettier rules to avoid + test failures. +*/ function format(file, contents) { let linter = new tslint.Linter({ fix: true }); let config = tslint.Configuration.findConfiguration( @@ -69,5 +74,9 @@ function format(file, contents) { __filename ); linter.lint(file, contents, config.results); - linter.getResult(); + let result = linter.getResult(); + + if (result.fixes.length === 0) { + fs.writeFileSync(file, contents, { encoding: 'utf8' }); + } }
Fix bug in opcode generation
glimmerjs_glimmer-vm
train
js
3fe63d10b9a655d350526de69c98c9d9f9bc9d44
diff --git a/src/Core/CoreConstants.php b/src/Core/CoreConstants.php index <HASH>..<HASH> 100644 --- a/src/Core/CoreConstants.php +++ b/src/Core/CoreConstants.php @@ -298,7 +298,7 @@ class CoreConstants * The Request source header value. * @var string REQUESTSOURCEHEADER */ - const USERAGENT = "V3PHPSDK5.3.3"; + const USERAGENT = "V3PHPSDK5.3.4"; public static function getType($string, $return=1) {
Update user agent to the latest release.
intuit_QuickBooks-V3-PHP-SDK
train
php
e6d2a8aacdd2cd84174021e7befd4a04e95dd069
diff --git a/src/main/java/org/acra/dialog/CrashReportDialog.java b/src/main/java/org/acra/dialog/CrashReportDialog.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/acra/dialog/CrashReportDialog.java +++ b/src/main/java/org/acra/dialog/CrashReportDialog.java @@ -62,9 +62,9 @@ public class CrashReportDialog extends BaseCrashReportDialog implements DialogIn if (iconResourceId != ACRAConstants.DEFAULT_RES_VALUE) { dialogBuilder.setIcon(iconResourceId); } - dialogBuilder.setView(buildCustomView(savedInstanceState)); - dialogBuilder.setPositiveButton(getText(getConfig().resDialogPositiveButtonText()), CrashReportDialog.this); - dialogBuilder.setNegativeButton(getText(getConfig().resDialogNegativeButtonText()), CrashReportDialog.this); + dialogBuilder.setView(buildCustomView(savedInstanceState)) + .setPositiveButton(getText(getConfig().resDialogPositiveButtonText()), this) + .setNegativeButton(getText(getConfig().resDialogNegativeButtonText()), this); mDialog = dialogBuilder.create(); mDialog.setCanceledOnTouchOutside(false);
chain listener setup (simplify)
ACRA_acra
train
java
b4b13c4e843b02c7b0a07600352e7b9491163944
diff --git a/tests/exec.js b/tests/exec.js index <HASH>..<HASH> 100644 --- a/tests/exec.js +++ b/tests/exec.js @@ -25,6 +25,37 @@ exports['exec with callback, calls query'] = function (test) { }); }; +exports['exec with callback and options, calls query'] = function (test) { + test.expect(4); + var q = queryize.select().from('test_table'); + + var conn = { + query: function (options, callback) { + test.deepEqual(options, { + sql: 'SELECT * FROM `test_table`', + values: [] + }); + test.deepEqual(options.__proto__, { + sql: 'FOO', + bar: 42 + }); + test.ok(true); + callback(false, [{name: 'John'}]); + return new EventEmitter(); + } + }; + + var options = { + sql: 'FOO', + bar: 42 + }; + + q.exec(conn, options, function (err, results) { + test.deepEqual(results, [{name: 'John'}]); + test.done(); + }); +}; + exports['exec with callback, calls execute'] = function (test) { test.expect(4); var q = queryize.select().from('test_table');
Added test case for exec() with options.
Twipped_QueryizeJS
train
js
8f4fc3d80b16107fa22b36541aa5567abbdfb569
diff --git a/lib/irt/extensions/method.rb b/lib/irt/extensions/method.rb index <HASH>..<HASH> 100644 --- a/lib/irt/extensions/method.rb +++ b/lib/irt/extensions/method.rb @@ -12,7 +12,7 @@ class Method end arr = Array.new(n) set_trace_func proc{ |event, file, line, meth_name, binding, classname| - if event.eql?('call') && name.match(meth_name.to_s) + if event.eql?('call') && name.to_s.match(meth_name.to_s) f = file l = line set_trace_func nil
fix "Method#location raises TypeError with ruby <I>" bug
ddnexus_irt
train
rb
a80622697abb5444a392c9efa7bdaa2880fbe922
diff --git a/docroot/modules/custom/ymca_google/src/GooglePush.php b/docroot/modules/custom/ymca_google/src/GooglePush.php index <HASH>..<HASH> 100644 --- a/docroot/modules/custom/ymca_google/src/GooglePush.php +++ b/docroot/modules/custom/ymca_google/src/GooglePush.php @@ -494,6 +494,7 @@ class GooglePush { } else { // @todo Probably we are trying to update deleted event. Should be marked to be inserted. + // @todo 404 error needs to be catched. $message = 'Google Service Exception for operation %op for Entity: %uri : %message'; $this->loggerFactory->get('GroupX_CM')->error( $message,
First steps, some todos
ymcatwincities_openy
train
php
c727626e9b78f5ee796a1474076e985a31fc45e5
diff --git a/src/TigerApp.php b/src/TigerApp.php index <HASH>..<HASH> 100644 --- a/src/TigerApp.php +++ b/src/TigerApp.php @@ -416,7 +416,7 @@ class TigerApp break; case "s3": $clientConfig = []; - if(isset($client['BaseUrl'])) { + if(isset($config['BaseUrl'])) { $clientConfig['base_url'] = $config['BaseUrl']; } $clientConfig['key'] = $config['Key']; @@ -424,8 +424,9 @@ class TigerApp if(isset($config['Region'])) { $clientConfig['region'] = $config['Region']; } +# \Kint::dump($clientConfig);exit; $client = S3Client::factory($clientConfig); - $adaptor = new Flysystem\AwsS3v3\AwsS3Adapter($client, $config['Bucket']); + $adaptor = new Flysystem\AwsS3v2\AwsS3Adapter($client, $config['Bucket']); break; default: throw new TigerException("Unsupported storage type: {$config['Type']}.");
Change to using the older adaptor for dreamhost compatability
Thruio_TigerKit
train
php
d5a11561316d743f5d5875210e00e924b47e585e
diff --git a/src/widgets/star-rating/star-rating.js b/src/widgets/star-rating/star-rating.js index <HASH>..<HASH> 100644 --- a/src/widgets/star-rating/star-rating.js +++ b/src/widgets/star-rating/star-rating.js @@ -29,7 +29,8 @@ starRating({ /** * Instantiate a list of refinements based on a rating attribute - * The underlying attribute needs to have values from 0 to N + * The ratings must be integer values. You can still keep the precise float value in another attribute + * to be used in the custom ranking configuration. So that the actual hits ranking is precise. * @function starRating * @param {string|DOMElement} options.container CSS Selector or DOMElement to insert the widget * @param {string} options.attributeName Name of the attribute for filtering
docs(star-rating): ratings must be integers fixes #<I> this is a documentation hotfix
algolia_instantsearch.js
train
js
d759873b329d9041bd601b9f53202e773c4452d7
diff --git a/test/functional/test_document.rb b/test/functional/test_document.rb index <HASH>..<HASH> 100644 --- a/test/functional/test_document.rb +++ b/test/functional/test_document.rb @@ -61,7 +61,6 @@ class DocumentTest < Test::Unit::TestCase doc.tags.should == %w(foo bar) @document.find(doc.id).tags.should == %w(foo bar) end - end context "Using key with type Hash" do @@ -683,10 +682,12 @@ class DocumentTest < Test::Unit::TestCase doc = @document.create(:first_name => 'John', :age => 27) old_created_at = doc.created_at old_updated_at = doc.updated_at + sleep 1 # this annoys me + @document.update(doc._id, { :first_name => 'Johnny' }) - doc = @document.update(doc._id, { :first_name => 'Johnny' }) - doc.created_at.to_i.should == old_created_at.to_i - doc.updated_at.to_i.should_not == old_updated_at.to_i + from_db = @document.find(doc.id) + from_db.created_at.to_i.should == old_created_at.to_i + from_db.updated_at.to_i.should_not == old_updated_at.to_i end end end \ No newline at end of file
Fixed failing test with sleep. Annoying.
mongomapper_mongomapper
train
rb
14951a3f53baf2ba828f00843ba7b4ed09c6df1f
diff --git a/redpipe/structs.py b/redpipe/structs.py index <HASH>..<HASH> 100644 --- a/redpipe/structs.py +++ b/redpipe/structs.py @@ -87,7 +87,8 @@ class Struct(object): return for k, v in ref.result.items(): - self._data[k] = v + if k != keyname: + self._data[k] = v pipe.on_execute(cb) diff --git a/test.py b/test.py index <HASH>..<HASH> 100755 --- a/test.py +++ b/test.py @@ -650,6 +650,19 @@ class StructTestCase(BaseTestCase): u = self.User(k) self.assertFalse(u.persisted) + def test_indirect_overlap_of_pk(self): + key = '1' + other_key = '2' + u = self.UserWithPk( + user_id=key, + first_name='first%s' % key, + ) + u.core().hset(key, 'user_id', other_key) + u = self.UserWithPk(key) + self.assertEqual(dict(u)['user_id'], key) + self.assertNotIn('user_id', u._data) # noqa + self.assertEqual(u.key, key) + class ConnectTestCase(unittest.TestCase): def tearDown(self):
confirm behavior if Struct primary key field is overlapped somehow with a redis hash member name
72squared_redpipe
train
py,py
1f172c5dbb102da965aca3393348bf9a4c0228a9
diff --git a/src/capture.js b/src/capture.js index <HASH>..<HASH> 100644 --- a/src/capture.js +++ b/src/capture.js @@ -3,7 +3,7 @@ var _ = require('lodash'), fs = require('fs'), logger = require('winston'), - util = require('util'), + path = require('path'), utils = require('./utils'), SCRIPT_FILE = 'scripts/screenshot.js', @@ -17,7 +17,7 @@ var _ = require('lodash'), function outputFile(options, conf, base64) { var format = options.format || DEF_FORMAT; - return util.format('%s/%s.%s', conf.storage, base64, format); + return conf.storage + path.sep + base64 + '.' + format; } function cliCommand(config) {
Fix path to output file: use platform-specific path separator
vbauer_manet
train
js
d7dfc63393db8f2770eab2698d885678ba0f77d4
diff --git a/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableOptionsFactory.java b/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableOptionsFactory.java index <HASH>..<HASH> 100644 --- a/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableOptionsFactory.java +++ b/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableOptionsFactory.java @@ -125,20 +125,6 @@ public class BigtableOptionsFactory { "google.bigtable.grpc.channel.timeout.ms"; public static final long BIGTABLE_CHANNEL_TIMEOUT_MS_DEFAULT = 30 * 60 * 1000; - static { - Runnable shutDownRunnable = new Runnable() { - @Override - public void run() { - int activeConnectionCount = BigtableConnection.getActiveConnectionCount(); - if (activeConnectionCount > 0) { - LOG.warn("Shutdown is commencing and you have open %d connections. " - + "Data could be lost if there are onging requests. ", activeConnectionCount); - } - } - }; - Runtime.getRuntime().addShutdownHook(new Thread(shutDownRunnable)); - } - public static BigtableOptions fromConfiguration(Configuration configuration) throws IOException { BigtableOptions.Builder optionsBuilder = new BigtableOptions.Builder();
Removing the check for active connections on shutdown.
googleapis_cloud-bigtable-client
train
java
60a2d32283b452617e4d164cf0a2b3041241697b
diff --git a/src/frontend/org/voltdb/VoltDB.java b/src/frontend/org/voltdb/VoltDB.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/VoltDB.java +++ b/src/frontend/org/voltdb/VoltDB.java @@ -413,6 +413,12 @@ public class VoltDB { m_startAction = START_ACTION.CREATE; } } + } else { + if (!m_isEnterprise && m_newRejoin) { + // pauseless rejoin is only available in pro + isValid = false; + hostLog.fatal("Pauseless rejoin is only available in the Enterprise Edition"); + } } return isValid;
Give a clear error message if pauseless rejoin is requested in the community edition.
VoltDB_voltdb
train
java
cb15a12287cc08df5fcedc054f28cadec88af590
diff --git a/lib/datagrid/helper.rb b/lib/datagrid/helper.rb index <HASH>..<HASH> 100644 --- a/lib/datagrid/helper.rb +++ b/lib/datagrid/helper.rb @@ -30,11 +30,11 @@ module Datagrid protected - def datagrid_header(grid, options) + def datagrid_header(grid, options = {}) header = empty_string grid.columns.each do |column| data = _safe(column.header) - if column.order + if options[:order] && column.order data << datagrid_order_for(grid, column) end header << content_tag(:th, data)
Datagrid::Helper#datagrid_header :order option support
bogdan_datagrid
train
rb
12bee843713eee7e1600a305faf280569f1d1e43
diff --git a/sen/tui/init.py b/sen/tui/init.py index <HASH>..<HASH> 100644 --- a/sen/tui/init.py +++ b/sen/tui/init.py @@ -192,8 +192,10 @@ class UI(urwid.MainLoop): add_subwidget(str(containers_count), "status_text_red") add_subwidget(", Running: ") - add_subwidget(str(len(self.d.sorted_containers(sort_by_time=False, stopped=False))), - "status_text_green") + running_containers = self.d.sorted_containers(sort_by_time=False, stopped=False) + running_containers_n = len(running_containers) + add_subwidget(str(running_containers_n), + "status_text_green" if running_containers_n > 0 else "status_text") try: command_name, command_took = self.d.last_command.popleft()
status: print 0 running containers in gray
TomasTomecek_sen
train
py
5cb3d07f44d35a904db511c01dcd8fc64dfd64ec
diff --git a/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php b/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php index <HASH>..<HASH> 100644 --- a/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php +++ b/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php @@ -48,7 +48,7 @@ class HttpMethodBypass implements Bypass // uppercase and exclude empties $methods = array_reduce( $methods, - static function &(&$result, $method) { + function ($result, $method) { $method = strtoupper(trim($method)); if (strlen($method)) { $result[] = $method;
FIX: Avoid pass-literal-by-reference warning in PHP 8
silverstripe_silverstripe-framework
train
php
acd3e1925e3276af6fc9eaf6c9e8c0e071e61444
diff --git a/graylog2-web-interface/src/domainActions/notifyingAction.js b/graylog2-web-interface/src/domainActions/notifyingAction.js index <HASH>..<HASH> 100644 --- a/graylog2-web-interface/src/domainActions/notifyingAction.js +++ b/graylog2-web-interface/src/domainActions/notifyingAction.js @@ -1,6 +1,7 @@ // @flow strict import UserNotification from 'util/UserNotification'; import { createNotFoundError } from 'logic/errors/ReportedErrors'; +import ErrorsActions from 'actions/errors/ErrorsActions'; type Notification = { title?: string, @@ -23,8 +24,8 @@ const notifyingAction = <T, Args: Array<T>, Result>({ action, success: successNo return result; }).catch((error) => { - if (notFoundRedirect && error?.status === '404') { - createNotFoundError(error); + if (notFoundRedirect && error?.status === 404) { + ErrorsActions.report(createNotFoundError(error)); return; }
Display error page when <I> error gets catched with notifyingAction
Graylog2_graylog2-server
train
js
7763502738c3c08ce075c73c18ee91c7d8fbda9a
diff --git a/spec/hash_spec.rb b/spec/hash_spec.rb index <HASH>..<HASH> 100644 --- a/spec/hash_spec.rb +++ b/spec/hash_spec.rb @@ -5,7 +5,11 @@ describe Hash, '#jsoned_into' do include Helpers it "should convert a single parsed json into card" do - Trello::Card.should_receive(:new).once.with(cards_details.first) + expect(Trello::Card) + .to receive(:new) + .once + .with(cards_details.first) + cards_details.first.jsoned_into(Trello::Card) end end
Migrate spec/hash_spec.rb to `expect` syntax and add a missing assertion (ie: was not testing anything)
jeremytregunna_ruby-trello
train
rb