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
f7a785011f54ed98b6c479e8973b8ea4efd78620
diff --git a/tests/test_doitlive.py b/tests/test_doitlive.py index <HASH>..<HASH> 100644 --- a/tests/test_doitlive.py +++ b/tests/test_doitlive.py @@ -146,7 +146,7 @@ class TestPlayer: def test_unalias(self, runner): user_input = random_string(len("foo")) result = run_session(runner, "unalias.session", user_input) - # nonzero exit code becuase 'foo' is no longer aliased + # nonzero exit code because 'foo' is no longer aliased assert result.exit_code != 0 assert "foobarbazquux" not in result.output
docs: fix simple typo, becuase -> because (#<I>) There is a small typo in tests/test_doitlive.py. Should read `because` rather than `becuase`.
sloria_doitlive
train
py
76c588c640c75546f115e3721d637b362a85d090
diff --git a/src/Towel/Tests/CacheTest.php b/src/Towel/Tests/CacheTest.php index <HASH>..<HASH> 100644 --- a/src/Towel/Tests/CacheTest.php +++ b/src/Towel/Tests/CacheTest.php @@ -34,6 +34,6 @@ class CacheTest extends \PHPUnit_Framework_TestCase { $cache = get_app()->getCache(); $cache->clear(); - $this->assertTrue(is_array($cache->getDriverInstance()->getAllKeys()), 'Get all keys returned false'); + $this->assertTrue(is_array($cache->getDriverInstance()->getAllKeys()), 'Get all keys returned false, Is the memcached service running ?'); } } \ No newline at end of file
All tests went ok! :)
42mate_towel
train
php
697ce72e1b7ce157f2fe3dae63f1fee9db6793be
diff --git a/lib/UnexpectedError.js b/lib/UnexpectedError.js index <HASH>..<HASH> 100644 --- a/lib/UnexpectedError.js +++ b/lib/UnexpectedError.js @@ -60,15 +60,22 @@ UnexpectedError.prototype.getDefaultErrorMessage = function (compact) { UnexpectedError.prototype.getNestedErrorMessage = function (compact) { var message = this.expect.output.clone(); if (this.assertion) { - message.append(this.assertion.standardErrorMessage()); + message.append(this.assertion.standardErrorMessage(compact)); } else { message.append(this.output); } - var parentCompact = this.parent && this.parent.subject === this.subject; + var parent = this.parent; + while (parent.errorMode === 'bubble') { + parent = parent.parent; + } + var parentCompact = + this.assertion && parent.assertion && + this.assertion.subject === parent.assertion.subject; + message.nl() .indentLines() - .i().block(this.parent.getErrorMessage(parentCompact)); + .i().block(parent.getErrorMessage(parentCompact)); return message; };
Make the compact mode work properly with error mode bubble
unexpectedjs_unexpected
train
js
2837deba375570b961b9a736a4bac57bd52d2142
diff --git a/libraries/Maniaplanet/DedicatedServer/Structures/ServerOptions.php b/libraries/Maniaplanet/DedicatedServer/Structures/ServerOptions.php index <HASH>..<HASH> 100644 --- a/libraries/Maniaplanet/DedicatedServer/Structures/ServerOptions.php +++ b/libraries/Maniaplanet/DedicatedServer/Structures/ServerOptions.php @@ -4,7 +4,7 @@ * * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3 */ - + namespace Maniaplanet\DedicatedServer\Structures; class ServerOptions extends AbstractStructure @@ -39,4 +39,6 @@ class ServerOptions extends AbstractStructure public $nextUseChangingValidationSeed; public $clientInputsMaxLatency; public $keepPlayerSlots; + public $disableHorns; + public $disableServiceAnnounces; } \ No newline at end of file
Update ServerOptions to match with server output
maniaplanet_dedicated-server-api
train
php
358f655568160925f08f74cb8bef152d8f73de04
diff --git a/tibber/__init__.py b/tibber/__init__.py index <HASH>..<HASH> 100644 --- a/tibber/__init__.py +++ b/tibber/__init__.py @@ -93,8 +93,11 @@ class Tibber: _LOGGER.error("Error connecting to Tibber, resp code: %s", resp.status) return None result = await resp.json() - except (asyncio.TimeoutError, aiohttp.ClientError) as err: - _LOGGER.error("Error connecting to Tibber: %s", err) + except aiohttp.ClientError as err: + _LOGGER.error("Error connecting to Tibber: %s, %s", err, document) + raise + except asyncio.TimeoutError as err: + _LOGGER.error("Timed out when connecting to Tibber: %s, %s", err, document) raise errors = result.get('errors') if errors:
Improve err logging (#<I>) * Improve err handling * document
Danielhiversen_pyTibber
train
py
15fda6e2de5500794ab5b93598f9c5115573058b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup setup( name='ostd', @@ -15,8 +15,9 @@ setup( ], keywords='opensubtitles', - py_modules=['ostd'], - requires=[ + packages=['ostd'], + + install_requires=[ 'chardet' ] )
Change from distutils to setuputils
Fylipp_ostd
train
py
6f1ea29e260ead0b4a37f889821e625f5eec83ae
diff --git a/src/components/ChangePasswordForm.js b/src/components/ChangePasswordForm.js index <HASH>..<HASH> 100644 --- a/src/components/ChangePasswordForm.js +++ b/src/components/ChangePasswordForm.js @@ -53,8 +53,7 @@ export default class ChangePasswordForm extends React.Component { state = { spToken: null, fields: { - password: '', - confirmPassword: undefined + password: '' }, errorMessage: null, isFormSent: false, @@ -86,7 +85,7 @@ export default class ChangePasswordForm extends React.Component { // then simply default to what we have in state. data = data || this.state.fields; - if (data.confirmPassword !== undefined && data.password !== data.confirmPassword) { + if ('confirmPassword' in data && data.password !== data.confirmPassword) { return this.setState({ isFormProcessing: false, errorMessage: 'Passwords does not match.'
fix issue with optional password confirmation in ChangePasswordForm
stormpath_stormpath-sdk-react
train
js
c9bd5078268e045be2a7ebc0d7d9fcda8cae7ab4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,14 @@ from distutils.core import setup, Extension +import platform, os + +platform_version = list(platform.python_version_tuple())[0:2] +if platform_version != ['2', '7']: + print 'pygetdns requires Python version 2.7. Exiting ... ' + os._exit(1) + +long_description = ( 'pygetdns is a set of wrappers around the getdns' + 'library (http://www.getdnsapi.net), providing' + 'Python language bindings for the API') CFLAGS = [ '-g' ] module1 = Extension('getdns', @@ -10,6 +20,8 @@ module1 = Extension('getdns', ) setup(name='PackageName', - version='0.1', - description='getdns interface', + version='0.1.0', + description='pygetdns Python bindings for getdns', + long_description=long_description, + url='http://www.getdnsapi.net', ext_modules = [ module1 ])
added a version check, beefed up the description, verified install success
getdnsapi_getdns-python-bindings
train
py
806426b9e8feb9aaf6acf6586443ac164bb0c83d
diff --git a/steam/Client.js b/steam/Client.js index <HASH>..<HASH> 100644 --- a/steam/Client.js +++ b/steam/Client.js @@ -5,7 +5,6 @@ module.exports = (function (undefined){ mixin = require('./helpers').mixin, http_build_query = require('./helpers').http_build_query, apiKey, - url, method, version, apiFormat, @@ -36,11 +35,11 @@ module.exports = (function (undefined){ }; Client.prototype.getUrl = function getUrl(){ - return url; + return this.url; }; Client.prototype.setUrl = function setUrl(value){ - url = value; + this.url = value; }; Client.prototype.getInterface = function getInterface(){
Client's url isn't global.
DPr00f_steam-api-node
train
js
71805d2966c80cd8226c1479e92ba4002c36b588
diff --git a/graylog2-server/src/main/java/org/graylog2/inputs/codecs/SyslogCodec.java b/graylog2-server/src/main/java/org/graylog2/inputs/codecs/SyslogCodec.java index <HASH>..<HASH> 100644 --- a/graylog2-server/src/main/java/org/graylog2/inputs/codecs/SyslogCodec.java +++ b/graylog2-server/src/main/java/org/graylog2/inputs/codecs/SyslogCodec.java @@ -234,7 +234,7 @@ public class SyslogCodec extends AbstractCodec { CK_FORCE_RDNS, "Force rDNS?", false, - "Force rDNS resolution of hostname? Use if hostname cannot be parsed." + "Force rDNS resolution of hostname? Use if hostname cannot be parsed. (Be careful if you are sending DNS logs into this input because it can cause a feedback loop.)" ) );
Add note about possible rDNS feedback loop (#<I>) Trying to do rDNS lookups for DNS logs will cause more DNS logs which will cause more rDNS lookups which will ... See: <URL>
Graylog2_graylog2-server
train
java
4da35190c347679fe8b0075fc8a68659f4797933
diff --git a/pykechain/client.py b/pykechain/client.py index <HASH>..<HASH> 100644 --- a/pykechain/client.py +++ b/pykechain/client.py @@ -112,11 +112,11 @@ class Client(object): return self.last_response - def scopes(self, name=None, id=None, status='ACTIVE'): + def scopes(self, name=None, pk=None, status='ACTIVE'): """Return all scopes visible / accessible for the logged in user. :param name: if provided, filter the search for a scope/project by name - :param id: if provided, filter the search by scope_id + :param pk: if provided, filter the search by scope_id :param status: if provided, filter the search for the status. eg. 'ACTIVE', 'TEMPLATE', 'LIBRARY' :return: :obj:`list` of :obj:`Scope` :raises: NotFoundError @@ -137,7 +137,7 @@ class Client(object): """ r = self._request('GET', self._build_url('scopes'), params={ 'name': name, - 'id': id, + 'id': pk, 'status': status })
refactoring argument of scope from id -> pk, as used everywhere else.
KE-works_pykechain
train
py
0db8c0a520946ef299b9e789cf7299a9a1650b85
diff --git a/blockstack_cli_0.14.1/blockstack_client/app.py b/blockstack_cli_0.14.1/blockstack_client/app.py index <HASH>..<HASH> 100644 --- a/blockstack_cli_0.14.1/blockstack_client/app.py +++ b/blockstack_cli_0.14.1/blockstack_client/app.py @@ -178,9 +178,10 @@ def app_get_wallet(name, app_name, app_account_id, interactive=False, password=N log.error('No such wallet "{}"'.format(wallet_path)) return {'error': 'No such wallet'} - if not (interactive or password is None): + if not interactive and password is None: raise ValueError('Password required in non-interactive mode') - else: + + if interactive and password is not None: password = raw_input('Enter password for "{}.{}@{}": '.format(app_account_id, app_name, name)) return wallet.load_wallet(password=password, config_dir=config_dir, wallet_path=wallet_path, include_private=True)
fix for interactivity/password check
blockstack_blockstack-core
train
py
51c3290beedac6b66b2e6f41cde9336c6a292a15
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index <HASH>..<HASH> 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -906,6 +906,18 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash } cap = hi + // Set sender address or use a default if none specified + if args.From == nil { + if wallets := b.AccountManager().Wallets(); len(wallets) > 0 { + if accounts := wallets[0].Accounts(); len(accounts) > 0 { + args.From = &accounts[0].Address + } + } + } + // Use zero-address if none other is available + if args.From == nil { + args.From = &common.Address{} + } // Create a helper to check if a gas allowance results in an executable transaction executable := func(gas uint64) bool { args.Gas = (*hexutil.Uint64)(&gas)
internal/ethapi: don't query wallets at every execution of gas estimation
ethereum_go-ethereum
train
go
28063ba667012b9f1b433933f941a2888f010a7f
diff --git a/spec/punchblock/component/output_spec.rb b/spec/punchblock/component/output_spec.rb index <HASH>..<HASH> 100644 --- a/spec/punchblock/component/output_spec.rb +++ b/spec/punchblock/component/output_spec.rb @@ -70,6 +70,36 @@ module Punchblock its(:voice) { should be == 'allison' } its(:renderer) { should be == 'swift' } its(:text) { should be == 'Hello world' } + + context "with SSML" do + let :stanza do + <<-MESSAGE +<output xmlns='urn:xmpp:rayo:output:1' + interrupt-on='speech' + start-offset='2000' + start-paused='false' + repeat-interval='2000' + repeat-times='10' + max-time='30000' + voice='allison' + renderer='swift'> + <speak version="1.0" + xmlns="http://www.w3.org/2001/10/synthesis" + xml:lang="en-US"> + <say-as interpret-as="ordinal">100</say-as> + </speak> +</output> + MESSAGE + end + + def ssml_doc(mode = :ordinal) + RubySpeech::SSML.draw do + say_as(:interpret_as => mode) { string '100' } + end + end + + its(:ssml) { should be == ssml_doc } + end end describe "for text" do
[CS] Add spec for reading SSML content from an output component
adhearsion_punchblock
train
rb
f8dac8be287f9652d6f3676425e0c241dca90481
diff --git a/cocaine/tools/actions/common.py b/cocaine/tools/actions/common.py index <HASH>..<HASH> 100644 --- a/cocaine/tools/actions/common.py +++ b/cocaine/tools/actions/common.py @@ -85,7 +85,7 @@ class Cluster(object): try: host = socket.gethostbyaddr(addr)[0] converted_result[uuid] = [host, port] - except socket.gaierror: + except (socket.gaierror, IOError): converted_result[uuid] = [addr, port] raise gen.Return(converted_result)
[Tools] Cluster: handle a case when the gateway is connecting to someone right now
cocaine_cocaine-tools
train
py
1ff13d057e94eb62dd6cdca0c4727b8f3acabc55
diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -218,7 +218,10 @@ describe('transaction', function(){ } } , function(err, results) { - if (err) throw err; + if (err) { + pg.types.setTypeParser(20, originalTypeParser20); + throw err; + } } ); });
make sure the type parser gets restored in the event of an error
goodybag_node-pg-transaction
train
js
4a35408eac8174ddae79ac370de5e2afce494276
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -64,7 +64,7 @@ HardHarmonyExportDependency.prototype.describeHarmonyExport = function() { }; function CacheModule(cacheItem) { - RawModule.call(this, cacheItem.source, cacheItem.identifier, cacheItem.identifier); + RawModule.call(this, cacheItem.source, cacheItem.identifier, cacheItem.readableIdentifier); this.context = cacheItem.context; this.request = cacheItem.request; @@ -570,6 +570,8 @@ HardSourceWebpackPlugin.prototype.apply = function(compiler) { context: module.context, request: module.request, identifier: module.identifier(), + readableIdentifier: module + .readableIdentifier(compilation.moduleTemplate.requestShortener), assets: Object.keys(module.assets || {}), buildTimestamp: module.buildTimestamp, strict: module.strict,
Freeze and thaw readableIdentifier to fulfill isomorphic test
mzgoddard_hard-source-webpack-plugin
train
js
d316f7230a17f452e443e06d5f3173e74c08d678
diff --git a/src/Router.php b/src/Router.php index <HASH>..<HASH> 100644 --- a/src/Router.php +++ b/src/Router.php @@ -136,7 +136,7 @@ class Router implements StageInterface $url = '!!!!'.rand(0, 999).microtime(); } else { $replace = function ($match) { - $base = "(?'{$match[1]}'\w+"; + $base = "(?'{$match[1]}'[a-zA-Z0-9-_]+"; if (isset($match[2]) && $match[2] == '?') { if (isset($match[3]) && $match[3] == '/') { $base .= '/';
this should match more than just \w
monolyth-php_reroute
train
php
1d76e3395f835a7ba45eabb690058fb2a691e413
diff --git a/perf/perf_test.go b/perf/perf_test.go index <HASH>..<HASH> 100644 --- a/perf/perf_test.go +++ b/perf/perf_test.go @@ -43,7 +43,7 @@ func TestExponent(t *testing.T) { {"-2", time.Millisecond}, {"-3", 500 * time.Microsecond}, {"-3", 100 * time.Microsecond}, - {"-4", 50 * time.Microsecond}, + {"-4", 10 * time.Microsecond}, } { tr := NewTimer() time.Sleep(c.d)
perf: Make it easier to hit the <<I>μs bucket in the test
anacrolix_missinggo
train
go
b9140274a03bcad7acc627b7be829c6e77e24777
diff --git a/librosa/__init__.py b/librosa/__init__.py index <HASH>..<HASH> 100644 --- a/librosa/__init__.py +++ b/librosa/__init__.py @@ -17,4 +17,4 @@ from . import util # Exporting all core functions is okay here: suppress the import warning from librosa.core import * # pylint: disable=wildcard-import -__version__ = '0.2.1' +__version__ = '0.2.2-dev' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='librosa', - version='0.2.1', + version='0.2.2-dev', description='Python module for audio and music processing', author='Brian McFee', author_email='[email protected]',
udpated version strings to <I>-dev
librosa_librosa
train
py,py
82e3d26999db52320ce9e82980ac0875e4316257
diff --git a/tests/support/helpers.py b/tests/support/helpers.py index <HASH>..<HASH> 100644 --- a/tests/support/helpers.py +++ b/tests/support/helpers.py @@ -33,6 +33,7 @@ import time import tornado.ioloop import tornado.web import types +import unittest # Import 3rd-party libs import psutil # pylint: disable=3rd-party-module-not-gated @@ -214,6 +215,8 @@ def flaky(caller=None, condition=True): if callable(setup): setup() return caller(cls) + except unittest.SkipTest as exc: + cls.skipTest(exc.message) except Exception as exc: if attempt >= 3: six.reraise(*sys.exc_info())
Do not run setup/teardown for tests that need to be skipped
saltstack_salt
train
py
236f393c9f4dc67244ff30ca928557e156f21fe8
diff --git a/realtime/make_map.py b/realtime/make_map.py index <HASH>..<HASH> 100644 --- a/realtime/make_map.py +++ b/realtime/make_map.py @@ -144,19 +144,30 @@ def create_shake_events( shake_ids.reverse() if not shake_ids: return [] - last_int = int(shake_ids[0]) - # sort descending - for shake_id in shake_ids: - if last_int - int(shake_id) < 100: - shake_event = ShakeEvent( + + if event_id: + shake_events.append( + ShakeEvent( working_dir=working_dir, event_id=event_id, locale=locale, force_flag=force_flag, population_raster_path=population_path) - shake_events.append(shake_event) - else: - break + ) + else: + last_int = int(shake_ids[0]) + # sort descending + for shake_id in shake_ids: + if last_int - int(shake_id) < 100: + shake_event = ShakeEvent( + working_dir=working_dir, + event_id=shake_id, + locale=locale, + force_flag=force_flag, + population_raster_path=population_path) + shake_events.append(shake_event) + else: + break return shake_events
fix #<I>: correct bug to clearly get the relevant shake id
inasafe_inasafe
train
py
810504697f1c86e38c502c5d3331e485268e6550
diff --git a/mysqldump.php b/mysqldump.php index <HASH>..<HASH> 100644 --- a/mysqldump.php +++ b/mysqldump.php @@ -81,7 +81,7 @@ class MySQLDump $vrednost = $row[$i]; if (!is_integer($vrednost)) - $vrednost = "'".addslashes($vrednost)."'"; + $vrednost = "'".mysql_real_escape_string($vrednost)."'"; $buffer .= $vrednost.', '; } @@ -109,7 +109,7 @@ class MySQLDump $sql = mysql_query("SHOW CREATE TABLE `$tablename`") or die(mysql_error()); if ($row = mysql_fetch_array($sql)) { - $this->write( $row['Create Table']."\n\n" ); + $this->write( $row['Create Table'].";\n\n" ); } } }
2 in 1: ";" after "create table" and proper escape 1. Sorry, forgot to ";" in CREATE TABLE routine. 2. Replaced addslashes with mysql_real_escape_string (<URL>)
ifsnop_mysqldump-php
train
php
601ea4717af1ffdd9af39bc5843108f38e4ef20f
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -99,16 +99,16 @@ describe('walker#walk', function() { // point in space function p(x, y) { return { - x: x || 0, - y: y || 0 + x: x, + y: y }; } // coordinate in grid function c(column, row) { return { - column: column || 0, - row: row || 0 + column: column, + row: row }; }
defaults seem more tricky than useful for this purpose
psalaets_grid-walk
train
js
95adf902aaf465dd75f5007fa1ef56f2ae058a32
diff --git a/core/src/test/java/tachyon/TachyonURITest.java b/core/src/test/java/tachyon/TachyonURITest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/tachyon/TachyonURITest.java +++ b/core/src/test/java/tachyon/TachyonURITest.java @@ -53,5 +53,7 @@ public class TachyonURITest { @Test public void constructFromParentAndChildTests() { testParentChild(".", ".", "."); + testParentChild("/", "/", "."); + testParentChild("/", ".", "/"); } }
newly added unit tests fail: java.net.URISyntaxException: Expected authority at index 2: //
Alluxio_alluxio
train
java
abdcceda98c94821551fac0522b70c7a92f7fa59
diff --git a/packages/site/pages/roadmap.js b/packages/site/pages/roadmap.js index <HASH>..<HASH> 100644 --- a/packages/site/pages/roadmap.js +++ b/packages/site/pages/roadmap.js @@ -25,6 +25,10 @@ const work = { ], next: [ { + title: 'Icon Packs Discovery', + tags: ['Resources'] + }, + { title: 'Sketch Libraries', tags: ['Resources'] },
refactor(site): icon packs to roadmap
pluralsight_design-system
train
js
a7c805ff104c8b75c16461c3afd84133088997b7
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ // Implements http://rfc.zeromq.org/spec:32 // Ported from https://github.com/zeromq/libzmq/blob/8cda54c52b08005b71f828243f22051cdbc482b4/src/zmq_utils.cpp#L77-L168 -var encoder = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#"; +var encoder = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#".split(""); var decoder = [ 0x00, 0x44, 0x00, 0x54, 0x53, 0x52, 0x48, 0x00,
split the encode string into an array... because IE6 can't deal with treating a string like an array.
msealand_z85.node
train
js
3624ff720cf98293034d7d5fe87c08f5520099d6
diff --git a/railties/lib/rails/generators/erb.rb b/railties/lib/rails/generators/erb.rb index <HASH>..<HASH> 100644 --- a/railties/lib/rails/generators/erb.rb +++ b/railties/lib/rails/generators/erb.rb @@ -17,7 +17,7 @@ module Erb # :nodoc: :erb end - def filename_with_extensions(name, format) + def filename_with_extensions(name, format = self.format) [name, format, handler].compact.join(".") end end
Fix for external generators extend Erb::Generators HAML and probably other generators extend this class and invoke filename_with_extensions with the old signature (without format). This makes the second argument optional and defaults it to the #format method which could be overridden as well. Closes #<I>.
rails_rails
train
rb
c395d786c9e796ed4d2f54b52787491aa507c084
diff --git a/core/services/src/main/java/org/openengsb/core/services/internal/ProxyConnector.java b/core/services/src/main/java/org/openengsb/core/services/internal/ProxyConnector.java index <HASH>..<HASH> 100644 --- a/core/services/src/main/java/org/openengsb/core/services/internal/ProxyConnector.java +++ b/core/services/src/main/java/org/openengsb/core/services/internal/ProxyConnector.java @@ -46,7 +46,7 @@ public class ProxyConnector implements InvocationHandler { case Exception: throw new RuntimeException(callSync.getArg().toString()); default: - throw new IllegalStateException("Return Type has to be either Object or Exception"); + throw new IllegalStateException("Return Type has to be either Void, Object or Exception"); } }
[OPENENGSB-<I>] Clearify exception in ProxyConnector that Void is also allowed
openengsb_openengsb
train
java
17fa7a4f805fbf5c4b0f401a6604f01d636859ea
diff --git a/buildbot_travis/configurator.py b/buildbot_travis/configurator.py index <HASH>..<HASH> 100644 --- a/buildbot_travis/configurator.py +++ b/buildbot_travis/configurator.py @@ -126,7 +126,7 @@ class TravisConfigurator(object): l = {} # execute the code with empty global, and a given local context (that we return) try: - exec code in {}, l + exec(code, {}, l) except Exception: config_error("custom code generated an exception {}:".format(traceback.format_exc())) raise
Use tuple form of exec, for compatibilit with Python 3
buildbot_buildbot_travis
train
py
faac0159e5a9184f842dc4e0fcef69e60cfa265d
diff --git a/lib/assets/SrcSet.js b/lib/assets/SrcSet.js index <HASH>..<HASH> 100644 --- a/lib/assets/SrcSet.js +++ b/lib/assets/SrcSet.js @@ -35,7 +35,7 @@ extendWithGettersAndSetters(SrcSet.prototype, { extraTokens: extraTokens }); } else { - var warning = new errors.SyntaxError({message: 'SrcSet: Could not parse entry: ' + entry, asset: this}); + var warning = new errors.SyntaxError({message: 'SrcSet: Could not parse entry: ' + entryStr, asset: this}); if (this.assetGraph) { this.assetGraph.emit('warn', warning); } else {
Fix: SrcSet was referencing an undefined variable
assetgraph_assetgraph
train
js
326abd8d47a59bae3acb1bb0e65a161ccd3746a4
diff --git a/test/index-spec.js b/test/index-spec.js index <HASH>..<HASH> 100644 --- a/test/index-spec.js +++ b/test/index-spec.js @@ -52,5 +52,22 @@ describe('react-sizer', function() { render((<FixedParent><SizerChild/></FixedParent>), node); }); + + it('supports changing the width and height props', function(done) { + const SizerChild = sizer({ + widthProp: 'myWidth', + heightProp: 'myHeight', + updateSizeCallback: () => { + expect(node.textContent).toEqual(FIXED_PARENT_WIDTH + ' x ' + FIXED_PARENT_HEIGHT); + done(); + } + })(function(props) { + const { myWidth, myHeight } = props; + + return <div>{myWidth} x {myHeight}</div>; + }); + + render((<FixedParent><SizerChild/></FixedParent>), node); + }); }); });
Add test for changing the width and height prop names
jharris4_react-sizer
train
js
903fc68972474a9aeb128709a911de50e29daf83
diff --git a/packages/razzle/config/createConfigAsync.js b/packages/razzle/config/createConfigAsync.js index <HASH>..<HASH> 100644 --- a/packages/razzle/config/createConfigAsync.js +++ b/packages/razzle/config/createConfigAsync.js @@ -329,6 +329,7 @@ module.exports = ( return callback(); } : nodeExternals({ + additionalModuleDirs: additionalModulePaths, whitelist: [ IS_DEV ? 'webpack/hot/poll?300' : null, /\.(eot|woff|woff2|ttf|otf)$/,
dev-infra: try making tests pass in ci
jaredpalmer_razzle
train
js
60220a43e96d4416a4c23b406857ac64c2bad9bf
diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/AbstractReturnValueIgnored.java b/core/src/main/java/com/google/errorprone/bugpatterns/AbstractReturnValueIgnored.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/AbstractReturnValueIgnored.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/AbstractReturnValueIgnored.java @@ -101,8 +101,6 @@ public abstract class AbstractReturnValueIgnored extends BugChecker ReturnTreeMatcher, NewClassTreeMatcher { - private static final String CRV_CONSTRUCTOR_FLAG = "CheckConstructorReturnValue"; - private final Supplier<Matcher<ExpressionTree>> methodInvocationMatcher = Suppliers.memoize( () ->
Delete a file left over from <URL>
google_error-prone
train
java
0ce9c0c811b06fa5c15469850f34c67078427e43
diff --git a/pyOCD/gdbserver/gdbserver.py b/pyOCD/gdbserver/gdbserver.py index <HASH>..<HASH> 100644 --- a/pyOCD/gdbserver/gdbserver.py +++ b/pyOCD/gdbserver/gdbserver.py @@ -506,7 +506,7 @@ class GDBServer(threading.Thread): def getRegister(self): resp = '' - for i in range(len(CORE_REGISTER)): + for i in range(18): reg = self.target.readCoreRegister(i) resp += self.intToHexGDB(reg) logging.debug("GDB reg: %s = 0x%X", i, reg) @@ -587,7 +587,7 @@ class GDBServer(threading.Thread): return if size > (self.packet_size - 4): - size = self.packet_size - 4 + size = self.packet_size - 4 nbBytesAvailable = size_xml - offset
[fix] issue#<I> - print only first <I> core registers.
mbedmicro_pyOCD
train
py
18f0ca0d92496c1030029b415275231019bb2276
diff --git a/dvc/dependency/base.py b/dvc/dependency/base.py index <HASH>..<HASH> 100644 --- a/dvc/dependency/base.py +++ b/dvc/dependency/base.py @@ -59,7 +59,11 @@ class DependencyBase(object): def status(self): if self.changed(): # FIXME better msgs - return {self.rel_path: 'changed'} + if self.path_info['scheme'] == 'local': + p = self.rel_path + else: + p = self.path + return {p: 'changed'} return {} def save(self): diff --git a/tests/test_repro.py b/tests/test_repro.py index <HASH>..<HASH> 100644 --- a/tests/test_repro.py +++ b/tests/test_repro.py @@ -380,6 +380,8 @@ class TestReproExternalBase(TestDvc): sleep() + self.dvc.status() + stages = self.dvc.reproduce(import_stage.path) self.assertEqual(len(stages), 1) self.assertTrue(os.path.exists('import'))
dependency: only use rel_path for local deps Fixes #<I>
iterative_dvc
train
py,py
e748c9b9ad2bb52442f696df42955f486d24b98e
diff --git a/spec/dummy/spec/requests/requests_spec.rb b/spec/dummy/spec/requests/requests_spec.rb index <HASH>..<HASH> 100644 --- a/spec/dummy/spec/requests/requests_spec.rb +++ b/spec/dummy/spec/requests/requests_spec.rb @@ -126,15 +126,21 @@ describe 'API' do end version 1.1 do remove_resource :sales + resource :products, actions: [:index] end end end + let!(:product) { create :product } + it 'inherits from previous versions' do make_request :get, 'api/products', nil, '1.0' + make_request :get, 'api/products/1', nil, '1.0' expect { make_request :get, 'api/sales', nil, '1.0' }.to raise_error make_request :get, 'api/sales', nil, '1.0.1' expect { make_request :get, 'api/sales', nil, '1.1.0' }.to raise_error + expect { make_request :get, 'api/products/1', nil, '1.1.0' }.to raise_error + make_request :get, 'api/products', nil, '1.1.0' end end end
Make sure resources are overwritten when specified in an inherited version
mobyinc_Cathode
train
rb
475edecc4fdab7432d53d1f7f2777b66e2f06c17
diff --git a/cherrypy/_cputil.py b/cherrypy/_cputil.py index <HASH>..<HASH> 100644 --- a/cherrypy/_cputil.py +++ b/cherrypy/_cputil.py @@ -54,7 +54,7 @@ def get_object_trail(objectpath=None): return objectTrail -def get_special_attribute(name, alternate_name = None): +def get_special_attribute(name, old_name = None): """Return the special attribute. A special attribute is one that applies to all of the children from where it is defined, such as _cp_filters.""" @@ -71,10 +71,13 @@ def get_special_attribute(name, alternate_name = None): return getattr(obj, name) try: - return globals()[name] + if old_name: + return globals()[old_name] + else: + return globals()[name] except KeyError: - if alternate_name: - return get_special_attribute(alternate_name) + if old_name: + return get_special_attribute(name) msg = "Special attribute %s could not be found" % repr(name) raise cherrypy.HTTPError(500, msg)
Fix for #<I>: Try old name first
cherrypy_cheroot
train
py
dedeb0be8a8173a045e976b9878ff72110242f00
diff --git a/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java b/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java index <HASH>..<HASH> 100644 --- a/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java +++ b/src/java/org/apache/cassandra/dht/Murmur3Partitioner.java @@ -121,7 +121,7 @@ public class Murmur3Partitioner extends AbstractPartitioner<LongToken> // 0-case if (!i.hasNext()) - throw new RuntimeException("No nodes present in the cluster. How did you call this?"); + throw new RuntimeException("No nodes present in the cluster. Has this node finished starting up?"); // 1-case if (sortedTokens.size() == 1) ownerships.put((Token) i.next(), new Float(1.0));
Give users a clue how they called it.
Stratio_stratio-cassandra
train
java
094d77bd112570a432670676016f28f295b00064
diff --git a/includes/media.php b/includes/media.php index <HASH>..<HASH> 100644 --- a/includes/media.php +++ b/includes/media.php @@ -419,7 +419,7 @@ function pods_audio( $url, $args = false ) { if ( ! is_string( $url ) ) { $id = $url; - if ( is_array( $id ) ) { + if ( ! is_numeric( $id ) ) { $id = pods_v( 'ID', $url ); } $url = wp_get_attachment_url( $id ); @@ -455,7 +455,7 @@ function pods_video( $url, $args = false ) { if ( ! is_string( $url ) ) { $id = $url; - if ( is_array( $id ) ) { + if ( ! is_numeric( $id ) ) { $id = pods_v( 'ID', $url ); } $url = wp_get_attachment_url( $id );
Enhance pods_v usage for getting the ID Will also enable support for objects
pods-framework_pods
train
php
9c99d65716b61c51b39e092bec6fc698958b24d6
diff --git a/protocol/protocol.go b/protocol/protocol.go index <HASH>..<HASH> 100644 --- a/protocol/protocol.go +++ b/protocol/protocol.go @@ -129,7 +129,7 @@ func NewConnection(nodeID NodeID, reader io.Reader, writer io.Writer, receiver M cr := &countingReader{Reader: reader} cw := &countingWriter{Writer: writer} - compThres := 1<<32 - 1 // compression disabled + compThres := 1<<31 - 1 // compression disabled if compress { compThres = 128 // compress messages that are 128 bytes long or larger }
Build on <I> bit archs (ref #<I>)
syncthing_syncthing
train
go
2b41f05848c4a203624791ca0e9030deda2dd1f5
diff --git a/common/config.go b/common/config.go index <HASH>..<HASH> 100644 --- a/common/config.go +++ b/common/config.go @@ -78,6 +78,11 @@ func DownloadableURL(original string) (string, error) { // since net/url turns "C:/" into "/C:/" if runtime.GOOS == "windows" && url.Path[0] == '/' { url.Path = url.Path[1:len(url.Path)] + + // Also replace all backslashes with forwardslashes since Windows + // users are likely to do this but the URL should actually only + // contain forward slashes. + url.Path = strings.Replace(url.Path, `\`, `/`, -1) } if _, err := os.Stat(url.Path); err != nil {
common: replace windows file URL backslash with forward slash /cc @jasonberanek - Just adding this as well because I see this being common as well.
hashicorp_packer
train
go
b470dace1ab7efdcfe80e366b449f5e963f9d736
diff --git a/examples/windowsize/main.go b/examples/windowsize/main.go index <HASH>..<HASH> 100644 --- a/examples/windowsize/main.go +++ b/examples/windowsize/main.go @@ -415,7 +415,17 @@ func main() { const title = "Window Size (Ebiten Demo)" if *flagLegacy { - if err := ebiten.Run(g.Update, g.width, g.height, initScreenScale, title); err != nil { + update := func(screen *ebiten.Image) error { + if err := g.Update(screen); err != nil { + return err + } + if ebiten.IsDrawingSkipped() { + return nil + } + g.Draw(screen) + return nil + } + if err := ebiten.Run(update, g.width, g.height, initScreenScale, title); err != nil { log.Fatal(err) } } else {
examples/windowsize: Bug fix: Nothing was rendered with -legacy mode
hajimehoshi_ebiten
train
go
ab428b5c4a7de3f3ab9bbc90fe6218bc256e27b5
diff --git a/src/platforms/web/runtime/components/transition-group.js b/src/platforms/web/runtime/components/transition-group.js index <HASH>..<HASH> 100644 --- a/src/platforms/web/runtime/components/transition-group.js +++ b/src/platforms/web/runtime/components/transition-group.js @@ -89,7 +89,7 @@ export default { updated () { const children = this.prevChildren - const moveClass = this.moveClass || (this.name + '-move') + const moveClass = this.moveClass || ((this.name || 'v') + '-move') if (!children.length || !this.hasMove(children[0].elm, moveClass)) { return }
fix v-move class when name isn't specified (#<I>)
IOriens_wxml-transpiler
train
js
c29e173e0c1a0e3b98ac84b051c6db0750ad2ba2
diff --git a/src/carousel/Carousel.js b/src/carousel/Carousel.js index <HASH>..<HASH> 100644 --- a/src/carousel/Carousel.js +++ b/src/carousel/Carousel.js @@ -401,7 +401,7 @@ export default class Carousel extends Component { _getScrollOffset (event) { const { vertical } = this.props; return (event && event.nativeEvent && event.nativeEvent.contentOffset && - event.nativeEvent.contentOffset[vertical ? 'y' : 'x']) || 0; + Math.round(event.nativeEvent.contentOffset[vertical ? 'y' : 'x'])) || 0; } _getContainerInnerMargin (opposite = false) {
fix(Carousel): prevent loop and callback issue on android because scroll offset's value is not an integer
archriss_react-native-snap-carousel
train
js
da821c121dd57d7a7c8417ec40d9f0dbc84b4769
diff --git a/lib/jsonapi/resource_serializer.rb b/lib/jsonapi/resource_serializer.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/resource_serializer.rb +++ b/lib/jsonapi/resource_serializer.rb @@ -72,7 +72,7 @@ module JSONAPI } end - def find_link(query_params) + def query_link(query_params) url_generator.query_link(query_params) end diff --git a/lib/jsonapi/response_document.rb b/lib/jsonapi/response_document.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/response_document.rb +++ b/lib/jsonapi/response_document.rb @@ -76,7 +76,7 @@ module JSONAPI relationship = result.source_resource.class._relationships[result._type.to_sym] links[link_name] = serializer.url_generator.relationships_related_link(result.source_resource, relationship, query_params(params)) else - links[link_name] = serializer.find_link(query_params(params)) + links[link_name] = serializer.query_link(query_params(params)) end end end
Use "query_link" consistently over "find_link"
cerebris_jsonapi-resources
train
rb,rb
e5eb33dee53ddd7ccdde0622190ff1170115899e
diff --git a/timeline.php b/timeline.php index <HASH>..<HASH> 100644 --- a/timeline.php +++ b/timeline.php @@ -283,7 +283,7 @@ $controller->checkPrivacy(); <span class="details1"><?php echo WT_I18N::translate('Remove person'); ?></span></a> <?php if (!empty($controller->birthyears[$pid])) { ?> <span class="details1"><br /> - <?php echo /* I18N: an age marker, which can be moved */ WT_I18N::translate('Show a movable age marker?'); ?> + <?php echo /* I18N: an age indicator, which can be dragged around the screen */ WT_I18N::translate('Show an age cursor?'); ?> <input type="checkbox" name="agebar<?php echo $p; ?>" value="ON" onclick="showhide('agebox<?php echo $p; ?>', this);" /> </span> <?php }
I<I>N: better name for the "age marker" on timeline.php
fisharebest_webtrees
train
php
2b46c370aa880a33d3de98bf721b4c6139c6ed86
diff --git a/src/ui_components/jf_tree/jf_tree_api.js b/src/ui_components/jf_tree/jf_tree_api.js index <HASH>..<HASH> 100644 --- a/src/ui_components/jf_tree/jf_tree_api.js +++ b/src/ui_components/jf_tree/jf_tree_api.js @@ -447,9 +447,9 @@ export function JFTreeApi($q, $timeout, AdvancedStringMatch, ContextMenuService, } } - toggleExpansion(node) { + toggleExpansion(node) { let flat = this._flatFromNode(node); - if (flat.pane.isNodeOpen(node)) { + if (flat && flat.pane.isNodeOpen(node)) { this.closeNode(node); } else {
jf-tree: Add safety check on toggle expansion to prevent error when on drill down mode and pressing 'back'
jfrog_jfrog-ui-essentials
train
js
767339915b44172dcfb3a394feed4af169f739fb
diff --git a/tests/test.py b/tests/test.py index <HASH>..<HASH> 100644 --- a/tests/test.py +++ b/tests/test.py @@ -14,7 +14,6 @@ from you_get.extractors import ( class YouGetTests(unittest.TestCase): def test_imgur(self): imgur.download('http://imgur.com/WVLk5nD', info_only=True) - imgur.download('http://imgur.com/gallery/WVLk5nD', info_only=True) def test_magisto(self): magisto.download( @@ -40,7 +39,7 @@ class YouGetTests(unittest.TestCase): ) def test_acfun(self): - acfun.download('https://www.acfun.cn/v/ac11701912', info_only=True) + acfun.download('https://www.acfun.cn/v/ac11701912', info_only=True) if __name__ == '__main__': unittest.main()
[tests] remove one test_imgur case since it fails too often
soimort_you-get
train
py
3f8be19739d93e230bcc74f9638e922dd74586a7
diff --git a/python/weka/core/__init__.py b/python/weka/core/__init__.py index <HASH>..<HASH> 100644 --- a/python/weka/core/__init__.py +++ b/python/weka/core/__init__.py @@ -0,0 +1,23 @@ +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# __init__.py +# Copyright (C) 2015 Fracpete (pythonwekawrapper at gmail dot com) + +# check whether scipy is there +scipy_available = False +try: + import scipy + scipy_available = True +except ImportError: + pass
added check whether scipy is available; variable "scipy_available" can be used to query state
fracpete_python-weka-wrapper
train
py
af7bbbe2412f9a0174338526daa01fe270500806
diff --git a/executor/analyze_test.go b/executor/analyze_test.go index <HASH>..<HASH> 100644 --- a/executor/analyze_test.go +++ b/executor/analyze_test.go @@ -518,7 +518,7 @@ func (s *testFastAnalyze) TestFastAnalyzeRetryRowCount(c *C) { c.Assert(row[5], Equals, "30") } -func (s *testSuite1) TestFailedAnalyzeRequest(c *C) { +func (s *testSuite9) TestFailedAnalyzeRequest(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t")
executor: fix failpoint race for analyze test (#<I>)
pingcap_tidb
train
go
5d942f5a53df3fdc68016ffdf3b2e223afa6fccc
diff --git a/calendar/tests/externallib_test.php b/calendar/tests/externallib_test.php index <HASH>..<HASH> 100644 --- a/calendar/tests/externallib_test.php +++ b/calendar/tests/externallib_test.php @@ -1267,4 +1267,27 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase { $this->assertCount(1, $groupedbycourse[$course2->id]); $this->assertEquals('Event 3', $groupedbycourse[$course2->id][0]['name']); } + + /** + * Test for deleting module events. + */ + public function test_delete_calendar_events_for_modules() { + $this->resetAfterTest(); + $this->setAdminUser(); + $course = $this->getDataGenerator()->create_course(); + $nexttime = time() + DAYSECS; + $this->getDataGenerator()->create_module('assign', ['course' => $course->id, 'duedate' => $nexttime]); + $events = calendar_get_events(time(), $nexttime, true, true, true); + $this->assertCount(1, $events); + $params = []; + foreach ($events as $event) { + $params[] = [ + 'eventid' => $event->id, + 'repeat' => false + ]; + } + + $this->expectException('moodle_exception'); + core_calendar_external::delete_calendar_events($params); + } }
MDL-<I> core_calendar: test action events cannot be deleted
moodle_moodle
train
php
83190a5bf1cf7b0d25cd2b63d06fc5822d904aac
diff --git a/tests/test_template_context_processors.py b/tests/test_template_context_processors.py index <HASH>..<HASH> 100644 --- a/tests/test_template_context_processors.py +++ b/tests/test_template_context_processors.py @@ -32,7 +32,7 @@ from flask import render_template_string def test_context_processor_badge_svg(app): """Test context processor badge generating a SVG.""" template = r""" - {{ badge_svg('DOI','10.1234/zenodo.12345') }} + {{ badge_svg('DOI','10.1234/zenodo.12345')|safe }} """ with app.test_request_context(): html = render_template_string(template)
tests: force safe representation of SVG badge * Forces safe representation of SVG badge to support Flask <I>.
inveniosoftware_invenio-formatter
train
py
1676258e2f09bb00be841d6e9ff0aac78ae0dd9c
diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/api/nova.py +++ b/openstack_dashboard/api/nova.py @@ -463,13 +463,14 @@ def get_auth_params_from_request(request): request.user.username, request.user.token.id, request.user.tenant_id, - base.url_for(request, 'compute') + base.url_for(request, 'compute'), + base.url_for(request, 'identity') ) @memoized_with_request(get_auth_params_from_request) def novaclient(request_auth_params): - username, token_id, project_id, auth_url = request_auth_params + username, token_id, project_id, nova_url, auth_url = request_auth_params c = nova_client.Client(VERSIONS.get_active_version()['version'], username, token_id, @@ -479,7 +480,7 @@ def novaclient(request_auth_params): cacert=CACERT, http_log_debug=settings.DEBUG) c.client.auth_token = token_id - c.client.management_url = auth_url + c.client.management_url = nova_url return c
Changed auth_url in api/nova.py to point to keystone auth_url should be keystone instead of nova, this patch sets the correct value for the auth_url. Change-Id: Id<I>e<I>c0b3c<I>cef3fac4c<I>b<I>d<I>d Closes-Bug: #<I>
openstack_horizon
train
py
8ba44d3992024d0e1713e193ce841c650015a457
diff --git a/tilequeue/queue/message.py b/tilequeue/queue/message.py index <HASH>..<HASH> 100644 --- a/tilequeue/queue/message.py +++ b/tilequeue/queue/message.py @@ -177,6 +177,6 @@ class MultipleMessagesPerCoordTracker(object): except KeyError: pass all_done = queue_handle is not None - parent_tile = self.pyramid_map.pop(queue_handle_id) + parent_tile = self.pyramid_map.pop(queue_handle_id, None) return MessageDoneResult(queue_handle, all_done, parent_tile)
Prevent pop from erroring out Add in the crucial None argument to pop to prevent errors.
tilezen_tilequeue
train
py
0ce8f32914de68d44b4ee9c81bc1872369f8f5e5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( include_package_data=True, install_requires=[ "Django>=1.6, <1.7", - "South>=0.8.4", + "South>=0.8.4, <1.0", "django-braces>=1.4.0", "django-choices>=1.1.12", "django-haystack>=2.1.0",
don't install south <I>
eliostvs_django-kb
train
py
8323d6aa9e8971b5059b4f9e7ff14bd355a4b626
diff --git a/cluster/service.go b/cluster/service.go index <HASH>..<HASH> 100644 --- a/cluster/service.go +++ b/cluster/service.go @@ -121,7 +121,10 @@ func (s *Service) handleConn(conn net.Conn) { conn.Close() }() - s.Logger.Println("accept remote write connection") + s.Logger.Printf("accept remote write connection from %v\n", conn.RemoteAddr()) + defer func() { + s.Logger.Printf("close remote write connection from %v\n", conn.RemoteAddr()) + }() for { // Read type-length-value. typ, buf, err := ReadTLV(conn)
Log when TCP clients connect/disconnect
influxdata_influxdb
train
go
480fc295c41bb0175e5f17ede5c2ec9bf1f663cd
diff --git a/src/abcWalletTxLib-TRD.js b/src/abcWalletTxLib-TRD.js index <HASH>..<HASH> 100644 --- a/src/abcWalletTxLib-TRD.js +++ b/src/abcWalletTxLib-TRD.js @@ -9,6 +9,8 @@ const DATA_STORE_FOLDER = 'txEngineFolder' const ADDRESS_POLL_MILLISECONDS = 20000 const TRANSACTION_POLL_MILLISECONDS = 3000 const BLOCKHEIGHT_POLL_MILLISECONDS = 60000 +const baseUrl = 'http://shitcoin-az-braz.airbitz.co:8080/api/' +// const baseUrl = 'http://localhost:8080/api/' export const TxLibBTC = { getInfo: () => { @@ -35,7 +37,6 @@ export const TxLibBTC = { } } -const baseUrl = 'http://localhost:8080/api/' function fetchGet (cmd, params) { return window.fetch(baseUrl + cmd + '/' + params, {
Change to use VPS instance of shitcoin node
EdgeApp_edge-currency-ethereum
train
js
ae6cfe934f3b42b01cf0615cc4177438c395d48d
diff --git a/state/remoteentities.go b/state/remoteentities.go index <HASH>..<HASH> 100644 --- a/state/remoteentities.go +++ b/state/remoteentities.go @@ -159,11 +159,18 @@ func (r *RemoteEntities) ImportRemoteEntity(entity names.Tag, token string) erro if remoteEntity.Token == token { return nil, jujutxn.ErrNoOperations } - // Token already exists, so remove first. - ops = append(ops, r.removeRemoteEntityOps(entity)...) + // Token already exists; update. + return []txn.Op{{ + C: remoteEntitiesC, + Id: entity.String(), + Assert: txn.DocExists, + Update: bson.D{ + {"$set", bson.D{{"token", token}}}, + {"$unset", bson.D{{"macaroon", nil}}}, + }, + }}, nil } - ops = append(ops, r.importRemoteEntityOps(entity, token)...) - return ops, nil + return r.importRemoteEntityOps(entity, token), nil } err := r.st.db().Run(buildTxn) return errors.Annotatef(err, "recording reference to %s", names.ReadableString(entity))
Updates ops generated for importing an extant remote entity. Server side transactions do not allow us to delete and insert in a single transaction where we assert that the doc does not exist for the insert. Instead we return an update operation.
juju_juju
train
go
6cfa5e4b00550e5bac48faa09fa6bad38d3c6905
diff --git a/src/sap.m/src/sap/m/P13nDialog.js b/src/sap.m/src/sap/m/P13nDialog.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/P13nDialog.js +++ b/src/sap.m/src/sap/m/P13nDialog.js @@ -106,7 +106,8 @@ sap.ui.define([ P13nDialog.prototype._initDialog = function() { var that = this; this.setHorizontalScrolling(false); - this.setContentWidth("50rem"); + // according to consistency we adjust the content width of P13nDialog to the content width of value help dialog + this.setContentWidth("65rem"); this.setContentHeight("40rem"); this.setTitle(this._oResourceBundle.getText("P13NDIALOG_VIEW_SETTINGS")); this.addButton(new sap.m.Button({
[INTERNAL] sap.m.P<I>nDialog - changed to responsive layout Change-Id: I<I>e<I>a<I>c4eb<I>c8a0bcfd5bef<I>bb3
SAP_openui5
train
js
71698d352ead93f6baafd8556a151b781968e325
diff --git a/salt/states/boto_apigateway.py b/salt/states/boto_apigateway.py index <HASH>..<HASH> 100644 --- a/salt/states/boto_apigateway.py +++ b/salt/states/boto_apigateway.py @@ -84,15 +84,22 @@ def _name_matches(name, matches): return True return False -def _object_reducer(o, names = ['Id', 'Name', 'Created', 'Deleted', 'Updated', 'Flushed', 'Associated', 'Disassociated']): +def _object_reducer(o, names = ['id', 'name', 'path', 'httpMethod', 'statusCode', 'Created', 'Deleted', 'Updated', 'Flushed', 'Associated', 'Disassociated']): result = {} if isinstance(o, dict): for k, v in o.iteritems(): - # need to keep this if isinstance(v, dict): reduced = _object_reducer(v, names) if reduced or _name_matches(k, names): result[k] = reduced + elif isinstance(v, list): + newlist = [] + for val in v: + reduced = _object_reducer(val, names) + if reduced or _name_matches(k, names): + newlist.append(reduced) + if newlist: + result[k] = newlist else: if _name_matches(k, names): result[k] = v
object reducer for log_changes now supports lists
saltstack_salt
train
py
c646eda87d8a08573fe29051b4d38b8d924badb3
diff --git a/src/Ufo/Core/Debug.php b/src/Ufo/Core/Debug.php index <HASH>..<HASH> 100644 --- a/src/Ufo/Core/Debug.php +++ b/src/Ufo/Core/Debug.php @@ -139,14 +139,14 @@ class Debug implements DebugInterface } /** - * Вывод информации о переменной. + * Show variable debug info. * @param mixed $var * @param bool $dump = true * @param bool $exit = true * @param bool $float = false * @return void */ - public static function varDump($var, bool $dump = true, bool $exit = true, bool $float = false): void + public static function vd($var, bool $dump = true, bool $exit = true, bool $float = false): void { // @codeCoverageIgnoreStart if ($exit) { @@ -175,12 +175,4 @@ class Debug implements DebugInterface } // @codeCoverageIgnoreEnd } - - /** - * @see varDump - */ - public static function vd($var, bool $dump = true, bool $exit = true, bool $float = false): void - { - self::varDump($var, $dump, $exit, $float); - } }
chore: replaced unused method instead to its alias
enikeishik_ufoframework
train
php
188f47a309d30a9e0e411a4663ebf9cc37cea7e3
diff --git a/src/org/dita/dost/module/TopicMergeModule.java b/src/org/dita/dost/module/TopicMergeModule.java index <HASH>..<HASH> 100644 --- a/src/org/dita/dost/module/TopicMergeModule.java +++ b/src/org/dita/dost/module/TopicMergeModule.java @@ -93,7 +93,8 @@ public class TopicMergeModule implements AbstractPipelineModule { } if (style != null){ TransformerFactory factory = TransformerFactory.newInstance(); - Transformer transformer = factory.newTransformer(new StreamSource(new FileInputStream(style))); + final File styleFile = new File(style); + Transformer transformer = factory.newTransformer(new StreamSource(styleFile.toURI().toString())); transformer.transform(new StreamSource(midStream), new StreamResult(new FileOutputStream(new File(out)))); }else{ output = new OutputStreamWriter(new FileOutputStream(out),Constants.UTF8);
Add stylesheet URL to XSLT compilation to enable xsl:import usage. Without stylesheet URI the Transformer compilation fails if the stylesheet uses either xsl:import or xsl:include. In addition, using URI in StreamSource instead of FileInputStream the source stream does not have to be closed.
dita-ot_dita-ot
train
java
5c76b8433653f7ee1bd56229aa31e8a88f326e61
diff --git a/lib/active_scaffold/helpers/list_column_helpers.rb b/lib/active_scaffold/helpers/list_column_helpers.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/helpers/list_column_helpers.rb +++ b/lib/active_scaffold/helpers/list_column_helpers.rb @@ -244,7 +244,7 @@ module ActiveScaffold def inplace_edit_data(column) data = {} - data[:ie_url] = url_for({:controller => params_for[:controller], :action => "update_column", :column => column.name, :id => '__id__'}) + data[:ie_url] = url_for(params_for(:action => "update_column", :column => column.name, :id => '__id__')) data[:ie_cancel_text] = column.options[:cancel_text] || as_(:cancel) data[:ie_loading_text] = column.options[:loading_text] || as_(:loading) data[:ie_save_text] = column.options[:save_text] || as_(:update)
fix update_colums, row and table in nested scaffolds
activescaffold_active_scaffold
train
rb
3dd7c3c656842751c9752c7f069b181821e62a84
diff --git a/inginious/frontend/lti/pages/utils.py b/inginious/frontend/lti/pages/utils.py index <HASH>..<HASH> 100644 --- a/inginious/frontend/lti/pages/utils.py +++ b/inginious/frontend/lti/pages/utils.py @@ -175,11 +175,14 @@ class LTIAuthenticatedPage(LTIPage): try: course_id, task_id = self.user_manager.session_task() - self.course = self.course_factory.get_course(course_id) - self.task = self.course.get_task(task_id) except: raise LTINotConnectedException() + try: + self.course = self.course_factory.get_course(course_id) + self.task = self.course.get_task(task_id) + except: + raise web.notfound() class LTILaunchPage(LTIPage, metaclass=abc.ABCMeta): """
LTI : disting. session expired and task not found
UCL-INGI_INGInious
train
py
d2326a1b8eb736f1fc15c4b6373e1761a0809419
diff --git a/HARK/ConsumptionSaving/tests/test_ConsAggShockModel.py b/HARK/ConsumptionSaving/tests/test_ConsAggShockModel.py index <HASH>..<HASH> 100644 --- a/HARK/ConsumptionSaving/tests/test_ConsAggShockModel.py +++ b/HARK/ConsumptionSaving/tests/test_ConsAggShockModel.py @@ -45,7 +45,7 @@ class testAggShockConsumerType(unittest.TestCase): self.economy.AFunc = self.economy.dynamics.AFunc self.assertAlmostEqual(self.economy.AFunc.slope, - 1.124330884813638) + 1.1374781287418916) class testAggShockMarkovConsumerType(unittest.TestCase): @@ -79,5 +79,5 @@ class testAggShockMarkovConsumerType(unittest.TestCase): self.economy.AFunc = self.economy.dynamics.AFunc self.assertAlmostEqual(self.economy.AFunc[0].slope, - 1.0801777346256896) + 1.0897651487240472)
update automated tests because random seeds are changing for ConsAggShock
econ-ark_HARK
train
py
9cf7bb4fd0dacca0ae2834ac60857deacbde0138
diff --git a/ib_insync/contract.py b/ib_insync/contract.py index <HASH>..<HASH> 100644 --- a/ib_insync/contract.py +++ b/ib_insync/contract.py @@ -166,8 +166,13 @@ class Bond(Contract): class FuturesOption(Contract): __slots__ = () - def __init__(self, **kwargs): - Contract.__init__(self, secType='FOP', **kwargs) + def __init__(self, symbol='', lastTradeDateOrContractMonth='', + strike='', right='', exchange='', multiplier='', + currency='', **kwargs): + Contract.__init__(self, secType='FOP', symbol=symbol, + lastTradeDateOrContractMonth=lastTradeDateOrContractMonth, + strike=strike, right=right, exchange=exchange, + multiplier=multiplier, currency=currency, **kwargs) class MutualFund(Contract):
Issue #<I> FuturesOption constructor like Option
erdewit_ib_insync
train
py
692eab5f898a21709118c5fe1218efd682ce9eef
diff --git a/src/Tokenizer/Token.php b/src/Tokenizer/Token.php index <HASH>..<HASH> 100644 --- a/src/Tokenizer/Token.php +++ b/src/Tokenizer/Token.php @@ -138,7 +138,7 @@ class Token * * @return \string */ - public function &getFilteredContent() + public function getFilteredContent() { if (! $this->filteredContent) { return $this->content;
Don't return a reference in Org\Heigl\Hyphenator\Tokenizer\Token::getFilteredContent() I suppose this was added by accident in 1bd<I>b<I>c<I>a<I>d<I>bc1f2cd<I>c<I>cbfa<I>d
heiglandreas_Org_Heigl_Hyphenator
train
php
54bc6de2ebf3f4199690f4f55efd4978e3097b2d
diff --git a/rating/lib.php b/rating/lib.php index <HASH>..<HASH> 100644 --- a/rating/lib.php +++ b/rating/lib.php @@ -241,6 +241,12 @@ class rating_manager { public function get_ratings($options) { global $DB, $USER, $PAGE, $CFG; + //are ratings enabled? + if ($options->aggregate==RATING_AGGREGATE_NONE) { + return $options->items; + } + $aggregatestr = $this->get_aggregation_method($options->aggregate); + if(empty($options->items)) { return $options->items; } @@ -251,8 +257,6 @@ class rating_manager { $userid = $options->userid; } - $aggregatestr = $this->get_aggregation_method($options->aggregate); - //create an array of item ids $itemids = array(); foreach($options->items as $item) {
Rating MDL-<I> Prevented fetching of ratings when ratings are turned off
moodle_moodle
train
php
4dbc7eac5654d314b2dcefe87e86387ef527f292
diff --git a/zipline/lib/labelarray.py b/zipline/lib/labelarray.py index <HASH>..<HASH> 100644 --- a/zipline/lib/labelarray.py +++ b/zipline/lib/labelarray.py @@ -408,7 +408,6 @@ class LabelArray(ndarray): # numeric methods. SUPPORTED_NDARRAY_METHODS = frozenset([ 'base', - 'byteswap', 'compress', 'copy', 'data', @@ -421,7 +420,6 @@ class LabelArray(ndarray): 'itemsize', 'nbytes', 'ndim', - 'newbyteorder', 'ravel', 'repeat', 'reshape',
MAINT: Remove byteswap and newbyteorder from LabelArray.
quantopian_zipline
train
py
7750aa5936f2c407d8d1eb2d6f64f8f33d442f0e
diff --git a/LiSE/orm.py b/LiSE/orm.py index <HASH>..<HASH> 100644 --- a/LiSE/orm.py +++ b/LiSE/orm.py @@ -977,35 +977,7 @@ class SaveableMetaclass(type): Table declarations ================== - Classes with this metaclass need to be declared with an attribute called - ``tables``. This is a sequence of tuples. Each of the tuples is of length - 5. Each describes a table that records what's in the class. - The meaning of each tuple is thus: - - ``(name, column_declarations, primary_key, foreign_keys, checks)`` - - ``name`` is the name of the table as sqlite3 will use it. - - ``column_declarations`` is a dictionary. The keys are field names, aka - column names. Each value is the type for its field, perhaps including a - clause like DEFAULT 0. - - ``primary_key`` is an iterable over strings that are column names as - declared in the previous argument. Together the columns so named form the - primary key for this table. - - ``foreign_keys`` is a dictionary. Each foreign key is a key here, and its - value is a pair. The first element of the pair is the foreign table that - the foreign key refers to. The second element is the field or fields in - that table that the foreign key points to. - - ``checks`` is an iterable over strings that will each end up in its own - CHECK(...) clause in sqlite3. - - A class of :class:`SaveableMetaclass` can have any number of such - table-tuples. The tables will be declared in the order they appear in the - tables attribute. Dependencies and Custom SQL
That docstring needs a rewrite...later
LogicalDash_LiSE
train
py
5b12351b5d82c52e3e936adb70b2ad5dd159808e
diff --git a/ext_emconf.php b/ext_emconf.php index <HASH>..<HASH> 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -28,7 +28,7 @@ $EM_CONF[$_EXTKEY] = array ( 'CGLcompliance_note' => NULL, 'constraints' => array( 'depends' => array( - 'typo3' => '6.2.0-6.3.99', + 'typo3' => '6.2.4-6.3.99', 'css_styled_content' => '6.2.0-6.3.99', 'realurl' => '1.12.8-1.12.99', ),
Correct dependency to TYPO3 version to ensure that the correct forms are loaded
benjaminkott_bootstrap_package
train
php
6b4de7563acdccfe3876b265abde3aaf022e5892
diff --git a/driver/src/main/org/mongodb/operation/MixedBulkWriteOperation.java b/driver/src/main/org/mongodb/operation/MixedBulkWriteOperation.java index <HASH>..<HASH> 100644 --- a/driver/src/main/org/mongodb/operation/MixedBulkWriteOperation.java +++ b/driver/src/main/org/mongodb/operation/MixedBulkWriteOperation.java @@ -412,9 +412,7 @@ public class MixedBulkWriteOperation<T> implements WriteOperation<BulkWriteResul bulkWriteBatchCombiner.addResult(getResult(writeResult), indexMap); } } catch (MongoWriteException writeException) { - if (writeException.getCommandResult().getResponse().get("wtimeout") != null - || writeException.getCommandResult().getResponse().get("wnote") != null - || writeException.getCommandResult().getResponse().get("jnote") != null) { + if (writeException.getCommandResult().getResponse().get("wtimeout") != null) { bulkWriteBatchCombiner.addWriteConcernErrorResult(getWriteConcernError(writeException)); } else { bulkWriteBatchCombiner.addWriteErrorResult(getBulkWriteError(writeException), indexMap);
JAVA-<I>: Removing special handling of jnote/wnote for bulk write operations against servers <= <I>
mongodb_mongo-java-driver
train
java
df089ed9682dafefd4e804f73518dfb4e25c3232
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -49,11 +49,15 @@ function start_server(opts, callback) { opts.exit_callback(code); } }); + + emitter.once('mongoShutdown', function() { + child.kill('SIGTERM'); + }); - // this type of redirect is causing uncaught exception even with try/catch - // when process exits with non zero error code, even tho error handler - // is registered - //child.stderr.pipe(child.stdout); + // this type of redirect is causing uncaught exception even with try/catch + // when process exits with non zero error code, even tho error handler + // is registered + //child.stderr.pipe(child.stdout); var started = 0; child.stdout.on('data', function(data) { @@ -74,12 +78,13 @@ function start_server(opts, callback) { }); if (opts.auto_shutdown) { var shutdown = function() { - child.kill('SIGTERM'); - }; + child.kill('SIGTERM'); + }; process.on('uncaughtException', shutdown); process.on('exit', shutdown); } } + return emitter; } function dir_exists(dir) {
added emitter return and shutdown listener
winfinit_mongodb-prebuilt
train
js
22a5bfee9f0dfd3e2aaebc287c9fcb1984f78952
diff --git a/mlbgame/__init__.py b/mlbgame/__init__.py index <HASH>..<HASH> 100644 --- a/mlbgame/__init__.py +++ b/mlbgame/__init__.py @@ -0,0 +1,6 @@ +import sys + +if sys.version_info[0] != 2: + print("mlbgame requires Python 2.6+ and does not work with Python 3") + print("You are running Python version {}.{}".format(sys.version_info.major, sys.version_info.minor)) + sys.exit(1) \ No newline at end of file
Ensure it is only run with python <I>+
panzarino_mlbgame
train
py
ef13f4c06ba9b053af7365f729a3b0656fd66767
diff --git a/lib/file/encoder/event.js b/lib/file/encoder/event.js index <HASH>..<HASH> 100644 --- a/lib/file/encoder/event.js +++ b/lib/file/encoder/event.js @@ -211,6 +211,11 @@ function encodeChannelEvent(event) { eventData.writeUInt8(value & 0x7F); eventData.writeUInt8(value >> 7); break; + default: + throw new error.MIDIFileEncoderError( + event.type, + 'known ChannelEvent type' + ); } cursor = new BufferCursor(new buffer.Buffer(
:bulb: Add check for ChannelEvent types
matteodelabre_midijs
train
js
fd334ad028f9475851a92c929e8da946ab44c645
diff --git a/standalone/src/main/java/io/pravega/local/InProcPravegaCluster.java b/standalone/src/main/java/io/pravega/local/InProcPravegaCluster.java index <HASH>..<HASH> 100644 --- a/standalone/src/main/java/io/pravega/local/InProcPravegaCluster.java +++ b/standalone/src/main/java/io/pravega/local/InProcPravegaCluster.java @@ -71,7 +71,6 @@ import org.apache.curator.retry.ExponentialBackoffRetry; @ToString public class InProcPravegaCluster implements AutoCloseable { - private static final String LOCALHOST = "localhost"; private static final String ALL_INTERFACES = "0.0.0.0"; private static final int THREADPOOL_SIZE = 20; private boolean isInMemStorage; @@ -308,7 +307,6 @@ public class InProcPravegaCluster implements AutoCloseable { .with(ServiceConfig.CERT_FILE, this.certFile) .with(ServiceConfig.ENABLE_TLS_RELOAD, this.enableTlsReload) .with(ServiceConfig.LISTENING_IP_ADDRESS, ALL_INTERFACES) - .with(ServiceConfig.PUBLISHED_IP_ADDRESS, LOCALHOST) .with(ServiceConfig.CACHE_POLICY_MAX_TIME, 60) .with(ServiceConfig.CACHE_POLICY_MAX_SIZE, 128 * 1024 * 1024L) .with(ServiceConfig.DATALOG_IMPLEMENTATION, isInMemStorage ?
Issue <I>: Use default published IP in standalone (#<I>) Removes a blanket override on Published IP config from standalone.
pravega_pravega
train
java
d8a5053a96e18b13543fcad05b02a1e8e4d68811
diff --git a/src/frontend/org/voltdb/RealVoltDB.java b/src/frontend/org/voltdb/RealVoltDB.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/RealVoltDB.java +++ b/src/frontend/org/voltdb/RealVoltDB.java @@ -481,6 +481,8 @@ public class RealVoltDB implements VoltDBInterface, RestoreAgent.Callback, Mailb m_messenger.registerMailbox(m_rejoinCoordinator); m_mailboxPublisher.registerMailbox(MailboxType.OTHER, new MailboxNodeContent(m_rejoinCoordinator.getHSId(), null)); + } else if (isRejoin) { + SnapshotSaveAPI.recoveringSiteCount.set(siteMailboxes.size()); } // All mailboxes should be set up, publish it diff --git a/tests/frontend/org/voltdb/TestRejoinEndToEnd.java b/tests/frontend/org/voltdb/TestRejoinEndToEnd.java index <HASH>..<HASH> 100644 --- a/tests/frontend/org/voltdb/TestRejoinEndToEnd.java +++ b/tests/frontend/org/voltdb/TestRejoinEndToEnd.java @@ -170,7 +170,7 @@ public class TestRejoinEndToEnd extends RejoinTestBase { localServer = new ServerThread(config); localServer.start(); - localServer.waitForInitialization(); + localServer.waitForRejoin(); Thread.sleep(2000);
Fix broken rejoin functionality on iv2-master. Wasn't setting recoveringSiteCount with blocking rejoin
VoltDB_voltdb
train
java,java
7f4d2e627b8e3add9573e8a7df9ec4c8eb7d7f78
diff --git a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php index <HASH>..<HASH> 100644 --- a/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php +++ b/tests/ProxyManagerTest/ProxyGenerator/LazyLoadingValueHolder/MethodGenerator/GetProxyInitializerTest.php @@ -37,6 +37,7 @@ class GetProxyInitializerTest extends PHPUnit_Framework_TestCase */ public function testBodyStructure() { + /* @var $initializer PropertyGenerator|\PHPUnit_Framework_MockObject_MockObject */ $initializer = $this->getMock(PropertyGenerator::class); $initializer->expects($this->any())->method('getName')->will($this->returnValue('foo'));
Providing IDE hints for mocks
Ocramius_ProxyManager
train
php
880676aa6f7152e3d99f8cf552d75fdd4d250015
diff --git a/mpop/imageo/image.py b/mpop/imageo/image.py index <HASH>..<HASH> 100644 --- a/mpop/imageo/image.py +++ b/mpop/imageo/image.py @@ -252,6 +252,7 @@ class Image(object): self.fill_value = None self.palette = None self.shape = None + self.info = {} self._secondary_mode = "RGB" diff --git a/mpop/saturn/runner.py b/mpop/saturn/runner.py index <HASH>..<HASH> 100644 --- a/mpop/saturn/runner.py +++ b/mpop/saturn/runner.py @@ -221,6 +221,7 @@ class SequentialRunner(object): LOG.info("Running interrupted") return img = fun() + img.info["product_name"] = product flist.save_object(img, hook) del img except (NotLoadedError, KeyError, ValueError), err: @@ -259,6 +260,7 @@ class SequentialRunner(object): try: LOG.debug("Doing "+product+".") img = fun() + img.info["product_name"] = product if extra_tags: img.tags.update(extra_tags) flist.save_object(img, hook)
Add the product name to the the image info.
pytroll_satpy
train
py,py
85bbd3348cf6e2e0b27d2576c4c85c882c40ef17
diff --git a/tests/Unit/Transport/ResponseValidatorTest.php b/tests/Unit/Transport/ResponseValidatorTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/Transport/ResponseValidatorTest.php +++ b/tests/Unit/Transport/ResponseValidatorTest.php @@ -134,6 +134,28 @@ class ResponseValidatorTest extends \PHPUnit_Framework_TestCase } /** + * Make sure that the content type is asserted properly. + * + * @return void + */ + public function testCharsetContentType() + { + $this->response->expects($this->once()) + ->method('hasHeader') + ->will($this->returnValue(true)); + + $this->response->expects($this->once()) + ->method('getHeader') + ->with('Content-Type') + ->will($this->returnValue(['application/json; charset=utf-8'])); + + $this->assertSame( + $this->validator, + $this->validator->contentType('application/json') + ); + } + + /** * Make sure that a missing Content-Type header throws an exception. * * @return void
Tests: Cover ContentType with charset case.
klarna_kco_rest_php
train
php
4ff6270272f441b7c3fa2a053a25fb4930c3f22e
diff --git a/lib/lingohub/models/project.rb b/lib/lingohub/models/project.rb index <HASH>..<HASH> 100644 --- a/lib/lingohub/models/project.rb +++ b/lib/lingohub/models/project.rb @@ -46,9 +46,9 @@ module Lingohub @resources = {} response = @client.get(self.resources_url) resource_hash = JSON.parse(response) - members = resource_hash["resources"]["members"] + members = resource_hash["members"] members.each do |member| - @resources[member["name"]] = Lingohub::Models::Resource.new(@client, member["link"]["href"]) + @resources[member["name"]] = Lingohub::Models::Resource.new(@client, member["links"][0]["href"]) end end @resources
#1 Fix `lingohub translation:down --all ARGS` Previously, "members" was nested below "resources" and "links" used to be "link" and no array.
lingohub_lingohub_ruby
train
rb
1f7a9b1ab3d261de5be7d490e7e4f978f317242f
diff --git a/daemon/image_delete.go b/daemon/image_delete.go index <HASH>..<HASH> 100644 --- a/daemon/image_delete.go +++ b/daemon/image_delete.go @@ -76,7 +76,7 @@ func (daemon *Daemon) ImageDelete(imageRef string, force, prune bool) ([]types.I // first. We can only remove this reference if either force is // true, there are multiple repository references to this // image, or there are no containers using the given reference. - if !(force || len(repoRefs) > 1) { + if !force && isSingleReference(repoRefs) { if container := daemon.getContainerUsingImage(imgID); container != nil { // If we removed the repository reference then // this image would remain "dangling" and since
Fix untag without force while container running With digests being added by default, all images have multiple references. The check for whether force is required to remove the reference should use the new check for single reference which accounts for digest references. This change restores pre-<I> behavior and ensures images are not accidentally left dangling while a container is running.
moby_moby
train
go
a9117626f83700b917aa8460221059265106c2f6
diff --git a/lib/liquid/health_checks.rb b/lib/liquid/health_checks.rb index <HASH>..<HASH> 100644 --- a/lib/liquid/health_checks.rb +++ b/lib/liquid/health_checks.rb @@ -36,14 +36,19 @@ class HealthCheck end def self.run - @@checks.inject({}) do |result, (name, handler)| - if handler.class == Proc - result[name] = handler.call + @@checks.inject({}) do |results, (name, handler)| + if handler.is_a? Proc + result = handler.call else - result[name] = handler.new.execute + result = handler.new.execute end - result + unless result.is_a? Result + result = Result.new(result , nil, nil) + end + + results[name] = result + results end end
Wrap health check result in Result object if needed
liquidm_ext
train
rb
d634efbfe787a75e81fdc726665c79972ecd2262
diff --git a/shutit_util.py b/shutit_util.py index <HASH>..<HASH> 100644 --- a/shutit_util.py +++ b/shutit_util.py @@ -806,7 +806,7 @@ shutitfile: a shutitfile-based project (can be docker, bash, vagrant) # Finished parsing args. # Sort out config path if shutit.action['list_configs'] or shutit.action['list_modules'] or shutit.action['list_deps'] or shutit_global.shutit_global_object.loglevel == logging.DEBUG: - shutit.build['log_config_path'] = shutit.build['shutit_state_dir'] + '/config/' + shutit.build['build_id'] + shutit.build['log_config_path'] = shutit.build['shutit_state_dir'] + '/config/' if not os.path.exists(shutit.build['log_config_path']): os.makedirs(shutit.build['log_config_path']) os.chmod(shutit.build['log_config_path'],0o777)
logconfigpath does not need build id
ianmiell_shutit
train
py
a5d61a7cd1bcbb1db338803bee663c34d6506125
diff --git a/pysat/_constellation.py b/pysat/_constellation.py index <HASH>..<HASH> 100644 --- a/pysat/_constellation.py +++ b/pysat/_constellation.py @@ -40,7 +40,7 @@ class Constellation(object): ---------- instruments : list A list of pysat Instruments that make up the Constellation - bounds : datetime/filename/None, datetime/filename/None) + bounds : tuple Tuple of two datetime objects or filenames indicating bounds for loading data, a tuple of NoneType objects. Users may provide as a tuple or tuple of lists (useful for bounds with gaps). The attribute is always
MAINT: updated type in docstring Updated the type for `bounds` in the docstring.
rstoneback_pysat
train
py
3062e76124b66d540473e2d208b64bc158fcaf41
diff --git a/server/single_server_test.go b/server/single_server_test.go index <HASH>..<HASH> 100644 --- a/server/single_server_test.go +++ b/server/single_server_test.go @@ -84,7 +84,7 @@ func (s *SingleServerSuite) Test_SingleServer(c *C) { c.Assert(isJsonBody(res), Equals, true) // Create a database. - res, err = postEndpoint("/db", "'CREATE TABLE foo (id integer not null primary key, name text)'") + res, err = postEndpoint("/db", "CREATE TABLE foo (id integer not null primary key, name text)") c.Assert(err, IsNil) c.Assert(res.StatusCode, Equals, 200)
Remove unnecessary single-quotes from unit test
rqlite_rqlite
train
go
df86ef45be3b77032c208c900fc567abec007c38
diff --git a/morphia/src/main/java/com/google/code/morphia/DatastoreImpl.java b/morphia/src/main/java/com/google/code/morphia/DatastoreImpl.java index <HASH>..<HASH> 100644 --- a/morphia/src/main/java/com/google/code/morphia/DatastoreImpl.java +++ b/morphia/src/main/java/com/google/code/morphia/DatastoreImpl.java @@ -713,7 +713,12 @@ public class DatastoreImpl implements Datastore, AdvancedDatastore { cmd.append( "update", ((UpdateOpsImpl<T>) ops).getOps() ); if (!oldVersion) cmd.append( "new", true); + + DBObject res = (DBObject) db.command( cmd ).get( "value" ); - T entity = (T) morphia.getMapper().fromDBObject(qi.getEntityClass(), (DBObject) db.command( cmd ).get( "value" )); - return entity; } + if (res == null) + return null; + else + return (T) morphia.getMapper().fromDBObject(qi.getEntityClass(), res); + } }
Small cleanup to remove exception printing out.
MorphiaOrg_morphia
train
java
54c055c793921a840314523752c8d789899d7eee
diff --git a/server/php/UploadHandler.php b/server/php/UploadHandler.php index <HASH>..<HASH> 100644 --- a/server/php/UploadHandler.php +++ b/server/php/UploadHandler.php @@ -613,7 +613,25 @@ class UploadHandler } list($file_path, $new_file_path) = $this->get_scaled_image_file_paths($file_name, $version); - $type = strtolower(substr(strrchr($file_name, '.'), 1)); + if (function_exists('exif_imagetype')) { + //use the signature of the file + switch(exif_imagetype($file_path)){ + case IMAGETYPE_JPEG: + $type = 'jpg'; + break; + case IMAGETYPE_PNG: + $type = 'png'; + break; + case IMAGETYPE_GIF: + $type = 'gif'; + break; + default: + $type = ''; + } + }else { + //use the extention; + $type = strtolower(substr(strrchr($file_name, '.'), 1)); + } switch ($type) { case 'jpg': case 'jpeg':
Use Exif Data to check the image type, Do not rely on extention
blueimp_jQuery-File-Upload
train
php
cd8e63d2f48bcc563b66fbdf4b9940b42274a618
diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index <HASH>..<HASH> 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -63,7 +63,7 @@ class EOSDriver(NetworkDriver): _RE_BGP_INFO = re.compile(r'BGP neighbor is (?P<neighbor>.*?), remote AS (?P<as>.*?), .*') # noqa _RE_BGP_RID_INFO = re.compile(r'.*BGP version 4, remote router ID (?P<rid>.*?), VRF (?P<vrf>.*?)$') # noqa - _RE_BGP_DESC = re.compile(r'\s+Description: (?P<description>.*?)') + _RE_BGP_DESC = re.compile(r'\s+Description: (?P<description>.*?)$') _RE_BGP_LOCAL = re.compile(r'Local AS is (?P<as>.*?),.*') _RE_BGP_PREFIX = re.compile(r'(\s*?)(?P<af>IPv[46]) Unicast:\s*(?P<sent>\d+)\s*(?P<received>\d+)') # noqa _RE_SNMP_COMM = re.compile(r"""^snmp-server\s+community\s+(?P<community>\S+)
EOS BGP Description not getting retrieved
napalm-automation_napalm
train
py
5416051be6b464b20ff73234523a6cdf2e1d2c20
diff --git a/client/hippo/user.js b/client/hippo/user.js index <HASH>..<HASH> 100644 --- a/client/hippo/user.js +++ b/client/hippo/user.js @@ -73,9 +73,7 @@ export class UserModel extends BaseModel { setFromSessionRequest(req) { merge(this, pick(req, 'errors', 'lastServerMessage')); if (req.isValid) { - Config.data = req.data; - Config.persistToStorage(); - Config.bootstrapUserData(); + Config.update(req.data); this.errors = {}; } return this; diff --git a/templates/js/config-data.js b/templates/js/config-data.js index <HASH>..<HASH> 100644 --- a/templates/js/config-data.js +++ b/templates/js/config-data.js @@ -7,4 +7,4 @@ import <%= name %> from '<%= ext.client_extension_path %>'; <% end %> -Config.bootstrap(<%= Hippo::Extensions.client_bootstrap_data.to_json %>); +Config.update(<%= Hippo::Extensions.client_bootstrap_data.to_json %>);
Config.bootstrap is now update
argosity_hippo
train
js,js
fd77cb68bfdaedc376cc7573b502a81c281b1e5d
diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/linking/XbaseLinkingScopeProvider.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/linking/XbaseLinkingScopeProvider.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/linking/XbaseLinkingScopeProvider.java +++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/linking/XbaseLinkingScopeProvider.java @@ -21,7 +21,7 @@ import com.google.inject.Provider; /** * @author Sven Efftinge - Initial contribution and API */ -public class XbaseLinkingScopeProvider implements IDelegatingScopeProvider { +public class XbaseLinkingScopeProvider implements IScopeProvider /* implements IDelegatingScopeProvider */ { @Inject private IScopeProvider delegate;
[xbase] Workaround to fix critical bug: Disable tracking of imported names for Xtend (== reintroduce the bug)
eclipse_xtext-extras
train
java
963b1bee559985b997f5f131a906c5ce4bc8d026
diff --git a/src/Middleware/ClientIp.php b/src/Middleware/ClientIp.php index <HASH>..<HASH> 100644 --- a/src/Middleware/ClientIp.php +++ b/src/Middleware/ClientIp.php @@ -14,6 +14,11 @@ class ClientIp const KEY = 'CLIENT_IPS'; /** + * @var bool + */ + private $remote = false; + + /** * @var array The trusted headers */ private $headers = [ @@ -78,6 +83,21 @@ class ClientIp } /** + * To get the ip from a remote service. + * Useful for testing purposes on localhost. + * + * @param bool $remote + * + * @return self + */ + public function remote($remote = true) + { + $this->remote = $remote; + + return $this; + } + + /** * Execute the middleware. * * @param ServerRequestInterface $request @@ -105,6 +125,10 @@ class ClientIp $server = $request->getServerParams(); $ips = []; + if ($this->remote) { + $ips[] = file_get_contents('http://ipecho.net/plain'); + } + if (!empty($server['REMOTE_ADDR']) && filter_var($server['REMOTE_ADDR'], FILTER_VALIDATE_IP)) { $ips[] = $server['REMOTE_ADDR']; }
added ClientIp::remote() option
oscarotero_psr7-middlewares
train
php
d3fd24825dead887240ac1f49fd2a49852e1ab78
diff --git a/lib/odyssey.rb b/lib/odyssey.rb index <HASH>..<HASH> 100644 --- a/lib/odyssey.rb +++ b/lib/odyssey.rb @@ -25,7 +25,7 @@ module Odyssey #run whatever method was given as if it were a shortcut to a formula def self.method_missing(*args) #send to the main method - formula_class = args[0].to_s.split("_").each { |s| s.capitalize! }.join + formula_class = args[0].to_s.split("_").map { |s| s.capitalize! }.join analyze(args[1], formula_class, args[2] || false) end @@ -37,4 +37,4 @@ end require 'require_all' require 'odyssey/engine' -require_rel 'formulas' \ No newline at end of file +require_rel 'formulas'
Fix method missing lookup of formula class
cameronsutter_odyssey
train
rb
726abaf8356b680c69d7f0cd9eb8fd75de6e451f
diff --git a/kopeme-core/src/main/java/kieker/monitoring/writer/filesystem/aggregateddata/FileDataManager.java b/kopeme-core/src/main/java/kieker/monitoring/writer/filesystem/aggregateddata/FileDataManager.java index <HASH>..<HASH> 100644 --- a/kopeme-core/src/main/java/kieker/monitoring/writer/filesystem/aggregateddata/FileDataManager.java +++ b/kopeme-core/src/main/java/kieker/monitoring/writer/filesystem/aggregateddata/FileDataManager.java @@ -61,8 +61,6 @@ public class FileDataManager implements Runnable { for (final Map.Entry<AggregatedDataNode, WritingData> value : nodeMap.entrySet()) { writeLine(value); - currentEntries++; - if (currentEntries >= aggregatedTreeWriter.getEntriesPerFile()) { startNextFile(); } @@ -75,6 +73,7 @@ public class FileDataManager implements Runnable { writeHeader(value.getKey()); writeStatistics(value.getValue()); currentWriter.write("\n"); + currentEntries++; value.getValue().persistStatistic(); } }
Update currentEntries only if entry is realy written
DaGeRe_KoPeMe
train
java
0a2dbd7cb5df60e5291b93819e5b11dd61e0ed03
diff --git a/lib/ronin/host_name.rb b/lib/ronin/host_name.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/host_name.rb +++ b/lib/ronin/host_name.rb @@ -21,6 +21,7 @@ require 'ronin/address' require 'ronin/host_name_ip_address' require 'ronin/url' +require 'ronin/email_address' require 'ronin/model' module Ronin @@ -36,6 +37,9 @@ module Ronin has 0..n, :ip_addresses, :through => :host_name_ip_addresses, :model => 'IPAddress' + # The email addresses that are associated with the host-name. + has 0..n, :email_addresses + # # Resolves the IP Address of the host name. #
Forget to add a has 0..n relationship with HostName and EmailAddress.
ronin-ruby_ronin
train
rb
b406fec3086553a025c806dd7d796c04ff81021f
diff --git a/ns_api.py b/ns_api.py index <HASH>..<HASH> 100644 --- a/ns_api.py +++ b/ns_api.py @@ -82,7 +82,7 @@ def list_from_json(source_list_json): Deserialise all the items in source_list from json """ result = [] - if source_list_json == []: + if source_list_json == [] or source_list_json == None: return result for list_item in source_list_json: item = json.loads(list_item)
Fix for rare case where list is None
aquatix_ns-api
train
py
b6de665d64c053639714beb34674e414892224bb
diff --git a/rmd_reader/rmd_reader.py b/rmd_reader/rmd_reader.py index <HASH>..<HASH> 100644 --- a/rmd_reader/rmd_reader.py +++ b/rmd_reader/rmd_reader.py @@ -104,7 +104,7 @@ class RmdReader(readers.BaseReader): opts_knit$set(unnamed.chunk.label="{unnamed_chunk_label}") render_markdown() hook_plot <- knit_hooks$get('plot') -knit_hooks$set(plot=function(x, options) hook_plot(paste0("{{filename}}/", x), options)) +knit_hooks$set(plot=function(x, options) hook_plot(paste0("{{static}}/", x), options)) '''.format(unnamed_chunk_label=chunk_label)) with warnings.catch_warnings(): warnings.simplefilter("ignore")
Avoid warning about the use of {filename} After the upgrade to pelican 4, I got warnings that told me to use {static} instead of {filename}. This change makes these warnings disappear as far as they were caused by my rmd articles.
getpelican_pelican-plugins
train
py
253844614a1092b1da31363c37d9f726263e8beb
diff --git a/features/support/coveralls.rb b/features/support/coveralls.rb index <HASH>..<HASH> 100644 --- a/features/support/coveralls.rb +++ b/features/support/coveralls.rb @@ -1,5 +1,8 @@ if ENV["CI"] require "coveralls" - Coveralls.wear_merged! + Coveralls.wear_merged! do + add_filter "features/" + add_filter "spec/" + end end diff --git a/spec/support/coveralls.rb b/spec/support/coveralls.rb index <HASH>..<HASH> 100644 --- a/spec/support/coveralls.rb +++ b/spec/support/coveralls.rb @@ -2,6 +2,7 @@ if ENV["CI"] require "coveralls" Coveralls.wear_merged! do - add_filter "spec/support" + add_filter "features/" + add_filter "spec/" end end
Even better, ignore all test files for coverage.
tristandunn_pusher-fake
train
rb,rb
a589d0cb8ada3a3b2566e67f0112f44c3a6c0d79
diff --git a/test_howdoi.py b/test_howdoi.py index <HASH>..<HASH> 100644 --- a/test_howdoi.py +++ b/test_howdoi.py @@ -66,7 +66,7 @@ class HowdoiTestCase(unittest.TestCase): first_answer = self.call_howdoi(query) second_answer = self.call_howdoi(query + ' -a') self.assertNotEqual(first_answer, second_answer) - self.assertNotEqual(re.match('.*Answer from http.?://stackoverflow.com.*', second_answer, re.DOTALL), None) + self.assertNotEqual(re.match('.*http.?://.*', second_answer, re.DOTALL), None) def test_multiple_answers(self): query = self.queries[0]
Update automated test to take into account changes
gleitz_howdoi
train
py