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
2928f450b4f97ec454365c09c4039a3610df0bd5
diff --git a/src/main/resources/core/scripts/selenium-remoterunner.js b/src/main/resources/core/scripts/selenium-remoterunner.js index <HASH>..<HASH> 100644 --- a/src/main/resources/core/scripts/selenium-remoterunner.js +++ b/src/main/resources/core/scripts/selenium-remoterunner.js @@ -271,7 +271,9 @@ objectExtend(RemoteRunner.prototype, { }, _HandleHttpResponse : function() { + // When request is completed if (this.xmlHttpForCommandsAndResults.readyState == 4) { + // OK if (this.xmlHttpForCommandsAndResults.status == 200) { if (this.xmlHttpForCommandsAndResults.responseText=="") { LOG.error("saw blank string xmlHttpForCommandsAndResults.responseText"); @@ -280,7 +282,9 @@ objectExtend(RemoteRunner.prototype, { var command = this._extractCommand(this.xmlHttpForCommandsAndResults); this.currentCommand = command; this.continueTestAtCurrentCommand(); - } else { + } + // Not OK + else { var s = 'xmlHttp returned: ' + this.xmlHttpForCommandsAndResults.status + ": " + this.xmlHttpForCommandsAndResults.statusText; LOG.error(s); this.currentCommand = null;
Add comments to HandleHttpResponse as reported in SEL-<I>. r<I>
SeleniumHQ_selenium
train
js
271f8b74d23f45190bccd040b63895ec68d8b25c
diff --git a/test/CoreTest/Entity/AttachableEntityTraitTest.php b/test/CoreTest/Entity/AttachableEntityTraitTest.php index <HASH>..<HASH> 100644 --- a/test/CoreTest/Entity/AttachableEntityTraitTest.php +++ b/test/CoreTest/Entity/AttachableEntityTraitTest.php @@ -100,16 +100,6 @@ class AttachableEntityTraitTest extends \PHPUnit_Framework_TestCase } /** - * @covers ::setAttachableEntityManager() - */ - public function testSetAttachableEntityManagerWithManagerAlreadySet() - { - $this->injectManager($this->attachableEntityTrait); - $this->setExpectedException(\LogicException::class, 'Attachable entity manager is already set'); - $this->injectManager($this->attachableEntityTrait); - } - - /** * @covers ::addAttachedEntity() * @covers ::getAttachableEntityManager() */
[Organizations] adds company logo to the list of profiles page removes testSetAttachableEntityManagerWithManagerAlreadySet. Test is not deeded any more
yawik_core
train
php
ffa642ebd308db4b2bfe4b6406346e28a80c3aa2
diff --git a/src/phpDocumentor/Plugin/Core/Transformer/Writer/Statistics.php b/src/phpDocumentor/Plugin/Core/Transformer/Writer/Statistics.php index <HASH>..<HASH> 100644 --- a/src/phpDocumentor/Plugin/Core/Transformer/Writer/Statistics.php +++ b/src/phpDocumentor/Plugin/Core/Transformer/Writer/Statistics.php @@ -78,7 +78,7 @@ class Statistics extends Checkstyle protected function appendPhpdocStatsElement(\DOMDocument $document) { $stats = $document->createElement('phpdoc-stats'); - $stats->setAttribute('version', rtrim(Application::$VERSION)); + $stats->setAttribute('version', Application::$VERSION); $document->appendChild($stats); return $document;
No need for trim version - fixed in meantime
phpDocumentor_phpDocumentor2
train
php
5e430eda6be8957601434b377468dc1c1a078525
diff --git a/Framework/Gt.php b/Framework/Gt.php index <HASH>..<HASH> 100644 --- a/Framework/Gt.php +++ b/Framework/Gt.php @@ -8,8 +8,11 @@ * defaults for when there aren't any. Then the request is handled, followed by * the response. The final task is to compute all code and render the page. This * is done by the Dispatcher. + * + * For unit tests, passing in true to $skipRequestResponse will stop the usual + * request-response execution. */ -public function __construct($t) { +public function __construct($t, $skipRequestResponse = false) { // set_error_handler(array("ErrorHandler", "error"), // E_ALL & E_NOTICE & E_RECOVERABLE_ERROR); @@ -40,6 +43,10 @@ public function __construct($t) { $c::init(); } + if($skipRequestResponse) { + return; + } + // Compute the request, instantiating the relavent PageCode/Api. $request = new Request($config, $t); $response = new Response($request);
Added skipRequestReturn variable for when inside a test, if the request/response isn't needed to be executed
PhpGt_WebEngine
train
php
cad363fd39c293807d1663e85c264502f13366bc
diff --git a/lib/graphql_grpc/function.rb b/lib/graphql_grpc/function.rb index <HASH>..<HASH> 100644 --- a/lib/graphql_grpc/function.rb +++ b/lib/graphql_grpc/function.rb @@ -96,7 +96,13 @@ module GraphqlGrpc if result.is_a?(Enumerator) [].tap { |arr| result.each { |e| arr << e } } else - result.to_hash + if result.respond_to?(:to_hash) + result.to_hash + elsif result.respond_to?(:to_h) + result.to_h + else + raise NotImplementedError + end end end diff --git a/lib/graphql_grpc/version.rb b/lib/graphql_grpc/version.rb index <HASH>..<HASH> 100644 --- a/lib/graphql_grpc/version.rb +++ b/lib/graphql_grpc/version.rb @@ -1,3 +1,3 @@ module GraphqlGrpc - VERSION = '0.1.12'.freeze + VERSION = '0.1.13'.freeze end
Updating code to handle refactored gRPC response method; #to_hash -> #to_h.
ateamlunchbox_graphql_grpc
train
rb,rb
eff2bc86057b1e0db2b2556f649bd285fae0d2fb
diff --git a/start.js b/start.js index <HASH>..<HASH> 100644 --- a/start.js +++ b/start.js @@ -1,10 +1,12 @@ -"use strict" -var R = require("ramda"); -var minimist = require("minimist"); -var chalk = require("chalk"); -var server = require("./lib/server"); +'use strict' +require('babel-polyfill'); +var R = require('ramda'); +var minimist = require('minimist'); +var chalk = require('chalk'); +var server = require('./lib/server'); var log = require('./lib/shared/log').default; +// Read-in command-line arguments. var args = process.argv.slice(2); args = args.length > 0 ? args = minimist(args) : {}; @@ -29,10 +31,10 @@ if (R.is(String, args.entry)) { port: args.port }) .catch(err => { - log.error(chalk.red("Failed to start.")); + log.error(chalk.red('Failed to start.')); log.error(chalk.red(err.message)); log.error() }); } else { - log.error(chalk.red("No entry path was specified, for example: `--entry ./src/specs`\n")); + log.error(chalk.red('No entry path was specified, for example: `--entry ./src/specs`\n')); }
Ensure async methods run / and changed " => ' (quotes).
philcockfield_ui-harness
train
js
eca7075e33c48dc387bc8f3247e21a6997dd081d
diff --git a/redis/asyncio/lock.py b/redis/asyncio/lock.py index <HASH>..<HASH> 100644 --- a/redis/asyncio/lock.py +++ b/redis/asyncio/lock.py @@ -3,7 +3,7 @@ import sys import threading import uuid from types import SimpleNamespace -from typing import TYPE_CHECKING, Awaitable, NoReturn, Optional, Union +from typing import TYPE_CHECKING, Awaitable, Optional, Union from redis.exceptions import LockError, LockNotOwnedError @@ -243,7 +243,7 @@ class Lock: stored_token = encoder.encode(stored_token) return self.local.token is not None and stored_token == self.local.token - def release(self) -> Awaitable[NoReturn]: + def release(self) -> Awaitable[None]: """Releases the already acquired lock""" expected_token = self.local.token if expected_token is None: @@ -251,7 +251,7 @@ class Lock: self.local.token = None return self.do_release(expected_token) - async def do_release(self, expected_token: bytes): + async def do_release(self, expected_token: bytes) -> None: if not bool( await self.lua_release( keys=[self.name], args=[expected_token], client=self.redis
Fix incorrect return annotation in asyncio.lock (#<I>) NoReturn should be used only when the function never returns. In this case, the awaitable returns None if releasing the lock succeeds, so `Awaitable[None]` is right. Noticed this while reviewing python/typeshed#<I>
andymccurdy_redis-py
train
py
4fa58ce172a37b96cc79fba0e55fba860f8e1b3d
diff --git a/src/geshi/pascal.php b/src/geshi/pascal.php index <HASH>..<HASH> 100644 --- a/src/geshi/pascal.php +++ b/src/geshi/pascal.php @@ -84,6 +84,7 @@ $language_data = array ( ), ), 'SYMBOLS' => array( + ',', ':', '=', '.', '+', '-', '*', '/' ), 'CASE_SENSITIVE' => array( GESHI_COMMENTS => false,
add: some symbols for pascal... still pretty colour-less
GeSHi_geshi-1.0
train
php
68f87378d5bac7efc97cf118f6754b5a6de73fa3
diff --git a/splunklib/modularinput/event_writer.py b/splunklib/modularinput/event_writer.py index <HASH>..<HASH> 100755 --- a/splunklib/modularinput/event_writer.py +++ b/splunklib/modularinput/event_writer.py @@ -48,7 +48,7 @@ class EventWriter(object): else: self._out = TextIOWrapper(output) - if isinstance(output, TextIOBase): + if isinstance(error, TextIOBase): self._err = error else: self._err = TextIOWrapper(error) diff --git a/tests/modularinput/test_event.py b/tests/modularinput/test_event.py index <HASH>..<HASH> 100644 --- a/tests/modularinput/test_event.py +++ b/tests/modularinput/test_event.py @@ -144,9 +144,6 @@ class EventTestCase(unittest.TestCase): out = BytesIO() err = BytesIO() - outwrap = TextIOWrapper(out) - errwrap = TextIOWrapper(err) - ew = EventWriter(out, err) expected_xml = ET.parse(data_open("data/event_maximal.xml")).getroot()
error in checking to see if error output is a TextIOBase Also removed a couple unused objects in a test
splunk_splunk-sdk-python
train
py,py
6fe82ede61724c8e2f1f0a85a204584f10064a19
diff --git a/spf/parser.go b/spf/parser.go index <HASH>..<HASH> 100644 --- a/spf/parser.go +++ b/spf/parser.go @@ -112,6 +112,14 @@ func (p *Parser) sortTokens(tokens []*Token) error { return nil } +func (p *Parser) setDomain(t *Token) string { + if !isEmpty(&t.Value) { + return t.Value + } else { + return p.Domain + } +} + func (p *Parser) parseVersion(t *Token) (bool, SPFResult) { if t.Value == spfPrefix { return true, None
Fix setDomain() A logic inversion was required, as Parser.Domain was returned upon nonempty Token.Value.
zaccone_spf
train
go
5e4d0b7af11fb4e2af7061606d88be28c28f815b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -29,3 +29,4 @@ setup( 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], +)
fixed a small issue with setup.py
ankitjaiswal07_django-offline
train
py
2bca94e8607f351c761415ea7337370f7b16e4f3
diff --git a/src/League/StatsD/Laravel/Provider/StatsdServiceProvider.php b/src/League/StatsD/Laravel/Provider/StatsdServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/League/StatsD/Laravel/Provider/StatsdServiceProvider.php +++ b/src/League/StatsD/Laravel/Provider/StatsdServiceProvider.php @@ -3,7 +3,7 @@ namespace League\StatsD\Laravel\Provider; use Illuminate\Support\ServiceProvider; -use League\StatsD\Client as StatsdClient; +use League\StatsD\Client as Statsd; /** * StatsD Service provider for Laravel @@ -20,6 +20,7 @@ class StatsdServiceProvider extends ServiceProvider */ public function boot() { + $this->package('league/statsd', 'statsd'); } /** @@ -33,7 +34,7 @@ class StatsdServiceProvider extends ServiceProvider } /** - * Register Statsd + * Register Statsd * * @return void */ @@ -54,7 +55,7 @@ class StatsdServiceProvider extends ServiceProvider } // Create - $statsd = new StatsdClient(); + $statsd = new Statsd(); $statsd->configure($options); return $statsd; }
Added $this->package to service provider boot function
thephpleague_statsd
train
php
098483a89aa0d034e8c1425b1abacc5e0032c73e
diff --git a/src/main/java/uk/co/real_logic/agrona/collections/Int2ObjectCache.java b/src/main/java/uk/co/real_logic/agrona/collections/Int2ObjectCache.java index <HASH>..<HASH> 100644 --- a/src/main/java/uk/co/real_logic/agrona/collections/Int2ObjectCache.java +++ b/src/main/java/uk/co/real_logic/agrona/collections/Int2ObjectCache.java @@ -104,6 +104,15 @@ public class Int2ObjectCache<V> } /** + * Reset the cache statistics counters to zero. + */ + public void resetCounters() + { + cacheHits = 0; + cacheMisses = 0; + } + + /** * Get the maximum size the cache of values can grow to. * * @return the maximum size the cache of values can grow to. @@ -403,12 +412,24 @@ public class Int2ObjectCache<V> } /** - * {@inheritDoc} + * Clear down all items in the cache. + * + * If an exception occurs during the eviction handler callback then clear may need to be called again to complete. */ + @SuppressWarnings("unchecked") public void clear() { - size = 0; - Arrays.fill(values, null); + for (int i = 0, size = values.length; i < size; i++) + { + final Object value = values[i]; + if (null != value) + { + values[i] = null; + this.size--; + + evictionHandler.accept((V)value); + } + } } /**
[Java]: Added the ability to reset cache counters and notify of eviction on clear.
real-logic_agrona
train
java
2ce0730ed53ff984056bd0fb7d1b8e3964fd5ed5
diff --git a/tests/unit/modules/test_win_wua.py b/tests/unit/modules/test_win_wua.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/test_win_wua.py +++ b/tests/unit/modules/test_win_wua.py @@ -40,6 +40,7 @@ class WinWuaInstalledTestCase(TestCase): """ Test the functions in the win_wua.installed function """ + service_auto = {"StartType": "Auto"} service_disabled = {"StartType": "Disabled"}
Fix pre-commit (black)
saltstack_salt
train
py
1a3c346d077357d683052c4a6e85ec2e7182b027
diff --git a/src/utils/parse.js b/src/utils/parse.js index <HASH>..<HASH> 100644 --- a/src/utils/parse.js +++ b/src/utils/parse.js @@ -58,7 +58,13 @@ function sanitizeFunction(functionString) { params = match.groups.params.split(',').map((x) => x.trim()) } - const func = Function(...params, match.groups.body || ''); + // Here's the security flaw. We want this functionality for supporting + // JSONP, so we've opted for the best attempt at maintaining some amount + // of security. This should be a little better than eval because it + // shouldn't automatically execute code, just create a function which can + // be called later. + // eslint-disable-next-line no-new-func + const func = new Function(...params, match.groups.body || ''); func.displayName = match.groups.name; return func; }
Fix not using `new` and add comment about the security flaw.
oxyno-zeta_react-editable-json-tree
train
js
88bbb63a5b770403c49ab1dac679223bae789983
diff --git a/src/Instagram.php b/src/Instagram.php index <HASH>..<HASH> 100644 --- a/src/Instagram.php +++ b/src/Instagram.php @@ -52,7 +52,7 @@ class Instagram { * @param array $params * @param array $config */ - public function __construct(array $params, array $config = []) + public function __construct(array $params = [], array $config = []) { $this->accessToken = array_key_exists('accessToken',$params) ? $params['accessToken'] : ''; $this->clientId = array_key_exists('clientId',$params) ? $params['clientId'] : '';
allow instantiation without params
marvinosswald_instagram-php
train
php
20a6a848f4fd76629308887092d5f2aa83ba71a8
diff --git a/spyder/plugins/completion/kite/plugin.py b/spyder/plugins/completion/kite/plugin.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/completion/kite/plugin.py +++ b/spyder/plugins/completion/kite/plugin.py @@ -157,7 +157,7 @@ class KiteCompletionPlugin(SpyderCompletionPlugin): box.set_checked(False) box.set_check_visible(True) box.setText( - _("It seems like your Kite installation is faulty. " + _("It seems that your Kite installation is faulty. " "If you want to use Kite, please remove the " "directory that appears bellow, " "and try a reinstallation:<br><br>"
Kite: Update faulty installation message
spyder-ide_spyder
train
py
144f195da54aea7c74db024783b31454fe39ab82
diff --git a/pgcontents/tests/test_synchronization.py b/pgcontents/tests/test_synchronization.py index <HASH>..<HASH> 100644 --- a/pgcontents/tests/test_synchronization.py +++ b/pgcontents/tests/test_synchronization.py @@ -142,11 +142,24 @@ class TestReEncryption(TestCase): crypto1_factory = {user_id: crypto1}.__getitem__ crypto2_factory = {user_id: crypto2}.__getitem__ - reencrypt_all_users(engine, no_crypto_factory, crypto1_factory, logger) - check_reencryption(no_crypto_manager, manager1) + # Verify that reencryption is idempotent: + for _ in range(2): + reencrypt_all_users( + engine, + no_crypto_factory, + crypto1_factory, + logger, + ) + check_reencryption(no_crypto_manager, manager1) - reencrypt_all_users(engine, crypto1_factory, crypto2_factory, logger) - check_reencryption(manager1, manager2) + for _ in range(2): + reencrypt_all_users( + engine, + crypto1_factory, + crypto2_factory, + logger, + ) + check_reencryption(manager1, manager2) with self.assertRaises(ValueError): # Using reencrypt_all_users with a no-encryption target isn't
TEST: Explicitly test re-entrancy.
quantopian_pgcontents
train
py
78789a3adf9577cf090f2c2bb6cc669b00684197
diff --git a/app/components/medication-allergy.js b/app/components/medication-allergy.js index <HASH>..<HASH> 100644 --- a/app/components/medication-allergy.js +++ b/app/components/medication-allergy.js @@ -1,5 +1,8 @@ import Ember from 'ember'; -import { translationMacro as t } from 'ember-i18n'; + +const { + computed +} = Ember; export default Ember.Component.extend({ store: Ember.inject.service(), @@ -7,8 +10,18 @@ export default Ember.Component.extend({ patient: null, displayModal: false, currentAllergy: false, - buttonConfirmText: t('buttons.add'), - additionalButtons: Ember.computed('currentAllergy', function() { + + buttonConfirmText: computed('currentAllergy', function() { + let i18n = this.get('i18n'); + let currentAllergy = this.get('currentAllergy'); + if (currentAllergy) { + return i18n.t('buttons.update'); + } else { + return i18n.t('buttons.add'); + } + }), + + additionalButtons: computed('currentAllergy', function() { let currentAllergy = this.get('currentAllergy'); let btn = this.get('i18n').t('buttons.delete'); if (currentAllergy) {
Updated button on edit allergy from add to update.
HospitalRun_hospitalrun-frontend
train
js
5304f2909d4ed8069dc83360ff2866232fa43374
diff --git a/umbra/behaviors.d/facebook.js b/umbra/behaviors.d/facebook.js index <HASH>..<HASH> 100644 --- a/umbra/behaviors.d/facebook.js +++ b/umbra/behaviors.d/facebook.js @@ -102,7 +102,7 @@ var umbraIntervalFunc = function() { if (where == 0) { // on screen // var pos = target.getBoundingClientRect().top; // window.scrollTo(0, target.getBoundingClientRect().top - 100); - console.log("clicking at " + target.getBoundingClientRect().top + " on " + target.outerHTML); + console.log("clicking at " + target.getBoundingClientRect().top + " on " + target.id); if (target.click != undefined) { umbraState.expectingSomething = 'closeButton'; target.click();
Less verbose logging.
internetarchive_brozzler
train
js
ed9520cd3b4a39d45ec972b3dc4b612ef8b3500b
diff --git a/lib/jekyll/readers/data_reader.rb b/lib/jekyll/readers/data_reader.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/readers/data_reader.rb +++ b/lib/jekyll/readers/data_reader.rb @@ -7,20 +7,20 @@ module Jekyll @entry_filter = EntryFilter.new(site) end - # Read all the files in <source>/<dir>/_drafts and create a new Draft - # object with each one. + # Read all the files in <dir> and adds them to @content # # dir - The String relative path of the directory to read. # - # Returns nothing. + # Returns @content, a Hash of the .yaml, .yml, + # .json, and .csv files in the base directory def read(dir) base = site.in_source_dir(dir) read_data_to(base, @content) @content end - # Read and parse all yaml files under <dir> and add them to the - # <data> variable. + # Read and parse all .yaml, .yml, .json, and .csv + # files under <dir> and add them to the <data> variable. # # dir - The string absolute path of the directory to read. # data - The variable to which data will be added.
Fixes #<I> Updated data_reader.rb comments to more accurately reflect read() and read_data_to() functionality.
jekyll_jekyll
train
rb
4a18d3649ec3ac07590965d86b3c9b530900ef78
diff --git a/library/CM/Mail.php b/library/CM/Mail.php index <HASH>..<HASH> 100644 --- a/library/CM/Mail.php +++ b/library/CM/Mail.php @@ -1,6 +1,8 @@ <?php -class CM_Mail extends CM_View_Abstract implements CM_Typed { +class CM_Mail extends CM_View_Abstract implements CM_Typed, CM_Service_ManagerAwareInterface { + + use CM_Service_ManagerAwareTrait; /** @var CM_Model_User|null */ private $_recipient; @@ -51,6 +53,8 @@ class CM_Mail extends CM_View_Abstract implements CM_Typed { * @throws CM_Exception_Invalid */ public function __construct($recipient = null, array $tplParams = null, CM_Site_Abstract $site = null) { + $this->setServiceManager(CM_Service_Manager::getInstance()); + if ($this->hasTemplate()) { $this->setRenderLayout(true); }
CM_Mail implements CM_Service_ManagerAwareInterface
cargomedia_cm
train
php
43071368f1e1bb660ad197310bb0d22d66806168
diff --git a/psamm/command.py b/psamm/command.py index <HASH>..<HASH> 100644 --- a/psamm/command.py +++ b/psamm/command.py @@ -91,6 +91,22 @@ class Command(object): logger.warning('Only the first medium will be used') medium = media[0] if len(media) > 0 else None + # Warn about undefined compounds + compounds = set() + for compound in model.parse_compounds(): + compounds.add(compound.id) + + undefined_compounds = set() + for reaction in database.reactions: + for compound, _ in database.get_reaction_values(reaction): + if compound.name not in compounds: + undefined_compounds.add(compound.name) + + for compound in sorted(undefined_compounds): + logger.warning( + 'The compound {} was not defined in the list' + ' of compounds'.format(compound)) + self._mm = MetabolicModel.load_model( database, model.parse_model(), medium, model.parse_limits(), v_max=model.get_default_flux_limit())
command: Warn about compounds that are not defined in the model
zhanglab_psamm
train
py
908a0766cb0dabc4102fdee527868f506d2ce57f
diff --git a/lib/whois/answer/parser/whois.publicinterestregistry.net.rb b/lib/whois/answer/parser/whois.publicinterestregistry.net.rb index <HASH>..<HASH> 100644 --- a/lib/whois/answer/parser/whois.publicinterestregistry.net.rb +++ b/lib/whois/answer/parser/whois.publicinterestregistry.net.rb @@ -177,12 +177,11 @@ module Whois end def trim_newline - # The last line is \r\n\n - @input.scan(/\n+/) + @input.skip(/\n+/) end def parse_not_found - @input.scan(/^NOT FOUND\n/) + @input.skip(/^NOT FOUND\n/) end def parse_throttle
Use skip instead of scan when the consumed string is not relevant
weppos_whois
train
rb
04bc1999046edb9e88e740ee0352cea6d5f5e09d
diff --git a/spec/bolt/transport/winrm_spec.rb b/spec/bolt/transport/winrm_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bolt/transport/winrm_spec.rb +++ b/spec/bolt/transport/winrm_spec.rb @@ -15,6 +15,8 @@ describe Bolt::Transport::WinRM do def mk_config(conf) stringified = conf.each_with_object({}) { |(k, v), coll| coll[k.to_s] = v } + # The default of 10 seconds seems to be too short to always succeed in AppVeyor. + stringified['connect-timeout'] ||= 20 Bolt::Config.new(transport: 'winrm', transports: { winrm: stringified }) end
(maint) Increase winrm timeout in spec tests AppVeyor periodically times out connecting over WinRM during spec tests. Increase the default timeout to avoid connection problems during testing.
puppetlabs_bolt
train
rb
f732ea8e260e06022a31076c87338c0a8137461b
diff --git a/python/lowdim.py b/python/lowdim.py index <HASH>..<HASH> 100644 --- a/python/lowdim.py +++ b/python/lowdim.py @@ -112,7 +112,7 @@ if len(argsIn) > 10 : if analMode == 'mean' : resp = X.map(lambda x : dot(y,x)) -if analMode == 'standardize' : +if analMode == 'corr' : resp = X.map(lambda x : dot(y,(x-mean(x))/norm(x))) if analMode == 'regress' : yhat = dot(inv(dot(y,transpose(y))),y)
Changed name of correlation based analysis
thunder-project_thunder
train
py
e8f55f41893bedefc0ee055a4752b408df0b9d78
diff --git a/schema.py b/schema.py index <HASH>..<HASH> 100644 --- a/schema.py +++ b/schema.py @@ -197,7 +197,8 @@ class Schema(object): required = set(k for k in s if type(k) is not Optional) if not required.issubset(coverage): missing_keys = required - coverage - s_missing_keys = ", ".join(repr(k) for k in missing_keys) + s_missing_keys = ', '.join(repr(k) for k in sorted(missing_keys, + key=repr)) raise SchemaMissingKeyError('Missing keys: ' + s_missing_keys, e) if not self._ignore_extra_keys and (len(new) != len(data)): wrong_keys = set(data.keys()) - set(new.keys())
Sort missing keys Wrong keys are sorted, but for some reason, missing keys are not. Sorting them in the error message looks better and is useful for testability.
keleshev_schema
train
py
7fd79e2bcc65f2e35ee1ada816481ab3e0c64d2a
diff --git a/twitter/statuses.go b/twitter/statuses.go index <HASH>..<HASH> 100644 --- a/twitter/statuses.go +++ b/twitter/statuses.go @@ -27,6 +27,8 @@ type Tweet struct { InReplyToUserIDStr string `json:"in_reply_to_user_id_str"` Lang string `json:"lang"` PossiblySensitive bool `json:"possibly_sensitive"` + QuoteCount int `json:"quote_count"` + ReplyCount int `json:"reply_count"` RetweetCount int `json:"retweet_count"` Retweeted bool `json:"retweeted"` RetweetedStatus *Tweet `json:"retweeted_status"`
Add QuoteCount and RetweetCount to Tweet (#<I>)
dghubble_go-twitter
train
go
125d41add601f472d03f5f39f32c674b25af86f1
diff --git a/app/models/katello/concerns/pulp_database_unit.rb b/app/models/katello/concerns/pulp_database_unit.rb index <HASH>..<HASH> 100644 --- a/app/models/katello/concerns/pulp_database_unit.rb +++ b/app/models/katello/concerns/pulp_database_unit.rb @@ -194,7 +194,12 @@ module Katello def db_values_copy(source_repo, dest_repo) db_values = [] - new_units = self.repository_association_class.where(repository: source_repo).where.not(unit_id_field => self.repository_association_class.where(repository: dest_repo).pluck(unit_id_field)) + existing_unit_ids = self.repository_association_class.where(repository: dest_repo).pluck(unit_id_field) + if existing_unit_ids.empty? + new_units = self.repository_association_class.where(repository: source_repo) + else + new_units = self.repository_association_class.where(repository: source_repo).where.not("#{unit_id_field} in (?) ", existing_unit_ids) + end unit_backend_identifier_field = backend_identifier_field unit_identifier_filed = unit_id_field new_units.each do |unit|
Fixes #<I> - Large CV publish (#<I>)
Katello_katello
train
rb
9ab20ad9907eddc95b40a70d468a56abe63631fa
diff --git a/test/test.index.js b/test/test.index.js index <HASH>..<HASH> 100644 --- a/test/test.index.js +++ b/test/test.index.js @@ -81,7 +81,7 @@ describe("tgfancy", function() { describe("Text Paging (using Tgfancy#sendMessage())", function() { - this.timeout(timeout); + this.timeout(timeout * 2); it("pages long message", function() { const length = 5500; const longText = Array(length + 1).join("#"); @@ -126,6 +126,7 @@ describe("Queued-methods (using Tgfancy#sendMessage())", function() { describe("Chat-ID Resolution (using Tgfancy#sendMessage())", function() { + this.timeout(timeout); it("resolves username", function() { return client.sendMessage(username, "message") .then(function(message) {
[test] Increase timeouts for network ops
GochoMugo_tgfancy
train
js
eab97ee0af14774ca03d98a622052f85aabca4e4
diff --git a/tests/bootstrap.php b/tests/bootstrap.php index <HASH>..<HASH> 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,4 +1,6 @@ <?php require_once('../autoload.php'); -require_once('../vendor/autoload.php'); \ No newline at end of file +require_once('../vendor/autoload.php'); + +error_reporting(E_ERROR); \ No newline at end of file
Changed error reporting level in PHPUnit
siriusphp_upload
train
php
807c5bed4d1ffd40c4065805a20483dd6b6e115d
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,17 +11,17 @@ __author__ = 'Jason R. Coombs <jaraco@jaraco.com>' name = 'jaraco.windows' -setup_params=dict( +setup_params = dict( name = name, - use_hg_version = dict(increment='0.1'), + use_hg_version = dict(increment='0.0.1'), description = 'Windows Routines by Jason R. Coombs', long_description = open('README').read(), author = 'Jason R. Coombs', author_email = 'jaraco@jaraco.com', - url = 'http://pypi.python.org/pypi/'+name, + url = 'http://pypi.python.org/pypi/' + name, packages = find_packages(), zip_safe=True, - namespace_packages = ['jaraco',], + namespace_packages = ['jaraco'], license = 'MIT', classifiers = [ "Development Status :: 5 - Production/Stable",
Updated setup.py with default increment
jaraco_jaraco.windows
train
py
810a59c119a64ce01941bc44fb74f6deaf0b7c0d
diff --git a/claripy/backends/backend_vsa.py b/claripy/backends/backend_vsa.py index <HASH>..<HASH> 100644 --- a/claripy/backends/backend_vsa.py +++ b/claripy/backends/backend_vsa.py @@ -268,6 +268,15 @@ class BackendVSA(Backend): # TODO: Implement other operations! @staticmethod + def Or(*args): + first = args[0] + others = args[1:] + + for o in others: + first = first.union(o) + return first + + @staticmethod def LShR(expr, shift_amount): return expr >> shift_amount
added Or operation to BackendVSA (maps to union on bools)
angr_claripy
train
py
1a7ab87c0dc3cbfb61efaebf6b30534dbfff7a78
diff --git a/logagg/collector.py b/logagg/collector.py index <HASH>..<HASH> 100644 --- a/logagg/collector.py +++ b/logagg/collector.py @@ -62,13 +62,15 @@ class LogCollector(object): self.formatters = {} self.queue = Queue.Queue(maxsize=self.QUEUE_MAX_SIZE) - def validate_log_format(self, log): + def _remove_redundancy(self, log): for key in log: - #To avoid duplicate information if key in log and key in log['data']: log[key] = log['data'].pop(key) + return log - assert bool(key in self.LOG_STRUCTURE) + def validate_log_format(self, log): + for key in log: + assert (key in self.LOG_STRUCTURE) assert isinstance(log[key], self.LOG_STRUCTURE[key]) @keeprunning(LOG_FILE_POLL_INTERVAL, on_error=util.log_exception) @@ -101,6 +103,7 @@ class LogCollector(object): _log = util.load_object(formatter)(raw_log) log.update(_log) + log = self._remove_redundancy(log) self.validate_log_format(log) except (SystemExit, KeyboardInterrupt) as e: raise except:
made _remove_redundancy a separate fn
deep-compute_logagg
train
py
a52a8402380f8c60ace428566f6c3077139ac1c5
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ # -*- coding:utf-8 -*- import setuptools -version = "0.6.9" +version = "0.6.10" with open("README.md", "r") as fh: long_description = fh.read()
Up the version. Thanks to Anders Melchiorsen for his PR's
frawau_aiolifx
train
py
22a09c2e3ad990e858afc1679afa7588dfdd1759
diff --git a/helper/schema/schema.go b/helper/schema/schema.go index <HASH>..<HASH> 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -674,7 +674,7 @@ func (m schemaMap) InternalValidate(topSchemaMap schemaMap) error { var ok bool if target, ok = sm[part]; !ok { - return fmt.Errorf("%s: ConflictsWith references unknown attribute (%s)", k, key) + return fmt.Errorf("%s: ConflictsWith references unknown attribute (%s) at part (%s)", k, key, part) } if subResource, ok := target.Elem.(*Resource); ok {
add "part" to ConflictsWith validation error
hashicorp_terraform
train
go
d99cccae5ebc17bf168a27ea0a63a32244b09300
diff --git a/pyautogui/_pyautogui_x11.py b/pyautogui/_pyautogui_x11.py index <HASH>..<HASH> 100644 --- a/pyautogui/_pyautogui_x11.py +++ b/pyautogui/_pyautogui_x11.py @@ -34,26 +34,26 @@ def _vscroll(clicks, x=None, y=None): clicks = int(clicks) if clicks == 0: return - - if clicks > 0: + elif clicks > 0: button = 4 # scroll up else: button = 5 # scroll down - _click(x, y, button=button, clicks=abs(clicks)) # TODO - broken + for i in range(abs(clicks)): + _click(x, y, button=button) def _hscroll(clicks, x=None, y=None): clicks = int(clicks) if clicks == 0: return - - if clicks > 0: + elif clicks > 0: button = 7 # scroll right else: button = 6 # scroll left - _click(x, y, button=button, clicks=abs(clicks)) # TODO - broken + for i in range(abs(clicks)): + _click(x, y, button=button) def _scroll(clicks, x=None, y=None):
Fixing X<I> scroll.
asweigart_pyautogui
train
py
2beaabc3c97138a6dd3c84d740d83bde7d53e0e0
diff --git a/Component/Drivers/BaseDriver.php b/Component/Drivers/BaseDriver.php index <HASH>..<HASH> 100644 --- a/Component/Drivers/BaseDriver.php +++ b/Component/Drivers/BaseDriver.php @@ -31,12 +31,23 @@ abstract class BaseDriver extends ContainerAware * BaseDriver constructor. * * @param ContainerInterface $container - * @param array $settings + * @param array $args */ - public function __construct(ContainerInterface $container, array $settings = array()) + public function __construct(ContainerInterface $container, array $args = array()) { $this->setContainer($container); - $this->settings = $settings; + + // init $methods by $args + if (is_array($args)) { + $methods = get_class_methods(get_class($this)); + foreach ($args as $key => $value) { + $keyMethod = "set" . ucwords($key); + if (in_array($keyMethod, $methods)) { + $this->$keyMethod($value); + } + } + } + $this->settings = $args; } /**
Fill BaseDriver by args
mapbender_data-source
train
php
72e2f9f41b331c3a24ca4a1a89a81809ed4494e1
diff --git a/src/StefanoTree/NestedSet/NodeInfo.php b/src/StefanoTree/NestedSet/NodeInfo.php index <HASH>..<HASH> 100644 --- a/src/StefanoTree/NestedSet/NodeInfo.php +++ b/src/StefanoTree/NestedSet/NodeInfo.php @@ -108,7 +108,7 @@ class NodeInfo */ public function isRoot(): bool { - if (0 == $this->getParentId()) { + if (1 === $this->getLeft()) { return true; } else { return false;
Check the `left` property in order to understand if a node is root or not: In order to be able to use `id` (and so `parentId`) as string I would like to check the `left` property to discover if a node is root, because 0 == 'an-id-string' is true in php. Also the parentId can be null.
bartko-s_stefano-tree
train
php
0db240c1dd9c0d679d941f0b5e67d72b63a02ea8
diff --git a/lib/behat/form_field/behat_form_field.php b/lib/behat/form_field/behat_form_field.php index <HASH>..<HASH> 100644 --- a/lib/behat/form_field/behat_form_field.php +++ b/lib/behat/form_field/behat_form_field.php @@ -106,7 +106,9 @@ class behat_form_field { // using the generic behat_form_field is because we are // dealing with a fgroup element. $instance = $this->guess_type(); - return $instance->field->keyPress($char, $modifier); + $instance->field->keyDown($char, $modifier); + $instance->field->keyPress($char, $modifier); + $instance->field->keyUp($char, $modifier); } /**
MDL-<I> behat: Key press should be down-press-up As we simulate real user key press event, the event should down followed by press and then up key
moodle_moodle
train
php
20f7a06d699ed2b20ec434d78a0715689f899edf
diff --git a/src/platforms/web/util/attrs.js b/src/platforms/web/util/attrs.js index <HASH>..<HASH> 100644 --- a/src/platforms/web/util/attrs.js +++ b/src/platforms/web/util/attrs.js @@ -33,14 +33,13 @@ const isAttr = makeMap( ) /* istanbul ignore next */ -const isRenderableAttr = (name: string): boolean => { +export const isRenderableAttr = (name: string): boolean => { return ( isAttr(name) || name.indexOf('data-') === 0 || name.indexOf('aria-') === 0 ) } -export { isRenderableAttr } export const propsToAttrMap = { acceptCharset: 'accept-charset',
Inline export for consistency (#<I>)
IOriens_wxml-transpiler
train
js
7483ab61cecd4963ab4432870ba3c88604c8d3d4
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -125,10 +125,9 @@ type Config struct { // never be used except for testing purposes, as it can cause a split-brain. StartAsLeader bool - // The unique ID for this server across all time. If using protocol - // version 0 this is optional and will be populated with the server's - // network address if not given. For protocol version > 0 this is - // required. + // The unique ID for this server across all time. For protocol version + // > 1 this is required, and for older protocols it will be populated with + // the server's network address. LocalID ServerID // NotifyCh is used to provide a channel that will be notified of leadership @@ -168,7 +167,7 @@ func ValidateConfig(config *Config) error { return fmt.Errorf("Protocol version %d must be >= %d and <= %d", config.ProtocolVersion, ProtocolVersionMin, ProtocolVersionMax) } - if config.ProtocolVersion > 0 && len(config.LocalID) == 0 { + if config.ProtocolVersion > 1 && len(config.LocalID) == 0 { return fmt.Errorf("LocalID cannot be empty") } if config.HeartbeatTimeout < 5*time.Millisecond {
Tweaks LocalID comments and requirements.
hashicorp_raft
train
go
a0cdf0310cda2be25cd51d9086f8c435cb5b4526
diff --git a/pylogit/mixed_logit.py b/pylogit/mixed_logit.py index <HASH>..<HASH> 100755 --- a/pylogit/mixed_logit.py +++ b/pylogit/mixed_logit.py @@ -419,8 +419,9 @@ class MixedLogit(base_mcm.MNDC_Model): if "intercept_ref_pos" in kwargs: if kwargs["intercept_ref_pos"] is not None: - msg = "All Mixed Logit intercepts should be in the index." - raise ValueError(msg) + msg = "All Mixed Logit intercepts should be in the index. " + msg_2 = "intercept_ref_pos should be None." + raise ValueError(msg + msg_2) # Carry out the common instantiation process for all choice models model_name = model_type_to_display_name["Mixed Logit"]
Changed the ValueError message for when an individual includes the intercept_ref_pos in the fit_mle method so that it is more specific in pointing out the offense.
timothyb0912_pylogit
train
py
7d60d907b301aeb544db4cee1dd335c41059f08a
diff --git a/spyderlib/widgets/externalshell/namespacebrowser.py b/spyderlib/widgets/externalshell/namespacebrowser.py index <HASH>..<HASH> 100644 --- a/spyderlib/widgets/externalshell/namespacebrowser.py +++ b/spyderlib/widgets/externalshell/namespacebrowser.py @@ -249,14 +249,23 @@ class NamespaceBrowser(QWidget): settings = self.get_view_settings() communicate(self._get_sock(), 'set_remote_view_settings()', settings=[settings]) - + def visibility_changed(self, enable): - """Notify the widget whether its container (the namespace browser + """Notify the widget whether its container (the namespace browser plugin is visible or not""" - self.is_visible = enable - if enable: - self.refresh_table() - + # This is slowing down Spyder a lot if too much data is present in + # the Variable Explorer, and users give focus to it after being hidden. + # This also happens when the Variable Explorer is visible and users + # give focus to Spyder after using another application (like Chrome + # or Firefox). + # That's why we've decided to remove this feature + # Fixes Issue 2593 + # + # self.is_visible = enable + # if enable: + # self.refresh_table() + pass + def toggle_auto_refresh(self, state): """Toggle auto refresh state""" self.autorefresh = state
Variable Explorer: Don't refresh it after giving focus to it Fixes #<I>
spyder-ide_spyder
train
py
e1b9a2896afa4a6699bd23aa20acada4b522afa3
diff --git a/vendor/plugins/refinery/lib/refinery/application_controller.rb b/vendor/plugins/refinery/lib/refinery/application_controller.rb index <HASH>..<HASH> 100644 --- a/vendor/plugins/refinery/lib/refinery/application_controller.rb +++ b/vendor/plugins/refinery/lib/refinery/application_controller.rb @@ -59,7 +59,7 @@ class Refinery::ApplicationController < ActionController::Base protected def default_url_options(options={}) - Refinery::I18n.enabled? ? { :locale => I18n.locale } : {} + ::Refinery::I18n.enabled? ? { :locale => I18n.locale } : {} end # get all the pages to be displayed in the site menu. @@ -88,7 +88,7 @@ protected ::I18n.locale = locale elsif locale.present? and locale != ::Refinery::I18n.default_frontend_locale params[:locale] = I18n.locale = ::Refinery::I18n.default_frontend_locale - redirect_to(params, :message => "The locale '#{locale.to_s}' is not supported.") and return + redirect_to(params, :notice => "The locale '#{locale.to_s}' is not supported.") and return else ::I18n.locale = ::Refinery::I18n.default_frontend_locale end
fully qualify Refinery as ::Refinery and use :notice instead of :message
refinery_refinerycms
train
rb
273a3f2cd27f03fd98aed2525c24c32cbd1ce33a
diff --git a/packages/twig-extensions/functions/custom-functions/pattern-template/pattern_template.function.php b/packages/twig-extensions/functions/custom-functions/pattern-template/pattern_template.function.php index <HASH>..<HASH> 100644 --- a/packages/twig-extensions/functions/custom-functions/pattern-template/pattern_template.function.php +++ b/packages/twig-extensions/functions/custom-functions/pattern-template/pattern_template.function.php @@ -15,6 +15,8 @@ $function = new \Twig_SimpleFunction('pattern_template', function ($patternName) return '@bolt/button.twig'; case 'card': return '@bolt/card.twig'; + case 'card-w-teaser': + return '@bolt/card-w-teaser.twig'; case 'eyebrow': return '@bolt/eyebrow.twig'; case 'flag':
add "card-w-teaser" to "pattern_include" custom twig function
bolt-design-system_bolt
train
php
2cf8c086bcf40706f8841e379a38efb097b5181b
diff --git a/aioworkers/queue/base.py b/aioworkers/queue/base.py index <HASH>..<HASH> 100644 --- a/aioworkers/queue/base.py +++ b/aioworkers/queue/base.py @@ -1,5 +1,6 @@ import asyncio import time +from typing import Any, Callable from ..core.base import AbstractReader, AbstractWriter from ..utils import import_name @@ -36,6 +37,10 @@ class ScoreQueueMixin: default_score: default value score """ + default_score: str + _default_score: Callable[[Any], float] + _loop: asyncio.AbstractEventLoop + def __init__(self, *args, **kwargs): self._base_timestamp = time.time() self._set_default(kwargs) @@ -51,14 +56,15 @@ class ScoreQueueMixin: self._default_score = import_name(default) def _loop_time(self) -> float: - return self.loop.time() + self._base_timestamp + return self._loop.time() + self._base_timestamp def set_config(self, config): super().set_config(config) self._set_default(self._config) async def init(self): - self._base_timestamp = -self.loop.time() + time.time() + self._loop = asyncio.get_running_loop() + self._base_timestamp = -self._loop.time() + time.time() await super().init() def put(self, value, score=None):
fix typing for ScoreQueueMixin
aioworkers_aioworkers
train
py
cf7256ec91780d036f2ff685fb6453a0bf77d93f
diff --git a/lib/gpx/track.rb b/lib/gpx/track.rb index <HASH>..<HASH> 100644 --- a/lib/gpx/track.rb +++ b/lib/gpx/track.rb @@ -55,7 +55,6 @@ module GPX def append_segment(seg) update_meta_data(seg) @segments << seg - @points.concat(seg.points) unless seg.nil? end # Returns true if the given time occurs within any of the segments of this track. @@ -125,7 +124,7 @@ module GPX @distance += seg.distance end end - + protected def update_meta_data(seg) diff --git a/tests/track_test.rb b/tests/track_test.rb index <HASH>..<HASH> 100644 --- a/tests/track_test.rb +++ b/tests/track_test.rb @@ -69,4 +69,13 @@ class TrackTest < Minitest::Test assert_equal(-109.447045, @track.bounds.max_lon) end + def test_append_segment + trk = GPX::Track.new + seg = GPX::Segment.new(track: trk) + pt = GPX::TrackPoint.new(lat: -118, lon: 34) + seg.append_point(pt) + trk.append_segment(seg) + assert_equal(1, trk.points.size) + end + end
Fix duplication of points on appending segment to track
dougfales_gpx
train
rb,rb
7a16fab8eabcebad7f216b9a6b3ab1985dd43fc6
diff --git a/src/plugins/docker/command-handlers.js b/src/plugins/docker/command-handlers.js index <HASH>..<HASH> 100644 --- a/src/plugins/docker/command-handlers.js +++ b/src/plugins/docker/command-handlers.js @@ -21,7 +21,7 @@ import nodemiral from 'nodemiral'; const log = debug('mup:module:docker'); function uniqueSessions(api) { - const {servers, swarm} = api.getConfig().servers; + const {servers, swarm} = api.getConfig(); const sessions = api.getSessions(['app', 'mongo', 'proxy']); if (swarm) {
Fix getting docker sessions when swarm is enabled
zodern_meteor-up
train
js
51c054e20031ba77ae285c38020fbddb15d19f55
diff --git a/app/controllers/impressionist_controller.rb b/app/controllers/impressionist_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/impressionist_controller.rb +++ b/app/controllers/impressionist_controller.rb @@ -3,13 +3,13 @@ require 'digest/sha2' module ImpressionistController module ClassMethods def impressionist(opts={}) - before_filter { |c| c.impressionist_subapp_filter(opts) } + before_action { |c| c.impressionist_subapp_filter(opts) } end end module InstanceMethods def self.included(base) - base.before_filter :impressionist_app_filter + base.before_action :impressionist_app_filter end def impressionist(obj,message=nil,opts={})
before_filter -> before_action `before_filter` is deprecated in favor of `before_action` and removed in Rails <I>
charlotte-ruby_impressionist
train
rb
46d86e7b11525bc3a996a672602651d11ddf17c6
diff --git a/openquake/risklib/asset.py b/openquake/risklib/asset.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/asset.py +++ b/openquake/risklib/asset.py @@ -787,7 +787,8 @@ class Exposure(object): costs.append(Node('cost', a)) occupancies = Node('occupancies') for period in occupancy_periods: - a = dict(occupants=dic[period], period=period) + a = dict(occupants=float(dic[period]), + period=period) occupancies.append(Node('occupancy', a)) tags = Node('tags') for tagname in self.tagcol.tagnames: @@ -813,6 +814,8 @@ class Exposure(object): insurance_limits = {} retrofitted = None asset_id = asset_node['id'].encode('utf8') + # FIXME: in case of an exposure split in CSV files the line number + # is None because param['fname'] points to the .xml file :-( with context(param['fname'], asset_node): self.asset_refs.append(asset_id) taxonomy = asset_node['taxonomy']
Now the line number for CSV exposures without occupancy is returned correctly in case of errors [skip CI] Former-commit-id: <I>c<I>c<I>fde5f<I>f2b<I>bc6d<I>ee
gem_oq-engine
train
py
fea24fb33b5a3e73cf25828acd02d2e03c350990
diff --git a/PheanstalkProducer.php b/PheanstalkProducer.php index <HASH>..<HASH> 100644 --- a/PheanstalkProducer.php +++ b/PheanstalkProducer.php @@ -66,22 +66,6 @@ class PheanstalkProducer implements PsrProducer /** * {@inheritdoc} */ - public function setCompletionListener(CompletionListener $listener = null) - { - $this->completionListener = $listener; - } - - /** - * @return CompletionListener|null - */ - public function getCompletionListener() - { - return $this->completionListener; - } - - /** - * {@inheritdoc} - */ public function getDeliveryDelay() { return $this->deliveryDelay;
remove completion listnere feature for now.
php-enqueue_pheanstalk
train
php
a2eed846b4a1ebd1b4c623e22cbff299ed19bc6a
diff --git a/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java b/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java +++ b/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java @@ -123,11 +123,17 @@ public class Bootstrap { * {@link Channel} is created. Bootstrap creates a new pipeline which has * the same entries with the returned pipeline for a new {@link Channel}. * - * @return the default {@link ChannelPipeline}. {@code null} if - * {@link #setPipelineFactory(ChannelPipelineFactory)} was - * called last time. + * @return the default {@link ChannelPipeline} + * + * @throws IllegalStateException + * if {@link #setPipelineFactory(ChannelPipelineFactory)} was + * called by a user last time. */ public ChannelPipeline getPipeline() { + ChannelPipeline pipeline = this.pipeline; + if (pipeline == null) { + throw new IllegalStateException("pipelineFactory in use"); + } return pipeline; } @@ -143,7 +149,7 @@ public class Bootstrap { if (pipeline == null) { throw new NullPointerException("pipeline"); } - pipeline = this.pipeline; + this.pipeline = pipeline; pipelineFactory = pipelineFactory(pipeline); }
Fixed NETTY-<I> (Bootstrap.getPipeline() shold throw an IllegalStateException if pipelineFactory property is in use.) and NETTY-<I> (Bootstrap.setPipeline() doesn't update the pipeline property at all.)
netty_netty
train
java
28589d459d839bef8af7e03f1d78989dccab528f
diff --git a/src/expression.js b/src/expression.js index <HASH>..<HASH> 100755 --- a/src/expression.js +++ b/src/expression.js @@ -103,8 +103,16 @@ pp.parseMaybeAssign = function(noIn, refShorthandDefaultPos, afterLeftParse) { node.left = this.type === tt.eq ? this.toAssignable(left) : left refShorthandDefaultPos.start = 0 // reset because shorthand default was used correctly this.checkLVal(left) - if (left.parenthesizedExpression && (left.type === "ObjectPattern" || left.type === "ArrayPattern")) { - this.raise(left.start, "You're trying to assign to a parenthesized expression, instead of `({ foo }) = {}` use `({ foo } = {})`"); + if (left.parenthesizedExpression) { + let errorMsg + if (left.type === "ObjectPattern") { + errorMsg = "`({a}) = 0` use `({a} = 0)`" + } else if (left.type === "ArrayPattern") { + errorMsg = "`([a]) = 0` use `([a] = 0)`" + } + if (errorMsg) { + this.raise(left.start, `You're trying to assign to a parenthesized expression, eg. instead of ${errorMsg}`) + } } this.next() node.right = this.parseMaybeAssign(noIn)
make illegal LHS pattern error messages more user friendly
babel_babylon
train
js
891ddcba6ecd6b1bdde77d89476a2d6560f085dc
diff --git a/etcdserver/server.go b/etcdserver/server.go index <HASH>..<HASH> 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -247,7 +247,10 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) { plog.Fatalf("create snapshot directory error: %v", err) } ss := snap.New(cfg.SnapDir()) - be := backend.NewDefaultBackend(path.Join(cfg.SnapDir(), databaseFilename)) + + bepath := path.Join(cfg.SnapDir(), databaseFilename) + beExist := fileutil.Exist(bepath) + be := backend.NewDefaultBackend(bepath) defer func() { if err != nil { be.Close() @@ -351,6 +354,10 @@ func NewServer(cfg *ServerConfig) (srv *EtcdServer, err error) { cl.SetStore(st) cl.SetBackend(be) cl.Recover() + if cl.Version() != nil && cl.Version().LessThan(semver.Version{Major: 3}) && !beExist { + os.RemoveAll(bepath) + return nil, fmt.Errorf("database file (%v) of the backend is missing", bepath) + } default: return nil, fmt.Errorf("unsupported bootstrap config") }
etcdserver: refuse to restart if backend file is missing
etcd-io_etcd
train
go
1ebfb6f6432b48aff0dea83311e0c0510afa3287
diff --git a/xchange-okcoin/src/main/java/com/xeiam/xchange/okcoin/OkCoinExchange.java b/xchange-okcoin/src/main/java/com/xeiam/xchange/okcoin/OkCoinExchange.java index <HASH>..<HASH> 100644 --- a/xchange-okcoin/src/main/java/com/xeiam/xchange/okcoin/OkCoinExchange.java +++ b/xchange-okcoin/src/main/java/com/xeiam/xchange/okcoin/OkCoinExchange.java @@ -55,7 +55,7 @@ public class OkCoinExchange extends BaseExchange { /** Extract futures leverage used by spec */ private static int futuresLeverageOfConfig(ExchangeSpecification exchangeSpecification) { if (exchangeSpecification.getExchangeSpecificParameters().containsKey("Futures_Leverage")) { - return (Integer) exchangeSpecification.getExchangeSpecificParameters().get("Futures_Leverage"); + return Integer.valueOf((String) exchangeSpecification.getExchangeSpecificParameters().get("Futures_Leverage")); } else { // default choice of 10x leverage is "safe" choice and default by OkCoin. return 10;
Fix wrong casting in okcoin Futures_Leverage config
knowm_XChange
train
java
e451bbd0ff408a017e6c77a67fb0c2662c3ec1a2
diff --git a/lib/Site.php b/lib/Site.php index <HASH>..<HASH> 100644 --- a/lib/Site.php +++ b/lib/Site.php @@ -163,7 +163,7 @@ class Site extends Core implements CoreInterface { $this->title = $this->name; $this->description = get_bloginfo('description'); $this->theme = new Theme(); - $this->language_attributes = Helper::function_wrapper('language_attributes'); + $this->language_attributes = get_language_attributes(); $this->multisite = false; }
ref #<I> -- Replace wrapped function with function that doesn’t echo anything
timber_timber
train
php
6338f9e5593044c4e0965945b1939c9e6d5e0cac
diff --git a/lib/ttf/tables/maxp.js b/lib/ttf/tables/maxp.js index <HASH>..<HASH> 100644 --- a/lib/ttf/tables/maxp.js +++ b/lib/ttf/tables/maxp.js @@ -5,16 +5,13 @@ var _ = require('lodash'); var jDataView = require('jDataView'); -// Find max points in glyph contours. -// Actual number of points can be reduced in the further code, but it is not a problem. -// This number cannot be less than max glyph points because of glyph missing -// in certain cases in some browser (like Chrome in MS Windows). +// Find max points in glyph TTF contours. function getMaxPoints(font) { var maxPoints = 0; return _.reduce(font.glyphs, function (maxPoints, glyph) { - var sumPoints = _.reduce(glyph.contours, function (sumPoints, contour) { - return (sumPoints || 0) + contour.points.length; + var sumPoints = _.reduce(glyph.ttfContours, function (sumPoints, contour) { + return (sumPoints || 0) + contour.length; }, sumPoints); return Math.max(sumPoints || 0, maxPoints);
Addition fix for MAXP table.
fontello_svg2ttf
train
js
0001a33e2c46cc44391b0aca8c05de527caf312b
diff --git a/markdownlint.js b/markdownlint.js index <HASH>..<HASH> 100755 --- a/markdownlint.js +++ b/markdownlint.js @@ -5,15 +5,16 @@ var pkg = require('./package'); var program = require('commander'); var values = require('lodash.values'); +var rc = require('rc'); +var extend = require('deep-extend'); +var fs = require('fs'); +var markdownlint = require('markdownlint'); function readConfiguration(args) { - var rc = require('rc'); var config = rc('markdownlint', {}); if (args.config) { - var fs = require('fs'); try { var userConfig = JSON.parse(fs.readFileSync(args.config)); - var extend = require('deep-extend'); config = extend(config, userConfig); } catch (e) { console.warn('Cannot read or parse config file', args.config); @@ -23,7 +24,6 @@ function readConfiguration(args) { } function lint(lintFiles, config) { - var markdownlint = require('markdownlint'); var lintOptions = { files: lintFiles, config: config
Refactoring: move all requires to top
igorshubovych_markdownlint-cli
train
js
5a1639cef3cf8e3160f76bf5764f32328d2ad636
diff --git a/assess_container_networking.py b/assess_container_networking.py index <HASH>..<HASH> 100755 --- a/assess_container_networking.py +++ b/assess_container_networking.py @@ -388,7 +388,7 @@ def assess_container_networking(client, types): log.info("Restarting hosted machine: {}".format(host)) client.juju( 'run', ('--machine', host, 'sudo shutdown -r now')) - client.juju('show-action-status', ('--name', 'juju-run')) + client.juju('show-action-status', ('--name', 'juju-run')) log.info("Restarting controller machine 0") controller_client = client.get_controller_client()
Call show-action-status once.
juju_juju
train
py
d93cab5f22f22ce7cf64749e5a5abe0f566972a3
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -182,7 +182,7 @@ ModulationController.prototype = { getRawWavData: function(array, lbr, version) { var rawPcmData = this.transcode(array, lbr, version); - return this.getWavArray(samples); + return this.getWavArray(rawPcmData); }, fillU16: function(arr, off, val) {
index: fix getRawWavData We were passing the wrong variable name to getWavArray(), and as such it wasn't working at all.
chibitronics_ltc-npm-modulate
train
js
c6a36a5b5a7a16bad71b50580bb39e21fbdad658
diff --git a/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/entities/components/QueryBuilder/QueryStringValue.js b/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/entities/components/QueryBuilder/QueryStringValue.js index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/entities/components/QueryBuilder/QueryStringValue.js +++ b/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/entities/components/QueryBuilder/QueryStringValue.js @@ -37,6 +37,10 @@ export class QueryStringValue extends QueryValue { this._dispatchChangeEvent(); }); + this.handles.value.addEventListener("keydown", (event) => { + event.stopPropagation(); + }); + } _getTemplate() {
Fixes small UX issue with value components in FlowEditor.
structr_structr
train
js
31b032eeedfbdd9952a39c9d5fb941ab042c946b
diff --git a/jishaku/meta.py b/jishaku/meta.py index <HASH>..<HASH> 100644 --- a/jishaku/meta.py +++ b/jishaku/meta.py @@ -13,6 +13,8 @@ Meta information about jishaku. from collections import namedtuple +import pkg_resources + __all__ = ( '__author__', '__copyright__', @@ -33,3 +35,6 @@ __docformat__ = 'restructuredtext en' __license__ = 'MIT' __title__ = 'jishaku' __version__ = '.'.join(map(str, (version_info.major, version_info.minor, version_info.micro))) + +# This ensures that when jishaku is reloaded, pkg_resources requeries it to provide correct version info +del pkg_resources.working_set.by_key['jishaku']
Force pkg_resources to update Jishaku version info
Gorialis_jishaku
train
py
49a9756d0331a10aa8b16527f837b1b813769587
diff --git a/backtrader/lineseries.py b/backtrader/lineseries.py index <HASH>..<HASH> 100644 --- a/backtrader/lineseries.py +++ b/backtrader/lineseries.py @@ -25,6 +25,16 @@ import metabase class LineAlias(object): + ''' Descriptor class that store a line reference and returns that line from the owner + + Keyword Args: + line (int): reference to the line that will be returned fro owner's *lines* buffer + + As a convenience the __set__ method of the descriptor is used not set the *line* reference + because this is a constant along the live of the descriptor instance, but rather to + set the value of the *line* at the instant '0' (the current one) + ''' + def __init__(self, line): self.line = line
lineseries 1st documentation addition
backtrader_backtrader
train
py
89de20a24dfccddf8f96e7e5c62e54ed62e93dd4
diff --git a/lib/dm-core/collection.rb b/lib/dm-core/collection.rb index <HASH>..<HASH> 100644 --- a/lib/dm-core/collection.rb +++ b/lib/dm-core/collection.rb @@ -66,10 +66,7 @@ module DataMapper def get(*key) key = model.typecast_key(key) if loaded? - # find indexed resource (create index first if it does not exist) - if @cache.empty? - each { |r| @cache[r.key] = r } - end + # find indexed resource @cache[key] elsif query.limit || query.offset > 0 # current query is exclusive, find resource within the set
Removed dead code * Cache should be kept in sync through orphan_resource and relate_resource so this block of code should never be executed.
datamapper_dm-core
train
rb
7f9b476341624a1813cea128cafb422f5d65ac97
diff --git a/test/integration/image-component/default/test/index.test.js b/test/integration/image-component/default/test/index.test.js index <HASH>..<HASH> 100644 --- a/test/integration/image-component/default/test/index.test.js +++ b/test/integration/image-component/default/test/index.test.js @@ -1150,7 +1150,7 @@ function runTests(mode) { } }) - it('should be valid W3C HTML', async () => { + it('should be valid HTML', async () => { let browser try { browser = await webdriver(appPort, '/valid-html-w3c') @@ -1161,8 +1161,10 @@ function runTests(mode) { url, format: 'json', isLocal: true, + validator: 'whatwg', }) - expect(result.messages).toEqual([]) + expect(result.isValid).toBe(true) + expect(result.errors).toEqual([]) } finally { if (browser) { await browser.close()
Update to use whatwg validator for test (#<I>) The w3c validator seems to be down and this shouldn't block our tests so this uses the whatwg validator instead x-ref: <URL>
zeit_next.js
train
js
3638eda0c9b9b617ccccbbbc7b0804e279fd467b
diff --git a/django_ses/views.py b/django_ses/views.py index <HASH>..<HASH> 100644 --- a/django_ses/views.py +++ b/django_ses/views.py @@ -174,7 +174,7 @@ def handle_bounce(request): For the format of the SNS subscription confirmation request see this URL: http://docs.aws.amazon.com/sns/latest/gsg/json-formats.html#http-subscription-confirmation-json - SNS message signatures are verified by default. This funcionality can + SNS message signatures are verified by default. This functionality can be disabled by setting AWS_SES_VERIFY_BOUNCE_SIGNATURES to False. However, this is not recommended. See: http://docs.amazonwebservices.com/sns/latest/gsg/SendMessageToHttp.verify.signature.html
docs: Fix simple typo, funcionality -> functionality (#<I>) There is a small typo in django_ses/views.py. Should read `functionality` rather than `funcionality`.
django-ses_django-ses
train
py
bb9517b73f9148c0270751ccca66af8fce2e2f93
diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -38,7 +38,7 @@ module Jekyll # Build your Jekyll site. # # site - the Jekyll::Site instance to build - # options - the + # options - A Hash of options passed to the command # # Returns nothing. def build(site, options)
Fill in a bit of missing TomDoc Fill in a piece of missing doc for the `build` function in `commands/build.rb`
jekyll_jekyll
train
rb
7f962a8efefed8c05acada58c480fdf30fc2a9dd
diff --git a/lib/generators/double_entry/install/templates/migration.rb b/lib/generators/double_entry/install/templates/migration.rb index <HASH>..<HASH> 100644 --- a/lib/generators/double_entry/install/templates/migration.rb +++ b/lib/generators/double_entry/install/templates/migration.rb @@ -1,5 +1,10 @@ -class CreateDoubleEntryTables < ActiveRecord::Migration[4.2] +if Rails::VERSION::STRING[0..2].to_f < 5 + active_record_migration_class = ActiveRecord::Migration[Rails::VERSION::STRING[0..2].to_f] +else + active_record_migration_class = ActiveRecord::Migration +end +class CreateDoubleEntryTables < active_record_migration_class def self.up create_table "double_entry_account_balances", :force => true do |t| t.string "account", :limit => 31, :null => false
gracefully fallback class so rails 4 doesn't break
envato_double_entry
train
rb
646b23e0b4e116dfcdaa1bceb12ae7be03f43ebd
diff --git a/lib/carto/external.js b/lib/carto/external.js index <HASH>..<HASH> 100644 --- a/lib/carto/external.js +++ b/lib/carto/external.js @@ -228,7 +228,7 @@ External.types = [ } }, { - extension: /\.geojson/, + extension: /\.geojson|\.json/, datafile: function(d, c) { c(null, d.path()) }, ds_options: { type: 'ogr',
Accept .json extension as geojson.
mapbox_carto
train
js
e33902f52a7d62d16ce190723f0b5bf4a98d0e29
diff --git a/lib/configurate/proxy.rb b/lib/configurate/proxy.rb index <HASH>..<HASH> 100644 --- a/lib/configurate/proxy.rb +++ b/lib/configurate/proxy.rb @@ -36,7 +36,9 @@ module Configurate :to_ary => :to_a }.each do |method, converter| define_method method do - target.public_send converter + value = target + return value.public_send converter if value.respond_to? converter + value.public_send method end end
fallback to implicit converter if there's no explicit converter defined
jhass_configurate
train
rb
bb41d2300bebdcf54a3f129b201bdd9b74d02bc3
diff --git a/test/www/jxcore/bv_tests/testThaliNativeLayer.js b/test/www/jxcore/bv_tests/testThaliNativeLayer.js index <HASH>..<HASH> 100644 --- a/test/www/jxcore/bv_tests/testThaliNativeLayer.js +++ b/test/www/jxcore/bv_tests/testThaliNativeLayer.js @@ -1,6 +1,6 @@ 'use strict'; -if (typeof Mobile === 'undefined') { +if (!jxcore.utils.OSInfo().isMobile) { return; }
Disable the Thali native layer test on desktop. It doesn't work anymore due to the way the Wifi infrastructure handles the express router object.
thaliproject_Thali_CordovaPlugin
train
js
342d923a15df211774811f6f9cc65ab2603757e3
diff --git a/pysat/instruments/nasa_cdaweb_methods.py b/pysat/instruments/nasa_cdaweb_methods.py index <HASH>..<HASH> 100644 --- a/pysat/instruments/nasa_cdaweb_methods.py +++ b/pysat/instruments/nasa_cdaweb_methods.py @@ -34,8 +34,8 @@ def list_files(tag=None, sat_id=None, data_path=None, format_str=None, User specified file format. If None is specified, the default formats associated with the supplied tags are used. (default=None) supported_tags : (dict or NoneType) - keys are tags supported by list_files routine. Values are the - default format_str values for key. (default=None) + keys are sat_id, each containing a dict keyed by tag + where the values file format template strings. (default=None) fake_daily_files_from_monthly : bool Some CDAWeb instrument data files are stored by month, interfering with pysat's functionality of loading by day. This flag, when true,
Updated docstring information on supported_tags
rstoneback_pysat
train
py
41bce32b79c029957dc825dd3140450f17e0aeb5
diff --git a/lib/plugins/index.js b/lib/plugins/index.js index <HASH>..<HASH> 100644 --- a/lib/plugins/index.js +++ b/lib/plugins/index.js @@ -527,6 +527,7 @@ function resolvePluginRule(req) { var rules = req.rules; var plugin = req.pluginMgr = getPluginByRuleUrl(comUtil.rule.getUrl(rules.rule)); var _plugin = getPluginByPluginRule(rules.plugin); + req.ruleValue = plugin && comUtil.getMatcherValue(rules.rule); if (_plugin) { if (plugin) { if (plugin != _plugin) {
refactor: Refine lib/plugins/index.js
avwo_whistle
train
js
88dfb912d71ae4d14de0d7b54a3a35b0c81bcf44
diff --git a/app/templates/gulp/watch-assets.js b/app/templates/gulp/watch-assets.js index <HASH>..<HASH> 100644 --- a/app/templates/gulp/watch-assets.js +++ b/app/templates/gulp/watch-assets.js @@ -72,7 +72,6 @@ module.exports = function (gulp, plugins) { plugins.watch([ 'views/**/*.' + cfg.nitro.view_file_extension, - '!' + cfg.nitro.view_partials_directory + '/*.' + cfg.nitro.view_file_extension, // exclude partials cfg.nitro.view_data_directory + '/**/*.json', 'components/**/*.' + cfg.nitro.view_file_extension<% if (options.clientTpl) { %>, '!components/**/template/**/*.hbs'<% } %>,
partial change reloads the browser
namics_generator-nitro
train
js
ba49c18cbbf8ad1d9a263469bbd2898b3d294970
diff --git a/src/Layers/DynamicMapLayer.js b/src/Layers/DynamicMapLayer.js index <HASH>..<HASH> 100644 --- a/src/Layers/DynamicMapLayer.js +++ b/src/Layers/DynamicMapLayer.js @@ -70,6 +70,8 @@ L.esri.Layers.DynamicMapLayer = L.esri.Layers.RasterLayer.extend({ if(this.options.layers){ identifyRequest.layers('visible:' + this.options.layers.join(',')); + } else { + identifyRequest.layers('visible'); } identifyRequest.run(callback);
identify only visible layers in bindPopup
Esri_esri-leaflet
train
js
47307dbc7e3be785630f4e158215e34aa6fdf033
diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ReproTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ReproTests.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ReproTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ReproTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
Polish contribution Closes gh-<I>
spring-projects_spring-boot
train
java
3032245d535f444201766c3b80528416eb926c0f
diff --git a/plugins/SegmentEditor/Controller.php b/plugins/SegmentEditor/Controller.php index <HASH>..<HASH> 100644 --- a/plugins/SegmentEditor/Controller.php +++ b/plugins/SegmentEditor/Controller.php @@ -26,7 +26,9 @@ class Piwik_SegmentEditor_Controller extends Piwik_Controller foreach($segments as $segment) { if($segment['category'] == Piwik_Translate('General_Visit') && $segment['type'] == 'metric') { - $segment['category'] .= ' (' . lcfirst(Piwik_Translate('General_Metrics')) . ')'; + $metricsLabel = Piwik_Translate('General_Metrics'); + $metricsLabel[0] = strtolower($metricsLabel[0]); + $segment['category'] .= ' (' . $metricsLabel . ')'; } $segmentsByCategory[$segment['category']][] = $segment; }
Fixing lcfirst not available yet
matomo-org_matomo
train
php
44dc0168c4c43fea9ad9ee605b8199ca68d5c415
diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/message/ODistributedConnectResponse.java b/client/src/main/java/com/orientechnologies/orient/client/remote/message/ODistributedConnectResponse.java index <HASH>..<HASH> 100644 --- a/client/src/main/java/com/orientechnologies/orient/client/remote/message/ODistributedConnectResponse.java +++ b/client/src/main/java/com/orientechnologies/orient/client/remote/message/ODistributedConnectResponse.java @@ -28,12 +28,14 @@ public class ODistributedConnectResponse implements OBinaryResponse { @Override public void write(OChannelDataOutput channel, int protocolVersion, ORecordSerializer serializer) throws IOException { + channel.writeInt(sessionId); channel.writeInt(distributedProtocolVersion); channel.writeBytes(token); } @Override public void read(OChannelDataInput network, OStorageRemoteSession session) throws IOException { + this.sessionId = network.readInt(); distributedProtocolVersion = network.readInt(); token = network.readBytes(); }
fixed missing sessionId in distributed request
orientechnologies_orientdb
train
java
bb05cd306a679420ab9ec3df3f0d8fca14312327
diff --git a/src/Propel/Runtime/Map/DatabaseMap.php b/src/Propel/Runtime/Map/DatabaseMap.php index <HASH>..<HASH> 100644 --- a/src/Propel/Runtime/Map/DatabaseMap.php +++ b/src/Propel/Runtime/Map/DatabaseMap.php @@ -184,7 +184,7 @@ class DatabaseMap $this->addTableFromMapClass($tmClass); return $this->tablesByPhpName[$phpName]; - } else if (class_exists($tmClass = substr_replace($phpName, '\\map\\', strrpos($phpName, '\\'), 1) . 'TableMap')) { + } else if (class_exists($tmClass = substr_replace($phpName, '\\Map\\', strrpos($phpName, '\\'), 1) . 'TableMap')) { $this->addTableFromMapClass($tmClass); return $this->tablesByPhpName[$phpName];
Generator now creates the map and om folders camelcased Map and Om
propelorm_Propel2
train
php
537f0e249ce81fc460be921162f5abebebbafd67
diff --git a/filesystem.go b/filesystem.go index <HASH>..<HASH> 100644 --- a/filesystem.go +++ b/filesystem.go @@ -19,6 +19,7 @@ import ( "os" "github.com/pkg/errors" + "regexp" ) func EnsureDir(path string) error { @@ -46,3 +47,21 @@ func GetFiles(path string) ([]string, error) { } return fileNames, nil } + +func GetFilteredFiles(path string, filter string) ([]string, error) { + files, err := GetFiles(path) + if err != nil { + return nil, err + } + filterRegexp, err := regexp.Compile(filter) + if err != nil { + return nil, errors.Wrapf(err, "cannot compile filter regexp '%s'", filter) + } + filteredFiles := make([]string, 0, len(files)) + for _, file := range files { + if filterRegexp.MatchString(file) { + filteredFiles = append(filteredFiles, file) + } + } + return filteredFiles, nil +} \ No newline at end of file
Add function to get files from directory, that match regexp.
lyobzik_go-utils
train
go
3ee5e6a384a16d55169ca51fd728ecfdb55d2c27
diff --git a/Form/Type/BaseType.php b/Form/Type/BaseType.php index <HASH>..<HASH> 100644 --- a/Form/Type/BaseType.php +++ b/Form/Type/BaseType.php @@ -87,8 +87,10 @@ class BaseType extends AbstractFormType $fieldOptions = array_merge($guess->getOptions(), $fieldOptions); } } + if ($meta->isAssociation($field)) { + $this->addValidConstraint($fieldOptions); + } - $this->addValidConstraint($fieldOptions); $builder->add($field, $fieldType, $fieldOptions); } }
Base form type: add "valid" constraint only for associations.
DarvinStudio_DarvinAdminBundle
train
php
e532caa069ddce3733e87970fbad88efcef46567
diff --git a/lib/gds_zendesk/version.rb b/lib/gds_zendesk/version.rb index <HASH>..<HASH> 100644 --- a/lib/gds_zendesk/version.rb +++ b/lib/gds_zendesk/version.rb @@ -1,3 +1,3 @@ module GDSZendesk - VERSION = "1.0.1" + VERSION = "1.0.2" end
Bump gem version to <I> (pushing to rubygems)
alphagov_gds_zendesk
train
rb
578450eaaa3f66ab6ac42f43fa9d79eb2b3d0939
diff --git a/src/rituals/invoke_tasks.py b/src/rituals/invoke_tasks.py index <HASH>..<HASH> 100644 --- a/src/rituals/invoke_tasks.py +++ b/src/rituals/invoke_tasks.py @@ -23,6 +23,7 @@ # TODO: Move task bodies to common_tasks module, and just keep Invoke wrappers here import os +import sys import shlex import shutil @@ -113,8 +114,18 @@ def dist(devpi=False, egg=True, wheel=False): @task def test(): """Perform standard unittests.""" - config.load() - run('python setup.py test') + cfg = config.load() + add_root2pypath(cfg) + + try: + console = sys.stdin.isatty() + except AttributeError: + console = False + + if console and os.path.exists('bin/py.test'): + run('bin/py.test --color=yes {0}'.format(cfg.testdir)) + else: + run('python setup.py test') @task
:arrow_upper_right: use colorized py.test output when printing to console
jhermann_rituals
train
py
fb9d4049d82d2eb2ea6e91874867ecc7064933a9
diff --git a/test/mouse.spec.js b/test/mouse.spec.js index <HASH>..<HASH> 100644 --- a/test/mouse.spec.js +++ b/test/mouse.spec.js @@ -136,5 +136,20 @@ module.exports.addTests = function({testRunner, expect, FFOX}) { [200, 300] ]); }); + // @see https://crbug.com/929806 + xit('should work with mobile viewports and cross process navigations', async({page, server}) => { + await page.goto(server.EMPTY_PAGE); + await page.setViewport({width: 360, height: 640, isMobile: true}); + await page.goto(server.CROSS_PROCESS_PREFIX + '/mobile.html'); + await page.evaluate(() => { + document.addEventListener('click', event => { + window.result = {x: event.clientX, y: event.clientY}; + }); + }); + + await page.mouse.click(30, 40); + + expect(await page.evaluate('result')).toEqual({x: 30, y: 40}); + }); }); };
test(mouse): add failing for test for mobile + cross process navigation (#<I>)
GoogleChrome_puppeteer
train
js
07b705ce16c159f6223ab6a52866a4337ec1ea3f
diff --git a/views/js/qtiRunner/modalFeedback/inlineRenderer.js b/views/js/qtiRunner/modalFeedback/inlineRenderer.js index <HASH>..<HASH> 100644 --- a/views/js/qtiRunner/modalFeedback/inlineRenderer.js +++ b/views/js/qtiRunner/modalFeedback/inlineRenderer.js @@ -108,6 +108,10 @@ define([ firstFeedback = $(renderingData.dom); } + $('img', renderingData.dom).on('load', function() { + iframeNotifier.parent('itemcontentchange'); + }); + //record rendered feedback for later reference renderedFeebacks.push(renderingData); if(renderedFeebacks.length === renderingQueue.length){
Force frame resize when images nested inside inline feedback are loaded
oat-sa_extension-tao-itemqti
train
js
3f58786eb17e99f14ebab44f9d52384a4143ceb3
diff --git a/nodeconductor/structure/serializers.py b/nodeconductor/structure/serializers.py index <HASH>..<HASH> 100644 --- a/nodeconductor/structure/serializers.py +++ b/nodeconductor/structure/serializers.py @@ -1,10 +1,11 @@ from __future__ import unicode_literals +import re + from django.db import models as django_models from django.contrib import auth from django.core.exceptions import ValidationError from rest_framework import serializers -from rest_framework.reverse import reverse from nodeconductor.core import serializers as core_serializers, utils as core_utils from nodeconductor.structure import models, filters @@ -503,13 +504,11 @@ class CreationTimeStatsSerializer(serializers.Serializer): class PasswordSerializer(serializers.Serializer): password = serializers.CharField(min_length=7) - def validate(self, attrs): - password = attrs.get('password') - - import re - - if not re.search('\d+', password): + def validate_password(self, value): + if not re.search('\d+', value): raise serializers.ValidationError("Password must contain one or more digits") - if not re.search('[^\W\d_]+', password): + if not re.search('[^\W\d_]+', value): raise serializers.ValidationError("Password must contain one or more upper- or lower-case characters") + + return value
Update password validation to DRF <I> NC-<I>
opennode_waldur-core
train
py
fd81c6daedbb184b45575a1035fea6858e578e8f
diff --git a/lib/health_inspector/checklists/cookbooks.rb b/lib/health_inspector/checklists/cookbooks.rb index <HASH>..<HASH> 100644 --- a/lib/health_inspector/checklists/cookbooks.rb +++ b/lib/health_inspector/checklists/cookbooks.rb @@ -38,6 +38,7 @@ module HealthInspector Chef::CookbookVersion::COOKBOOK_SEGMENTS.each do |segment| cookbook.manifest[segment].each do |manifest_record| path = cookbook_path.join("#{manifest_record['path']}") + next if path.basename.to_s == '.git' if path.exist? checksum = checksum_cookbook_file(path)
Fix a bug that happens with git submodules in some cases Fixes #7
bmarini_knife-inspect
train
rb
91f11f912c11136f342f0233a6e7773c8e6c4257
diff --git a/tooling/circle-cli/commands/verify-no-builds-on-branch.js b/tooling/circle-cli/commands/verify-no-builds-on-branch.js index <HASH>..<HASH> 100644 --- a/tooling/circle-cli/commands/verify-no-builds-on-branch.js +++ b/tooling/circle-cli/commands/verify-no-builds-on-branch.js @@ -9,9 +9,22 @@ const tap = require(`../lib/tap`); const blockUntilQueueEmpty = _.curry(function blockUntilQueueEmpty(argv, ci) { return ci.getBranchBuilds(argv) .then((builds) => { - if (_.filter(builds, {status: `pending`}).length > 0 || _.filter(builds, {status: `running`}).length > 0) { + + // lifecycle values: + // - queued + // - scheduled + // - not_run + // - not_running + // - running + // - finished + // I'm assuming not_run and finished are the only values the imply the + // build is not running or pending + const queued = builds + .filter((build) => build.lifecycle !== `finished` && build.lifecycle !== `not_run`); + + if (queued.length > 0) { return new Promise((resolve) => { - console.log('waiting for queue to drain') + console.log(`waiting for queue to drain`); setTimeout(() => resolve(blockUntilQueueEmpty(argv, ci)), argv.interval); }); }
chore(tooling): adjust queuing logic
webex_spark-js-sdk
train
js
b7844282bc44dc548f62b4e4784c79c6231d5f65
diff --git a/pymbar/timeseries.py b/pymbar/timeseries.py index <HASH>..<HASH> 100644 --- a/pymbar/timeseries.py +++ b/pymbar/timeseries.py @@ -389,7 +389,8 @@ def normalizedFluctuationCorrelationFunction(A_n, B_n=None, N_max=None, norm=Tru N_max : int, default=None if specified, will only compute correlation function out to time lag of N_max norm: bool, optional, default=True - if False will retrun the unnormalized correlation function D(t) = <A(t) B(t)> + if False will return the unnormalized correlation function D(t) = <A(t) B(t)> + Returns ------- C_n : np.ndarray @@ -488,6 +489,7 @@ def normalizedFluctuationCorrelationFunctionMultiple(A_kn, B_kn=None, N_max=None if False, will return unnormalized D(t) = <A(t) B(t)> truncate: bool, optional, default=False if True, will stop calculating the correlation function when it goes below 0 + Returns ------- C_n[n] : np.ndarray @@ -807,6 +809,7 @@ def statisticalInefficiency_fft(A_n, mintime=3, memsafe=True): If this function is used several times on arrays of comparable size then one might benefit from setting this option to False. If set to True then clear np.fft cache to avoid a fast increase in memory consumption when this function is called on many arrays of different sizes. + Returns ------- g : np.ndarray,
Fixes missing blank line before Returns section in docs
choderalab_pymbar
train
py
d496405470865a4b15aa814e3b5c6f96c3dd8ef6
diff --git a/src/Constraints/Enum.php b/src/Constraints/Enum.php index <HASH>..<HASH> 100644 --- a/src/Constraints/Enum.php +++ b/src/Constraints/Enum.php @@ -17,8 +17,16 @@ class Enum implements Constraint { Assert::type($parameter, 'array', self::KEYWORD, $validator->getPointer()); - if (in_array($value, $parameter, true)) { - return null; + if (is_object($value)) { + foreach ($parameter as $i) { + if (is_object($i) && $value == $i) { + return null; + } + } + } else { + if (in_array($value, $parameter, true)) { + return null; + } } return new ValidationError(
Fixes enum constraint edge case with objects equality (#<I>) * Fixes enum constraint edge case with objects equality closes #<I> * fix code style
thephpleague_json-guard
train
php
ee21baff0db5415e0a647a5798f2799c82079027
diff --git a/pybliometrics/scopus/superclasses/search.py b/pybliometrics/scopus/superclasses/search.py index <HASH>..<HASH> 100644 --- a/pybliometrics/scopus/superclasses/search.py +++ b/pybliometrics/scopus/superclasses/search.py @@ -60,7 +60,7 @@ class Search(Base): ValueError If the api parameter is an invalid entry. """ - params = {'count': count, 'view': view} + params = {'count': count, 'view': view, **kwds} if isinstance(query, dict): params.update(query) name = "&".join(["=".join(t) for t in zip(query.keys(), query.values())])
adding additionally provided parameters into account for the search paramters (#<I>)
scopus-api_scopus
train
py
6dbf7cf5f8cbc0689146795e85bde752534ca364
diff --git a/libaio/__init__.py b/libaio/__init__.py index <HASH>..<HASH> 100644 --- a/libaio/__init__.py +++ b/libaio/__init__.py @@ -231,10 +231,10 @@ class AIOContext(object): block (AIOBlock) The IO block to cancel. - Returns cancelled block's event data. + Returns cancelled block's event data (see getEvents). """ event = libaio.io_event() - libaio.io_cancel(self._ctx, block._iocb, event) + libaio.io_cancel(self._ctx, byref(block._iocb), byref(event)) return self._eventToPython(event) def getEvents(self, min_nr=1, nr=None, timeout=None): @@ -250,6 +250,11 @@ class AIOContext(object): timeout (float, None): Time to wait for events. If None, become blocking. + + Returns a list of 3-tuples, containing: + - completed AIOBlock instance + - res, file-object-type-dependent value + - res2, another file-object-type-dependent value """ if nr is None: nr = self._maxevents
libaio.AIOContext: Document event data a bit better. Not documented by libaio, so found by reading kernel source. Also, (hopefully) fix io_cancel arguments.
vpelletier_python-libaio
train
py
f6b5c080808e2cf2e4b9a59c9645f5e75bd00899
diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js index <HASH>..<HASH> 100644 --- a/src/core/renderers/webgl/managers/FilterManager.js +++ b/src/core/renderers/webgl/managers/FilterManager.js @@ -203,6 +203,8 @@ FilterManager.prototype.applyFilter = function (filter, input, output, clear) // bind the input texture.. input.texture.bind(0); + // when you manually bind a texture, please switch active texture location to it + renderer._activeTextureLocation = 0; renderer.state.setBlendMode( filter.blendMode );
when you manually bind a texture, please switch renderer active texture location to it
pixijs_pixi.js
train
js
06a81934ec6b953d2c0f9bea4724c5186cd82aef
diff --git a/lib/sass/plugin/staleness_checker.rb b/lib/sass/plugin/staleness_checker.rb index <HASH>..<HASH> 100644 --- a/lib/sass/plugin/staleness_checker.rb +++ b/lib/sass/plugin/staleness_checker.rb @@ -104,7 +104,7 @@ module Sass lambda do |dep| begin mtime(dep) > css_mtime || dependencies_stale?(dep, css_mtime) - rescue Sass::SyntaxError + rescue Sass::SyntaxError, Errno::ENOENT # If there's an error finding depenencies, default to recompiling. true end
[Sass] Make sure deleted dependencies are handled correctly.
sass_ruby-sass
train
rb
b2336b6da4850cf6bb2b033aaf0c7461a97b00b4
diff --git a/python/mxnet/libinfo.py b/python/mxnet/libinfo.py index <HASH>..<HASH> 100644 --- a/python/mxnet/libinfo.py +++ b/python/mxnet/libinfo.py @@ -59,7 +59,7 @@ def find_lib_path(prefix='libmxnet'): elif os.name == "posix" and os.environ.get('LD_LIBRARY_PATH', None): dll_path[0:0] = [p.strip() for p in os.environ['LD_LIBRARY_PATH'].split(":")] if os.name == 'nt': - os.environ['PATH'] = os.path.dirname(__file__) + ';' + os.environ['PATH'] + os.environ['PATH'] = os.path.dirname(__file__) + ';' + os.environ.get('PATH', '') dll_path = [os.path.join(p, prefix + '.dll') for p in dll_path] elif platform.system() == 'Darwin': dll_path = [os.path.join(p, prefix + '.dylib') for p in dll_path] + \
Fix Win Environ "PATH" does not exists Bug (#<I>) When "PATH" are not in the environment, we will get error when reading os.environ['PATH']. Change to os.environ.get('PATH', '') to fix it.
apache_incubator-mxnet
train
py
9113191eff333b27475071053b5d119a3f0b881c
diff --git a/closure/goog/vec/ray.js b/closure/goog/vec/ray.js index <HASH>..<HASH> 100644 --- a/closure/goog/vec/ray.js +++ b/closure/goog/vec/ray.js @@ -36,17 +36,17 @@ goog.require('goog.vec.Vec3'); */ goog.vec.Ray = function(opt_origin, opt_dir) { /** - * @type {goog.vec.Vec3.Number} + * @type {goog.vec.Vec3.Float64} */ - this.origin = goog.vec.Vec3.createNumber(); + this.origin = goog.vec.Vec3.createFloat64(); if (opt_origin) { goog.vec.Vec3.setFromArray(this.origin, opt_origin); } /** - * @type {goog.vec.Vec3.Number} + * @type {goog.vec.Vec3.Float64} */ - this.dir = goog.vec.Vec3.createNumber(); + this.dir = goog.vec.Vec3.createFloat64(); if (opt_dir) { goog.vec.Vec3.setFromArray(this.dir, opt_dir); }
Have goog.vec.Ray use Float<I>Array instead of Array.<number>. This will make it easier to convert code that uses goog.vec.Ray to use the new monomorphic goog.vec types. ------------- Created by MOE: <URL>
google_closure-library
train
js
6212c5975ed81f55c7d207871bafae30483ab4e3
diff --git a/Serializer/Serializer.php b/Serializer/Serializer.php index <HASH>..<HASH> 100644 --- a/Serializer/Serializer.php +++ b/Serializer/Serializer.php @@ -73,7 +73,7 @@ class Serializer implements SerializerInterface */ public final function normalize($data, $format = null) { - if ($this->customObjectNormalizers) { + if (is_object($data) && $this->customObjectNormalizers) { foreach ($this->customObjectNormalizers as $normalizer) { if ($normalizer->supportsNormalization($data, $format)) { return $normalizer->normalize($data, $format); diff --git a/Tests/Serializer/SerializerTest.php b/Tests/Serializer/SerializerTest.php index <HASH>..<HASH> 100644 --- a/Tests/Serializer/SerializerTest.php +++ b/Tests/Serializer/SerializerTest.php @@ -51,9 +51,12 @@ class SerializerTest extends \PHPUnit_Framework_TestCase $list = new AuthorList(); $list->add(new Author('Bar')); - $normalized = $serializer->normalize($list); + $normalized = $serializer->normalize($list); $this->assertEquals(array(), $normalized); + + $normalized = $serializer->normalize(array('foo')); + $this->assertEquals(array('foo'), $normalized); } public function testDenormalize()
minor performance tweak to reduce performance lost by previous commit
alekitto_serializer
train
php,php
b6f0171998d5d21ce0a6742d52e0474a9f57fa43
diff --git a/packages/sproutcore-views/lib/views/container_view.js b/packages/sproutcore-views/lib/views/container_view.js index <HASH>..<HASH> 100644 --- a/packages/sproutcore-views/lib/views/container_view.js +++ b/packages/sproutcore-views/lib/views/container_view.js @@ -8,17 +8,20 @@ require('sproutcore-views/views/view'); var get = SC.get, set = SC.set, meta = SC.meta; +var childViewsProperty = SC.computed(function() { + return get(this, '_childViews'); +}).property('_childViews').cacheable(); + SC.ContainerView = SC.View.extend({ init: function() { var childViews = get(this, 'childViews'); - SC.defineProperty(this, 'childViews', SC.View.CHILD_VIEWS_CP); + SC.defineProperty(this, 'childViews', childViewsProperty); this._super(); var _childViews = get(this, '_childViews'); - childViews.forEach(function(viewName, idx) { var view;
ContainerView should always delegate to _childViews. A ContainerView may not have virtual views as children.
emberjs_ember.js
train
js
1fe93cc9d552890ced54e917849bb1e97c940dd5
diff --git a/spec/bson/driver_bson_spec.rb b/spec/bson/driver_bson_spec.rb index <HASH>..<HASH> 100644 --- a/spec/bson/driver_bson_spec.rb +++ b/spec/bson/driver_bson_spec.rb @@ -29,15 +29,15 @@ describe 'Driver common bson tests' do end it 'parses the string value to the same value as the decoded document', if: test.from_string? do - expect(BSON::Decimal128.from_string(test.string)).to eq(test.object) + expect(BSON::Decimal128.new(test.string)).to eq(test.object) end it 'parses the #to_s (match_string) value to the same value as the decoded document', if: test.match_string do - expect(BSON::Decimal128.from_string(test.match_string)).to eq(test.object) + expect(BSON::Decimal128.new(test.match_string)).to eq(test.object) end it 'creates the correct object from a non canonical string and then prints to the correct string', if: test.match_string do - expect(BSON::Decimal128.from_string(test.string).to_s).to eq(test.match_string) + expect(BSON::Decimal128.new(test.string).to_s).to eq(test.match_string) end it 'can be converted to a native type' do
Use #new on Decimal<I> when creating from a String
mongodb_bson-ruby
train
rb