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
f31fe3330bc0c75cf760f901462d327aa8a0aefc
diff --git a/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java b/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java index <HASH>..<HASH> 100644 --- a/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java +++ b/clients/java/src/test/java/com/thoughtworks/selenium/SeleneseTestCase.java @@ -120,8 +120,7 @@ public class SeleneseTestCase extends TestCase { String s1glob = s1.replaceFirst("glob:", ".*") .replaceAll("\\*", ".*") - .replaceAll("[\\]\\[\\$\\(\\).]", "\\\\$1") - .replaceAll("\\.", "\\\\.") + .replaceAll("([\\]\\[\\$\\(\\).])", "\\\\$1") .replaceAll("\\?", ".") + ".*"; if (!s2.matches(s1glob)) { System.out.println("expected " + s2 + " to match glob " + s1 + " (had transformed the glob into regexp:" + s1glob);
fix hiding of regexp characters when comparing strings r<I>
SeleniumHQ_selenium
train
java
cc92c4563b4ed99d7dfeb506c5855edbda2e29c6
diff --git a/config.php b/config.php index <HASH>..<HASH> 100755 --- a/config.php +++ b/config.php @@ -2,7 +2,8 @@ function phoxy_default_conf() { - return array( + return + [ "ip" => $_SERVER['REMOTE_ADDR'], "site" => "http://".$_SERVER['HTTP_HOST']."/", "ejs_dir" => "ejs", @@ -17,7 +18,8 @@ function phoxy_default_conf() "cache_local" => null, "autostart" => true, "api_xss_prevent" => true, - ); + "cache" => ["session" => "1h"] + ]; } if (!function_exists("phoxy_conf"))
Default cache on config is 1 hour
phoxy_phoxy
train
php
e2217a09e8efc938c8544538c07f2558f38f31cd
diff --git a/salt/pillar/mongo.py b/salt/pillar/mongo.py index <HASH>..<HASH> 100644 --- a/salt/pillar/mongo.py +++ b/salt/pillar/mongo.py @@ -116,7 +116,7 @@ def ext_pillar(minion_id, host = __opts__['mongo.host'] port = __opts__['mongo.port'] log.info('connecting to {0}:{1} for mongo ext_pillar'.format(host, port)) - conn = pymongo.Connection(host, port) + conn = pymongo.MongoClient(host, port) log.debug('using database \'{0}\''.format(__opts__['mongo.db'])) mdb = conn[__opts__['mongo.db']] @@ -139,7 +139,7 @@ def ext_pillar(minion_id, ) ) - result = mdb[collection].find_one({id_field: minion_id}, fields=fields) + result = mdb[collection].find_one({id_field: minion_id}, projection=fields) if result: if fields: log.debug(
removed deprecated pymongo usage as no longer functional with pymongo > 3.x
saltstack_salt
train
py
486c5ce64acdd7698950a1a73f545108aa65461c
diff --git a/spec/helper.rb b/spec/helper.rb index <HASH>..<HASH> 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -57,7 +57,7 @@ RSpec.configure do |config| nvim_version = Support .nvim_version - .split("?") + .split("+") .first if !requirement.satisfied_by?(Gem::Version.new(nvim_version))
fixup! Support nvim nightly version strings
neovim_neovim-ruby
train
rb
ebbbe0418412e9b65ca1fa3972cb11279070f8b3
diff --git a/packages/ra-ui-materialui/src/input/ResettableTextField.js b/packages/ra-ui-materialui/src/input/ResettableTextField.js index <HASH>..<HASH> 100644 --- a/packages/ra-ui-materialui/src/input/ResettableTextField.js +++ b/packages/ra-ui-materialui/src/input/ResettableTextField.js @@ -25,6 +25,10 @@ const useStyles = makeStyles({ }, }); +const handleMouseDownClearButton = event => { + event.preventDefault(); +}; + /** * An override of the default Material-UI TextField which is resettable */ @@ -52,10 +56,6 @@ function ResettableTextField({ [onChange] ); - const handleMouseDownClearButton = useCallback(event => { - event.preventDefault(); - }, []); - const handleFocus = useCallback( event => { setShowClear(true);
Move handleMouseDownClearButton out of component
marmelab_react-admin
train
js
466a1910f139b0721de9065c7ae0dfdb2d00483e
diff --git a/packages/perspective-viewer/src/config/themes.config.js b/packages/perspective-viewer/src/config/themes.config.js index <HASH>..<HASH> 100644 --- a/packages/perspective-viewer/src/config/themes.config.js +++ b/packages/perspective-viewer/src/config/themes.config.js @@ -24,7 +24,10 @@ module.exports = Object.assign({}, common(), { }), new WebpackOnBuildPlugin(() => { for (const theme of THEMES) { - fs.unlinkSync(path.resolve(__dirname, "..", "..", "build", theme.replace("less", "js"))); + const filePath = path.resolve(__dirname, "..", "..", "build", theme.replace("less", "js")); + if (fs.existsSync(filePath)) { + fs.unlinkSync(filePath); + } } }) ], @@ -38,7 +41,7 @@ module.exports = Object.assign({}, common(), { loader: "base64-font-loader" }, { - test: /themes\/.+?\.less$/, + test: /themes[\\/].+?\.less$/, use: [{loader: MiniCssExtractPlugin.loader}, "css-loader", "less-loader"] } ]
Fix for webpack 4 themes generation error on Windows
finos_perspective
train
js
2866739f57f4fc137367568b5527395c6292e76b
diff --git a/blockstack_cli_0.14.1/blockstack_client/backend/queue.py b/blockstack_cli_0.14.1/blockstack_client/backend/queue.py index <HASH>..<HASH> 100644 --- a/blockstack_cli_0.14.1/blockstack_client/backend/queue.py +++ b/blockstack_cli_0.14.1/blockstack_client/backend/queue.py @@ -430,11 +430,11 @@ def cleanup_update_queue(path=DEFAULT_QUEUE_PATH, config_path=CONFIG_PATH): for rowdata in rows: entry = extract_entry(rowdata) + fqu = entry['fqu'] + # clear stale update if is_update_expired(entry, config_path=config_path): - log.debug("Removing tx with > max confirmations: (%s, confirmations %s)" - % (fqu, confirmations)) - + log.debug("Removing stale update tx: %s" % fqu) to_remove.append(entry) continue
fix undefined variable bug (in master) discovered by ruxton
blockstack_blockstack-core
train
py
43a26bf7ed1aa2860deef2b1acdd5d660124e1e8
diff --git a/test/unit/baseclient-suite.js b/test/unit/baseclient-suite.js index <HASH>..<HASH> 100644 --- a/test/unit/baseclient-suite.js +++ b/test/unit/baseclient-suite.js @@ -52,7 +52,7 @@ define(['requirejs'], function(requirejs, undefined) { run: function(env, test) { var storage = new RemoteStorage(); var client = new RemoteStorage.BaseClient(storage, '/foo/'); - test.assertAnd(client.storage, storage); + test.assertAnd(client.storage instanceof RemoteStorage, true); test.assertAnd(client.base, '/foo/'); test.done(); } diff --git a/test/unit/localstorage-suite.js b/test/unit/localstorage-suite.js index <HASH>..<HASH> 100644 --- a/test/unit/localstorage-suite.js +++ b/test/unit/localstorage-suite.js @@ -118,7 +118,8 @@ define(['requirejs'], function(requirejs) { local: { body: 'bar', contentType: 'text/plain' - } + }, + common: {} }); test.done(); });
Fix tests that fail because Jaribu checks more thorough now
remotestorage_remotestorage.js
train
js,js
f4b4539a71fe6b49d93261b7698a0cb82a221422
diff --git a/lib/rulesets.js b/lib/rulesets.js index <HASH>..<HASH> 100644 --- a/lib/rulesets.js +++ b/lib/rulesets.js @@ -22,7 +22,8 @@ module.exports = { 'touchdown-package': { _skip: [ /^tests?\b/i, - /^grunt?\b/i + /^grunt?\b/i, + /^artifacts\b/i ], configs: { regex: /^configs\/([a-z_\-\/]+)\.(json|js)$/i
Ignoring artifacts folder
yahoo_locator
train
js
7bbdd8b41e6cb2afb64a7b860e51553748a160bc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import setuptools setuptools.setup( name="Mongothon", - version="0.7.16", + version="0.7.17", author="Tom Leach", author_email="tom@gc.io", description="A MongoDB object-document mapping layer for Python", @@ -14,6 +14,6 @@ setuptools.setup( long_description="Mongothon is a MongoDB object-document mapping " + "API for Python, loosely based on the awesome " + "mongoose.js library.", - install_requires=['pymongo>=2.5.0', 'inflection==0.2.0', 'schemer==0.2.4'], + install_requires=['pymongo>=2.5.0', 'inflection==0.2.0', 'schemer>=0.2.0, <0.3.0'], tests_require=['mock', 'nose'] )
Use new version of Schemer and make the version float
gamechanger_mongothon
train
py
855636f7807bca98f91bdc9e40d1d1a95fa9b75a
diff --git a/lib/openstax/salesforce/spec_helpers.rb b/lib/openstax/salesforce/spec_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/openstax/salesforce/spec_helpers.rb +++ b/lib/openstax/salesforce/spec_helpers.rb @@ -59,6 +59,8 @@ module OpenStax::Salesforce::SpecHelpers include OpenStax::Salesforce::Remote def initialize + # For cassette consistency, to ensure specs always get new tokens + ActiveForce.clear_sfdc_client! end # Used to filter records to the scope of one spec
Ensure specs that use the SF proxy always get new tokens
openstax_openstax_salesforce
train
rb
b3aed0d17714611f58de264123f0d9ac90d30a27
diff --git a/Generator/NewAction.php b/Generator/NewAction.php index <HASH>..<HASH> 100644 --- a/Generator/NewAction.php +++ b/Generator/NewAction.php @@ -17,7 +17,7 @@ class NewAction extends Action parent::__construct($name); $this->setLabel('actions.new.label'); - $this->setIcon('icon-white icon-certificate'); + $this->setIcon('icon-white icon-plus'); $this->setClass('btn-primary'); } }
Changed the new image, to plus
symfony2admingenerator_AdmingeneratorGeneratorBundle
train
php
748cf2476b19e29deb6cf65d94e52235db1ba85a
diff --git a/WebDriverBase.php b/WebDriverBase.php index <HASH>..<HASH> 100644 --- a/WebDriverBase.php +++ b/WebDriverBase.php @@ -100,7 +100,7 @@ abstract class WebDriverBase { $results = $this->curl($http_method, '/' . $webdriver_command, - $arguments[0]); + array_shift($arguments)); return $results['value']; } @@ -112,7 +112,7 @@ abstract class WebDriverBase { $webdriver_command))); } - $http_methods = $this->methods()[$webdriver_command]; - return is_array($http_methods) ? $http_methods[0] : $http_methods; + $http_methods = (array) $this->methods()[$webdriver_command]; + return array_shift($http_methods); } }
fix 0 index errors Summary: Reviewers: Test Plan: Task ID:
facebook_php-webdriver
train
php
38f3da657a330923fd48715330ec46cafac5736f
diff --git a/bibliopixel/drivers/serial_driver.py b/bibliopixel/drivers/serial_driver.py index <HASH>..<HASH> 100644 --- a/bibliopixel/drivers/serial_driver.py +++ b/bibliopixel/drivers/serial_driver.py @@ -36,6 +36,7 @@ class LEDTYPE: WS2812 = 3 WS2812B = 3 NEOPIXEL = 3 + APA104 = 3 #400khz variant of above WS2811_400 = 4 @@ -44,6 +45,9 @@ class LEDTYPE: TM1803 = 6 UCS1903 = 7 SM16716 = 8 + APA102 = 9 + LPD1886 = 10 + P9813 = 11 class DriverSerial(DriverBase): """Main driver for Serial based LED strips""" diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup( name='BiblioPixel', - version='1.0.1', + version='1.0.2', description='BiblioPixel is a pure python library for manipulating a wide variety of LED strip based displays, both in strip and matrix form.', author='Adam Haile', author_email='adam@maniacallabs.com',
Added chipsets from new AllPixel firmware
ManiacalLabs_BiblioPixel
train
py,py
4435e187593d1aee339511218bd128fe4c5f595c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -316,6 +316,8 @@ function visualizeRender (component) { component.renderLogDetail = null; component.renderLogRenderCount = null; component._updateRenderLogPositionTimeout = null; + + return component; } module.exports = visualizeRender;
Update index.js Return modified component, so that when not using `@decorator` syntax, as it isn't set in stone, it works. By that, I mean wrapping component in the decorator function. ```javascript visualizeRender(MyComponent) // or @visualizeRender class MyComponent ... ```
marcin-mazurek_react-render-visualizer-decorator
train
js
0c274336acaadc0ca3efaf6f88d32595e3b16314
diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py index <HASH>..<HASH> 100644 --- a/qiskit/circuit/quantumcircuit.py +++ b/qiskit/circuit/quantumcircuit.py @@ -863,16 +863,14 @@ class QuantumCircuit: mapped_instrs.append((n_instr, n_qargs, n_cargs)) if front: + # adjust new instrs before original ones and update all parameters dest._data = mapped_instrs + dest._data - else: - dest._data += mapped_instrs - - if front: dest._parameter_table.clear() for instr, _, _ in dest._data: dest._update_parameter_table(instr) else: - # just append new parameters + # just append new instrs and parameters + dest._data += mapped_instrs for instr, _, _ in mapped_instrs: dest._update_parameter_table(instr)
Merge condition check codes in compose() method (#<I>) * Merge condition check codes in compose() method * change comment * format comment
Qiskit_qiskit-terra
train
py
9b56241c1a6b1e78863e721aa2f479f1804cbbf2
diff --git a/assets/js/views/image-upload/crop.js b/assets/js/views/image-upload/crop.js index <HASH>..<HASH> 100644 --- a/assets/js/views/image-upload/crop.js +++ b/assets/js/views/image-upload/crop.js @@ -54,18 +54,6 @@ define(function (require) { // Start jcrop up once the images loaded this.$el.imagesLoaded(this.init); - - }, - - // Events - events: { - 'active': 'activate' // This image has now been activated - }, - - // Activated, meaning a tab has been clicked to reveal it. Note: the first - // image is assumed to be activated on load. - activate: function() { - if (!this.initted) this.init(); }, // Add jcrop to the element @@ -97,7 +85,7 @@ define(function (require) { // Store a reference to jcrop and call the ready function }, function() { self.jcrop = this; - activeCrop = true; + self.activeCrop = true; // Put all of the jcrop instances in a parent to give them the polariod effecast self.$el.siblings('.jcrop-holder').wrap('<div class="img-thumbnail" style="display: inline-block;"/>');
Removing some unncessary code
BKWLD_decoy
train
js
a3dfbf02f91e429d2cb3d9a7dcbacabf716a9cb5
diff --git a/src/selectr.js b/src/selectr.js index <HASH>..<HASH> 100644 --- a/src/selectr.js +++ b/src/selectr.js @@ -447,6 +447,8 @@ _aTempEscapedSeperators.push(util.escapeRegExp(this.tagSeperators[_nTagSeperatorStepCount])); } this.tagSeperatorsRegex = new RegExp(_aTempEscapedSeperators.join('|'),'i'); + } else { + this.tagSeperatorsRegex = new RegExp(',','i'); } }
missing tegSeperatorRegex when no seperators are given
Mobius1_Selectr
train
js
9962e598a095dec77579d55ba2e68126b8eb762d
diff --git a/p2p/switch.go b/p2p/switch.go index <HASH>..<HASH> 100644 --- a/p2p/switch.go +++ b/p2p/switch.go @@ -283,7 +283,9 @@ func (sw *Switch) StopPeerForError(peer Peer, reason interface{}) { if peer.IsPersistent() { addr := peer.OriginalAddr() if addr == nil { - panic(fmt.Sprintf("persistent peer %v with no original address", peer)) + // FIXME: persistent peers can't be inbound right now. + // self-reported address for inbound persistent peers + addr = peer.NodeInfo().NetAddress() } go sw.reconnectToPeer(addr) }
reconnect to self-reported address if persistent peer is inbound (#<I>) * reconnect to self-reported address if persistent peer is inbound * add a fixme
tendermint_tendermint
train
go
fe3f272f0c960799d9bb2183b9b4e678b5bb8e3d
diff --git a/lib/kamerling/repos.rb b/lib/kamerling/repos.rb index <HASH>..<HASH> 100644 --- a/lib/kamerling/repos.rb +++ b/lib/kamerling/repos.rb @@ -1,4 +1,4 @@ -require 'sequel' +warn_off { require 'sequel' } require_relative 'client' require_relative 'project' require_relative 'registration'
sequel <I> brings some more warnings
chastell_kamerling
train
rb
f5220ea88fb1abd824500a33d4ee8671b036a8ae
diff --git a/test/base/test_mock_driver.py b/test/base/test_mock_driver.py index <HASH>..<HASH> 100644 --- a/test/base/test_mock_driver.py +++ b/test/base/test_mock_driver.py @@ -74,15 +74,15 @@ class TestMockDriver(object): with pytest.raises(NotImplementedError) as excinfo: d.get_route_to() - expected = "You can provide mocked data in {}/get_route_to.1".format( - optional_args["path"] + expected = "You can provide mocked data in {}".format( + os.path.join(optional_args["path"], "get_route_to.1") ) assert expected in py23_compat.text_type(excinfo.value) with pytest.raises(NotImplementedError) as excinfo: d.get_route_to() - expected = "You can provide mocked data in {}/get_route_to.2".format( - optional_args["path"] + expected = "You can provide mocked data in {}".format( + os.path.join(optional_args["path"], "get_route_to.2") ) assert expected in py23_compat.text_type(excinfo.value)
Fix path in tests when running on a windows environment (#<I>)
napalm-automation_napalm
train
py
37b5db7b406077420f24f46066e49bdd8dcec16b
diff --git a/jquery.maskMoney.js b/jquery.maskMoney.js index <HASH>..<HASH> 100644 --- a/jquery.maskMoney.js +++ b/jquery.maskMoney.js @@ -211,6 +211,11 @@ : setSymbol(neg+t); } + function mask() { + var value = input.val(); + input.val(maskValue(value)); + } + function getDefaultMask() { var n = parseFloat('0')/Math.pow(10,settings.precision); return (n.toFixed(settings.precision)).replace(new RegExp('\\.','g'),settings.decimal); @@ -240,6 +245,7 @@ input.bind('keydown',keydownEvent); input.bind('blur',blurEvent); input.bind('focus',focusEvent); + input.bind("mask", mask); input.one('unmaskMoney',function() { input.unbind('focus',focusEvent); @@ -321,4 +327,4 @@ }; } -})(jQuery); \ No newline at end of file +})(jQuery);
Added support for 'mask' events
plentz_jquery-maskmoney
train
js
f7baa5f7e5cd77f60a1aef78019a57a70707df8c
diff --git a/utils/build/webgme.classes/cbuild.js b/utils/build/webgme.classes/cbuild.js index <HASH>..<HASH> 100644 --- a/utils/build/webgme.classes/cbuild.js +++ b/utils/build/webgme.classes/cbuild.js @@ -8,6 +8,7 @@ executor: './common/executor', superagent: './client/lib/superagent/superagent-1.2.0', debug: './client/lib/debug/debug', + q: './client/lib/q/q', js: './client/js/', lib: './client/lib/', 'js/Dialogs/PluginConfig/PluginConfigDialog': '../utils/build/empty/empty',
#<I> Include path to q in build. Former-commit-id: a<I>c7e7c<I>fda<I>d<I>b5c<I>b<I>c<I>
webgme_webgme-engine
train
js
76914398f96c92be9213549120c0bbc0192dcf54
diff --git a/Classes/Helper/InlineHelper.php b/Classes/Helper/InlineHelper.php index <HASH>..<HASH> 100644 --- a/Classes/Helper/InlineHelper.php +++ b/Classes/Helper/InlineHelper.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; +use TYPO3\CMS\Core\Database\Query\Restriction\FrontendGroupRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction; use TYPO3\CMS\Core\Database\RelationHandler; use TYPO3\CMS\Core\Resource\FileRepository; @@ -239,6 +240,7 @@ class InlineHelper } } $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($childTable); + $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(FrontendGroupRestriction::class)); if (TYPO3_MODE === 'BE') { $queryBuilder ->getRestrictions()
[TASK] Add FrontendGroupRestriction to InlineHelper Add possibility to filter out restricted (fe_group) repeating items. Fixes: #<I>
Gernott_mask
train
php
27e9cd981f26024753f3d00bd0c02903e35e0c59
diff --git a/app/models/unidom/visitor/concerns/as_visitor.rb b/app/models/unidom/visitor/concerns/as_visitor.rb index <HASH>..<HASH> 100644 --- a/app/models/unidom/visitor/concerns/as_visitor.rb +++ b/app/models/unidom/visitor/concerns/as_visitor.rb @@ -32,14 +32,13 @@ module Unidom::Visitor::Concerns::AsVisitor module ClassMethods -=begin def sign_up!(it, as: nil, through: nil, at: Time.now, flag_code: 'RQRD', primary: true) - cognize! it, primary: true, at: at - is_identificated! as: as, at: at - is_authenticated! through: through, at: at - self + user = create! opened_at: at + user.cognize! it, primary: true, at: at + user.is_identificated! as: as, at: at + user.is_authenticated! through: through, at: at + user end -=end end
1, Improve the As Visitor concern to add the .sign_up! method.
topbitdu_unidom-visitor
train
rb
b0eae898a82bc172f3287ae0b0d865966034263e
diff --git a/spec/puppet-syntax/manifests_spec.rb b/spec/puppet-syntax/manifests_spec.rb index <HASH>..<HASH> 100644 --- a/spec/puppet-syntax/manifests_spec.rb +++ b/spec/puppet-syntax/manifests_spec.rb @@ -76,8 +76,8 @@ describe PuppetSyntax::Manifests do expect(output[1]).to match(/Deprecation notice:/) end end - else - context 'on puppet < 3.7' do + elsif Puppet::Util::Package.versioncmp(Puppet.version, '3.5') < 0 + context 'on puppet < 3.5' do it 'should not print deprecation notices' do files = fixture_manifests('deprecation_notice.pp') output, has_errors = subject.check(files) @@ -118,7 +118,7 @@ describe PuppetSyntax::Manifests do expect(has_errors).to eq(false) end end - context 'Puppet >= 3.7 and < 4.0' do + context 'Puppet >= 3.7' do # Certain elements of the future parser weren't added until 3.7 if Puppet::Util::Package.versioncmp(Puppet.version, '3.7') >= 0 it 'should fail on what were deprecation notices in the < 4.0 parser' do
Match context text to what's being tested and polish some logic
voxpupuli_puppet-syntax
train
rb
b2c0cc77df596fc76b415fcf7bef307100d2f48c
diff --git a/src/inputmask.js b/src/inputmask.js index <HASH>..<HASH> 100644 --- a/src/inputmask.js +++ b/src/inputmask.js @@ -100,15 +100,15 @@ function init(Survey) { surveyElement.customWidgetData.isNeedRender = true; }; - $(el).on('focusout change', function () { - - if ($(el).inputmask('isComplete')) { - surveyElement.value = $(el).val(); + var pushValueHandler = function () { + if (el.inputmask.isComplete()) { + surveyElement.value = options.autoUnmask ? + el.inputmask.unmaskedvalue() : el.value; } else { surveyElement.value = null; } - - }); + }; + el.onfocusout = el.onchange = pushValueHandler; var updateHandler = function() { el.value =
Remove jQuery from inputmask
surveyjs_widgets
train
js
1372acbf9ee4b760746c5b1f99783705c359d2b0
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -30,10 +30,7 @@ function Actions(prompt) { */ Actions.prototype.number = function(pos, key) { - if (key && key.hasOwnProperty('value')) { - pos = Number(key.value); - } - pos = this.position(pos); + pos = this.position(pos, key); if (pos >= 0 && pos <= this.choices.length) { this.choices.position = pos - 1; this.choices.radio(); @@ -153,7 +150,10 @@ Actions.prototype.enter = function(pos, key) { * @api public */ -Actions.prototype.position = function(pos) { +Actions.prototype.position = function(pos, key) { + if (key && key.name === 'number' && key.hasOwnProperty('value')) { + pos = Number(key.value); + } if (typeof pos === 'number') { if (pos >= 0 && pos <= this.choices.length) { this.choices.position = pos;
get correct position on `number`
enquirer_prompt-actions
train
js
a038cf9b8c791236f6aaf2ebab103df4e448ff40
diff --git a/AllTestsRunner.php b/AllTestsRunner.php index <HASH>..<HASH> 100644 --- a/AllTestsRunner.php +++ b/AllTestsRunner.php @@ -109,7 +109,7 @@ class AllTestsRunner extends PHPUnit_Framework_TestCase $aTestDirectories = array(); $aTestSuites = getenv('TEST_DIRS')? explode(',', getenv('TEST_DIRS')) : static::$testSuites; - $testConfig = static::getTestConfig(); + $testConfig = static::getStaticTestConfig(); foreach ($aTestSuites as $sSuite) { $aTestDirectories[] = $testConfig->getCurrentTestSuite() ."/$sSuite"; } diff --git a/library/UnitTestCase.php b/library/UnitTestCase.php index <HASH>..<HASH> 100755 --- a/library/UnitTestCase.php +++ b/library/UnitTestCase.php @@ -892,7 +892,7 @@ abstract class UnitTestCase extends BaseTestCase { if (is_null(self::$dbRestore)) { $factory = new DatabaseRestorerFactory(); - self::$dbRestore = $factory->createRestorer(self::getTestConfig()->getDatabaseRestorationClass()); + self::$dbRestore = $factory->createRestorer(self::getStaticTestConfig()->getDatabaseRestorationClass()); } return self::$dbRestore;
Change getTestConfig calls to static method PHP Strict standards: Non-static method OxidEsales\TestingLibrary\BaseTestCase::getTestConfig() should not be called statically in /var/www/oxideshop/vendor/oxid-esales/testing-library/library/UnitTestCase.php on line <I> Related #<I>
OXID-eSales_testing_library
train
php,php
c8c9d85d0c1180b3d02fc35d9c8cea9e5e98453a
diff --git a/tests/unit/simple_test.py b/tests/unit/simple_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/simple_test.py +++ b/tests/unit/simple_test.py @@ -235,3 +235,23 @@ def test_req_is_absolute(req, expected): def test_req_is_absolute_null(): assert venv_update.req_is_absolute(None) is False + + +def test_wait_for_all_subprocesses(monkeypatch): + class _nonlocal(object): + wait = 10 + thrown = False + + def fakewait(): + if _nonlocal.wait <= 0: + _nonlocal.thrown = True + raise OSError(10, 'No child process') + else: + _nonlocal.wait -= 1 + + import os + monkeypatch.setattr(os, 'wait', fakewait) + venv_update.wait_for_all_subprocesses() + + assert _nonlocal.wait == 0 + assert _nonlocal.thrown is True diff --git a/venv_update.py b/venv_update.py index <HASH>..<HASH> 100644 --- a/venv_update.py +++ b/venv_update.py @@ -400,7 +400,6 @@ def do_install(reqs): def wait_for_all_subprocesses(): - # TODO: unit-test from os import wait try: while True:
unit coverage for wait_for_all_subprocesses
Yelp_venv-update
train
py,py
30658002e6837fb33bb6f8e079427952daf18d95
diff --git a/Asset/Package/PathPackage.php b/Asset/Package/PathPackage.php index <HASH>..<HASH> 100644 --- a/Asset/Package/PathPackage.php +++ b/Asset/Package/PathPackage.php @@ -18,6 +18,8 @@ use Symfony\Component\Asset\PathPackage as BasePathPackage; use Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface; /** + * @see BasePathPackage + * * @author Kamil Kokot <kamil@kokot.me> */ class PathPackage extends BasePathPackage @@ -66,6 +68,13 @@ class PathPackage extends BasePathPackage $path = $this->pathResolver->resolve($path, $theme); } - return $this->getBasePath().ltrim($this->getVersionStrategy()->applyVersion($path), '/'); + $versionedPath = $this->getVersionStrategy()->applyVersion($path); + + // if absolute or begins with /, we're done + if ($this->isAbsoluteUrl($versionedPath) || ($versionedPath && '/' === $versionedPath[0])) { + return $versionedPath; + } + + return $this->getBasePath() . ltrim($versionedPath, '/'); } }
Handle absolute paths and urls in PathPackage
Sylius_SyliusThemeBundle
train
php
617c1c9ee9230de678e2c44bb0f08c6f933f7a35
diff --git a/src/openpgp.js b/src/openpgp.js index <HASH>..<HASH> 100644 --- a/src/openpgp.js +++ b/src/openpgp.js @@ -552,8 +552,15 @@ function onError(message, error) { if (config.debug) { console.error(error.stack); } // rethrow new high level error for api users const newError = new Error(message + ': ' + error.message); + + // Standardize stack trace for tests + if (error.stack.indexOf(error.message) === -1) { + error.stack = 'Error: ' + error.message + '\n' + error.stack; + } + //newError.innerError = error; newError.stack += '\n' + error.stack; + throw newError; }
include error message in stack trace for Safari/Firefox
openpgpjs_openpgpjs
train
js
4d343f27742a8535d2940a29a96921e55705c7ee
diff --git a/openstatesapi/bills.py b/openstatesapi/bills.py index <HASH>..<HASH> 100644 --- a/openstatesapi/bills.py +++ b/openstatesapi/bills.py @@ -1,4 +1,4 @@ -from pupa.scrape import Bill, Vote +from pupa.scrape import Bill, VoteEvent from .base import OpenstatesBaseScraper @@ -237,7 +237,7 @@ class OpenstatesBillScraper(OpenstatesBaseScraper): elif chamber == 'joint': chamber = 'legislature' - newvote = Vote(legislative_session=vote.pop('session'), + newvote = VoteEvent(legislative_session=vote.pop('session'), motion_text=vote.pop('motion'), result='pass' if vote.pop('passed') else 'fail', chamber=chamber,
update Vote class to be VoteEvent per pupa changes
openstates_billy
train
py
6a1782b5fce2b55fc02beba7cbef9b6af7436779
diff --git a/java/src/com/google/template/soy/data/SoyValueConverter.java b/java/src/com/google/template/soy/data/SoyValueConverter.java index <HASH>..<HASH> 100644 --- a/java/src/com/google/template/soy/data/SoyValueConverter.java +++ b/java/src/com/google/template/soy/data/SoyValueConverter.java @@ -327,6 +327,8 @@ public final class SoyValueConverter { return newListFromIterable(input); } }); + // NOTE: We don't convert plain Iterables, because many types extend from Iterable but are not + // meant to be enumerated. (e.g. ByteString implements Iterable<Byte>) expensiveConverterMap.put( FluentIterable.class, new Converter<FluentIterable<?>>() {
Add a comment about why we don't convert Iterable GITHUB_BREAKING_CHANGES=none ------------- Created by MOE: <URL>
google_closure-templates
train
java
c967c921aed138eaa3e3e9600f7b536c17bdf6e1
diff --git a/py/slimmer/slimmer.py b/py/slimmer/slimmer.py index <HASH>..<HASH> 100644 --- a/py/slimmer/slimmer.py +++ b/py/slimmer/slimmer.py @@ -38,18 +38,6 @@ class SlimmerMiddleware(object): f = open("%s/%s.html" % (settings.TEMPLATE_PATH,name)) return f.read() - def redirect(self,request,response): - location = urlparse(response['Location']) - if 'alphagov.co.uk' in location.netloc: - rewritten_url = ( - location.scheme, - request.get_host(), - location.path, - location.query, - location.fragment ) - response['Location'] = urlunsplit(rewritten_url) - return response.content - def not_found(self,request,response): return self.process_error("404") @@ -65,8 +53,6 @@ class SlimmerMiddleware(object): return response responses = { 200: self.skin, - 301: self.redirect, - 302: self.redirect, 404: self.not_found, 500: self.error }
Stop Py Slimmer rewriting redirects since (a) we're doing it in the apps and (b) it was getting it wrong
alphagov_slimmer
train
py
fc9ed2940a5cffb9c595f719da03395cf9222587
diff --git a/host/basil/HL/seq_gen.py b/host/basil/HL/seq_gen.py index <HASH>..<HASH> 100644 --- a/host/basil/HL/seq_gen.py +++ b/host/basil/HL/seq_gen.py @@ -32,11 +32,11 @@ class seq_gen(RegisterHardwareLayer): def __init__(self, intf, conf): super(seq_gen, self).__init__(intf, conf) self._seq_mem_offset = 32 # in bytes + + def init(self): + #self.reset() self._seq_mem_size = self.get_mem_size() -# def init(self): -# self.reset() - def reset(self): self.RESET = 0 @@ -112,7 +112,7 @@ class seq_gen(RegisterHardwareLayer): def set_data(self, data, addr=0): if self._seq_mem_size < len(data): - raise ValueError('Size of data is too big') + raise ValueError('Size of data %d is too big %d' % len(data), self._seq_mem_size) self._intf.write(self._conf['base_addr'] + self._seq_mem_offset + addr, data) def get_data(self, size=None, addr=0):
BUG: do not access hardware before init()
SiLab-Bonn_basil
train
py
bc46520e3f165a6cca16900f0b8ec3b3c02c627e
diff --git a/modules/system/assets/js/framework.js b/modules/system/assets/js/framework.js index <HASH>..<HASH> 100644 --- a/modules/system/assets/js/framework.js +++ b/modules/system/assets/js/framework.js @@ -319,7 +319,8 @@ if (window.jQuery.request !== undefined) { } else { requestData = $form.serialize() - if (!$.isEmptyObject(data)) requestData += '&' + $.param(data) + if (requestData) requestData = requestData + '&' + if (!$.isEmptyObject(data)) requestData += $.param(data) } /*
This prevents &foo=bar on empty forms
octobercms_october
train
js
9ed53ef6dd157b61e7beb9cc62a7644646448916
diff --git a/src/creep.py b/src/creep.py index <HASH>..<HASH> 100755 --- a/src/creep.py +++ b/src/creep.py @@ -109,7 +109,9 @@ def deploy (logger, environment, modifiers, name, files, rev_from, rev_to): if not prompt (logger, 'Execute synchronization? [Y/N]'): return True - # Execute processed actions using actual target + # Execute processed actions starting with "DEL" ones + actions.sort (key = lambda action: (action.type == creep.Action.DEL and 0 or 1, action.path)) + if not target.send (logger, work, actions): return False
Delete files first when deploying.
r3c_creep
train
py
51c2e19e874be6a7a203cb77829ac9b29dbf1946
diff --git a/lib/core/utils/flattened-tree.js b/lib/core/utils/flattened-tree.js index <HASH>..<HASH> 100644 --- a/lib/core/utils/flattened-tree.js +++ b/lib/core/utils/flattened-tree.js @@ -34,13 +34,13 @@ function virtualDOMfromNode(node, shadowId) { actualNode: node, _isHidden: null, // will be populated by axe.utils.isHidden get isFocusable() { - if (!vNodeCache._isFocusable) { + if (!vNodeCache.hasOwnProperty('_isFocusable')) { vNodeCache._isFocusable = axe.commons.dom.isFocusable(node); } return vNodeCache._isFocusable; }, get tabbableElements() { - if (!vNodeCache._tabbableElements) { + if (!vNodeCache.hasOwnProperty('_tabbableElements')) { vNodeCache._tabbableElements = axe.commons.dom.getTabbableElements( this );
fix: check if property exists in cache of flattenedTree (#<I>)
dequelabs_axe-core
train
js
a25eecc06882a4108cb7f3ee5ffebd86d4ee6d07
diff --git a/dustmaps/sfd.py b/dustmaps/sfd.py index <HASH>..<HASH> 100644 --- a/dustmaps/sfd.py +++ b/dustmaps/sfd.py @@ -30,7 +30,7 @@ import astropy.io.fits as fits from scipy.ndimage import map_coordinates from .std_paths import * -from .map_base import DustMap, ensure_flat_galactic +from .map_base import DustMap, WebDustMap, ensure_flat_galactic from . import fetch_utils from . import dustexceptions @@ -95,6 +95,22 @@ class SFDQuery(DustMap): return out +class SFDWebQuery(WebDustMap): + """ + Remote query over the web for the Schlegel, Finkbeiner & Davis (1998) dust + map. + + This query object does not require a local version of the data, but rather + an internet connection to contact the web API. The query functions have the + same inputs and outputs as their counterparts in ``SFDQuery``. + """ + + def __init__(self, api_url=None): + super(SFDWebQuery, self).__init__( + api_url=api_url, + map_name='sfd') + + def fetch(): """ Downloads the Schlegel, Finkbeiner & Davis (1998) dust map, placing it in
Added web query for SFD.
gregreen_dustmaps
train
py
8c11d9fc8d7654aaa1d6dd43628a3f9049711376
diff --git a/support/demo_template/index.js b/support/demo_template/index.js index <HASH>..<HASH> 100644 --- a/support/demo_template/index.js +++ b/support/demo_template/index.js @@ -96,6 +96,7 @@ defaults.highlight = function (str, lang) { var result = hljs.highlightAuto(str); + /*eslint-disable no-console*/ console.log('highlight language: ' + result.language + ', relevance: ' + result.relevance); return '<pre class="hljs language-' + esc(result.language) + '"><code>' +
Suppressed lint warning
markdown-it_markdown-it
train
js
b52d86ed30c2abcee81ab49b90774475aca16f68
diff --git a/pymatgen/analysis/elasticity/elastic.py b/pymatgen/analysis/elasticity/elastic.py index <HASH>..<HASH> 100644 --- a/pymatgen/analysis/elasticity/elastic.py +++ b/pymatgen/analysis/elasticity/elastic.py @@ -702,12 +702,10 @@ class ElasticTensorExpansion(TensorCollection): soec = ElasticTensor(self[0]) v0 = (structure.volume * 1e-30 / structure.num_sites) if mode == "debye": - vl, vt = soec.long_v(structure), soec.trans_v(structure) - vm = 3**(1./3.) * (1 / vl**3 + 2 / vt**3)**(-1./3.) - td = 1.05457e-34 / 1.38065e-23 * vm * (6 * np.pi**2 / v0) ** (1./3.) + td = soec.debye_temperature(structure) t_ratio = temperature / td integrand = lambda x: (x**4 * np.exp(x)) / (np.exp(x) - 1)**2 - cv = 3 * 8.314 * t_ratio**3 * quad(integrand, 0, t_ratio**-1)[0] + cv = 9 * 8.314 * t_ratio**3 * quad(integrand, 0, t_ratio**-1)[0] elif mode == "dulong-petit": cv = 3 * 8.314 else:
shorten debye temp and fix factor
materialsproject_pymatgen
train
py
81283fe539f7d973c91d513019b43591d65d9a58
diff --git a/should.js b/should.js index <HASH>..<HASH> 100644 --- a/should.js +++ b/should.js @@ -1 +1 @@ -module.exports = require('./').should(); +global.should = module.exports = require('./').should();
Add script that register should into the global space
chaijs_chai
train
js
4b3281ed7a3b8616822544b0b2d27c34d8684a0b
diff --git a/src/ColumnSortable/Sortable.php b/src/ColumnSortable/Sortable.php index <HASH>..<HASH> 100755 --- a/src/ColumnSortable/Sortable.php +++ b/src/ColumnSortable/Sortable.php @@ -76,7 +76,7 @@ trait Sortable try { $relation = $query->getRelation($relationName); } catch (BadMethodCallException $e) { - throw new RelationDoesNotExistsException($relationName); + throw new RelationDoesNotExistsException($relationName, 0, $e); } $query = $this->queryJoinBuilder($query, $relation);
RelationDoesNotExistsException sends also previous exception.
Kyslik_column-sortable
train
php
31e1e8b35d9ba389631970b1c9d9ab599431dee0
diff --git a/spyder/plugins/projects/plugin.py b/spyder/plugins/projects/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/projects/plugin.py +++ b/spyder/plugins/projects/plugin.py @@ -299,7 +299,6 @@ class Projects(SpyderPluginWidget): return else: path = encoding.to_unicode_from_fs(path) - self.notify_project_open(path) self.add_to_recent(path) # A project was not open before @@ -325,6 +324,7 @@ class Projects(SpyderPluginWidget): project = EmptyProject(path) self.current_active_project = project self.latest_project = project + self.notify_project_open(path) self.set_option('current_project_path', self.get_active_project_path()) self.setup_menu_actions()
Projects: Move notify_project_open to the same place it's put in master
spyder-ide_spyder
train
py
2a856df4885204362eef76349c1cdb4b26a8853e
diff --git a/redisson/src/main/java/org/redisson/client/RedisClient.java b/redisson/src/main/java/org/redisson/client/RedisClient.java index <HASH>..<HASH> 100644 --- a/redisson/src/main/java/org/redisson/client/RedisClient.java +++ b/redisson/src/main/java/org/redisson/client/RedisClient.java @@ -23,7 +23,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -import org.redisson.RedissonShutdownException; import org.redisson.api.RFuture; import org.redisson.client.handler.RedisChannelInitializer; import org.redisson.client.handler.RedisChannelInitializer.Type;
Fixed - RejectedExecutionException thrown by RedisClient.connectAsync method during shutdown process.
redisson_redisson
train
java
5d3e90426e40935b210d6dad55cc367d711dc89f
diff --git a/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java b/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java index <HASH>..<HASH> 100644 --- a/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java +++ b/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java @@ -131,7 +131,8 @@ public class InstanceImpl<T> extends AbstractFacade<T, Instance<T>> implements I } private Set<Bean<?>> getBeans() { - return getBeanManager().getBeans(getType(), getQualifiers()); + Set<Bean<?>> beans = getBeanManager().getBeans(getType(), getQualifiers()); + return getBeanManager().getBeanResolver().resolve(beans); } public Iterator<T> iterator() {
Fix the way InstanceImpl resolves beans
weld_core
train
java
7366a61097019c856db545402e18ec4c129977d9
diff --git a/src/Model/CustomPostType/ModelEntity.php b/src/Model/CustomPostType/ModelEntity.php index <HASH>..<HASH> 100644 --- a/src/Model/CustomPostType/ModelEntity.php +++ b/src/Model/CustomPostType/ModelEntity.php @@ -182,8 +182,11 @@ class ModelEntity public function __debugInfo() { $objectVars = array(); - foreach (get_object_vars($this) as $key => $value) { - $objectVars[$key] = Debugger::export($value); + + if (!is_null($this)) { + foreach (get_object_vars($this) as $key => $value) { + $objectVars[$key] = Debugger::export($value); + } } return array_merge($objectVars, $this->toArray()); @@ -197,6 +200,10 @@ class ModelEntity */ public function bindToObject($obj) { + if (is_array($obj)) { + $obj = (object)$obj; + } + $this->associatedObject = $obj; }
enforce objects as binding parameter for modelentities
strata-mvc_strata
train
php
4f8843e511b0abbd3fc8f76e7088141ae8e91779
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,6 @@ def main(): classifiers=[ 'Development Status :: 4 - Beta', 'Framework :: IPython', - 'Framework :: Jupyter', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', 'Operating System :: OS Independent',
BLD: Remove Jupyter trove classifier. No such classifier exists.
quantopian_pgcontents
train
py
35b74c9f10a47e4464b95d33d372e373ad275824
diff --git a/lib/constants.js b/lib/constants.js index <HASH>..<HASH> 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -34,7 +34,8 @@ module.exports = { fileLoggerParameters: undefined, consoleLoggerParameters: undefined, loggerParameters: undefined, - nodeReuse: true + nodeReuse: true, + customArgs: [] } };
Add customArgs to DEFAULTS This fixes the issue introduced in <I>da5d<I>d7d8f<I>fa<I>a1f<I>b<I>a<I>ab2d3, where `customArgs` was rejected as an invalid option
hoffi_gulp-msbuild
train
js
98a7402ba3c75f329ceb356f4bf7afc50209d238
diff --git a/lib/test.js b/lib/test.js index <HASH>..<HASH> 100644 --- a/lib/test.js +++ b/lib/test.js @@ -27,6 +27,11 @@ function Test(title, fn) { // store the time point before test execution // to calculate the total time spent in test this._timeStart = null; + + // workaround for Babel giving anonymous functions a name + if (this.title === 'callee$0$0') { + this.title = '[anonymous]'; + } } module.exports = Test;
work around Babel giving anonymous functions a name
andywer_ava-ts
train
js
b480980d34153beaf68ee408889932bf531e4733
diff --git a/lib/scorpio/resource_base.rb b/lib/scorpio/resource_base.rb index <HASH>..<HASH> 100644 --- a/lib/scorpio/resource_base.rb +++ b/lib/scorpio/resource_base.rb @@ -110,6 +110,13 @@ module Scorpio rescue NameError end define_singleton_method(:openapi_document) { openapi_document } + define_singleton_method(:openapi_document=) do + if self == openapi_document_class + raise(ArgumentError, "openapi_document may only be set once on #{self.inspect}") + else + raise(ArgumentError, "openapi_document may not be overridden on subclass #{self.inspect} after it was set on #{openapi_document_class.inspect}") + end + end update_dynamic_methods openapi_document.paths.each do |path, path_item|
disallow overriding of openapi_document after it has been set (on the openapi document class or any subclass)
notEthan_jsi
train
rb
0752924cdd1eb832017349d0cd909c8eb0a8d81f
diff --git a/app/templates/src/main/java/package/config/_CacheConfiguration.java b/app/templates/src/main/java/package/config/_CacheConfiguration.java index <HASH>..<HASH> 100644 --- a/app/templates/src/main/java/package/config/_CacheConfiguration.java +++ b/app/templates/src/main/java/package/config/_CacheConfiguration.java @@ -70,9 +70,11 @@ public class CacheConfiguration { for (EntityType<?> entity : entities) { String name = entity.getJavaType().getName(); net.sf.ehcache.Cache cache = cacheManager.getCache(name); - cache.getCacheConfiguration().setTimeToLiveSeconds(env.getProperty("cache.timeToLiveSeconds", Integer.class, 3600)); - net.sf.ehcache.Ehcache decoratedCache = InstrumentedEhcache.instrument(metricRegistry, cache); - cacheManager.replaceCacheWithDecoratedCache(cache, decoratedCache); + if (cache != null) { + cache.getCacheConfiguration().setTimeToLiveSeconds(env.getProperty("cache.timeToLiveSeconds", Integer.class, 3600)); + net.sf.ehcache.Ehcache decoratedCache = InstrumentedEhcache.instrument(metricRegistry, cache); + cacheManager.replaceCacheWithDecoratedCache(cache, decoratedCache); + } } EhCacheCacheManager ehCacheManager = new EhCacheCacheManager(); ehCacheManager.setCacheManager(cacheManager);
If the cache was not configured, do not try to monitor it
jhipster_generator-jhipster
train
java
d97cc916a5676ccb24fdecd8b78b724433e08b55
diff --git a/src/pybel/cli.py b/src/pybel/cli.py index <HASH>..<HASH> 100644 --- a/src/pybel/cli.py +++ b/src/pybel/cli.py @@ -24,6 +24,7 @@ import click from .canonicalize import to_bel from .constants import PYBEL_LOG_DIR, DEFAULT_CACHE_LOCATION from .io import from_lines, from_url, to_json, to_csv, to_graphml, to_neo4j, to_cx, to_pickle +from .manager import models from .manager.cache import CacheManager from .manager.database_io import to_database, from_database @@ -222,5 +223,13 @@ def drop(gid, connection): manager.drop_graph(gid) +@graph.command(help='Drops all graphs') +@click.option('-c', '--connection', help='Cache location. Defaults to {}'.format(DEFAULT_CACHE_LOCATION)) +def dropall(connection): + manager = CacheManager(connection=connection) + manager.session.query(models.Network).delete() + manager.session.commit() + + if __name__ == '__main__': main()
Added drop all graphs cli command [skip ci]
pybel_pybel
train
py
f104f234d9f44349d81fcb16c024c7b85831612c
diff --git a/nvr/nvr.py b/nvr/nvr.py index <HASH>..<HASH> 100644 --- a/nvr/nvr.py +++ b/nvr/nvr.py @@ -438,9 +438,9 @@ def main(argv=sys.argv, env=os.environ): sys.exit(1) if options.q: - nvr.server.command("silent execute 'lcd' fnameescape('{}')". - format(os.environ['PWD'].replace("'", "''"))) - nvr.server.command('call setqflist([])') + path = nvr.server.funcs.fnameescape(os.environ['PWD']) + nvr.server.command('lcd {}'.format(path)) + nvr.server.funcs.setqflist('[]') with open(options.q, 'r') as f: for line in f.readlines(): nvr.server.command("caddexpr '{}'".
Improve quoting for -q
mhinz_neovim-remote
train
py
8dd0b900fc2d3f30b5939e50e7f9685fd1305229
diff --git a/src/Request.js b/src/Request.js index <HASH>..<HASH> 100644 --- a/src/Request.js +++ b/src/Request.js @@ -92,7 +92,7 @@ function xmlHttpPost (url, params, callback, context) { httpRequest.timeout = context.options.timeout; } } - httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); httpRequest.send(serialize(params)); return httpRequest; @@ -123,7 +123,7 @@ export function request (url, params, callback, context) { httpRequest.open('GET', url + '?' + paramString); } else if (requestLength > 2000 && Support.cors) { httpRequest.open('POST', url); - httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); } if (typeof context !== 'undefined' && context !== null) {
make UTF8 explicit in request headers
Esri_esri-leaflet
train
js
d1162492e5619cfeffb96af186f33fb4959d04ad
diff --git a/fedmsg_meta_fedora_infrastructure/buildsys.py b/fedmsg_meta_fedora_infrastructure/buildsys.py index <HASH>..<HASH> 100644 --- a/fedmsg_meta_fedora_infrastructure/buildsys.py +++ b/fedmsg_meta_fedora_infrastructure/buildsys.py @@ -21,7 +21,7 @@ from fedmsg.meta.base import BaseProcessor class KojiProcessor(BaseProcessor): - __name__ = "koji" + __name__ = "buildsys" __description__ = "the Fedora build system" __link__ = "https://koji.fedoraproject.org/koji" __docs__ = "https://fedoraproject.org/wiki/Using_the_Koji_build_system"
Set KojiProcessor.__name__ to 'buildsys' instead of 'koji'. The BaseProcessor.__prefix__ regex assumes that the __name__ of the text processor is used as the prefix in the message topic.
fedora-infra_fedmsg_meta_fedora_infrastructure
train
py
6aa5cc383d32ec42dcac40f6b791d6fe10569d59
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -79,6 +79,12 @@ module.exports = function(grunt) { newlineMaximum: 2 } }, + newlines_amount_invalid: { + src: ['tests/files/newline_toomuch.txt'], + options: { + newlineMaximum: 0 + } + }, trailingspaces: { src: ['tests/files/trailingspaces.txt'], options: { diff --git a/tests/test_newlines.js b/tests/test_newlines.js index <HASH>..<HASH> 100644 --- a/tests/test_newlines.js +++ b/tests/test_newlines.js @@ -60,5 +60,16 @@ exports.tests = { ); test.done(); }); + }, + + newlines_amount_invalid: function(test) { + test.expect(1); + exec('grunt lintspaces:newlines_amount_invalid', execOptions, function(error, stdout) { + var message = MESSAGES.NEWLINE_MAXIMUM_INVALIDVALUE.replace('{a}', '0'); + test.equal(stdout.indexOf(message) > -1, true, + 'A failure log message should appear when maximum newlines amount is less then 1.' + ); + test.done(); + }); } };
Add test for invalid setting of maximum newline amount
schorfES_grunt-lintspaces
train
js,js
63c32ee091f624cb3fc3a1ec63d5c78d17b802e0
diff --git a/lib/database.js b/lib/database.js index <HASH>..<HASH> 100644 --- a/lib/database.js +++ b/lib/database.js @@ -123,15 +123,18 @@ Database.reopen(/** @lends Database# */ { * refer to classes (i.e. when defining relationships). * * @param {String} name The name for the class + * @param {Object} [properties] Properties to add to the class * @return {Class} The model class */ - model: function(name) { + model: function(name, properties) { var className = _.str.classify(name); var known = this._modelClasses; - if (!known[className]) { - known[className] = this.Model.extend({}, { __name__: className }); + var model = known[className]; + if (!model) { + model = known[className] = + this.Model.extend({}, { __name__: className }); } - return known[className]; + return model.reopen(properties); }, // convenience methods (documentation at original definitions)
Enhanced model method to allow adding instance properties.
wbyoung_azul
train
js
d710c2207fa05f7a1fb5d57f9d51e805d0a90016
diff --git a/pkg/cmd/util/clientcmd/client.go b/pkg/cmd/util/clientcmd/client.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/util/clientcmd/client.go +++ b/pkg/cmd/util/clientcmd/client.go @@ -62,6 +62,9 @@ func (b *OpenshiftCLIClientBuilder) OpenshiftInternalAuthorizationClient() (auth if err != nil { return nil, err } + // used for reconcile commands touching dozens of objects + clientConfig.QPS = 50 + clientConfig.Burst = 100 client, err := authorizationclientinternal.NewForConfig(clientConfig) if err != nil { return nil, err
interesting: bump reconcile qps
openshift_origin
train
go
0f02d41819d04101293480e5fa41158d02d9c6d4
diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-pe/version.rb +++ b/lib/beaker-pe/version.rb @@ -3,7 +3,7 @@ module Beaker module PE module Version - STRING = '1.29.0' + STRING = '1.30.0' end end
(GEM) update beaker-pe version to <I>
puppetlabs_beaker-pe
train
rb
f5792a2e8f2a2044cc10bbf05f130585c0983ff0
diff --git a/src/main/java/io/mola/galimatias/IPv4Address.java b/src/main/java/io/mola/galimatias/IPv4Address.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/mola/galimatias/IPv4Address.java +++ b/src/main/java/io/mola/galimatias/IPv4Address.java @@ -32,13 +32,13 @@ public class IPv4Address extends Host { private final int address; - private IPv4Address(final byte[] addr) { - int address = 0; - address = addr[3] & 0xFF; - address |= ((addr[2] << 8) & 0xFF00); - address |= ((addr[1] << 16) & 0xFF0000); - address |= ((addr[0] << 24) & 0xFF000000); - this.address = address; + private IPv4Address(final byte[] addrBytes) { + int addr = 0; + addr = addrBytes[3] & 0xFF; + addr |= ((addrBytes[2] << 8) & 0xFF00); + addr |= ((addrBytes[1] << 16) & 0xFF0000); + addr |= ((addrBytes[0] << 24) & 0xFF000000); + this.address = addr; } public static IPv4Address parseIPv4Address(final String input) throws GalimatiasParseException{
Eliminate shadowed variable warning
smola_galimatias
train
java
da1bb94579c1898d1bbb2a2e43cf1cea8ebebb73
diff --git a/src/Cache/FileStore.php b/src/Cache/FileStore.php index <HASH>..<HASH> 100644 --- a/src/Cache/FileStore.php +++ b/src/Cache/FileStore.php @@ -167,7 +167,13 @@ class FileStore extends AbstractCache public function sharedGet(string $path): string { return $this->lock($path, LOCK_SH, function ($handle) use ($path) { - return fread($handle, filesize($path) ?: 1); + $contents = fread($handle, filesize($path) ?: 1); + + if (false === $contents) { + return ''; + } + + return $contents; }); } @@ -198,7 +204,7 @@ class FileStore extends AbstractCache } return $this->lock($cacheFile, LOCK_EX, function ($handle) use ($cacheKey, $cacheFile, $value) { - $contents = fread($handle, filesize($cacheFile) ?: 1) ?? []; + $contents = fread($handle, filesize($cacheFile) ?: 1) ?? ''; $contents = json_decode($contents, true) ?? []; if ( ! empty($contents[$cacheKey]) && \is_array($value)) {
fix: Typecast issues (#<I>)
ankitpokhrel_tus-php
train
php
c7b5fccb9e54dfb91607be3f8f3bd09491269ab8
diff --git a/tests/unit/utils/cloud_test.py b/tests/unit/utils/cloud_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/utils/cloud_test.py +++ b/tests/unit/utils/cloud_test.py @@ -20,7 +20,7 @@ ensure_in_syspath('../../') # Import salt libs from salt.utils import cloud -from integration import TMP +from integration import TMP, CODE_DIR GPG_KEYDIR = os.path.join(TMP, 'gpg-keydir') @@ -63,6 +63,8 @@ try: except ImportError: HAS_KEYRING = False +os.chdir(CODE_DIR) + class CloudUtilsTestCase(TestCase):
Change cwd back to Salt's code dir
saltstack_salt
train
py
7061080dc4c7cab5e8b7873ce840176ea1778002
diff --git a/src/scs_core/__init__.py b/src/scs_core/__init__.py index <HASH>..<HASH> 100644 --- a/src/scs_core/__init__.py +++ b/src/scs_core/__init__.py @@ -6,4 +6,4 @@ Created on 3 May 2021 https://packaging.python.org/guides/single-sourcing-package-version/ """ -__version__ = '1.0.15' +__version__ = '1.0.16'
Added SCD<I>Baseline to Configuration
south-coast-science_scs_core
train
py
1d0c7ea6c2b84c5dffd1023b2132fc7a0d45a387
diff --git a/libraries/mako/I18n.php b/libraries/mako/I18n.php index <HASH>..<HASH> 100644 --- a/libraries/mako/I18n.php +++ b/libraries/mako/I18n.php @@ -68,7 +68,7 @@ namespace mako if(preg_match('/^[a-z]{2}[_][A-Z]{2}$/', $language) === 0) { - throw new RuntimeException(__CLASS__ . ": Invalid i18n language pack name."); + throw new RuntimeException(vsprintf("%s: Invalid i18n language name.", array(__CLASS__))); } if(is_dir(MAKO_APPLICATION.'/i18n/' . $language)) @@ -77,7 +77,7 @@ namespace mako } else { - throw new RuntimeException(__CLASS__ . ": The '{$language}' i18n language pack does not exist."); + throw new RuntimeException(vsprintf("%s: The '%s' language pack does not exist.", array(__CLASS__, $language))); } static::$translationTable = array(); // Reset the translation table
Updated i<I>n exceptions
mako-framework_framework
train
php
765a96c22fa92842b7566b58842420b8d61ee1e9
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,9 +57,9 @@ author = u'Ahmet DAL' # built documents. # # The short X.Y version. -version = '0.6.0' +version = '0.6.1' # The full version, including alpha/beta/rc tags. -release = '0.6.0' +release = '0.6.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ except IOError as err: setup( name='django-river', - version='0.6.0', + version='0.6.1', author='Ahmet DAL', author_email='ceahmetdal@gmail.com', packages=find_packages(),
version is upgraded to <I> :arrow_up:
javrasya_django-river
train
py,py
1893ae305231a6e2b76dfc490cb41b4a8636d433
diff --git a/lago/vm.py b/lago/vm.py index <HASH>..<HASH> 100644 --- a/lago/vm.py +++ b/lago/vm.py @@ -144,9 +144,9 @@ class LocalLibvirtVMProvider(vm.VMProviderPlugin): ) try: - with utils.ExceptionTimer(timeout=15): + with utils.ExceptionTimer(timeout=60 * 5): while self.defined(): - time.sleep(0.1) + time.sleep(1) except utils.TimerException: raise utils.LagoUserException( 'Failed to shutdown vm: {}'.format(self.vm.name())
Increase shutdown timeout The previous timeout of <I> secondes wasn't enough for shutting down loaded vms (such as ovirt-engine).
lago-project_lago
train
py
966316c9434c6b06ea814949bf02010148317f62
diff --git a/src/Router.php b/src/Router.php index <HASH>..<HASH> 100644 --- a/src/Router.php +++ b/src/Router.php @@ -115,31 +115,5 @@ class Router } return $this->states[$name]; } - - /** - * Temporarily redirect to the URL associated with state $name. - * - * @param string $name The state name to resolve. - * @param array $arguments Additional arguments needed to build the URL. - * @return void - */ - public function redirect($name, array $arguments = []) - { - header("Location: ".$this->absolute($name, $arguments), true, 302); - die(); - } - - /** - * Permanently redirect to the URL associated with state $name. - * - * @param string $name The state name to resolve. - * @param array $arguments Additional arguments needed to build the URL. - * @return void - */ - public function move($name, array $arguments = []) - { - header("Location: ".$this->absolute($name, $arguments), true, 301); - die(); - } }
cleanup, these were moved to Url class
monolyth-php_reroute
train
php
62b1f1a62d3f534a7841794d9fd434964143f76a
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -328,7 +328,7 @@ module ActionDispatch # +call+ or a string representing a controller's action. # # match 'path', :to => 'controller#action' - # match 'path', :to => lambda { [200, {}, "Success!"] } + # match 'path', :to => lambda { |env| [200, {}, "Success!"] } # match 'path', :to => RackApp # # [:on]
Fix typo in match :to docs
rails_rails
train
rb
4ab55e305b7381cf2400ea987684e79f69f262b7
diff --git a/src/main/java/org/thymeleaf/templateresolver/ITemplateResolver.java b/src/main/java/org/thymeleaf/templateresolver/ITemplateResolver.java index <HASH>..<HASH> 100755 --- a/src/main/java/org/thymeleaf/templateresolver/ITemplateResolver.java +++ b/src/main/java/org/thymeleaf/templateresolver/ITemplateResolver.java @@ -113,6 +113,13 @@ public interface ITemplateResolver { * resource existance by default in order to avoid the possible performance impact of a double access * to the resource. * </p> + * <p> + * Note that the <em>markup selectors</em> that might be used for a executing or inserting a template + * are not specified to the template resolver. The reason is markup selectors are applied by the parser, + * not the template resolvers, and allowing the resolver to take any decisions based on markup selectors + * (like e.g. omitting some output from the resource) could harm the correctness of the selection operation + * performed by the parser. + * </p> * * @param configuration the engine configuration. * @param template the template to be resolved (usually its name)
Improved JavaDoc for ITemplateResolver
thymeleaf_thymeleaf
train
java
e662071f75408ef199d7f08a4897f26d15b52f89
diff --git a/htmlparsing.py b/htmlparsing.py index <HASH>..<HASH> 100644 --- a/htmlparsing.py +++ b/htmlparsing.py @@ -32,7 +32,7 @@ GITHUB_FILE_TAG = 'blob-wrapper data type-text' # --------------------------- def get_github_text(raw_html): - html = BeautifulSoup(raw_html) + html = BeautifulSoup(raw_html, "html.parser") gist_description = html.body.find('div', attrs={'class': GITHUB_CONTENT_TAG}) @@ -63,7 +63,7 @@ def get_search_text(service, raw_html): if service == 'facebook': raw_html = raw_html.replace('<!--', '').replace('-->', '') - html_soup = BeautifulSoup(raw_html) + html_soup = BeautifulSoup(raw_html, "html.parser") if service in SITES: query_data = SITES[service]['html_query']
get rid of Beautifulsoup warning
blockstack_blockstack-proofs-py
train
py
b7fc06e2b42c8ac6512e5c5dbbfbe9e7d61fdbcd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,8 +15,8 @@ with open('HISTORY.rst') as history_file: requirements = [ 'requests >= 2.0.0, < 3.0.0', 'tld ~= 0.9', - 'dukpy >= 0.2.0, < 1.0.0', 'pyobjc-framework-SystemConfiguration >= 3.2.1; sys.platform=="darwin"', + 'dukpy ~=0.2.2', ] classifiers = [
Require at least dukpy <I>, for memory leak fix.
carsonyl_pypac
train
py
fd5c759e0fe0ca6817ed16dc422a6b2b109a0240
diff --git a/test/test_mhcflurry.py b/test/test_mhcflurry.py index <HASH>..<HASH> 100644 --- a/test/test_mhcflurry.py +++ b/test/test_mhcflurry.py @@ -1,4 +1,6 @@ -from nose.tools import eq_ +import sys + +from nose.tools import eq_, nottest from numpy import testing from mhcflurry import Class1AffinityPredictor @@ -11,6 +13,15 @@ protein_sequence_dict = { "TP53-001": "ASILLLVFYW" } + +def skip_if_py2(function): + if sys.version_info[0] < 3: + print("MHCflurry requires python 3. Skipping test.") + return nottest(function) + return function + + +@skip_if_py2 def test_mhcflurry(): predictor = MHCflurry(alleles=[DEFAULT_ALLELE]) binding_predictions = predictor.predict_subsequences(
Don't run mhcflurry unit tests under python 2, since mhcflurry now requires python 3.
openvax_mhctools
train
py
51db79069d86fd58c108bc223a840f55875177e0
diff --git a/lib/neo4j-core/property/property.rb b/lib/neo4j-core/property/property.rb index <HASH>..<HASH> 100644 --- a/lib/neo4j-core/property/property.rb +++ b/lib/neo4j-core/property/property.rb @@ -88,7 +88,7 @@ module Neo4j # @param [String, Symbol] key of the property to set # @param [String,Fixnum,Float,true,false, Array] value to set def []=(key, value) - raise "Not valid Neo4j Property value #{value.class}, valid: #{VALID_PROPERTY_VALUE_CLASSES.join(', ')}" unless valid_property?(value) + raise "Not valid Neo4j Property value #{value.class}, valid: #{VALID_PROPERTY_VALUE_CLASSES.to_a.join(', ')}" unless valid_property?(value) k = key.to_s if value.nil? @@ -115,4 +115,4 @@ module Neo4j end end -end \ No newline at end of file +end
Fixes "NoMethodError: undefined method `join' for #<Set..." error Currently throws a Fixes "NoMethodError: undefined method `join' for #<Set...".
neo4jrb_neo4j-core
train
rb
cd4d2857c0427dafcb17767e04588630d6ce0e67
diff --git a/hypertools/tools/load.py b/hypertools/tools/load.py index <HASH>..<HASH> 100644 --- a/hypertools/tools/load.py +++ b/hypertools/tools/load.py @@ -27,7 +27,15 @@ datadict = { } -def load(dataset, reduce=None, ndims=None, align=None, normalize=None): +def load( + dataset, + reduce=None, + ndims=None, + align=None, + normalize=None, + *, + legacy=False +): """ Load a .geo file or example data @@ -88,6 +96,9 @@ def load(dataset, reduce=None, ndims=None, align=None, normalize=None): key is a string that specifies the model and the params key is a dictionary of parameter values (default : 'hyper'). + legacy : bool + Pass legacy=True to load DataGeometry objects created with hypertools<0.8.0 + Returns ---------- data : Numpy Array
add legacy keyword-only arg to signature and docstring
ContextLab_hypertools
train
py
8fa195c17f74430ccf8b32be51ccde9f6baf6d37
diff --git a/dingo/core/network/__init__.py b/dingo/core/network/__init__.py index <HASH>..<HASH> 100644 --- a/dingo/core/network/__init__.py +++ b/dingo/core/network/__init__.py @@ -153,6 +153,7 @@ class StationDingo(): self._transformers.append(transformer) # TODO: what if it exists? -> error message + class BusDingo(Bus): """ Create new pypower Bus class as child from oemof Bus used to define busses and generators data
add some empty lines to comply with PEP8
openego_ding0
train
py
e0f559c2bdbfceb49486b9ef4970a0fe3ead0a8d
diff --git a/src/EventDispatcher.php b/src/EventDispatcher.php index <HASH>..<HASH> 100644 --- a/src/EventDispatcher.php +++ b/src/EventDispatcher.php @@ -39,7 +39,7 @@ class EventDispatcher * * @return CreateTokenEvent */ - public function createToken(string $purpose, string $user, array $payload): CreateTokenEvent + public function createToken(string $purpose, $user, array $payload): CreateTokenEvent { $this->eventDispatcher->dispatch( $event = new CreateTokenEvent($purpose, $user, $payload)
Fixed wrong property type and name in EventDispatcher
yokai-php_security-token-bundle
train
php
3583ef6a463fbd0fb5f6215c02a4f689dc72b1fa
diff --git a/lib/gyazz/wiki.rb b/lib/gyazz/wiki.rb index <HASH>..<HASH> 100644 --- a/lib/gyazz/wiki.rb +++ b/lib/gyazz/wiki.rb @@ -36,6 +36,7 @@ module Gyazz end def post(path, opts) + opts[:basic_auth] = @basic_auth if @basic_auth res = HTTParty.post "#{@host}#{path}", opts case res.code when 200 diff --git a/test/test_auth.rb b/test/test_auth.rb index <HASH>..<HASH> 100644 --- a/test/test_auth.rb +++ b/test/test_auth.rb @@ -26,4 +26,23 @@ class TestWikiAuth < MiniTest::Test end end + def test_auth_page_get_fail + page = @wiki.page('aaa') + err = nil + begin + page.text + rescue => e + err = e + end + assert_equal err.class, Gyazz::Error + end + + def test_auth_page_get_set + @wiki.auth = {:username => 'test_username', :password => 'test_password'} + page = @wiki.page('aaa') + body = ["foo", "bar", Time.now.to_s].join("\n") + page.text = body + assert_equal page.text.strip, body + end + end
add tests for Gyazz::Page#text with Auth #2 bugfix Auth of Gyazz::Wiki#post #2
masui_gyazz-ruby
train
rb,rb
e05cc61b745c4263b4ff8145c897a424a7e6a1ad
diff --git a/quasar/src/components/field/QField.js b/quasar/src/components/field/QField.js index <HASH>..<HASH> 100644 --- a/quasar/src/components/field/QField.js +++ b/quasar/src/components/field/QField.js @@ -47,7 +47,7 @@ export default Vue.extend({ }, floatingLabel () { - return this.stackLabel || this.focused || (this.innerValue && this.innerValue.length > 0) + return this.stackLabel || this.focused || (this.innerValue !== void 0 && ('' + this.innerValue).length > 0) }, hasBottom () {
fix(quasar): [v1] QInput with type=number label will not float with default value #<I>
quasarframework_quasar
train
js
25a17ce1dddd80c2448c74be68d27feb850c7136
diff --git a/jsx-asset.go b/jsx-asset.go index <HASH>..<HASH> 100644 --- a/jsx-asset.go +++ b/jsx-asset.go @@ -74,7 +74,7 @@ func (a *JSXAsset) Compile() (io.Reader, error) { } var buf bytes.Buffer - cmd := exec.Command("node_modules/react-tools/bin/jsx", "--es6module") + cmd := exec.Command("node_modules/babel-cli/bin/babel.js", "--plugins", "transform-react-jsx") cmd.Stdin = data cmd.Stdout = &buf cmd.Stderr = os.Stderr diff --git a/matrix.go b/matrix.go index <HASH>..<HASH> 100644 --- a/matrix.go +++ b/matrix.go @@ -204,7 +204,8 @@ func (m *Matrix) installDeps() error { "recast@0.10.30", "es6-promise@3.0.2", "node-sass@3.8.0", - "react-tools@0.13.3", + "babel-cli@6.11.4", + "babel-plugin-transform-react-jsx@6.8", "eslint@1.6.0", "eslint-plugin-react@3.5.1", })
Use babel as JSX transformer react-tools is no longer supported
jvatic_asset-matrix-go
train
go,go
810e2f6ec136bf8fa0e23db048797effae0f3f2d
diff --git a/src/BackblazeAdapter.php b/src/BackblazeAdapter.php index <HASH>..<HASH> 100755 --- a/src/BackblazeAdapter.php +++ b/src/BackblazeAdapter.php @@ -130,7 +130,8 @@ class BackblazeAdapter extends AbstractAdapter { { return $this->getClient()->upload([ 'BucketName' => $this->bucketName, - 'FileName' => $path + 'FileName' => $path, + 'Body' => '' ]); }
Fixed issue where trying to create a dir throws error Fixed issue where trying to create a dir throws error, this is because the key 'Body' is always expected by the upload method
gliterd_flysystem-backblaze
train
php
1b2093b01b91e6020ac0084c2f6030bf194daf5c
diff --git a/cmd/juju/action/show.go b/cmd/juju/action/show.go index <HASH>..<HASH> 100644 --- a/cmd/juju/action/show.go +++ b/cmd/juju/action/show.go @@ -102,21 +102,11 @@ func (c *showCommand) Run(ctx *cmd.Context) error { if !ok { continue } - - if infoMap["default"] != nil { - args[argName] = actionArg{ - Type: infoMap["type"], - Description: infoMap["description"], - Default: infoMap["default"], - } - } else { - // Don't include the default value if it's unspecified - args[argName] = actionArg{ - Type: infoMap["type"], - Description: infoMap["description"], - } + args[argName] = actionArg{ + Type: infoMap["type"], + Description: infoMap["description"], + Default: infoMap["default"], } - } }
Removed some redundant code to tidy up slightly
juju_juju
train
go
0d6af434afe6bd31d6f7bd7e519ef3d744718268
diff --git a/www/tests/issues.py b/www/tests/issues.py index <HASH>..<HASH> 100644 --- a/www/tests/issues.py +++ b/www/tests/issues.py @@ -195,4 +195,14 @@ assert time.asctime(time.gmtime(0)) == 'Thu Jan 1 00:00:00 1970' tup = tuple(time.gmtime(0).args) assert time.asctime(tup) == 'Thu Jan 1 00:00:00 1970' +# issue 154 +class MyMetaClass(type): + def __str__(cls): + return "Hello" + +class MyClass(metaclass=MyMetaClass): + pass + +assert str(MyClass) == "Hello" + print('passed all tests')
Add test for issue #<I>
brython-dev_brython
train
py
b94118ba7d6449af493e6e9fb475c6c1f65b6604
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,7 @@ require 'rubygems' require 'rspec' require 'active_support' require 'active_record' +require 'factory_girl' $:.unshift(File.dirname(__FILE__) + '/../lib') require 'pickle'
make sure factory_girl is loaded for specs Some specs behave depending on the version of FactoryGirl. On Travis, specs see < <I>, but the implementation sees <I> (presence of ::FactoryGirl)
ianwhite_pickle
train
rb
a6bceba061b587a69fac038b09b2ebcf53f984d2
diff --git a/lib/appdmg.js b/lib/appdmg.js index <HASH>..<HASH> 100644 --- a/lib/appdmg.js +++ b/lib/appdmg.js @@ -427,7 +427,7 @@ module.exports = exports = function (options) { var codeSignIdentifier = codeSignOptions['identifier'] util.codesign(codeSignIdentity, codeSignIdentifier, global.target, next) } else { - return next.step() + return next.skip() } })
🐛 Call correct function to skip step
LinusU_node-appdmg
train
js
dee8ceb58df8b09c0a954db2ce6aaae31ec8ee22
diff --git a/test/service.js b/test/service.js index <HASH>..<HASH> 100644 --- a/test/service.js +++ b/test/service.js @@ -107,6 +107,19 @@ describe('Service', function () { should.not.exist(itemCache) }) + it('`purgeCaches` method should remove all items from all caches', function () { + var caches = cacheIds.map(httpEtag.getCache) + caches.forEach(function (cache) { + cache.setItem('hello', 'world') + }) + + httpEtag.purgeCaches() + + caches.forEach(function (cache) { + should.not.exist(cache.getItem('hello')) + }) + }) + /** * CACHE TESTS */
Create `purgeCaches` service method test
shaungrady_angular-http-etag
train
js
5c746f0896dd32e03a8166d69f3bf3d45124a339
diff --git a/azurerm/internal/services/storage/resource_arm_storage_table.go b/azurerm/internal/services/storage/resource_arm_storage_table.go index <HASH>..<HASH> 100644 --- a/azurerm/internal/services/storage/resource_arm_storage_table.go +++ b/azurerm/internal/services/storage/resource_arm_storage_table.go @@ -176,7 +176,7 @@ func resourceArmStorageTableRead(d *schema.ResourceData, meta interface{}) error if err != nil { return fmt.Errorf("retrieving Table %q (Storage Account %q / Resource Group %q): %s", id.Name, id.AccountName, account.ResourceGroup, err) } - if exists == nil && !*exists { + if exists == nil || !*exists { log.Printf("[DEBUG] Storage Account %q not found, removing table %q from state", id.AccountName, id.Name) d.SetId("") return nil
r/storage_table: fixing a crash
terraform-providers_terraform-provider-azurerm
train
go
693bd2f215ba497da197b1ceb248535257c33dd8
diff --git a/code/services/DataChangeTrackService.php b/code/services/DataChangeTrackService.php index <HASH>..<HASH> 100644 --- a/code/services/DataChangeTrackService.php +++ b/code/services/DataChangeTrackService.php @@ -17,4 +17,8 @@ class DataChangeTrackService { $this->dcr_cache["{$object->ID}-{$object->Classname}"]->track($object, $type); } + + public function __toString() { + return ''; + } }
FIX Ensure that if the dataChangeTracker gets serialized, it can still be string converted later
symbiote_silverstripe-datachange-tracker
train
php
4dcbd28d0f2f0e23f8aac9716bde0760553fa6ff
diff --git a/lib/jazzy/config.rb b/lib/jazzy/config.rb index <HASH>..<HASH> 100644 --- a/lib/jazzy/config.rb +++ b/lib/jazzy/config.rb @@ -184,7 +184,7 @@ module Jazzy opt.on('--assets-directory DIRPATH', 'The directory that ' \ 'contains the assets (CSS, JS, images) to use') do |assets_directory| - config.assets_directory = Pathname(assets_directory) + config.assets_directory = Pathname(assets_directory).expand_path end opt.on('--readme FILEPATH', diff --git a/lib/jazzy/doc_builder.rb b/lib/jazzy/doc_builder.rb index <HASH>..<HASH> 100644 --- a/lib/jazzy/doc_builder.rb +++ b/lib/jazzy/doc_builder.rb @@ -160,7 +160,6 @@ module Jazzy end def self.copy_assets(destination) - # origin = Pathname(__FILE__).parent + '../../lib/jazzy/assets/.' origin = options.assets_directory; FileUtils.cp_r(origin, destination) Pathname.glob(destination + 'css/**/*.scss').each do |scss|
addressing issues discussed in PR #<I>
realm_jazzy
train
rb,rb
a78b5c2f8d924b07d40292853bc0d52415839cce
diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -341,7 +341,7 @@ module Jekyll "posts" => posts.sort { |a, b| b <=> a }, "pages" => pages, "static_files" => static_files.sort { |a, b| a.relative_path <=> b.relative_path }, - "html_pages" => pages.reject { |page| !page.html? }, + "html_pages" => pages.select { |page| page.html? || page.url.end_with?("/") }, "categories" => post_attr_hash('categories'), "tags" => post_attr_hash('tags'), "collections" => collections,
Include files with a url which ends in / in the site.html_pages list <URL>
jekyll_jekyll
train
rb
009cc315fa94027c250b03dc5f300a1651c03f16
diff --git a/lib/fetch/base.rb b/lib/fetch/base.rb index <HASH>..<HASH> 100644 --- a/lib/fetch/base.rb +++ b/lib/fetch/base.rb @@ -48,10 +48,10 @@ module Fetch # Cached fetch source modules. # - # Fetch::Base.fetch_source_modules[:google][:search] # => FetchModules::Google::Search - # Fetch::Base.fetch_source_modules[:google][:nonexistent] # => nil - def fetch_source_modules - @fetch_source_modules ||= Hash.new do |source_hash, source_key| + # Fetch::Base.module_cache[:google][:search] # => FetchModules::Google::Search + # Fetch::Base.module_cache[:google][:nonexistent] # => nil + def module_cache + @module_cache ||= Hash.new do |source_hash, source_key| source_hash[source_key] = Hash.new do |module_hash, module_key| module_hash[module_key] = constantize_fetch_module(source_key, module_key) end @@ -136,7 +136,7 @@ module Fetch @fetch_modules ||= begin sources.map do |source_key| self.class.fetch_modules.map do |module_key| - mod = self.class.fetch_source_modules[source_key][module_key] + mod = self.class.module_cache[source_key][module_key] mod.new(fetchable) if mod end end.flatten.compact
Add self-explanatory cache name
bogrobotten_fetch
train
rb
d54fd8d5837db5c08c13908905c05b85067c0b58
diff --git a/lib/spinner.js b/lib/spinner.js index <HASH>..<HASH> 100644 --- a/lib/spinner.js +++ b/lib/spinner.js @@ -73,7 +73,7 @@ class Spinner { } clear () { - if (!this.enabled) return + if (!this._output) return this.stream.write(this.ansi.cursorUp(this._lines)) this.stream.write(this.ansi.eraseDown) }
better method of detecting when to clear
heroku_heroku-cli-util
train
js
a7d0b6fe9db6b97b0252afc9c81fc36cc3265afa
diff --git a/cmd/root.go b/cmd/root.go index <HASH>..<HASH> 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -26,6 +26,7 @@ import ( golog "log" "os" "path/filepath" + "strings" "sync" "github.com/fatih/color" @@ -37,13 +38,13 @@ import ( ) var Version = "0.23.1" -var Banner = ` - /\ |‾‾| /‾‾/ /‾/ - /\ / \ | |_/ / / / - / \/ \ | | / ‾‾\ - / \ | |‾\ \ | (_) | - / __________ \ |__| \__\ \___/ .io` - +var Banner = strings.Join([]string{ + ` /\ |‾‾| /‾‾/ /‾/ `, + ` /\ / \ | |_/ / / / `, + ` / \/ \ | | / ‾‾\ `, + ` / \ | |‾\ \ | (_) | `, + ` / __________ \ |__| \__\ \___/ .io`, +}, "\n") var BannerColor = color.New(color.FgCyan) var (
Preserve the trailing spaces in the k6 ASCII banner
loadimpact_k6
train
go
7ea4679b24a550a4d639b6a7b458429eeb59449f
diff --git a/admin/index.php b/admin/index.php index <HASH>..<HASH> 100644 --- a/admin/index.php +++ b/admin/index.php @@ -85,7 +85,7 @@ echo "<LI><B><A HREF=\"site.php\">Site settings</A></B>"; echo "<LI><B><A HREF=\"../course/edit.php\">Create a new course</A></B>"; echo "<LI><B><A HREF=\"user.php\">Edit a user's account</A></B>"; - echo "<LI><B>Assign teachers to courses</B>"; + echo "<LI><B><A HREF=\"teacher.php\">Assign teachers to courses</A></B>"; echo "<LI><B>Delete a course</B>"; echo "<LI><B>View Logs</B>"; echo "</UL>";
Turned on link to teacher.php
moodle_moodle
train
php
39bc2be33b588f09f61500353f7a6b06a3dca0e6
diff --git a/iota/types.py b/iota/types.py index <HASH>..<HASH> 100644 --- a/iota/types.py +++ b/iota/types.py @@ -371,6 +371,8 @@ class Address(TryteString): # type: (TrytesCompatible) -> None super(Address, self).__init__(trytes, pad=self.LEN) + self.checksum = None # type: Optional[TryteString] + if len(self._trytes) > self.LEN: raise ValueError('Addresses must be 81 trytes long.') diff --git a/test/types_test.py b/test/types_test.py index <HASH>..<HASH> 100644 --- a/test/types_test.py +++ b/test/types_test.py @@ -517,6 +517,9 @@ class AddressTestCase(TestCase): b'HXXXGJHJDQPOMDOMNRDKYCZRUFZROZDADTHZC9999' ) + # Checksum is not generated automatically. + self.assertIsNone(addy.checksum) + def test_init_error_too_long(self): """ Attempting to create an address longer than 81 trytes.
Added placeholder for address checksums.
iotaledger_iota.lib.py
train
py,py
f8fda8febb9d622b57d752949764dafb0ad39192
diff --git a/src/CodeInspector/ClassChecker.php b/src/CodeInspector/ClassChecker.php index <HASH>..<HASH> 100644 --- a/src/CodeInspector/ClassChecker.php +++ b/src/CodeInspector/ClassChecker.php @@ -125,11 +125,16 @@ class ClassChecker implements StatementsSource (new StatementsChecker($this))->check($leftover_stmts, $context); } + $config = Config::getInstance(); + if ($check_statements) { // do the method checks after all class methods have been initialised foreach ($method_checkers as $method_checker) { $method_checker->check(new Context()); - $method_checker->checkReturnTypes(); + + if (!$config->excludeIssueInFile('CodeInspector\Issue\InvalidReturnType', $this->_file_name)) { + $method_checker->checkReturnTypes(); + } } }
Do not check return types if we ignore for that file
vimeo_psalm
train
php
cd75658cb56b2042433d62f4b6aa7dc84eaf3b5a
diff --git a/xdot.py b/xdot.py index <HASH>..<HASH> 100755 --- a/xdot.py +++ b/xdot.py @@ -510,6 +510,7 @@ UNDERLINE = 4 SUPERSCRIPT = 8 SUBSCRIPT = 16 STRIKE_THROUGH = 32 +OVERLINE = 64 class XDotAttrParser: @@ -1146,7 +1147,7 @@ class DotParser(Parser): class XDotParser(DotParser): - XDOTVERSION = '1.6' + XDOTVERSION = '1.7' def __init__(self, xdotcode): lexer = DotLexer(buf = xdotcode)
Support xdot format <I> All it adds is the OVERLINE bit for t. We don't currently support t at all, so we can claim support for <I> just much as <I>.
jrfonseca_xdot.py
train
py
53f5bf66f286fa279801f7f264d1e56d2d30d51b
diff --git a/job.go b/job.go index <HASH>..<HASH> 100644 --- a/job.go +++ b/job.go @@ -163,10 +163,11 @@ func (j *Job) Reschedule(time time.Time) error { unixNanoTime := time.UTC().UnixNano() t.command("HSET", redis.Args{j.key(), "time", unixNanoTime}, nil) t.setStatus(j, StatusQueued) + j.time = unixNanoTime + t.addJobToTimeIndex(j) if err := t.exec(); err != nil { return err } - j.time = unixNanoTime j.status = StatusQueued return nil } diff --git a/job_test.go b/job_test.go index <HASH>..<HASH> 100644 --- a/job_test.go +++ b/job_test.go @@ -153,6 +153,7 @@ func TestJobReschedule(t *testing.T) { t.Errorf("Unexpected error in job.Reschedule: %s", err.Error()) } expectJobFieldEquals(t, job, "time", unixNanoTime, int64Converter) + expectJobInTimeIndex(t, job) // Run through a set of possible state paths and make sure the result is // always what we expect
Fix bug where job was not being updated in the time index in Reschedule
albrow_jobs
train
go,go
9c72928dc37197b212ec602ee4415294d4aa9144
diff --git a/user/view.php b/user/view.php index <HASH>..<HASH> 100644 --- a/user/view.php +++ b/user/view.php @@ -124,6 +124,18 @@ print_row("icq:","<a href=\"http://web.icq.com/wwp?uin=$user->icq\">$user->icq <img src=\"http://web.icq.com/whitepages/online?icq=$user->icq&img=5\" width=18 height=18 border=0></a>"); } + if (isteacher($course->id)) { + if ($mycourses = get_my_courses($user->id)) { + $courselisting = ''; + foreach ($mycourses as $mycourse) { + if ($mycourse->visible) { + $courselisting .= "<a href=\"$CFG->wwwroot/course/view.php?id=$mycourse->id\">$mycourse->fullname</a>, "; + } + } + print_row(get_string('courses').':', rtrim($courselisting,', ')); + } + } + if ($user->lastaccess) { $datestring = userdate($user->lastaccess)."&nbsp (".format_time(time() - $user->lastaccess).")"; } else {
Show enrolled courses on user page to teachers See <URL>
moodle_moodle
train
php