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
1c36243f775200167df522998ad61db0c73545a5
diff --git a/src/CCapture.js b/src/CCapture.js index <HASH>..<HASH> 100755 --- a/src/CCapture.js +++ b/src/CCapture.js @@ -716,8 +716,12 @@ function CCapture( settings ) { return this._hookedTime + _settings.startTime; }; - Object.defineProperty( HTMLVideoElement.prototype, 'currentTime', { get: hookCurrentTime } ) - Object.defineProperty( HTMLAudioElement.prototype, 'currentTime', { get: hookCurrentTime } ) + try { + Object.defineProperty( HTMLVideoElement.prototype, 'currentTime', { get: hookCurrentTime } ) + Object.defineProperty( HTMLAudioElement.prototype, 'currentTime', { get: hookCurrentTime } ) + } catch (err) { + _log(err); + } }
Don't set currentTime if it's already defined.
spite_ccapture.js
train
js
9a15ccd5567a72b653390ce63e77b7f3446dd059
diff --git a/event.go b/event.go index <HASH>..<HASH> 100644 --- a/event.go +++ b/event.go @@ -29,7 +29,8 @@ type EventStreamReader struct { // NewEventStreamReader creates an instance of EventStreamReader. func NewEventStreamReader(eventStream io.Reader, maxBufferSize int) *EventStreamReader { scanner := bufio.NewScanner(eventStream) - scanner.Buffer(make([]byte, 4096), maxBufferSize) + initBufferSize := minPosInt(4096, maxBufferSize) + scanner.Buffer(make([]byte, initBufferSize), maxBufferSize) split := func(data []byte, atEOF bool) (int, []byte, error) { if atEOF && len(data) == 0 {
fix inital buffer size (#<I>) Correctly handle maxBufferSize for scanner buffer
r3labs_sse
train
go
9049dea9d500a1793ab7de795a26802600b99c6f
diff --git a/perfplot/__init__.py b/perfplot/__init__.py index <HASH>..<HASH> 100644 --- a/perfplot/__init__.py +++ b/perfplot/__init__.py @@ -16,29 +16,16 @@ if pipdated.needs_checking('perfplot'): print(msg) -def show( - setup, kernels, labels, n_range, - xlabel=None, - repeat=100, - logx=False, - logy=False, - automatic_order=True - ): +def show(*args, **kwargs): from matplotlib import pyplot as plt - _plot( - setup, kernels, labels, n_range, - xlabel=xlabel, - repeat=repeat, - logx=logx, - logy=logy, - automatic_order=automatic_order - ) + _plot(*args, **kwargs) plt.show() return def _plot( - setup, kernels, labels, n_range, + setup, kernels, n_range, + labels=None, xlabel=None, repeat=100, logx=False, @@ -92,6 +79,9 @@ def _plot( x = n_range T = numpy.min(timings, axis=2) + if labels is None: + labels = [k.func_name for k in kernels] + if automatic_order: # Sort T by the last entry. This makes the order in the legend # correspond to the order of the lines.
allow for empty labels; trivial show() signature
nschloe_perfplot
train
py
6a732fa70350aab1a372f1cc84e8dc28d7bebacb
diff --git a/xray/test/test_conventions.py b/xray/test/test_conventions.py index <HASH>..<HASH> 100644 --- a/xray/test/test_conventions.py +++ b/xray/test/test_conventions.py @@ -472,6 +472,15 @@ class TestDecodeCF(TestCase): actual = conventions.maybe_encode_dtype(original) self.assertDatasetIdentical(expected, actual) + def test_decode_cf_with_multiple_missing_values(self): + original = Variable(['t'], [0, 1, 2], + {'missing_value': np.array([0, 1])}) + expected = Variable(['t'], [np.nan, np.nan, 2], {}) + with warnings.catch_warnings(record=True) as w: + actual = conventions.decode_cf_variable(original) + self.assertDatasetIdentical(expected, actual) + self.assertIn('variable has multiple fill', str(w[0].message)) + class CFEncodedInMemoryStore(InMemoryDataStore): def store(self, variables, attributes):
Add unit test to check that multiple mising values issues warning
pydata_xarray
train
py
12f972c5e202c34a07778e84d848d6c19eb3566e
diff --git a/bsdploy/fabfile_mfsbsd.py b/bsdploy/fabfile_mfsbsd.py index <HASH>..<HASH> 100644 --- a/bsdploy/fabfile_mfsbsd.py +++ b/bsdploy/fabfile_mfsbsd.py @@ -133,6 +133,8 @@ def _bootstrap(): run('''touch /mnt/firstboot''') run('''sysrc -f /mnt/etc/rc.conf firstboot_freebsd_update_enable=YES''') + # update from config + bootstrap_packages += env.instance.config.get('bootstrap-packages', '').split() # we need to install python here, because there is no way to install it via # ansible playbooks bu.install_pkg('/mnt', chroot=True, packages=bootstrap_packages)
FIX: honour ``bootstrap-packages`` settings for mfsbsd
ployground_bsdploy
train
py
13e8e1a2ff85c158a5a94bd33accafdb45cdeb40
diff --git a/lib/manager/travis/package.js b/lib/manager/travis/package.js index <HASH>..<HASH> 100644 --- a/lib/manager/travis/package.js +++ b/lib/manager/travis/package.js @@ -41,7 +41,9 @@ async function getPackageUpdates(config) { config.rangeStrategy === 'pin' || isPinnedVersion(config.currentVersion[0]) ) { - const releases = Object.keys((await getDependency('nodejs/node')).versions); + const releases = Object.keys( + (await getDependency('nodejs/node', { clean: 'true' })).versions + ); newVersion = newVersion.map(version => maxSatisfyingVersion(releases, version) );
fix: travis get clean versions
renovatebot_renovate
train
js
51ee32c081f8b833459c0befc373f4a1a18eac96
diff --git a/keanu-python/keanu/base.py b/keanu-python/keanu/base.py index <HASH>..<HASH> 100644 --- a/keanu-python/keanu/base.py +++ b/keanu-python/keanu/base.py @@ -27,8 +27,6 @@ class JavaObjectWrapper: (python_name, self._class)) java_name = _to_camel_case_name(k) - logging.getLogger("keanu").warning( - "\"{}\" is not implemented so Java API \"{}\" was called directly instead".format(k, java_name)) return self.unwrap().__getattr__(java_name) def unwrap(self) -> JavaObject:
Removed the warning you get if you call a method in camel_case that hasn't been wrapped in the JavaObjectWrapper. This is a valid thing to do if the arguments and return types are primitives.
improbable-research_keanu
train
py
a795dd73aecaba69ada08c83c23cb67351141d19
diff --git a/lib/dragonfly/data_storage/s3data_store.rb b/lib/dragonfly/data_storage/s3data_store.rb index <HASH>..<HASH> 100644 --- a/lib/dragonfly/data_storage/s3data_store.rb +++ b/lib/dragonfly/data_storage/s3data_store.rb @@ -17,10 +17,14 @@ module Dragonfly configurable_attr :url_scheme, 'http' REGIONS = { - 'us-east-1' => 's3.amazonaws.com', #default - 'eu-west-1' => 's3-eu-west-1.amazonaws.com', + 'us-east-1' => 's3.amazonaws.com', #default + 'us-west-1' => 's3-us-west-1.amazonaws.com', + 'us-west-2' => 's3-us-west-2.amazonaws.com', + 'ap-northeast-1' => 's3-ap-northeast-1.amazonaws.com', 'ap-southeast-1' => 's3-ap-southeast-1.amazonaws.com', - 'us-west-1' => 's3-us-west-1.amazonaws.com' + 'eu-west-1' => 's3-eu-west-1.amazonaws.com', + 'sa-east-1' => 's3-sa-east-1.amazonaws.com', + 'sa-east-1' => 's3-sa-east-1.amazonaws.com' } def initialize(opts={})
Added some more S3 regions (taken from fog's code)
markevans_dragonfly
train
rb
acdb027c8adea2d9ee0d63af80b80906f93785a9
diff --git a/ndbench-cass-plugins/src/main/java/com/netflix/ndbench/plugin/cass/ElassandraCassJavaDriverPlugin.java b/ndbench-cass-plugins/src/main/java/com/netflix/ndbench/plugin/cass/ElassandraCassJavaDriverPlugin.java index <HASH>..<HASH> 100644 --- a/ndbench-cass-plugins/src/main/java/com/netflix/ndbench/plugin/cass/ElassandraCassJavaDriverPlugin.java +++ b/ndbench-cass-plugins/src/main/java/com/netflix/ndbench/plugin/cass/ElassandraCassJavaDriverPlugin.java @@ -56,7 +56,7 @@ public class ElassandraCassJavaDriverPlugin implements NdBenchClient{ upsertCF(this.session); writePstmt = session.prepare("INSERT INTO "+ TableName +" (\"_id\", name) VALUES (?, ?)"); - readPstmt = session.prepare("SELECT * From "+ TableName +" Where _id = ?"); + readPstmt = session.prepare("SELECT * From "+ TableName +" Where \"_id\" = ?"); Logger.info("Initialized ElassandraCassJavaDriverPlugin"); }
fix elasandra id issue
Netflix_ndbench
train
java
1acc380d035728a73df6ca99fc97bc7251ae8b22
diff --git a/src/Testing/Response.php b/src/Testing/Response.php index <HASH>..<HASH> 100644 --- a/src/Testing/Response.php +++ b/src/Testing/Response.php @@ -260,9 +260,10 @@ class Response * __call * * @param string $method + * @param array $params * @return mixed */ - public function __call(string $method) + public function __call(string $method, array $params = []) { if (method_exists($this->parser, $method)) { return call_user_func([$this->parser, $method]);
fix: __call() must take exactly 2 arguments
bowphp_framework
train
php
67ba6bf826a39ce99a4c46c12030719d534cb12a
diff --git a/lib/manifest.js b/lib/manifest.js index <HASH>..<HASH> 100644 --- a/lib/manifest.js +++ b/lib/manifest.js @@ -1,5 +1,6 @@ "use strict"; +let path = require("path"); let createFile = require("./util/files"); let { repr } = require("./util"); @@ -8,7 +9,15 @@ let retryTimings = [10, 50, 100, 250, 500, 1000]; module.exports = class Manifest { constructor(filepath, { key, value }) { this.filepath = filepath; - this.keyTransform = key || (filepath => filepath); + + if(key === "short") { + this.keyTransform = (f, targetDir) => path.relative(targetDir, f); + } else if(key) { + this.keyTransform = key; + } else { + this.keyTransform = filepath => filepath; + } + this.valueTransform = value || (filepath => "/" + filepath); this._index = {};
Shortcut: Provide "short" as the key to get the short version of the key
faucet-pipeline_faucet-pipeline-core
train
js
f83237ce6e4fbe5b6153d773dc2ae46253897346
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -65,7 +65,9 @@ export default function serve(options = { contentBase: '' }) { createServer(requestListener).listen(options.port); } - let running = options.verbose === false + closeServerOnTermination(server); + + var running = options.verbose === false return { name: 'serve', @@ -120,3 +122,13 @@ function found(response, filePath, content) { function green(text) { return `\u001b[1m\u001b[32m${text}\u001b[39m\u001b[22m` } + +function closeServerOnTermination(server) { + const terminationSignals = ['SIGINT', 'SIGTERM']; + terminationSignals.forEach((signal) => { + process.on(signal, () => { + server.close(); + process.exit(); + }) + }) +}
Close the server when a termination signal is encountered
thgh_rollup-plugin-serve
train
js
e40205d22da931739a9822f5fa2930c372d2f6fe
diff --git a/src/bootstrap.php b/src/bootstrap.php index <HASH>..<HASH> 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -1,6 +1,23 @@ <?php -require_once __DIR__ . '/../vendor/autoload.php'; +$files = array( + __DIR__ . '/../vendor/autoload.php', + __DIR__ . '/../../../autoload.php' +); + +$loader = false; + +foreach ($files as $file) { + if (file_exists($file)) { + $loader = require_once $file; + break; + } +} + +if (!$loader instanceof \Composer\Autoload\ClassLoader) { + echo 'You must first install the vendors using composer.' . PHP_EOL; + exit(1); +} use Camspiers\StatisticalClassifier\Config\Config; use Camspiers\StatisticalClassifier\Console\Command\GenerateContainerCommand;
UPDATE: Support installation as a vendor
camspiers_statistical-classifier
train
php
e6262fcd0dbbe22138c2a9bbbc3ed8d4ba3f8034
diff --git a/blocks/admin_bookmarks/block_admin_bookmarks.php b/blocks/admin_bookmarks/block_admin_bookmarks.php index <HASH>..<HASH> 100644 --- a/blocks/admin_bookmarks/block_admin_bookmarks.php +++ b/blocks/admin_bookmarks/block_admin_bookmarks.php @@ -31,9 +31,6 @@ class block_admin_bookmarks extends block_base { global $CFG, $USER, $PAGE; - require_once($CFG->libdir.'/adminlib.php'); - $adminroot = admin_get_root(); - if ($this->content !== NULL) { return $this->content; } @@ -41,6 +38,10 @@ class block_admin_bookmarks extends block_base { $this->content = new stdClass; $this->content->text = ''; if (get_user_preferences('admin_bookmarks')) { + // this is expensive! Only require when bookmakrs exist.. + require_once($CFG->libdir.'/adminlib.php'); + $adminroot = admin_get_root(); + $bookmarks = explode(',',get_user_preferences('admin_bookmarks')); // hmm... just a liiitle (potentially) processor-intensive // (recall that $adminroot->locate is a huge recursive call... and we're calling it repeatedly here
MDL-<I> - save <I> database queries in the case of the admin bookmarks block without bookmarks on non-admin page Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
5dc94d5e990ece178ac51b6729595bc7e49d8fc1
diff --git a/lib/lemonad.js b/lib/lemonad.js index <HASH>..<HASH> 100644 --- a/lib/lemonad.js +++ b/lib/lemonad.js @@ -898,7 +898,7 @@ }; // Flips the first two args of a function - L.flip2 = function(fun) { + L.flip = L.flip2 = function(fun) { return function(/* args */) { var args = _.toArray(arguments); var tmp = args[0];
L.flip as alias for flip2
fogus_lemonad
train
js
697b186f98aa9796e6da62803c87e239090b4aae
diff --git a/support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/DelegatedClientFactory.java b/support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/DelegatedClientFactory.java index <HASH>..<HASH> 100644 --- a/support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/DelegatedClientFactory.java +++ b/support/cas-server-support-pac4j-core-clients/src/main/java/org/apereo/cas/support/pac4j/authentication/DelegatedClientFactory.java @@ -397,6 +397,7 @@ public class DelegatedClientFactory { cfg.setForceAuth(saml.isForceAuth()); cfg.setPassive(saml.isPassive()); cfg.setSignMetadata(saml.isSignServiceProviderMetadata()); + cfg.setAcceptedSkew(saml.getAcceptedSkew()); if (StringUtils.isNotBlank(saml.getPrincipalIdAttribute())) { cfg.setAttributeAsId(saml.getPrincipalIdAttribute());
Pac4j delegation: Add missing setAcceptedSkew (#<I>)
apereo_cas
train
java
89da402710b95e1d657f0e8bf75aee865be9eb19
diff --git a/core/server/update-check.js b/core/server/update-check.js index <HASH>..<HASH> 100644 --- a/core/server/update-check.js +++ b/core/server/update-check.js @@ -69,7 +69,7 @@ function updateCheckData() { data.node_version = process.versions.node; data.env = process.env.NODE_ENV; data.database_type = require('./models/base').client; - data.email_transport = mailConfig.options && mailConfig.options.service ? mailConfig.options.service : mailConfig.transport; + data.email_transport = mailConfig && mailConfig.options && mailConfig.options.service ? mailConfig.options.service : mailConfig.transport; return when.settle(ops).then(function (descriptors) { var hash = descriptors[0].value,
Fix command line error closes #<I> - added check for mailConfig
TryGhost_Ghost
train
js
4fcaced381e3102a4862461c86c1bff635aa5fe2
diff --git a/aaf2/cfb.py b/aaf2/cfb.py index <HASH>..<HASH> 100644 --- a/aaf2/cfb.py +++ b/aaf2/cfb.py @@ -14,6 +14,7 @@ import math import weakref from array import array from struct import Struct +import mmap from .utils import ( read_u8, read_u16le, @@ -567,9 +568,15 @@ class DirEntry(object): return self.name class CompoundFileBinary(object): - def __init__(self, file_object, mode='rb', sector_size=4096): + def __init__(self, file_object, mode='rb', sector_size=4096, use_mmap=True): self.f = file_object + self.file_object = self.f + self.mm = None + + if use_mmap and mode == 'rb' and hasattr(file_object, 'fileno'): + self.mm = mmap.mmap(file_object.fileno(), 0, prot=mmap.PROT_READ) + self.f = self.mm self.difat = [[]] self.fat = array(str('I')) @@ -639,7 +646,8 @@ class CompoundFileBinary(object): self.write_minifat() self.write_dir_entries() self.is_open = False - + if self.mm: + self.mm.close() def setup_empty(self, sector_size):
use mmap in cfb when read only for slight performance increase
markreidvfx_pyaaf2
train
py
892bdddc225fdece1ada45afecdd237ffe30b511
diff --git a/openpnm/algorithms/GenericTransport.py b/openpnm/algorithms/GenericTransport.py index <HASH>..<HASH> 100644 --- a/openpnm/algorithms/GenericTransport.py +++ b/openpnm/algorithms/GenericTransport.py @@ -525,7 +525,7 @@ class GenericTransport(GenericAlgorithm): B = np.ones((self.A.shape[0], 1)) mc = min(10, int(A.shape[0]//4)) ml = pyamg.smoothed_aggregation_solver(A, B, max_coarse=mc) - x = ml.solve(b=b, tol=tol) + x = ml.solve(b=b, tol=atol) return x def results(self):
Fixed a typo in pyamg args.
PMEAL_OpenPNM
train
py
4070af7648b011e32c8a183b4cce73032c024514
diff --git a/src/test/java/integration/SelenideMethodsTest.java b/src/test/java/integration/SelenideMethodsTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/integration/SelenideMethodsTest.java +++ b/src/test/java/integration/SelenideMethodsTest.java @@ -247,8 +247,14 @@ public class SelenideMethodsTest extends IntegrationTest { $("h1").shouldHave(exactText("Page with selects")); $("h2").shouldHave(exactText("Dropdown list")); $(By.name("domain")).find("option").shouldHave(text("@livemail.ru")); - $("#radioButtons").shouldHave(text("Radio buttons\n" + - "Мастер Маргарита Кот \"Бегемот\" Theodor Woland")); + if (isHtmlUnit()) { + $("#radioButtons").shouldHave(text("Radio buttons\n" + + "uncheckedМастер uncheckedМаргарита uncheckedКот \"Бегемот\" uncheckedTheodor Woland")); + } + else { + $("#radioButtons").shouldHave(text("Radio buttons\n" + + "Мастер Маргарита Кот \"Бегемот\" Theodor Woland")); + } } @Test
fix failing test in hmtlunit
selenide_selenide
train
java
27cb5dfd0ed96e1d6d2e8d0d5c2b3bd83263b034
diff --git a/pypiper/manager.py b/pypiper/manager.py index <HASH>..<HASH> 100644 --- a/pypiper/manager.py +++ b/pypiper/manager.py @@ -1823,6 +1823,13 @@ class PipelineManager(object): for mnt in mounts: absmnt = os.path.abspath(mnt) cmd += " -v " + absmnt + ":" + absmnt + cmd += " -v {cwd}:{cwd} --workdir={cwd}".format(cwd=os.getcwd()) + cmd += " --user={uid}".format(uid=os.getuid()) + cmd += " --volume=/etc/group:/etc/group:ro" + cmd += " --volume=/etc/passwd:/etc/passwd:ro" + cmd += " --volume=/etc/shadow:/etc/shadow:ro" + cmd += " --volume=/etc/sudoers.d:/etc/sudoers.d:ro" + cmd += " --volume=/tmp/.X11-unix:/tmp/.X11-unix:rw" cmd += " " + image container = self.checkprint(cmd).rstrip() self.container = container
add @nsheff changes from dockerfix and avoid merge conflict
databio_pypiper
train
py
dc5651c3e55176145faf662f372d21fd44296d84
diff --git a/lib/rubocop/cop/mixin/multiline_expression_indentation.rb b/lib/rubocop/cop/mixin/multiline_expression_indentation.rb index <HASH>..<HASH> 100644 --- a/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +++ b/lib/rubocop/cop/mixin/multiline_expression_indentation.rb @@ -120,7 +120,7 @@ module RuboCop def keyword_message_tail(node) keyword = node.loc.keyword.source kind = keyword == 'for' ? 'collection' : 'condition' - article = keyword =~ /^[iu]/ ? 'an' : 'a' + article = keyword.start_with?('i', 'u') ? 'an' : 'a' format(KEYWORD_MESSAGE_TAIL, kind: kind, article: article,
Replace regular expression usage in MultilineExpressionIndentation mixin
rubocop-hq_rubocop
train
rb
9903205889a0d27077e224281554b5ebc8cc0820
diff --git a/commands/KeyCommands.js b/commands/KeyCommands.js index <HASH>..<HASH> 100644 --- a/commands/KeyCommands.js +++ b/commands/KeyCommands.js @@ -210,7 +210,7 @@ KeyCommands.prototype = extend(BaseCommand.prototype, { return this._makeNewKey(filename); }, - keyAlgorithmForProtocol(protocol) { + keyAlgorithmForProtocol: function (protocol) { return protocol === 'udp' ? 'ec' : 'rsa'; }, diff --git a/test/oldcmd/KeyCommand.spec.js b/test/oldcmd/KeyCommand.spec.js index <HASH>..<HASH> 100644 --- a/test/oldcmd/KeyCommand.spec.js +++ b/test/oldcmd/KeyCommand.spec.js @@ -258,5 +258,14 @@ describe('Key Command', function() { }); }); + describe('keyAlgorithmForProtocol', function() { + it('returns rsa for TCP protocol', function() { + expect(key.keyAlgorithmForProtocol('tcp')).eql('rsa'); + }); + + it('returns ec for UDP protocol', function() { + expect(key.keyAlgorithmForProtocol('udp')).eql('ec'); + }); + }); });
fixes ES6 style function in ES5 source. with tests
particle-iot_particle-cli
train
js,js
13212da0deb7afc0d7109c8f0a54ca30bba233ff
diff --git a/lib/rfunk/version.rb b/lib/rfunk/version.rb index <HASH>..<HASH> 100644 --- a/lib/rfunk/version.rb +++ b/lib/rfunk/version.rb @@ -1,3 +1,3 @@ module RFunk - VERSION = '0.2.0' + VERSION = '0.3.0' end
Bumped to version <I>
alexfalkowski_rfunk
train
rb
3b26036d67c54d54e183fac7a943b112d972873b
diff --git a/lib/types/keywords.js b/lib/types/keywords.js index <HASH>..<HASH> 100644 --- a/lib/types/keywords.js +++ b/lib/types/keywords.js @@ -95,8 +95,7 @@ keywords.coerceTo = { const inlineTermValidator = (it, keyword, schema) => { return ` - let $data = data${it.dataLevel || ''}; - if (typeof $data === 'function' && $data.hasOwnProperty('_query')) { + if (typeof data${it.dataLevel || ''} === 'function' && data${it.dataLevel || ''}.hasOwnProperty('_query')) { vErrors = []; errors = 0; return true;
fix(acceptsTerm): prevent issue with duplicate defined local values
mbroadst_thinkagain
train
js
e6de46b1222b68969fe01afdc487fe8daf189f8a
diff --git a/ulid_test.go b/ulid_test.go index <HASH>..<HASH> 100644 --- a/ulid_test.go +++ b/ulid_test.go @@ -30,7 +30,7 @@ import ( func ExampleULID() { t := time.Unix(1000000, 0) - entropy := rand.New(rand.NewSource(t.UnixNano())) + entropy := rand.New(ulid.Monotonic(rand.NewSource(t.UnixNano())), 0) fmt.Println(ulid.MustNew(ulid.Timestamp(t), entropy)) // Output: 0000XSNJG0MQJHBF4QX1EFD6Y3 }
Update ExampleULID with Monotonic entropy
oklog_ulid
train
go
f26fab44d0f1287dcd9c28fc4a9b72704cf664d9
diff --git a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/Kernel.php +++ b/src/Sylius/Bundle/CoreBundle/Application/Kernel.php @@ -31,7 +31,7 @@ use Webmozart\Assert\Assert; class Kernel extends HttpKernel { - public const VERSION = '1.8.0-DEV'; + public const VERSION = '1.8.0'; public const VERSION_ID = '10800'; @@ -41,7 +41,7 @@ class Kernel extends HttpKernel public const RELEASE_VERSION = '0'; - public const EXTRA_VERSION = 'DEV'; + public const EXTRA_VERSION = ''; public function __construct(string $environment, bool $debug) {
Change application's version to <I>
Sylius_Sylius
train
php
7c9b391159f81e98dd34bcd827d7dd34928cd89b
diff --git a/tdigest.go b/tdigest.go index <HASH>..<HASH> 100644 --- a/tdigest.go +++ b/tdigest.go @@ -174,10 +174,6 @@ func shuffle(data []centroid) { } } -func (t TDigest) String() string { - return fmt.Sprintf("TD<compression=%.2f, count=%d, centroids=%d>", t.compression, t.count, t.summary.Len()) -} - func estimateCapacity(compression float64) uint { return uint(compression) * 10 } diff --git a/tdigest_test.go b/tdigest_test.go index <HASH>..<HASH> 100644 --- a/tdigest_test.go +++ b/tdigest_test.go @@ -234,7 +234,7 @@ func TestSerialization(t *testing.T) { t2, _ := FromBytes(bytes.NewReader(serialized)) if t1.count != t2.count || t1.summary.Len() != t2.summary.Len() || t1.compression != t2.compression { - t.Errorf("Deserialized to something different. t1=%s t2=%s serialized=%v", t1, t2, serialized) + t.Errorf("Deserialized to something different. t1=%v t2=%v serialized=%v", t1, t2, serialized) } }
Remove yet another useless String() method This time I didn't forget to run `go vet`...
caio_go-tdigest
train
go,go
4fee79b348a9d19b8cf09bf748762265866c6ce8
diff --git a/cqlengine/tests/query/test_queryset.py b/cqlengine/tests/query/test_queryset.py index <HASH>..<HASH> 100644 --- a/cqlengine/tests/query/test_queryset.py +++ b/cqlengine/tests/query/test_queryset.py @@ -408,13 +408,15 @@ class TestQuerySetConnectionHandling(BaseQuerySetUsage): def test_conn_is_returned_after_queryset_is_garbage_collected(self): """ Tests that the connection is returned to the connection pool after the queryset is gc'd """ from cqlengine.connection import ConnectionPool - assert ConnectionPool._queue.qsize() == 1 + # The queue size can be 1 if we just run this file's tests + # It will be 2 when we run 'em all + initial_size = ConnectionPool._queue.qsize() q = TestModel.objects(test_id=0) v = q[0] - assert ConnectionPool._queue.qsize() == 0 + assert ConnectionPool._queue.qsize() == initial_size - 1 del q - assert ConnectionPool._queue.qsize() == 1 + assert ConnectionPool._queue.qsize() == initial_size class TimeUUIDQueryModel(Model): partition = columns.UUID(primary_key=True)
Make all tests pass when run alltogether with 'py.test cqlengine/tests'
cqlengine_cqlengine
train
py
1b5a2b6e9bc3844b0b3e643a424ab08944c7677a
diff --git a/integration/fs_mounter/fs_mounter_test.go b/integration/fs_mounter/fs_mounter_test.go index <HASH>..<HASH> 100644 --- a/integration/fs_mounter/fs_mounter_test.go +++ b/integration/fs_mounter/fs_mounter_test.go @@ -21,7 +21,7 @@ func mountAtPath(path string) string { fsMounterPath, "--disk-image", diskImage, "--mount-path", mountPath, - "--size-in-megabytes", "100", + "--size-in-megabytes", "1024", ) session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter)
bump up another size to make mkfs.btrfs happy
concourse_baggageclaim
train
go
57c3a4a703baaa05e181ff4c85cee14ede4c9f76
diff --git a/imgix/urlbuilder.py b/imgix/urlbuilder.py index <HASH>..<HASH> 100644 --- a/imgix/urlbuilder.py +++ b/imgix/urlbuilder.py @@ -208,8 +208,6 @@ class UrlBuilder(object): srcset_params['dpr'] = dpr # If variable quality output is _not disabled_, then... if not disable_variable_quality: - # Other implementations will use the 'q' or quality value, - # so will this one, but let's validate the input (if any). quality = params.get('q', DPR_QUALITIES[dpr]) # Mutate the copy of params; associate the quality value
refactor: remove dead comment This PR removes a dead comment. Prior to this PR, the comment indicated that there was validation, but validation was suggested to be, and was, removed from this function. This change updates the comment to describe the current behavior.
imgix_imgix-python
train
py
f7d54ef4a1d95ba2234eaad5d827c5faadba41f5
diff --git a/lib/url-parser.js b/lib/url-parser.js index <HASH>..<HASH> 100644 --- a/lib/url-parser.js +++ b/lib/url-parser.js @@ -52,9 +52,12 @@ function httpToFloraRequest(httpRequest) { */ let payload = ''; + let contentTypes; - const contentTypes = contentType.parse(httpRequest.headers['content-type']); - httpRequest.setEncoding(contentTypes.parameters.charset || 'utf-8'); + if (httpRequest.headers['content-type']) { + contentTypes = contentType.parse(httpRequest.headers['content-type']); + httpRequest.setEncoding(contentTypes.parameters.charset || 'utf-8'); + } httpRequest.on('data', (chunk) => { payload += chunk; @@ -62,6 +65,10 @@ function httpToFloraRequest(httpRequest) { httpRequest.on('end', () => { if (httpRequest.method === 'POST' && payload.length) { + if (!contentTypes) { + reject(new RequestError('Content-Type missing')); + return; + } if (contentTypes.type === 'application/x-www-form-urlencoded') { payload = querystring.parse(payload); Object.keys(payload).forEach((key) => {
hotfix: accept no Content-Type for non-POST requests
godmodelabs_flora
train
js
09614030c3832877627bc9e3d659c02db7fbc6ab
diff --git a/salt/state.py b/salt/state.py index <HASH>..<HASH> 100644 --- a/salt/state.py +++ b/salt/state.py @@ -1867,7 +1867,7 @@ class State(object): for lkey, lval in listen_to.items(): to_tag = _gen_tag(crefs[(lkey, lval)]) if running[to_tag]['changes']: - chunk = crefs[(key, val)] + chunk = crefs[key] low = chunk.copy() low['sfun'] = chunk['fun'] low['fun'] = 'mod_watch'
Bah! overcomplicated it inline :)
saltstack_salt
train
py
ffbaa2998cafaec7205099962c597b979a08897c
diff --git a/lib/data_mapper/relation/graph/node/aliases/binary.rb b/lib/data_mapper/relation/graph/node/aliases/binary.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/relation/graph/node/aliases/binary.rb +++ b/lib/data_mapper/relation/graph/node/aliases/binary.rb @@ -244,7 +244,8 @@ module DataMapper private def old_field(left_entries, left_key) - left_entries.fetch(left_key) + # FIXME: we can't use fetch here because it fails on RBX 1.9 + left_entries[left_key] || raise(ArgumentError, "+left_key+ cannot be found") end def initial_aliases diff --git a/lib/data_mapper/relation/graph/node/aliases/unary.rb b/lib/data_mapper/relation/graph/node/aliases/unary.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/relation/graph/node/aliases/unary.rb +++ b/lib/data_mapper/relation/graph/node/aliases/unary.rb @@ -43,7 +43,8 @@ module DataMapper private def old_field(left_entries, left_key) - @inverted.fetch(left_key) + # FIXME: we can't use fetch here because it fails on RBX 1.9 + @inverted[left_key] || raise(ArgumentError, "+left_key+ cannot be found") end def initial_aliases
Workaround Hash#fetch issue on rbx-<I>
rom-rb_rom
train
rb,rb
8bdcf7408bd3b1db1bdc2981f7fdd5e5c291d4be
diff --git a/bindings/py/setup.py b/bindings/py/setup.py index <HASH>..<HASH> 100644 --- a/bindings/py/setup.py +++ b/bindings/py/setup.py @@ -364,7 +364,6 @@ def getExtensionModules(nupicCoreReleaseDir, platform, bitness, cxxCompiler, cmd # for Cap'n'Proto serialization "-lkj", "-lcapnp", - "-lcapnpc", # optimization (safe defaults) "-O2"] @@ -378,7 +377,6 @@ def getExtensionModules(nupicCoreReleaseDir, platform, bitness, cxxCompiler, cmd # for Cap'n'Proto serialization "-lkj", "-lcapnp", - "-lcapnpc", # optimization (safe defaults) "-O2" ] @@ -404,8 +402,7 @@ def getExtensionModules(nupicCoreReleaseDir, platform, bitness, cxxCompiler, cmd pythonLib, "dl", "kj", - "capnp", - "capnpc"] + "capnp"] if platform == "linux": commonLibraries.extend(["pthread"]) elif platform in WINDOWS_PLATFORMS:
Remove capnpc link flags from nupic.bindings. These should only be needed in cmake build for generating the C++ code from .capnp files and shouldn't be needed for the nupic.bindings extensions build.
numenta_nupic.core
train
py
01d92531ee0993c0e6e5efe877a1242bfd808626
diff --git a/rpc/http.go b/rpc/http.go index <HASH>..<HASH> 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -251,7 +251,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } // All checks passed, create a codec that reads direct from the request body - // untilEOF and writes the response to w and order the server to process a + // until EOF, write the response to w, and order the server to process a // single request. ctx := r.Context() ctx = context.WithValue(ctx, "remote", r.RemoteAddr) @@ -338,7 +338,7 @@ func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - // Not an ip address, but a hostname. Need to validate + // Not an IP address, but a hostname. Need to validate if _, exist := h.vhosts["*"]; exist { h.next.ServeHTTP(w, r) return
rpc: correct typo and reword comment for consistency (#<I>)
ethereum_go-ethereum
train
go
6905e064ed52556c31c5ffa4dd61bacf0722e1d9
diff --git a/tasks/components/scraper.js b/tasks/components/scraper.js index <HASH>..<HASH> 100644 --- a/tasks/components/scraper.js +++ b/tasks/components/scraper.js @@ -175,12 +175,12 @@ component.description = marked( isFile - ? fs.readFileSync(basepath + description, Scraper.OPTIONS.readFileSync) + ? fs.readFileSync(basepath + description, Scraper.OPTIONS.readFileSync).replace(/^\uFEFF/, '') : description ); return component; - } + }; /** * Add the provided component to the @@ -254,4 +254,4 @@ module.exports = Scraper; -} ()); \ No newline at end of file +} ());
Remove byte order character before parsing description as md.
martinjunior_grunt-emo
train
js
c768f94e620a7dee230ef9dcdc2ff6553036bd22
diff --git a/ethereum/hybrid_casper/chain.py b/ethereum/hybrid_casper/chain.py index <HASH>..<HASH> 100644 --- a/ethereum/hybrid_casper/chain.py +++ b/ethereum/hybrid_casper/chain.py @@ -377,7 +377,6 @@ class Chain(object): self.time_queue.insert(i, block) log.info('Block received too early (%d vs %d). Delaying for %d seconds' % (now, block.header.timestamp, block.header.timestamp - now)) - # TODO: Add logic which only adds blocks if we can trace it back to the full chain return False # Check what the current checkpoint head should be @@ -424,7 +423,7 @@ class Chain(object): while(fork_cp_block.header.number > head_cp_block.header.number): fork_cp_block = self.get_prev_checkpoint_block(fork_cp_block) # Replace the head only if the fork block is a child of the head checkpoint - if (head_cp_block.hash == fork_cp_block.hash and block_score > self.get_score(self.head)) or block.hash == self.checkpoint_head_hash: + if (head_cp_block.hash == fork_cp_block.hash and block_score > self.get_score(self.head)): log.info('Replacing head') b = block new_chain = {}
Remove weird add_block fork condition & comment
ethereum_pyethereum
train
py
4b5e969b967738380bd2468f7e04e33ca1d52f80
diff --git a/nunaliit2-js/src/main/webapp/nunaliit2/n2.couchAuth.js b/nunaliit2-js/src/main/webapp/nunaliit2/n2.couchAuth.js index <HASH>..<HASH> 100644 --- a/nunaliit2-js/src/main/webapp/nunaliit2/n2.couchAuth.js +++ b/nunaliit2-js/src/main/webapp/nunaliit2/n2.couchAuth.js @@ -66,8 +66,6 @@ var defaultOptions = { ,anonymousUser: 'anonymous' ,anonymousPw: 'anonymous' ,autoAnonymousLogin: false - ,prompt: _loc('Please login') - ,userString: _loc('user name') ,directory: null }; @@ -86,6 +84,7 @@ var AuthService = $n2.Class({ ,defaultOptions ,{ autoRefresh: true + ,prompt: _loc('Please login') ,refreshIntervalInSec: 120 // 2 minutes } ,options_
nunaliit2-js: Fix authentication dialog box title that does not localize properly.
GCRC_nunaliit
train
js
0e636281053f0c2945c82dcddd978b0e9eb1658e
diff --git a/angr/simos.py b/angr/simos.py index <HASH>..<HASH> 100644 --- a/angr/simos.py +++ b/angr/simos.py @@ -143,8 +143,7 @@ def setup_elf_ifuncs(proj): for reloc in binary.relocs: if reloc.symbol is None or reloc.resolvedby is None: continue - # http://osxr.org/glibc/source/elf/elf.h#0466 - if reloc.resolvedby.type != 'STT_LOOS': # thanks, pyreadelf + if reloc.resolvedby.type != 'STT_GNU_IFUNC': continue gotaddr = reloc.addr + binary.rebase_addr gotvalue = proj.ld.memory.read_addr_at(gotaddr)
CLE now exports the right symbol name for ifuncs
angr_angr
train
py
4e060ab972673300a4082fd359e8626721afdfda
diff --git a/backup/backuplib.php b/backup/backuplib.php index <HASH>..<HASH> 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -1718,6 +1718,7 @@ foreach ($mypreferences->mods as $name => $info) { //Check if the xxxx_encode_content_links exists + include_once("$CFG->dirroot/mod/$name/backuplib.php"); $function_name = $name."_encode_content_links"; if (function_exists($function_name)) { $result = $function_name($result,$mypreferences); diff --git a/backup/restorelib.php b/backup/restorelib.php index <HASH>..<HASH> 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -63,6 +63,8 @@ //from backup format to destination site/course in order to mantain inter-activities //working in the backup/restore process function restore_decode_content_links($restore) { + global $CFG; + $status = true; if (!defined('RESTORE_SILENTLY')) { @@ -72,6 +74,7 @@ //If the module is being restored if ($info->restore == 1) { //Check if the xxxx_decode_content_links_caller exists + include_once("$CFG->dirroot/mod/$name/restorelib.php"); $function_name = $name."_decode_content_links_caller"; if (function_exists($function_name)) { if (!defined('RESTORE_SILENTLY')) {
Bug #<I> - The restore process behaves differently depending on which module contains the absolute links; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php,php
18f499e969c1ccf7f49cfa5be2a0ff8c5a40b0e5
diff --git a/tests/files/phpcode.php b/tests/files/phpcode.php index <HASH>..<HASH> 100644 --- a/tests/files/phpcode.php +++ b/tests/files/phpcode.php @@ -16,7 +16,7 @@ <p><?php __("text 7 (with parenthesis)"); ?></p> <p><?php __("text 8 \"with escaped double quotes\""); ?></p> <p><?php __("text 9 'with single quotes'"); ?></p> - <p><?= n__("text 10 with plural", "The plural form", 5); ?></p> + <p><?php echo n__("text 10 with plural", "The plural form", 5); ?></p> </div> <?php __e("<div id=\"blog\" class=\"container\">
fixed test for php<I>
oscarotero_Gettext
train
php
bfa4c9b8df611f9c11b5b49f9470ca857a151feb
diff --git a/tests/test_program.py b/tests/test_program.py index <HASH>..<HASH> 100644 --- a/tests/test_program.py +++ b/tests/test_program.py @@ -208,6 +208,8 @@ class TestProgramFeatures(object): assert p.actual_targets == {mysys.a1} def test_triggerlist_targetlist_change2_namever(self, mysys): + # TODO: investigate failure in https://travis-ci.org/tuomas2/automate/jobs/245124552 + # TODO: check also similar tests above. p = mysys.p #add = {p} if isinstance(p, StatusObject) else set() add = set()
Add TODO items in a test that fails randomly
tuomas2_automate
train
py
61da91a4a22cbecd002cb0f16b5f36c9ee8e6eaa
diff --git a/lib/Instrumental.php b/lib/Instrumental.php index <HASH>..<HASH> 100644 --- a/lib/Instrumental.php +++ b/lib/Instrumental.php @@ -110,8 +110,7 @@ class Instrumental { // $this->log->addError('Bar'); echo time() . " $message\n"; - // flush(); - ob_flush(); + flush(); // error_log("$message\n", 3, "logs/development.log"); }
Replaced ob_flush with flush since the former throws an error in some cases and the later should flush to stdout.
Instrumental_instrumental_agent-php
train
php
83a33327f31b4022890282fe0c586fb6d0242f9d
diff --git a/lib/create-icon-set.js b/lib/create-icon-set.js index <HASH>..<HASH> 100644 --- a/lib/create-icon-set.js +++ b/lib/create-icon-set.js @@ -47,6 +47,11 @@ function createIconSet(glyphMap : Object, fontFamily : string) : Function { React.PropTypes.array, // Multiple styles to be merged ]) }, + + setNativeProps(nativeProps) { + this._root.setNativeProps(nativeProps); + }, + render: function() { var name = this.props.name; @@ -71,7 +76,7 @@ function createIconSet(glyphMap : Object, fontFamily : string) : Function { textStyle.color = color; return ( - <View {...this.props} style={containerStyle}> + <View ref={component => this._root = component} {...this.props} style={containerStyle}> <Text style={textStyle}>{glyph}</Text> {this.props.children} </View>
Fixed a bug when Icon is a direct child to Touchable*. #9
oblador_react-native-vector-icons
train
js
5180faae233492c14ad1634e82f05d0020dc7917
diff --git a/Storage/Processor/Image.php b/Storage/Processor/Image.php index <HASH>..<HASH> 100644 --- a/Storage/Processor/Image.php +++ b/Storage/Processor/Image.php @@ -183,6 +183,9 @@ class Image $color = $this->config->getBorderColor() ?? $this->config->getBackground(); $cornerImage = imagecreatetruecolor($radius, $radius); + if ($cornerImage === false) { + throw new \RuntimeException('Could not create cornerImage'); + } $clearColor = imagecolorallocate($cornerImage, 0, 0, 0); $solidColor = imagecolorallocate($cornerImage, (int) hexdec(substr($color, 1, 2)), (int) hexdec(substr($color, 3, 2)), (int) hexdec(substr($color, 5, 2))); @@ -221,6 +224,9 @@ class Image private function applyWatermark($image, $width, $height) { $stamp = imagecreatefrompng($this->watermark); + if ($stamp === false) { + throw new \RuntimeException('Could not convert watermark to image'); + } $sx = imagesx($stamp); $sy = imagesy($stamp); imagecopy($image, $stamp, (int) ($width - $sx) / 2, (int) ($height - $sy) / 2, 0, 0, $sx, $sy);
bug(param-type): image functions require resource, that can not be false
ems-project_EMSCommonBundle
train
php
3eafd7766dc97ee21c0bfdea8d297d24748a81c6
diff --git a/tests/fields/models.py b/tests/fields/models.py index <HASH>..<HASH> 100644 --- a/tests/fields/models.py +++ b/tests/fields/models.py @@ -3,7 +3,14 @@ from django.db import models from djstripe.fields import StripePercentField +from djstripe.models import StripeModel class ExampleDecimalModel(models.Model): noval = StripePercentField() + + +class TestCustomActionModel(StripeModel): + # for some reason having a FK here throws relation doesn't exist even though + # djstripe is also one of the installed apps in tests.settings + djstripe_owner_account = None
Added the TestCustomActionModel to test the Custom Admin Action Made TestCustomActionModel inherit from StripeModel so all sub-classes of StripeModel could also get tested easily.
dj-stripe_dj-stripe
train
py
2ecd01521fa95f2d79e9a483d6b84bc26145ddbc
diff --git a/src/Http/Response.php b/src/Http/Response.php index <HASH>..<HASH> 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -632,6 +632,7 @@ class Response implements ResponseInterface } $this->_reasonPhrase = $reasonPhrase; + // These status codes don't have bodies and can't have content-types. if (in_array($code, [304, 204], true)) { $this->_clearHeader('Content-Type'); }
Add comment for content-type removal.
cakephp_cakephp
train
php
c77f0b35a171878eeb2363b71f76bf1bad22aabd
diff --git a/odl/solvers/nonsmooth/adupdates.py b/odl/solvers/nonsmooth/adupdates.py index <HASH>..<HASH> 100644 --- a/odl/solvers/nonsmooth/adupdates.py +++ b/odl/solvers/nonsmooth/adupdates.py @@ -125,18 +125,18 @@ def adupdates_method(x, g, L, stepsize, majs, niter, random=False, """ # Check the lenghts of the lists (= number of dual variables) length = len(g) - if not len(L) == length: + if len(L) != length: raise ValueError('Number of `L` {} and number of `g` {} do not agree.' ''.format(len(L), length)) - if not len(majs) == length: + if len(majs) != length: raise ValueError('Number of `majs` {} and number of `g` {} do not' ' agree.'.format(len(majs), length)) # Check if operators have a common domain # (the space of the primal variable): domain = L[0].domain - if any(domain != opi.domain for opi in L): + if any(opi.domain != domain for opi in L): raise ValueError('Domains of `L` are not all equal.') # Check if range of the operators equals domain of the functionals
STY: Write checks in ODL style.
odlgroup_odl
train
py
52ccc893c7cb4630e7adc5a20e9d52169d7b2201
diff --git a/js/di.js b/js/di.js index <HASH>..<HASH> 100644 --- a/js/di.js +++ b/js/di.js @@ -207,6 +207,7 @@ Arenite.DI = function (arenite) { var imported = arenite.object.get(window, imp.namespace)(); arenite.config = arenite.object.extend(arenite.config, imported); if (imported.imports) { + window.console.log('Arenite: Merging imports', imported.imports); imports = arenite.array.merge(imports, imported.imports); } } @@ -241,6 +242,7 @@ Arenite.DI = function (arenite) { } if (arenite.config.imports) { + window.console.log('Arenite: Merging imports', arenite.config.imports); _mergeImports(JSON.parse(JSON.stringify(arenite.config.imports))); } else { _loadSyncDependencies();
Added logging to aid in the debug of sub-imports
lcavadas_arenite
train
js
6fe526ec66e202ffeafb8f65da487927c4f5b527
diff --git a/test/unit/test_service_models.py b/test/unit/test_service_models.py index <HASH>..<HASH> 100644 --- a/test/unit/test_service_models.py +++ b/test/unit/test_service_models.py @@ -373,12 +373,11 @@ class GoogleSafeBrowsingTest(UrlTesterTest, unittest.TestCase): self._test_for_unathorized_api_key(function) def host_collection_host_factory(h): - host_object = MagicMock() - host_object.__str__.return_value = h + host_object = host_list_host_factory(h) host_object.is_subdomain.return_value = False host_object.__eq__.return_value = False - test = lambda h2: str(host_object) == str(h2) + test = lambda h2: host_object.to_unicode() == h2.to_unicode() host_object.__eq__.side_effect = test host_object.is_subdomain.side_effect = test
Make function creating host object mocks be reused The function host_list_host_factory is now used in function host_collection_host_factory. The conversion of the return value is being modified to use the mocked to_unicode method available to it.
piotr-rusin_spam-lists
train
py
5e05adcd27ceeaa4b6b5a23930505f99ff3b0644
diff --git a/src/main/java/com/zaxxer/hikari/pool/PoolBase.java b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/zaxxer/hikari/pool/PoolBase.java +++ b/src/main/java/com/zaxxer/hikari/pool/PoolBase.java @@ -176,7 +176,7 @@ abstract class PoolBase Throwable getLastConnectionFailure() { - return lastConnectionFailure.getAndSet(null); + return lastConnectionFailure.get(); } public DataSource getUnwrappedDataSource()
Fixes #<I> only reset lastConnectionFailure after a successful dataSource.getConnection() call.
brettwooldridge_HikariCP
train
java
ce9cb3bc2a8c10550043ff74997556b688a112be
diff --git a/scriptcwl/workflow.py b/scriptcwl/workflow.py index <HASH>..<HASH> 100644 --- a/scriptcwl/workflow.py +++ b/scriptcwl/workflow.py @@ -22,15 +22,12 @@ class WorkflowGenerator(object): self.load(steps) def __getattr__(self, name, **kwargs): - try: - return super(self.__class__, self).__getattr__(name) - except AttributeError: - name = cwl_name(name) - step = self._get_step(name) - for n in step.output_names: - oname = step.output_to_input(n) - self.step_output_types[oname] = step.step_outputs[n] - return partial(self._make_step, step, **kwargs) + name = cwl_name(name) + step = self._get_step(name) + for n in step.output_names: + oname = step.output_to_input(n) + self.step_output_types[oname] = step.step_outputs[n] + return partial(self._make_step, step, **kwargs) def load(self, steps): self.steps_library = steps
Refactor __getattr__ to remove recursion error The old __getattr__ implementation raised a recursion error when trying to add steps using a subclass of WorkflowGenerator. This commit fixes that error.
NLeSC_scriptcwl
train
py
4968e3ff6d6efcc1031058f1935f9f1bc2a962bf
diff --git a/core/src/ons/internal/lazy-repeat.js b/core/src/ons/internal/lazy-repeat.js index <HASH>..<HASH> 100644 --- a/core/src/ons/internal/lazy-repeat.js +++ b/core/src/ons/internal/lazy-repeat.js @@ -121,7 +121,7 @@ export class LazyRepeatProvider { * @param {LazyRepeatDelegate} delegate */ constructor(wrapperElement, delegate) { - this._wrapperElement = util.validated('wrapperElement', wrapperElement, Element); + this._wrapperElement = wrapperElement; this._delegate = util.validated('delegate', delegate, LazyRepeatDelegate); if (wrapperElement.tagName.toLowerCase() === 'ons-list') {
fix(ons-lazy-repeat): fix Safari issue
OnsenUI_OnsenUI
train
js
7bc7bfa84550b4037672cc1168a178cf20f0c548
diff --git a/pamda/private/curry_spec/make_func_curry_spec.py b/pamda/private/curry_spec/make_func_curry_spec.py index <HASH>..<HASH> 100644 --- a/pamda/private/curry_spec/make_func_curry_spec.py +++ b/pamda/private/curry_spec/make_func_curry_spec.py @@ -18,7 +18,7 @@ def func_arg_names(f): def func_arg_defaults(f): argspec = getargspec(f) arg_names = argspec.args - default_arg_values = argspec.defaults + default_arg_values = argspec.defaults or [] num_defaults = len(default_arg_values) default_arg_names = arg_names[-num_defaults:] return dict(zip(default_arg_names, default_arg_values))
Fix make_fun_curry_spec for functions with no defaults
jackfirth_pyramda
train
py
1916583790c61033a5f31c63426393b28666089a
diff --git a/lib/types.js b/lib/types.js index <HASH>..<HASH> 100755 --- a/lib/types.js +++ b/lib/types.js @@ -114,6 +114,8 @@ function __processOptions(t, type) { if (type.max != null) t.maximum = type.max; if (type.minLength != null) t.minLength = type.minLength; if (type.maxLength != null) t.maxLength = type.maxLength; + if (type.minlength != null) t.minLength = type.minlength; + if (type.maxlength != null) t.maxLength = type.maxlength; if (type.examples != null) t.examples = type.examples; if (type.match) { if (type.match instanceof RegExp) {
fixed String minlength and maxlength (#<I>) * fixed String minlength and maxlength
DScheglov_mongoose-schema-jsonschema
train
js
66fc13e7702cce91f9f8c4fd9690509077c99ed4
diff --git a/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/QuartzSchedulerService.java b/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/QuartzSchedulerService.java index <HASH>..<HASH> 100644 --- a/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/QuartzSchedulerService.java +++ b/jbpm-flow/src/main/java/org/jbpm/process/core/timer/impl/QuartzSchedulerService.java @@ -169,7 +169,8 @@ public class QuartzSchedulerService implements GlobalSchedulerService { // Define a Trigger that will fire "now" org.quartz.Trigger triggerq = new SimpleTrigger(quartzJobHandle.getJobName()+"_trigger", quartzJobHandle.getJobGroup(), nextFireTime); - + logger.debug("triggerq.name = {}, triggerq.startTime = {}", triggerq.getName(), triggerq.getStartTime()); // nextFireTime is mapped to startTime + // Schedule the job with the trigger try { if (scheduler.isShutdown()) {
adding debug log which is useful for trouble-shooting (#<I>)
kiegroup_jbpm
train
java
bb06433900e0a69cf864f6d5ed347be213ae9aea
diff --git a/duradmin/src/main/webapp/js/spaces-manager.js b/duradmin/src/main/webapp/js/spaces-manager.js index <HASH>..<HASH> 100644 --- a/duradmin/src/main/webapp/js/spaces-manager.js +++ b/duradmin/src/main/webapp/js/spaces-manager.js @@ -147,11 +147,19 @@ $(function(){ clearContents(); // attach delete button listener $(".delete-space-button",detail).click(function(evt){ - if(!dc.confirm("Are you sure you want to delete multiple spaces?")){ - return; - } - dc.busy("Deleting spaces", {modal: true}); - var spaces = $("#spaces-list").selectablelist("getSelectedData"); + var confirmText = "Are you sure you want to delete multiple spaces?"; + var busyText = "Deleting spaces"; + var spaces = $("#spaces-list").selectablelist("getSelectedData"); + if(spaces.length < 2){ + confirmText = "Are you sure you want to delete this space?"; + busyText = "Deleting space"; + } + + if(!dc.confirm(confirmText)){ + return; + } + dc.busy(busyText, {modal: true}); + var job = dc.util.createJob("delete-spaces"); for(i in spaces){
This resolves issue DURACLOUD-<I>. When only one space is selected to be deleted, changed the warning to be singular instead of plural git-svn-id: <URL>
duracloud_duracloud
train
js
972bb895a7720b487c9ddbef4878f88ffcd95b1a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -150,7 +150,7 @@ setup( packages=['diamond', 'diamond.handler', 'diamond.utils'], scripts=['bin/diamond', 'bin/diamond-setup'], data_files=data_files, - python_requires='==2.7', + python_requires='~=2.7', install_requires=install_requires, classifiers=[ 'Programming Language :: Python',
Update python_requires Fix problem: diamond requires Python '==<I>' but the running Python is <I>
python-diamond_Diamond
train
py
28175cfe6adf20a3e446f79b80e14b9ae7193136
diff --git a/spec/mail/example_emails_spec.rb b/spec/mail/example_emails_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mail/example_emails_spec.rb +++ b/spec/mail/example_emails_spec.rb @@ -300,4 +300,20 @@ describe "Test emails" do end + describe "empty address lists" do + + before(:each) do + @message = Mail::Message.new(File.read(fixture('emails', 'error_emails', 'weird_to_header.eml'))) + end + + it "should parse the email and encode without crashing" do + doing { @message.encoded }.should_not raise_error + end + + it "should return an empty groups list" do + @message.to.should == ['[email protected]', '[email protected]'] + end + + end + end \ No newline at end of file
Adding spec to test error email for missing addresses in to header
mikel_mail
train
rb
81ead6fba7b8c544f448a6ff550879604c859d8a
diff --git a/tools/apidoc.js b/tools/apidoc.js index <HASH>..<HASH> 100644 --- a/tools/apidoc.js +++ b/tools/apidoc.js @@ -243,7 +243,7 @@ function load(file, loadDescription) { } function generate(module, moduleName) { - var outFile = 'apidocs/api-' + moduleName + '.md'; + var outFile = 'apidocs/module-' + moduleName + '.md'; try { fs.unlinkSync(outFile);
Adjust file names generated by API docs.
oxygenhq_oxygen
train
js
0e2ec3ef248d1892acbb114faf3ceb7dcd32457e
diff --git a/test/core/targets/simple.js b/test/core/targets/simple.js index <HASH>..<HASH> 100644 --- a/test/core/targets/simple.js +++ b/test/core/targets/simple.js @@ -21,7 +21,7 @@ let COOKIES = {}; const users = { leo: { name: 'leo', - password: '$2a$10$iqJSHD.BGr0E2IxQwYgJmeP3NvhPrXAeLSaGCj6IR/XU5QtjVu5Tm', // 'secret' + password: 'secret', id: '1' } };
fix(tests): Remove bcrypt-encoded password
artilleryio_artillery
train
js
4a335d79d6da2901100d5a01bc16d8fef7d30da4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,7 @@ setup( # Dependencies install_requires=[ "nassl>=4.0.0,<5.0.0", - "cryptography>=2.6,<3.3", + "cryptography>=2.6,<3.4", "tls-parser>=1.2.2,<1.3.0", "typing_extensions ; python_version<'3.8'", # To remove when we drop support for Python 3.7 ],
[#<I>] Update cryptography in setup.py
nabla-c0d3_sslyze
train
py
eaa3580fa66d1941e015f3cd348b97ebab9350af
diff --git a/test/unit/test_archivers.py b/test/unit/test_archivers.py index <HASH>..<HASH> 100644 --- a/test/unit/test_archivers.py +++ b/test/unit/test_archivers.py @@ -31,11 +31,16 @@ class MockCommit(object): self.message = message +class MockHead(object): + is_detached = False + + class MockRepo(object): active_branch = "master" bare = False _is_dirty = False commits = [MockCommit("commit-1"), MockCommit("commit-2")] + head = MockHead() def is_dirty(self): return self._is_dirty
Add a mock head to the unit tests for git
tonybaloney_wily
train
py
12cb79e47879e94f5e6d4f207ac88f5a1bb8b349
diff --git a/scripts/importer/mtasks/general_data.py b/scripts/importer/mtasks/general_data.py index <HASH>..<HASH> 100644 --- a/scripts/importer/mtasks/general_data.py +++ b/scripts/importer/mtasks/general_data.py @@ -1092,7 +1092,7 @@ def do_superfit_spectra(events, stubs, args, tasks, task_obj, log): epoff = '' source = events[name].add_source(srcname='Superfit', url=superfit_url, secondary=True) - events[name].add_quantity('alias', name, source) + events[name].add_quantity('alias', oldname, source) with open(sffile) as ff: rows = ff.read().splitlines()
BUG: change name added to aliases in 'superfit_spectra'.
astrocatalogs_astrocats
train
py
f5ab67cb3f1f656fcf76d560f50688b5b83f0437
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -173,8 +173,14 @@ Geocoder.prototype = mapboxgl.util.inherit(mapboxgl.Control, { _query: function(input) { if (!input) return; - var q = (typeof input === 'string') ? input : input.join(); - this._geocode(q, function(results) { + if (typeof input === 'object' && input.length) { + input = [ + mapboxgl.util.wrap(input[0], -180, 180), + mapboxgl.util.wrap(input[1], -180, 180) + ].join(); + } + + this._geocode(input, function(results) { if (!results.length) return; var result = results[0]; this._results = results;
Use mapboxgl.wrap When coordinates outside of -<I> or <I> are received. Closes #<I>
mapbox_mapbox-gl-geocoder
train
js
5a93950e6447694d61044aa2ec2e0849cb25d94d
diff --git a/src/functions.js b/src/functions.js index <HASH>..<HASH> 100644 --- a/src/functions.js +++ b/src/functions.js @@ -104,6 +104,6 @@ module.exports = function(codegen) { }, // functions defined in function_definitions - 'inRange': 'fn.in_range' + 'inRange': 'fn.inRange' }; }; diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -18,7 +18,14 @@ var expr = module.exports = { var value = generator(expr.parse(str)); args[len] = '"use strict"; return (' + value.code + ');'; var generatedFn = Function.apply(null, args); - value.fn = generatedFn.bind(null, generator.functionDefinitions); + var fnDefs = generator.functionDefinitions; + if (len < 8) { + value.fn = function(a, b, c, d, e, f, g) { + generatedFn(fnDefs, a, b, c, d, e, f, g); + } + } else { + value.fn = generatedFn.bind(null, fnDefs); + } return value; }; compile.codegen = generator;
Renamed in_range to inRange (fixed). Closures are more efficient for generated fns
vega_vega-expression
train
js,js
927af219b2ee210b85942f211f1873bd98823a96
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ version = '0.1.10' setup( name='hydrachain', version=version, - description="", + description="Permissioned Distributed Ledger based on Ethereum", long_description=readme + '\n\n' + history, author="HeikoHeiko", author_email='[email protected]',
Adding `description` to `setup.py` Adding `description` to `setup.py`
HydraChain_hydrachain
train
py
dcba9e93cfbb4ad4c5f9f03c94a684bb818a2567
diff --git a/lib/AlignedBuilder.php b/lib/AlignedBuilder.php index <HASH>..<HASH> 100755 --- a/lib/AlignedBuilder.php +++ b/lib/AlignedBuilder.php @@ -268,11 +268,11 @@ class AlignedBuilder $type = max($type, strlen($resourceRecord->getType())); } - $padding[] = $name; - $padding[] = $ttl; - $padding[] = $type; - $padding[] = array_sum($padding) + 6; - - return $padding; + return [ + $name, + $ttl, + $type, + $name + $ttl + $type + 6, + ]; } }
Fixed minor issue with getPadding()
Badcow_DNS
train
php
cc3335244cd55d04b61ad98d40bec91b40c6114f
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private static $freshCache = []; - const VERSION = '5.1.5-DEV'; + const VERSION = '5.1.5'; const VERSION_ID = 50105; const MAJOR_VERSION = 5; const MINOR_VERSION = 1; const RELEASE_VERSION = 5; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2021'; const END_OF_LIFE = '01/2021';
Update VERSION for <I>
symfony_symfony
train
php
25e7f6b6d76041a4bb8f92cc26f81004b3b58220
diff --git a/src/bundle/Resources/public/js/scripts/button.content.edit.js b/src/bundle/Resources/public/js/scripts/button.content.edit.js index <HASH>..<HASH> 100644 --- a/src/bundle/Resources/public/js/scripts/button.content.edit.js +++ b/src/bundle/Resources/public/js/scripts/button.content.edit.js @@ -15,7 +15,7 @@ contentInfoInput.value = contentId; versionInfoContentInfoInput.value = contentId; versionInfoVersionNoInput.value = versionNo; - languageInput.setAttribute('checked', true); + languageInput.checked = true; versionEditForm.submit(); }; const addDraft = () => {
EZP-<I>: Can't create new draft due to lack of language code in URL
ezsystems_ezplatform-admin-ui
train
js
5ec395f560db5bc0fa908184915b31bf9b9a4f97
diff --git a/src/FcmChannel.php b/src/FcmChannel.php index <HASH>..<HASH> 100755 --- a/src/FcmChannel.php +++ b/src/FcmChannel.php @@ -50,17 +50,30 @@ class FcmChannel $message->to($to); } + + if (is_array($message->getTo())) { + $chunks = array_chunk($message->getTo(), 1000); - $response = $this->client->post(self::API_URI, [ - 'headers' => array_merge( - [ + foreach ($chunks as $chunk) { + $message->to($chunk); + + $response = $this->client->post(self::API_URI, [ + 'headers' => [ + 'Authorization' => 'key='.$this->apiKey, + 'Content-Type' => 'application/json', + ], + 'body' => $message->formatData(), + ]); + } + } else { + $response = $this->client->post(self::API_URI, [ + 'headers' => [ 'Authorization' => 'key='.$this->apiKey, 'Content-Type' => 'application/json', ], - $message->getHeaders() - ), - 'body' => $message->formatData(), - ]); + 'body' => $message->formatData(), + ]); + } return \GuzzleHttp\json_decode($response->getBody(), true); }
Split recepients arrays into chunks with <I> items
benwilkins_laravel-fcm-notification
train
php
6521748e9572eea2a97b6b8b836f2389d3d9df07
diff --git a/lib/dimples/site.rb b/lib/dimples/site.rb index <HASH>..<HASH> 100644 --- a/lib/dimples/site.rb +++ b/lib/dimples/site.rb @@ -280,8 +280,16 @@ module Dimples @archives[:day]["#{year}-#{month}-#{day}"] ||= [] end + def plugins + @plugins ||= Plugin.subclasses&.map { |subclass| subclass.new(self) } + end + + private + def trigger_event(event, item = nil) - Plugin.send_event(self, event, item) + plugins.each do |plugin| + plugin.process(event, item) if plugin.supports_event?(event) + end end end end
Add a plugins method, and switch trigger_event to use it
waferbaby_dimples
train
rb
dad4382ae7bdf9b3a685fb3f7c0141ca00d646da
diff --git a/quantecon/__init__.py b/quantecon/__init__.py index <HASH>..<HASH> 100644 --- a/quantecon/__init__.py +++ b/quantecon/__init__.py @@ -35,7 +35,7 @@ from .markov import mc_compute_stationary, mc_sample_path #Imports t #<- from .rank_nullspace import rank_est, nullspace from .robustlq import RBLQ -from .util import searchsorted, fetch_nb_dependencies +from .util import searchsorted, fetch_nb_dependencies, tic, tac, toc #-Add Version Attribute-# from .version import version as __version__
upgraded tic, tac and toc to top level
QuantEcon_QuantEcon.py
train
py
a545c3a5e3d07af99179d4888e653a62171dd779
diff --git a/lib/robot.js b/lib/robot.js index <HASH>..<HASH> 100644 --- a/lib/robot.js +++ b/lib/robot.js @@ -82,7 +82,7 @@ Robot.prototype.getSchedule = function getSchedule(callback) { if (error) { callback(error, result); } else if (result && 'data' in result && 'enabled' in result.data) { - callback(null, result.data.enabled); + callback(null, result.data); } else { callback(result && 'message' in result ? result.message : 'failed', result); }
Make getSchedule to return full schedule, not only enables status Changes to be committed: modified: lib/robot.js
Pmant_node-botvac
train
js
dd25ddb2b261a7333d070fa586304c35526619a0
diff --git a/internal/service/elb/service_account_data_source_test.go b/internal/service/elb/service_account_data_source_test.go index <HASH>..<HASH> 100644 --- a/internal/service/elb/service_account_data_source_test.go +++ b/internal/service/elb/service_account_data_source_test.go @@ -41,7 +41,7 @@ func TestAccELBServiceAccountDataSource_region(t *testing.T) { ProviderFactories: acctest.ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCheckAWSElbServiceAccountExplicitRegionConfig, + Config: testAccServiceAccountDataSourceConfig_explicitRegion, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "id", expectedAccountID), acctest.CheckResourceAttrGlobalARNAccountID(dataSourceName, "arn", expectedAccountID, "iam", "root"), @@ -55,7 +55,7 @@ const testAccServiceAccountDataSourceConfig_basic = ` data "aws_elb_service_account" "main" {} ` -const testAccCheckAWSElbServiceAccountExplicitRegionConfig = ` +const testAccServiceAccountDataSourceConfig_explicitRegion = ` data "aws_region" "current" {} data "aws_elb_service_account" "regional" {
elb: Fix missed AWS
terraform-providers_terraform-provider-aws
train
go
232dc9e452227a5d6806cbc96d8a3e7e0fc5bf04
diff --git a/registrasion/controllers/invoice.py b/registrasion/controllers/invoice.py index <HASH>..<HASH> 100644 --- a/registrasion/controllers/invoice.py +++ b/registrasion/controllers/invoice.py @@ -357,8 +357,18 @@ class InvoiceController(ForId, object): return cart.revision == self.invoice.cart_revision def update_validity(self): - ''' Voids this invoice if the cart it is attached to has updated. ''' - if not self._invoice_matches_cart(): + ''' Voids this invoice if the attached cart is no longer valid because + the cart revision has changed, or the reservations have expired. ''' + + is_valid = self._invoice_matches_cart() + cart = self.invoice.cart + if self.invoice.is_unpaid and is_valid and cart: + try: + CartController(cart).validate_cart() + except ValidationError: + is_valid = False + + if not is_valid: if self.invoice.total_payments() > 0: # Free up the payments made to this invoice self.refund()
Invoices are tested for cart validity before display. Fixes #<I>.
chrisjrn_registrasion
train
py
afee5587a9b50cc0c66279e7d5d87744be688cd7
diff --git a/galpy/potential.py b/galpy/potential.py index <HASH>..<HASH> 100644 --- a/galpy/potential.py +++ b/galpy/potential.py @@ -13,6 +13,7 @@ from galpy.potential_src import KGPotential from galpy.potential_src import interpRZPotential from galpy.potential_src import DehnenBarPotential from galpy.potential_src import SteadyLogSpiralPotential +from galpy.potential_src import TransientLogSpiralPotential # # Functions # @@ -53,3 +54,4 @@ KGPotential= KGPotential.KGPotential interpRZPotential= interpRZPotential.interpRZPotential DehnenBarPotential= DehnenBarPotential.DehnenBarPotential SteadyLogSpiralPotential= SteadyLogSpiralPotential.SteadyLogSpiralPotential +TransientLogSpiralPotential= TransientLogSpiralPotential.TransientLogSpiralPotential
add transient spiral to top-level
jobovy_galpy
train
py
d4aecde7bbb086755b6700308381287f73535b0b
diff --git a/Model/CampaignExecutioner.php b/Model/CampaignExecutioner.php index <HASH>..<HASH> 100644 --- a/Model/CampaignExecutioner.php +++ b/Model/CampaignExecutioner.php @@ -53,6 +53,9 @@ class CampaignExecutioner { $limiter = new ContactLimiter($batchLimit, null, null, null, $contactIdList); + // Make sure these events show up as system triggered for summary counts to be accurate. + defined('MAUTIC_CAMPAIGN_SYSTEM_TRIGGERED') or define('MAUTIC_CAMPAIGN_SYSTEM_TRIGGERED', 1); + /** @var Counter $counter */ $counter = $this->kickoffExecutioner->execute($campaign, $limiter);
[ENG-<I>] Ensure campaign triggered counts are accurate.
TheDMSGroup_mautic-contact-source
train
php
2f70b95dc6f6975bcf5a2e8593af7d27d9682388
diff --git a/src/client/websocketRouterAccess.js b/src/client/websocketRouterAccess.js index <HASH>..<HASH> 100644 --- a/src/client/websocketRouterAccess.js +++ b/src/client/websocketRouterAccess.js @@ -85,7 +85,7 @@ define(['common/storage/constants', 'q'], function (CONSTANTS, Q) { const deferred = Q.defer(); logger.debug('outgoing message to websocket router', {metadata: {routerId: routerId, messageType: messageType, payload: payload}}); - storage.sendWsRouterMessage(routerId, messageType, payload, (err,result) => { + storage.sendWsRouterMessage(routerId, messageType, payload, (err, result) => { if (err) { deferred.reject(err); } else {
WIP - fix eslint issue
webgme_webgme-engine
train
js
190ae8cc9b22bf8a63f21cff8a9745e39fd00480
diff --git a/lib/slather/project.rb b/lib/slather/project.rb index <HASH>..<HASH> 100755 --- a/lib/slather/project.rb +++ b/lib/slather/project.rb @@ -158,14 +158,15 @@ module Slather raise StandardError, "The specified build directory (#{self.build_directory}) does not exist" unless File.exists?(self.build_directory) dir = nil if self.scheme - dir = Dir[File.join("#{build_directory}","/**/CodeCoverage/#{self.scheme}")].first + dir = Dir[File.join(build_directory,"/**/CodeCoverage/#{self.scheme}")].first else - dir = Dir[File.join("#{build_directory}","/**/#{first_product_name}")].first + dir = Dir[File.join(build_directory,"/**/#{first_product_name}")].first end if dir == nil # Xcode 7.3 moved the location of Coverage.profdata - dir = Dir[File.join("#{build_directory}","/**/CodeCoverage")].first + dir = Dir[File.join(build_directory,"/**/CodeCoverage")].first + end if dir == nil && Slather.xcode_version[0] >= 9 # Xcode 9 moved the location of Coverage.profdata
build_directory is being substituted in a string unnecessarily.
SlatherOrg_slather
train
rb
3b3731c14683cb941131f5ac134e462d7db8879e
diff --git a/src/Service/ViewHelper.php b/src/Service/ViewHelper.php index <HASH>..<HASH> 100644 --- a/src/Service/ViewHelper.php +++ b/src/Service/ViewHelper.php @@ -231,23 +231,11 @@ class ViewHelper if (!$this->renderer) { return ''; } - $response = $this->prepareResponseStream($this->response); - $response = $this->renderer->start($this->request, $response)->render($viewFile, $data); - - return $this->returnResponseBody($response); + return $this->renderer + ->start($this->request, $this->response) + ->renderContents($viewFile, $data); } - - /** - * @param ResponseInterface $response - * @return ResponseInterface - */ - private function prepareResponseStream($response) - { - $response->getBody()->rewind(); - - return $response; - } - + /** * @param ResponseInterface $response * @return string
simplified ViewHelper::render method; by using renderContent method of View.
TuumPHP_Respond
train
php
80e7071e7a5278d079e8e023267abf7e0da54f9a
diff --git a/src/Module.php b/src/Module.php index <HASH>..<HASH> 100644 --- a/src/Module.php +++ b/src/Module.php @@ -29,7 +29,7 @@ use luya\base\CoreModuleInterface; * * @author Basil Suter <[email protected]> */ -class Module extends \luya\base\Module implements CoreModuleInterface +final class Module extends \luya\base\Module implements CoreModuleInterface { /** * @inheritdoc
set module classes as final in order to prevent extend from them when creating custom modules.
luyadev_luya-module-styleguide
train
php
51fe1a2d53cf13aad1fb39b2ad5bb717b32382e2
diff --git a/rejester/workers.py b/rejester/workers.py index <HASH>..<HASH> 100644 --- a/rejester/workers.py +++ b/rejester/workers.py @@ -391,7 +391,7 @@ class SingleWorker(Worker): return False try: if set_title: - setproctitle('rejester worker {} {}' + setproctitle('rejester worker {!r} {!r}' .format(unit.work_spec_name, unit.key)) unit.run() unit.finish()
setproctitle() in a way that doesn't fail if work unit keys have \0 bytes
diffeo_rejester
train
py
8dce6a98e7e5fca968392d6638c984ed3a5bb90d
diff --git a/src/operation.js b/src/operation.js index <HASH>..<HASH> 100644 --- a/src/operation.js +++ b/src/operation.js @@ -409,7 +409,7 @@ export class Operation { } /** - * Returns an XDR ManageDataOp. // + * This operation adds data entry to the ledger. * @param {object} opts * @param {string} opts.name - The name of the data entry. * @param {string|Buffer} opts.value - The value of the data entry.
Update ManageData operation jsdoc
stellar_js-stellar-base
train
js
39ef0025d831958a29ed9aeef924ad9e6396e463
diff --git a/test/oauth-signature.qunit.tests.js b/test/oauth-signature.qunit.tests.js index <HASH>..<HASH> 100644 --- a/test/oauth-signature.qunit.tests.js +++ b/test/oauth-signature.qunit.tests.js @@ -178,6 +178,8 @@ test('The value should be decoded following the RFC3986', function () { equal(new Rfc3986().decode('%31%32%33%41%42%43'), '123ABC', 'Encoded unreserved characters must be decoded'); equal(new Rfc3986().decode(), '', + 'Undefined value should return empty string'); + equal(new Rfc3986().decode(''), '', 'Empty value should return empty string'); equal(new Rfc3986().decode(null), '', 'Null value should return empty string');
Added one more test for empty string
bettiolo_oauth-signature-js
train
js
c152010ffe0052de8ca6af501788b932ba405a9e
diff --git a/hazelcast/src/main/java/com/hazelcast/instance/Node.java b/hazelcast/src/main/java/com/hazelcast/instance/Node.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/instance/Node.java +++ b/hazelcast/src/main/java/com/hazelcast/instance/Node.java @@ -395,6 +395,10 @@ public class Node { if (groupProperties.getBoolean(GroupProperty.SHUTDOWNHOOK_ENABLED)) { Runtime.getRuntime().removeShutdownHook(shutdownHookThread); } + } catch (Throwable ignored) { + } + + try { discoveryService.destroy(); } catch (Throwable ignored) { }
DiscoveryService#destroy method moved to its own try-catch block, fixes #<I>
hazelcast_hazelcast
train
java
5aafbddf65945ac4b8c4947c9589a5205234d062
diff --git a/js/tooltip/lumx.tooltip_directive.js b/js/tooltip/lumx.tooltip_directive.js index <HASH>..<HASH> 100644 --- a/js/tooltip/lumx.tooltip_directive.js +++ b/js/tooltip/lumx.tooltip_directive.js @@ -108,6 +108,12 @@ angular.module('lumx.tooltip', []) tooltip.remove(); }, 200); }; + + $scope.$on('$destroy', function() + { + tooltip.remove(); + $scope.$destroy(); + }); }]) .directive('lxTooltip', function() {
fix tooltip: remove element on scope destroy Sometimes the tooltip was still visible in the screen even after a page change. By deleting the tooltip's element from the DOM when the scope is destroyed, we ensure that the tooltip don't stay visible.
lumapps_lumX
train
js
de8b6758335b5d892a28219587229c496cfaf464
diff --git a/news-bundle/src/Resources/contao/dca/tl_news.php b/news-bundle/src/Resources/contao/dca/tl_news.php index <HASH>..<HASH> 100644 --- a/news-bundle/src/Resources/contao/dca/tl_news.php +++ b/news-bundle/src/Resources/contao/dca/tl_news.php @@ -860,6 +860,12 @@ class tl_news extends Backend if (strlen(Input::get('tid'))) { $this->toggleVisibility(Input::get('tid'), (Input::get('state') == 1)); + + if (Environment::get('isAjaxRequest')) + { + exit; + } + $this->redirect($this->getReferer()); }
[News] Correctly handle "toggle visibility" requests via Ajax
contao_contao
train
php
38e7bd50c0d8cd7610bc460386240ed33108bc75
diff --git a/tests/TextDiffTest.php b/tests/TextDiffTest.php index <HASH>..<HASH> 100644 --- a/tests/TextDiffTest.php +++ b/tests/TextDiffTest.php @@ -38,10 +38,11 @@ final class TextDiffTest extends \PHPUnit_Framework_TestCase $commandTester->execute( array( 'path' => array(__DIR__.'/Fixtures/FixCommand/TextDiffTestInput.php'), - '--rules' => 'concat_without_spaces', - '--dry-run' => true, '--diff' => true, + '--dry-run' => true, '--format' => $format, + '--rules' => 'concat_without_spaces', + '--using-cache' => 'no', ), array( 'decorated' => $isDecorated,
TextDiffTest - tests should not produce cache file
FriendsOfPHP_PHP-CS-Fixer
train
php
06a88da3c83ce57cff84abf04aea8274a758e960
diff --git a/salt/daemons/flo/worker.py b/salt/daemons/flo/worker.py index <HASH>..<HASH> 100644 --- a/salt/daemons/flo/worker.py +++ b/salt/daemons/flo/worker.py @@ -11,7 +11,7 @@ import time import os import multiprocessing import logging -from six.moves import range +from salt.utils.six.moves import range # Import salt libs import salt.daemons.masterapi
Replaced module six in file /salt/daemons/flo/worker.py
saltstack_salt
train
py
502b16d5e658928f6c9b1f0d0f1857337c3d6b50
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( 'art', ], classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: MIT License',
fix : minor edit in setup file
sepandhaghighi_pycm
train
py
a19138f5d78bb4d5b7460dcfbb1237ee7e0d32c3
diff --git a/dir.go b/dir.go index <HASH>..<HASH> 100644 --- a/dir.go +++ b/dir.go @@ -9,7 +9,13 @@ import ( "bazil.org/fuse" ) +const dirSeparator = '/' + +// A "directory" in GCS, defined by an object name prefix. All prefixes end +// with dirSeparator except for the special case of the root directory, where +// the prefix is the empty string. type dir struct { + prefix string } func (d *dir) Attr() fuse.Attr {
Clarified the purpose of the dir struct.
jacobsa_timeutil
train
go
28e8973073a5e63abfc22ca28e6dad72cb65deae
diff --git a/builtin/credential/radius/backend_test.go b/builtin/credential/radius/backend_test.go index <HASH>..<HASH> 100644 --- a/builtin/credential/radius/backend_test.go +++ b/builtin/credential/radius/backend_test.go @@ -144,11 +144,6 @@ func TestBackend_users(t *testing.T) { } func TestBackend_acceptance(t *testing.T) { - if os.Getenv(logicaltest.TestEnvVar) == "" { - t.Skip(fmt.Sprintf("Acceptance tests skipped unless env '%s' set", logicaltest.TestEnvVar)) - return - } - b, err := Factory(context.Background(), &logical.BackendConfig{ Logger: nil, System: &logical.StaticSystemView{ @@ -210,7 +205,6 @@ func TestBackend_acceptance(t *testing.T) { logicaltest.Test(t, logicaltest.TestCase{ CredentialBackend: b, PreCheck: testAccPreCheck(t, host, port), - AcceptanceTest: true, Steps: []logicaltest.TestStep{ // Login with valid but unknown user will fail because unregistered_user_policies is empty testConfigWrite(t, configDataAcceptanceNoAllowUnreg, false),
Since we run plenty of dockerized tests without requiring an env var to (#<I>) be set, let's make the Radius tests behave that way too.
hashicorp_vault
train
go
66efca5d06170b2386b6251a793fff1b172dc858
diff --git a/id/v4.go b/id/v4.go index <HASH>..<HASH> 100644 --- a/id/v4.go +++ b/id/v4.go @@ -1,11 +1,16 @@ -package uuid +package id -import uuid "github.com/satori/go.uuid" +import ( + "github.com/influxdata/chronograf" + uuid "github.com/satori/go.uuid" +) -// V4 implements chronograf.ID -type V4 struct{} +var _ chronograf.ID = &UUID + +// UUID generates a V4 uuid +type UUID struct{} // Generate creates a UUID v4 string -func (i *V4) Generate() (string, error) { +func (i *UUID) Generate() (string, error) { return uuid.NewV4().String(), nil }
Rename V4 to UUID
influxdata_influxdb
train
go
5df397ad4ddeb611e4a3b8e1040d3544509716f0
diff --git a/panoptes_client/subject.py b/panoptes_client/subject.py index <HASH>..<HASH> 100644 --- a/panoptes_client/subject.py +++ b/panoptes_client/subject.py @@ -1,6 +1,10 @@ from __future__ import absolute_import, division, print_function -_OLD_STR = str +_OLD_STR_TYPES = (str,) +try: + _OLD_STR_TYPES = _OLD_STR_TYPES + (unicode,) +except NameError: + pass from builtins import range, str @@ -83,7 +87,7 @@ class Subject(PanoptesObject): self.locations.append(location) self._media_files.append(None) return - elif type(location) in (str, _OLD_STR): + elif type(location) in (str, _OLD_STR_TYPES): f = open(location, 'rb') else: f = location
Fix unicode location paths in Python 2
zooniverse_panoptes-python-client
train
py
ed6806d480d68d9379ea1b6cf77791facad655aa
diff --git a/programs/thellier_gui3.py b/programs/thellier_gui3.py index <HASH>..<HASH> 100755 --- a/programs/thellier_gui3.py +++ b/programs/thellier_gui3.py @@ -5381,6 +5381,7 @@ class Arai_GUI(wx.Frame): self.zijplot.set_xlim(xmin, xmax) self.zijplot.set_ylim(ymin, ymax) + self.zijplot.axis("equal") self.canvas2.draw()
modified: thellier_gui3.py
PmagPy_PmagPy
train
py
022db7426eadfef9e2677f898dc0441481a16265
diff --git a/src/PhoneNumberUtil.php b/src/PhoneNumberUtil.php index <HASH>..<HASH> 100644 --- a/src/PhoneNumberUtil.php +++ b/src/PhoneNumberUtil.php @@ -807,7 +807,8 @@ class PhoneNumberUtil /** * Returns the region where a phone number is from. This could be used for geocoding at the region - * level. + * level. Only guarantees correct results for valid, full numbers (not short-codes, or invalid + * numbers). * * @param PhoneNumber $number the phone number whose origin we want to know * @return null|string the region where the phone number is from, or null if no region matches this calling
Update documentation for getRegionCodeForNumber Clarify that it does not work for short-codes or invalid numbers.
giggsey_libphonenumber-for-php
train
php
4b7bc92ff37efc6bccfec4d5fa2ec8d652f50243
diff --git a/gems/rake-support/lib/torquebox/server.rb b/gems/rake-support/lib/torquebox/server.rb index <HASH>..<HASH> 100644 --- a/gems/rake-support/lib/torquebox/server.rb +++ b/gems/rake-support/lib/torquebox/server.rb @@ -46,10 +46,10 @@ module TorqueBox def self.setup_environment ENV['TORQUEBOX_HOME'] ||= torquebox_home - ENV['JBOSS_HOME'] ||= "#{ENV['TORQUEBOX_HOME']}/jboss" + ENV['JBOSS_HOME'] ||= "#{ENV['TORQUEBOX_HOME']}/jboss" if ENV['TORQUEBOX_HOME'] ENV['JRUBY_HOME'] ||= jruby_home ENV['JBOSS_OPTS'] ||= "-Djruby.home=#{jruby_home}" - %w(JBOSS_HOME JRUBY_HOME).each { |key| puts "[ERROR] #{key} is not set. Install torquebox-server gem or manually set #{key}" unless ENV[key] } + %w(JBOSS_HOME JRUBY_HOME).each { |key| puts "[ERROR] #{key} is not set. Install torquebox-server gem (and ensure it's in your Gemfile) or manually set #{key}" unless ENV[key] } end end
Display a helpful error message when torquebox-server is being used but not listed in the Gemfile
torquebox_torquebox
train
rb
c20126a4955015faf5e92ead7339a9678fafcd6c
diff --git a/src/main/java/io/yawp/utils/EntityUtils.java b/src/main/java/io/yawp/utils/EntityUtils.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/yawp/utils/EntityUtils.java +++ b/src/main/java/io/yawp/utils/EntityUtils.java @@ -70,10 +70,6 @@ public class EntityUtils { public static Class<?> getIdType(Class<?> clazz) { Field idField = getFieldWithAnnotation(clazz, Id.class); - if (!idField.getType().equals(IdRef.class)) { - // TODO remove long id support - return clazz; - } ParameterizedType type = (ParameterizedType) idField.getGenericType(); Type[] types = type.getActualTypeArguments(); assert types.length == 1;
idref key with name
feroult_yawp
train
java