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
f3bc3596d109362c75fea7de9fb125037923d43a
diff --git a/src/select.js b/src/select.js index <HASH>..<HASH> 100644 --- a/src/select.js +++ b/src/select.js @@ -1180,6 +1180,8 @@ }; function onDocumentClick(e) { + if (!$select.open) return; //Skip it if dropdown is close + var contains = false; if (window.jQuery) { @@ -1191,8 +1193,12 @@ } if (!contains && !$select.clickTriggeredSelect) { - var targetScope = angular.element(e.target).scope(); - $select.close(targetScope && targetScope.$select && targetScope.$select !== $select); // Skip focusser if the target is another select + //Will lose focus only with certain targets + var focusableControls = ['input','button','textarea']; + var targetScope = angular.element(e.target).scope(); //To check if target is other ui-select + var skipFocusser = targetScope && targetScope.$select && targetScope.$select !== $select; //To check if target is other ui-select + if (!skipFocusser) skipFocusser = ~focusableControls.indexOf(e.target.tagName.toLowerCase()); //Check if target is input, button or textarea + $select.close(skipFocusser); scope.$digest(); } $select.clickTriggeredSelect = false;
fix(focus): prevent to focus stealing on focusable targets
angular-ui_ui-select
train
js
b9bd037963da2b3bf412432b0ce843d337cf377c
diff --git a/src/engine/blocks.js b/src/engine/blocks.js index <HASH>..<HASH> 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -91,11 +91,11 @@ Blocks.prototype.getOpcode = function (id) { */ Blocks.prototype.generateBlockListener = function (isFlyout, opt_runtime) { + var instance = this; /** * The actual generated block listener. - * @param {Object} Blockly "block" event + * @param {Object} e Blockly "block" event */ - var instance = this; return function (e) { // Validate event if (typeof e !== 'object') return;
Fixing eslint JSDoc from merge
LLK_scratch-vm
train
js
568c87216a5ccd2482df2889f74860d481452f36
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -42,17 +42,14 @@ function clusterMetrics() { const aggregatorRegistry = new promClient.AggregatorRegistry(); const metricsMiddleware = function(req, res, next) { - if (aggregatorRegistry) { - aggregatorRegistry.clusterMetrics((err, clusterMetrics) => { - if (err) { - console.error(err); - } - res.set('Content-Type', aggregatorRegistry.contentType); - res.send(clusterMetrics); - }); - } else { - return next(); + aggregatorRegistry.clusterMetrics((err, clusterMetrics) => { + if (err) { + console.error(err); + return res.sendStatus(500); } + res.set('Content-Type', aggregatorRegistry.contentType); + res.send(clusterMetrics); + }); }; return metricsMiddleware;
#<I> remove unnecessary check for existance after new, break on error with <I>
jochen-schweizer_express-prom-bundle
train
js
176a42cb3d3c0510c8555d1b51abbda14875ff55
diff --git a/synapse/lib/plugins.py b/synapse/lib/plugins.py index <HASH>..<HASH> 100644 --- a/synapse/lib/plugins.py +++ b/synapse/lib/plugins.py @@ -84,7 +84,7 @@ class Plugins(s_eventbus.EventBus): try: ret.append( func(*args,**kwargs) ) except Exception as e: - logger.exc(e) + logger.exception(e) return ret @@ -112,7 +112,7 @@ class Plugins(s_eventbus.EventBus): try: fini(self) except Exception as e: - logger.exc(e) + logger.exception(e) def _runInitPlug(self, plug): sorc = plug[1].get('%s:source' % self.form) @@ -133,7 +133,7 @@ class Plugins(s_eventbus.EventBus): try: init(self) except Exception as e: - logger.exc(e) + logger.exception(e) self.plugs[iden] = plug self.plugmods[iden] = pmod
fix for logging call to exception()
vertexproject_synapse
train
py
3639bc881c7264ce3eeb5d82aa3603e630b932fb
diff --git a/src/stash.js b/src/stash.js index <HASH>..<HASH> 100644 --- a/src/stash.js +++ b/src/stash.js @@ -88,8 +88,9 @@ Item.prototype.clear = function () { this._load_(); - - this.set(this.value, -1); + this.expiration = -1; + this.locked = false; + this._write_(); }; Item.prototype.lock = function () {
refactor Item#clear
onionskin_onionskin
train
js
c58e102d26e3ec94175a00cad7ca0e7fb8e3e8b0
diff --git a/spaceship/lib/spaceship/client.rb b/spaceship/lib/spaceship/client.rb index <HASH>..<HASH> 100644 --- a/spaceship/lib/spaceship/client.rb +++ b/spaceship/lib/spaceship/client.rb @@ -766,12 +766,16 @@ module Spaceship def log_request(method, url, params, headers = nil, &block) url ||= extract_key_from_block('url', &block) body = extract_key_from_block('body', &block) + body_to_log = '[undefined body]' if body begin body = JSON.parse(body) + # replace password in body if present body['password'] = '***' if body.kind_of?(Hash) && body.key?("password") + body_to_log = body.to_json rescue JSON::ParserError - # no json, no password + # no json, no password to replace + body_to_log = "[non JSON body]" end end params_to_log = Hash(params).dup # to also work with nil @@ -780,7 +784,7 @@ module Spaceship params_to_log = params_to_log.collect do |key, value| "{#{key}: #{value}}" end - logger.info(">> #{method.upcase} #{url}: #{body.to_json} #{params_to_log.join(', ')}") + logger.info(">> #{method.upcase} #{url}: #{body_to_log} #{params_to_log.join(', ')}") end def log_response(method, url, response, headers = nil, &block)
[spaceship] Fix logging of non-JSON request bodies (#<I>) * fix logging of non-JSON request bodies * better non JSON pseudo body
fastlane_fastlane
train
rb
964b9814c84fe09a3714b3b030878f6b72330646
diff --git a/core/finance/financial_metrics.py b/core/finance/financial_metrics.py index <HASH>..<HASH> 100644 --- a/core/finance/financial_metrics.py +++ b/core/finance/financial_metrics.py @@ -25,21 +25,24 @@ class FinancialMetrics(): print('****** Computing Metrics ******') self._init_metrics() - def get_metrics(self, pronac, metrics=[]): - + def get_metrics(self, pronac, metrics=None): if not isinstance(pronac, str): - raise ValueError('PRONAC type must be str (string)') + raise ValueError('PRONAC type must be str') + results = {} - if metrics == []: + if metrics is None: metrics = self.metrics.keys() for metric in metrics: - if metric in self.metrics: + try: print('Getting Metrics for [{}]'.format(metric)) - results[metric] = self.metrics[metric].get_metrics(pronac) - else: + metric_obj = self.metrics[metric] + results[metric] = metric_obj.get_metrics(metric) + except KeyError: raise Exception('metricNotFound: {}'.format(metric)) + except: #TODO: create exception types + pass self._add_easiness_to_metrics(results) return results
Add exception handling for financial metrics get_metrics.
lappis-unb_salic-ml
train
py
d64761c2ee0366df0dc6485b72507a4d1a69fb47
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 @@ -55,7 +55,7 @@ repo_name = u"dtoolcore" # built documents. # # The short X.Y version. -version = u"0.15.0" +version = u"1.0.0" # The full version, including alpha/beta/rc tags. release = version diff --git a/dtoolcore/__init__.py b/dtoolcore/__init__.py index <HASH>..<HASH> 100644 --- a/dtoolcore/__init__.py +++ b/dtoolcore/__init__.py @@ -35,7 +35,7 @@ from dtoolcore.filehasher import ( FileHasher, ) -__version__ = "0.15.0" +__version__ = "1.0.0" # admin/administrative metadata - .dtool/dtool diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup -version = "0.15.0" +version = "1.0.0" url = "https://github.com/JIC-CSB/dtoolcore" readme = open('README.rst').read()
Update version number to <I>
jic-dtool_dtoolcore
train
py,py,py
70d43d0f3383b90350e97d9a5c078e01248d27fd
diff --git a/tests/test_multicolor.py b/tests/test_multicolor.py index <HASH>..<HASH> 100644 --- a/tests/test_multicolor.py +++ b/tests/test_multicolor.py @@ -35,6 +35,9 @@ class MulticolorTestCase(unittest.TestCase): mc1 = Multicolor("red") mc2 = Multicolor("ret") self.assertNotEqual(mc1, mc2) + mc1 = Multicolor("red", "red", "blue") + mc2 = Multicolor("red", "blue") + self.assertNotEqual(mc1, mc2) def test_update(self): mc = Multicolor()
initial take on changing the philosophy on Multicolor class to support duplications
aganezov_bg
train
py
51d15f38d216c3d611953becf273df2d789d77df
diff --git a/client-js/component-chart-editor.js b/client-js/component-chart-editor.js index <HASH>..<HASH> 100644 --- a/client-js/component-chart-editor.js +++ b/client-js/component-chart-editor.js @@ -100,7 +100,7 @@ var ChartEditor = function (opts) { ct.fields[f].$input.val(config.fields[f]); // check the value var inputVal = ct.fields[f].$input.val(); - t // if the value is nothing, then we will force it + // if the value is nothing, then we will force it if (!inputVal) { console.log('in the thing'); console.log(ct.fields[f]);
How'd that t get there?
rickbergfalk_sqlpad
train
js
49e7d2e6076276ef73122a1d6b34e552a68d6a52
diff --git a/php/commands/media.php b/php/commands/media.php index <HASH>..<HASH> 100644 --- a/php/commands/media.php +++ b/php/commands/media.php @@ -24,18 +24,15 @@ class Media_Command extends WP_CLI_Command { * * wp media regenerate --yes * - * @synopsis <attachment-id>... [--yes] + * @synopsis [<attachment-id>...] [--yes] */ function regenerate( $args, $assoc_args = array() ) { global $wpdb; - // If id is given, skip confirm because it is only one file - if( !empty( $args ) ) { - $assoc_args['yes'] = true; + if ( empty( $args ) ) { + WP_CLI::confirm( 'Do you realy want to regenerate all images?', $assoc_args ); } - WP_CLI::confirm('Do you realy want to regenerate all images?', $assoc_args); - $query_args = array( 'post_type' => 'attachment', 'post__in' => $args,
media regenerate: attachment IDs are optional
wp-cli_export-command
train
php
6cfafa33fb37dac2ab5f51031b7277b516b6b45c
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100644 --- a/devices.js +++ b/devices.js @@ -1132,7 +1132,7 @@ const devices = [ }, }, { - zigbeeModel: ['Flex RGBW', 'LIGHTIFY Indoor Flex RGBW'], + zigbeeModel: ['Flex RGBW', 'LIGHTIFY Indoor Flex RGBW', 'LIGHTIFY Flex RGBW'], model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW',
Additional model name for Osram LIGHTIFY Flex RGBW (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
8ddb1124e6104508eb9d960bfb41d217ee16e81d
diff --git a/src/frontend/org/voltdb/utils/CatalogUtil.java b/src/frontend/org/voltdb/utils/CatalogUtil.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/utils/CatalogUtil.java +++ b/src/frontend/org/voltdb/utils/CatalogUtil.java @@ -617,6 +617,10 @@ public abstract class CatalogUtil { int fsyncInterval = 200; int maxTxnsBeforeFsync = Integer.MAX_VALUE; boolean enabled = false; + // enterprise voltdb defaults to CL enabled if not specified in the XML + if (MiscUtils.isPro()) { + enabled = true; + } boolean sync = false; int logSizeMb = 1024; org.voltdb.catalog.CommandLog config = catalog.getClusters().get("cluster").getLogconfig().get("log");
ENG-<I>: Make command logging enabled by default in enterprise version.
VoltDB_voltdb
train
java
8bd804e1c03b9aab340ab14bdddf91c6ee3cfcac
diff --git a/lib/server.js b/lib/server.js index <HASH>..<HASH> 100644 --- a/lib/server.js +++ b/lib/server.js @@ -7,6 +7,12 @@ var linter = require('./linter'); var token = crypto.randomBytes(8).toString('hex'); +var openConnections = [] + +function forceClose(con) { + con.write('Server is stopping...\n# exit 1'); + con.end(); +} var server = net.createServer({ allowHalfOpen: true @@ -16,6 +22,7 @@ var server = net.createServer({ data += chunk; }); con.on('end', function () { + openConnections = openConnections.filter(c => c !== con); if (!data) { con.end(); return; @@ -29,6 +36,7 @@ var server = net.createServer({ if (data === 'stop') { con.end(); server.close(); + openConnections.forEach(forceClose); return; } var cwd, args, text; @@ -56,6 +64,10 @@ var server = net.createServer({ }); }); +server.on('connection', function (con) { + openConnections = openConnections.concat([con]) +}) + server.listen(0, '127.0.0.1', function () { var port = server.address().port; portfile.write(port, token);
Force all open connections to close when the server is stopped (#<I>) This is a less graceful approach to stopping the server, but it allows for editors to hold a connection open to make for an even faster response time.
mantoni_eslint_d.js
train
js
ff3bd5bd598762f9351a87043ff9281021b79f9d
diff --git a/simulator/src/main/java/com/hazelcast/simulator/protocol/processors/WorkerOperationProcessor.java b/simulator/src/main/java/com/hazelcast/simulator/protocol/processors/WorkerOperationProcessor.java index <HASH>..<HASH> 100644 --- a/simulator/src/main/java/com/hazelcast/simulator/protocol/processors/WorkerOperationProcessor.java +++ b/simulator/src/main/java/com/hazelcast/simulator/protocol/processors/WorkerOperationProcessor.java @@ -94,7 +94,6 @@ public class WorkerOperationProcessor extends AbstractOperationProcessor { processCreateTest((CreateTestOperation) operation); break; case KILL_WORKER: - new Thread() { public void run() { try { @@ -105,7 +104,7 @@ public class WorkerOperationProcessor extends AbstractOperationProcessor { LOGGER.fatal("Killing worker"); System.exit(1); } - }.run(); + }.start(); break; default: return UNSUPPORTED_OPERATION_ON_THIS_PROCESSOR;
Fixd bug in WorkerOperationProcessor; kill thread isn't started; but run.. doh
hazelcast_hazelcast-simulator
train
java
95546d68c5eec4576b0d5dcb741175ee39692333
diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -121,6 +121,9 @@ class SimpleObjectHydrator extends AbstractHydrator continue; } + // Check if value is null before conversion (because some types convert null to something else) + $valueIsNull = $value === null; + // Convert field to a valid PHP value if (isset($cacheKeyInfo['type'])) { $type = $cacheKeyInfo['type']; @@ -130,7 +133,7 @@ class SimpleObjectHydrator extends AbstractHydrator $fieldName = $cacheKeyInfo['fieldName']; // Prevent overwrite in case of inherit classes using same property name (See AbstractHydrator) - if ( ! isset($data[$fieldName]) || $value !== null) { + if ( ! isset($data[$fieldName]) || ! $valueIsNull) { $data[$fieldName] = $value; } }
Fix hydration in a joined inheritance with simple array or json array SimpleArrayType and JsonArrayType convert NULL value to an empty array, which fails the null check that is used to prevent overwrite Fixes issue #<I>
doctrine_orm
train
php
8e80a35e8d2cdb410c3727333e8518cadc08783b
diff --git a/src/AutoComplete/AutoComplete.js b/src/AutoComplete/AutoComplete.js index <HASH>..<HASH> 100644 --- a/src/AutoComplete/AutoComplete.js +++ b/src/AutoComplete/AutoComplete.js @@ -453,7 +453,7 @@ class AutoComplete extends Component { autoWidth={false} disableAutoFocus={focusTextField} onEscKeyDown={this.handleEscKeyDown} - initiallyKeyboardFocused={false} + initiallyKeyboardFocused={true} onItemTouchTap={this.handleItemTouchTap} onMouseDown={this.handleMouseDown} style={Object.assign(styles.menu, menuStyle)}
[AutoComplete] Fix first item selection on keyboard focus
mui-org_material-ui
train
js
40dc63695d06cb4ad7451ca5fa570b4e89a171cf
diff --git a/code/services/SAMLConfiguration.php b/code/services/SAMLConfiguration.php index <HASH>..<HASH> 100644 --- a/code/services/SAMLConfiguration.php +++ b/code/services/SAMLConfiguration.php @@ -96,7 +96,7 @@ class SAMLConfiguration extends Object { // Set true or don't present thi parameter and you will get an AuthContext 'exact' 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport' // Set an array with the possible auth context values: array ('urn:oasis:names:tc:SAML:2.0:ac:classes:Password', 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509'), 'requestedAuthnContext' => array( - // 'urn:federation:authentication:windows', + 'urn:federation:authentication:windows', 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password', 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509', ),
Allow window ADFS automatic login for windows This will make the login and redirect to ADFS transparent for the user. It requires that the ADFS site is added to the internet explorers zone for Intranet sites and that the Windows Autologin. Example of setup can be found here <URL>
silverstripe_silverstripe-activedirectory
train
php
e082e609c78057ba4a953bfcc1a05dcf02701870
diff --git a/src/Workers/FileWorker.php b/src/Workers/FileWorker.php index <HASH>..<HASH> 100644 --- a/src/Workers/FileWorker.php +++ b/src/Workers/FileWorker.php @@ -52,10 +52,8 @@ class FileWorker extends AbstractWorker { $vars = array_merge($oldVars, $vars); $this->setVars($vars); $templateFilename = Directories::concat($this->currentWorkDir, $filename); - if(!file_exists($templateFilename)) { - if(file_exists($templateFilename . $this->fileExt)) { - $templateFilename .= $this->fileExt; - } + if(is_file($templateFilename . $this->fileExt)) { + $templateFilename .= $this->fileExt; } call_user_func(function () use ($templateFilename) { require $templateFilename;
Fixed a bug were a directory named like a required resource has the same name.
rkrx_php-view
train
php
830d337cc3b4cc7983f2f7bd4a497bbb403f7221
diff --git a/app/addons/databases/base.js b/app/addons/databases/base.js index <HASH>..<HASH> 100644 --- a/app/addons/databases/base.js +++ b/app/addons/databases/base.js @@ -36,8 +36,14 @@ function partitionUrlComponent(partitionKey) { function checkPartitionedDatabaseFeature () { // Checks if the CouchDB server supports Partitioned Databases return get(Helpers.getServerUrl("/")).then((couchdb) => { - //TODO: needs to be updated with the correct feature name - return couchdb.features && couchdb.features.includes('partitions'); + if (couchdb.features && couchdb.features.includes('partitions')) { + return true; + } + // Check if it's enabled as an experimental feature + if (couchdb.feature_flags && couchdb.feature_flags.includes('partitions')) { + return true; + } + return false; }).catch(() => { return false; });
Update check for partitioned dbs (#<I>)
apache_couchdb-fauxton
train
js
ad196a3084cb47cf60ce9a1b5a4c51423d95835e
diff --git a/src/MetaSyntactical/Io/Reader.php b/src/MetaSyntactical/Io/Reader.php index <HASH>..<HASH> 100644 --- a/src/MetaSyntactical/Io/Reader.php +++ b/src/MetaSyntactical/Io/Reader.php @@ -525,7 +525,11 @@ class Reader { if (PHP_INT_SIZE < 8) { // @codeCoverageIgnoreStart - list(, $hi, $lo) = unpack('S*', $this->read(4)) + array(0, 0, 0); + if ($this->isLittleEndian()) { + list(, $lo, $hi) = unpack('S*', $this->read(4)); + } else { + list(, $hi, $lo) = unpack('S*', $this->read(4)); + } return $hi * (0xffff+1) + $lo; // eq $hi << 16 | $lo // @codeCoverageIgnoreEnd } else {
Added distinction for little endian machines
MetaSyntactical_Io
train
php
68a7c5b463b4714f023fbd02b39951edc1415d70
diff --git a/pyparsing/helpers.py b/pyparsing/helpers.py index <HASH>..<HASH> 100644 --- a/pyparsing/helpers.py +++ b/pyparsing/helpers.py @@ -664,13 +664,21 @@ class OpAssoc(Enum): RIGHT = 2 -InfixNotationOperatorSpec = Tuple[ - Union[ - ParserElement, str, Tuple[Union[ParserElement, str], Union[ParserElement, str]] +InfixNotationOperatorArgType = Union[ + ParserElement, str, Tuple[Union[ParserElement, str], Union[ParserElement, str]] +] +InfixNotationOperatorSpec = Union[ + Tuple[ + InfixNotationOperatorArgType, + int, + OpAssoc, + OptionalType[ParseAction], + ], + Tuple[ + InfixNotationOperatorArgType, + int, + OpAssoc, ], - int, - OpAssoc, - OptionalType[ParseAction], ]
Better type matching for infix_notation operator specs
pyparsing_pyparsing
train
py
b148a904d8de88718ace087e5eb89d44b75f272f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,11 @@ setup( license='BSD', url='http://github.com/praekelt/django-recaptcha', packages=find_packages(), + install_requires = [ + 'django', + ], tests_require=[ - 'django-setuptest>=0.1', + 'django-setuptest>=0.2.1', ], test_suite="setuptest.setuptest.SetupTestSuite", include_package_data=True,
Up setuptest version so tests pass with Django <I>
praekelt_django-recaptcha
train
py
55a3d8b04c9e25326d8c860333aa66799b31bc23
diff --git a/hairball/plugins/__init__.py b/hairball/plugins/__init__.py index <HASH>..<HASH> 100644 --- a/hairball/plugins/__init__.py +++ b/hairball/plugins/__init__.py @@ -19,8 +19,8 @@ class PluginBase(object): data.append('<div class="float scratchblocks">{0}</div>' .format(script.to_block_plugin())) heading = PluginBase.SUBHEADING.format(heading) - return ('{0}\n<div class="clear"></div>\n' - '<div>{1}</div>').format(heading, ''.join(data)) + return ('<div>\n{0}\n<div>{1}</div>\n<div class="clear"></div>\n' + '</div>\n').format(heading, ''.join(data)) def __init__(self, name, batch): self.name = name
Fix formatting issue in to_scratch_blocks.
ucsb-cs-education_hairball
train
py
7a9a4ff40ba11cfbd0b24548c301457393cf0673
diff --git a/mtcnn/mtcnn.py b/mtcnn/mtcnn.py index <HASH>..<HASH> 100644 --- a/mtcnn/mtcnn.py +++ b/mtcnn/mtcnn.py @@ -304,9 +304,12 @@ class MTCNN(object): bounding_boxes = [] for bounding_box, keypoints in zip(total_boxes, points.T): + x = max(0, int(bounding_box[0])) + y = max(0, int(bounding_box[1])) + width = int(bounding_box[2] - x) + height = int(bounding_box[3] - y) bounding_boxes.append({ - 'box': [max(0, int(bounding_box[0])), max(0, int(bounding_box[1])), - int(bounding_box[2] - bounding_box[0]), int(bounding_box[3] - bounding_box[1])], + 'box': [x, y, width, height], 'confidence': bounding_box[-1], 'keypoints': { 'left_eye': (int(keypoints[0]), int(keypoints[5])), @@ -315,8 +318,7 @@ class MTCNN(object): 'mouth_left': (int(keypoints[3]), int(keypoints[8])), 'mouth_right': (int(keypoints[4]), int(keypoints[9])), } - } - ) + }) return bounding_boxes
Fixes width and height bug from negative image coordinates. Fixes #<I>
ipazc_mtcnn
train
py
a83b67475a6b8230b858e6f877b5e2293c682d4b
diff --git a/gorank.go b/gorank.go index <HASH>..<HASH> 100644 --- a/gorank.go +++ b/gorank.go @@ -33,7 +33,7 @@ func sendEdges(filename string, f func(uint32, uint32)) { // Adds the ReadByte method requird by io.ByteReader interface wrappedByteReader := bufio.NewReader(file) edge := uint64(0) - edgeStore := make([]uint64, 16384, 16384) + edgeStore := make([]uint64, 0, 524288) for { // Read the variable integer and undo the delta encoding by adding the previous edge rawEdge, err := binary.ReadUvarint(wrappedByteReader)
Increase edge store size (~5MB x # of workers) and fix minor bug Minor bug: the array was created with capacity for N edges (good) but also with N edges initialized (bad) as that creates N edges that link from node 0 to node 0. This error would only occur if the graph used had less than N edges. Fixed by initializing with zero items.
Smerity_gopagerank
train
go
6ca3ab96c5319c8d01dfb09612879ff577e577e6
diff --git a/assets/js/kirki-branding.js b/assets/js/kirki-branding.js index <HASH>..<HASH> 100644 --- a/assets/js/kirki-branding.js +++ b/assets/js/kirki-branding.js @@ -3,6 +3,6 @@ jQuery(document).ready(function($) { "use strict"; jQuery( "div#customize-info .preview-notice" ).replaceWith( '<img src="' + kirkiBranding.logoImage + '">' ); } if ( '' != kirkiBranding.description ) { - jQuery( "div#customize-info .accordion-section-content" ).replaceWith( '<div class="accordion-section-content"><div class="theme-description">' + kirkiBranding.description + '</div></div>' ); + jQuery( "div#customize-info > .customize-panel-description" ).replaceWith( '<div class="customize-panel-description">' + kirkiBranding.description + '</div>' ); } });
markup in the customizer has changed
aristath_kirki
train
js
cd3b54b81c2cf8d954df240b831b8127f7579134
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 @@ -5,10 +5,12 @@ require_relative "support/components_helper" require "gds_api/test_helpers/content_store" require "faker" -require "i18n/coverage" -require "i18n/coverage/printers/file_printer" -I18n::Coverage.config.printer = I18n::Coverage::Printers::FilePrinter -I18n::Coverage.start +if ENV["USE_I18N_COVERAGE"] + require "i18n/coverage" + require "i18n/coverage/printers/file_printer" + I18n::Coverage.config.printer = I18n::Coverage::Printers::FilePrinter + I18n::Coverage.start +end WebMock.disable_net_connect!(allow_localhost: true)
Wrap i<I>n-coverage in a conditional Some tests inexplicably fail when i<I>n key coverage is included. So we should only run the coverage when we want to check the i<I>n coverage - not as part of a standard test run.
alphagov_govuk_publishing_components
train
rb
e6e1f607193a4b2ef7082d734434fd519866ebcb
diff --git a/graphtools/base.py b/graphtools/base.py index <HASH>..<HASH> 100644 --- a/graphtools/base.py +++ b/graphtools/base.py @@ -716,6 +716,8 @@ class BaseGraph(with_metaclass(abc.ABCMeta, Base)): "Got {}".format(distance)) P = graph_shortest_path(D, method=method) + # symmetrize for numerical error + P = (P + P.T) / 2 # sklearn returns 0 if no path exists P[np.where(P == 0)] = np.inf # diagonal should actually be zero
symmetrize graph distance
KrishnaswamyLab_graphtools
train
py
b4a7ad7a0c98202650968af9137b5d6ca156a934
diff --git a/lib/cursor.js b/lib/cursor.js index <HASH>..<HASH> 100644 --- a/lib/cursor.js +++ b/lib/cursor.js @@ -1020,8 +1020,7 @@ Cursor.prototype.transformStream = function(options) { Cursor.prototype.explain = function(callback) { if (this.operation) { this.operation.options.explain = true; - executeOperation(this.s.topology, this.operation, callback); - return; + return executeOperation(this.s.topology, this.operation, callback); } this.s.cmd.explain = true;
fix: return `executeOperation` for explain, if promise is desired
mongodb_node-mongodb-native
train
js
b6770d0c3c841aa83402e6f3d94e2bd17367f9fb
diff --git a/library/src/main/java/hotchemi/android/rate/DialogOptions.java b/library/src/main/java/hotchemi/android/rate/DialogOptions.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/hotchemi/android/rate/DialogOptions.java +++ b/library/src/main/java/hotchemi/android/rate/DialogOptions.java @@ -28,8 +28,7 @@ final class DialogOptions { private OnClickButtonListener listener; - public boolean shouldShowNeutralButton() - { + public boolean shouldShowNeutralButton() { return showNeutralButton; }
OMG, I'm starting to hate Android Studio auto-indent: Opening brackets shouldn't have new spaces
hotchemi_Android-Rate
train
java
4482301882cb9afc314d632c125fff466e929676
diff --git a/internal/uidriver/glfw/ui_darwin.go b/internal/uidriver/glfw/ui_darwin.go index <HASH>..<HASH> 100644 --- a/internal/uidriver/glfw/ui_darwin.go +++ b/internal/uidriver/glfw/ui_darwin.go @@ -42,9 +42,12 @@ package glfw // } // } // -// static bool isNativeFullscreen() { -// return [[NSApplication sharedApplication] currentSystemPresentationOptions] & -// NSApplicationPresentationFullScreen; +// static bool isNativeFullscreen(uintptr_t windowPtr) { +// if (!windowPtr) { +// return false; +// } +// NSWindow* window = (NSWindow*)windowPtr; +// return (window.styleMask & NSWindowStyleMaskFullScreen) != 0; // } // // static void setNativeCursor(int cursorID) { @@ -118,7 +121,7 @@ func (u *UserInterface) nativeWindow() uintptr { } func (u *UserInterface) isNativeFullscreen() bool { - return bool(C.isNativeFullscreen()) + return bool(C.isNativeFullscreen(C.uintptr_t(u.window.GetCocoaWindow()))) } func (u *UserInterface) setNativeCursor(shape driver.CursorShape) {
internal/uidriver/glfw: Better implementation of isNativeFullscreen The old implementation can return false when the window is not active.
hajimehoshi_ebiten
train
go
a1d1b5a2f621ba50d986d97b96ff32f33e9a1106
diff --git a/src/rollup.js b/src/rollup.js index <HASH>..<HASH> 100644 --- a/src/rollup.js +++ b/src/rollup.js @@ -54,7 +54,7 @@ module.exports = function linaria({ result.code += `\nimport ${JSON.stringify(filename)};\n`; /* eslint-disable-next-line consistent-return */ - return result.code; + return { code: result.code, map: result.sourceMap }; }, }; };
feat: add a sourcemap to rollup output (#<I>)
callstack_linaria
train
js
67060004ee2547f5a074e0155023585b03b1f50c
diff --git a/src/main/java/org/pinae/timon/util/ConfigMap.java b/src/main/java/org/pinae/timon/util/ConfigMap.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/pinae/timon/util/ConfigMap.java +++ b/src/main/java/org/pinae/timon/util/ConfigMap.java @@ -93,7 +93,7 @@ public class ConfigMap<K, V> extends HashMap<K, V> { } } - public static ConfigMap<String, String> getConfig(String filename) throws IOException { + public static ConfigMap<String, String> loadFromFile(String filename) throws IOException { ConfigMap<String, String> configMap = new ConfigMap<String, String>();
Change getConfig to loadFromFile
PinaeOS_timon
train
java
893e5792b70626409d0962e9d82597ff911e3593
diff --git a/bin/cli.js b/bin/cli.js index <HASH>..<HASH> 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -1,6 +1,7 @@ #!/usr/bin/env node 'use strict'; +const process = require('process'); const program = require('commander'); const rc = require('rc')('madge'); const debug = require('debug')('madge'); @@ -30,6 +31,10 @@ if (!program.args.length) { process.exit(1); } +if (!program.color) { + process.env.DEBUG_COLORS = false; +} + if (rc.config) { debug('using runtime configuration from %s', rc.config); }
Disable colors in debug output when running with —-no-color
pahen_madge
train
js
c2429dfbd3544c9f0e4b921561510f56372a3c68
diff --git a/cumulusci/core/keychain/BaseProjectKeychain.py b/cumulusci/core/keychain/BaseProjectKeychain.py index <HASH>..<HASH> 100644 --- a/cumulusci/core/keychain/BaseProjectKeychain.py +++ b/cumulusci/core/keychain/BaseProjectKeychain.py @@ -265,3 +265,7 @@ class BaseProjectKeychain(BaseConfig): services = list(self.services.keys()) services.sort() return services + + @property + def project_cache_dir(self): + return self.project_config.universal_config_obj.cumulusci_config_dir
Add project_cache_dir for caching in contexts without an EncryptedFileProjectKeychain
SFDO-Tooling_CumulusCI
train
py
0c96fa8b7cd4a7f22bceacf12c85d5f68770db98
diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index <HASH>..<HASH> 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1240,8 +1240,6 @@ class Client(Methods, BaseClient): break f.write(chunk) - f.flush() - os.fsync(f.fileno()) offset += limit @@ -1324,8 +1322,6 @@ class Client(Methods, BaseClient): assert h.hash == sha256(cdn_chunk).digest(), "Invalid CDN hash part {}".format(i) f.write(decrypted_chunk) - f.flush() - os.fsync(f.fileno()) offset += limit
Don't flush each chunk. Let python/os deal with it
pyrogram_pyrogram
train
py
ceea32e6963d4b752a567fc7033fce3bfdbb4b23
diff --git a/js/src/example.js b/js/src/example.js index <HASH>..<HASH> 100644 --- a/js/src/example.js +++ b/js/src/example.js @@ -58,18 +58,20 @@ function render_function() { container_name = container_name + '_alt'; } + // widget-subarea appears to be limited to a width of ~960px in nbviewer + d3.select(this.el) .append('div') .classed('clustergrammer_widget', true) .attr('id', container_name) - .style('width', '1000px') + .style('width', '975px') .style('height', '800px'); var inst_network_string = this.model.get('network'); inst_network = JSON.parse(inst_network_string); - var about_string = "<a href='https://github.com/MaayanLab/clustergrammer-widget' target='_blank' ><img src=" + url + " style='width:120px; margin-left:-10px'></a>"; + var about_string = "<a href='https://github.com/MaayanLab/clustergrammer-widget' target='_blank' ><img src=" + url + " style='width:127px; margin-left:-10px'></a>"; var container_id = '#'+container_name; // define arguments object
reduced width slightly to look better in nbviewer
ismms-himc_clustergrammer2
train
js
274d0c9e0ed1347484277214e00ffeec1ce46ee1
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js @@ -361,6 +361,9 @@ define([ }, parameters: findParameter, callback: function(data) { + if (lib.node("replaceCompareDiv").classList.contains("replaceCompareDivVisible")) { //$NON-NLS-1$ //$NON-NLS-0$ + return false; //TODO is there a better way of preventing the command from being executed? + } if (self._localSearcher) { var searchString = ""; var parsedParam = null; @@ -386,6 +389,7 @@ define([ } self._localSearcher.show({findString: searchString, replaceString: parsedParam.replaceWith}); self._localSearcher.find(true, tempOptions); + self.commandService.closeParameterCollector(); //TODO is there a better way of hiding the parameter collector? } else { self._localSearcher.show({findString: searchString}); }
Bug <I> - Replace Global Search Page (search.html) with Inline Search in Edit Page (edit.html) - Preventing "Find in file" (Ctrl+F) popup from showing up when user navigates to different files from within search results or when the Replace mode's inline compare preview is visible
eclipse_orion.client
train
js
5c628a12bbe4779aba5e052ceb1fcd31cfa42714
diff --git a/acceptance/tests/provider/package/pip.rb b/acceptance/tests/provider/package/pip.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/provider/package/pip.rb +++ b/acceptance/tests/provider/package/pip.rb @@ -11,8 +11,13 @@ test_name "pip provider should install, use install_options with latest, and uni agents.each do |agent| step "Setup: Install EPEL Repository, Python and Pip" do package_present(agent, 'epel-release') - package_present(agent, 'python') - package_present(agent, 'python-pip') + if agent.platform =~ /el-8/ + package_present(agent, 'python2') + package_present(agent, 'python2-pip') + else + package_present(agent, 'python') + package_present(agent, 'python-pip') + end end step "Install a pip package" do
(maint) fix pip tests on centos-8
puppetlabs_puppet
train
rb
35674a06531a2538a0c990f0ca1e6e1dd5c297b1
diff --git a/agentarchives/archivesspace/client.py b/agentarchives/archivesspace/client.py index <HASH>..<HASH> 100644 --- a/agentarchives/archivesspace/client.py +++ b/agentarchives/archivesspace/client.py @@ -311,10 +311,11 @@ class ArchivesSpaceClient(object): if not dates: try: start_date = record['dates'][0]['begin'] - except IndexError: + except (IndexError, ValueError): return '' end_date = record['dates'][0].get('end') return self._format_dates(start_date, end_date) + return dates def _fetch_date_expression_from_record(self, record): if not record.get('dates'):
ArchivesSpace: Dates falls back to date expression If a date expression is found, return that instead of returning None. This is consistent with previous behaviour.
artefactual-labs_agentarchives
train
py
91a32b71d50f70b131e2d6ae748d765852cf1e07
diff --git a/indra/db/util.py b/indra/db/util.py index <HASH>..<HASH> 100644 --- a/indra/db/util.py +++ b/indra/db/util.py @@ -193,14 +193,17 @@ def insert_agents(db, prefix, stmts_wo_agents=None, **kwargs): if stmts_wo_agents is None: stmts_wo_agents, num_stmts = \ get_statements_without_agents(db, prefix, verbose=verbose) + else: + num_stmts = None if verbose: - try: - num_stmts = len(stmts_wo_agents) - except TypeError: - logger.info("Could not get length from type: %s. Turning off " - "verbose messaging." % type(stmts_wo_agents)) - verbose = False + if num_stmts is None: + try: + num_stmts = len(stmts_wo_agents) + except TypeError: + logger.info("Could not get length from type: %s. Turning off " + "verbose messaging." % type(stmts_wo_agents)) + verbose = False # Construct the agent records logger.info("Building agent data for insert...")
Tweak verbose setting some more.
sorgerlab_indra
train
py
a9bc8ea565143deae635e9644e144897e7598259
diff --git a/core/src/test/java/com/linecorp/armeria/server/healthcheck/ScheduledHealthCheckerTest.java b/core/src/test/java/com/linecorp/armeria/server/healthcheck/ScheduledHealthCheckerTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/com/linecorp/armeria/server/healthcheck/ScheduledHealthCheckerTest.java +++ b/core/src/test/java/com/linecorp/armeria/server/healthcheck/ScheduledHealthCheckerTest.java @@ -153,7 +153,7 @@ class ScheduledHealthCheckerTest { assertThat(WebClient.of(uri).get("/hc").aggregate().join().status()).isSameAs(HttpStatus.OK); health.set(false); - await().atMost(Duration.ofSeconds(1)) + await().atMost(Duration.ofSeconds(5)) .untilAsserted( () -> assertThat(WebClient.of(uri).get("/hc").aggregate().join().status()) .isSameAs(HttpStatus.SERVICE_UNAVAILABLE));
Fix test failures in `ScheduledHealthCheckerTest.awareUnhealthy()` (#<I>)
line_armeria
train
java
c303f750c7de556e032327cc6a3bcefe53a562f3
diff --git a/hgtools/managers.py b/hgtools/managers.py index <HASH>..<HASH> 100755 --- a/hgtools/managers.py +++ b/hgtools/managers.py @@ -189,7 +189,10 @@ class LibraryManager(HGRepoManager): return version not in self.OLD_VERSIONS def _get_repo(self): - return hg.repository(ui.ui(), path=self.location) + class quiet_ui(ui.ui): + def write_err(self, *args, **kwargs): + pass + return hg.repository(quiet_ui(), path=self.location) @property def repo(self):
Suppress errors from mercurial API
jaraco_hgtools
train
py
317644f52e1fc25c46aae66e3f789b7fb519fc34
diff --git a/app/Http/Controllers/Posts/PageController.php b/app/Http/Controllers/Posts/PageController.php index <HASH>..<HASH> 100644 --- a/app/Http/Controllers/Posts/PageController.php +++ b/app/Http/Controllers/Posts/PageController.php @@ -36,7 +36,7 @@ class PageController extends Controller { $page = Page::where('slug', $slug)->first(); - if(!is_null($page)){ + if (!is_null($page)) { $page = new Page(); }
Apply fixes from StyleCI (#<I>) [ci skip] [skip ci]
orchidsoftware_platform
train
php
fd0f6e15415cf9c75c2c71d15ab324da8b5beb30
diff --git a/superset/connectors/base/models.py b/superset/connectors/base/models.py index <HASH>..<HASH> 100644 --- a/superset/connectors/base/models.py +++ b/superset/connectors/base/models.py @@ -410,7 +410,7 @@ class BaseDatasource( fkmany: List[Column], fkmany_class: Type[Union["BaseColumn", "BaseMetric"]], key_attr: str, - ) -> List[Column]: # pylint: disable=too-many-locals + ) -> List[Column]: """Update ORM one-to-many list from object list Used for syncing metrics and columns using the same code"""
fix: removed disabled lint rule `too-many-locals` in connectors/base/models.py (#<I>)
apache_incubator-superset
train
py
57ea998fb35af07ce6249abd69711aa47f8c44d1
diff --git a/xmlrpc2/serializer.py b/xmlrpc2/serializer.py index <HASH>..<HASH> 100644 --- a/xmlrpc2/serializer.py +++ b/xmlrpc2/serializer.py @@ -2,6 +2,7 @@ from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals +import collections import base64 import datetime @@ -59,6 +60,27 @@ class Serializer(object): elif isinstance(data, bytes): item = etree.Element("base64") item.text = base64.b64encode(data) + elif isinstance(data, collections.Mapping): + item = etree.Element("struct") + + for k, v in data.items(): + member = etree.Element("member") + + name = etree.Element("name") + name.text = k + + member.append(name) + member.append(self.to_xml(v)) + + item.append(member) + elif isinstance(data, collections.Iterable): + item = etree.Element("array") + array_data = etree.Element("data") + + for x in data: + array_data.append(self.to_xml(x)) + + item.append(array_data) else: raise ValueError("Unable to serialize {cls} objects, unknown type".format(cls=data.__class__.__name__))
add iterables and mappings to xml serialization
dstufft_xmlrpc2
train
py
fbccdf9a96fe952ec3f99a2fb16afbc25c568ce5
diff --git a/actionpack/lib/action_controller/caching/pages.rb b/actionpack/lib/action_controller/caching/pages.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/caching/pages.rb +++ b/actionpack/lib/action_controller/caching/pages.rb @@ -99,7 +99,7 @@ module ActionController #:nodoc: # caches_page :index # # # cache the index action except for JSON requests - # caches_page :index, :if => Proc.new { |c| !c.request.format.json? } + # caches_page :index, :if => Proc.new { !request.format.json? } # # # don't gzip images # caches_page :image, :gzip => false
Proc objects for caches_page no need controller object
rails_rails
train
rb
f23627e7c29b5c88f3a055c8cc149c9e1decbbe2
diff --git a/raiden/network/resolver/client.py b/raiden/network/resolver/client.py index <HASH>..<HASH> 100644 --- a/raiden/network/resolver/client.py +++ b/raiden/network/resolver/client.py @@ -58,8 +58,7 @@ def reveal_secret_with_resolver( if secret_request_event.expiration < current_state.block_number: log.debug( - "Stopped using resolver, transfer expired", - resolver_endpoint=resolver_endpoint + "Stopped using resolver, transfer expired", resolver_endpoint=resolver_endpoint ) return False @@ -80,8 +79,7 @@ def reveal_secret_with_resolver( gevent.sleep(5) log.debug( - "Got secret from resolver, dispatching secret reveal", - resolver_endpoint=resolver_endpoint + "Got secret from resolver, dispatching secret reveal", resolver_endpoint=resolver_endpoint ) state_change = ReceiveSecretReveal( sender=secret_request_event.recipient,
Fix resolver lint issues
raiden-network_raiden
train
py
01c135ff5b0201a493ebb55f1306f9bc02b12f06
diff --git a/src/Aura/Router/Route.php b/src/Aura/Router/Route.php index <HASH>..<HASH> 100644 --- a/src/Aura/Router/Route.php +++ b/src/Aura/Router/Route.php @@ -358,7 +358,7 @@ class Route throw new Exception($message); } else { $keys[] = "{:$name}"; - $vals[] = "(?<$name>" . substr($subpattern, 1); + $vals[] = "(?P<$name>" . substr($subpattern, 1); } } $this->regex = str_replace($keys, $vals, $this->regex);
use 'old' PCRE syntax for backwards compat. Thanks, dhaaker.
auraphp_Aura.Router
train
php
61d25338bcebd953f4de703e887d3ccf625bb114
diff --git a/holoviews/ipython/parser.py b/holoviews/ipython/parser.py index <HASH>..<HASH> 100644 --- a/holoviews/ipython/parser.py +++ b/holoviews/ipython/parser.py @@ -70,7 +70,8 @@ class Parser(object): elements =list(items) # Assume anything before ) or } can be joined with commas # (e.g tuples with spaces in them) - joiner=',' if any(')' or '}' in el for el in elements) else '' + joiner=',' if any(((')' in el) or ('}' in el)) + for el in elements) else '' grouped[-1] += joiner + joiner.join(elements) for keyword in grouped:
Fixed logical error in Parser.todict method
pyviz_holoviews
train
py
2fe43115fbcf3a5d0888f4db0db78ef5262207f8
diff --git a/xibless/gen.py b/xibless/gen.py index <HASH>..<HASH> 100644 --- a/xibless/gen.py +++ b/xibless/gen.py @@ -132,13 +132,13 @@ def generate(modulePath, dest, runmode=False, localizationTable=None): tmpl.funcsig = funcsig tmpl.contents = '\n'.join(codePieces) with open(dest, 'wt') as fp: - fp.write(tmpl.render()) + fp.write(tidyCode(tmpl.render())) if dest_header: tmpl = CodeTemplate(HEADER_TMPL) tmpl.funcsig = funcsig tmpl.ownerimport = ownerimport with open(dest_header, 'wt') as fp: - fp.write(tmpl.render()) + fp.write(tidyCode(tmpl.render())) def runUI(modulePath): @@ -152,3 +152,16 @@ def runUI(modulePath): p = Popen(cmd, shell=True) p.wait() +def tidyCode(code): + lines = (l.strip() for l in code.split('\n')) + result = [] + level = 0 + for line in lines: + if not line: + if result and result[-1] != '': + result.append('') + continue + level -= line.count('}') + result.append((' ' * (level * 4)) + line) + level += line.count('{') + return '\n'.join(result)
Format the auto-generated code to look a bit better (makes it easier to debug).
hsoft_xibless
train
py
04c39ad184bb7dacaaf0dfc12357991897d14743
diff --git a/index/scorch/builder.go b/index/scorch/builder.go index <HASH>..<HASH> 100644 --- a/index/scorch/builder.go +++ b/index/scorch/builder.go @@ -107,8 +107,9 @@ func (o *Builder) parseConfig(config map[string]interface{}) (err error) { segPlugin, err := chooseSegmentPlugin(forcedSegmentType, uint32(forcedSegmentVersion)) if err != nil { - o.segPlugin = segPlugin + return err } + o.segPlugin = segPlugin } return nil
allow segment type/version override to work (#<I>) logic was reversed, preventing correct configuration from actually switching the segment plugin used
blevesearch_bleve
train
go
099cfd76940d0a933ba739aa50508b2db1d95b38
diff --git a/resources/views/roles/edit-add.blade.php b/resources/views/roles/edit-add.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/roles/edit-add.blade.php +++ b/resources/views/roles/edit-add.blade.php @@ -60,7 +60,7 @@ <?php $role_permissions = (isset($dataTypeContent)) ? $dataTypeContent->permissions->pluck('key')->toArray() : []; ?> - @foreach(LaravelAdminPanel\Models\Permission::all()->groupBy('table_name') as $table => $permission) + @foreach(LaravelAdminPanel\Models\Permission::all()->groupBy('slug') as $table => $permission) <li> <input type="checkbox" id="{{$table}}" class="permission-group"> <label for="{{$table}}"><strong>{{title_case(str_replace('_',' ', $table))}}</strong></label>
replace table_name to slug in resources/views/roles/edit-add.blade.php
laraveladminpanel_admin
train
php
ee6de9e9ca964550f889c98c71b99847a488ebd6
diff --git a/footer.php b/footer.php index <HASH>..<HASH> 100644 --- a/footer.php +++ b/footer.php @@ -7,14 +7,15 @@ * @package understrap */ - $the_theme = wp_get_theme(); +$the_theme = wp_get_theme(); +$container = get_theme_mod('understrap_container_type'); ?> <?php get_sidebar('footerfull'); ?> <div class="wrapper" id="wrapper-footer"> - <div class="<?php echo $container?>" id="content"> + <div class="<?php echo $container; ?>" id="content"> <div class="row"> diff --git a/header.php b/header.php index <HASH>..<HASH> 100755 --- a/header.php +++ b/header.php @@ -8,6 +8,8 @@ */ ?> +<?php $container = get_theme_mod('understrap_container_type'); ?> + <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> @@ -33,7 +35,7 @@ <nav class="navbar navbar-dark bg-inverse site-navigation" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement"> - <div class="<?php echo $container?>" id="content"> + <div class="<?php echo $container; ?>" id="content"> <div class="navbar-header">
fix undefined variable issue in header and footer
understrap_understrap
train
php,php
f4137b4cd55486dd0a0ef5f3ffb31c1eae07a768
diff --git a/src/clusterpost-server/checkConfiguration.js b/src/clusterpost-server/checkConfiguration.js index <HASH>..<HASH> 100644 --- a/src/clusterpost-server/checkConfiguration.js +++ b/src/clusterpost-server/checkConfiguration.js @@ -46,8 +46,3 @@ try{ fs.writeFileSync(path.join(installdir, 'index.js'), index); } - - -var pack = fs.readFileSync(path.join(cwd, "package.json")); -fs.writeFileSync(path.join(installdir, 'package.json'), pack); -
BUG: Do not copy the package.json file when installing clusterpost-server as external package
juanprietob_clusterpost
train
js
8b67c877f7351da8c754a3f2d0c2ff8456732fb1
diff --git a/src/PDO/Database.php b/src/PDO/Database.php index <HASH>..<HASH> 100644 --- a/src/PDO/Database.php +++ b/src/PDO/Database.php @@ -28,14 +28,22 @@ class Database extends \PDO */ public function __construct($dsn, $usr = null, $pwd = null, array $options = array()) { - $options = array( + $options = $this->getDefaultOptions() + $options; + + @parent::__construct($dsn, $usr, $pwd, $options); + } + + /** + * @return array + */ + protected function getDefaultOptions() + { + return array( \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, \PDO::ATTR_EMULATE_PREPARES => false, \PDO::ATTR_STATEMENT_CLASS => array('Slim\\PDO\\Statement', array($this)), - ) + $options; - - @parent::__construct($dsn, $usr, $pwd, $options); + ); } /**
Provided a way to opt-opt of options being passed to PDO.
FaaPz_PDO
train
php
6d841dd1d1f3a34a80ef412912146da66bb97799
diff --git a/src/main/java/com/mysema/codegen/ScalaWriter.java b/src/main/java/com/mysema/codegen/ScalaWriter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/mysema/codegen/ScalaWriter.java +++ b/src/main/java/com/mysema/codegen/ScalaWriter.java @@ -44,6 +44,8 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter> { private static final String DEF = "def "; + private static final String OVERRIDE_DEF = "override " + DEF; + private static final String EXTENDS = " extends "; private static final String WITH = " with "; @@ -313,6 +315,17 @@ public class ScalaWriter extends AbstractCodeWriter<ScalaWriter> { return beginMethod(DEF, returnType, methodName, args); } + public <T> ScalaWriter beginOverridePublicMethod(Type returnType, String methodName, + Collection<T> parameters, Function<T, Parameter> transformer) + throws IOException { + return beginMethod(OVERRIDE_DEF, returnType, methodName, transform(parameters, transformer)); + } + + public ScalaWriter beginOverridePublicMethod(Type returnType, String methodName, Parameter... args) + throws IOException { + return beginMethod(OVERRIDE_DEF, returnType, methodName, args); + } + @Override public <T> ScalaWriter beginStaticMethod(Type returnType, String methodName, Collection<T> parameters, Function<T, Parameter> transformer) throws IOException {
Add method beginOverridePublicMethod for ScalaWriter
querydsl_codegen
train
java
f08f0651d20de27720b9ea444075e7b3267eee31
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,6 +15,7 @@ setup( author_email='[email protected]', url='https://github.com/carljm/django-model-utils/', packages=find_packages(), + install_requires=['django>=1.4.2'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment',
Add minimum required Django version to setup
jazzband_django-model-utils
train
py
0c57410938f7d2c85c963aff9f68252bfff7b77f
diff --git a/EventListener/DynamicFormListener.php b/EventListener/DynamicFormListener.php index <HASH>..<HASH> 100644 --- a/EventListener/DynamicFormListener.php +++ b/EventListener/DynamicFormListener.php @@ -23,13 +23,20 @@ final class DynamicFormListener implements EventSubscriberInterface public static function getSubscribedEvents() { return [ + FormEvents::PRE_SET_DATA => 'onPreSetData', FormEvents::POST_SUBMIT => 'onPostSubmit', ]; } + public function onPreSetData(FormEvent $event): void + { + ($this->callable)($event->getData(), $event->getForm()); + } + public function onPostSubmit(FormEvent $event): void { $form = $event->getForm(); - ($this->callable)($form->getData(), $form, $event->getData()); + + ($this->callable)($form->getData(), $form); } }
[Reform] Added PRE_SET_DATA handler to DynamicFormListener.
ruvents_ruwork-reform
train
php
0aa3b16c908bce4b1688b25af55be2a07c5481a1
diff --git a/mod/book/backup/moodle1/lib.php b/mod/book/backup/moodle1/lib.php index <HASH>..<HASH> 100644 --- a/mod/book/backup/moodle1/lib.php +++ b/mod/book/backup/moodle1/lib.php @@ -121,12 +121,12 @@ class moodle1_mod_book_handler extends moodle1_mod_handler { * @param array $data */ public function process_book_chapters($data) { - $this->write_xml('chapter', $data, array('/chapter/id')); - - // convert chapter files + // Convert chapter files. $this->fileman->filearea = 'chapter'; $this->fileman->itemid = $data['id']; $data['content'] = moodle1_converter::migrate_referenced_files($data['content'], $this->fileman); + + $this->write_xml('chapter', $data, array('/chapter/id')); } /**
MDL-<I> mod_book: <I> backup restore convertis files to book area
moodle_moodle
train
php
22fcedb89fc1c4d5bc5461ad625872c0340cf998
diff --git a/Finder/TransformedFinder.php b/Finder/TransformedFinder.php index <HASH>..<HASH> 100644 --- a/Finder/TransformedFinder.php +++ b/Finder/TransformedFinder.php @@ -26,7 +26,14 @@ use Pagerfanta\Pagerfanta; */ class TransformedFinder implements PaginatedFinderInterface { + /** + * @var SearchableInterface + */ protected $searchable; + + /** + * @var ElasticaToModelTransformerInterface + */ protected $transformer; /** @@ -49,6 +56,13 @@ class TransformedFinder implements PaginatedFinderInterface return $this->transformer->transform($results); } + /** + * @param $query + * @param null|int $limit + * @param array $options + * + * @return array + */ public function findHybrid($query, $limit = null, $options = array()) { $results = $this->search($query, $limit, $options);
Add missing doc in TransformedFinder
FriendsOfSymfony_FOSElasticaBundle
train
php
13f57702d467add630d6be3188aef4203d37efe2
diff --git a/context_test.go b/context_test.go index <HASH>..<HASH> 100644 --- a/context_test.go +++ b/context_test.go @@ -410,15 +410,15 @@ func TestContextNegotiationFormatCustum(t *testing.T) { func TestContextIsAborted(t *testing.T) { c, _, _ := createTestContext() - assert.False(t, c.IsAborted()) c.Abort() - assert.True(t, c.IsAborted()) c.Next() + assert.True(t, c.IsAborted()) + c.Next() assert.True(t, c.IsAborted()) }
Adds more c.Next() just to be sure
gin-gonic_gin
train
go
c1d3666ca61a13e25618cdf43d0e67318f740778
diff --git a/version/version_base.go b/version/version_base.go index <HASH>..<HASH> 100644 --- a/version/version_base.go +++ b/version/version_base.go @@ -7,10 +7,10 @@ package version // adding new versions and pick a name that will follow "version_base.go". func init() { // The main version number that is being run at the moment. - Version = "0.7.3" + Version = "0.7.4" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. - VersionPrerelease = "" + VersionPrerelease = "dev" }
Puts tree in <I> dev mode.
hashicorp_consul
train
go
219fbc8525c81f63e9cc34d301f89d173f913ef8
diff --git a/lib/fog/vsphere/requests/compute/list_vm_volumes.rb b/lib/fog/vsphere/requests/compute/list_vm_volumes.rb index <HASH>..<HASH> 100644 --- a/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +++ b/lib/fog/vsphere/requests/compute/list_vm_volumes.rb @@ -31,7 +31,7 @@ module Fog get_vm_ref(vm_id).disks.map do |vol| { :id => vol.backing.uuid, - :thin => vol.backing.thinProvisioned, + :thin => (vol.backing.thinProvisioned rescue(nil)), :mode => vol.backing.diskMode, :filename => vol.backing.fileName, :datastore => (vol.backing.datastore.name rescue(nil)),
Fix exception if listing raw vSphere volumes (thinProvisioned method missing)
fog_fog
train
rb
d066c11a8604261f511533e2c1c1f382a6743d55
diff --git a/common/src/org/immutables/common/collect/ImmutableOrdinalSet.java b/common/src/org/immutables/common/collect/ImmutableOrdinalSet.java index <HASH>..<HASH> 100644 --- a/common/src/org/immutables/common/collect/ImmutableOrdinalSet.java +++ b/common/src/org/immutables/common/collect/ImmutableOrdinalSet.java @@ -399,9 +399,6 @@ public abstract class ImmutableOrdinalSet<E extends OrdinalValue<E>> for (int i = 0; i < vector.length; i++) { long v = vector[i]; word: for (int ordinal = i << POWER_OF_TWO_WORD_BITS; v > 0;) { - if (v == -9223372036854775808L) { - System.out.println("BOrd " + ordinal); - } int zeroes = Long.numberOfTrailingZeros(v); if (zeroes == BITS_PER_WORD) { break word;
removed scissors left inside a body during surgery
immutables_immutables
train
java
48dfeb2a95025c096b20a9020df60367478303ec
diff --git a/templates/refinery/edge.rb b/templates/refinery/edge.rb index <HASH>..<HASH> 100644 --- a/templates/refinery/edge.rb +++ b/templates/refinery/edge.rb @@ -26,11 +26,6 @@ end run 'bundle install' rake 'db:create' generate 'refinery:cms --fresh-installation' -generate 'refinery:core' -generate 'refinery:pages' -generate 'refinery:images' -generate 'refinery:resources' -generate 'refinery:i18n' rake 'railties:install:migrations db:migrate'
Generating with a --fresh-installation flag negates the need to run the other generators.
refinery_refinerycms
train
rb
f88299f11a23a7c07bd0e64f26708f874a660851
diff --git a/src/devTools.js b/src/devTools.js index <HASH>..<HASH> 100644 --- a/src/devTools.js +++ b/src/devTools.js @@ -120,7 +120,7 @@ function handleChange(state, liftedState, maxAge) { } export default function devTools(options) { - const maxAge = options.maxAge || 30; + const maxAge = options && options.maxAge || 30; return (next) => { return (reducer, initialState) => { store = configureStore(
Fix "undefined is not an object (evaluating options.maxAge)"
zalmoxisus_remote-redux-devtools
train
js
0b4f7c927b48ba5e370a9de76da324d4770b14db
diff --git a/src/DebugBar/Resources/debugbar.js b/src/DebugBar/Resources/debugbar.js index <HASH>..<HASH> 100644 --- a/src/DebugBar/Resources/debugbar.js +++ b/src/DebugBar/Resources/debugbar.js @@ -461,6 +461,8 @@ if (typeof(PhpDebugBar) == 'undefined') { // dragging of resize handle var dragging = false; + var min_h = 40; + var max_h = $(window).height() - this.$header.height() - 10; this.$resizehdle.on('mousedown', function(e) { var orig_h = $body.height(), pos_y = e.pageY; dragging = true; @@ -468,6 +470,9 @@ if (typeof(PhpDebugBar) == 'undefined') { $body.parents().on('mousemove', function(e) { if (dragging) { var h = orig_h + (pos_y - e.pageY); + // Respect the min/max values + h = Math.min(h, max_h); + h = Math.max(h, min_h); $body.css('height', h); localStorage.setItem('phpdebugbar-height', h); self.recomputeBottomOffset();
Restrict resizing to visible screen This makes sure that the debugbar isn't dragged to high, so the handler is unreachable, and not too low to make sure it's always clear that it's just resized, not broken/collapsed.
maximebf_php-debugbar
train
js
7e227f7f24112b1be150a3cb82606829b6bf683e
diff --git a/graylog2-server/src/main/java/org/graylog2/indexer/searches/timeranges/RelativeRange.java b/graylog2-server/src/main/java/org/graylog2/indexer/searches/timeranges/RelativeRange.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/indexer/searches/timeranges/RelativeRange.java +++ b/graylog2-server/src/main/java/org/graylog2/indexer/searches/timeranges/RelativeRange.java @@ -29,8 +29,6 @@ import java.util.Map; public class RelativeRange implements TimeRange { private final int range; - private final DateTime to; - public RelativeRange(int range) throws InvalidRangeParametersException { if (range < 0) { @@ -38,7 +36,6 @@ public class RelativeRange implements TimeRange { } this.range = range; - this.to = DateTime.now(); } @Override @@ -68,6 +65,6 @@ public class RelativeRange implements TimeRange { @Override public DateTime getTo() { - return to; + return DateTime.now(); } }
Possible fix for #<I> - Relative ranges no longer store to date to be reusable
Graylog2_graylog2-server
train
java
ff1171419c1a8a31821fb9ddf2c5699882e3033b
diff --git a/Command/ReindexCommand.php b/Command/ReindexCommand.php index <HASH>..<HASH> 100644 --- a/Command/ReindexCommand.php +++ b/Command/ReindexCommand.php @@ -11,9 +11,9 @@ namespace Sulu\Bundle\ArticleBundle\Command; -use PHPCR\Query\QueryResultInterface; use Sulu\Bundle\ArticleBundle\Document\Index\IndexerInterface; use Sulu\Bundle\DocumentManagerBundle\Bridge\PropertyEncoder; +use Sulu\Component\DocumentManager\Collection\QueryResultCollection; use Sulu\Component\DocumentManager\DocumentManagerInterface; use Sulu\Component\HttpKernel\SuluKernel; use Sulu\Component\Webspace\Manager\WebspaceManagerInterface; @@ -213,7 +213,7 @@ class ReindexCommand extends Command /** * Query for documents with given locale. */ - protected function getDocuments(string $locale): QueryResultInterface + protected function getDocuments(string $locale): QueryResultCollection { $sql2 = sprintf( 'SELECT * FROM [nt:unstructured] AS a WHERE [jcr:mixinTypes] = "sulu:article" AND [%s] IS NOT NULL',
Fix return type in ReindexCommand (fixes #<I>) (#<I>)
sulu_SuluArticleBundle
train
php
9011ecc6d2386d02d1e9fd22c4d6f5012023571e
diff --git a/src/components/BootstrapWeb.php b/src/components/BootstrapWeb.php index <HASH>..<HASH> 100644 --- a/src/components/BootstrapWeb.php +++ b/src/components/BootstrapWeb.php @@ -19,6 +19,9 @@ class BootstrapWeb extends \luya\base\Bootstrap private $_adminMenus = []; + /** + * @todo see if the api already exstis, api urls must be unique (otherwise the auth process will not work anymore) + */ public function beforeRun() { foreach ($this->getModules() as $item) { @@ -32,9 +35,9 @@ class BootstrapWeb extends \luya\base\Bootstrap if (($apis = $this->getReflectionPropertyValue($item['reflection'], 'apis')) !== false) { foreach ($apis as $alias => $class) { $this->_apis[] = [ - 'moduleId' => $item['id'], - 'class' => $class, - 'alias' => $alias, + 'moduleId' => $item['id'], + 'class' => $class, + 'alias' => $alias, ]; } }
added todo make unique apis
luyadev_luya
train
php
fbafd760a9fcb81f1bc663ef1a5e67b47a120e47
diff --git a/src/editor/Editor.js b/src/editor/Editor.js index <HASH>..<HASH> 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -386,11 +386,6 @@ define(function (require, exports, module) { // before indenting so that embedded whitespace such as indents are not // orphaned to the right of the electric char being inserted this.setCursorPos(cursor.line, this.document.getLine(cursor.line).length); - } else { - // if the line has non-whitespace to the right of the electric char we - // intend to insert, then set the cursor at the beginning of the non- - // whitespace and indent to there. - this.setCursorPos(cursor.line, nonWS); } // Need to do the auto-indent on a timeout to ensure // the keypress is handled before auto-indenting.
removed else condition based on review comments
adobe_brackets
train
js
40ff478691d0032bb1ad17e62c98e0f4d63e38fb
diff --git a/qa_tests/disagg_unittest.py b/qa_tests/disagg_unittest.py index <HASH>..<HASH> 100644 --- a/qa_tests/disagg_unittest.py +++ b/qa_tests/disagg_unittest.py @@ -108,6 +108,9 @@ class DisaggCalcQATestCase(unittest.TestCase, helpers.ConfigTestMixin): self.assertTrue(os.path.exists(h5_file)) self._verify_h5(h5_file, job_record.oq_params) + # clean up the job hdf5 results dir: + shutil.rmtree(H5_OUTPUT_DIR % job_record.id) + def _verify_xml_output(self, expected, actual, job_id): """Read both `expected` and `actual` file and check for exact equality. """
disagg qa test now cleans up some lingering test files
gem_oq-engine
train
py
6445ba8e3c9aac71be105569148c47c6f5fc4907
diff --git a/xmlWorksheet.go b/xmlWorksheet.go index <HASH>..<HASH> 100644 --- a/xmlWorksheet.go +++ b/xmlWorksheet.go @@ -18,13 +18,11 @@ const ( ) // xlsxWorksheetRels contains xlsxWorksheetRelation -// TODO comment type xlsxWorksheetRels struct { XMLName xml.Name `xml:"http://schemas.openxmlformats.org/package/2006/relationships Relationships"` Relationships []xlsxWorksheetRelation `xml:"Relationship"` } -//TODO comment type xlsxWorksheetRelation struct { Id string `xml:"Id,attr"` Type RelationshipType `xml:"Type,attr"`
Update xmlWorksheet.go
tealeg_xlsx
train
go
3318e7ad4cd8e9d30ecd1a409fc0eb4b206f522a
diff --git a/Library/MethodCall.php b/Library/MethodCall.php index <HASH>..<HASH> 100644 --- a/Library/MethodCall.php +++ b/Library/MethodCall.php @@ -67,11 +67,11 @@ class MethodCall extends Call } else { $classTypes = $caller->getClassTypes(); foreach ($classTypes as $classType) { - if ($compiler->isClass($classType) || $compiler->isInterface($classType) || $compiler->isBundledClass($classType) || $compiler->isBundledInterface($classType)) { - if ($compiler->isInterface($classType)) { - continue; - } + if ($compiler->isInterface($classType)) { + continue; + } + if ($compiler->isClass($classType) || $compiler->isBundledClass($classType) || $compiler->isBundledInterface($classType)) { if ($compiler->isClass($classType)) { $classDefinition = $compiler->getClassDefinition($classType); } else {
[Refactoring] MethodCall - remove dublicated check. - Check in check :)
phalcon_zephir
train
php
ae50348969c6873e0a7fbff6460731709d72d1a5
diff --git a/faq-bundle/src/Resources/contao/modules/ModuleFaqList.php b/faq-bundle/src/Resources/contao/modules/ModuleFaqList.php index <HASH>..<HASH> 100644 --- a/faq-bundle/src/Resources/contao/modules/ModuleFaqList.php +++ b/faq-bundle/src/Resources/contao/modules/ModuleFaqList.php @@ -155,7 +155,7 @@ class ModuleFaqList extends \Module if ($jumpTo > 0 && ($objTarget = \PageModel::findByPk($jumpTo)) !== null) { - /** @var \PageModel $objTarget */ + /** @var PageModel $objTarget */ $this->arrTargets[$jumpTo] = ampersand($objTarget->getFrontendUrl(\Config::get('useAutoItem') ? '/%s' : '/items/%s')); } }
[Faq] Do not type hint against aliased classes.
contao_contao
train
php
a6183c0f83f8e8d2c50a6cb86989c002a48ed3ad
diff --git a/examples/php/symbols.php b/examples/php/symbols.php index <HASH>..<HASH> 100644 --- a/examples/php/symbols.php +++ b/examples/php/symbols.php @@ -53,7 +53,7 @@ if (count ($argv) > 1) { if ($exchange_found) { - dump ('Instantiating', green ($id), 'exchange exchange'); + dump ('Instantiating', green ($id), 'exchange'); // instantiate the exchange by id $exchange = '\\ccxt\\' . $id;
examples/php/symbols.php minor edit
ccxt_ccxt
train
php
04db1c3e4de7db2de36f0c9ab49cc5400b985552
diff --git a/src/ol/source/urltilesource.js b/src/ol/source/urltilesource.js index <HASH>..<HASH> 100644 --- a/src/ol/source/urltilesource.js +++ b/src/ol/source/urltilesource.js @@ -182,9 +182,9 @@ ol.source.UrlTile.prototype.setTileUrlFunction = function(tileUrlFunction) { * @api stable */ ol.source.UrlTile.prototype.setUrl = function(url) { - this.urls = [url]; - var urls = ol.TileUrlFunction.expandUrl(url); - this.setTileUrlFunction(this.fixedTileUrlFunction || + var urls = this.urls = ol.TileUrlFunction.expandUrl(url); + this.setTileUrlFunction(this.fixedTileUrlFunction ? + this.fixedTileUrlFunction.bind(this) : ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid)); };
Expand urls before setting this.urls
openlayers_openlayers
train
js
f8120c44c504f51a8a4f30024330b2c248817256
diff --git a/examples/glyphs/colors.py b/examples/glyphs/colors.py index <HASH>..<HASH> 100644 --- a/examples/glyphs/colors.py +++ b/examples/glyphs/colors.py @@ -176,7 +176,7 @@ plot.add_layout(xaxis_below, 'below') plot.add_layout(CategoricalAxis(), 'left') url = "http://www.colors.commutercreative.com/@names/" -tooltips = """Click here to go to:<br /><a href="{url}">{url}</a>""".format(url=url) +tooltips = """Click the color to go to:<br /><a href="{url}">{url}</a>""".format(url=url) tap = TapTool(plot=plot, renderers=[rect_renderer], action=OpenURL(url=url)) hover = HoverTool(plot=plot, renderers=[rect_renderer], tooltips=tooltips)
Improve tooltip wording in glyphs/colors
bokeh_bokeh
train
py
fd566fd131848db634196958b5cc113577059df0
diff --git a/tests/TestCase/Database/Schema/PostgresSchemaTest.php b/tests/TestCase/Database/Schema/PostgresSchemaTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Database/Schema/PostgresSchemaTest.php +++ b/tests/TestCase/Database/Schema/PostgresSchemaTest.php @@ -972,6 +972,7 @@ SQL; 'comment' => 'This is the title', ]) ->addColumn('body', ['type' => 'text']) + ->addColumn('data', ['type' => 'json']) ->addColumn('created', 'datetime') ->addConstraint('primary', [ 'type' => 'primary', @@ -987,6 +988,7 @@ CREATE TABLE "schema_articles" ( "id" SERIAL, "title" VARCHAR NOT NULL, "body" TEXT, +"data" JSON, "created" TIMESTAMP, PRIMARY KEY ("id") )
Added test for generating table with json column in postgres
cakephp_cakephp
train
php
8460db331f122c4c87ecd770c6d3c32ae4ea44f8
diff --git a/lib/cli/src/frameworks/vue3/Page.stories.js b/lib/cli/src/frameworks/vue3/Page.stories.js index <HASH>..<HASH> 100644 --- a/lib/cli/src/frameworks/vue3/Page.stories.js +++ b/lib/cli/src/frameworks/vue3/Page.stories.js @@ -24,4 +24,6 @@ LoggedIn.args = { }; export const LoggedOut = Template.bind({}); -LoggedOut.args = {}; +LoggedOut.args = { + ...HeaderStories.LoggedOut.args +};
Update lib/cli/src/frameworks/vue3/Page.stories.js
storybooks_storybook
train
js
5bb0608c1765603c2828c90fd584c995125aa92b
diff --git a/markerclustererplus/src/markerclusterer.js b/markerclustererplus/src/markerclusterer.js index <HASH>..<HASH> 100644 --- a/markerclustererplus/src/markerclusterer.js +++ b/markerclustererplus/src/markerclusterer.js @@ -3,7 +3,7 @@ /** * @name MarkerClustererPlus for Google Maps V3 - * @version 2.0.15 [October 18, 2012] + * @version 2.0.16 [October 18, 2012] * @author Gary Little * @fileoverview * The library creates and manages per-zoom-level clusters for large amounts of markers.
Incremented version number for impending point release.
googlemaps_v3-utility-library
train
js
9b61bd09e59e792524fa75d46cbf6cc3b9737449
diff --git a/lib/social_snippet/repository/drivers/git_driver.rb b/lib/social_snippet/repository/drivers/git_driver.rb index <HASH>..<HASH> 100644 --- a/lib/social_snippet/repository/drivers/git_driver.rb +++ b/lib/social_snippet/repository/drivers/git_driver.rb @@ -92,4 +92,6 @@ module SocialSnippet::Repository::Drivers end # GitDriver + ::SocialSnippet::Repository::DriverFactory.add_driver GitDriver + end # SocialSnippet
git_driver: add self to the factory
social-snippet_social-snippet
train
rb
db88a2044996bad2eb12368ee7e79c73eb82ea33
diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index <HASH>..<HASH> 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -276,6 +276,16 @@ class AsyncTCPReqChannel(salt.transport.client.ReqChannel): kwargs.get("crypt", "aes"), # TODO: use the same channel for crypt ) + @classmethod + def force_close_all_instances(cls): + """ + Will force close all instances + :return: None + """ + for weak_dict in list(cls.instance_map.values()): + for instance in list(weak_dict.values()): + instance.close() + # has to remain empty for singletons, since __init__ will *always* be called def __init__(self, opts, **kwargs): pass
Add `close_all_instances` classmethod to the TCP transport singleton. Just like we have for the ZeroMQ transport
saltstack_salt
train
py
c9b66e1a85a35b3dc6fe9e8b7ea5f7b079520759
diff --git a/gandi/cli/core/utils.py b/gandi/cli/core/utils.py index <HASH>..<HASH> 100644 --- a/gandi/cli/core/utils.py +++ b/gandi/cli/core/utils.py @@ -73,6 +73,11 @@ def output_image(gandi, image, datacenters, output_keys, justify=14): output_line(gandi, 'datacenter', dc_name, justify) +def output_sshkey(gandi, sshkey, output_keys, justify=12): + '''Helper to output an ssh key information ''' + output_generic(gandi, sshkey, output_keys, justify) + + def check_domain_available(ctx, domain): """ Helper to check if a domain is available """ gandi = ctx.obj
Add the output helper for sshkey.
Gandi_gandi.cli
train
py
a859ddd4fe30695c4eef33f4824e05bf1a822849
diff --git a/src/extend.js b/src/extend.js index <HASH>..<HASH> 100644 --- a/src/extend.js +++ b/src/extend.js @@ -109,7 +109,7 @@ export default function (Vue) { function getChoiceIndex (choice, choicesLength) { choice = Math.abs(choice) - if (choicesLength === 2) return getOldChoiceIndexFixed(choice) + if (choicesLength === 2) { return getOldChoiceIndexFixed(choice) } return choice ? Math.min(choice, 2) : 0 } diff --git a/src/override.js b/src/override.js index <HASH>..<HASH> 100644 --- a/src/override.js +++ b/src/override.js @@ -17,11 +17,9 @@ export default function (Vue, langVM, version) { if (!this.$parent) { // root this.$lang = langVM - this._langUnwatch = this.$lang.$watch('$data', (a, b) => { + this._langUnwatch = this.$lang.$watch('$data', (val, old) => { update(this) - }, { - deep: true - }) + }, { deep: true }) } }
:shirt: refactor: update layouting
kazupon_vue-i18n
train
js,js
7b1f2c6d84db624ad8d9a10c35601bfcda825a7c
diff --git a/lib/veritas/relation/operation/order/direction.rb b/lib/veritas/relation/operation/order/direction.rb index <HASH>..<HASH> 100644 --- a/lib/veritas/relation/operation/order/direction.rb +++ b/lib/veritas/relation/operation/order/direction.rb @@ -12,6 +12,7 @@ module Veritas end def call(left, right) + attribute = self.attribute self.class.eval(left[attribute], right[attribute]) end
Silence reek warning for multiple uses of the same method
dkubb_axiom
train
rb
c11da994ae3502ecd1dfcf156122fde37783cce6
diff --git a/styleguide.config.js b/styleguide.config.js index <HASH>..<HASH> 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -74,17 +74,18 @@ module.exports = { </script>` } }, - dangerouslyUpdateWebpackConfig(webpackConfig, env) { - webpackConfig.node = { + webpackConfig: { + node: { fs: "empty", child_process: "empty", net: "empty", canvas: "empty" - }; - webpackConfig.resolve.extensions = [".ts", ".tsx", ".js", ".jsx", ".json"]; - webpackConfig.externals = ["canvas"]; - webpackConfig.module = { - ...webpackConfig.module, + }, + resolve: { + extensions: [".ts", ".tsx", ".js", ".jsx", ".json"] + }, + externals: ["canvas"], + module: { rules: [ { test: /\.tsx?$/, @@ -100,7 +101,6 @@ module.exports = { } } ] - }; - return webpackConfig; + } } };
migrate to webpackConfig key in styleguide config
nteract_nteract
train
js
f218a7614a54a62d5d66edf501d98f41ea54840a
diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java index <HASH>..<HASH> 100644 --- a/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java +++ b/aeron-cluster/src/main/java/io/aeron/cluster/SequencerAgent.java @@ -1033,10 +1033,6 @@ class SequencerAgent implements Agent, ServiceControlListener, MemberStatusListe } } } - else - { - electLeader(); - } if (memberId == votedForMemberId) { @@ -1048,11 +1044,6 @@ class SequencerAgent implements Agent, ServiceControlListener, MemberStatusListe } } - private void electLeader() - { - throw new IllegalStateException("elections not yet supported"); - } - private void requestVotes( final ClusterMember[] clusterMembers, final long lastLogPosition, final long lastTermPosition) {
[Java] Remove method in prep for putting in new election instance.
real-logic_aeron
train
java
80411d1ed3545702fc9d6588080b61ee082b3ea7
diff --git a/src/part.js b/src/part.js index <HASH>..<HASH> 100644 --- a/src/part.js +++ b/src/part.js @@ -202,8 +202,9 @@ Part.prototype.parseStep = function(step) { */ Part.prototype.applyInterval = function(values, step) { if (step) { + var minVal = values[0] values = values.filter(function(value) { - return value % step === 0; + return value % step === minVal; }); } return values; @@ -320,7 +321,7 @@ Part.prototype.isFullInterval = function(step) { var min = this.min(); var max = this.max(); var haveAllValues = this.values.length === (max - min) / step + 1; - if (min - step < unit.min && max + step > unit.max && haveAllValues) { + if (min === unit.min && max === unit.max && haveAllValues) { return true; } return false;
Fix parsing and converting Fix on isFullInterval returning true even when not full Fix on applyInterval not parsing partial step (eg: 1-5/2) correctly
roccivic_cron-converter
train
js
af5d9f6a06c5c755d468304b7f46e2387ce06c66
diff --git a/lib/statslib.php b/lib/statslib.php index <HASH>..<HASH> 100644 --- a/lib/statslib.php +++ b/lib/statslib.php @@ -317,6 +317,9 @@ function stats_cron_weekly () { WHERE courseid = '.$course->id.' AND '.$timesql.' AND stattype = \'logins\''; if ($stat = get_record_sql($sql)) { + if (empty($stat->stat1)) { + $stat->stat1 = 0; + } $stat->courseid = $course->id; $stat->roleid = 0; $stat->timeend = $nextsunday; @@ -443,6 +446,9 @@ function stats_cron_monthly () { WHERE courseid = '.$course->id.' AND '.$timesql.' AND stattype = \'logins\''; if ($stat = get_record_sql($sql)) { + if (empty($stat->stat1)) { + $stat->stat1 = 0; + } $stat->courseid = $course->id; $stat->roleid = 0; $stat->timeend = $nextmonthend; @@ -1021,7 +1027,7 @@ function stats_fix_zeros($stats,$timeafter,$timestr,$line2=true,$line3=false) { $actualtimes[] = $s->timeend; } - $timeafter = array_pop($actualtimes); + $timeafter = array_pop(array_values($actualtimes)); while ($timeafter < $now) { $times[] = $timeafter;
bugsquish! stats aggregates and weird missing dates bug
moodle_moodle
train
php
30abff69afc553b6c42bf9fed1f94b4cc5663798
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index <HASH>..<HASH> 100755 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -171,7 +171,7 @@ class Configuration implements ConfigurationInterface ->example(1) ->end() ->scalarNode('receive_wait_time') - ->defaultValue(3) + ->defaultValue(0) ->info('How many seconds to Long Poll when requesting messages - if supported') ->example(3) ->end() diff --git a/src/Provider/IronMqProvider.php b/src/Provider/IronMqProvider.php index <HASH>..<HASH> 100755 --- a/src/Provider/IronMqProvider.php +++ b/src/Provider/IronMqProvider.php @@ -172,7 +172,8 @@ class IronMqProvider extends AbstractProvider $messages = $this->ironmq->getMessages( $this->getNameWithPrefix(), $options['messages_to_receive'], - $options['message_timeout'] + $options['message_timeout'], + $options['receive_wait_time'] ); if (!is_array($messages)) {
Enable 'receive_wait_time' configuration parameter for IronMqProvider The IronMqProvider was not using 'receive_wait_time' configuration for long polling but it's supported since IronMQ <I> (<URL>
uecode_qpush-bundle
train
php,php
115bf42617030057b13fdbf0d8731d840723bb97
diff --git a/commons/components/commons-mule/src/test/java/org/soitoolkit/commons/mule/mail/MailUtilTest.java b/commons/components/commons-mule/src/test/java/org/soitoolkit/commons/mule/mail/MailUtilTest.java index <HASH>..<HASH> 100644 --- a/commons/components/commons-mule/src/test/java/org/soitoolkit/commons/mule/mail/MailUtilTest.java +++ b/commons/components/commons-mule/src/test/java/org/soitoolkit/commons/mule/mail/MailUtilTest.java @@ -72,6 +72,10 @@ public class MailUtilTest { } @Test + public void dummyTest() throws Exception { + } + +// @Test public void sendAndReceiveMessageWithoutAttachmentsTest() throws Exception { log.info("SMTP without attachements..."); @@ -95,7 +99,7 @@ public class MailUtilTest { assertEquals(0, m.getAttachments().size()); } - @Test +// @Test public void sendAndReceiveMessageWithAttachmentsTest() throws Exception { log.info("SMTP with attachment...");
Disable tests until we can clean the mailbox in the setup method so that the test results are predictable.
soi-toolkit_soi-toolkit-mule
train
java
aaab8025cd657028ecc5ccca39630326b368f1df
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,8 +15,7 @@ setup(name = "artist", 'Intended Audience :: Education', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3', 'Topic :: Scientific/Engineering :: Visualization', 'Topic :: Education', 'Topic :: Text Processing :: Markup :: LaTeX',
Update Python classifiers in setup.py
davidfokkema_artist
train
py
95225d610bde10fa0224078098f815f869cbfb19
diff --git a/salt/utils/event.py b/salt/utils/event.py index <HASH>..<HASH> 100644 --- a/salt/utils/event.py +++ b/salt/utils/event.py @@ -136,7 +136,7 @@ class SaltEvent(object): if self.sub in socks and socks[self.sub] == zmq.POLLIN: raw = self.sub.recv() # Double check the tag - if tag != raw[:20].rstrip('|'): + if not raw[:20].rstrip('|').startswith(tag): continue data = self.serial.loads(raw[20:]) if full:
Tags check was inverse in event listener
saltstack_salt
train
py
4d2cee1335ad0765e85a788073fcdf5e374f666f
diff --git a/lib/skiima/db_adapters/mysql2_adapter.rb b/lib/skiima/db_adapters/mysql2_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/skiima/db_adapters/mysql2_adapter.rb +++ b/lib/skiima/db_adapters/mysql2_adapter.rb @@ -6,13 +6,14 @@ require 'mysql2' module Skiima def self.mysql2_connection(logger, config) + config = Skiima.symbolize_keys(config) config[:username] = 'root' if config[:username].nil? if Mysql2::Client.const_defined? :FOUND_ROWS config[:flags] = Mysql2::Client::FOUND_ROWS end - client = Mysql2::Client.new(Skiima.symbolize_keys(config)) + client = Mysql2::Client.new(config) options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], 0] Skiima::DbAdapters::Mysql2Adapter.new(client, logger, options, config) end
Mysql Adapter: fixed issue with symbolized keys on config hash
dcunited001_skiima
train
rb
0109a7260c1809d00817efe00dac188d028a9948
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -86,15 +86,16 @@ def check_compiler(compiler, extensions, compiler_name): compiler_found = True # https://stackoverflow.com/questions/19774778/when-is-it-necessary-to-use-use-the-flag-stdlib-libstdc - for e in extensions: - if LooseVersion(platform.release()) < LooseVersion("10.9"): - opt ="-stdlib=libc++" - else: - opt ="-stdlib=stdlibc++" - - if not (opt in e.extra_compile_args): - e.extra_compile_args.append(opt) - + if plat == 'Darwin': + for e in extensions: + if LooseVersion(platform.release()) < LooseVersion("10.9"): + opt ="-stdlib=libc++" + else: + opt ="-stdlib=stdlibc++" + + if not (opt in e.extra_compile_args): + e.extra_compile_args.append(opt) + ver = find_version_clang(s) if ver != '':
Just an Mac OS X issue.
phoebe-project_phoebe2
train
py
616990b09d63b9947ef34174c69b994146776b61
diff --git a/wasync/src/main/java/org/atmosphere/wasync/impl/DefaultSocket.java b/wasync/src/main/java/org/atmosphere/wasync/impl/DefaultSocket.java index <HASH>..<HASH> 100644 --- a/wasync/src/main/java/org/atmosphere/wasync/impl/DefaultSocket.java +++ b/wasync/src/main/java/org/atmosphere/wasync/impl/DefaultSocket.java @@ -157,6 +157,8 @@ public class DefaultSocket implements Socket { } catch (ExecutionException t) { Throwable e = t.getCause(); + logger.error("Unable to connect", t); + if (TransportNotSupported.class.isAssignableFrom(e.getClass())) { return this; }
Log an error when unable to open the connection
Atmosphere_wasync
train
java
3065fd18ec5227f2a0eff859ae27c2b9f01872d3
diff --git a/routes/admin/authenticated/sidebar/mobilizations-launch/page.js b/routes/admin/authenticated/sidebar/mobilizations-launch/page.js index <HASH>..<HASH> 100644 --- a/routes/admin/authenticated/sidebar/mobilizations-launch/page.js +++ b/routes/admin/authenticated/sidebar/mobilizations-launch/page.js @@ -18,14 +18,7 @@ if (require('exenv').canUseDOM) { const FormShareImplementation = FormShare( state => ({ initialValues: MobSelectors(state).getMobilization() }), - { - submit: values => MobActions.asyncUpdateMobilization({ - ...values, - next: () => browserHistory.push( - paths.mobilizationLaunchEnd(values.id) - ) - }) - }, + { submit: MobActions.asyncUpdateMobilization }, values => { const errors = {} if (!values.facebook_share_image) { @@ -85,6 +78,7 @@ const MobilizationsLaunchPage = ({ hostedZones, mobilization, isSaving, ...formP formClassNames='mobilization-launch--form-share' titleText='Configure as informações de compartilhamento' buttonText={buttonText} + onFinishSubmit={() => browserHistory.push(paths.mobilizationLaunchEnd(mobilization.id))} /> </StepContent> </StepsContainerStack>
Refactor redirect when finish sharing submit. Issue #<I>
nossas_bonde-client
train
js