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
1b651db9c577fc09fb4ca2be7e5858985de5d207
diff --git a/spacy/language.py b/spacy/language.py index <HASH>..<HASH> 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -244,7 +244,7 @@ class Language(object): self.tagger = self.Defaults.create_tagger(self) \ if 'tagger' not in overrides \ else overrides['tagger'] - self.parser = self.Defaults.create_tagger(self) \ + self.parser = self.Defaults.create_parser(self) \ if 'parser' not in overrides \ else overrides['parser'] self.entity = self.Defaults.create_entity(self) \
Fix parser creation in Language class.
explosion_spaCy
train
py
c5d6debc0773e6733ab5e10c8ba04d9ac672b2f7
diff --git a/templates/platform.html.php b/templates/platform.html.php index <HASH>..<HASH> 100755 --- a/templates/platform.html.php +++ b/templates/platform.html.php @@ -13,10 +13,10 @@ </label> <div class="col-sm-10"> <select name="language" class="form-control"> - <option <?php if ($var('platform_settings')->getLanguage() === 'en') echo 'selected' ?>> + <option value="EN" <?php if ($var('platform_settings')->getLanguage() === 'en') echo 'selected' ?>> English </option> - <option <?php if ($var('platform_settings')->getLanguage() === 'fr') echo 'selected' ?>> + <option value="FR" <?php if ($var('platform_settings')->getLanguage() === 'fr') echo 'selected' ?>> Français </option> </select>
[WebInstaller] Update platform.html.php
claroline_Distribution
train
php
b8307648ff82f1362fcbb4dba2a139083eaf0230
diff --git a/leeroy/github.py b/leeroy/github.py index <HASH>..<HASH> 100644 --- a/leeroy/github.py +++ b/leeroy/github.py @@ -222,7 +222,8 @@ def get_pull_request(app, repo_config, pull_request): :param pull_request: the pull request number """ response = get_api_response( - app, repo_config, "/repos/{{repo_name}}/pulls/{0}".format(pull_request)) + app, repo_config, + "/repos/{{repo_name}}/pulls/{0}".format(pull_request)) return response.json
fix up a flake8 issue
litl_leeroy
train
py
b2878a0a010f5ed93580c3df3bb658f19a181cc8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,8 @@ var pg = require('pg'), var DEFAULTS = { statementTimeout: '0', // the node-postgres default is no timeout - poolSize : 20 + poolSize : 20, + ssl: false } // Do not try to parse a postgres DATE to a javascript Date. @@ -149,6 +150,7 @@ function createMultipleInsertCTE(insert) { module.exports = function (env) { var envWithDefaults = _.assign({}, DEFAULTS, env) pg.defaults.poolSize = envWithDefaults.poolSize + pg.defaults.ssl = envWithDefaults.ssl return { getConnection: getConnectionWithEnv,
Allow overriding SSL that by default is disabled
reaktor_pg-using-bluebird
train
js
5be71551a7fd3b08d4d20b1b48d6df7137cc57c8
diff --git a/src/Swoole/Socket/UdpSocket.php b/src/Swoole/Socket/UdpSocket.php index <HASH>..<HASH> 100644 --- a/src/Swoole/Socket/UdpSocket.php +++ b/src/Swoole/Socket/UdpSocket.php @@ -14,7 +14,10 @@ abstract class UdpSocket implements PortInterface, UdpInterface $this->swoolePort = $port; } - abstract public function onReceive(\swoole_server $server, $fd, $reactorId, $data); + public function onReceive(\swoole_server $server, $fd, $reactorId, $data) + { + + } abstract public function onPacket(\swoole_server $server, $data, array $clientInfo); } \ No newline at end of file
empty onReceive implement for udp
hhxsv5_laravel-s
train
php
16500513b833b77a1c786b050834cbe62cc16839
diff --git a/shared/settings/feedback.native.js b/shared/settings/feedback.native.js index <HASH>..<HASH> 100644 --- a/shared/settings/feedback.native.js +++ b/shared/settings/feedback.native.js @@ -133,7 +133,15 @@ class Feedback extends Component<Props> { </Box> </Box> <ButtonBar> - <Button label="Send" type="Primary" onClick={this._onSubmit} waiting={sending} /> + <Button + fullWidth={true} + label="Send" + onClick={this._onSubmit} + // TODO: Remove this style when fullWidth does it. + style={{width: '100%'}} + type="Primary" + waiting={sending} + /> </ButtonBar> {sendError && ( <Box style={{...globalStyles.flexBoxColumn, marginTop: globalMargins.small}}>
Make the feedback button full-width. (#<I>) * Make the button full-width. * Set fullWidth. * Add TODO.
keybase_client
train
js
385c072648a12641d0bcf00319a7506f82d932e4
diff --git a/app/js/controllers/main/home/tabs/OverviewController.js b/app/js/controllers/main/home/tabs/OverviewController.js index <HASH>..<HASH> 100644 --- a/app/js/controllers/main/home/tabs/OverviewController.js +++ b/app/js/controllers/main/home/tabs/OverviewController.js @@ -76,7 +76,7 @@ module.exports = ($scope, $interval, BMA, UIUtils, summary, bmapi, ws) => { }); function bindBlockWS() { - bmapi.websocket.block().on(undefined, (block) => { + BMA.websocket.block().on(undefined, (block) => { $scope.current = block; $scope.$apply(); });
Fixing duniter/duniter#<I> Websocket for block still using BMA
duniter_duniter-ui
train
js
002ee80ddf1e3616e9d957abbdab76180d45aa27
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -192,6 +192,7 @@ def setup_package(): 'thinc>=6.10.1,<6.11.0', 'plac<1.0.0,>=0.9.6', 'six', + 'html5lib==1.0b8', 'pathlib', 'ujson>=1.35', 'dill>=0.2,<0.3',
Add html5lib to setup.py to fix six error (see #<I>)
explosion_spaCy
train
py
d1cbe048efc2760938b92023398fa4a2b4e203fb
diff --git a/client/src/containers/Editor/Editor.js b/client/src/containers/Editor/Editor.js index <HASH>..<HASH> 100644 --- a/client/src/containers/Editor/Editor.js +++ b/client/src/containers/Editor/Editor.js @@ -27,7 +27,7 @@ class Editor extends Component { { label: 'Filename', // TODO Use same property names as DataObject - name: 'basename', + name: 'Name', }, ]; @@ -246,7 +246,7 @@ Editor.propTypes = { file: React.PropTypes.shape({ id: React.PropTypes.number, title: React.PropTypes.string, - basename: React.PropTypes.string, + name: React.PropTypes.string, url: React.PropTypes.string, size: React.PropTypes.string, type: React.PropTypes.string, diff --git a/client/src/state/queuedFiles/QueuedFilesReducer.js b/client/src/state/queuedFiles/QueuedFilesReducer.js index <HASH>..<HASH> 100644 --- a/client/src/state/queuedFiles/QueuedFilesReducer.js +++ b/client/src/state/queuedFiles/QueuedFilesReducer.js @@ -10,7 +10,7 @@ function fileFactory() { width: null, }, }, - basename: null, + name: null, canDelete: false, canEdit: false, category: null,
Keep property names consistent between SS and React File.Name should map to a "name" property on the API. "basename" is a better technical term, but it just gets confusing if we break property symmetry between PHP and JS without a clean mapping API
silverstripe_silverstripe-asset-admin
train
js,js
f70b14f92842cf8620d94a6a2602e46bafc42575
diff --git a/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php b/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php index <HASH>..<HASH> 100644 --- a/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php +++ b/src/Guzzle/Service/Command/LocationVisitor/Response/JsonVisitor.php @@ -64,8 +64,13 @@ class JsonVisitor extends AbstractResponseVisitor if ($properties = $param->getProperties()) { foreach ($properties as $property) { $name = $property->getName(); - if (isset($value[$name])) { - $this->recursiveProcess($property, $value[$name]); + $key = $property->getWireName(); + if (isset($value[$key])) { + $this->recursiveProcess($property, $value[$key]); + } + if ($key != $name) { + $value[$name] = $value[$key]; + unset($value[$key]); } } }
Allowing nested renaming of JSON responses
guzzle_guzzle3
train
php
923ee7e441554c5f507779f5e01e6af28b98ab34
diff --git a/basic_cms/tests/test_api.py b/basic_cms/tests/test_api.py index <HASH>..<HASH> 100644 --- a/basic_cms/tests/test_api.py +++ b/basic_cms/tests/test_api.py @@ -32,7 +32,7 @@ class CMSPagesApiTests(TestCase): response = self.client.get(reverse('basic_cms_api', args=['terms']), data) self.assertEqual(response.status_code, 200) # self.assertJSONEqual(self.original_json_data, response.content) - self.assertEqual(self.original_json_data, response.content) + self.assertEqual(self.original_json_data, response.data) response = self.client.get(reverse('basic_cms_api', args=['terms'])) self.assertEqual(response.status_code, 200)
python <I> support #2
ArabellaTech_django-basic-cms
train
py
e6af2f803983b7c10448b341dbbed8dbdb82e4b6
diff --git a/src/App/Console/RouteCommand.php b/src/App/Console/RouteCommand.php index <HASH>..<HASH> 100644 --- a/src/App/Console/RouteCommand.php +++ b/src/App/Console/RouteCommand.php @@ -25,7 +25,7 @@ class RouteCommand extends Command protected function execute( InputInterface $input, OutputInterface $output ) { $result = 1; - system( "php public/index.php " . $input->getArgument( 'route' ), $result ); + system( "php " . INFUSE_BASE_DIR . "/public/index.php " . $input->getArgument( 'route' ), $result ); return $result; } } \ No newline at end of file
use absolute paths in route command of console app
infusephp_infuse
train
php
2ea45fab1346d2db48ebd0cdb2880e1eb4da0b34
diff --git a/js/therock.js b/js/therock.js index <HASH>..<HASH> 100644 --- a/js/therock.js +++ b/js/therock.js @@ -3,7 +3,7 @@ // --------------------------------------------------------------------------- const Exchange = require ('./base/Exchange'); -const { ExchangeError } = require ('./base/errors'); +const { ExchangeError, ArgumentsRequired } = require ('./base/errors'); // --------------------------------------------------------------------------- @@ -284,6 +284,9 @@ module.exports = class therock extends Exchange { } async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) { + if (symbol === undefined) { + throw new ArgumentsRequired (this.id + ' fetchMyTrades requires a symbol argument'); + } await this.loadMarkets (); let market = this.market (symbol); let response = await this.privateGetFundsIdTrades (this.extend ({
therock fetchMyTrades guards for undefined symbol
ccxt_ccxt
train
js
b05507239f8402b7b0377c76dbef00ff75ace6b0
diff --git a/src/session.js b/src/session.js index <HASH>..<HASH> 100644 --- a/src/session.js +++ b/src/session.js @@ -69,6 +69,7 @@ ghostdriver.Session = function(desiredCapabilities) { "proxy" : { //< TODO Support more proxy options - PhantomJS does allow setting from command line "proxyType" : _const.PROXY_TYPES.DIRECT }, + "webSecurityEnabled" : true }, _negotiatedCapabilities = { "browserName" : _defaultCapabilities.browserName, @@ -92,7 +93,10 @@ ghostdriver.Session = function(desiredCapabilities) { "nativeEvents" : _defaultCapabilities.nativeEvents, "proxy" : typeof(desiredCapabilities.proxy) === "undefined" ? _defaultCapabilities.proxy : - desiredCapabilities.proxy + desiredCapabilities.proxy, + "webSecurityEnabled" : typeof(desiredCapabilities.webSecurityEnabled) === "undefined" ? + _defaultCapabilities.webSecurityEnabled : + desiredCapabilities.webSecurityEnabled }, // NOTE: This value is needed for Timeouts Upper-bound limit. // "setTimeout/setInterval" accept only 32 bit integers, even though Number are all Doubles (go figure!)
Add webSecurityEnabled capability to session.js
detro_ghostdriver
train
js
536a0410ee8f3a46ef5b2c43f700156be2665cc7
diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Layer/Vector.js +++ b/lib/OpenLayers/Layer/Vector.js @@ -810,7 +810,9 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, { } } - if (!this.renderer.drawFeature(feature, style)) { + var drawn = this.renderer.drawFeature(feature, style); + //TODO remove the check for null when we get rid of Renderer.SVG + if (drawn === false || drawn === null) { this.unrenderedFeatures[feature.id] = feature; } else { delete this.unrenderedFeatures[feature.id];
only add features to the unrendererdFeatures array when they were not drawn due to lack of geometry. r=erilem (closes #<I>)" git-svn-id: <URL>
openlayers_openlayers
train
js
953a6bf2dd01872b86dd12e7212a652f90d738db
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ setup( 'djangorestframework', 'pyjwt', ], - python_requires='>=3.6,<3.9', + python_requires='>=3.6', extras_require=extras_require, packages=find_packages(exclude=['tests', 'tests.*', 'licenses', 'requirements']), include_package_data=True,
Remove upper version bound for the python requirement This makes it possible to install djangorestframework-simplejwt with poetry
davesque_django-rest-framework-simplejwt
train
py
d7a751a5de7260b82d9e0399e8efcce3f8f2500a
diff --git a/lib/Rfc6455Connection.php b/lib/Rfc6455Connection.php index <HASH>..<HASH> 100644 --- a/lib/Rfc6455Connection.php +++ b/lib/Rfc6455Connection.php @@ -232,6 +232,12 @@ final class Rfc6455Connection implements Connection { $this->lastDataReadAt = \time(); if (!$this->currentMessageEmitter) { + if ($opcode === self::OP_CONT) { + $this->onParsedError(Code::PROTOCOL_ERROR, 'Nothing to continue'); + + return; + } + $binary = $opcode === self::OP_BIN; $this->currentMessageEmitter = new Emitter; @@ -628,6 +634,10 @@ final class Rfc6455Connection implements Connection { $payload = ''; } + if ($this->parseError) { + return; + } + $frameLength -= $frameBytesRecd; $nextEmit = $dataMsgBytesRecd + $emitThreshold; $frameBytesRecd = 0; @@ -690,6 +700,10 @@ final class Rfc6455Connection implements Connection { $nextEmit = $dataMsgBytesRecd + $emitThreshold; $this->onParsedData($opcode, $payload, $fin); + + if ($this->parseError) { + return; + } } } else { $dataArr[] = $payload;
Reject OP_CONT if there's nothing to continue, abort on parse errors
amphp_websocket-client
train
php
7582231b1d798c6953f85bb00befe3107cb94e69
diff --git a/components/textdiff/textdiff.js b/components/textdiff/textdiff.js index <HASH>..<HASH> 100644 --- a/components/textdiff/textdiff.js +++ b/components/textdiff/textdiff.js @@ -17,7 +17,6 @@ var TextDiffViewModel = function(args) { this.sha1 = args.sha1; this.loadMoreCount = ko.observable(0); this.diffJson = null; - this.diffHtml = ko.observable(); this.loadCount = loadLimit; this.textDiffType = args.textDiffType; this.isShowingDiffs = args.isShowingDiffs;
Quickly removing unused variables in fear of @campersau
FredrikNoren_ungit
train
js
cb37aaa01b48397525e428354c27eb5e855233f4
diff --git a/test/spec/api/map.test.js b/test/spec/api/map.test.js index <HASH>..<HASH> 100644 --- a/test/spec/api/map.test.js +++ b/test/spec/api/map.test.js @@ -158,7 +158,7 @@ describe("ol.map", function() { map.destroy(); - expect(goog.isDef(map.getLayers())).toBe(false); + expect(map.layers()).not.toBeDefined(); });
map.test.js - fix the map is destroyable test in advanced mode
openlayers_openlayers
train
js
d271eb3d2307e6c5d463119e64dd85ec6edb864b
diff --git a/src/Data/Collection.php b/src/Data/Collection.php index <HASH>..<HASH> 100644 --- a/src/Data/Collection.php +++ b/src/Data/Collection.php @@ -201,38 +201,6 @@ class Collection implements Serializable, ArrayAccess, Iterator $this->_objectCreation = false; } - public function setFilter() - { - - } - - public function getFilters() - { - - } - - public function resetFilters() - { - - } - - public function setOrder() - { - - } - - public function getOrder() - { - - } - - public function setCollection() - { - - } - - //finished methods - /** * return serialized collection *
create Collection class (issue #4) This version introduces multiple enhancements: removed some methods, part of theme was moved into <I> version, some of them was removed absolutely Details of additions/deletions below: -------------------------------------------------------------- Modified: Data/Collection.php -- Removed -- setFilter getFilters resetFilters setOrder getOrder setCollection
bluetree-service_container
train
php
70ebc4cfe5ec80d7ac98dfa7eee53c7ed1e27eb9
diff --git a/source/class/qx/tool/utils/LogManager.js b/source/class/qx/tool/utils/LogManager.js index <HASH>..<HASH> 100644 --- a/source/class/qx/tool/utils/LogManager.js +++ b/source/class/qx/tool/utils/LogManager.js @@ -18,10 +18,13 @@ * Authors: * * John Spackman (john.spackman@zenesis.com, @johnspackman) * - * @require( qx.tool.utils.Logger) * * *********************************************************************** */ -var LEVELS = [ "trace", "debug", "info", "warn", "error", "fatal" ]; +/** + * @require(qx.tool.utils.Logger) +*/ + + var LEVELS = [ "trace", "debug", "info", "warn", "error", "fatal" ]; function zeropad2(val) { if (val < 10) {
@require has to be inside a jsdoc comment
qooxdoo_qooxdoo-compiler
train
js
71ddb9e89836e561dc66967df768f124b5edb135
diff --git a/lib/y_support/core_ext/hash/misc.rb b/lib/y_support/core_ext/hash/misc.rb index <HASH>..<HASH> 100644 --- a/lib/y_support/core_ext/hash/misc.rb +++ b/lib/y_support/core_ext/hash/misc.rb @@ -17,7 +17,7 @@ class Hash # would ensue. singleton_class.class_exec { remove_method :method_added } # And let's redefine the +:slice+ method now: - warn "Warning: Attempt to redefine Hash##{sym} occured, reverting." + warn "Warning: Attempt to redefine Hash##{sym} occured, reverting." if YSupport::DEBUG class_exec do # A bit like Array#slice, but only takes 1 argument, which is either diff --git a/lib/y_support/version.rb b/lib/y_support/version.rb index <HASH>..<HASH> 100644 --- a/lib/y_support/version.rb +++ b/lib/y_support/version.rb @@ -1,3 +1,4 @@ module YSupport VERSION = "2.0.36" + DEBUG = false end
toning down the method stealing warning
boris-s_y_support
train
rb,rb
982dec07584a02f6d12ff79c8adb579e2f5628a7
diff --git a/src/dataviews/helpers/histogram-helper.js b/src/dataviews/helpers/histogram-helper.js index <HASH>..<HASH> 100644 --- a/src/dataviews/helpers/histogram-helper.js +++ b/src/dataviews/helpers/histogram-helper.js @@ -61,7 +61,9 @@ helper.fillTimestampBuckets = function (buckets, start, aggregation, numberOfBin helper.fillNumericBuckets = function (buckets, start, width, numberOfBins) { for (var i = 0; i < numberOfBins; i++) { var bucketStart = start + (i * width); - var bucketEnd = (((i + 1) === numberOfBins) && buckets[i]) ? buckets[i].max : start + ((i + 1) * width); + var commonBucketEnd = start + ((i + 1) * width); + var isLastBucket = (i + 1) === numberOfBins; + var bucketEnd = (isLastBucket && buckets[i]) ? buckets[i].max : commonBucketEnd; var filledBucket = _.extend({}, { bin: i, start: bucketStart,
Little refactor to add explaining variables
CartoDB_carto.js
train
js
abf6e6b4be6a45f93189216a2553085440e5de9d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ setup( 'psycopg2cffi==2.7.4', 'djangorestframework==3.3.3', 'drf-extensions==0.2.8', + 'djangorestframework-composed-permissions==0.1', ], classifiers=[ 'Development Status :: 4 - Beta',
Add composed permissions package to install list
praekeltfoundation_seed-auth-api
train
py
542965888eb122fe74975579d52cda611f9b66a8
diff --git a/netatmo.js b/netatmo.js index <HASH>..<HASH> 100644 --- a/netatmo.js +++ b/netatmo.js @@ -363,7 +363,7 @@ netatmo.prototype.getThermostatsData = function (options, callback) { var devices = body.body.devices; - this.emit('get-stationsdata', err, devices); + this.emit('get-thermostatsdata', err, devices); if (callback) { return callback(err, devices); @@ -700,7 +700,7 @@ netatmo.prototype.setThermpoint = function (options, callback) { console.log(body); - this.emit('get-thermstate', err, body.status); + this.emit('get-thermostatsdata', err, body.status); if (callback) { return callback(err, body.status);
fix event name for get-thermostatsdata fix event name for `get-thermostatsdata` after a mix and match between old deprecated 'get-thermstate' and the new not deprecated `get-thermostatsdata`
karbassi_netatmo
train
js
23954a4b5e59d0f3528d4a948db4dbe9d2029c9d
diff --git a/cake/tests/groups/database.group.php b/cake/tests/groups/database.group.php index <HASH>..<HASH> 100644 --- a/cake/tests/groups/database.group.php +++ b/cake/tests/groups/database.group.php @@ -53,7 +53,7 @@ class DatabaseGroupTest extends TestSuite { */ function DatabaseGroupTest() { TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'db_acl'); - TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'schema'); + TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'cake_schema'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'connection_manager'); TestManager::addTestFile($this, CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS . 'datasources' . DS . 'dbo_source'); }
Fixing incorrect path to test file in database group test.
cakephp_cakephp
train
php
c89c7412e4e2649bee7e69bd1d935aef9467a715
diff --git a/electionnight/management/commands/bootstrap_results_config.py b/electionnight/management/commands/bootstrap_results_config.py index <HASH>..<HASH> 100644 --- a/electionnight/management/commands/bootstrap_results_config.py +++ b/electionnight/management/commands/bootstrap_results_config.py @@ -103,7 +103,8 @@ class Command(BaseCommand): Q(division__slug=state) | Q(division__parent__slug=state), ) - if state_elections.count() == 0: + # first check to see if we have normal elections + if state_elections.filter(race__special=False).count() == 0: return levels = ['state', 'county']
don't build a statewide results file if it's only a special
The-Politico_politico-civic-election-night
train
py
e0c139ed7bed7f12b3071209003fa25fe766fab3
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -60,9 +60,9 @@ copyright = u'2014, Yehonatan Daniv' # built documents. # # The short X.Y version. -version = '0.0.4' +version = '0.0.6' # The full version, including alpha/beta/rc tags. -release = '0.0.4' +release = '0.0.6' # 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 @@ -7,7 +7,7 @@ from setuptools import setup, find_packages setup( name='django-rest-assured', - version='0.0.5', + version='0.0.6', description='Django REST Assured instantly test-covers your Django REST Framework based API.', # long_description=long_description, url='https://github.com/ydaniv/django-rest-assured',
Bumped version to <I>
ydaniv_django-rest-assured
train
py,py
ce6223d38025c7f33027adbb2b356315ac0212df
diff --git a/src/EventListener/ConfigurationNoticesListener.php b/src/EventListener/ConfigurationNoticesListener.php index <HASH>..<HASH> 100644 --- a/src/EventListener/ConfigurationNoticesListener.php +++ b/src/EventListener/ConfigurationNoticesListener.php @@ -181,7 +181,7 @@ class ConfigurationNoticesListener implements EventSubscriberInterface if (!empty($canonical) && ($hostname != $canonical)) { $notice = json_encode([ 'severity' => 1, - 'notice' => "The <tt>canonical: </tt> is set in <tt>config.yml</tt>, but you are currently logged in using another hostname. This might cause issues with uploaded files, or links inserted in the content.", + 'notice' => "The <tt>canonical hostname</tt> is set to $canonical in <tt>config.yml</tt>, but you are currently logged in using another hostname. This might cause issues with uploaded files, or links inserted in the content.", 'info' => sprintf( "Log in on Bolt using the proper URL: <tt><a href='%s'>%s</a></tt>.", $this->app['canonical']->getUrl(),
make the notification more meaningful explicitly spell out the configured hostname in the notification message to aid the administrator
bolt_configuration-notices
train
php
93500f1545febde16cde783e1800f3c496dbf05e
diff --git a/src/Codeception/Module/WPDb.php b/src/Codeception/Module/WPDb.php index <HASH>..<HASH> 100644 --- a/src/Codeception/Module/WPDb.php +++ b/src/Codeception/Module/WPDb.php @@ -257,7 +257,7 @@ class WPDb extends Db throw new \InvalidArgumentException("Dump file [{$dumpFile}] does not exist or is not readable."); } - $this->driver->load($dumpFile); + $this->_getDriver()->load(file($dumpFile)); return; }
Fix issue #<I>, related to driver not defined Fix the issue lucatume/wp-browser/issues/<I> where the property `$driver` is not defined and the file content is not passed to the load function.
lucatume_wp-browser
train
php
0e0e61d76aae8d20bde6597b6cddb710ea16840d
diff --git a/github/github.go b/github/github.go index <HASH>..<HASH> 100644 --- a/github/github.go +++ b/github/github.go @@ -103,7 +103,7 @@ func (gh *GitHub) CreateRepository(project Project, description, homepage string return } - params := octokat.Repository{Name: project.Name, Description: description, Homepage: homepage, Private: isPrivate} + params := octokit.Repository{Name: project.Name, Description: description, Homepage: homepage, Private: isPrivate} repo, result := repoService.Create(params) if result.HasError() { err = result.Err
Fix wrong reference to octokit
github_hub
train
go
0f6d9a0de1bcdf960261c8488bbdf87cc87629e6
diff --git a/www/src/builtin_modules.js b/www/src/builtin_modules.js index <HASH>..<HASH> 100644 --- a/www/src/builtin_modules.js +++ b/www/src/builtin_modules.js @@ -299,6 +299,11 @@ return obj })(__BRYTHON__) + }else{ + // In a web worker, name "window" is not defined, but name "self" is + delete browser.$$window + delete browser.win + browser.self = $B.win } modules['browser'] = browser @@ -529,6 +534,4 @@ $B.set_func_names($B.cell, "builtins") - - })(__BRYTHON__)
In a web worker, browser has no attribute "window" but has an attribute "self"
brython-dev_brython
train
js
104a7779c98b1ec2c85bb872d34fbada53de82d9
diff --git a/modeshape-jdbc-local/src/test/java/org/modeshape/jdbc/AbstractJdbcDriverIntegrationTest.java b/modeshape-jdbc-local/src/test/java/org/modeshape/jdbc/AbstractJdbcDriverIntegrationTest.java index <HASH>..<HASH> 100644 --- a/modeshape-jdbc-local/src/test/java/org/modeshape/jdbc/AbstractJdbcDriverIntegrationTest.java +++ b/modeshape-jdbc-local/src/test/java/org/modeshape/jdbc/AbstractJdbcDriverIntegrationTest.java @@ -259,6 +259,7 @@ public abstract class AbstractJdbcDriverIntegrationTest extends AbstractJdbcDriv "cars NULL mix:simpleVersionable VIEW Is Mixin: true NULL NULL NULL null DERIVED", "cars NULL mix:title VIEW Is Mixin: true NULL NULL NULL null DERIVED", "cars NULL mix:versionable VIEW Is Mixin: true NULL NULL NULL null DERIVED", + "cars NULL mode:accessControllable VIEW Is Mixin: true NULL NULL NULL null DERIVED", "cars NULL mode:derived VIEW Is Mixin: true NULL NULL NULL null DERIVED", "cars NULL mode:federation VIEW Is Mixin: false NULL NULL NULL null DERIVED", "cars NULL mode:hashed VIEW Is Mixin: true NULL NULL NULL null DERIVED",
MODE-<I>: Add mode:accessControllable to result set
ModeShape_modeshape
train
java
2bbf8dcf9503eea0c5af7564a7d7696485782d7b
diff --git a/draft-js-mention-plugin/src/MentionSuggestions/Entry/index.js b/draft-js-mention-plugin/src/MentionSuggestions/Entry/index.js index <HASH>..<HASH> 100644 --- a/draft-js-mention-plugin/src/MentionSuggestions/Entry/index.js +++ b/draft-js-mention-plugin/src/MentionSuggestions/Entry/index.js @@ -39,8 +39,8 @@ export default class Entry extends Component { }; render() { - const { theme = {}, searchValue } = this.props; - const className = this.props.isFocused ? theme.mentionSuggestionsEntryFocused : theme.mentionSuggestionsEntry; + const { theme = {}, mention, searchValue, isFocused } = this.props; + const className = isFocused ? theme.mentionSuggestionsEntryFocused : theme.mentionSuggestionsEntry; const EntryComponent = this.props.entryComponent; return ( <EntryComponent @@ -50,7 +50,8 @@ export default class Entry extends Component { onMouseEnter={this.onMouseEnter} role="option" theme={theme} - mention={this.props.mention} + mention={mention} + isFocused={isFocused} searchValue={searchValue} /> );
Pass through isFocused prop to mention entry
draft-js-plugins_draft-js-plugins
train
js
68fec90c18d5a4871ad62d6aea5065c8763b988c
diff --git a/src/Illuminate/Database/SQLiteConnection.php b/src/Illuminate/Database/SQLiteConnection.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/SQLiteConnection.php +++ b/src/Illuminate/Database/SQLiteConnection.php @@ -27,6 +27,7 @@ class SQLiteConnection extends Connection $this->getSchemaBuilder()->enableForeignKeyConstraints(); } } + /** * Get the default query grammar instance. * @@ -84,7 +85,7 @@ class SQLiteConnection extends Connection /** * Get the database connection foreign key constraints configuration option. * - * @return boolean|null + * @return bool|null */ protected function getForeignKeyConstraintsConfigurationValue() {
Apply fixes from StyleCI (#<I>)
laravel_framework
train
php
7f77b82a61dc446b2ed243810bb885ded418245c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ REQUIREMENTS = [ 'lunardate', 'pytz', 'pyCalverter', + 'setuptools==0.6c11', ] version = '1.3.0.dev0' __VERSION__ = version
refs #<I> -- use an obsolete version of setuptools this version is known to be buggy and causes ``DistributionNotFound`` exceptions.
peopledoc_workalendar
train
py
e6e3e3eaa0897c39d5b6dd837418ae973f4a12dd
diff --git a/luminoso_api/upload.py b/luminoso_api/upload.py index <HASH>..<HASH> 100644 --- a/luminoso_api/upload.py +++ b/luminoso_api/upload.py @@ -14,7 +14,7 @@ def batches(iterable, size): sourceiter = iter(iterable) while True: batchiter = islice(sourceiter, size) - yield chain([batchiter.next()], batchiter) + yield chain([next(batchiter)], batchiter) def upload_stream(stream, server, account, projname, reader_dict, username=None, password=None,
Changed .next to next()
LuminosoInsight_luminoso-api-client-python
train
py
50fe7f3e1d30cc188dba6c2e720a0ffbf6b4179f
diff --git a/tests/SpecTests/Context.php b/tests/SpecTests/Context.php index <HASH>..<HASH> 100644 --- a/tests/SpecTests/Context.php +++ b/tests/SpecTests/Context.php @@ -88,15 +88,6 @@ final class Context $this->useEncryptedClient = true; } - public static function fromChangeStreams(stdClass $test, $databaseName, $collectionName) - { - $o = new self($databaseName, $collectionName); - - $o->client = FunctionalTestCase::createTestClient(); - - return $o; - } - public static function fromClientSideEncryption(stdClass $test, $databaseName, $collectionName) { $o = new self($databaseName, $collectionName); @@ -145,15 +136,6 @@ final class Context return $o; } - public static function fromCommandMonitoring(stdClass $test, $databaseName, $collectionName) - { - $o = new self($databaseName, $collectionName); - - $o->client = FunctionalTestCase::createTestClient(); - - return $o; - } - public static function fromCrud(stdClass $test, $databaseName, $collectionName) { $o = new self($databaseName, $collectionName);
Remove obsolete Context methods These methods should have been removed in f2cfb9ff<I>f6e<I>b<I>c7a<I>f<I>d<I>d4ca7 (PHPLIB-<I>) and <I>e8f<I>f<I>d<I>b8a<I>cd1d<I>c1fb8f<I>ba9 (PHPLIB-<I>).
mongodb_mongo-php-library
train
php
2c6f8620e2c97c3c036929678b517bf426e9dacd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -383,9 +383,8 @@ Logger.prototype.write = function(level, record, parameters) { } for(i = 0;i < this.streams.length;i++) { target = this.streams[i]; - json = (target.json === true && !listeners.length) - || (this.conf.json && !listeners.length); - if(json && (target.type !== RAW)) { + json = (target.json === true) || this.conf.json; + if(json && !listeners.length && (target.type !== RAW)) { if(this.bitwise) record.level = this.translate(record.level); record = JSON.stringify(record, circular()); }
Tidy write() conditionals.
cli-kit_cli-logger
train
js
60a4267b22975ce6acbbaa320dbe3a8ceca2b704
diff --git a/helpers.php b/helpers.php index <HASH>..<HASH> 100755 --- a/helpers.php +++ b/helpers.php @@ -334,11 +334,15 @@ if (! function_exists('class_uses_recursive')) { /** * Returns all traits used by a class, its subclasses and trait of their traits. * - * @param string $class + * @param object|string $class * @return array */ function class_uses_recursive($class) { + if (is_object($class)) { + $class = get_class($class); + } + $results = []; foreach (array_merge([$class => $class], class_parents($class)) as $class) {
allow passing object instance to class_uses_recursive (#<I>)
illuminate_support
train
php
74365514d1e40bd1f831cc5230e5b128b0ed7660
diff --git a/Adafruit_GPIO/Platform.py b/Adafruit_GPIO/Platform.py index <HASH>..<HASH> 100644 --- a/Adafruit_GPIO/Platform.py +++ b/Adafruit_GPIO/Platform.py @@ -26,6 +26,7 @@ UNKNOWN = 0 RASPBERRY_PI = 1 BEAGLEBONE_BLACK = 2 MINNOWBOARD = 3 +JETSON_NANO = 4 def platform_detect(): """Detect if running on the Raspberry Pi or Beaglebone Black and return the @@ -45,6 +46,8 @@ def platform_detect(): return BEAGLEBONE_BLACK elif plat.lower().find('armv7l-with-glibc2.4') > -1: return BEAGLEBONE_BLACK + elif plat.lower().find('tegra-aarch64-with-ubuntu') > -1: + return JETSON_NANO # Handle Minnowboard # Assumption is that mraa is installed
Added Detection of Jetson Nano Board
adafruit_Adafruit_Python_GPIO
train
py
63db5affa4930d3fac9b144cf8125bbbdb6b18db
diff --git a/dynamic_scraper/models.py b/dynamic_scraper/models.py index <HASH>..<HASH> 100644 --- a/dynamic_scraper/models.py +++ b/dynamic_scraper/models.py @@ -71,7 +71,7 @@ class Scraper(models.Model): name = models.CharField(max_length=200) scraped_obj_class = models.ForeignKey(ScrapedObjClass) status = models.CharField(max_length=1, choices=STATUS_CHOICES, default='P') - content_type = models.CharField(max_length=1, choices=CONTENT_TYPE_CHOICES, default='H') + content_type = models.CharField(max_length=1, choices=CONTENT_TYPE_CHOICES, default='H', help_text="Data type format of scraped pages (for JSON use JSONPath instead of XPath)") render_javascript = models.BooleanField(default=False, help_text="Render Javascript on pages (ScrapyJS/Splash deployment needed, careful: resource intense)") max_items_read = models.IntegerField(blank=True, null=True, help_text="Max number of items to be read (empty: unlimited).") max_items_save = models.IntegerField(blank=True, null=True, help_text="Max number of items to be saved (empty: unlimited).")
Added help text for content type choice select in Scraper admin form
holgerd77_django-dynamic-scraper
train
py
f68c9ead289d08d6abe8da1d2c0c971bc08c2fa5
diff --git a/cytoscape-navigator.js b/cytoscape-navigator.js index <HASH>..<HASH> 100644 --- a/cytoscape-navigator.js +++ b/cytoscape-navigator.js @@ -279,11 +279,11 @@ }; var wid = function(elem) { - return Math.max(elem.clientWidth, elem.scrollWidth, elem.offsetWidth); + return elem.getBoundingClientRect().width; }; var hei = function(elem) { - return Math.max(elem.clientHeight, elem.scrollHeight, elem.offsetHeight); + return elem.getBoundingClientRect().height; }; Navigator.prototype = { @@ -359,7 +359,7 @@ if (this.options.container && !this.options.removeCustomContainer) { this.$panel.innerHTML = ''; } else { - document.body.removeChild(this.$panel); + this.$panel.parentElement.removeChild(this.$panel); } } @@ -889,8 +889,6 @@ $img.style['position'] = 'absolute'; $img.style['left'] = translate.x + 'px'; $img.style['top'] = translate.y + 'px'; - $img.style['width'] = '100%'; - $img.style['height'] = '100%'; } this._onRenderHandler = throttle(render, that.options.rerenderDelay)
bug fixes for width/height/destroying
cytoscape_cytoscape.js-navigator
train
js
024e807cc5450453f7f04fe6538b5f5d8c510944
diff --git a/lib/devtools/config.rb b/lib/devtools/config.rb index <HASH>..<HASH> 100644 --- a/lib/devtools/config.rb +++ b/lib/devtools/config.rb @@ -157,7 +157,7 @@ module Devtools class Devtools < self FILE = 'devtools.yml'.freeze - attribute :unit_test_timeout, ::Devtools::Project::UNIT_TEST_TIMEOUT + attribute :unit_test_timeout, UNIT_TEST_TIMEOUT end end end
Simplify and therefore fix const access
mbj_devtools
train
rb
ddf4d73aa23f9f62e58ccb6c1f2216008f30059e
diff --git a/test/functional/ft_65_timers.rb b/test/functional/ft_65_timers.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_65_timers.rb +++ b/test/functional/ft_65_timers.rb @@ -314,5 +314,23 @@ class FtTimersTest < Test::Unit::TestCase assert_equal "#<ArgumentError: unknown time char 'x'>", err.message end + + def test_process_status_and_timers + + @dashboard.register :alpha, Ruote::StorageParticipant + + pdef = Ruote.process_definition do + alpha :timers => '3h: x, 1d: timeout' + end + + wfid = @dashboard.launch(pdef) + + @dashboard.wait_for('dispatched') + + ps = @dashboard.ps(wfid).inspect + + assert_match /apply\n\s+\*\* no target \*\*/, ps + assert_match /cancel\n\s+0_0!/, ps + end end
add test for timers/schedules without targets
jmettraux_ruote
train
rb
95ad7d655d12eb33f4c117f91b7fbb7165d9dd22
diff --git a/lib/jsi/schema.rb b/lib/jsi/schema.rb index <HASH>..<HASH> 100644 --- a/lib/jsi/schema.rb +++ b/lib/jsi/schema.rb @@ -125,7 +125,6 @@ module JSI # matching oneOf is good here. one schema for one instance. # matching anyOf is okay. there could be more than one schema matched. it's often just one. if more # than one is a match, you just get the first one. - instance = instance.deref if instance.is_a?(JSI::JSON::Node) %w(oneOf anyOf).select { |k| schema_node[k].respond_to?(:to_ary) }.each do |someof_key| schema_node[someof_key].map(&:deref).map do |someof_node| someof_schema = self.class.new(someof_node)
dev fix unnecessary incorrect deref of instance on Schema#match_to_instance
notEthan_jsi
train
rb
cbeb462999816caa93d57c309d7f4fd3168ac58a
diff --git a/src/js/UrlBuilder.js b/src/js/UrlBuilder.js index <HASH>..<HASH> 100644 --- a/src/js/UrlBuilder.js +++ b/src/js/UrlBuilder.js @@ -25,8 +25,9 @@ class UrlBuilder { let host = (this.route.domain || this.ziggy.baseDomain).replace(/\/+$/, ''); - if (this.ziggy.basePort && (host.replace(/\/+$/, '') === this.ziggy.baseDomain.replace(/\/+$/, ''))) - host = this.ziggy.baseDomain + ':' + this.ziggy.basePort; + if (this.ziggy.basePort) { + host = `${host}:${this.ziggy.basePort}`; + } return this.ziggy.baseProtocol + '://' + host + '/'; }
Remove check for matching base domain and update host string concatenation to *append* the port rather than reconstructing the whole string
tightenco_ziggy
train
js
ebedcd04fc694c7c7947692be7c0cbe53304681f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ var stream = require('stream') var util = require('util') function WebsocketStream(server, protocol) { - var self = this stream.Stream.call(this) this.readable = true this.writable = true @@ -11,14 +10,13 @@ function WebsocketStream(server, protocol) { this.ws.on('message', this.onMessage.bind(this)) this.ws.on('error', this.onError.bind(this)) this.ws.on('close', this.onClose.bind(this)) - this.ws.on('open', function() { - self.emit('open') - }) + this.ws.on('open', this.onOpen.bind(this)) } else { this.ws = new WebSocket(server, protocol) this.ws.onmessage = this.onMessage.bind(this) this.ws.onerror = this.onError.bind(this) this.ws.onclose = this.onClose.bind(this) + this.ws.onopen = this.onOpen.bind(this) } } @@ -43,6 +41,10 @@ WebsocketStream.prototype.onClose = function(err) { this.emit('end') } +WebsocketStream.prototype.onClose = function(err) { + this.emit('open') +} + WebsocketStream.prototype.write = function(data) { return this.ws.send(data) }
Register onopen callback on ws instance and emit 'open' event.
maxogden_websocket-stream
train
js
265c7fef27203f98e61d44020f790c3c6a3ba914
diff --git a/src/Repo/Entity/Quantity/Def/Sale.php b/src/Repo/Entity/Quantity/Def/Sale.php index <HASH>..<HASH> 100644 --- a/src/Repo/Entity/Quantity/Def/Sale.php +++ b/src/Repo/Entity/Quantity/Def/Sale.php @@ -26,7 +26,7 @@ class Sale extends BaseEntityRepo implements IEntityRepo public function getBySaleItemId($id) { $result = []; - $where = '=' . (int)$id; + $where = Entity::ATTR_SALE_ITEM_REF . '=' . (int)$id; $rows = $this->get($where); foreach ($rows as $row) { $item = new \Praxigento\Warehouse\Data\Entity\Quantity\Sale($row);
MOBI-<I> - Tax & discount mismatch with the reference order
praxigento_mobi_mod_warehouse
train
php
d238f2553f851e35ad5e1f41be126b08ffd36beb
diff --git a/lib/mongo/bulk/bulk_write.rb b/lib/mongo/bulk/bulk_write.rb index <HASH>..<HASH> 100644 --- a/lib/mongo/bulk/bulk_write.rb +++ b/lib/mongo/bulk/bulk_write.rb @@ -189,9 +189,7 @@ module Mongo # @todo set this before or after the execute? @executed = true - - @ops = merge_ops - ops = @ops.dup + ops = merge_ops replies = [] until ops.empty? diff --git a/lib/mongo/operation/bulk_insert/result.rb b/lib/mongo/operation/bulk_insert/result.rb index <HASH>..<HASH> 100644 --- a/lib/mongo/operation/bulk_insert/result.rb +++ b/lib/mongo/operation/bulk_insert/result.rb @@ -17,8 +17,7 @@ module Mongo module Write class BulkInsert - # Defines custom behaviour of results when inserting to a server - # with version < 2.5.5. + # Defines custom behaviour of results when inserting. # # @since 2.0.0 class Result < Operation::Result @@ -37,13 +36,11 @@ module Mongo end # Defines custom behaviour of results when inserting. + # For server versions < 2.5.5 (that don't use write commands). # # @since 2.0.0 class LegacyResult < Operation::Result - # ordered: n documents -> n replies - # unordered: n documents -> documents.count - # Gets the number of documents inserted. # # @example Get the counts.
RUBY-<I> minor cleanup
mongodb_mongo-ruby-driver
train
rb,rb
d53d41d30b5c088c73509912db3280ff2c53d264
diff --git a/py/dynesty/plotting.py b/py/dynesty/plotting.py index <HASH>..<HASH> 100644 --- a/py/dynesty/plotting.py +++ b/py/dynesty/plotting.py @@ -34,6 +34,7 @@ def _make_subplots(fig, nx, ny, xsize, ysize): # Setting up default plot layout. if fig is None: fig, axes = pl.subplots(nx, ny, figsize=(xsize, ysize)) + axes = np.asarray(axes).reshape(nx, ny) else: fig, axes = fig try: @@ -1743,6 +1744,7 @@ def boundplot(results, # Setting up default plot layout. fig, axes = _make_subplots(fig, 1, 1, 6, 6) + axes = axes[0, 0] # Plotting. axes.plot(x1, x2, color=color, zorder=1, **plot_kwargs)
update plotting to make sure the notebooks run clearly
joshspeagle_dynesty
train
py
defb41516e860cc3e5ca3077dd0dbe9760e282c9
diff --git a/core/event/network.go b/core/event/network.go index <HASH>..<HASH> 100644 --- a/core/event/network.go +++ b/core/event/network.go @@ -5,12 +5,12 @@ import ( "github.com/libp2p/go-libp2p-core/peer" ) -// EvtPeerConnectednessChange should be emitted every time we form a connection with a peer or drop our last +// EvtPeerConnectednessChanged should be emitted every time we form a connection with a peer or drop our last // connection with the peer. Essentially, it is emitted in two cases: // a) We form a/any connection with a peer. // b) We go from having a connection/s with a peer to having no connection with the peer. // It contains the Id of the remote peer and the new connectedness state. -type EvtPeerConnectednessChange struct { - RemotePeerId peer.ID +type EvtPeerConnectednessChanged struct { + Peer peer.ID Connectedness network.Connectedness }
changes as per raul's review
libp2p_go-libp2p
train
go
dced94b0282eb121a880ad1c2ab073af79a0fe7e
diff --git a/tests/tests.py b/tests/tests.py index <HASH>..<HASH> 100755 --- a/tests/tests.py +++ b/tests/tests.py @@ -96,7 +96,13 @@ class TestOAuth(unittest.TestCase): print current_team['team_id'],current_team['name'],current_team['number_of_trades'],current_team['number_of_moves'] class TestStockParser(unittest.TestCase): - + + def setUp(self,): + pass + + def tearDown(self): + pass + def get_current_info(self,): data = stockretriever.get_current_info(["YHOO","AAPL","GOOG"]) @@ -113,6 +119,7 @@ class TestStockParser(unittest.TestCase): logging.debug(pretty_json(data.content)) self.assertEquals(data.status_code,200) + class TestTable(unittest.TestCase): def setUp(self,):
trying to fix tests run for TestStockScraper
josuebrunel_myql
train
py
f7a2eb4ed51edf7d404b516fb3a03a411647c8f6
diff --git a/lib/backend/etcdbk/etcd.go b/lib/backend/etcdbk/etcd.go index <HASH>..<HASH> 100644 --- a/lib/backend/etcdbk/etcd.go +++ b/lib/backend/etcdbk/etcd.go @@ -319,7 +319,7 @@ func (b *EtcdBackend) reconnect(ctx context.Context) error { certPool := x509.NewCertPool() parsedCert, err := tlsca.ParseCertificatePEM(caCertPEM) if err != nil { - return trace.Wrap(err, "failed to parse CA certificate") + return trace.Wrap(err, "failed to parse CA certificate %q", b.cfg.TLSCAFile) } certPool.AddCert(parsedCert)
Include CA cert file path in the error message
gravitational_teleport
train
go
c4c9a1268da0761b32dd117f9bd8c509024f80a0
diff --git a/lib/browser.js b/lib/browser.js index <HASH>..<HASH> 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -261,23 +261,19 @@ DummyBrowser.prototype = { */ _verfiyBrowserConfig: function (browserName, config) { - var browser = null; - // load and assign browser configuration if it exists - var browsers = config.get('browsers') || null; - if (browsers) { - browser = browsers[0][browserName]; - } + var browsers = config.get('browsers'); // check if we couldnt find a configured alias, + // set to defaults otherwise + if (!browsers) { + return {actAs: this.desiredCapabilities.browserName, version: this.desiredCapabilities['browser-version']}; + } + var browser = config.get('browsers')[0][browserName] || null; + // check if we couldnt find a configured alias, // check and apply if there is a default config if (!browser && this.browsers[browserName]) { browser = this.browsers[browserName]; } - // check if we couldnt find a configured alias, - // set to defaults otherwise - if (!browser) { - return {actAs: this.desiredCapabilities.browserName, version: this.desiredCapabilities['browser-version']}; - } // check if the actas property has been set, if not // use the given browser name
Removed a bit of complexity from '_verfiyBrowserConfig'
dalekjs_dalek-driver-sauce
train
js
e349e24aa244d7aaaa364cc326cc76285e02b143
diff --git a/core/ViewDataTable/Manager.php b/core/ViewDataTable/Manager.php index <HASH>..<HASH> 100644 --- a/core/ViewDataTable/Manager.php +++ b/core/ViewDataTable/Manager.php @@ -8,6 +8,7 @@ */ namespace Piwik\ViewDataTable; +use Piwik\Cache; use Piwik\Common; use Piwik\Option; use Piwik\Piwik; @@ -63,6 +64,14 @@ class Manager */ public static function getAvailableViewDataTables() { + $cache = Cache::getTransientCache(); + $cacheId = 'ViewDataTable.getAvailableViewDataTables'; + $dataTables = $cache->fetch($cacheId); + + if (!empty($dataTables)) { + return $dataTables; + } + $klassToExtend = '\\Piwik\\Plugin\\ViewDataTable'; /** @var string[] $visualizations */ @@ -107,6 +116,8 @@ class Manager $result[$vizId] = $viz; } + $cache->save($cacheId, $result); + return $result; }
we do request the available view datatables many times, eg when detecting the footerIcons. Instead cache the result to save many postEvents etc
matomo-org_matomo
train
php
5d219d6d65b80f563402238bec20dde46defe323
diff --git a/indra/ontology/bio/ontology.py b/indra/ontology/bio/ontology.py index <HASH>..<HASH> 100644 --- a/indra/ontology/bio/ontology.py +++ b/indra/ontology/bio/ontology.py @@ -231,11 +231,15 @@ class BioOntology(IndraOntology): # Here we assume if no namespace is given, then # we're dealing with a (namespace, id) tuple if from_ns is None: - from_ns, from_id = from_id + from_ns_, from_id = from_id + else: + from_ns_ = from_ns if to_ns is None: - to_ns, to_id = to_id - source = label_fix(from_ns, from_id) - target = label_fix(to_ns, to_id) + to_ns_, to_id = to_id + else: + to_ns_ = to_ns + source = label_fix(from_ns_, from_id) + target = label_fix(to_ns_, to_id) edges.append((source, target, data)) if symmetric: edges.append((target, source, data))
Fix handling of undefined from/to ns
sorgerlab_indra
train
py
d497e7db6beac98a1c6928bd4017cb81d3e618ca
diff --git a/src/test/java/edu/ksu/canvas/CanvasTestBase.java b/src/test/java/edu/ksu/canvas/CanvasTestBase.java index <HASH>..<HASH> 100644 --- a/src/test/java/edu/ksu/canvas/CanvasTestBase.java +++ b/src/test/java/edu/ksu/canvas/CanvasTestBase.java @@ -15,7 +15,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {CommonTestConfig.class}) @ActiveProfiles("dev") -public class CanvasTestBase { +public abstract class CanvasTestBase { public static final OauthToken SOME_OAUTH_TOKEN = new NonRefreshableOauthToken("token");; public static final int SOME_CONNECT_TIMEOUT = 1000; public static final int SOME_READ_TIMEOUT = 1000;
Make CanvasTestBase abstract Although this doesn’t get run as a test under maven when using IntelliJ it attempts to run this class as a test which then fails, marking it as abstract means it should never get run by IntelliJ, but also allows it to continue to be used as before.
kstateome_canvas-api
train
java
66462a2c72433113bcac808638ab54eae601dc1d
diff --git a/www/src/py_type.js b/www/src/py_type.js index <HASH>..<HASH> 100644 --- a/www/src/py_type.js +++ b/www/src/py_type.js @@ -209,7 +209,7 @@ $B.$class_constructor = function(class_name, class_obj, bases, kls.$factory = nofactory } - kls.__qualname__ = module + '.' + class_name.replace("$$", "") + kls.__qualname__ = class_name.replace("$$", "") return kls }
Bug fix : attribute _qualname__ of classes don't include module name
brython-dev_brython
train
js
790f923994db4f49fc16bb25427bd9937af5b9cf
diff --git a/test/code_workflow_example.rb b/test/code_workflow_example.rb index <HASH>..<HASH> 100644 --- a/test/code_workflow_example.rb +++ b/test/code_workflow_example.rb @@ -204,9 +204,19 @@ module Dynflow def initialize super - @tasks = Set.new - @clocks = Thread.new { loop { tick } } + @tasks = Set.new @progress = Hash.new { |h, k| h[k] = 0 } + + @start_ticker = Queue.new + @ticker = Thread.new do + loop do + @start_ticker.pop + sleep interval + self << Tick + end + end + + tick end def wait_for_task(action, external_task_id) @@ -228,12 +238,12 @@ module Dynflow end, Tick >>-> do poll + tick end) end def tick - self << Tick - sleep interval + @start_ticker << true end def poll
Replace the clock with ticker which is waiting for pull to finish
Dynflow_dynflow
train
rb
73a9fc333f5789f9a39eea12ab3cd7098c29953c
diff --git a/libs/parser/grammar.class.php b/libs/parser/grammar.class.php index <HASH>..<HASH> 100644 --- a/libs/parser/grammar.class.php +++ b/libs/parser/grammar.class.php @@ -301,7 +301,8 @@ namespace org\octris\core\parser { if (!is_null($this->initial)) { $valid = $v($this->rules[$this->initial]); } else { - die("TODO: no initial rule\n"); + // no initial rule, build one + $valid = $v(['$alternation' => array_keys($this->rules)]); } $expected = array_unique($expected);
build an "alternation" rule including all defined rules if no initial rule is defined
octris_parser
train
php
037b03fa465809449ffa0ca7ee34cf80fa6b9f5b
diff --git a/sniffer/scanner/base.py b/sniffer/scanner/base.py index <HASH>..<HASH> 100644 --- a/sniffer/scanner/base.py +++ b/sniffer/scanner/base.py @@ -211,11 +211,11 @@ class PollingScanner(BaseScanner): self.log(""" No supported libraries found: using polling-method. -You may want to install a third-party library for performance benefits. +You may want to install a third-party library so I don't eat CPU. Supported libraries are: - pyinotify (Linux) - pywin32 (Windows) - - MacFSEvents (OSX Leopard) + - MacFSEvents (OSX) """) self._running = True self.trigger_init()
Edited the log message to be a bit more description (and friendly).
jeffh_sniffer
train
py
576c66d43e1fb8a4a8d800392d8d71b9091a1a0a
diff --git a/src/js/mediaelement-renderer-youtube-iframe.js b/src/js/mediaelement-renderer-youtube-iframe.js index <HASH>..<HASH> 100644 --- a/src/js/mediaelement-renderer-youtube-iframe.js +++ b/src/js/mediaelement-renderer-youtube-iframe.js @@ -373,23 +373,22 @@ height = mediaElement.originalNode.height, width = mediaElement.originalNode.width, videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src), - defaultVars = { - controls: 0, - rel: 0, - disablekb: 1, - showinfo: 0, - modestbranding: 0, - html5: 1, - playsinline: 1 - }, youtubeSettings = { id: youtube.id, containerId: youtubeContainer.id, videoId: videoId, height: height, width: width, - playerVars: mejs.Utility.extend({}, defaultVars, youtube.options.youTubeVars), - origin: location.host, + playerVars: { + controls: 0, + rel: 0, + disablekb: 1, + showinfo: 0, + modestbranding: 0, + html5: 1, + playsinline: 1 + }, + origin: win.location.host, events: { onReady: function (e) {
Removed support for other YouTube variables since no need for them
mediaelement_mediaelement
train
js
11fad124ff6813d54bc81367209f237693d911c1
diff --git a/lib/dpl/provider/elastic_beanstalk.rb b/lib/dpl/provider/elastic_beanstalk.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/provider/elastic_beanstalk.rb +++ b/lib/dpl/provider/elastic_beanstalk.rb @@ -6,7 +6,7 @@ module DPL class ElasticBeanstalk < Provider experimental 'AWS Elastic Beanstalk' - S3_BUCKET = 'travis_elasticbeanstalk_builds' + S3_BUCKET = 'travis-elasticbeanstalk-builds' def needs_key? false
You shall not use underscores in bucket names!
travis-ci_dpl
train
rb
9e82cdedef235f07eb8675f216f755734e27cf4e
diff --git a/src/main/java/com/google/maps/GeolocationApi.java b/src/main/java/com/google/maps/GeolocationApi.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/google/maps/GeolocationApi.java +++ b/src/main/java/com/google/maps/GeolocationApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 Google Inc. All rights reserved. + * Copyright 2016 Google Inc. All rights reserved. * * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this @@ -86,4 +86,4 @@ public class GeolocationApi { return ApiException.from(reason, message); } } -} \ No newline at end of file +}
copyright year changed to <I>
googlemaps_google-maps-services-java
train
java
9627a784495d4b078660db743b4757b3606954df
diff --git a/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java b/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java index <HASH>..<HASH> 100644 --- a/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java +++ b/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java @@ -61,6 +61,10 @@ public class HttpSupport { logger.error(info); } + protected void logError(Throwable e){ + logger.error("", e); + } + protected void logError(String info, Throwable e){ logger.error(info, e); }
added logError(Throwable) convenience method
javalite_activejdbc
train
java
a4bfb85204d7e7a5bde5b9837ef6c10322f8965b
diff --git a/kaba/kaba/js/js-directory-task.js b/kaba/kaba/js/js-directory-task.js index <HASH>..<HASH> 100644 --- a/kaba/kaba/js/js-directory-task.js +++ b/kaba/kaba/js/js-directory-task.js @@ -106,6 +106,7 @@ module.exports = class JsDirectoryTask browserifyInstance.transform("babelify", { + global: true, presets: babelPresets, plugins: babelPlugins, });
Run babelify on all imports, as uglifyjs doesn’t handle ES<I> too well
Becklyn_kaba
train
js
4d3a5986d0d27b3ad4a4ec50274dd7f7cdf776a2
diff --git a/controllers/UserController.js b/controllers/UserController.js index <HASH>..<HASH> 100644 --- a/controllers/UserController.js +++ b/controllers/UserController.js @@ -262,9 +262,7 @@ module.exports = function( config, Controller, passport, UserService ) { .then( this.proxy( function( user ) { require( 'clever-auth' ).controllers.AuthController.authenticate.apply( this, [ null, user ] ); })) - .catch( this.proxy( function( err ) { - this.send( { statusCode: 400, message: err }, 400 ); - })); + .catch( this.proxy( 'handleServiceMessage' ) ) }, /** @@ -277,9 +275,7 @@ module.exports = function( config, Controller, passport, UserService ) { .then( this.proxy( function( user ) { require( 'clever-auth' ).controllers.AuthController.updateSession.apply( this, [ user ] ); })) - .catch( this.proxy( function( err ) { - this.send( { statusCode: 400, message: err }, 400 ); - })); + .catch( this.proxy( 'handleServiceMessage' ) ) }, /**
refactor(auth): Modified user controller to call handleServiceMessage with exceptions as well
CleverStack_clever-auth
train
js
963f22e2d426c7d6df7a3ac85c98f8253b8b24fc
diff --git a/integration/isolated/v3_stage_command_test.go b/integration/isolated/v3_stage_command_test.go index <HASH>..<HASH> 100644 --- a/integration/isolated/v3_stage_command_test.go +++ b/integration/isolated/v3_stage_command_test.go @@ -146,7 +146,6 @@ var _ = Describe("v3-stage command", func() { userName, _ := helpers.GetCredentials() Eventually(session.Out).Should(Say("Staging package for %s in org %s / space %s as %s\\.\\.\\.", appName, orgName, spaceName, userName)) - Eventually(session.Out).Should(Say("Creating container")) Eventually(session.Out).Should(Say("droplet: %s", helpers.GUIDRegex)) Eventually(session.Out).Should(Say("OK"))
don't assert on output from CAPI [#<I>]
cloudfoundry_cli
train
go
30831595679cf7b3cbd33fb05c860ced7089a72c
diff --git a/spyder/widgets/ipythonconsole/shell.py b/spyder/widgets/ipythonconsole/shell.py index <HASH>..<HASH> 100644 --- a/spyder/widgets/ipythonconsole/shell.py +++ b/spyder/widgets/ipythonconsole/shell.py @@ -82,8 +82,11 @@ class ShellWidget(NamepaceBrowserWidget, HelpWidget, DebuggingWidget): def set_cwd(self, dirname): """Set shell current working directory.""" - return self.silent_execute( - u"get_ipython().kernel.set_cwd(r'{}')".format(dirname)) + code = u"get_ipython().kernel.set_cwd(r'{}')".format(dirname) + if self._reading: + self.kernel_client.input(u'!' + code) + else: + self.silent_execute(code) # --- To handle the banner def long_banner(self):
IPython console: Make setting cwd work while debugging
spyder-ide_spyder
train
py
b2d5842064ab1059f66b762823441f2c022117ac
diff --git a/lib/converter.js b/lib/converter.js index <HASH>..<HASH> 100644 --- a/lib/converter.js +++ b/lib/converter.js @@ -57,8 +57,10 @@ module.exports = { * @note this form of loading is most likely not browser friendly, find browser alternative */ converters: { - 'converter-v1-to-v2': require('./converters/converter-v1-to-v2'), - 'converter-v2-to-v1': require('./converters/converter-v2-to-v1') + 'converter-v1-to-v2': require('./converters/v1.0.0/converter-v1-to-v2'), + 'converter-v1-to-v21': require('./converters/v1.0.0/converter-v1-to-v21'), + 'converter-v2-to-v1': require('./converters/v2.0.0/converter-v2-to-v1'), + 'converter-v21-to-v1': require('./converters/v2.1.0/converter-v21-to-v1') }, /**
Added module entry for new <I> converters
postmanlabs_postman-collection-transformer
train
js
d9d111162b95ece8b073f0762502c160b77b086f
diff --git a/src/primitives/a-ocean.js b/src/primitives/a-ocean.js index <HASH>..<HASH> 100644 --- a/src/primitives/a-ocean.js +++ b/src/primitives/a-ocean.js @@ -13,6 +13,10 @@ module.exports.Primitive = AFRAME.registerPrimitive('a-ocean', { width: 'ocean.width', depth: 'ocean.depth', density: 'ocean.density', + amplitude: 'ocean.amplitude', + amplitudeVariance: 'ocean.amplitudeVariance', + speed: 'ocean.speed', + speedVariance: 'ocean.speedVariance', color: 'ocean.color', opacity: 'ocean.opacity' }
[ocean] Add missing primitive mappings. Fixes #<I>.
donmccurdy_aframe-extras
train
js
6392646202d8c94bc2ee329f1e5a776ba5e54af4
diff --git a/src/FieldTrait.php b/src/FieldTrait.php index <HASH>..<HASH> 100644 --- a/src/FieldTrait.php +++ b/src/FieldTrait.php @@ -1,8 +1,11 @@ <?php namespace CsvMigrations; +use Cake\Core\App; use Cake\ORM\Query; +use Cake\ORM\Table as TargetTable; use CsvMigrations\ConfigurationTrait; +use Qobo\Utils\ModuleConfig\ModuleConfig; trait FieldTrait { @@ -33,4 +36,20 @@ trait FieldTrait return $query; } + + /** + * Get Table's lookup fields. + * + * @param \Cake\ORM\Table $table Table instance + * @return array + */ + public function getLookupFields(TargetTable $table) + { + $moduleName = App::shortName(get_class($table), 'Model/Table', 'Table'); + + $config = new ModuleConfig(ModuleConfig::CONFIG_TYPE_MODULE, $moduleName); + $parsed = $config->parse(); + + return $parsed->table->lookup_fields ?: []; + } }
Get Table's lookup fields (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
37a6c0a1d35c3ae0f5b3fb9278f94b57b64c9647
diff --git a/spyderlib/plugins/ipythonconsole.py b/spyderlib/plugins/ipythonconsole.py index <HASH>..<HASH> 100644 --- a/spyderlib/plugins/ipythonconsole.py +++ b/spyderlib/plugins/ipythonconsole.py @@ -853,7 +853,8 @@ class IPythonConsole(SpyderPluginWidget): def kernel_and_frontend_match(self, connection_file): # Determine kernel version - ci = get_connection_info(connection_file, unpack=True) + ci = get_connection_info(connection_file, unpack=True, + profile='default') if ci.has_key(u('control_port')): kernel_ver = '>=1.0' else:
IPython Console: Fix error while checking if frontend and kernel versions match - This one was introduced after updating with tip on revision <I>c<I>cb<I>
spyder-ide_spyder
train
py
465c51026acccc93cfe3ea5cb0b647f8deec62b9
diff --git a/ahoy.js b/ahoy.js index <HASH>..<HASH> 100644 --- a/ahoy.js +++ b/ahoy.js @@ -215,7 +215,7 @@ ahoy.trackClicks = function () { $(document).on("click", "a, button, input[type=submit]", function (e) { var $target = $(e.currentTarget); - properties = eventProperties(e); + var properties = eventProperties(e); properties.text = properties.tag == "input" ? $target.val() : $.trim($target.text()); properties.href = $target.attr("href"); ahoy.track("$click", properties); @@ -224,14 +224,14 @@ ahoy.trackSubmits = function () { $(document).on("submit", "form", function (e) { - properties = eventProperties(e); + var properties = eventProperties(e); ahoy.track("$submit", properties); }); }; ahoy.trackChanges = function () { $(document).on("change", "input, textarea, select", function (e) { - properties = eventProperties(e); + var properties = eventProperties(e); ahoy.track("$change", properties); }); }; @@ -239,6 +239,8 @@ ahoy.trackAll = function() { ahoy.trackView(); ahoy.trackClicks(); + ahoy.trackSubmits(); + ahoy.trackChanges(); }; // push events from queue
Include trackSubmits and trackChanges in trackAll
ankane_ahoy.js
train
js
af893c59c6e671e2bb411c51a589ddb683d7e990
diff --git a/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/config/GrpcServerProperties.java b/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/config/GrpcServerProperties.java index <HASH>..<HASH> 100644 --- a/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/config/GrpcServerProperties.java +++ b/grpc-server-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/server/config/GrpcServerProperties.java @@ -225,6 +225,22 @@ public class GrpcServerProperties { */ private String trustCertCollectionPath = null; + /** + * Specifies the cipher suite. If {@code null} or empty it will use the system's default cipher suite. + * + * @param ciphers Cipher suite consisting of one or more cipher strings separated by colons, commas or spaces. + * @return The cipher suite accepted for secure connections or null. + */ + private String ciphers = null; + + /** + * Specifies the protocols accepted for secure connections. If {@code null} or empty it will use the system's + * default (all supported) protocols. + * + * @return The cipher suites accepted for secure connections or null. + */ + private String protocols = null; + } /**
Adds ciphers and protocols fields to the GrpcServerProperties.Security Class
yidongnan_grpc-spring-boot-starter
train
java
045cacc8baa2b75f0f5e82e6de02226e55e1bd5b
diff --git a/test_path.py b/test_path.py index <HASH>..<HASH> 100644 --- a/test_path.py +++ b/test_path.py @@ -141,6 +141,14 @@ class BasicTestCase(unittest.TestCase): self.assertEqual(nt_ok / 'quux', r'foo\bar\baz\quux') self.assertEqual(posix_ok / 'quux', r'foo/bar/baz/quux') + def testExplicitModuleClasses(self): + """ + multiple calls to path.using_module should produce the same class. + """ + nt_path = path.using_module(ntpath) + self.assert_(nt_path is path.using_module(ntpath)) + self.assertEqual(nt_path.__name__, 'path_ntpath') + class ReturnSelfTestCase(unittest.TestCase): def setUp(self): # Create a temporary directory.
Add test capturing expectation of multiple calls to using_module
jaraco_path.py
train
py
d6fc3da2d1b1ba2e53feaa61e3967ca9c996b437
diff --git a/src/Controller/GroupsController.php b/src/Controller/GroupsController.php index <HASH>..<HASH> 100644 --- a/src/Controller/GroupsController.php +++ b/src/Controller/GroupsController.php @@ -18,7 +18,7 @@ class GroupsController extends AppController */ public function index() { - $this->set('groups', $this->paginate($this->Groups, ['contain' => 'Users', 'limit' => 500])); + $this->set('groups', $this->paginate($this->Groups, ['contain' => 'Users', 'maxLimit' => 500, 'limit' => 500])); $this->set('_serialize', ['groups']); }
override max limit (task #<I>)
QoboLtd_cakephp-groups
train
php
ec3ac9a247ec3132dea3c30ca36cefc217e25441
diff --git a/src/manipulation.js b/src/manipulation.js index <HASH>..<HASH> 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -52,7 +52,7 @@ require( "./event" ); // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
Fix #<I>. Don't throw if text node is appended to table. Close gh-<I>.
jquery_jquery
train
js
8fe980a3d0923cbd12254f217c7afce50732290b
diff --git a/tests/config_test.py b/tests/config_test.py index <HASH>..<HASH> 100644 --- a/tests/config_test.py +++ b/tests/config_test.py @@ -453,6 +453,14 @@ class TestMTimeComparator(object): assert not comparator.has_changed() assert comparator.has_changed() + @mock.patch('staticconf.config.os.path.getmtime', autospec=True, side_effect=[1, 2, 1]) + def test_change_when_newer_time_before_older_time(self, mock_mtime): + comparator = config.MTimeComparator(['./one.file']) + # 1 -> 2 + assert comparator.has_changed() + # 2 -> 1 (can happen as a result of a revert) + assert comparator.has_changed() + class TestMTimeComparatorWithCompareFunc(object):
Added test for the case I'm fixing
dnephin_PyStaticConfiguration
train
py
cb5030b73b73339346ed049a6daeefa94b75ab78
diff --git a/packages/graphics/src/Graphics.js b/packages/graphics/src/Graphics.js index <HASH>..<HASH> 100644 --- a/packages/graphics/src/Graphics.js +++ b/packages/graphics/src/Graphics.js @@ -1202,7 +1202,7 @@ export default class Graphics extends Container if (data.type === SHAPES.POLY) { - data.shape.closed = data.shape.closed || this.filling; + data.shape.closed = data.shape.closed; this.currentPath = data; }
Don't auto-close paths when using Graphics with CanvasRenderer (#<I>) When defining a path, any call to beginFill results in the path being closed, but only for the Canvas renderer, not for the WebGL renderer. This commit removes the check that sets the shape to be closed when a fill is active. This unifies the rendering behavior between Canvas and WebGL.
pixijs_pixi.js
train
js
711900d617c85c3e4d4ea77d757250a3f29ce2ec
diff --git a/elasticsearch_dsl/faceted_search.py b/elasticsearch_dsl/faceted_search.py index <HASH>..<HASH> 100644 --- a/elasticsearch_dsl/faceted_search.py +++ b/elasticsearch_dsl/faceted_search.py @@ -90,6 +90,10 @@ class FacetedSearch(object): return search def aggregate(self, search): + """ + Add aggregations representing the facets selected, including potential + filters. + """ for f, agg in iteritems(self.facets): agg_filter = F('match_all') for field, filter in iteritems(self._filters): @@ -103,6 +107,10 @@ class FacetedSearch(object): ).bucket(f, agg) def filter(self, search): + """ + Add a ``post_filter`` to the search request narrowing the results based + on the facet filters. + """ post_filter = F('match_all') for f in itervalues(self._filters): post_filter &= f
doc strings for some FacetedSearch methods
elastic_elasticsearch-dsl-py
train
py
e9b8b764b9ede7275f47d3420d508033db29de02
diff --git a/pgmpy/inference/Sampling.py b/pgmpy/inference/Sampling.py index <HASH>..<HASH> 100644 --- a/pgmpy/inference/Sampling.py +++ b/pgmpy/inference/Sampling.py @@ -66,7 +66,7 @@ class BayesianModelSampling(Inference): cpd = self.cpds[node] if cpd.evidence: evidence = sampled.values[:, :index].tolist() - weights = np.apply_along_axis(lambda t: cpd.reduce(t, inplace=False).values, 1, evidence) + weights = list(map(lambda t: cpd.reduce(t, inplace=False).values, evidence)) sampled[node] = sample_discrete(cpd.variables[cpd.variable], weights) else: sampled[node] = sample_discrete(cpd.variables[cpd.variable], cpd.values, size)
minor correction (still not the best solution. Can't understand why np.apply_along_axis is not working)
pgmpy_pgmpy
train
py
7fe2ef2f083dd0508d8bfabc0d534aff10e7e704
diff --git a/mwtab/validator.py b/mwtab/validator.py index <HASH>..<HASH> 100755 --- a/mwtab/validator.py +++ b/mwtab/validator.py @@ -154,14 +154,12 @@ def validate_file(mwtabfile, section_schema_mapping=section_schema_mapping, vali :rtype: :py:class:`collections.OrderedDict` """ errors = [] + if validate_samples or validate_factors: errors.extend(_validate_samples_factors(mwtabfile, validate_samples, validate_factors)) if mwtabfile.get("METABOLITES") and validate_features: - try: - errors.extend(_validate_metabolites(mwtabfile)) - except KeyError: - errors.append(KeyError()) + errors.extend(_validate_metabolites(mwtabfile)) if validate_schema: for section_key, section in mwtabfile.items():
Fixes validate_file in validator.py.
MoseleyBioinformaticsLab_mwtab
train
py
acae4afce37c3d5196c1bd36e0126c5a21463a32
diff --git a/js/libtextsecure.js b/js/libtextsecure.js index <HASH>..<HASH> 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -36232,7 +36232,8 @@ var TextSecureServer = (function() { try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} if (options.validateResponse) { if (!validateResponse(result, options.validateResponse)) { - reject(new Error('Invalid response')); + console.log(options.type, url, xhr.status, 'Error'); + reject(HTTPError(xhr.status, result, options.stack)); } } } diff --git a/libtextsecure/api.js b/libtextsecure/api.js index <HASH>..<HASH> 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -51,7 +51,8 @@ var TextSecureServer = (function() { try { result = JSON.parse(xhr.responseText + ''); } catch(e) {} if (options.validateResponse) { if (!validateResponse(result, options.validateResponse)) { - reject(new Error('Invalid response')); + console.log(options.type, url, xhr.status, 'Error'); + reject(HTTPError(xhr.status, result, options.stack)); } } }
Handle invalid responses better Depending on the response code, returning an HTTPError here will let us retry later, if appropriate. // FREEBIE
ForstaLabs_librelay-node
train
js,js
07f61d822d9729118a80692919bfdb236deee10f
diff --git a/packages/api-page-builder/src/plugins/models/pbPage.model.js b/packages/api-page-builder/src/plugins/models/pbPage.model.js index <HASH>..<HASH> 100644 --- a/packages/api-page-builder/src/plugins/models/pbPage.model.js +++ b/packages/api-page-builder/src/plugins/models/pbPage.model.js @@ -92,19 +92,19 @@ export default ({ createBase, context, PbCategory, PbSettings }) => { return new Promise(async resolve => { const settings = await PbSettings.load(); resolve(settings.data.pages.home === this.parent); - }); + }).catch(() => false); }, get isErrorPage() { return new Promise(async resolve => { const settings = await PbSettings.load(); resolve(settings.data.pages.error === this.parent); - }); + }).catch(() => false); }, get isNotFoundPage() { return new Promise(async resolve => { const settings = await PbSettings.load(); resolve(settings.data.pages.notFound === this.parent); - }); + }).catch(() => false); }, get revisions() { return new Promise(async resolve => {
fix: handle errors on missing settings or lack of settings values.
Webiny_webiny-js
train
js
be2359952ebd5672c3b6c4b10e3eed2cf2f62086
diff --git a/src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java b/src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java +++ b/src/test/java/com/aparapi/runtime/MultiplePassesMemoryConsumptionTest.java @@ -50,7 +50,7 @@ public class MultiplePassesMemoryConsumptionTest { } } long extraMemory = baseFree - testFree; - Assert.assertTrue("Too much memory consumed: " + extraMemory, extraMemory < 1000); + Assert.assertTrue("Too much memory consumed: " + extraMemory, extraMemory < 4000000); } }
test: increased the max memory consumption to 4 megs on the test.
Syncleus_aparapi
train
java
a3c6acf1fc2540f24ccf18de32128718f81863c9
diff --git a/multiqc/plots/table.py b/multiqc/plots/table.py index <HASH>..<HASH> 100644 --- a/multiqc/plots/table.py +++ b/multiqc/plots/table.py @@ -129,13 +129,18 @@ def make_table (dt): kname = '{}_{}'.format(header['namespace'], rid) dt.raw_vals[s_name][kname] = val + if header.get('shared_key', None) == 'read_count' and header.get('modify') is None: + header['modify'] = lambda x: x * config.read_count_multiplier + if header.get('shared_key', None) == 'base_count' and header.get('modify') is None: + header['modify'] = lambda x: x * config.base_count_multiplier + if 'modify' in header and callable(header['modify']): val = header['modify'](val) try: dmin = header['dmin'] dmax = header['dmax'] - percentage = ((float(val) - dmin) / (dmax - dmin)) * 100; + percentage = ((float(val) - dmin) / (dmax - dmin)) * 100 percentage = min(percentage, 100) percentage = max(percentage, 0) except (ZeroDivisionError,ValueError):
Automatically modify read or base counts according shared_key set Will make read and base counts in custom content affected by modifiers. Otherwise we can't set lambdas in yamls.
ewels_MultiQC
train
py
839974ca432c70d57e82e9b47334f743e0c20281
diff --git a/src/managers/ApplicationCommandPermissionsManager.js b/src/managers/ApplicationCommandPermissionsManager.js index <HASH>..<HASH> 100644 --- a/src/managers/ApplicationCommandPermissionsManager.js +++ b/src/managers/ApplicationCommandPermissionsManager.js @@ -133,12 +133,13 @@ class ApplicationCommandPermissionsManager extends BaseManager { * @returns {Promise<ApplicationCommandPermissions[]|Collection<Snowflake, ApplicationCommandPermissions[]>>} * @example * // Set the permissions for one command - * client.application.commands.permissions.set({ command: '123456789012345678', permissions: [ - * { - * id: '876543210987654321', - * type: 'USER', - * permission: false, - * }, + * client.application.commands.permissions.set({ guild: '892455839386304532', command: '123456789012345678', + * permissions: [ + * { + * id: '876543210987654321', + * type: 'USER', + * permission: false, + * }, * ]}) * .then(console.log) * .catch(console.error);
docs(ApplicationCommandPermissionsManager): fix example set method (#<I>)
discordjs_discord.js
train
js
90ca502bd47aa29d8f36addf5499a2ac41557737
diff --git a/lib/accounting/booking.rb b/lib/accounting/booking.rb index <HASH>..<HASH> 100644 --- a/lib/accounting/booking.rb +++ b/lib/accounting/booking.rb @@ -10,10 +10,17 @@ module Accounting named_scope :by_account, lambda {|account_id| { :conditions => ["debit_account_id = :account_id OR credit_account_id = :account_id", {:account_id => account_id}] } } do - # Returns array of all booking titles + # Returns array of all booking titles. def titles find(:all, :group => :title).map{|booking| booking.title} end + + # Statistics per booking title. + # + # The statistics are an array of hashes with keys title, count, sum, average. + def statistics + find(:all, :select => "title, count(*) AS count, sum(amount) AS sum, avg(amount) AS avg", :group => :title).map{|stat| stat.attributes} + end end # Returns array of all years we have bookings for
Extend Booking.by_account with statistics method.
huerlisi_has_accounts
train
rb
dda098d66ef06cf26d65ec546e4e2334f332ace9
diff --git a/db/schema.rb b/db/schema.rb index <HASH>..<HASH> 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20130903180641) do +ActiveRecord::Schema.define(version: 20130826211404) do create_table "project_ownerships", force: true do |t| t.integer "user_id" @@ -20,12 +20,6 @@ ActiveRecord::Schema.define(version: 20130903180641) do t.datetime "updated_at" end - create_table "repositories", force: true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "users", force: true do |t| t.string "name", default: "", null: false t.string "email", default: "", null: false
For some reason there was a table repositories in the schema
mezuro_prezento
train
rb
4901e8dfcd72591ff5ac715dbf53fc75bfc90f34
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,6 @@ setup(name='django-mathfilters', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', - 'Programming Language :: Python :: Implementation :: PyPy3', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Software Development :: Libraries :: Python Modules', ],
PyPI doesn't like the PyPy3 classifier
dbrgn_django-mathfilters
train
py
a9478b0ee3a9bbc87638a5669fa3a345b2ef840f
diff --git a/lib/resqued/worker.rb b/lib/resqued/worker.rb index <HASH>..<HASH> 100644 --- a/lib/resqued/worker.rb +++ b/lib/resqued/worker.rb @@ -58,8 +58,14 @@ module Resqued # In case we get a signal before the process is all the way up. [:QUIT, :TERM, :INT].each { |signal| trap(signal) { exit 1 } } $0 = "STARTING RESQUE FOR #{queues.join(',')}" - if Resque.respond_to?("logger=") && ! log_to_stdout? - Resque.logger = Resque.logger.class.new(logging_io) + if ! log_to_stdout? + lf = logging_io + if Resque.respond_to?("logger=") + Resque.logger = Resque.logger.class.new(lf) + else + $stdout.reopen(lf) + lf.close + end end resque_worker = Resque::Worker.new(*queues) resque_worker.log "Starting worker #{resque_worker}"
Try to get all resques to write their logs to our log file.
spraints_resqued
train
rb
2e1796cdf8b31c45fb00d2c3a41d8551db6857cd
diff --git a/pescador/version.py b/pescador/version.py index <HASH>..<HASH> 100644 --- a/pescador/version.py +++ b/pescador/version.py @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- """Version info""" -short_version = '2.0' +short_version = '2.1' version = '2.1.0'
fixed a bug in the short version
pescadores_pescador
train
py
7ee433955536db3fdff2dba9548cd2e88ae8a43c
diff --git a/helper/schema/resource_diff.go b/helper/schema/resource_diff.go index <HASH>..<HASH> 100644 --- a/helper/schema/resource_diff.go +++ b/helper/schema/resource_diff.go @@ -536,11 +536,15 @@ func childAddrOf(child, parent string) bool { // checkKey checks the key to make sure it exists and is computed. func (d *ResourceDiff) checkKey(key, caller string) error { - s, ok := d.schema[key] - if !ok { + keyParts := strings.Split(key, ".") + var schema *Schema + schemaL := addrToSchema(keyParts, d.schema) + if len(schemaL) > 0 { + schema = schemaL[len(schemaL)-1] + } else { return fmt.Errorf("%s: invalid key: %s", caller, key) } - if !s.Computed { + if !schema.Computed { return fmt.Errorf("%s only operates on computed keys - %s is not one", caller, key) } return nil
Allow for nested fields with checkKey on ResourceDiffs. When checking if a ResourceDiff key is valid, allow for keys that exist on sub-blocks. This allows things like diff.Clear to be called on sub-block fields, instead of just on top-level fields.
hashicorp_terraform
train
go
09b6649b471486d58e6a0c80f4f7d12a6a1bb230
diff --git a/responses.go b/responses.go index <HASH>..<HASH> 100644 --- a/responses.go +++ b/responses.go @@ -47,6 +47,16 @@ type RespUserInteractive struct { Error string `json:"error"` } +// HasSingleStageFlow returns true if there exists at least 1 Flow with a single stage of stageName. +func (r RespUserInteractive) HasSingleStageFlow(stageName string) bool { + for _, f := range r.Flows { + if len(f.Stages) == 1 && f.Stages[0] == stageName { + return true + } + } + return false +} + // RespRegister is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register type RespRegister struct { AccessToken string `json:"access_token"`
Add helper function to find single stage flows
matrix-org_gomatrix
train
go
a20a275ef5cae1b38ead1c3191dd96a042eb2070
diff --git a/openstack_dashboard/api/_nova.py b/openstack_dashboard/api/_nova.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/api/_nova.py +++ b/openstack_dashboard/api/_nova.py @@ -84,7 +84,7 @@ class Server(base.APIResourceWrapper): @property def has_extended_attrs(self): - return any(getattr(self, attr) for attr in [ + return any(getattr(self, attr, None) for attr in [ 'OS-EXT-SRV-ATTR:instance_name', 'OS-EXT-SRV-ATTR:host', 'OS-EXT-SRV-ATTR:hostname', 'OS-EXT-SRV-ATTR:kernel_id', 'OS-EXT-SRV-ATTR:ramdisk_id', 'OS-EXT-SRV-ATTR:root_device_name',
Fix AttributeError in the project instance detail view The previous code does not handle a case where admin-specific attributes do not exist. This leads to AttributeError in the project instance detail page as these attributes are not included in the response from nova API. Change-Id: I4c<I>d<I>c<I>dec<I>e<I>c Closes-Bug: #<I>
openstack_horizon
train
py
8b4c8f22cd76ee3c61546395e3ae2c307549dc9f
diff --git a/test/tc_aggs.rb b/test/tc_aggs.rb index <HASH>..<HASH> 100644 --- a/test/tc_aggs.rb +++ b/test/tc_aggs.rb @@ -87,7 +87,7 @@ class PriorityQ q <- out # third stratum - out2 <= (q * minny).matches {|q, m| q} + out2 <= (q * minny).matches.lefts end end @@ -137,7 +137,7 @@ class JoinAgg < RenameGroup bloom do richsal <= emp.group([], max(:sal)) - rich <= (richsal * emp).matches {|r,e| e} + rich <= (richsal * emp).matches.rights argrich <= emp.argmax([], emp.sal) end end
Test combination of matches and lefts/rights.
bloom-lang_bud
train
rb
28995d4083461218e4e02840bd0c794479fe165c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,9 @@ import setuptools from glob import glob +with open("README.md") as f: + readme = f.read() + setuptools.setup( name="jupyter-server-proxy", version='1.5.2', @@ -9,6 +12,8 @@ setuptools.setup( author_email="rylo@berkeley.edu", license="BSD 3-Clause", description="Jupyter server extension to supervise and proxy web services", + long_description=readme, + long_description_content_type="text/markdown", packages=setuptools.find_packages(), install_requires=['notebook', 'simpervisor>=0.2', 'aiohttp'], python_requires='>=3.5',
Package README.md for PyPI
jupyterhub_jupyter-server-proxy
train
py
984096bf1a60a2e5ca296ab86a2a8ec628d48046
diff --git a/source/Core/Config.php b/source/Core/Config.php index <HASH>..<HASH> 100644 --- a/source/Core/Config.php +++ b/source/Core/Config.php @@ -1068,13 +1068,17 @@ class Config extends \OxidEsales\Eshop\Core\Base */ public function getActShopCurrencyObject() { - $cur = $this->getShopCurrency(); - $currencies = $this->getCurrencyArray(); - if (!isset($currencies[$cur])) { - return $this->_oActCurrencyObject = reset($currencies); // reset() returns the first element + if ($this->_oActCurrencyObject === null) { + $cur = $this->getShopCurrency(); + $currencies = $this->getCurrencyArray(); + if (!isset($currencies[$cur])) { + $this->_oActCurrencyObject = reset($currencies); // reset() returns the first element + } else { + $this->_oActCurrencyObject = $currencies[$cur]; + } } - return $this->_oActCurrencyObject = $currencies[$cur]; + return $this->_oActCurrencyObject; } /**
PR-<I> Cache active currency in getter
OXID-eSales_oxideshop_ce
train
php