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
7b608892edafb3a1567c8f02f5c465bbc85ddc5d
diff --git a/views/js/testRunner/actionBar/button.js b/views/js/testRunner/actionBar/button.js index <HASH>..<HASH> 100644 --- a/views/js/testRunner/actionBar/button.js +++ b/views/js/testRunner/actionBar/button.js @@ -80,7 +80,7 @@ define([ this.assumeType(); - if (!this.config.title && this.config.label) { + if (!this.config.title && this.config.label && this.is('button')) { this.config.title = this.config.label; } @@ -136,8 +136,6 @@ define([ this.config.is.group = true; this.config.is.button = false; this.config.title = ''; - this.config.label = ''; - this.config.icon = ''; }, /**
actionBar button: only remove title when type is group, keep label and icon values
oat-sa_extension-tao-testqti
train
js
9ed8db6b24b9bd632ed29d1514b7253a8fea26ce
diff --git a/src/PopupDialog.js b/src/PopupDialog.js index <HASH>..<HASH> 100644 --- a/src/PopupDialog.js +++ b/src/PopupDialog.js @@ -34,9 +34,7 @@ class PopupDialog extends Component { return ( <Dialog - ref={(dialog) => { - this.dialog = dialog; - }} + ref={dialog => this.dialog = dialog} {...this.props} > {title}
:rocket: fixed lambda assignment
jacklam718_react-native-popup-dialog
train
js
0dedc5d4a41be5ce78348219fde2541f883e7b16
diff --git a/lib/parse_resource/relation_array.rb b/lib/parse_resource/relation_array.rb index <HASH>..<HASH> 100644 --- a/lib/parse_resource/relation_array.rb +++ b/lib/parse_resource/relation_array.rb @@ -48,26 +48,6 @@ class RelationArray < Array self.each { |item| super(item) if item.id == object_id } end - def clear - super - end - - def size - super - end - - def count - super - end - - def empty? - super - end - - def where - super - end - def contains?(object) self.each { |item| return true if item.attributes == object.attributes } false
removed not so super methods #<I>
adelevie_parse_resource
train
rb
7332b06dd850e709132809ea213c15aac255c69b
diff --git a/lib/epp-client/server.rb b/lib/epp-client/server.rb index <HASH>..<HASH> 100644 --- a/lib/epp-client/server.rb +++ b/lib/epp-client/server.rb @@ -187,7 +187,9 @@ module EPP rescue Errno::EINVAL => e if retried message = e.message.split(" - ")[1] - raise Errno::EINVAL, "#{message}: TCPSocket.new(#{addr.inspect}, #{port.inspect})" + @connection_errors << Errno::EINVAL.new( + "#{message}: TCPSocket.new(#{addr.inspect}, #{port.inspect})") + next end retried = true
Store retried Errno::EINVAL in connection errors and try next addr. This should resolve issues where the first address, possibly IPv6 presents an EINVAL but later addresses may be successful.
m247_epp-client
train
rb
5d50ab1325971e9c4c7629b3a13371e3dc7f845e
diff --git a/test_isort.py b/test_isort.py index <HASH>..<HASH> 100644 --- a/test_isort.py +++ b/test_isort.py @@ -667,3 +667,8 @@ def test_custom_lines_after_import_section(): "\n" "\n" "foo = 'bar'\n") + +def test_settings_combine_instead_of_overwrite(): + """Test to ensure settings combine logically, instead of fully overwriting.""" + assert SortImports(known_standard_library=['not_std_library']).config['known_standard_library'] == \ + (SortImports().config['known_standard_library'] + ['not_std_library'])
Add test to ensure desired behaviour described in issue <I> works as expected
timothycrosley_isort
train
py
f88eb01325f9a17009315b3f73194b2108b17e75
diff --git a/examples/complete/simple/src/Home.js b/examples/complete/simple/src/Home.js index <HASH>..<HASH> 100644 --- a/examples/complete/simple/src/Home.js +++ b/examples/complete/simple/src/Home.js @@ -1,4 +1,4 @@ -import react, { Component, PropTypes } from 'react' +import React, { Component, PropTypes } from 'react' import { connect } from 'react-redux' import { firebaseConnect,
fix(simple example): react declaration in Home component (#<I>)
prescottprue_react-redux-firebase
train
js
63ac519fec95ac81e517091e4183a0b6b0a40233
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -149,6 +149,6 @@ test('context cleanup removes event handlers', function(t){ var button = _h('button', 'Click me!', {onclick: onClick}) _h.cleanup() simu.click(button) - t.assert(!onClick.called) + t.assert(!onClick.called, 'click listener was not triggered') t.end() })
improve messages in tests, while debugging
hyperhype_hyperscript
train
js
1bb16d9e13ebc5b1e0673cb7b048bd3894e1ccef
diff --git a/Observer/Customer/CreateUpdateContact.php b/Observer/Customer/CreateUpdateContact.php index <HASH>..<HASH> 100755 --- a/Observer/Customer/CreateUpdateContact.php +++ b/Observer/Customer/CreateUpdateContact.php @@ -76,6 +76,7 @@ class CreateUpdateContact implements \Magento\Framework\Event\ObserverInterface { $customer = $observer->getEvent()->getCustomer(); $websiteId = $customer->getWebsiteId(); + $storeId = $customer->getStoreId(); //check if enabled if (!$this->helper->isEnabled($websiteId)) { @@ -133,6 +134,7 @@ class CreateUpdateContact implements \Magento\Framework\Event\ObserverInterface $contactModel->setEmail($email); } $contactModel->setEmailImported(\Dotdigitalgroup\Email\Model\Contact::EMAIL_CONTACT_NOT_IMPORTED) + ->setStoreId($storeId) ->setCustomerId($customerId); $contactModel->getResource()->save($contactModel); } catch (\Exception $e) {
set store id on contact save
dotmailer_dotmailer-magento2-extension
train
php
3bd4ba85aeeebd85715664eaae22a70487619706
diff --git a/src/server.js b/src/server.js index <HASH>..<HASH> 100644 --- a/src/server.js +++ b/src/server.js @@ -87,6 +87,7 @@ app.use('/graphql', cors(), instrumentationMiddleware(Schema, timingCallback, { schema: Schema, rootValue: req.rootValue, formatError: formatError, + pretty: req.query.pretty, }; }));
support pretty-printing via ?pretty=true
clayallsopp_graphqlhub
train
js
000cfe0817b1c00e51380943f77458034d8a153d
diff --git a/grimoire_elk/_version.py b/grimoire_elk/_version.py index <HASH>..<HASH> 100644 --- a/grimoire_elk/_version.py +++ b/grimoire_elk/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.45.0" +__version__ = "0.46.0"
Update version number to <I>
chaoss_grimoirelab-elk
train
py
4771a134c4620ef1ef3693edf5f369802c8f3ac4
diff --git a/resources/views/dashboard/schedule/add.blade.php b/resources/views/dashboard/schedule/add.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/dashboard/schedule/add.blade.php +++ b/resources/views/dashboard/schedule/add.blade.php @@ -43,10 +43,11 @@ <label>{{ trans('forms.incidents.scheduled_at') }}</label> <input type="text" name="incident[scheduled_at]" class="form-control" rel="datepicker" required> </div> - <div class="form-group"> - <label>{{ trans('forms.incidents.notify_subscribers') }}</label> - <input type="checkbox" name="incident[notify]" value="1" checked="{{ Input::old('incident.message', 'checked') }}"> - <span class="help-block">{{ trans('forms.optional') }}</span> + <div class="checkbox"> + <label> + <input type="checkbox" name="incident[notify]" value="1" checked="{{ Input::old('incident.message', 'checked') }}"> + {{ trans('forms.incidents.notify_subscribers') }} + </label> </div> </fieldset>
Notify subscribers checkbox is now a single line, removed optional indicator
CachetHQ_Cachet
train
php
03f551a925e30b312ebb057f0cd858a71525826d
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -6,7 +6,7 @@ var makeInterfaceValidator = require('./index.js'); QUnit.module('can-validate-interface/makeInterfaceValidator'); -QUnit.test('basics', function() { +QUnit.test('basics', function(assert) { var dataMethods = [ "create", "read", "update", "delete" ]; var daoValidator = makeInterfaceValidator( [ dataMethods, "id" ] );
Fix tests for QUnit 2
canjs_can-validate-interface
train
js
738e06b7a8d4c50643b95afdf62b450275ec56f0
diff --git a/includes/raw_start.php b/includes/raw_start.php index <HASH>..<HASH> 100644 --- a/includes/raw_start.php +++ b/includes/raw_start.php @@ -11,6 +11,6 @@ if(PHP_SAPI == 'cli'){ } require_once dirname(__FILE__).'/../../tao/includes/class.Bootstrap.php'; -$bootStrap = new BootStrap('taoGroups'); +$bootStrap = new BootStrap('taoGroups', array('session_name' => TestRunner::SESSION_KEY)); $bootStrap->start(); ?> \ No newline at end of file
changed session ids of deliveries and tests(raw_start.php) git-svn-id: <URL>
oat-sa_extension-tao-group
train
php
2d144767333ebee969926ba89920149e38ff15e7
diff --git a/app/controllers/devise_token_auth/concerns/set_user_by_token.rb b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb index <HASH>..<HASH> 100644 --- a/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +++ b/app/controllers/devise_token_auth/concerns/set_user_by_token.rb @@ -69,7 +69,7 @@ module DeviseTokenAuth::Concerns::SetUserByToken # Generate new client_id with existing authentication @client_id = nil unless @used_auth_by_token - if not DeviseTokenAuth.change_headers_on_each_request + if @used_auth_by_token and not DeviseTokenAuth.change_headers_on_each_request auth_header = @resource.build_auth_header(@token, @client_id) # update the response header
Fix exception when change_headers_on_each_request is used alongside devise
lynndylanhurley_devise_token_auth
train
rb
bbd9410ee234cee6ff646340a5432b54629fd8ae
diff --git a/src/main/java/org/thymeleaf/engine/ProcessorTemplateHandler.java b/src/main/java/org/thymeleaf/engine/ProcessorTemplateHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/thymeleaf/engine/ProcessorTemplateHandler.java +++ b/src/main/java/org/thymeleaf/engine/ProcessorTemplateHandler.java @@ -2850,10 +2850,13 @@ public final class ProcessorTemplateHandler implements ITemplateHandler { } if (iterationIndex == 0) { - iterModel.replace(1, iterArtifacts.iterationFirstBodyEventIter0); - if (iterModel.size() > 3) { - iterModel.replace(iterModel.size() - 2, iterArtifacts.iterationLastBodyEventIterN); + if (!last) { + iterModel.replace(1, iterArtifacts.iterationFirstBodyEventIter0); + if (iterModel.size() > 3) { + iterModel.replace(iterModel.size() - 2, iterArtifacts.iterationLastBodyEventIterN); + } } + return; } if (iterationIndex == 1) {
Fixed the way white spaces are prettified in text-mode iterations when only one iteration occurs
thymeleaf_thymeleaf
train
java
742c9b692ca0d6c46a07d0a6c57c577a9aeab3b2
diff --git a/bin/run.js b/bin/run.js index <HASH>..<HASH> 100755 --- a/bin/run.js +++ b/bin/run.js @@ -476,7 +476,7 @@ function printAndCheckResultsDiff(results) { for (let i = 0; i < TEST_TYPES.length; i++) { const type = TEST_TYPES[i]; - if (numRegressions[type] || numFixes[type]) { + if (numRegressions[type]) { return true; } }
Only exit with a failure for regressions
code-dot-org_js-interpreter-tyrant
train
js
d761110ee44b2a8d969c6cc567e88d537ee92389
diff --git a/raiden/network/transport/matrix/client.py b/raiden/network/transport/matrix/client.py index <HASH>..<HASH> 100644 --- a/raiden/network/transport/matrix/client.py +++ b/raiden/network/transport/matrix/client.py @@ -402,6 +402,8 @@ class GMatrixClient(MatrixClient): def _sync(self, timeout_ms=30000): """ Reimplements MatrixClient._sync, add 'account_data' support to /sync """ + log.debug("Sync called", current_user=self.user_id) + response = self.api.sync(self.sync_token, timeout_ms) prev_sync_token = self.sync_token self.sync_token = response["next_batch"]
Added log for sync being called [skip tests]
raiden-network_raiden
train
py
a2f609b755f680d0e665cd5b2659e09848666399
diff --git a/chimp_lists.go b/chimp_lists.go index <HASH>..<HASH> 100644 --- a/chimp_lists.go +++ b/chimp_lists.go @@ -175,7 +175,7 @@ type BatchSubscribeResponse struct { UpdateCount int `json:"update_count"` Updates []Email `json:"updates"` ErrorCount int `json:"error_count"` - Error []BatchSubscriberError `json:"error"` + Error []BatchSubscriberError `json:"errors"` } type BatchError struct {
Fix BatchSubscribeResponse.Errors field name Changed "error" to "errors".
mattbaird_gochimp
train
go
26a5bcfaae6555cfa8b1d7f17250ecb279f05e09
diff --git a/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java b/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java index <HASH>..<HASH> 100755 --- a/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java +++ b/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java @@ -709,7 +709,7 @@ public class OHazelcastPlugin extends ODistributedAbstractPlugin final String eventNodeName = getNodeName(iEvent.getMember()); if (key.startsWith(CONFIG_NODE_PREFIX)) { - ODistributedServerLog.info(this, getLocalNodeName(), eventNodeName, DIRECTION.NONE, + ODistributedServerLog.debug(this, getLocalNodeName(), eventNodeName, DIRECTION.NONE, "updated node configuration id=%s name=%s", iEvent.getMember(), eventNodeName); final ODocument cfg = (ODocument) iEvent.getValue();
Minor: reduced logging level of updating distributed cfg
orientechnologies_orientdb
train
java
fc4cb62df5e01ce31a142a94b0a1b36857a17b80
diff --git a/modules_v3/ckeditor/ckeditor-4.2.2-custom/build-config.js b/modules_v3/ckeditor/ckeditor-4.2.2-custom/build-config.js index <HASH>..<HASH> 100644 --- a/modules_v3/ckeditor/ckeditor-4.2.2-custom/build-config.js +++ b/modules_v3/ckeditor/ckeditor-4.2.2-custom/build-config.js @@ -168,6 +168,6 @@ var CKBUILDER_CONFIG = { 'ug' : 1, 'uk' : 1, 'vi' : 1, - 'cy' : 1, + 'cy' : 1 } -}; \ No newline at end of file +};
IE8/javascript compatibility
fisharebest_webtrees
train
js
3b0e64fb65e7d612fb20869c1aa89157218b5ee5
diff --git a/src/Plugins/DeployOxid/Dispatcher/OxidTaskDispatcher.php b/src/Plugins/DeployOxid/Dispatcher/OxidTaskDispatcher.php index <HASH>..<HASH> 100644 --- a/src/Plugins/DeployOxid/Dispatcher/OxidTaskDispatcher.php +++ b/src/Plugins/DeployOxid/Dispatcher/OxidTaskDispatcher.php @@ -84,6 +84,8 @@ class OxidTaskDispatcher extends AbstractTaskDispatcher switch ($vartype){ case "arr": $value = is_array($value) ? serialize(array_values($value)) : $value; break; case "aarr": $value = is_array($value) ? serialize($value) : $value; break; + case "bool": $value = !is_int($value) && (bool)$value === true ? 1 : 0; break; + case "num": $value = (int)$value; break; } $uid = md5(uniqid("", true) . rand(1, 99999));
Added type casting to OXID configs
phizzl_deployee
train
php
39e532fd78346c16004a69b03e656002d7b845f6
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -10,5 +10,5 @@ describe('colorspace', function () { it('tones the color when namespaced by a : char', function () { assume(colorspace('bigpipe:pagelet')).equals('#00FF2C'); - }) + }); });
[test] Added missing ;
3rd-Eden_colorspace
train
js
28b58d834cce810cd5068394fe92af33beb84669
diff --git a/acceptance/tests/face/loadable_from_modules.rb b/acceptance/tests/face/loadable_from_modules.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/face/loadable_from_modules.rb +++ b/acceptance/tests/face/loadable_from_modules.rb @@ -68,7 +68,7 @@ end EOM on agent, puppet('module', 'build', 'puppetlabs-helloworld') - on agent, puppet('module', 'install', '--ignore-dependencies', '--target-dir', dev_modulepath, 'puppetlabs-helloworld/pkg/puppetlabs-helloworld-0.0.1.tar.gz') + on agent, puppet('module', 'install', '--ignore-dependencies', '--target-dir', dev_modulepath, 'puppetlabs-helloworld/pkg/puppetlabs-helloworld-0.1.0.tar.gz') on(agent, puppet('help', '--config', puppetconf)) do assert_match(/helloworld\s*Hello world face/, stdout, "Face missing from list of available subcommands")
(maint) Update puppet module version in test Commit <I>e7d2 updates the puppet module tool to follow semver.org and use '<I>' as the first revision of the module. Acceptance tests were relying on the default version being '<I>' which meant that the version change broke those tests. This commit updates the version used in the tests to match.
puppetlabs_puppet
train
rb
bc4989cd704607bf006317a33b401e44dc9ff09f
diff --git a/lib/disk/modules/MSCommon.rb b/lib/disk/modules/MSCommon.rb index <HASH>..<HASH> 100644 --- a/lib/disk/modules/MSCommon.rb +++ b/lib/disk/modules/MSCommon.rb @@ -140,7 +140,7 @@ module MSCommon if parent.nil? buf << MemoryBuffer.create(thisLen) else - buf << parent.d_read(pos + buf.length, thisLen, mark_dirty) + buf << parent.d_read(pos + buf.length, thisLen) end else @file.seek(getAbsSectorLoc(blockNum, secNum) + byteOffset, IO::SEEK_SET)
Remove extraneous 3rd argument to d_read A call to d_read for the parent disk was obviously left over from an earlier incarnation of this code. It is using an undefined and unnecessary 3rd argument which resulted in an unknown method exception. The extra argument has been removed and the code tested. (transferred from ManageIQ/manageiq-gems-pending@<I>a<I>e<I>e3bf<I>b<I>faaa<I>c2)
ManageIQ_manageiq-smartstate
train
rb
39cb04e5cb5497a40d2f6ce61b69d5ec485cfdc4
diff --git a/lib/ffaker/identification_es_col.rb b/lib/ffaker/identification_es_col.rb index <HASH>..<HASH> 100644 --- a/lib/ffaker/identification_es_col.rb +++ b/lib/ffaker/identification_es_col.rb @@ -10,6 +10,8 @@ module Faker Faker.numerify("#" * how_many_numbers) end + alias :id :drivers_license + def driver_license_category category = LICENSE_CATEGORY.rand # the categories are A1 A2 B1 B2 B3 C1 C2 C3 diff --git a/test/test_identification_col.rb b/test/test_identification_col.rb index <HASH>..<HASH> 100644 --- a/test/test_identification_col.rb +++ b/test/test_identification_col.rb @@ -1,6 +1,7 @@ require 'helper' class TestFakerIdentificationESCOL < Test::Unit::TestCase + include Test::Unit::Assertions def setup @tester = Faker::IdentificationESCOL end @@ -11,6 +12,10 @@ class TestFakerIdentificationESCOL < Test::Unit::TestCase assert @tester.drivers_license.length.between?(6,14) end + def test_id + assert @tester.method_defined? :id + end + def test_gender assert_match /(Hombre|Mujer)/, @tester.gender end
id is an alias of drivers license
ffaker_ffaker
train
rb,rb
eaf5d30472de4cf3191ed193fac52947e9021597
diff --git a/hgvs/dataproviders/uta.py b/hgvs/dataproviders/uta.py index <HASH>..<HASH> 100644 --- a/hgvs/dataproviders/uta.py +++ b/hgvs/dataproviders/uta.py @@ -147,7 +147,6 @@ class UTABase(Interface): "tx_for_region": """ select tx_ac,alt_ac,alt_strand,alt_aln_method,min(start_i) as start_i,max(end_i) as end_i from exon_set ES - join transcript T on ES.tx_ac = t.ac join exon E on ES.exon_set_id=E.exon_set_id where alt_ac=? and alt_aln_method=? group by tx_ac,alt_ac,alt_strand,alt_aln_method diff --git a/hgvs/variantmapper.py b/hgvs/variantmapper.py index <HASH>..<HASH> 100644 --- a/hgvs/variantmapper.py +++ b/hgvs/variantmapper.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- + """Provides VariantMapper and EasyVariantMapper to project variants between sequences using TranscriptMapper.
removed unnecessary join from tx_for_region sql
biocommons_hgvs
train
py,py
b4108c3159e2e4becc3ac19acb4176c9b36683e3
diff --git a/lib/core/helpers.js b/lib/core/helpers.js index <HASH>..<HASH> 100644 --- a/lib/core/helpers.js +++ b/lib/core/helpers.js @@ -7,6 +7,7 @@ "use strict"; var fs = require('fs'); + var util = require('util'); var path = require('path'); var Stream = require('stream'); @@ -52,11 +53,37 @@ return to; }; - // create a stream + // create a MiddleStream + function MiddleStream() { + Stream.apply(this, arguments); + this.writable = true; + this.readable = true; + + this.store = []; + this.paused = true; + } + util.inherits(MiddleStream, Stream); + MiddleStream.prototype.resume = function () { + while (this.store.length !== 0) { + this.emit('data', this.store.shift()); + } + this.paused = false; + }; + MiddleStream.prototype.pause = function () { + this.paused = true; + }; + + MiddleStream.prototype.write = function (chunk) { + if (this.paused) { + this.store.push(chunk); + return true; + } + this.emit('data', chunk); + return false; + }; + exports.createStream = function () { - var stream = new Stream(); - stream.writable = stream.readable = true; - return stream; + return new MiddleStream(); }; })();
[refactor] imitate streams as both writable and readable
AndreasMadsen_immortal
train
js
0784224232d608c0a283e8ee76599e4ecc2dbc98
diff --git a/js/bitbns.js b/js/bitbns.js index <HASH>..<HASH> 100644 --- a/js/bitbns.js +++ b/js/bitbns.js @@ -681,7 +681,7 @@ module.exports = class bitbns extends Exchange { side = 'buy'; } else if (side.indexOf ('sell')) { side = 'sell'; - }; + } const factor = this.safeString (trade, 'factor'); let costString = undefined; if (factor !== undefined) {
fix transaction side and tested safeTrade
ccxt_ccxt
train
js
48f486bf18b970afdbb119af881252a981ec2946
diff --git a/src/Controller.php b/src/Controller.php index <HASH>..<HASH> 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -53,6 +53,8 @@ use ntentan\utils\Text; */ class Controller { + + use utils\DependencyIjector; private $defaultMethod = 'run'; @@ -123,7 +125,7 @@ class Controller } throw new exceptions\ComponentNotFoundException( - "Component not found *$component*" + "Component not found *$component*" ); } diff --git a/src/controllers/components/auth/AuthComponent.php b/src/controllers/components/auth/AuthComponent.php index <HASH>..<HASH> 100644 --- a/src/controllers/components/auth/AuthComponent.php +++ b/src/controllers/components/auth/AuthComponent.php @@ -168,7 +168,7 @@ class AuthComponent extends Component public function logout() { Session::reset(); - Ntentan::redirect($this->parameters->get('login_route', $this->controller->route . "/login")); + Ntentan::redirect($this->parameters->get('login_route', $this->controller->getRoute() . "/login")); } public static function getUserId()
Fixing routes on the auth component
ntentan_ntentan
train
php,php
5b30950ec7a2ff6494491a3a323baa1a2205d463
diff --git a/closure/goog/string/stringformat.js b/closure/goog/string/stringformat.js index <HASH>..<HASH> 100644 --- a/closure/goog/string/stringformat.js +++ b/closure/goog/string/stringformat.js @@ -172,7 +172,7 @@ goog.string.format.demuxes_['f'] = function(value, // empty string instead of undefined for non-participating capture groups, // and isNaN('') == false. if (!(isNaN(precision) || precision == '')) { - replacement = value.toFixed(precision); + replacement = parseFloat(value).toFixed(precision); } // Generates sign string that will be attached to the replacement. diff --git a/closure/goog/string/stringformat_test.js b/closure/goog/string/stringformat_test.js index <HASH>..<HASH> 100644 --- a/closure/goog/string/stringformat_test.js +++ b/closure/goog/string/stringformat_test.js @@ -216,3 +216,9 @@ function testNonParticipatingGroupHandling() { // Bad types assertEquals(expected, goog.string.format(format, '1', 2, 3, 4)); } + +function testMinusString() { + var format = '%0.1f%%'; + var expected = '-0.7%'; + assertEquals(expected, goog.string.format(format, '-0.723')); +}
Added parseFloat in goog.string.format
google_closure-library
train
js,js
19a433f68c51c90c84e4f7407901d0828ddf69e3
diff --git a/Resources/public/js/directives/datagrid.js b/Resources/public/js/directives/datagrid.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/directives/datagrid.js +++ b/Resources/public/js/directives/datagrid.js @@ -349,11 +349,18 @@ angular.module('Samson.DataGrid') $scope.$broadcast('errors.updated', {}); $scope.hasErrors = false; - angular.copy(data, row); if (method == 'put') { + angular.copy(data, row); $scope.$emit('row.updated', row); } else { - $scope.$emit('row.created', row); + if (angular.isArray(data)) { + for (var i in data) { + $scope.$emit('row.created', data[i]); + } + } else { + angular.copy(data, row); + $scope.$emit('row.created', row); + } } }).error(function(data) { data.errors = data.errors || [];
allow for an array of results after a create call. For example, when you have a batch create action.
SamsonIT_DataGridBundle
train
js
6f4db22f032022055fcbb5c193e35164621c7845
diff --git a/src/drawNode.js b/src/drawNode.js index <HASH>..<HASH> 100644 --- a/src/drawNode.js +++ b/src/drawNode.js @@ -121,9 +121,20 @@ function _updateNode(node, x, y, width, height, shape, nodeId, attributes, optio .attr("id", id); title.text(nodeId); - var bbox = svgElements.node().getBBox(); - bbox.cx = bbox.x + bbox.width / 2; - bbox.cy = bbox.y + bbox.height / 2; + if (svgElements.size() != 0) { + var bbox = svgElements.node().getBBox(); + bbox.cx = bbox.x + bbox.width / 2; + bbox.cy = bbox.y + bbox.height / 2; + } else if (text.size() != 0) { + bbox = { + x: +text.attr('x'), + y: +text.attr('y'), + width: 0, + height: 0, + cx: +text.attr('x'), + cy: +text.attr('y'), + } + } svgElements.each(function(data, index) { var svgElement = d3.select(this); if (svgElement.attr("cx")) {
Handle drawing of all nodes shapes without svg shape element
magjac_d3-graphviz
train
js
00971ac1539c62fb1b26bfcccdf55b9ad2b7d2e9
diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index <HASH>..<HASH> 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -977,3 +977,7 @@ def _get_latest_pkg_version(pkginfo): if len(pkginfo) == 1: return next(six.iterkeys(pkginfo)) return sorted(pkginfo, cmp=_reverse_cmp_pkg_versions).pop() + + +def compare_versions(ver1='', oper='==', ver2=''): + return salt.utils.compare_versions(ver1, oper, ver2)
Added compare_versions to be used within jinja
saltstack_salt
train
py
fee3a59618b3d0cae8aab9ebba44a3a6f854cac9
diff --git a/iopipe/contrib/trace/auto_http.py b/iopipe/contrib/trace/auto_http.py index <HASH>..<HASH> 100644 --- a/iopipe/contrib/trace/auto_http.py +++ b/iopipe/contrib/trace/auto_http.py @@ -71,7 +71,7 @@ def patch_session_send(context, http_filter): with context.iopipe.mark(id): response = original_session_send(self, *args, **kwargs) trace = context.iopipe.mark.measure(id) - context.iopipe.mark.delete(id) + # context.iopipe.mark.delete(id) collect_metrics_for_response(response, context, trace, http_filter) return response diff --git a/iopipe/contrib/trace/marker.py b/iopipe/contrib/trace/marker.py index <HASH>..<HASH> 100644 --- a/iopipe/contrib/trace/marker.py +++ b/iopipe/contrib/trace/marker.py @@ -20,7 +20,6 @@ class Marker(object): def start(self, name): self.timeline.mark("start:%s" % name) - self.context.iopipe.label("@iopipe/trace") self.context.iopipe.label("@iopipe/plugin-trace") def end(self, name):
Do not delete performanceEntries for an http trace
iopipe_iopipe-python
train
py,py
58c919bdd5e80025b17f41997c43abebb932b823
diff --git a/library/CM/Layout/Abstract.js b/library/CM/Layout/Abstract.js index <HASH>..<HASH> 100644 --- a/library/CM/Layout/Abstract.js +++ b/library/CM/Layout/Abstract.js @@ -46,8 +46,8 @@ var CM_Layout_Abstract = CM_View_Abstract.extend({ return view; }) .catch(function(error) { + window.clearTimeout(layout._timeoutLoading); if (!(error instanceof Promise.CancellationError)) { - window.clearTimeout(layout._timeoutLoading); layout._$pagePlaceholder.addClass('error').html('<pre>' + error.message + '</pre>'); layout._onPageError(); throw error;
Fix clear of _timeoutLoading.
cargomedia_cm
train
js
0cfeb014962b78b4f02fd31bb2a58cea8a717002
diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index <HASH>..<HASH> 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -1602,9 +1602,10 @@ class grade_report_grader extends grade_report { } } - $name = shorten_text($element['object']->get_name()); + $name = $element['object']->get_name(); $courseheaderid = 'courseheader_' . clean_param($name, PARAM_ALPHANUMEXT); - $courseheader = html_writer::tag('span', $name, array('id' => $courseheaderid)); + $courseheader = html_writer::tag('span', $name, array('id' => $courseheaderid, + 'title' => $name, 'class' => 'gradeitemheader')); $courseheader .= html_writer::label($showing, $courseheaderid, false, array('class' => 'accesshide')); $courseheader .= $icon;
MDL-<I> Gradebook item titles - adjusting category titles
moodle_moodle
train
php
b6abb254c6c97e8067bdb73a29da8706f6668bb0
diff --git a/fastlane/lib/fastlane/actions/commit_version_bump.rb b/fastlane/lib/fastlane/actions/commit_version_bump.rb index <HASH>..<HASH> 100644 --- a/fastlane/lib/fastlane/actions/commit_version_bump.rb +++ b/fastlane/lib/fastlane/actions/commit_version_bump.rb @@ -190,7 +190,7 @@ module Fastlane end def self.category - :version_control + :source_control end end end
Fix category of commit_version_bump
fastlane_fastlane
train
rb
07f9a703fb77a0237006356a40aaa61d4e1a3f6e
diff --git a/src/ossos-pipeline/tests/base_tests.py b/src/ossos-pipeline/tests/base_tests.py index <HASH>..<HASH> 100644 --- a/src/ossos-pipeline/tests/base_tests.py +++ b/src/ossos-pipeline/tests/base_tests.py @@ -8,8 +8,6 @@ import os import unittest import wx - -from hamcrest import not_none, assert_that from mock import Mock from ossos.gui import events @@ -58,7 +56,7 @@ class WxWidgetTestCase(unittest.TestCase): return self._get_by_equality(iterable, has_same_label) def assert_has_child_with_label(self, parent, label): - assert_that(self.get_child_by_label(parent, label), not_none()) + self.assertIsNotNone(self.get_child_by_label(parent, label)) def get_child_by_label(self, parent, label): return self._get_by_label(label, parent.GetChildren())
removed dependency on hamcrest. not really needed
OSSOS_MOP
train
py
9bb1c6e8b398c651f8e40a6c6d016f4731ffae19
diff --git a/src/main/java/org/eclipse/jetty/nosql/memcached/hashmap/HashMapClient.java b/src/main/java/org/eclipse/jetty/nosql/memcached/hashmap/HashMapClient.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/eclipse/jetty/nosql/memcached/hashmap/HashMapClient.java +++ b/src/main/java/org/eclipse/jetty/nosql/memcached/hashmap/HashMapClient.java @@ -9,7 +9,7 @@ import org.eclipse.jetty.nosql.kvs.KeyValueStoreClientException; // intend to use this as test mock public class HashMapClient extends AbstractKeyValueStoreClient { - class Entry { + static class Entry { private byte[] data = null; private long expiry = 0; Entry(byte[] raw, long exp) {
made inner class static to shut FindBugs up
yyuu_jetty-nosql-memcached
train
java
08870b38f8c630cbbf168e5a9a4904a9c15a5cbb
diff --git a/tasks.py b/tasks.py index <HASH>..<HASH> 100644 --- a/tasks.py +++ b/tasks.py @@ -52,7 +52,9 @@ def publish( # Better than nothing, since we haven't solved "pretend I have some other # task's signature" yet... publish.__doc__ = release.publish.__doc__ -my_release = Collection('release', release.build, release.status, publish) +my_release = Collection( + 'release', release.build, release.status, publish, release.prepare, +) ns = Collection( coverage, @@ -72,9 +74,13 @@ ns.configure({ 'logformat': LOG_FORMAT, }, 'packaging': { + # NOTE: this is currently for identifying the source directory. Should + # it get used for actual releasing, needs changing. + 'package': 'fabric', 'sign': True, 'wheel': True, 'check_desc': True, + 'changelog_file': 'sites/www/changelog.rst', }, # TODO: perhaps move this into a tertiary, non automatically loaded, # conf file so that both this & the code under test can reference it?
Get Invocations release tasks working properly
fabric_fabric
train
py
1842352fa3d10954f14f2ef9413b616c96d29902
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -293,9 +293,9 @@ export default function createLogger(options = {}) { if ($time.length > maxLocaleTimeLength) { maxLocaleTimeLength = $time.length; } else if ($time.length < maxLocaleTimeLength) { - $time += ( + $time = ( chars(SPACER, maxLocaleTimeLength - $time.length) - ); + ) + $time; } } else { $time = chars(SPACER, maxLocaleTimeLength);
Right-align localized timestamp
PabloSichert_concurrency-logger
train
js
d9f9363db43eb7b095d694e4e60f6df8bc7d68f2
diff --git a/lib/kafka/async_producer.rb b/lib/kafka/async_producer.rb index <HASH>..<HASH> 100644 --- a/lib/kafka/async_producer.rb +++ b/lib/kafka/async_producer.rb @@ -144,6 +144,8 @@ module Kafka # @see Kafka::Producer#shutdown # @return [nil] def shutdown + ensure_threads_running! + @timer_thread && @timer_thread.exit @queue << [:shutdown, nil] @worker_thread && @worker_thread.join
Ensure threads are running when calling `shutdown` Similar to the previous commit, if a worker thread unexpectedly dies with unhandled messages in its queue and then we try to call `shutdown`, those messages won't be handled unless `produce` is called in the future (in which case the worker thread will read the `shutdown` message enqueued here and then exit again). With this change we will restart the worker thread so it can receive the `shutdown` message.
zendesk_ruby-kafka
train
rb
b15d51a29865e2a23aa1c3b139bfffd98a2a19a0
diff --git a/src/Entrust/Entrust.php b/src/Entrust/Entrust.php index <HASH>..<HASH> 100644 --- a/src/Entrust/Entrust.php +++ b/src/Entrust/Entrust.php @@ -38,10 +38,10 @@ class Entrust * * @return bool */ - public function hasRole($role) + public function hasRole($role, $requireAll = false) { if ($user = $this->user()) { - return $user->hasRole($role); + return $user->hasRole($role, $requireAll); } return false; @@ -54,10 +54,10 @@ class Entrust * * @return bool */ - public function can($permission) + public function can($permission, $requireAll = false) { if ($user = $this->user()) { - return $user->can($permission); + return $user->can($permission, $requireAll); } return false;
Expose multi-role and multi-perm options through Entrust class
Zizaco_entrust
train
php
31582fdf77cb47db9d9e225cde3ce9b6f1bb2741
diff --git a/java/tests/com/google/template/soy/SoyFileSetParserBuilder.java b/java/tests/com/google/template/soy/SoyFileSetParserBuilder.java index <HASH>..<HASH> 100644 --- a/java/tests/com/google/template/soy/SoyFileSetParserBuilder.java +++ b/java/tests/com/google/template/soy/SoyFileSetParserBuilder.java @@ -137,6 +137,12 @@ public final class SoyFileSetParserBuilder { return this; } + /** Enable experiments. Returns this object, for chaining. */ + public SoyFileSetParserBuilder enableExperimentalFeatures(ImmutableList<String> experiments) { + this.options.setExperimentalFeatures(experiments); + return this; + } + public SoyFileSetParserBuilder errorReporter(ErrorReporter errorReporter) { this.errorReporter = errorReporter; return this;
Add support for experimental features in the CompilerIntegrationTest. Tested: Manual: added an @Experiments annotation to a test, and verified in the debugger that the expected experimental features were enabled for passing and failing tests. GITHUB_BREAKING_CHANGES=None ------------- Created by MOE: <URL>
google_closure-templates
train
java
14f0e1cf98357887d1ac9f728953efbb3b75d59b
diff --git a/salt/crypt.py b/salt/crypt.py index <HASH>..<HASH> 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -69,7 +69,7 @@ def gen_keys(keydir, keyname, keysize): priv = '{0}.pem'.format(base) pub = '{0}.pub'.format(base) - gen = RSA.gen_key(keysize, 1) + gen = RSA.gen_key(keysize, 1, callback=lambda x,y,z:None) cumask = os.umask(191) gen.save_key(priv, None) os.umask(cumask)
supress console output from key generation Output from M2Crypto.RSA will no longer display when creating keys.
saltstack_salt
train
py
5a78d7260b87d7c0ecc3faa0819a629f5f3cde4d
diff --git a/src/Channels/GcmChannel.php b/src/Channels/GcmChannel.php index <HASH>..<HASH> 100644 --- a/src/Channels/GcmChannel.php +++ b/src/Channels/GcmChannel.php @@ -3,7 +3,6 @@ namespace Edujugon\PushNotification\Channels; use Edujugon\PushNotification\Messages\PushMessage; -use Illuminate\Support\Facades\Log; class GcmChannel extends PushChannel { @@ -21,7 +20,7 @@ class GcmChannel extends PushChannel protected function buildData(PushMessage $message) { $data = []; - if($message->title != null || $message->body != null || $message->sound != null || $message->click_action) + if($message->title != null || $message->body != null || $message->click_action) { $data = [ 'notification' => [ @@ -37,8 +36,6 @@ class GcmChannel extends PushChannel $data['data'] = $message->extra; } - Log::alert(dd($data)); - return $data; } }
changed null check of $message->sound in gcm channel buildData method
Edujugon_PushNotification
train
php
1388191a20adc83688194039263a770077d750de
diff --git a/packages/lib/PubSub.js b/packages/lib/PubSub.js index <HASH>..<HASH> 100644 --- a/packages/lib/PubSub.js +++ b/packages/lib/PubSub.js @@ -30,7 +30,7 @@ exports = Class(function() { } } - if(!this._subscribers[signal]) { return; } + if(!this._subscribers[signal]) { return this; } var subs = this._subscribers[signal].slice(0); for(var i = 0, sub; sub = subs[i]; ++i) { @@ -66,13 +66,18 @@ exports = Class(function() { .apply(GLOBAL, arguments); } }); + + if ( args.length === 3 ) { + cb._ctx = ctx; + cb._method = method; + } return this.subscribe(signal, cb); } // if no method is specified, all subscriptions with a callback context of ctx will be removed this.unsubscribe = function(signal, ctx, method) { - if (!this._subscribers || !this._subscribers[signal]) { return; } + if (!this._subscribers || !this._subscribers[signal]) { return this; } var subs = this._subscribers[signal]; for (var i = 0, c; c = subs[i]; ++i) { if (c == ctx || c._ctx == ctx && (!method || c._method == method)) {
fix chaining + allow subscribeOnce to be unsubscribed via the context
gameclosure_js.io
train
js
7abd5c0e5f5446d4d65f4f592e1048ad88913513
diff --git a/tests.py b/tests.py index <HASH>..<HASH> 100644 --- a/tests.py +++ b/tests.py @@ -813,9 +813,14 @@ class TestYara(unittest.TestCase): r = yara.compile(source='rule test { condition: ext_str matches /ssi$/ }', externals={'ext_str': 'mississippi'}) self.assertFalse(r.match(data='dummy')) - self.assertRaises(UnicodeEncodeError, yara.compile, - source="rule test { condition: true}", - externals={'foo': u'\u6765\u6613\u7f51\u7edc\u79d1' }) + if sys.version_info[0] >= 3: + self.assertTrue(yara.compile( + source="rule test { condition: true}", + externals={'foo': u'\u6765\u6613\u7f51\u7edc\u79d1' })) + else: + self.assertRaises(UnicodeEncodeError, yara.compile, + source="rule test { condition: true}", + externals={'foo': u'\u6765\u6613\u7f51\u7edc\u79d1' }) def testCallbackAll(self): global rule_data
Fix tests introduced in <I>c<I>a3b<I>a<I>bc<I>d<I>eec<I>b<I>.
VirusTotal_yara-python
train
py
137e57fc61e24bd6b6dc4de8dea0e47c9be59040
diff --git a/runtime/lib/formatter/PropelOnDemandFormatter.php b/runtime/lib/formatter/PropelOnDemandFormatter.php index <HASH>..<HASH> 100644 --- a/runtime/lib/formatter/PropelOnDemandFormatter.php +++ b/runtime/lib/formatter/PropelOnDemandFormatter.php @@ -58,7 +58,7 @@ class PropelOnDemandFormatter extends PropelObjectFormatter { $col = 0; // main object - $class = $this->isSingleTableInheritance ? call_user_func(array($his->peer, 'getOMClass'), $row, $col, false) : $this->class; + $class = $this->isSingleTableInheritance ? call_user_func(array($this->peer, 'getOMClass'), $row, $col, false) : $this->class; $obj = $this->getSingleObjectFromRow($row, $class, $col); // related objects using 'with' foreach ($this->getWith() as $modelWith) {
[<I>][<I>] Fixed typo in PropelOnDemandFormatter that makes in fail with single table inheritance (closes #<I>)
propelorm_Propel
train
php
a20e9d7ccbf4b1f4a17ff7c9e6ec9c1a2879a52e
diff --git a/clients/web/src/utilities.js b/clients/web/src/utilities.js index <HASH>..<HASH> 100644 --- a/clients/web/src/utilities.js +++ b/clients/web/src/utilities.js @@ -24,7 +24,7 @@ girder.formatDate = function (datestr, resolution) { output += ' ' + date.getFullYear(); if (resolution >= girder.DATE_MINUTE) { - output += ' ' + date.getHours() + ':' + + output += ' at ' + date.getHours() + ':' + ('0' + date.getMinutes()).slice(-2); } if (resolution >= girder.DATE_SECOND) {
Changing the format date output to be more friendly.
girder_girder
train
js
3ecd855c0943242abfaee6a714220739cf5efd02
diff --git a/lib/arjdbc/mysql/adapter.rb b/lib/arjdbc/mysql/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/arjdbc/mysql/adapter.rb +++ b/lib/arjdbc/mysql/adapter.rb @@ -482,7 +482,11 @@ module ArJdbc end def current_database - select_one("SELECT DATABASE() as db")["db"] + select_one("SELECT DATABASE() as db")['db'] + end + + def truncate(table_name, name = nil) + execute "TRUNCATE TABLE #{quote_table_name(table_name)}", name end # @override
[mysql] back-port missing truncate connection method (since AR <I>)
jruby_activerecord-jdbc-adapter
train
rb
d6396406ad628312d434552a0a1091a258fc9133
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -228,7 +228,7 @@ ShellCraft.prototype.shell = function (callback) { } process.stdin.on ('keypress', function (chunk, key) { - if (!key) { + if (!key || !self.uiPrompt.rl) { return; }
Skip keypress when readline is not ready
Xcraft-Inc_shellcraft.js
train
js
b372bb26f384d8491b1a1852cee366e7fb02c50d
diff --git a/src/main/java/com/github/lalyos/jfiglet/FigletFont.java b/src/main/java/com/github/lalyos/jfiglet/FigletFont.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/lalyos/jfiglet/FigletFont.java +++ b/src/main/java/com/github/lalyos/jfiglet/FigletFont.java @@ -129,8 +129,10 @@ public class FigletFont { continue; } codeTag = dummyS.concat(" ").split(" ")[0]; - if (codeTag.length()>2&&"x".equals(codeTag.substring(1,2))) { - charCode = Integer.parseInt(codeTag.substring(2),16); + if (codeTag.matches("^0[xX][0-9a-fA-F]+$")) { + charCode = Integer.parseInt(codeTag.substring(2), 16); + } else if (codeTag.matches("^0[0-7]+$")) { + charCode = Integer.parseInt(codeTag.substring(2), 8); } else { charCode = Integer.parseInt(codeTag); }
Replace <I> bit check with regex and add octal parsing
lalyos_jfiglet
train
java
c0ea86edd09fe4d15fdab86e4cbb28a0b7fb010c
diff --git a/modelx/core/space.py b/modelx/core/space.py index <HASH>..<HASH> 100644 --- a/modelx/core/space.py +++ b/modelx/core/space.py @@ -354,16 +354,6 @@ class BaseSpace(BaseSpaceContainer, ElementFactory): return self._impl.named_itemspaces.interfaces @property - def _self_spaces(self): - """A mapping associating names to self spaces.""" - return self._impl.self_spaces.interfaces - - @property - def _derived_spaces(self): - """A mapping associating names to derived spaces.""" - return self._impl.derived_spaces.interfaces - - @property def parameters(self): """A tuple of parameter strings.""" return tuple(self._impl.formula.parameters)
FAC: Remove unused Space methods
fumitoh_modelx
train
py
4978e3c285bbf052364b499c6ca9386ecae47629
diff --git a/tests/linalg_test.py b/tests/linalg_test.py index <HASH>..<HASH> 100644 --- a/tests/linalg_test.py +++ b/tests/linalg_test.py @@ -721,6 +721,7 @@ class NumpyLinalgTest(jtu.JaxTestCase): for dtype in float_types + complex_types for n in [-5, -2, -1, 0, 1, 2, 3, 4, 5, 10] for rng_factory in [jtu.rand_default])) + @jtu.skip_on_devices("tpu") # TODO(b/149870255): Bug in XLA:TPU?. def testMatrixPower(self, shape, dtype, n, rng_factory): rng = rng_factory() _skip_if_unsupported_type(dtype)
Disable linalg_test:testMatrix power on TPU (#<I>) Due to internal test failures (b/<I>)
tensorflow_probability
train
py
63add95d99d6283bd706ae3ddbb44d6b86b545df
diff --git a/core/app/controllers/admin/base_controller.rb b/core/app/controllers/admin/base_controller.rb index <HASH>..<HASH> 100644 --- a/core/app/controllers/admin/base_controller.rb +++ b/core/app/controllers/admin/base_controller.rb @@ -1,8 +1,6 @@ # Filters added to this controller apply to all controllers in the refinery backend. # Likewise, all the methods added will be available for all controllers in the refinery backend. -# You can extend refinery backend with your own functions here and they will likely not get overriden in an update. - module Admin class BaseController < ActionController::Base
Removed message from core controller about adding to this file, it didn't make sense anymore because it's wrapped up in our gem.
refinery_refinerycms
train
rb
0610a60d4295003cb767f6e78bb4dd1ad2582879
diff --git a/geocoder/tamu.py b/geocoder/tamu.py index <HASH>..<HASH> 100644 --- a/geocoder/tamu.py +++ b/geocoder/tamu.py @@ -78,8 +78,8 @@ class Tamu(Base): # Build initial Tree with results if self.parse['OutputGeocodes']: self._build_tree(self.parse.get('OutputGeocodes')[0]) - self._build_tree(self.parse.get('MatchedAddress')) self._build_tree(self.parse.get('OutputGeocode')) + self._build_tree(self.parse.get('ReferenceFeature')) if self.parse['CensusValues']: self._build_tree(self.parse.get('CensusValues')[0]['CensusValue1']) @@ -123,7 +123,9 @@ class Tamu(Base): @property def address(self): - return self.parse['InputAddress'].get('StreetAddress') +# return self.parse['InputAddress'].get('StreetAddress') + return ' '.join([ + self.housenumber, self.street, self.city, self.state, self.postal]) @property def city(self):
use ReferenceFeature instead of MatchedAddress
DenisCarriere_geocoder
train
py
c696f649d805587cc8674b6bc6ff475a422c8ff8
diff --git a/safe_qgis/widgets/dock.py b/safe_qgis/widgets/dock.py index <HASH>..<HASH> 100644 --- a/safe_qgis/widgets/dock.py +++ b/safe_qgis/widgets/dock.py @@ -112,7 +112,7 @@ SMALL_ICON_STYLE = styles.SMALL_ICON_STYLE LOGO_ELEMENT = m.Image('qrc:/plugins/inasafe/inasafe-logo.png', 'InaSAFE Logo') LOGGER = logging.getLogger('InaSAFE') -from pydev import pydevd # pylint: disable=F0401 +# from pydev import pydevd # pylint: disable=F0401 #noinspection PyArgumentList @@ -137,9 +137,9 @@ class Dock(QtGui.QDockWidget, Ui_DockBase): http://doc.qt.nokia.com/4.7-snapshot/designer-using-a-ui-file.html """ # Enable remote debugging - should normally be commented out. - pydevd.settrace( - 'localhost', port=5678, stdoutToServer=True, - stderrToServer=True) + # pydevd.settrace( + # 'localhost', port=5678, stdoutToServer=True, + # stderrToServer=True) QtGui.QDockWidget.__init__(self, None) self.setupUi(self)
Fix #<I> Aggregation fails on deintersect - disable debug stuff
inasafe_inasafe
train
py
8c05c9ba3f96ff535cd1fa7be38fb2a2ad3f893b
diff --git a/app/src/main/java/com/mikepenz/fastadapter/app/items/SampleItem.java b/app/src/main/java/com/mikepenz/fastadapter/app/items/SampleItem.java index <HASH>..<HASH> 100644 --- a/app/src/main/java/com/mikepenz/fastadapter/app/items/SampleItem.java +++ b/app/src/main/java/com/mikepenz/fastadapter/app/items/SampleItem.java @@ -101,7 +101,7 @@ public class SampleItem extends AbstractItem<SampleItem, SampleItem.ViewHolder> viewHolder.itemView.setTag(this); //set the background for the item - UIUtils.setBackground(viewHolder.view, FastAdapterUIUtils.getSelectableBackground(ctx, Color.RED)); + UIUtils.setBackground(viewHolder.view, FastAdapterUIUtils.getSelectableBackground(ctx, Color.RED, true)); //set the text for the name StringHolder.applyTo(name, viewHolder.name); //set the text for the description or hide
* adjust SampleItem to changed method
mikepenz_FastAdapter
train
java
856870c195e72ab57b9d3f1248a35e03b2704bfa
diff --git a/pyrogram/client/types/user_and_chats/user.py b/pyrogram/client/types/user_and_chats/user.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/types/user_and_chats/user.py +++ b/pyrogram/client/types/user_and_chats/user.py @@ -214,3 +214,38 @@ class User(Object): """ return self._client.unarchive_chats(self.id) + + + def block(self): + """Bound method *block* of :obj:`User`. + Use as a shortcut for: + .. code-block:: python + client.block_user(123456789) + Example: + .. code-block:: python + user.block() + Returns: + True on success. + Raises: + RPCError: In case of a Telegram RPC error. + """ + + return self._client.block_user(self.id) + + + def unblock(self): + """Bound method *unblock* of :obj:`User`. + Use as a shortcut for: + .. code-block:: python + client.unblock_user(123456789) + Example: + .. code-block:: python + user.unblock() + Returns: + True on success. + Raises: + RPCError: In case of a Telegram RPC error. + """ + + return self._client.unblock_user(self.id) +
Add bound methods block and unblock to User object
pyrogram_pyrogram
train
py
1f75796e4cd2827070f319d718ec4a8d285a9bdb
diff --git a/src/main/java/org/junit/rules/TemporaryFolder.java b/src/main/java/org/junit/rules/TemporaryFolder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/junit/rules/TemporaryFolder.java +++ b/src/main/java/org/junit/rules/TemporaryFolder.java @@ -108,7 +108,7 @@ public class TemporaryFolder extends ExternalResource { /** * Setting this flag assures that no resources are left undeleted. Failure * to fulfill the assurance results in failure of tests with an - * {@link IllegalStateException}. + * {@link AssertionError}. * * @return this */ @@ -237,7 +237,7 @@ public class TemporaryFolder extends ExternalResource { * Delete all files and folders under the temporary folder. Usually not * called directly, since it is automatically applied by the {@link Rule}. * - * @throws IllegalStateException if unable to clean up resources + * @throws AssertionError if unable to clean up resources * and deletion of resources is assured. */ public void delete() {
Fix wrong exception type in JavaDoc See issue #<I>
junit-team_junit4
train
java
13fe54b044320c1170279bfc29570e7f151c79a0
diff --git a/hazelcast/src/test/java/com/hazelcast/sql/impl/exec/scan/index/MapIndexScanExecTest.java b/hazelcast/src/test/java/com/hazelcast/sql/impl/exec/scan/index/MapIndexScanExecTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/sql/impl/exec/scan/index/MapIndexScanExecTest.java +++ b/hazelcast/src/test/java/com/hazelcast/sql/impl/exec/scan/index/MapIndexScanExecTest.java @@ -95,8 +95,12 @@ public class MapIndexScanExecTest extends SqlTestSupport { instance1 = factory.newHazelcastInstance(getInstanceConfig()); instance2 = factory.newHazelcastInstance(getInstanceConfig()); + assertClusterSizeEventually(2, instance1, instance2); + IMap<Integer, Integer> map = instance1.getMap(MAP_NAME); map.addIndex(new IndexConfig().setName(INDEX_NAME).setType(IndexType.SORTED).addAttribute("this")); + + waitAllForSafeState(instance1, instance2); } @After
Unit test fix: wait for safe state (#<I>) in the MapIndexScanExecTest waitt for SAFE state Closes <URL>
hazelcast_hazelcast
train
java
fd0208f4b5ff38ae73f1b2054afacf0e521ba9af
diff --git a/pyaml/__init__.py b/pyaml/__init__.py index <HASH>..<HASH> 100644 --- a/pyaml/__init__.py +++ b/pyaml/__init__.py @@ -114,7 +114,7 @@ class UnsafePrettyYAMLDumper(PrettyYAMLDumper): style = dumper.pyaml_string_val_style if not style: style = 'plain' - if '\n' in data or (data and data[0] in '!&*'): + if '\n' in data or (data and data[0] in '!&*['): style = 'literal' if '\n' in data[:-1]: for line in data.splitlines():
Strings starting with "[" need to be quoted as well.
mk-fg_pretty-yaml
train
py
c6c533b21d8a23ecef84fa743df5e2cd94f63ab6
diff --git a/test_config_manager.py b/test_config_manager.py index <HASH>..<HASH> 100644 --- a/test_config_manager.py +++ b/test_config_manager.py @@ -917,7 +917,6 @@ foo=bar ; other comment use_config_files=True, auto_help=False, argv_source=[]) - self.assertIsNone(c.ini_source) - self.assertIsNone(c.conf_source) - self.assertIsNone(c.json_source) - + self.assertTrue(c.ini_source is None) + self.assertTrue(c.conf_source is None) + self.assertTrue(c.json_source is None)
reverted use of unittest.assertIsNone() which requires python <I>
mozilla_configman
train
py
bc6118980fb853d19c0c2879e2f3e401cbe118ea
diff --git a/src/packet/packetlist.js b/src/packet/packetlist.js index <HASH>..<HASH> 100644 --- a/src/packet/packetlist.js +++ b/src/packet/packetlist.js @@ -53,10 +53,9 @@ List.prototype.read = async function (bytes) { await packet.read(parsed.packet); await writer.write(packet); } catch (e) { - if (!config.tolerant || - parsed.tag === enums.packet.symmetricallyEncrypted || - parsed.tag === enums.packet.literal || - parsed.tag === enums.packet.compressed) { + if (!config.tolerant || packetParser.supportsStreaming(parsed.tag)) { + // The packets that support streaming also happen to be the same + // ones we want to throw on parse errors for. await writer.abort(e); } util.print_debug_error(e);
Throw on parse errors in integrity protected encrypted packets
openpgpjs_openpgpjs
train
js
8cf768e19da294d54f426450374aa87e2f01e86e
diff --git a/packages/foxman-core/__test__/application.instance.test.js b/packages/foxman-core/__test__/application.instance.test.js index <HASH>..<HASH> 100644 --- a/packages/foxman-core/__test__/application.instance.test.js +++ b/packages/foxman-core/__test__/application.instance.test.js @@ -1,4 +1,4 @@ -const { init, generatePending } = require('../lib/application/instance'); +const { init, generatePending } = require('../lib/application/Instance'); class NoPendingPlugin { constructor() {
Tweaks * application.Instance.test.js
kaola-fed_foxman
train
js
68cc31030319f62f2c3acfcf843dbcb45b36fdef
diff --git a/holoviews/core/data.py b/holoviews/core/data.py index <HASH>..<HASH> 100644 --- a/holoviews/core/data.py +++ b/holoviews/core/data.py @@ -73,9 +73,9 @@ class Columns(Element): """ self.__dict__ = state if isinstance(self.data, OrderedDict): - self.data = NdElement(self.data, kdims=self.kdims, - vdims=self.vdims, group=self.group, - label=self.label) + self.data = Columns(self.data, kdims=self.kdims, + vdims=self.vdims, group=self.group, + label=self.label) self.interface = NdColumns elif isinstance(self.data, np.ndarray): self.interface = ArrayColumns
Columns now converts old pickle data to new formats
pyviz_holoviews
train
py
6f8c0bf61c34fd59df0a053f869a763ea61d0c82
diff --git a/modules/check-default-options.php b/modules/check-default-options.php index <HASH>..<HASH> 100644 --- a/modules/check-default-options.php +++ b/modules/check-default-options.php @@ -22,7 +22,7 @@ $options = array( ); foreach ( $options as $option ) { - if ( ! get_option($option) ) { + if ( get_option($option) === false ) { update_option($option, 'on'); } }
Use strict comparison when checking for option existence The plugin uses an empty string as a false value. It means that the user explicitly stated that they don't want the feature. Do not override empty strings. Closes: #<I>
Seravo_seravo-plugin
train
php
998ed7eb3e801d39326f36fd3b0c259fee2be0ec
diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb index <HASH>..<HASH> 100644 --- a/actionview/lib/action_view/base.rb +++ b/actionview/lib/action_view/base.rb @@ -213,6 +213,8 @@ module ActionView #:nodoc: context.lookup_context when Array ActionView::LookupContext.new(context) + when ActionView::PathSet + ActionView::LookupContext.new(context) when nil ActionView::LookupContext.new([]) else diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index <HASH>..<HASH> 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -360,6 +360,10 @@ module RenderTestCases assert_deprecated do ActionView::Base.new ["/a"] end + + assert_deprecated do + ActionView::Base.new ActionView::PathSet.new ["/a"] + end end def test_without_compiled_method_container_is_deprecated
Deprecate ActionView::PathSet as argument to ActionView::Base.new Currently, `ActionView::Base.new` will raise a `NotImplementedError` when given an instance of `ActionView::PathSet` on initialization. This commit prevents the raised error in favor of a deprecation warning.
rails_rails
train
rb,rb
35ea6bb9e8535e408c344aa00cb06e2977da7f07
diff --git a/src/Guzzle/Parser/ParserRegistry.php b/src/Guzzle/Parser/ParserRegistry.php index <HASH>..<HASH> 100644 --- a/src/Guzzle/Parser/ParserRegistry.php +++ b/src/Guzzle/Parser/ParserRegistry.php @@ -48,10 +48,9 @@ class ParserRegistry public function __construct() { // Use the PECL URI template parser if available - // Commenting out until https://github.com/ioseb/uri-template/issues/1 is fixed - // if (extension_loaded('uri_template')) { - // $this->mapping['uri_template'] = 'Guzzle\\Parser\\UriTemplate\\PeclUriTemplate'; - // } + if (extension_loaded('uri_template')) { + $this->mapping['uri_template'] = 'Guzzle\\Parser\\UriTemplate\\PeclUriTemplate'; + } } /**
Reinstating uri_template extension as the default if available
guzzle_guzzle3
train
php
aeb69791a6886185f3ae15c1c1c65e5124d53dd0
diff --git a/get-poetry.py b/get-poetry.py index <HASH>..<HASH> 100644 --- a/get-poetry.py +++ b/get-poetry.py @@ -702,7 +702,7 @@ class Installer: def get_unix_profiles(self): profiles = [os.path.join(HOME, ".profile")] - shell = os.getenv("SHELL") + shell = os.getenv("SHELL", "") if "zsh" in shell: zdotdir = os.getenv("ZDOTDIR", HOME) profiles.append(os.path.join(zdotdir, ".zprofile"))
Fix get-poetry.py when no shell is available
sdispater_poetry
train
py
def201aca819862470b879d5beb75fcf3d46f87f
diff --git a/src/rez/package_cache.py b/src/rez/package_cache.py index <HASH>..<HASH> 100644 --- a/src/rez/package_cache.py +++ b/src/rez/package_cache.py @@ -187,12 +187,12 @@ class PackageCache(object): ) # Package is already on same disk device as package cache. Note that - # this check is skipped on Windows + Py<=2.7, as os.stat does not + # this check is skipped on Windows + Py<3.4, as os.stat does not # support device identification. # dev_stat_not_supported = ( platform.system() == "Windows" and - sys.version_info[:2] <= (2, 7) + sys.version_info[:2] < (3, 4) ) if not config.package_cache_same_device and not dev_stat_not_supported:
trivial change, py<I> on Windows is the version that sets os.stat().st_dev properly.
nerdvegas_rez
train
py
b242ebd663989cf3e3d4592a79317e03867b6942
diff --git a/shoebot/data.py b/shoebot/data.py index <HASH>..<HASH> 100644 --- a/shoebot/data.py +++ b/shoebot/data.py @@ -889,7 +889,6 @@ class Image(Grob, TransformMixin, ColorMixin): import Image import numpy - from array import array # checks if image data is passed in command call, in this case it wraps # the data in a StringIO oject in order to use it as a file
removed array module import from Image class. let's free some memory
shoebot_shoebot
train
py
048189839037b8c5056d6e64bf1edbcb847d41a4
diff --git a/src/cli/keys.js b/src/cli/keys.js index <HASH>..<HASH> 100644 --- a/src/cli/keys.js +++ b/src/cli/keys.js @@ -54,7 +54,7 @@ module.exports = ({ commandProcessor, root }) => { }); commandProcessor.createCommand(keys, 'doctor', 'Creates and assigns a new key to your device, and uploads it to the cloud', { - params: '<device>', + params: '<device id>', options: protocolOption, handler: (args) => { const KeysCommand = require('../cmd/keys');
clarify that `particle keys doctor` expects device id (vs. name)
particle-iot_particle-cli
train
js
efb698335938dca53d151e99d90ee872e4e66fca
diff --git a/rules/named-functions-in-promises.js b/rules/named-functions-in-promises.js index <HASH>..<HASH> 100644 --- a/rules/named-functions-in-promises.js +++ b/rules/named-functions-in-promises.js @@ -14,7 +14,7 @@ module.exports = function(context) { context.report(node, message); }; - var promisesMethods = ['then', 'catch', 'success']; + var promisesMethods = ['then', 'catch']; return { CallExpression: function(node) {
named-functions-in-promises rule: Don't consider non-standard .success as Promise method.
ember-cli_eslint-plugin-ember
train
js
d2e14abfd56b041d6a5539dda40db717cdb3623b
diff --git a/sanic/request.py b/sanic/request.py index <HASH>..<HASH> 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -86,7 +86,7 @@ class Request(dict): :return: token related to request """ - prefixes = ('Token ', 'Bearer ') + prefixes = ('Bearer', 'Token ') auth_header = self.headers.get('Authorization') if auth_header is not None:
Inverted the order of prefixes in Request.token property. As suggested by @allan-simon See: <URL>
huge-success_sanic
train
py
e7f820e402731091e57c850541ff064740644fc4
diff --git a/.bin/helpers.js b/.bin/helpers.js index <HASH>..<HASH> 100644 --- a/.bin/helpers.js +++ b/.bin/helpers.js @@ -62,7 +62,7 @@ const closeLogs = () => { }; const exitProcess = (status = 1, error) => { - if (error) errorLog.write(error.toString()); + if (error) errorLog.write(error); closeLogs(); logToConsole(""); if (status === 0) {
improved script error printing see #<I>
Cycling74_miraweb
train
js
e82f094c49bdd16ef93900d7cc8063b0f3c26448
diff --git a/code/cms/ShopConfig.php b/code/cms/ShopConfig.php index <HASH>..<HASH> 100644 --- a/code/cms/ShopConfig.php +++ b/code/cms/ShopConfig.php @@ -16,10 +16,10 @@ class ShopConfig extends DataObjectDecorator{ function updateCMSFields($fields){ $fields->insertBefore($shoptab = new Tab('Shop', 'Shop'), 'Access'); - //$fields->findOrMakeTab("Root.Shop.Shipping","Shipping Countries"); //TODO: make Shipping tab - $fields->addFieldsToTab("Root.Shop", array( + $fields->addFieldsToTab("Root.Shop", new TabSet("ShopTabs",$countriestab = new Tab("Countries", $allowed = new CheckboxSetField('AllowedCountries','Allowed Ordering and Shipping Countries',Geoip::getCountryDropDown()) - )); + ))); + $countriestab->setTitle("Allowed Countries"); } function getCountriesList(){
NEW: Created tab for Allowed Countries
silvershop_silvershop-core
train
php
68d06d760256aed15733f65e4a3aae7c8703047c
diff --git a/src/main/java/us/fatehi/creditcardnumber/bankcard/ExpirationDate.java b/src/main/java/us/fatehi/creditcardnumber/bankcard/ExpirationDate.java index <HASH>..<HASH> 100644 --- a/src/main/java/us/fatehi/creditcardnumber/bankcard/ExpirationDate.java +++ b/src/main/java/us/fatehi/creditcardnumber/bankcard/ExpirationDate.java @@ -53,7 +53,42 @@ public class ExpirationDate */ public ExpirationDate() { - this(null); + this((String) null); + } + + /** + * Expiration date from year and month. + * + * @param year + * Year + * @param month + * Month + */ + public ExpirationDate(final Date date) + { + super(null); + if (date != null) + { + expirationDate = YearMonth.of(date.getYear() + 1900, date.getMonth() + 1); + } + else + { + expirationDate = null; + } + } + + /** + * Expiration date from year and month. + * + * @param year + * Year + * @param month + * Month + */ + public ExpirationDate(final int year, final int month) + { + super(null); + expirationDate = YearMonth.of(year, month); } /**
Adding more constructors for expiration date
sualeh_credit_card_number
train
java
71ab89dfc226379a32f1aa3414ffcb810652aa9a
diff --git a/pkg/minikube/bootstrapper/kubeadm/templates.go b/pkg/minikube/bootstrapper/kubeadm/templates.go index <HASH>..<HASH> 100644 --- a/pkg/minikube/bootstrapper/kubeadm/templates.go +++ b/pkg/minikube/bootstrapper/kubeadm/templates.go @@ -171,7 +171,8 @@ Documentation=http://kubernetes.io/docs/ ExecStart=/usr/bin/kubelet Restart=always StartLimitInterval=0 -RestartSec=10 +# Tuned for local dev: faster than upstream default (10s), but slower than systemd default (100ms) +RestartSec=600ms [Install] WantedBy=multi-user.target
Reduce kubectl restart time from <I> seconds to <I>ms
kubernetes_minikube
train
go
d9f2792d1fab73face48fbc7fcd10d0eac78c348
diff --git a/roaring/roaring.go b/roaring/roaring.go index <HASH>..<HASH> 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -23,7 +23,6 @@ import ( "math/bits" "sort" "unsafe" - "math" "github.com/pkg/errors" ) @@ -3945,7 +3944,7 @@ func (op *op) WriteTo(w io.Writer) (n int64, err error) { } var minOpSize = 13 -var maxOpSize = math.MaxInt64/8 - 13 +var maxOpN = 1000000 // UnmarshalBinary decodes data into an op. func (op *op) UnmarshalBinary(data []byte) error { @@ -3963,8 +3962,8 @@ func (op *op) UnmarshalBinary(data []byte) error { _, _ = h.Write(data[0:9]) if op.typ > 1 { - if maxOpSize < int(op.value){ - return fmt.Errorf("too big") + if maxOpN < int(op.value){ + return fmt.Errorf("Maximum operation size exceeded") } if len(data) < int(13+op.value*8) { return fmt.Errorf("op data truncated - expected %d, got %d", 13+op.value*8, len(data))
Reworded max int error and reset max int value
pilosa_pilosa
train
go
cafe539f0e20b46d52b65ab0ec157341ce1f7ec4
diff --git a/test/excel/writer/worksheet.rb b/test/excel/writer/worksheet.rb index <HASH>..<HASH> 100644 --- a/test/excel/writer/worksheet.rb +++ b/test/excel/writer/worksheet.rb @@ -14,6 +14,7 @@ class TestWorksheet < Test::Unit::TestCase assert_equal false, sheet.need_number?(114.55) assert_equal false, sheet.need_number?(0.1) assert_equal false, sheet.need_number?(0.01) + assert_equal false, sheet.need_number?(0 / 0.0) # NaN assert_equal true, sheet.need_number?(0.001) assert_equal true, sheet.need_number?(10000000.0) end
Added a test for the patch from Bjoern Andersson regarding NaN (Not a Number)
zdavatz_spreadsheet
train
rb
4c46510612b4f879ce0bff781855999310f1ee98
diff --git a/webdriver_manager/utils.py b/webdriver_manager/utils.py index <HASH>..<HASH> 100644 --- a/webdriver_manager/utils.py +++ b/webdriver_manager/utils.py @@ -96,12 +96,6 @@ def validate_response(resp: requests.Response): ) -def write_file(content, path): - with open(path, "wb") as code: - code.write(content) - return path - - def download_file(url: str, ssl_verify=True) -> File: log(f"Trying to download new driver from {url}") response = requests.get(url, stream=True, verify=ssl_verify) @@ -116,20 +110,6 @@ def get_date_diff(date1, date2, date_format): return (b - a).days -def get_filename_from_response(response, name): - try: - filename = re.findall("filename=(.+)", response.headers["content-disposition"])[0] - except KeyError: - filename = "{}.zip".format(name) - except IndexError: - filename = name + ".exe" - - if '"' in filename: - filename = filename.replace('"', "") - - return filename - - def linux_browser_apps_to_cmd(*apps: str) -> str: """Create 'browser --version' command from browser app names.
gh #<I> remove write_file, get_filename_from_response (#<I>)
SergeyPirogov_webdriver_manager
train
py
c5b69cf3f36659578cdf773886159a531d0325f6
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ var randomBytes = require('randombytes') -var ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ~abcdefghijklmnopqrstuvwxyz_' +var ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~' var counter = parseInt(randomBytes(2).toString('hex'), 16) var max = decode('___') var time = Date.now()
fix(ALPHABET): sorted chars.
nxtedition_xuid
train
js
95d7bdbbd88f690c1dc0db4c3cbe0e8419fb03fa
diff --git a/src/connection.js b/src/connection.js index <HASH>..<HASH> 100644 --- a/src/connection.js +++ b/src/connection.js @@ -575,7 +575,7 @@ const GetBlockTimeRpcResult = struct({ jsonrpc: struct.literal('2.0'), id: 'string', error: 'any?', - result: struct.union(['null', 'number']), + result: struct.union(['null', 'number', 'undefined']), }); /**
fix: undefined is a valid result for getBlockTime
solana-labs_solana-web3.js
train
js
5b1298a6ca43424a885b5d041400b74ccbfe9cbf
diff --git a/modules/es/views/es.SurfaceView.js b/modules/es/views/es.SurfaceView.js index <HASH>..<HASH> 100644 --- a/modules/es/views/es.SurfaceView.js +++ b/modules/es/views/es.SurfaceView.js @@ -134,8 +134,6 @@ es.SurfaceView = function( $container, model ) { this.$window.scroll( function() { surfaceView.dimensions.scrollTop = surfaceView.$window.scrollTop(); } ); - - this.documentView.on('update', function() {alert(1);}); }; es.SurfaceView.prototype.onMouseDown = function( e ) {
Removed alert() - dude, use console.log, and don't leave it in the SVN plz! :P
wikimedia_parsoid
train
js
5df6229d2aae5ec20c7380249e722de18c5a12e9
diff --git a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java +++ b/src/main/java/org/jboss/netty/handler/ssl/SslHandler.java @@ -273,14 +273,13 @@ public class SslHandler extends FrameDecoder { if (handshaking) { return this.handshakeFuture; } else { + engine.beginHandshake(); handshakeFuture = this.handshakeFuture = newHandshakeFuture(channel); handshaking = true; } } - ChannelHandlerContext ctx = context(channel); - engine.beginHandshake(); - wrapNonAppData(ctx, channel); + wrapNonAppData(context(channel), channel); return handshakeFuture; }
A workaround for 'missing algorithm' error during handshake
netty_netty
train
java
29fc37bad621238edff05322308c0b07eca9a79f
diff --git a/ph-ubl21/src/main/java/com/helger/ubl21/CUBL21.java b/ph-ubl21/src/main/java/com/helger/ubl21/CUBL21.java index <HASH>..<HASH> 100644 --- a/ph-ubl21/src/main/java/com/helger/ubl21/CUBL21.java +++ b/ph-ubl21/src/main/java/com/helger/ubl21/CUBL21.java @@ -40,9 +40,6 @@ public final class CUBL21 /** The cec namespace URL */ public static final String XML_SCHEMA_CEC_NAMESPACE_URL = "urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"; - @Deprecated - public static final String XSD_UBL_XMLDSIG = "schemas/ubl21/common/UBL-xmldsig-core-schema-2.1.xsd"; - @PresentForCodeCoverage private static final CUBL21 s_aInstance = new CUBL21 ();
Removed XMLDsig <I> constant
phax_ph-ubl
train
java
bb4753ccaeae2822dd2c1e4658e095009e1e81b3
diff --git a/lib/bootstrap_forms/helpers/wrappers.rb b/lib/bootstrap_forms/helpers/wrappers.rb index <HASH>..<HASH> 100644 --- a/lib/bootstrap_forms/helpers/wrappers.rb +++ b/lib/bootstrap_forms/helpers/wrappers.rb @@ -48,10 +48,14 @@ module BootstrapForms end def label_field(&block) - if respond_to?(:object) - label(@name, block_given? ? block : @field_options[:label], :class => ['control-label', required_class].compact.join(' ')) + if @field_options[:label] == "" + return "".html_safe else - label_tag(@name, block_given? ? block : @field_options[:label], :class => ['control-label', required_class].compact.join(' ')) + if respond_to?(:object) + label(@name, block_given? ? block : @field_options[:label], :class => ['control-label', required_class].compact.join(' ')) + else + label_tag(@name, block_given? ? block : @field_options[:label], :class => ['control-label', required_class].compact.join(' ')) + end end end
added the possibility to pass label: '' as option in tags, which cause the absence of label in html output
sethvargo_bootstrap_forms
train
rb
1c97019eaf239376605c3dd214661666ea7ce1a0
diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index <HASH>..<HASH> 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -1143,31 +1143,6 @@ function lesson_check_nickname($name) { return true; } -/*******************************************************************/ -function lesson_clean_data_submitted() { -// this function runs through all post/get data submitted to a page -// and runs clean_param on each -// returns an object - - // get the data - if ($form = data_submitted()) { - // run through and clean each form value - // detect arrays as well and process them accordingly - foreach ($form as $valuename => $formvalue) { - if (is_array($formvalue)) { - foreach ($formvalue as $index => $formsubvalue) { - $formvalue[$index] = clean_param($formsubvalue, PARAM_CLEAN); - } - $form->$valuename = $formvalue; - } else { - $form->$valuename = clean_param($formvalue, PARAM_CLEAN); - } - } - } - - return $form; -} - /// CDC-FLAG /// ?>
removed lesson_clean_data_submitted() function. Removed all instances of its use before I did this
moodle_moodle
train
php
428fd7e5aa01b18763c6d25cef3f7ad2a8d2ce18
diff --git a/core/workspace_comment.js b/core/workspace_comment.js index <HASH>..<HASH> 100644 --- a/core/workspace_comment.js +++ b/core/workspace_comment.js @@ -419,7 +419,7 @@ Blockly.WorkspaceComment.parseAttributes = function(xml) { * the XML. * @type {boolean} */ - minimized: xml.getAttribute('minimized') || false, + minimized: xml.getAttribute('minimized') == 'true' || false, /* @type {string} */ content: xml.textContent };
Import workspace comment minimized state correctly.
LLK_scratch-blocks
train
js
d4b562e001f35467f97a9463607e56371c76b6dc
diff --git a/lib/output/ebook/getCoverPath.js b/lib/output/ebook/getCoverPath.js index <HASH>..<HASH> 100644 --- a/lib/output/ebook/getCoverPath.js +++ b/lib/output/ebook/getCoverPath.js @@ -11,17 +11,17 @@ function getCoverPath(output) { var outputRoot = output.getRoot(); var book = output.getBook(); var config = book.getConfig(); - var cover = config.getValue('cover', 'cover.jpg'); + var coverName = config.getValue('cover', 'cover.jpg'); // Resolve to absolute - cover = fs.pickFile(outputRoot, cover); + var cover = fs.pickFile(outputRoot, coverName); if (cover) { return cover; } // Multilingual? try parent folder if (book.isLanguageBook()) { - cover = fs.pickFile(path.join(outputRoot, '..'), cover); + cover = fs.pickFile(path.join(outputRoot, '..'), coverName); } return cover;
Fix get of cover for multilingual books
GitbookIO_gitbook
train
js
8174f206125f1771aabfb334c33ff39777158261
diff --git a/lib/model/exposable.js b/lib/model/exposable.js index <HASH>..<HASH> 100644 --- a/lib/model/exposable.js +++ b/lib/model/exposable.js @@ -191,13 +191,25 @@ function exposeCrud(Model, methods) { function notFoundError(ctx, cb) { var modelName = ctx.method.sharedClass.name; - var id = ctx.req.param('id'); + var id = reqparam(ctx.req, 'id'); var msg = 'Unknown "' + modelName + '" id "' + id + '".'; var error = new Error(msg); error.statusCode = error.status = 404; cb(error); } + function reqparam(req, name, defaultValue) { + var params = req.params || {}; + var body = req.body || {}; + var query = req.query || {}; + + if (null != params[name] && params.hasOwnProperty(name)) return params[name]; + if (null != body[name]) return body[name]; + if (null != query[name]) return query[name]; + + return defaultValue; + } + enabled('create') && expose(Model, 'create', { description: 'Create a new instance of the model and persist it into the data source', accepts: {arg: 'data', type: 'object', source: 'body', description: 'Model instance data'},
fixed req.param dept throw message
uugolab_sycle
train
js
4585b61002f05b8d72ba2d50d308c88aee0368b7
diff --git a/lib/sdk/filters.js b/lib/sdk/filters.js index <HASH>..<HASH> 100644 --- a/lib/sdk/filters.js +++ b/lib/sdk/filters.js @@ -55,6 +55,7 @@ exports.contextfunctions = { url = path.join(prefix, url); url = path.relative(basepath, url); url = url.replace(/\\/g, '/'); + if (url.charAt(0) !== '.') url = './' + url; return url; }; },
append ./ on static_url, coz seajs
lepture_nico
train
js
c9501128b61089ca19f5564f1bed0e6d63843cc3
diff --git a/plugin/pkg/scheduler/factory/plugins.go b/plugin/pkg/scheduler/factory/plugins.go index <HASH>..<HASH> 100644 --- a/plugin/pkg/scheduler/factory/plugins.go +++ b/plugin/pkg/scheduler/factory/plugins.go @@ -110,7 +110,7 @@ func GetAlgorithmProvider(name string) (*AlgorithmProviderConfig, error) { var provider AlgorithmProviderConfig provider, ok := algorithmProviderMap[name] if !ok { - return nil, fmt.Errorf("plugin '%v' has not been registered", provider) + return nil, fmt.Errorf("plugin %q has not been registered", name) } return &provider, nil @@ -124,7 +124,7 @@ func getFitPredicateFunctions(keys util.StringSet) ([]algorithm.FitPredicate, er for _, key := range keys.List() { function, ok := fitPredicateMap[key] if !ok { - return nil, fmt.Errorf("Invalid predicate key %s specified - no corresponding function found", key) + return nil, fmt.Errorf("Invalid predicate key %q specified - no corresponding function found", key) } predicates = append(predicates, function) }
Scheduler is printing the wrong value when no default algorithms available
kubernetes_kubernetes
train
go
f180cdde6e288a7257440365a86e188d7ffd3d56
diff --git a/test/keenio-middleware.js b/test/keenio-middleware.js index <HASH>..<HASH> 100644 --- a/test/keenio-middleware.js +++ b/test/keenio-middleware.js @@ -173,7 +173,10 @@ describe("keenioMiddleware", function () { app = express(); app.configure(function () { - app.use(express.bodyParser()); + app.use(express.json()); + app.use(express.urlencoded()); // note: these two replace: app.use(express.bodyParser()); + // see: http://stackoverflow.com/questions/19581146/how-to-get-rid-of-connect-3-0-deprecation-alert + app.use(keenioMiddleware.handleAll()); app.use(app.router); }); @@ -266,7 +269,10 @@ describe("keenioMiddleware", function () { app = express(); app.configure(function () { - app.use(express.bodyParser()); + app.use(express.json()); + app.use(express.urlencoded()); // note: these two replace: app.use(express.bodyParser()); + // see: http://stackoverflow.com/questions/19581146/how-to-get-rid-of-connect-3-0-deprecation-alert + app.use(app.router); }); });
Removed annoying deprecated Connect/Express warning.
sebinsua_express-keenio
train
js
455057d80f404affae68b89bb2ce919b8b6c45bf
diff --git a/ibis/expr/analysis.py b/ibis/expr/analysis.py index <HASH>..<HASH> 100644 --- a/ibis/expr/analysis.py +++ b/ibis/expr/analysis.py @@ -538,7 +538,7 @@ def find_base_table(expr): if isinstance(expr, ir.TableExpr): return expr - for arg in expr.op().args: + for arg in expr.op().flat_args(): if isinstance(arg, ir.Expr): r = find_base_table(arg) if isinstance(r, ir.TableExpr): diff --git a/ibis/sql/tests/test_compiler.py b/ibis/sql/tests/test_compiler.py index <HASH>..<HASH> 100644 --- a/ibis/sql/tests/test_compiler.py +++ b/ibis/sql/tests/test_compiler.py @@ -387,6 +387,17 @@ FROM ( ) t0""" assert query == expected + def test_isnull_case_expr_rewrite_failure(self): + # #172, case expression that was not being properly converted into an + # aggregation + reduction = self.table.g.isnull().ifelse(1, 0).sum() + + result = to_sql(reduction) + expected = """\ +SELECT sum(CASE WHEN g IS NULL THEN 1 ELSE 0 END) AS tmp +FROM alltypes""" + assert result == expected + class TestDataIngestWorkflows(unittest.TestCase):
BUG: flatten args when looking for base table. Fix downstream failing example. Closes #<I>
ibis-project_ibis
train
py,py
b7ef6f85671bd1e57efcb0eb859b0b2b933d6645
diff --git a/cmd/minify/fs.go b/cmd/minify/fs.go index <HASH>..<HASH> 100644 --- a/cmd/minify/fs.go +++ b/cmd/minify/fs.go @@ -3,7 +3,7 @@ package main import ( "errors" "os" - "path" + "path/filepath" "sort" ) @@ -152,7 +152,7 @@ func walkDir(fsys FS, name string, d DirEntry, walkDirFn WalkDirFunc) error { } for _, d1 := range dirs { - name1 := path.Join(name, d1.Name()) + name1 := filepath.Join(name, d1.Name()) if err := walkDir(fsys, name1, d1, walkDirFn); err != nil { if err == SkipDir { break
Use the cross-platform path/filepath package by preference
tdewolff_minify
train
go
b453da6634b3d654889600982acb278c789718ba
diff --git a/tests/test_doctests.py b/tests/test_doctests.py index <HASH>..<HASH> 100644 --- a/tests/test_doctests.py +++ b/tests/test_doctests.py @@ -4,16 +4,14 @@ import glob import os #from zope.testing import doctest -from rtree.index import __c_api_version__ +from rtree.index import major_version, minor_version + from .data import boxes15, boxes3, points optionflags = (doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS) -sindex_version = tuple(map(int, - __c_api_version__.decode('utf-8').split('.'))) - def list_doctests(): # Skip the custom storage test unless we have libspatialindex 1.8+. return [filename @@ -21,7 +19,7 @@ def list_doctests(): in glob.glob(os.path.join(os.path.dirname(__file__), '*.txt')) if not ( filename.endswith('customStorage.txt') - and sindex_version < (1,8,0))] + and major_version < 2 and minor_version < 8)] def open_file(filename, mode='r'): """Helper function to open files from within the tests package."""
another attempt at shutting off customStorage tests when libspatialindex version < <I>
Toblerity_rtree
train
py
ceb0af01d9559253968a91fe9c9b9ed1d35349bd
diff --git a/scripts/shopify_api.py b/scripts/shopify_api.py index <HASH>..<HASH> 100755 --- a/scripts/shopify_api.py +++ b/scripts/shopify_api.py @@ -7,6 +7,7 @@ import os import os.path import glob import subprocess +import functools import yaml import six @@ -66,7 +67,7 @@ class TasksMeta(type): usage_string = " %s %s" % (cls._prog, task_func.usage) desc = task_func.__doc__.splitlines()[0] usage_list.append((usage_string, desc)) - max_len = reduce(lambda m, item: max(m, len(item[0])), usage_list, 0) + max_len = functools.reduce(lambda m, item: max(m, len(item[0])), usage_list, 0) print("Tasks:") cols = int(os.environ.get("COLUMNS", 80)) for line, desc in usage_list:
Use reduce in functools module for python 3 compatibility.
Shopify_shopify_python_api
train
py