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
ca30f5a70ea2fab4deb96917ce29f9e9405ed97c
diff --git a/lib/LineCol.php b/lib/LineCol.php index <HASH>..<HASH> 100644 --- a/lib/LineCol.php +++ b/lib/LineCol.php @@ -80,10 +80,11 @@ final class LineCol } throw new OutOfBoundsException(sprintf( - 'Position %s:%s is larger than text length %s', + 'Position %s:%s is larger than text length %s: %s', $this->line(), $this->col(), - strlen($text) + strlen($text), + $text )); } diff --git a/lib/Util/LineAtOffset.php b/lib/Util/LineAtOffset.php index <HASH>..<HASH> 100644 --- a/lib/Util/LineAtOffset.php +++ b/lib/Util/LineAtOffset.php @@ -26,7 +26,7 @@ final class LineAtOffset $lastLine = ''; foreach ($lines as $line) { $end = $start + strlen($line); - if ($byteOffset >= $start && $byteOffset < $end) { + if ($byteOffset >= $start && $byteOffset <= $end) { if (preg_match('{^(\r\n|\n|\r)$}', $line)) { return $lastLine; }
Fix bug with line-at-offset
phpactor_text-document
train
php,php
5d98ca49cad2f29e8fb0eaf8e6c1779a75a0c135
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,6 +2,8 @@ require 'rubygems' require 'test/unit' $:.unshift File.expand_path('../../lib', __FILE__) +ENV["TMUX"] = "true" + module FakeTmux attr_reader :tmux_commands
Travis does not use tmux unfortunately :(
v-yarotsky_tmuxall
train
rb
d0a2af1944b2f47549ed89fb17efe3a0509a1e82
diff --git a/splinter/driver/webdriver/cookie_manager.py b/splinter/driver/webdriver/cookie_manager.py index <HASH>..<HASH> 100644 --- a/splinter/driver/webdriver/cookie_manager.py +++ b/splinter/driver/webdriver/cookie_manager.py @@ -3,15 +3,10 @@ # Copyright 2012 splinter authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -import sys +from urllib.parse import urlparse from splinter.cookie_manager import CookieManagerAPI -if sys.version_info[0] > 2: - from urllib.parse import urlparse -else: - from urlparse import urlparse # NOQA - class CookieManager(CookieManagerAPI): def add(self, cookie, **kwargs):
Remove useless py2x version check (#<I>)
cobrateam_splinter
train
py
85d9d3244aa8cbc1e4809544ea86620a0e539160
diff --git a/ptest/screencapturer.py b/ptest/screencapturer.py index <HASH>..<HASH> 100644 --- a/ptest/screencapturer.py +++ b/ptest/screencapturer.py @@ -290,11 +290,12 @@ def take_screenshots(): if system() == 'Darwin' and not pyobjc_installed: screenshot["error"] = "The package pyobjc is necessary for taking screenshot of desktop, please install it." else: - output = BytesIO() try: + output = BytesIO() mss().save(output=output, screen=-1) # -1 means all monitors + value = output.getvalue() with open(os.path.join(config.get_option("temp"), screenshot["path"]), mode="wb") as f: - f.write(output.getvalue()) + f.write(value) except Exception as e: screenshot["error"] = str(e).strip() or "\n".join([str(arg) for arg in e.args]) @@ -329,8 +330,9 @@ def take_screenshots(): pass try: + value = web_driver.get_screenshot_as_png() with open(os.path.join(config.get_option("temp"), screenshot["path"]), mode="wb") as f: - f.write(web_driver.get_screenshot_as_png()) + f.write(value) except Exception as e: screenshot["error"] = str(e).strip() or "\n".join([str(arg) for arg in e.args])
Fix empty screenshot when failed to capture screenshot.
KarlGong_ptest
train
py
38fa8650971d2e46168a1167d6b05ddf2d87927f
diff --git a/eli5/formatters/image.py b/eli5/formatters/image.py index <HASH>..<HASH> 100644 --- a/eli5/formatters/image.py +++ b/eli5/formatters/image.py @@ -46,6 +46,9 @@ def format_as_image(expl, image = expl.image heatmap = expl.heatmap + # We first 1. colorize 2. resize + # as opposed 1. resize 2. colorize + heatmap = colorize(heatmap, colormap=colormap) # TODO: test colorize with a callable diff --git a/eli5/keras.py b/eli5/keras.py index <HASH>..<HASH> 100644 --- a/eli5/keras.py +++ b/eli5/keras.py @@ -103,7 +103,7 @@ def validate_doc(estimator, doc): if len(input_sh) == 4: # rank 4 with (batch, ...) shape # check that we have only one image (batch size 1) - single_batch = (1, *input_sh[1:]) + single_batch = (1, input_sh[1], input_sh[2], input_sh[3]) if doc_sh != single_batch: raise ValueError('Batch size does not match. ' 'doc must be of shape: {}, '
Replace starred expression with manual indexing (py<I> build fix)
TeamHG-Memex_eli5
train
py,py
e88a00f0c1de94147f10af40302036f54210b85f
diff --git a/tinyrpc/protocols/jsonrpc.py b/tinyrpc/protocols/jsonrpc.py index <HASH>..<HASH> 100644 --- a/tinyrpc/protocols/jsonrpc.py +++ b/tinyrpc/protocols/jsonrpc.py @@ -139,7 +139,7 @@ class JSONRPCRequest(RPCRequest): jdata['params'] = self.args if self.kwargs: jdata['params'] = self.kwargs - if self.unique_id != None: + if hasattr(self, 'unique_id') and self.unique_id is not None: jdata['id'] = self.unique_id return jdata
Support notifications, with <URL>
mbr_tinyrpc
train
py
8c29749ae7ce7548235d3e429452c0f992c5a453
diff --git a/test/api-configuration.test.js b/test/api-configuration.test.js index <HASH>..<HASH> 100644 --- a/test/api-configuration.test.js +++ b/test/api-configuration.test.js @@ -134,9 +134,13 @@ function PATTERN_IndexDocumentsResponse(members) { IndexDocumentsResponse: { '@': { xmlns: '' }, IndexDocumentsResult: { - FieldNames: members.map(function(member) { - return { member: '' }; - }) + FieldNames: (function() { + var pattern = {}; + members.forEach(function(member, index) { + pattern[index] = { member: '' }; + }); + return pattern; + })() }, ResponseMetadata: PATTERN_ResponseMetadata } @@ -578,10 +582,15 @@ suite('Configuration API', function() { body: PATTERN_IndexDocumentsResponse(expectedFieldNames) }); var fieldNames = response.body.IndexDocumentsResponse .IndexDocumentsResult - .FieldNames - .map(function(member) { - return member.member; - }); + .FieldNames; + fieldNames = (function() { + var names = []; + for (var i in fieldNames) { + if (fieldNames.hasOwnProperty(i)) + names.push(fieldNames[i].member); + } + return names; + })(); assert.deepEqual(fieldNames, expectedFieldNames); done();
Fix expected patterns for IndexDocuments response
groonga_gcs
train
js
5fee3b589c74d4304471dae7a76af9f0698af4dc
diff --git a/safe/gui/tools/minimum_needs/needs_manager_dialog.py b/safe/gui/tools/minimum_needs/needs_manager_dialog.py index <HASH>..<HASH> 100644 --- a/safe/gui/tools/minimum_needs/needs_manager_dialog.py +++ b/safe/gui/tools/minimum_needs/needs_manager_dialog.py @@ -702,10 +702,6 @@ class NeedsManagerDialog(QDialog, FORM_CLASS): self.minimum_needs.save_profile(minimum_needs['profile']) self.mark_current_profile_as_saved() - # Emit combobox function in dock - current_index = self.dock.cboFunction.currentIndex() - self.dock.cboFunction.currentIndexChanged.emit(current_index) - def save_profile_as(self): """Save the minimum needs under a new profile name. """
remove useless code about IF function combobox in minimumneeds dialog
inasafe_inasafe
train
py
f4f15aeed400b02ad577735b0b3537c028db5a9d
diff --git a/test/functional/test_dirty.rb b/test/functional/test_dirty.rb index <HASH>..<HASH> 100644 --- a/test/functional/test_dirty.rb +++ b/test/functional/test_dirty.rb @@ -99,6 +99,13 @@ class DirtyTest < Test::Unit::TestCase should "be false if no keys changed" do @document.new.changed?.should be_false end + + should "not raise when key name is 'value'" do + @document.key :value, Integer + + doc = @document.new + doc.value_changed?.should be_false + end end context "changes" do
Added test: _changed? should not raise when key name is 'value'
mongomapper_mongomapper
train
rb
9bf2a7f4ebb899244886ed4d0742895fa834fc91
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index <HASH>..<HASH> 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -123,7 +123,7 @@ const ( EnableEquivalenceClassCache utilfeature.Feature = "EnableEquivalenceClassCache" // owner: @k82cn - // alpha: v1.8 + // beta: v1.12 // // Taint nodes based on their condition status for 'NetworkUnavailable', // 'MemoryPressure', 'OutOfDisk' and 'DiskPressure'. @@ -304,7 +304,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS PodShareProcessNamespace: {Default: false, PreRelease: utilfeature.Alpha}, PodPriority: {Default: false, PreRelease: utilfeature.Alpha}, EnableEquivalenceClassCache: {Default: false, PreRelease: utilfeature.Alpha}, - TaintNodesByCondition: {Default: false, PreRelease: utilfeature.Alpha}, + TaintNodesByCondition: {Default: true, PreRelease: utilfeature.Beta}, MountPropagation: {Default: true, PreRelease: utilfeature.Beta}, QOSReserved: {Default: false, PreRelease: utilfeature.Alpha}, ExpandPersistentVolumes: {Default: false, PreRelease: utilfeature.Alpha},
Upgrade TaintNodesByCondition to beta.
kubernetes_kubernetes
train
go
40ab2f2f12ebd83a911fd425f29d88bc91bb2a26
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -335,10 +335,12 @@ function setFSEventsListener(path, realPath, callback, rawEmitter) { }; } -FSWatcher.prototype._watchWithFsEvents = function(watchPath, realPath) { +FSWatcher.prototype._watchWithFsEvents = function(watchPath, realPath, pt) { if (this._isIgnored(watchPath)) return; var watchCallback = function(fullPath, flags, info) { - var path = sysPath.join(watchPath, sysPath.relative(watchPath, fullPath)); + var path = pt(sysPath.join( + watchPath, sysPath.relative(watchPath, fullPath) + )); // ensure directories are tracked var parent = sysPath.dirname(path); var item = sysPath.basename(path); @@ -794,7 +796,7 @@ FSWatcher.prototype._addToFsEvents = function(file, pathTransform) { if (this.options.persistent) { fs.realpath(sysPath.resolve(file), function(error, realPath) { if (error) realPath = file; - _this._watchWithFsEvents(file, realPath); + _this._watchWithFsEvents(file, realPath, pathTransform); }); } return this;
Fix path resolution through symlinks gh-<I>
paulmillr_chokidar
train
js
9f28d01fa1599a148fa0822c39b661500efc2379
diff --git a/webapp/js/nextserver.js b/webapp/js/nextserver.js index <HASH>..<HASH> 100644 --- a/webapp/js/nextserver.js +++ b/webapp/js/nextserver.js @@ -112,8 +112,8 @@ function showPopup() { x = $(this).find("ul.subnav"); // var t = $(this).parents().filter("td.actions-col"); // x.css({ "left": + t.position().left + "px" }); - - var table = $(this).parents().filter("div.table-right-container,div.table-container,div.dashboardNavigation,div.analysisNavigation,div.table-actions"); +// trebuie adaugat tot timpul parintele in care se afla submeniul + var table = $(this).parents().filter("div.table-right-container,div.table-container,div.dashboardNavigation,div.analysisNavigation,div.table-actions, div.dashboardCapture"); var tt = table.position().top; var th = table.height(); var tb = tt + th;
Add new parrent to showPopup function
nextreports_nextreports-server
train
js
2824f16c49d87dbd03462fcce5396c85fd04a2c9
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -174,7 +174,7 @@ Server.prototype._onHttpRequest = function (req, res) { } if (left === 0) swarm.complete += 1 else swarm.incomplete += 1 - swarm.peers[addr] = { + peer = swarm.peers[addr] = { ip: ip, port: port, peerId: peerId @@ -233,7 +233,7 @@ Server.prototype._onHttpRequest = function (req, res) { return error('invalid event') // early return } - if (left === 0) peer.complete = true + if (left === 0 && peer) peer.complete = true // send peers var peers = compact === 1 @@ -367,7 +367,7 @@ Server.prototype._onUdpRequest = function (msg, rinfo) { } if (left === 0) swarm.complete += 1 else swarm.incomplete += 1 - swarm.peers[addr] = { + peer = swarm.peers[addr] = { ip: ip, port: port, peerId: peerId @@ -426,7 +426,7 @@ Server.prototype._onUdpRequest = function (msg, rinfo) { return error('invalid event') // early return } - if (left === 0) peer.complete = true + if (left === 0 && peer) peer.complete = true // send peers var peers = self._getPeersCompact(swarm, numWant)
don't assume peer var will exist
webtorrent_bittorrent-tracker
train
js
a414f275f4c406c2b7f595c2478ee7e807e36353
diff --git a/lib/lita/adapters/shell.rb b/lib/lita/adapters/shell.rb index <HASH>..<HASH> 100644 --- a/lib/lita/adapters/shell.rb +++ b/lib/lita/adapters/shell.rb @@ -3,6 +3,8 @@ module Lita module Adapters # An adapter that runs Lita in a UNIX shell. class Shell < Adapter + config :private_chat, default: false + # Creates a "Shell User" and then loops a prompt and input, passing the # incoming messages to the robot. # @return [void] @@ -39,7 +41,7 @@ module Lita def build_message(input, source) message = Message.new(robot, input, source) - message.command! if robot.config.adapter.private_chat + message.command! if robot.config.adapters.shell.private_chat message end diff --git a/spec/lita/adapters/shell_spec.rb b/spec/lita/adapters/shell_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lita/adapters/shell_spec.rb +++ b/spec/lita/adapters/shell_spec.rb @@ -27,8 +27,8 @@ describe Lita::Adapters::Shell, lita: true do subject.run end - it "marks messages as commands if config.adapter.private_chat is true" do - registry.config.adapter.private_chat = true + it "marks messages as commands if config.adapters.shell.private_chat is true" do + registry.config.adapters.shell.private_chat = true expect_any_instance_of(Lita::Message).to receive(:command!) subject.run end
Use new-style config for shell adapter.
litaio_lita
train
rb,rb
cc7f1ed1f6eee7017aa97f6e90e86eb15299070b
diff --git a/Eloquent/Builder.php b/Eloquent/Builder.php index <HASH>..<HASH> 100755 --- a/Eloquent/Builder.php +++ b/Eloquent/Builder.php @@ -1143,6 +1143,28 @@ class Builder } /** + * Add the given scopes to the current builder instance. + * + * @param array $scopes + * @return mixed + */ + public function scopes(array $scopes) + { + $builder = $this; + + foreach ($scopes as $scope => $parameters) { + if (is_int($scope)) { + $scope = $parameters; + $parameters = []; + } + + $builder = $builder->callScope('scope'.ucfirst($scope), (array) $parameters); + } + + return $builder; + } + + /** * Apply the given scope on the current builder instance. * * @param callable $scope
Add method to implement multiple scopes with variable names
illuminate_database
train
php
1ebf5933766e112a8f53bb4fc64af3ca54ace741
diff --git a/KrToolBaseClass.php b/KrToolBaseClass.php index <HASH>..<HASH> 100644 --- a/KrToolBaseClass.php +++ b/KrToolBaseClass.php @@ -8,11 +8,15 @@ class KrToolBaseClass { public function setSettings( $settings ) { foreach ( $this->settingsKeys as $key ) { - if ( !array_key_exists( $key, $settings ) ) { + if ( !isset( $this->settings[ $key ] ) && !array_key_exists( $key, $settings ) ) { throw new InvalidArgumentException( "Settings must have key $key." ); } } - $this->settings = $settings; + foreach ( $settings as $key => $value ) { + if ( in_array( $key, $this->settingsKeys ) ) { + $this->settings[ $key ] = $value; + } + } } public function getSetting( $key ) {
Allow ToolBaseClass to have default settings
Krinkle_toollabs-base
train
php
747e58ebf7f82d41734fd52abcadc67c97520675
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,8 @@ setup( long_description=open(join(here, 'README.rst')).read(), packages=find_packages(), test_suite='tests', - dependency_links=['https://github.com/trezor/python-mnemonic/archive/master.zip#egg=mnemonic-0.6'], - install_requires=['ecdsa>=0.9', 'protobuf', 'mnemonic>=0.6', 'hidapi>=0.7.99'], + dependency_links=['https://github.com/trezor/python-mnemonic/archive/master.zip#egg=mnemonic-0.8'], + install_requires=['ecdsa>=0.9', 'protobuf', 'mnemonic>=0.8', 'hidapi>=0.7.99'], include_package_data=True, zip_safe=False, classifiers=[
Uses mnemonic>=<I> (improved UTF8 handling)
trezor_python-trezor
train
py
3aa2583b2201b1e60c7ab774c18d0c788276cbd4
diff --git a/src/Phinx/Db/Adapter/MysqlAdapter.php b/src/Phinx/Db/Adapter/MysqlAdapter.php index <HASH>..<HASH> 100644 --- a/src/Phinx/Db/Adapter/MysqlAdapter.php +++ b/src/Phinx/Db/Adapter/MysqlAdapter.php @@ -350,8 +350,7 @@ class MysqlAdapter extends PdoAdapter implements AdapterInterface */ public function hasColumn($tableName, $columnName) { - $sql = sprintf('SHOW COLUMNS FROM %s', $this->quoteTableName($tableName)); - $rows = $this->fetchAll($sql); + $rows = $this->fetchAll(sprintf('SHOW COLUMNS FROM %s', $this->quoteTableName($tableName))); foreach ($rows as $column) { if (strcasecmp($column['Field'], $columnName) === 0) { return true;
refs #<I> comment, sprintf and fetAll as one line
cakephp_phinx
train
php
c49ba28bbffe74860c845f313882b49c0e85988d
diff --git a/src/providers/sh/util/alias.js b/src/providers/sh/util/alias.js index <HASH>..<HASH> 100755 --- a/src/providers/sh/util/alias.js +++ b/src/providers/sh/util/alias.js @@ -217,7 +217,7 @@ module.exports = class Alias extends Now { return bail(new Error(body.error.message)) } - // The two expected succesful cods are 200 and 304 + // The two expected successful codes are 200 and 304 if (res.status !== 200 && res.status !== 304) { throw new Error('Unhandled error') } @@ -524,7 +524,7 @@ module.exports = class Alias extends Now { return bail(new Error(body.error.message)) } - // The two expected succesful cods are 200 and 304 + // The two expected successful codes are 200 and 304 if (res.status !== 200 && res.status !== 304) { throw new Error('Unhandled error') }
Fixed a few comment typos (#<I>)
zeit_now-cli
train
js
42a6d1e1ddf841a456c392512e7289d88134cef9
diff --git a/config/environment.rb b/config/environment.rb index <HASH>..<HASH> 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -17,13 +17,11 @@ Radiant::Initializer.run do |config| # Only load the extensions named here, in the order given. By default all # extensions in vendor/extensions are loaded, in alphabetical order. :all # can be used as a placeholder for all extensions not explicitly named. - config.extensions = [ :all ] + # config.extensions = [ :all ] # By default, only English translations are loaded. Remove any of these from # the list below if you'd like to provide any of the additional options - config.ignore_extensions [:dutch_language_pack, :french_language_pack, :german_language_pack, - :italian_language_pack, :japanese_language_pack, :russian_language_pack, - :debug] + # config.ignore_extensions [] # Your secret key for verifying cookie session data integrity. # If you change this key, all old sessions will become invalid!
a little more parity with the instance generator environment.rb
radiant_radiant
train
rb
b6234c36db3bd740ba6a2ef36309c99286f3eb75
diff --git a/libnfldap.py b/libnfldap.py index <HASH>..<HASH> 100644 --- a/libnfldap.py +++ b/libnfldap.py @@ -221,6 +221,7 @@ COMMIT class LDAP(object): def __init__(self, url, bind_dn, bind_passwd): self.conn = ldap.initialize(url) + self.conn.start_tls_s() self.conn.simple_bind_s(bind_dn, bind_passwd) self.schema = {}
Add STARTTLS to LDAP connection
mozilla_libnfldap
train
py
01a20bb3d948765338e60f80f763486caf97b615
diff --git a/openquake/calculators/event_based.py b/openquake/calculators/event_based.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/event_based.py +++ b/openquake/calculators/event_based.py @@ -600,8 +600,11 @@ class EventBasedCalculator(ClassicalCalculator): # save individual curves if self.oqparam.individual_curves: for i in sorted(result): + key = 'hcurves/rlz-%03d' % i if result[i]: - self.datastore['hcurves/rlz-%03d' % i] = result[i] + self.datastore[key] = result[i] + else: + logging.info('Zero curves for %s', key) # compute and save statistics; this is done in process # we don't need to parallelize, since event based calculations # involves a "small" number of sites (<= 65,536)
Added a warning for zero hazard curves Former-commit-id: fe<I>d<I>ef<I>c4b<I>b<I>defdcc<I>a<I>a
gem_oq-engine
train
py
ae34140794738226dcdffd1951090a51a27bb59d
diff --git a/plugins/worker/web_client/JobStatus.js b/plugins/worker/web_client/JobStatus.js index <HASH>..<HASH> 100644 --- a/plugins/worker/web_client/JobStatus.js +++ b/plugins/worker/web_client/JobStatus.js @@ -28,7 +28,7 @@ JobStatus.registerStatus({ WORKER_CANCELING: { value: 824, text: 'Canceling', - icon: 'icon-cancel', + icon: 'icon-spin3 animate-spin', color: '#f89406' } });
Change canceling icon to 'spinning orange'
girder_girder
train
js
51dad72a0693e04918df56d03df5724dce7f9d76
diff --git a/src/Symfony/Component/Workflow/Workflow.php b/src/Symfony/Component/Workflow/Workflow.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Workflow/Workflow.php +++ b/src/Symfony/Component/Workflow/Workflow.php @@ -126,10 +126,10 @@ class Workflow $this->enter($subject, $transition, $marking); - $this->announce($subject, $transition, $marking); - $this->markingStore->setMarking($subject, $marking); + $this->announce($subject, $transition, $marking); + return $marking; }
[Workflow] Set the marking then announce enabled transition It allows to auto-apply some transition from a listener. The feature was asked here: <URL>
symfony_symfony
train
php
b369e0e6a492b88e3be2b674613bfe89ce84b08f
diff --git a/lib/hmr/client.js b/lib/hmr/client.js index <HASH>..<HASH> 100644 --- a/lib/hmr/client.js +++ b/lib/hmr/client.js @@ -7,20 +7,12 @@ var socket = socketIOClient(opts.root + opts.namespace, { path: opts.path }); -var hot = false; - var currentHash = ''; var reload = function() { - if (hot) { - console.info('[WPW-HMR] Reloading via HMR...'); - - window.postMessage('webpackHotUpdate' + currentHash, '*'); - } else { - console.info('[WPW-HMR] Reloading via restart...'); + console.info('[WPW-HMR] Triggering HMR with hash ' + currentHash + '...'); - window.location.reload(); - } + window.postMessage('webpackHotUpdate' + currentHash, '*'); }; socket.on('connect', function() { @@ -28,8 +20,6 @@ socket.on('connect', function() { }); socket.on('hot', function() { - hot = true; - console.info('[WPW-HMR] Hot Module Replacement enabled'); }); @@ -39,8 +29,6 @@ socket.on('invalid', function() { socket.on('hash', function(hash) { currentHash = hash; - - console.info('[WPW-HMR] Latest hash ' + hash); }); socket.on('no-change', function() {
Removed auto reload from the client-side hmr
markfinger_webpack-build
train
js
0d4eaeb6f116a6913005ef36207c768b5c83d178
diff --git a/tornado/testing.py b/tornado/testing.py index <HASH>..<HASH> 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -417,10 +417,8 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase): Interface is generally the same as `AsyncHTTPTestCase`. """ def get_http_client(self): - # Some versions of libcurl have deadlock bugs with ssl, - # so always run these tests with SimpleAsyncHTTPClient. - return SimpleAsyncHTTPClient(io_loop=self.io_loop, force_instance=True, - defaults=dict(validate_cert=False)) + return AsyncHTTPClient(io_loop=self.io_loop, force_instance=True, + defaults=dict(validate_cert=False)) def get_httpserver_options(self): return dict(ssl_options=self.get_ssl_options())
Remove a special case that avoided using curl in tests for HTTPS. This problem should have long since been fixed; any problematic configurations don't deserve to misleadingly pass the tests.
tornadoweb_tornado
train
py
3872d53af40a3fc49f5b5b9e80e71aea3f29ac8a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,5 +24,5 @@ setup( description='Modular Optimisation tools for soliving inverse problems.', long_description=release_info["__about__"], setup_requires=['pytest-runner', ], - tests_require=['pytest', 'pytest-cov', 'pytest-pep8'], + tests_require=['pytest==4.6.4', 'pytest-cov==2.5.1', 'pytest-pep8'], )
fixed pytest version for python <I> support
CEA-COSMIC_ModOpt
train
py
47013d66fd110ed9e3776596bbf805d91f2e017e
diff --git a/features/step_definitions/wait_steps.rb b/features/step_definitions/wait_steps.rb index <HASH>..<HASH> 100644 --- a/features/step_definitions/wait_steps.rb +++ b/features/step_definitions/wait_steps.rb @@ -78,7 +78,8 @@ Then('the removing collection of sections disappears') do end Then('I can wait a variable time for elements to disappear') do - expect { @test_site.home.removing_links(wait: 2.6) }.not_to raise_error + expect { @test_site.home.removing_links(wait: 1.9, count: 0) } + .not_to raise_error expect(@test_site.home).to have_no_removing_links end
Ensure that when doing the negative wait we pass in the counter to be zeroed, and not just counter to be active£
natritmeyer_site_prism
train
rb
59520c083aa1da961c124d4bf13193fa27d7c909
diff --git a/utils/utils.go b/utils/utils.go index <HASH>..<HASH> 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -76,10 +76,12 @@ func RunUnderSystemdScope(pid int, slice, unitName string) error { return err } properties = append(properties, - systemdDbus.PropSlice(slice), newProp("PIDs", []uint32{uint32(pid)}), newProp("Delegate", true), newProp("DefaultDependencies", false)) + if slice != "" { + properties = append(properties, systemdDbus.PropSlice(slice)) + } ch := make(chan string) _, err = conn.StartTransientUnit(unitName, "replace", properties, ch) if err != nil {
utils: check that the slice name is not null
cri-o_cri-o
train
go
023f52ae4a26caf5508226da1846587450cc4edd
diff --git a/master/buildbot/test/unit/test_mq_wamp.py b/master/buildbot/test/unit/test_mq_wamp.py index <HASH>..<HASH> 100644 --- a/master/buildbot/test/unit/test_mq_wamp.py +++ b/master/buildbot/test/unit/test_mq_wamp.py @@ -13,6 +13,7 @@ # # Copyright Buildbot Team Members import os +import textwrap import mock from autobahn.wamp.types import EventDetails @@ -157,10 +158,9 @@ class WampMQReal(unittest.TestCase): Tests a little bit more painful to run, but which involve real communication with a wamp router """ - HOW_TO_RUN = """ \ - define WAMP_ROUTER_URL to a wamp router to run this test\ - e.g: WAMP_ROUTER_URL=ws://localhost:8000/ws - """ + HOW_TO_RUN = textwrap.dedent("""\ + define WAMP_ROUTER_URL to a wamp router to run this test + e.g: WAMP_ROUTER_URL=ws://localhost:8000/ws""") # if connection is bad, this test can timeout easily # we reduce the timeout to help maintain the sanity of the developer timeout = 2
fix WAMP warning formatting Previsously it was seen as: ``` [SKIPPED] define WAMP_ROUTER_URL to a wamp router to run this test e.g: WAMP_ROUTER_URL=ws://localhost:<I>/ws ```
buildbot_buildbot
train
py
34a100d8fcbee6b1874fa3bfcb4ec8e1e6b10465
diff --git a/lib/view.js b/lib/view.js index <HASH>..<HASH> 100755 --- a/lib/view.js +++ b/lib/view.js @@ -37,13 +37,23 @@ require("./request").call(View.prototype); * * @return {object} this Chainable */ -View.prototype.query = function (query, callback) { +View.prototype.query = function (query, postData, callback) { if (typeof query === "function") { callback = query; query = {}; + postData = null; } - - return this.req("get", { query: query }, callback); + + if(typeof postData === "function") { + callback = postData; + postData = null; + } + + if(!postData) { + return this.req("get", { query: query }, callback); + } else { + return this.req("post", { query: query }, postData, callback); + } }; /**
Updating view module to allow POSTing to views - for sending keys=[]
dominicbarnes_node-couchdb-api
train
js
7e366e1fe95d170d71b4b7168eceff25d05da107
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -379,7 +379,7 @@ gulp.task('docs-default', function (callback) { }); // Generates a new local build of the docs. -gulp.task('docs-local', ['docs-default'], shell.task('bundle exec jekyll build --config=_config.yml,_config_local.yml', { +gulp.task('docs-local', ['docs-config-local', 'docs-default'], shell.task('bundle exec jekyll build --config=_config.yml,_config_local.yml', { cwd: __dirname + '/_docs', verbose: true }));
Added missing docs-config-local dependency to docs-local
UCF_Athena-Framework
train
js
2e26466979a2b457b68b8ace8a9e42849e51956b
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index <HASH>..<HASH> 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -333,7 +333,7 @@ gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(path.dirname(root), 'V gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/i386')); gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/amd64')); -gulp.task('vscode-win32', [/*'optimize-vscode', */'clean-vscode-win32'], packageTask('win32')); +gulp.task('vscode-win32', ['optimize-vscode', 'clean-vscode-win32'], packageTask('win32')); gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin')); gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32')); gulp.task('vscode-linux-x64', ['optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
Enable optimze-vscode again for vscode-win<I>
Microsoft_vscode
train
js
6534729676ce67a4f6df153ed0491d7259a7faf4
diff --git a/cassandra/src/main/java/org/opennms/newts/persistence/cassandra/Aggregation.java b/cassandra/src/main/java/org/opennms/newts/persistence/cassandra/Aggregation.java index <HASH>..<HASH> 100644 --- a/cassandra/src/main/java/org/opennms/newts/persistence/cassandra/Aggregation.java +++ b/cassandra/src/main/java/org/opennms/newts/persistence/cassandra/Aggregation.java @@ -66,14 +66,14 @@ public class Aggregation implements Iterable<Row<Measurement>>, Iterator<Row<Mea // accumulate for (Datasource ds : getDatasources()) { Measurement m = m_working.getElement(ds.getSource()); - values.put(ds.getSource(), m != null ? m.getValue() : Double.NaN); + values.put(ds.getLabel(), m != null ? m.getValue() : Double.NaN); } // next working m_working = m_input.hasNext() ? m_input.next() : null; } for (Datasource ds : getDatasources()) { - Double v = aggregate(ds, values.get(ds.getSource())); + Double v = aggregate(ds, values.get(ds.getLabel())); m_nextOut.addElement(new Measurement(m_nextOut.getTimestamp(), m_resource, ds.getLabel(), v)); }
collate by label, not source name
OpenNMS_newts
train
java
322a857569c5f42ba87a75afa94f551029b2cb04
diff --git a/PluginBase/src/org/bimserver/database/queries/om/JsonQueryObjectModelConverter.java b/PluginBase/src/org/bimserver/database/queries/om/JsonQueryObjectModelConverter.java index <HASH>..<HASH> 100644 --- a/PluginBase/src/org/bimserver/database/queries/om/JsonQueryObjectModelConverter.java +++ b/PluginBase/src/org/bimserver/database/queries/om/JsonQueryObjectModelConverter.java @@ -406,7 +406,7 @@ public class JsonQueryObjectModelConverter { addType(objectNode, queryPart, type, false); } else if (typeNode.isObject()) { ObjectNode typeDef = (ObjectNode) typeNode; - addType(objectNode, queryPart, typeDef.get("name").asText(), typeDef.get("includeAllSubTypes").asBoolean()); + addType(objectNode, queryPart, typeDef.get("name").asText(), typeDef.has("includeAllSubTypes") && typeDef.get("includeAllSubTypes").asBoolean()); } else { throw new QueryException("\"types\"[" + i + "] must be of type string"); }
Don't require includeAllSubTypes field
opensourceBIM_BIMserver
train
java
688e4d4e3d1bcbda9b0514d15283faa960813e35
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ with open('README.md') as f: with open('LICENSE') as f: license = f.read() -__version__ = '0.0.0.dev10' +__version__ = '1.0.0' setup( name='aperturelib',
Updated version to <I>
Aperture-py_aperture-lib
train
py
a91ad5a2a53c9f2ace9a19cba0cda5e319881846
diff --git a/lib/discordrb/data.rb b/lib/discordrb/data.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/data.rb +++ b/lib/discordrb/data.rb @@ -260,6 +260,12 @@ module Discordrb attr_reader :deaf alias_method :deafened?, :deaf + # @return [Time] when this member joined the server. + attr_reader :joined_at + + # Alias the creation_time because Members are not IDObjects as they don't technically have IDs + alias_method :creation_time, :joined_at + # @!visibility private def initialize(data, server, bot) @bot = bot
Create a reader for joined_at
meew0_discordrb
train
rb
2d099ef718baf1423cb654efee1cba674fcf2a45
diff --git a/lib/sorcery/version.rb b/lib/sorcery/version.rb index <HASH>..<HASH> 100644 --- a/lib/sorcery/version.rb +++ b/lib/sorcery/version.rb @@ -1,3 +1,3 @@ module Sorcery - VERSION = "0.10.14" + VERSION = "0.9.1" end
Fixes version (I was testing)
Sorcery_sorcery
train
rb
8d84c5d756d91fca9a766e0e0db687e88d79e700
diff --git a/tests/system/Log/FileHandlerTest.php b/tests/system/Log/FileHandlerTest.php index <HASH>..<HASH> 100644 --- a/tests/system/Log/FileHandlerTest.php +++ b/tests/system/Log/FileHandlerTest.php @@ -10,6 +10,7 @@ class FileHandlerTest extends \CIUnitTestCase protected function setUp(): void { + parent::setUp(); $this->root = vfsStream::setup('root'); $this->start = $this->root->url() . '/'; }
Fix FilerHandlerTest.php wierdness All tests would fail when this class was run by itself. setUp() method needed call the parent::setUp()
codeigniter4_CodeIgniter4
train
php
01867ebd9571a463bf85ed66236f9fa480255f8b
diff --git a/src/controllers/admin/AdminCrudController.php b/src/controllers/admin/AdminCrudController.php index <HASH>..<HASH> 100644 --- a/src/controllers/admin/AdminCrudController.php +++ b/src/controllers/admin/AdminCrudController.php @@ -101,6 +101,10 @@ abstract class AdminCrudController extends AdminAngelController { return $this->also_add_menu_item($this->model, $object->id); } + return $this->add_redirect($object); + } + public function add_redirect($object) + { return Redirect::to($this->uri())->with('success', ' <p>' . $this->model . ' successfully created.</p> '); @@ -159,7 +163,11 @@ abstract class AdminCrudController extends AdminAngelController { $change->save(); } - return Redirect::to($this->uri('edit/' . $id))->with('success', ' + return $this->edit_redirect($object); + } + public function edit_redirect($object) + { + return Redirect::to($this->uri('edit/' . $object->id))->with('success', ' <p>' . $this->model . ' successfully updated.</p> <p><a href="' . $this->uri('', true) . '">Return to index</a></p> ');
add_redirect and edit_redirect
JVMartin_angel-core
train
php
2b9a71909af76f573bca0c5201768e8670e1f601
diff --git a/assets/app/js/app.utils.js b/assets/app/js/app.utils.js index <HASH>..<HASH> 100755 --- a/assets/app/js/app.utils.js +++ b/assets/app/js/app.utils.js @@ -360,6 +360,10 @@ return App.Utils.renderer.default(v); }; + App.Utils.renderer.wysiwyg = function(v) { + v = App.Utils.stripTags(v); + return v.length < 50 ? v : App.$.trim(v).substring(0, 50).split(' ').slice(0, -1).join(' ') + '...'; + }; App.Utils.renderValue = function(renderer, v, meta) { return (this.renderer[renderer] || this.renderer.default)(v, meta);
added simple wysiwg renderer It strips tags and than truncates words instead of characters to preserve special chars like `&auml;`
agentejo_cockpit
train
js
172c6df375a5a00a6155a016c2a2d0ec3c2f14bf
diff --git a/rockAtlas/cl_utils.py b/rockAtlas/cl_utils.py index <HASH>..<HASH> 100644 --- a/rockAtlas/cl_utils.py +++ b/rockAtlas/cl_utils.py @@ -135,7 +135,8 @@ def main(arguments=None): from rockAtlas.phot import download data = download( log=log, - settings=settings + settings=settings, + dev_flag=True ) data.get(days=days) diff --git a/rockAtlas/phot/download.py b/rockAtlas/phot/download.py index <HASH>..<HASH> 100644 --- a/rockAtlas/phot/download.py +++ b/rockAtlas/phot/download.py @@ -55,7 +55,7 @@ class download(): self, log, settings=False, - dev_flag=0 + dev_flag=False ): self.log = log log.debug("instansiating a new 'download' object")
dev_flag to downloader
thespacedoctor_rockAtlas
train
py,py
1ec39b23c4477cd969033c11860e1124d39b37a7
diff --git a/src/Ubiquity/log/Logger.php b/src/Ubiquity/log/Logger.php index <HASH>..<HASH> 100644 --- a/src/Ubiquity/log/Logger.php +++ b/src/Ubiquity/log/Logger.php @@ -93,7 +93,7 @@ abstract class Logger { public static function close() { if (self::$test) { - self::$instance->close (); + self::$instance->_close (); } } @@ -113,6 +113,8 @@ abstract class Logger { abstract public function _clearAll(); + abstract public function _close(); + public static function isActive() { return self::$test; }
fix recursive pb
phpMv_ubiquity
train
php
94019516d43bc2072378e021450183dc8e6964d4
diff --git a/web/concrete/src/Tree/TreeType.php b/web/concrete/src/Tree/TreeType.php index <HASH>..<HASH> 100644 --- a/web/concrete/src/Tree/TreeType.php +++ b/web/concrete/src/Tree/TreeType.php @@ -57,7 +57,7 @@ class TreeType extends Object $db = Database::connection(); $row = $db->GetRow('select * from TreeTypes where treeTypeID = ?', array($treeTypeID)); if (is_array($row) && $row['treeTypeID']) { - $type = new self(); + $type = new static(); $type->setPropertiesFromArray($row); return $type; @@ -69,7 +69,7 @@ class TreeType extends Object $db = Database::connection(); $row = $db->GetRow('select * from TreeTypes where treeTypeHandle = ?', array($treeTypeHandle)); if (is_array($row) && $row['treeTypeHandle']) { - $type = new self(); + $type = new static(); $type->setPropertiesFromArray($row); return $type;
Use LSB in TreeType Late static bindings allow us to instantiate the called class rather than the class that the constructor is defined in. Former-commit-id: <I>fd4e<I>bcf6dae3cca<I>ae9e<I>b<I>cf0 Former-commit-id: <I>f4cbd<I>afe8e7eabbe<I>b<I>e<I>b<I>eb2
concrete5_concrete5
train
php
a390e19edadb8277a6e7e9ad966c5bda3941a2c9
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index <HASH>..<HASH> 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -1208,13 +1208,18 @@ class MainWindow(QMainWindow): else: # Load last project if a project was active when Spyder # was closed + reopen_last_session = False if projects: projects.reopen_last_project() + if projects.get_active_project() is None: + reopen_last_session = True + else: + reopen_last_session = True - # If no project is active, load last session - if projects and projects.get_active_project() is None: - if editor: - editor.setup_open_files(close_previous_files=False) + # If no project is active or Projects is disabled, load last + # session + if editor and reopen_last_session: + editor.setup_open_files(close_previous_files=False) # Raise the menuBar to the top of the main window widget's stack # Fixes spyder-ide/spyder#3887.
Main Window: Load previous session if Projects is disabled
spyder-ide_spyder
train
py
455948ad144adc44d99a605adc1eff1b273c6cca
diff --git a/public/app/features/playlist/playlist_routes.js b/public/app/features/playlist/playlist_routes.js index <HASH>..<HASH> 100644 --- a/public/app/features/playlist/playlist_routes.js +++ b/public/app/features/playlist/playlist_routes.js @@ -3,7 +3,7 @@ define([ 'app/core/config', 'lodash' ], -function (angular, config, _) { +function (angular) { 'use strict'; var module = angular.module('grafana.routes');
fix(playlist): fix broken build. unused vars
grafana_grafana
train
js
67bcfb4772da82679e4b1d1fc4ada34812f60604
diff --git a/aiogram/types/user.py b/aiogram/types/user.py index <HASH>..<HASH> 100644 --- a/aiogram/types/user.py +++ b/aiogram/types/user.py @@ -69,7 +69,7 @@ class User(base.TelegramObject): as_html = True if name is None: - name = self.mention + name = self.full_name if as_html: return markdown.hlink(name, self.url) return markdown.link(name, self.url)
Use User.full_name instead User.mention in User.get_mention() method.
aiogram_aiogram
train
py
d3dbc66ec9b27d97e2180f1c58b16add017d53c7
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -251,7 +251,7 @@ function parseData(chunk, telnetObj, callback) { if (promptIndex === -1 && stringData.length !== 0) { if (search(stringData, telnetObj.pageSeparator) !== -1) { - telnetObj.telnetSocket.write(Buffer('20', 'hex')) + telnetObj.telnetSocket.write(Buffer.from('20', 'hex')) } return @@ -306,7 +306,7 @@ function negotiate(socket, chunk) { negResp = negData.toString('hex').replace(/fd/g, 'fc').replace(/fb/g, 'fd') - if (socket.writable) socket.write(Buffer(negResp, 'hex')) + if (socket.writable) socket.write(Buffer.from(negResp, 'hex')) if (cmdData != undefined) return cmdData else return
use Buffer.from instead of Buffer
mkozjak_node-telnet-client
train
js
6d820b9ff71ca520ab1faa479c9617f95bb0adc3
diff --git a/test/tape/raw.js b/test/tape/raw.js index <HASH>..<HASH> 100644 --- a/test/tape/raw.js +++ b/test/tape/raw.js @@ -71,16 +71,6 @@ test('allows for options in raw queries, #605', function(t) { }) }) -test('undefined named bindings are ignored', function(t) { - - t.plan(2) - - t.equal(raw('select :item from :place', {}).toSQL().sql, 'select :item from :place') - - t.equal(raw('select :item :cool 2 from :place', {item: 'col1'}).toSQL().sql, 'select ? :cool 2 from :place') - -}) - test('raw bindings are optional, #853', function(t) { t.plan(2)
Remove test "undefined named bindings are ignored" as they are no longer ignored.
tgriesser_knex
train
js
e624cdf9ee281dcd3eef962ad4d848c08a83de7a
diff --git a/tests/Gliph/Visitor/DepthFirstBasicVisitorTest.php b/tests/Gliph/Visitor/DepthFirstBasicVisitorTest.php index <HASH>..<HASH> 100644 --- a/tests/Gliph/Visitor/DepthFirstBasicVisitorTest.php +++ b/tests/Gliph/Visitor/DepthFirstBasicVisitorTest.php @@ -88,7 +88,7 @@ class DepthFirstBasicVisitorTest extends SimpleStatefulDepthFirstVisitorTestBase * @covers ::getReachable */ public function testTraversalWithStartPoint() { - DepthFirst::traverse($this->g, $this->vis, $this->v['a']); + DepthFirst::traverse($this->g, $this->vis); $this->assertCount(3, $this->vis->getReachable($this->v['a'])); $this->assertCount(2, $this->vis->getReachable($this->v['b'])); $this->assertCount(0, $this->vis->getReachable($this->v['c']));
Let the DepthFirstVisitor test do find_sources() for coverage.
sdboyer_gliph
train
php
e2a1995aa28adaea48600010cb3d0d4eb4db4040
diff --git a/test/connection.js b/test/connection.js index <HASH>..<HASH> 100644 --- a/test/connection.js +++ b/test/connection.js @@ -15,11 +15,14 @@ describe('connection', function() { }); }); - it('should work in a worker', function(done){ - var worker = new Worker('/test/support/worker.js'); - worker.onmessage = function(e){ - expect(e.data); - done(); - }; - }); + // no `Worker` on old IE + if (global.Worker) { + it('should work in a worker', function(done){ + var worker = new Worker('/test/support/worker.js'); + worker.onmessage = function(e){ + expect(e.data); + done(); + }; + }); + } });
test: disable worker test via feature detection
socketio_engine.io-client
train
js
83fd3a0dcea3cd1a37a2457d685f0b93dc0c7de7
diff --git a/storage.js b/storage.js index <HASH>..<HASH> 100644 --- a/storage.js +++ b/storage.js @@ -687,13 +687,15 @@ function updateMinRetrievableMciAfterStabilizingMci(conn, last_stable_mci, handl findLastBallMciOfMci(conn, last_stable_mci, function(last_ball_mci){ if (last_ball_mci <= min_retrievable_mci) // nothing new return handleMinRetrievableMci(min_retrievable_mci); + var prev_min_retrievable_mci = min_retrievable_mci; min_retrievable_mci = last_ball_mci; // strip content off units older than min_retrievable_mci conn.query( // 'JOIN messages' filters units that are not stripped yet - "SELECT DISTINCT unit, content_hash FROM units JOIN messages USING(unit) WHERE main_chain_index<=? AND sequence='final-bad'", - [min_retrievable_mci], + "SELECT DISTINCT unit, content_hash FROM units JOIN messages USING(unit) \n\ + WHERE main_chain_index<=? AND main_chain_index>=? AND sequence='final-bad'", + [min_retrievable_mci, prev_min_retrievable_mci], function(unit_rows){ var arrQueries = []; async.eachSeries(
narrow mci interval for faster select
byteball_ocore
train
js
8cec7c43b64e4fe2bd8bc643eb7d7957761f030e
diff --git a/Swat/SwatWidgetCellRenderer.php b/Swat/SwatWidgetCellRenderer.php index <HASH>..<HASH> 100644 --- a/Swat/SwatWidgetCellRenderer.php +++ b/Swat/SwatWidgetCellRenderer.php @@ -312,7 +312,7 @@ class SwatWidgetCellRenderer extends SwatCellRenderer implements SwatUIParent, * * @return array an array of widgets indexed by replicator_id */ - public function &getWidgets($widget_id = null) + public function getWidgets($widget_id = null) { $form = $this->getForm(); if ($form !== null && $form->isSubmitted()) {
Don't return reference since it is not needed. svn commit r<I>
silverorange_swat
train
php
d76a980ad6b66c4b31f342608a62b9981108e3e2
diff --git a/Condorcet.class.php b/Condorcet.class.php index <HASH>..<HASH> 100644 --- a/Condorcet.class.php +++ b/Condorcet.class.php @@ -207,13 +207,14 @@ class Condorcet /// - public function __construct ($algo = null) + public function __construct ($method = null) { $this->_method = self::$_class_method ; $this->_options = array() ; $this->_votes = array() ; - $this->_algos = self::add_algos($algo) ; + + $this->setMethod($method) ; }
Bugfix about object method in constructor
julien-boudry_Condorcet
train
php
a230d97b491ace0a828da975b9cbaa5d97517f97
diff --git a/integration-tests/spec/backgroundable_spec.rb b/integration-tests/spec/backgroundable_spec.rb index <HASH>..<HASH> 100644 --- a/integration-tests/spec/backgroundable_spec.rb +++ b/integration-tests/spec/backgroundable_spec.rb @@ -24,7 +24,7 @@ describe "backgroundable tests" do visit "/background" page.should have_content('it worked') @background.publish "release" - result = @foreground.receive(:timeout => 25000) + result = @foreground.receive(:timeout => 60000) result.should == "success" end @@ -32,7 +32,7 @@ describe "backgroundable tests" do visit "/background?redefine=1" page.should have_content('it worked') @background.publish "release" - result = @foreground.receive(:timeout => 25000) + result = @foreground.receive(:timeout => 60000) result.should == "success" end end
More sleep to account for async runtime creation going slow, sometimes.
torquebox_torquebox
train
rb
6177809933591544931e4d6c1a410ddab51afb99
diff --git a/contrib/externs/jquery-1.12_and_2.2.js b/contrib/externs/jquery-1.12_and_2.2.js index <HASH>..<HASH> 100644 --- a/contrib/externs/jquery-1.12_and_2.2.js +++ b/contrib/externs/jquery-1.12_and_2.2.js @@ -1265,9 +1265,10 @@ jQuery.map = function(arg1, callback) {}; jQuery.prototype.map = function(callback) {}; /** - * @param {Array<*>} first - * @param {Array<*>} second - * @return {Array<*>} + * @template T, U + * @param {!Array<T>} first + * @param {!Array<U>} second + * @return {!Array<(T|U)>} */ jQuery.merge = function(first, second) {};
Corrected the type signature of $.merge to indicate that its arguments are mandatory and its return value is never null/undefined ------------- Created by MOE: <URL>
google_closure-compiler
train
js
86ca729e28c77088cb6af9ae0151cbef64541205
diff --git a/examples/app.py b/examples/app.py index <HASH>..<HASH> 100644 --- a/examples/app.py +++ b/examples/app.py @@ -33,9 +33,9 @@ You should execute these commands in the examples-directory. $ pip install invenio-theme $ pip install invenio-assets - $ flask -a app.py bower - $ cd instance - $ bower install + $ flask -a app.py npm + $ cd static + $ npm install $ cd .. $ flask -a app.py collect -v $ flask -a app.py assets build
examples: migration from bower to npm
inveniosoftware_invenio-accounts
train
py
4745f44c8c852c9d90d469bbf0687e03c0d6bf9f
diff --git a/src/main/java/br/com/digilabs/jqplot/chart/AbstractChart.java b/src/main/java/br/com/digilabs/jqplot/chart/AbstractChart.java index <HASH>..<HASH> 100644 --- a/src/main/java/br/com/digilabs/jqplot/chart/AbstractChart.java +++ b/src/main/java/br/com/digilabs/jqplot/chart/AbstractChart.java @@ -413,7 +413,7 @@ public abstract class AbstractChart<T extends ChartData<?>, S extends Serializab * @return AbstractChart */ public AbstractChart<T, S> setFillZero(Boolean fillZero) { - getChartConfiguration().seriesDefaultsInstance().getRendererOptions() + getChartConfiguration().seriesDefaultsInstance().rendererOptionsInstance() .setFillZero(fillZero); return this; }
Change getter of rendererOptions to correct one.
inaiat_jqplot4java
train
java
81394e79a7a53e46acd2ee6b1acb51f68b92ff37
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -172,12 +172,9 @@ class PSHACalculator(base.HazardCalculator): num_tasks = 0 num_sources = 0 src_filter = SourceFilter(tile, oq.maximum_distance) + if num_tiles > 1: + logging.info('Processing tile %d of %d', tile_i, len(tiles)) if self.prefilter: - if num_tiles > 1: - logging.info('Prefiltering tile %d of %d', tile_i, - len(tiles)) - else: - logging.info('Prefiltering sources') with self.monitor('prefiltering'): csm = self.csm.filter(src_filter) else:
Better logging [skip CI]
gem_oq-engine
train
py
2435355fb7432078127ccf70402365df522cafb0
diff --git a/src/Application.php b/src/Application.php index <HASH>..<HASH> 100644 --- a/src/Application.php +++ b/src/Application.php @@ -111,8 +111,9 @@ class Application extends \Pimple\Container ["exception" => $routeNotFound] ); + $response->setStatusCode(404) $response->setContent($this->load404Page()); - return; + throw $routeNotFound; } $this["logger.service"]("System")->info(
set <I> status code and rethrow exception let the output component handle the display of that exception
SlaxWeb_Bootstrap
train
php
cb2682c1cf47edb9adfe693ecaa86191199f746e
diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -40,7 +40,7 @@ module Dummy config.active_support.escape_html_entities_in_json = true # Enable the asset pipeline - config.assets.enabled = true + config.assets.enabled = false # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0'
Disable dummy app asset pipeline MS-<I>
rapid7_metasploit-model
train
rb
347b0f49fcb759493f3faf63d7beb8a905221c79
diff --git a/astrobase/checkplot.py b/astrobase/checkplot.py index <HASH>..<HASH> 100644 --- a/astrobase/checkplot.py +++ b/astrobase/checkplot.py @@ -1393,8 +1393,6 @@ def _pkl_finder_objectinfo(objectinfo, distance_upper_bound=match_xyzdist ) - import ipdb; ipdb.set_trace() - # sort by matchdist mdsorted = np.argsort(matchdists) matchdists = matchdists[mdsorted]
lcproc: add neighbor stuff to parallel_cp workers and driver
waqasbhatti_astrobase
train
py
2cf410ae98dd29fdd17ab775e1aebe4d2f34b20e
diff --git a/includes/class-freemius.php b/includes/class-freemius.php index <HASH>..<HASH> 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -11016,7 +11016,9 @@ $api = $this->get_api_site_scope(); $uid = $this->get_anonymous_id(); - $result = $api->get( "/users/{$this->_site->user_id}.json?uid={$uid}", false, WP_FS__TIME_10_MIN_IN_SEC ); + $request_path = "/users/{$this->_site->user_id}.json?uid={$uid}"; + + $result = $api->get( $request_path, false, WP_FS__TIME_10_MIN_IN_SEC ); if ( $this->is_api_result_entity( $result ) ) { $user = new FS_User( $result ); @@ -11033,7 +11035,7 @@ * Those API errors will continue coming and are not recoverable with the * current site's data. Therefore, extend the API call's cached result to 7 days. */ - $api->update_cache_expiration( "/users/{$this->_site->user_id}.json?uid={$uid}", WP_FS__TIME_WEEK_IN_SEC ); + $api->update_cache_expiration( $request_path, WP_FS__TIME_WEEK_IN_SEC ); } return $result;
[user-recovery] [minor] Added a helper var to store the API request path.
Freemius_wordpress-sdk
train
php
9ee3edbc3f2f546dc40530b51794a67cbcc03983
diff --git a/src/bosh-director/lib/bosh/director/disk_manager.rb b/src/bosh-director/lib/bosh/director/disk_manager.rb index <HASH>..<HASH> 100644 --- a/src/bosh-director/lib/bosh/director/disk_manager.rb +++ b/src/bosh-director/lib/bosh/director/disk_manager.rb @@ -117,8 +117,6 @@ module Bosh::Director end if agent_mounted_disks(instance_model).include?(disk_cid) - @logger.info("Stopping instance '#{instance_model}' before unmount") - agent_client(instance_model).stop @logger.info("Unmounting disk '#{disk_cid}'") agent_client(instance_model).unmount_disk(disk_cid) end
Remove unneeded call to stop in unmount_disk action [#<I>](<URL>)
cloudfoundry_bosh
train
rb
dbdb2e43830df20af4b619cab7cb9736bc33ac17
diff --git a/vstutils/static/js/common.js b/vstutils/static/js/common.js index <HASH>..<HASH> 100644 --- a/vstutils/static/js/common.js +++ b/vstutils/static/js/common.js @@ -1,7 +1,7 @@ function loadQUnitTests() { - $('body').append('<script src=\'' + window.pmStaticPath + 'js/tests/qUnitTest.js\'></script>'); + $('body').append('<script src=\'' + window.guiStaticPath + 'js/tests/qUnitTest.js\'></script>'); var intervaId = setInterval(function() {
fix var name from pmStaticPath to guiStaticPath
vstconsulting_vstutils
train
js
7f8b7d5e97c151eb497f436311b46325afdd50a1
diff --git a/src/bin.js b/src/bin.js index <HASH>..<HASH> 100755 --- a/src/bin.js +++ b/src/bin.js @@ -9,5 +9,5 @@ const cli = meow(` `); (async () => { - await process(await getConfig()); + await process(await getConfig(), cli.flags); })();
Pass CLI flags into config function.
treshugart_conartist
train
js
4db33dd4fc9ded57b82939e4b86fe39bf3c9ac03
diff --git a/vendor/plugins/typo_avatar_gravatar/lib/typo_avatar_gravatar.rb b/vendor/plugins/typo_avatar_gravatar/lib/typo_avatar_gravatar.rb index <HASH>..<HASH> 100644 --- a/vendor/plugins/typo_avatar_gravatar/lib/typo_avatar_gravatar.rb +++ b/vendor/plugins/typo_avatar_gravatar/lib/typo_avatar_gravatar.rb @@ -23,7 +23,7 @@ module TypoPlugins def gravatar_tag(email, options={}) options[:gravatar_id] = Digest::MD5.hexdigest(email.strip) options[:default] = CGI::escape(options[:default]) if options.include?(:default) - options[:size] ||= 60 + options[:size] ||= 48 url = "http://www.gravatar.com/avatar.php?" << options.map { |key,value| "#{key}=#{value}" }.sort.join("&") "<img src=\"#{url}\" class=\"avatar gravatar\" />"
Typo expects avatars to be <I> pixels by default
publify_publify
train
rb
52bab82d7d451ffe48b70c15abd422f7a7cc6d6c
diff --git a/imbox/__init__.py b/imbox/__init__.py index <HASH>..<HASH> 100644 --- a/imbox/__init__.py +++ b/imbox/__init__.py @@ -13,6 +13,7 @@ class Imbox(object): def logout(self): + self.connection.close() self.connection.logout() def query_uids(self, **kwargs):
imbox: call close() before logout The imaplib documentation recommends calling close() before logout to ensure that 'deleted messages are removed from writable mailbox.'
martinrusev_imbox
train
py
02da4f54b67f7bf7b360063800c06e9a87d16a20
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ EXTRA_REQUIREMENTS = { 'cli': ['click', 'requests'], 'html': ['lxml'], # apt: libxslt-dev libxml2-dev 'ods': ['lxml'], - 'parquet': ['parquet'], + 'parquet': ['parquet>=1.1'], 'xls': ['xlrd', 'xlwt'], 'xlsx': ['openpyxl'], 'xpath': ['lxml'],
Force parquet version to the new one Starting from version <I>, it supports Python 3.
turicas_rows
train
py
4a5ce536a3fa2ae9ca98bac56adc91672218ef41
diff --git a/src/View/Helper/MenuHelper.php b/src/View/Helper/MenuHelper.php index <HASH>..<HASH> 100644 --- a/src/View/Helper/MenuHelper.php +++ b/src/View/Helper/MenuHelper.php @@ -1,6 +1,7 @@ <?php namespace Menu\View\Helper; +use Cake\Core\Configure; use Cake\View\Helper; use Cake\View\View; @@ -14,6 +15,7 @@ class MenuHelper extends Helper */ public function getMenu($name) { + $allControllers = Configure::readOrFail('Menu.allControllers'); $menu = []; // get all controllers $controllers = $this->_getAllControllers(); @@ -21,6 +23,10 @@ class MenuHelper extends Helper if (is_callable([$controller, 'getMenu'])) { $menu = array_merge($menu, $controller::getMenu($name)); } + + if (!$allControllers) { + break; + } } return $menu; }
add logic for calling getMenu method from all controllers or from a single one (ask #<I>)
QoboLtd_cakephp-menu
train
php
3e8fb63997bd525f760fbf0bad1b13fa85084059
diff --git a/lib/service_mock/server.rb b/lib/service_mock/server.rb index <HASH>..<HASH> 100644 --- a/lib/service_mock/server.rb +++ b/lib/service_mock/server.rb @@ -43,7 +43,7 @@ module ServiceMock class Server include CommandLineOptions - attr_accessor :inherit_io, :wait_for_process, :remote_host, :classpath + attr_accessor :inherit_io, :wait_for_process, :remote_host, :classpath, :use_ssl attr_reader :wiremock_version, :working_directory, :process attr_accessor :proxy_addr, :proxy_port, :proxy_user, :proxy_pass @@ -52,6 +52,7 @@ module ServiceMock @working_directory = working_directory self.inherit_io = false self.wait_for_process = false + self.use_ssl = false end # @@ -215,10 +216,13 @@ module ServiceMock def http if using_proxy - return Net::HTTP.Proxy(proxy_addr, proxy_port, + http = Net::HTTP.Proxy(proxy_addr, proxy_port, proxy_user, proxy_pass) + else + http = Net::HTTP.new(admin_host, admin_port) end - Net::HTTP.new(admin_host, admin_port) + http.use_ssl = use_ssl + http end def using_proxy
added flag for use_ssl
cheezy_service_mock
train
rb
5e01f04e129385eb797e3735760b8e13cb1769d9
diff --git a/state/pool.go b/state/pool.go index <HASH>..<HASH> 100644 --- a/state/pool.go +++ b/state/pool.go @@ -10,6 +10,7 @@ import ( "sync" "time" + "github.com/juju/clock" "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/pubsub" @@ -185,6 +186,11 @@ func OpenStatePool(args OpenParams) (*StatePool, error) { return pool, nil } +// Clock returns the clock used by the system state. +func (p *StatePool) Clock() clock.Clock { + return p.systemState.clock() +} + // Get returns a PooledState for a given model, creating a new State instance // if required. // If the State has been marked for removal, an error is returned.
Allow access to the StatePool's clock.
juju_juju
train
go
3863d1701286ee388f77cd8db641ed0ca46f5401
diff --git a/graphdb/src/test/java/com/orientechnologies/orient/graph/blueprints/TestLoadGraph.java b/graphdb/src/test/java/com/orientechnologies/orient/graph/blueprints/TestLoadGraph.java index <HASH>..<HASH> 100755 --- a/graphdb/src/test/java/com/orientechnologies/orient/graph/blueprints/TestLoadGraph.java +++ b/graphdb/src/test/java/com/orientechnologies/orient/graph/blueprints/TestLoadGraph.java @@ -13,7 +13,7 @@ import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; public class TestLoadGraph { private static final String INPUT_FILE = "target/test-classes/graph-example-2.xml"; - private static final String DBURL = "plocal:target/databases/tinkerpop"; + private static final String DBURL = "plocal:target/databases/GratefulDeadConcerts"; private String inputFile = INPUT_FILE; private String dbURL = DBURL;
Renamed "tinkerpop" database -> "GratefulDeadConcerts"
orientechnologies_orientdb
train
java
2dc65abbb0f362ee21787e488102af11090ca517
diff --git a/lib/ascii-data-tools/record_type.rb b/lib/ascii-data-tools/record_type.rb index <HASH>..<HASH> 100644 --- a/lib/ascii-data-tools/record_type.rb +++ b/lib/ascii-data-tools/record_type.rb @@ -66,10 +66,14 @@ module AsciiDataTools end end - class Type + module FixedLengthType include RecordDecoder include RecordEncoder include Normaliser + end + + class Type + include FixedLengthType attr_reader :name def initialize(name, fields = [])
extracted the fixed length type-specific modules into own module
benilovj_ascii-data-tools
train
rb
d5d7499c41f7a59c2d46fded41d981a10ab63d3e
diff --git a/test/runtime/kvstore.go b/test/runtime/kvstore.go index <HASH>..<HASH> 100644 --- a/test/runtime/kvstore.go +++ b/test/runtime/kvstore.go @@ -25,7 +25,7 @@ import ( "github.com/sirupsen/logrus" ) -var _ = Describe("RuntimeKVStoreTest", func() { +var _ = Describe("RuntimeValidatedKVStoreTest", func() { var once sync.Once var logger *logrus.Entry
test/runtime: mark KVStore test as validated
cilium_cilium
train
go
8e72d84256446175ff8f4687841ac28ab5372ec7
diff --git a/aframe.js b/aframe.js index <HASH>..<HASH> 100644 --- a/aframe.js +++ b/aframe.js @@ -1548,16 +1548,20 @@ var aFrame = function(){ }, database : database, el : el, + fx : fx, + json : json, + label : label, listener : { add : observer.add, list : observer.list, remove : observer.remove, replace : observer.replace }, - fx : fx, - json : json, - label : label, - number : number, + number : number, + state : { + header : null, + pattern : /^.*$/ + }, spinner : { create : client.spinner, url : null
Refactored the closure by moving listener{} and created state{} which will be used to implement stateful binding in observer{}.
avoidwork_abaaso
train
js
72efbc775e97e649c00403d425888fd9d4e27bfa
diff --git a/color.js b/color.js index <HASH>..<HASH> 100644 --- a/color.js +++ b/color.js @@ -277,7 +277,7 @@ Color.prototype = { clone: function() { return new Color(this.rgb()); - }, + } } @@ -305,7 +305,7 @@ Color.prototype.setValues = function(space, vals) { "rgb": [255, 255, 255], "hsl": [360, 100, 100], "hsv": [360, 100, 100], - "cmyk": [100, 100, 100, 100], + "cmyk": [100, 100, 100, 100] }; var alpha = 1;
remove useless commas, make IE family happy
Qix-_color
train
js
76d3a2d63984e89e5ac06cc2e59d677faac9a7da
diff --git a/src/org/openscience/cdk/modeling/forcefield/IPotentialFunction.java b/src/org/openscience/cdk/modeling/forcefield/IPotentialFunction.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/modeling/forcefield/IPotentialFunction.java +++ b/src/org/openscience/cdk/modeling/forcefield/IPotentialFunction.java @@ -18,6 +18,7 @@ public interface IPotentialFunction { GVector energyGradient = null; //Gradient of the energy function in a 3xN point. GMatrix energyHessian = null; double[] forHessian = null; + int functionEvaluationNumber = 0; /** diff --git a/src/org/openscience/cdk/test/modeling/forcefield/TestPotentialFunction.java b/src/org/openscience/cdk/test/modeling/forcefield/TestPotentialFunction.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/test/modeling/forcefield/TestPotentialFunction.java +++ b/src/org/openscience/cdk/test/modeling/forcefield/TestPotentialFunction.java @@ -22,6 +22,7 @@ public class TestPotentialFunction implements IPotentialFunction { double[] forHessian = null; GMatrix order2ndErrorApproximateHessian = null; double[] forOrder2ndErrorApproximateHessian = null; + int functionEvaluationNumber = 0; /**
The variable functionEvaluationNumber was included in the PotentialFunction interface. git-svn-id: <URL>
cdk_cdk
train
java,java
c5319fc379885834682685447c9c72911b27b69f
diff --git a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php index <HASH>..<HASH> 100644 --- a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php @@ -1264,7 +1264,9 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse Type::fixUpLocalType( $docblock_info->mixin, $this->aliases, - $this->class_template_types + $this->class_template_types, + $this->type_aliases, + $fq_classlike_name ), null, $this->class_template_types
fix: mixin parameter of self should be properly resolved (#<I>)
vimeo_psalm
train
php
4c09de2bb007db20bc6f122c15a090aef220cd32
diff --git a/sprout/lib/sprout.rb b/sprout/lib/sprout.rb index <HASH>..<HASH> 100644 --- a/sprout/lib/sprout.rb +++ b/sprout/lib/sprout.rb @@ -9,10 +9,15 @@ require 'rake/clean' # includes open-uri, while older versions do not. # When open-uri is included twice, we get a bunch of nasty # warnings because constants are being overwritten. -if(Gem::Version.new(Gem::RubyGemsVersion) != Gem::Version.new('1.0.1')) +gem_version = Gem::Version.new(Gem::RubyGemsVersion) +if(gem_version != Gem::Version.new('1.0.1')) require 'open-uri' end +if(gem_version < Gem::Version.new('1.3.5')) + puts "[WARNING] You need to update your version of RubyGems: sudo gem update --system" +end + $:.unshift(File.dirname(__FILE__)) require 'sprout/dynamic_accessors' require 'progress_bar'
Added warning if version of RubyGems is less than <I>
lukebayes_project-sprouts
train
rb
1a118e57734e66547c430a85bce881c0f11016b5
diff --git a/spec/gibbon/gibbon_spec.rb b/spec/gibbon/gibbon_spec.rb index <HASH>..<HASH> 100644 --- a/spec/gibbon/gibbon_spec.rb +++ b/spec/gibbon/gibbon_spec.rb @@ -73,7 +73,7 @@ describe Gibbon do expect(@gibbon.proxy).to be_nil end - it "sets an proxy url key from the 'MAILCHIMP_PROXY_URL' ENV variable" do + it "sets a proxy url key from the 'MAILCHIMP_PROXY' ENV variable" do ENV['MAILCHIMP_PROXY'] = @proxy @gibbon = Gibbon::Request.new expect(@gibbon.proxy).to eq(@proxy)
fix typo MAILCHIMP_PROXY in spec
amro_gibbon
train
rb
a500e2946ae0c24d82242ec075d02a3e993e81c5
diff --git a/python/phonenumbers/__init__.py b/python/phonenumbers/__init__.py index <HASH>..<HASH> 100644 --- a/python/phonenumbers/__init__.py +++ b/python/phonenumbers/__init__.py @@ -146,7 +146,7 @@ from .phonenumbermatcher import PhoneNumberMatch, PhoneNumberMatcher, Leniency # Version number is taken from the upstream libphonenumber version # together with an indication of the version of the Python-specific code. -__version__ = "8.12.47" +__version__ = "8.12.48" __all__ = ['PhoneNumber', 'CountryCodeSource', 'FrozenPhoneNumber', 'REGION_CODE_FOR_NON_GEO_ENTITY', 'NumberFormat', 'PhoneNumberDesc', 'PhoneMetadata',
Prep for <I> release
daviddrysdale_python-phonenumbers
train
py
88208bfee8aab96825368cc8a27c1fe3b7740982
diff --git a/salmonella/widgets.py b/salmonella/widgets.py index <HASH>..<HASH> 100644 --- a/salmonella/widgets.py +++ b/salmonella/widgets.py @@ -1,11 +1,15 @@ from django.conf import settings from django.contrib.admin import widgets -from django.urls import reverse, NoReverseMatch from django.core.exceptions import ImproperlyConfigured from django.template.loader import render_to_string from django import VERSION try: + from django.urls import reverse, NoReverseMatch +except ImportError: + from django.core.urlresolvers import reverse, NoReverseMatch + +try: from django.utils.encoding import force_text except ImportError: from django.utils.encoding import force_unicode as force_text
Backwards compatibility for Django <<I> In order to preserve compatibility with Django before the <I> release, catch import errors when importing from `django.urls` and use `django.core.urlresolvers` instead.
lincolnloop_django-dynamic-raw-id
train
py
4d665f59b0dad088025cdcefc544dd9ad7f73b85
diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index <HASH>..<HASH> 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -258,7 +258,10 @@ class Locker $lock['packages-dev'] = $this->lockPackages($devPackages); } - if (empty($lock['packages']) && empty($lock['packages-dev'])) { + $lock['platform'] = $platformReqs; + $lock['platform-dev'] = $platformDevReqs; + + if (empty($lock['packages']) && empty($lock['packages-dev']) && empty($lock['platform']) && empty($lock['platform-dev'])) { if ($this->lockFile->exists()) { unlink($this->lockFile->getPath()); } @@ -266,9 +269,6 @@ class Locker return false; } - $lock['platform'] = $platformReqs; - $lock['platform-dev'] = $platformDevReqs; - if (!$this->isLocked() || $lock !== $this->getLockData()) { $this->lockFile->write($lock); $this->lockDataCache = null;
Create lock if we only have platform dependencies
mothership-ec_composer
train
php
9c530f3d56f3afc3641f3461aa30f15b671f688e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -2,8 +2,8 @@ from setuptools import setup setup( name='django-extra-views', - version='0.6.1', - url='https://github.com/miguelrestrepo/django-extra-views', + version='0.6.2', + url='https://github.com/AndrewIngram/django-extra-views', install_requires=[ 'Django >=1.3', ],
corrected url in setup.py
AndrewIngram_django-extra-views
train
py
67c3b12da7628ed679cee0060c9ab13412d9112c
diff --git a/src/TwitterApio.php b/src/TwitterApio.php index <HASH>..<HASH> 100644 --- a/src/TwitterApio.php +++ b/src/TwitterApio.php @@ -50,9 +50,9 @@ class TwitterApio extends tmhOAuth public function __construct($settings = [], $config = []) { include dirname(__DIR__) . '/config/config.php'; - $this->general_config = array_merge($general_config, $twitter_settings); - $this->general_config = array_merge($this->general_config, $config); - + $this->general_config = array_merge($general_config, $twitter_settings); // Original twitter settings from config file + $this->general_config = array_merge($this->general_config, $settings); // Supplied Oauth settings + $this->general_config = array_merge($this->general_config, $config); // Supplied app settings. parent::__construct(array_merge($twitter_settings, $settings)); }
Fix missing merge from twitter settings into general config.
j3j5_twitterapio
train
php
210013c722b9827e6b02cb9aa2eed89b4d0fb973
diff --git a/indra/sources/biopax/api.py b/indra/sources/biopax/api.py index <HASH>..<HASH> 100644 --- a/indra/sources/biopax/api.py +++ b/indra/sources/biopax/api.py @@ -157,6 +157,8 @@ def process_owl(owl_filename): A BiopaxProcessor containing the obtained BioPAX model in bp.model. """ model = pcc.owl_to_model(owl_filename) + if model is None: + return None return process_model(model)
Don't process file if it can't be opened
sorgerlab_indra
train
py
c29d88bf1a86bd62e724403c25c9bbac6bc91e2c
diff --git a/src/main/java/org/dasein/cloud/azure/compute/image/AzureOSImage.java b/src/main/java/org/dasein/cloud/azure/compute/image/AzureOSImage.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/dasein/cloud/azure/compute/image/AzureOSImage.java +++ b/src/main/java/org/dasein/cloud/azure/compute/image/AzureOSImage.java @@ -355,7 +355,7 @@ public class AzureOSImage extends AbstractImageSupport { @Nonnull @Override public Iterable<MachineImage> listImages(@Nullable ImageFilterOptions imageFilterOptions) throws CloudException, InternalException { - if (!imageFilterOptions.getImageClass().equals(ImageClass.MACHINE)) { + if (imageFilterOptions.getImageClass() != null && !imageFilterOptions.getImageClass().equals(ImageClass.MACHINE)) { return Collections.emptyList(); }
Avoid an NPE when image class not set in filter options
dasein-cloud_dasein-cloud-azure
train
java
e8bea5cc1e01c8ad26281a2b7fb8d6bcc3972503
diff --git a/lib/socket.js b/lib/socket.js index <HASH>..<HASH> 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -388,10 +388,9 @@ if (wasConnected) { this.transport.clearTimeouts(); - this.publish('disconnect', reason); - if (this.options.reconnect && !this.reconnecting) { + if ('booted' != reason && this.options.reconnect && !this.reconnecting) { this.reconnect(); } }
Fixed; avoid reconnection on forced client disconnections (both for when the server kicks a client and the client disconnects itself.
tsjing_socket.io-client
train
js
d7d116b80afa8976952c05087584ff18e14ae1d7
diff --git a/simuvex/s_helpers.py b/simuvex/s_helpers.py index <HASH>..<HASH> 100644 --- a/simuvex/s_helpers.py +++ b/simuvex/s_helpers.py @@ -13,18 +13,25 @@ l = logging.getLogger("s_helpers") ### Helper functions ### ######################## -# Returns size, in BYTES, of a type -def get_size(t): +def size_bits(t): + '''Returns size, in BITS, of a type.''' for s in 256, 128, 64, 32, 16, 8, 1: if str(s) in t: - return s/8 + return s raise Exception("Unable to determine length of %s." % t) +def size_bytes(t): + '''Returns size, in BYTES, of a type.''' + s = size_bits(t) + if s == 1: + raise Exception("size_bytes() is seeing a bit!") + return s/8 + def translate_irconst(c): - size = get_size(c.type) + size = size_bits(c.type) t = type(c.value) if t in (int, long): - return symexec.BitVecVal(c.value, size*8) + return symexec.BitVecVal(c.value, size) raise Exception("Unsupported constant type: %s" % type(c.value)) def flip_bytes(mem_expr):
split get_size into size_bytes and size_bits
angr_angr
train
py
8c5f42f058ee1e8d80f10883b98c72c062843f31
diff --git a/src/processors/save.js b/src/processors/save.js index <HASH>..<HASH> 100644 --- a/src/processors/save.js +++ b/src/processors/save.js @@ -27,10 +27,12 @@ options || (options = {}); options.purge = options.purge !== false; - if (!isDir && linq(outputs).count().run() > 1) { + if (!isDir && linq(inputs.all).count().run() > 1) { return callback(new Error('Cannot save multiple outputs to a single file, consider append / to the output path')); } + outputs = {}; + // Delete orphaned files from output async.series([ function (callback) { @@ -38,11 +40,7 @@ var outputFilename = isDir ? path.join(dirpath, filename).replace(/\\/g, '/') : dirpath; fs.unlink(path.resolve(outputdir, outputFilename), function (err) { - if (!err || err.code === 'ENOENT') { - outputs[outputFilename] = err = null; - } - - callback(err); + callback(err && err.code !== 'ENOENT' ? err : null); }); }, null).run(callback); },
Save processor should not reuse cached outputs
candrholdings_publishjs
train
js
bc5a5c3f1f4da0a816021dc9a4a04fba34a261ec
diff --git a/lib/sub_diff/adapter.rb b/lib/sub_diff/adapter.rb index <HASH>..<HASH> 100644 --- a/lib/sub_diff/adapter.rb +++ b/lib/sub_diff/adapter.rb @@ -2,7 +2,7 @@ module SubDiff class Adapter extend Forwardable - def_delegators :@differ, :builder + def_delegators :differ, :builder def_delegators :builder, :type def_delegators :instance, :diff
Refer to method instead of ivar
shuber_sub_diff
train
rb
8deb5c2cecda28dd1511767d4282cb9fabded93e
diff --git a/aws/data_source_aws_outposts_site_test.go b/aws/data_source_aws_outposts_site_test.go index <HASH>..<HASH> 100644 --- a/aws/data_source_aws_outposts_site_test.go +++ b/aws/data_source_aws_outposts_site_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/outposts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSOutpostsSiteDataSource_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsSites(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -34,6 +36,7 @@ func TestAccAWSOutpostsSiteDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsSites(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{
tests/ds/outposts_site: Add ErrorCheck
terraform-providers_terraform-provider-aws
train
go
47caddefce106e70cf24163f597cf5f4f40ec436
diff --git a/lib/modifier.js b/lib/modifier.js index <HASH>..<HASH> 100644 --- a/lib/modifier.js +++ b/lib/modifier.js @@ -24,6 +24,8 @@ util.inherits(Modifier, Pipeline); //Internals +Modifier.prototype._aggregatePluginResults = SerializationPlugin.getHtml; + Modifier.prototype._enablePlugin = function (plugin, replacer) { if (!this._isPluginEnabled(plugin)) { var serializationPluginIdx = this.plugins.indexOf(SerializationPlugin); @@ -34,7 +36,6 @@ Modifier.prototype._enablePlugin = function (plugin, replacer) { } }; -Modifier.prototype._aggregatePluginResults = SerializationPlugin.getHtml;
Swap code lines FTW =)
inikulin_ineed
train
js
06cc4e177e4f15413c9288e6893a1144c5fc1865
diff --git a/lib/resource/Application.js b/lib/resource/Application.js index <HASH>..<HASH> 100644 --- a/lib/resource/Application.js +++ b/lib/resource/Application.js @@ -12,6 +12,9 @@ Application.prototype.authenticateAccount = function authenticateApplicationAcco username = authcRequest.username, password = authcRequest.password, type = authcRequest.type || 'basic'; + var accountStore = ('string' === typeof authcRequest.accountStore) ? + {href: authcRequest.accountStore} : + authcRequest.accountStore; var loginAttempt = { type: type, @@ -19,7 +22,7 @@ Application.prototype.authenticateAccount = function authenticateApplicationAcco }; if (authcRequest.accountStore){ - loginAttempt.accountStore = authcRequest.accountStore; + loginAttempt.accountStore = accountStore } _this.dataStore.createResource(_this.loginAttempts.href, {expand: 'account'}, loginAttempt, require('./AuthenticationResult'), callback);
added support of authcRequest.accountStore param as string
stormpath_stormpath-sdk-node
train
js
abeba0a1de8e276255beba46b048627a4f529720
diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go index <HASH>..<HASH> 100644 --- a/core/rawdb/schema.go +++ b/core/rawdb/schema.go @@ -29,10 +29,10 @@ var ( // databaseVerisionKey tracks the current database version. databaseVerisionKey = []byte("DatabaseVersion") - // headHeaderKey tracks the latest know header's hash. + // headHeaderKey tracks the latest known header's hash. headHeaderKey = []byte("LastHeader") - // headBlockKey tracks the latest know full block's hash. + // headBlockKey tracks the latest known full block's hash. headBlockKey = []byte("LastBlock") // headFastBlockKey tracks the latest known incomplete block's hash during fast sync.
core/rawdb: fix typo (#<I>)
ethereum_go-ethereum
train
go
5ef8d571b7c8031da2b162b3647180d2b4932d26
diff --git a/lib/po2icu.js b/lib/po2icu.js index <HASH>..<HASH> 100644 --- a/lib/po2icu.js +++ b/lib/po2icu.js @@ -71,7 +71,7 @@ module.exports = { format = msg.comments.flag; } var msgid = msg.msgid; - var msgstr = msg.msgstr; + var msgstr = msg.msgstr[0]; var icuId = ''; var icuStr = ''; @@ -80,9 +80,12 @@ module.exports = { icuId = this.pythonToICU(msgid); icuStr = this.pythonToICU(msgstr); } - if (format.match(/c-format/g) !== null) { + else if (format.match(/c-format/g) !== null) { icuId = this.pythonToICU(msgid); icuStr = this.pythonToICU(msgstr); + } else { + icuId = msgid; + icuStr = msgstr; } var icuObject = {'icuId': icuId, 'icuStr': icuStr};
Get string from msgstr array since it's an array
LLK_po2icu
train
js
a609418f40272c12c11c1191476346e79e260cc7
diff --git a/gem-proxy/src/main/java/de/saumya/mojo/proxy/Controller.java b/gem-proxy/src/main/java/de/saumya/mojo/proxy/Controller.java index <HASH>..<HASH> 100644 --- a/gem-proxy/src/main/java/de/saumya/mojo/proxy/Controller.java +++ b/gem-proxy/src/main/java/de/saumya/mojo/proxy/Controller.java @@ -187,8 +187,12 @@ public class Controller { if(filename.endsWith(SHA1) || filename.endsWith(".pom")){ File local = new File(localStorage, filename); if(!local.exists()){ - if (!createFiles(parts[2], parts[3])){ - return new FileLocation(filename + " is being generated", Type.TEMP_UNAVAILABLE); + try { + if (!createFiles(parts[2], parts[3])){ + return new FileLocation(filename + " is being generated", Type.TEMP_UNAVAILABLE); + } + } catch (FileNotFoundException e) { + return notFound("not found"); } } return new FileLocation(local, filename.endsWith(SHA1)? Type.ASCII_FILE: Type.XML_FILE);
Return <I> instead of <I> from the gem proxy when asked for files it doesn't have
torquebox_jruby-maven-plugins
train
java
abc875365c6ae0f27f866e5fef2d22cbffe4d094
diff --git a/google-cloud-storage/lib/google/cloud/storage/file/verifier.rb b/google-cloud-storage/lib/google/cloud/storage/file/verifier.rb index <HASH>..<HASH> 100644 --- a/google-cloud-storage/lib/google/cloud/storage/file/verifier.rb +++ b/google-cloud-storage/lib/google/cloud/storage/file/verifier.rb @@ -50,7 +50,7 @@ module Google end def self.md5_for local_file - if local_file.respond_to? :path + if local_file.respond_to? :to_path ::File.open Pathname(local_file).to_path, "rb" do |f| ::Digest::MD5.file(f).base64digest end @@ -63,7 +63,7 @@ module Google end def self.crc32c_for local_file - if local_file.respond_to? :path + if local_file.respond_to? :to_path ::File.open Pathname(local_file).to_path, "rb" do |f| ::Digest::CRC32c.file(f).base64digest end
fix(storage): Update File::Verifier to test for File#to_path closes: #<I>
googleapis_google-cloud-ruby
train
rb
e4ecb8bce88fb8a30e220ce6b49bffcdb5f0678d
diff --git a/Kwf/Config.php b/Kwf/Config.php index <HASH>..<HASH> 100644 --- a/Kwf/Config.php +++ b/Kwf/Config.php @@ -11,6 +11,10 @@ class Kwf_Config $cfg = Kwf_Registry::get('config'); foreach (explode('.', $var) as $i) { + if (!isset($cfg->$i)) { + $cfg = null; + break; + } $cfg = $cfg->$i; } if ($cfg) {
change Kwf_Config::getValueArray to not cause error if parent setting doesn't exist, like getValue does
koala-framework_koala-framework
train
php