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
7363d2a8113d035f48ac7fc2a664fa3bc506b9b6
diff --git a/src/__tests__/parse-test.js b/src/__tests__/parse-test.js index <HASH>..<HASH> 100644 --- a/src/__tests__/parse-test.js +++ b/src/__tests__/parse-test.js @@ -73,7 +73,7 @@ describe('parse', () => { } }); - it('supports custom parserOptions', () => { + it('supports custom parserOptions with plugins', () => { expect(() => parse('const chained: Type = 1;', () => {}, null, { parserOptions: { @@ -85,4 +85,14 @@ describe('parse', () => { }), ).toThrowError(/.*Unexpected token \(1:13\).*/); }); + + it('supports custom parserOptions without plugins', () => { + expect(() => + parse('const chained: Type = 1;', () => {}, null, { + parserOptions: { + allowSuperOutsideMethod: true, + }, + }), + ).toThrowError(ERROR_MISSING_DEFINITION); + }); });
test: Add test for parserOptions without plugins
reactjs_react-docgen
train
js
ae81d4719f2a9fafd48ad02be848d1332448bc0b
diff --git a/core/lib/rom/schema.rb b/core/lib/rom/schema.rb index <HASH>..<HASH> 100644 --- a/core/lib/rom/schema.rb +++ b/core/lib/rom/schema.rb @@ -386,20 +386,6 @@ module ROM ) end - # Return a new schema with new options - # - # @example - # schema.with(inferrer: my_inferrer) - # - # @param [Hash] new_options - # - # @return [Schema] - # - # @api public - def with(new_options) - self.class.new(name, options.merge(new_options)) - end - # Return AST for the schema # # @return [Array]
Remove Schema#with Use auto-generated method instead
rom-rb_rom
train
rb
2baa378ae8ed61335a471b83961ca31509907938
diff --git a/upload/catalog/model/account/transaction.php b/upload/catalog/model/account/transaction.php index <HASH>..<HASH> 100644 --- a/upload/catalog/model/account/transaction.php +++ b/upload/catalog/model/account/transaction.php @@ -42,14 +42,14 @@ class Transaction extends \Opencart\System\Engine\Model { public function getTotalTransactions(): int { $query = $this->db->query("SELECT COUNT(*) AS `total` FROM `" . DB_PREFIX . "customer_transaction` WHERE `customer_id` = '" . (int)$this->customer->getId() . "'"); - return $query->row['total']; + return (int)$query->row['total']; } public function getTotalAmount(): int { $query = $this->db->query("SELECT SUM(amount) AS `total` FROM `" . DB_PREFIX . "customer_transaction` WHERE `customer_id` = '" . (int)$this->customer->getId() . "' GROUP BY `customer_id`"); if ($query->num_rows) { - return $query->row['total']; + return (int)$query->row['total']; } else { return 0; }
Added sanitized int on total
opencart_opencart
train
php
4bede6a8cc22efcb3a698568945582198e46954d
diff --git a/tests/TestCase/Cache/SimpleCacheEngineTest.php b/tests/TestCase/Cache/SimpleCacheEngineTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Cache/SimpleCacheEngineTest.php +++ b/tests/TestCase/Cache/SimpleCacheEngineTest.php @@ -14,6 +14,7 @@ */ namespace Cake\Test\TestCase\Cache; +use Cake\Cache\CacheEngine; use Cake\Cache\Engine\FileEngine; use Cake\Cache\SimpleCacheEngine; use Cake\TestSuite\TestCase; @@ -27,6 +28,20 @@ use Psr\SimpleCache\InvalidArgumentException; class SimpleCacheEngineTest extends TestCase { /** + * The inner cache engine + * + * @var CacheEngine + */ + protected $inner; + + /** + * The simple cache engine under test + * + * @var SimpleCacheEngine + */ + protected $cache; + + /** * Setup * * @return void
Add property type hints Improves auto-completion & IDE auto resolution.
cakephp_cakephp
train
php
adf88d9c47b17102a9cc464c62c46799fd7defbd
diff --git a/app_init/app_lib.py b/app_init/app_lib.py index <HASH>..<HASH> 100644 --- a/app_init/app_lib.py +++ b/app_init/app_lib.py @@ -63,7 +63,7 @@ class AppLib: # after adding the current working directory. if lib_directory is None: lib_directory = lib_latest - sys.path.insert(0, lib_directory) + sys.path.insert(0, os.path.join(os.getcwd(), lib_directory)) # insert the current working directory into the system Path for the App, ensuring that it is # always the first entry in the list.
+ updated app_lib to set full path to lib_ directory.
ThreatConnect-Inc_tcex
train
py
b8b98f871b18f67fe841b22c5155ba200f05964d
diff --git a/tests/frontend/org/voltdb/iv2/TestReplaySequencer.java b/tests/frontend/org/voltdb/iv2/TestReplaySequencer.java index <HASH>..<HASH> 100644 --- a/tests/frontend/org/voltdb/iv2/TestReplaySequencer.java +++ b/tests/frontend/org/voltdb/iv2/TestReplaySequencer.java @@ -270,5 +270,24 @@ public class TestReplaySequencer extends TestCase assertEquals(false, result); assertNull(dut.poll()); } + + @Test + public void testSentinelThenEOLThenFragment() + { + boolean result; + ReplaySequencer dut = new ReplaySequencer(); + + TransactionInfoBaseMessage sntl = makeSentinel(1L); + TransactionInfoBaseMessage frag = makeFragment(1L); + + dut.offer(1L, sntl); + + dut.setEOLReached(); + + result = dut.offer(1L, frag); + assertTrue(result); + assertEquals(frag, dut.poll()); + assertEquals(null, dut.poll()); + } }
ENG-<I>: Add a test case for the replay sequencer.
VoltDB_voltdb
train
java
a9a7492d1ca41980149c9b316b225317f2bb120a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ from setuptools import setup, find_packages setup( name='py2cytoscape', - version='0.4.3', + version='0.4.4', description='Tools to use Cytoscape and Cytoscape.js from Python', long_description='Collection of tools for using Cytoscape and ' 'cytoscape.js from Python. From v0.4.0, '
Version number updated for <I> release.
cytoscape_py2cytoscape
train
py
299cb973e5c43d5b87a37a7f30dc26c7cbce04ec
diff --git a/tests/dummy/app/controllers/helpers-documentation/liquid-if.js b/tests/dummy/app/controllers/helpers-documentation/liquid-if.js index <HASH>..<HASH> 100644 --- a/tests/dummy/app/controllers/helpers-documentation/liquid-if.js +++ b/tests/dummy/app/controllers/helpers-documentation/liquid-if.js @@ -1,9 +1,10 @@ import { equal } from '@ember/object/computed'; import Controller from '@ember/controller'; +import { computed } from '@ember/object'; export default Controller.extend({ vehicle: 'bike', - vehicles: Object.freeze(['bike', 'car']), - states: Object.freeze(['', 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT']), + vehicles: computed(function() { return ['bike', 'car']; }), + states: computed(function() { return ['', 'AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT']; }), isBike: equal('vehicle', 'bike') });
fix meta bug on ember-<I> and older
ember-animation_liquid-fire
train
js
c74de66b76e6840b0b3a8ca2e19fa1884e52939a
diff --git a/agent/core/src/main/java/org/jolokia/util/ClassUtil.java b/agent/core/src/main/java/org/jolokia/util/ClassUtil.java index <HASH>..<HASH> 100644 --- a/agent/core/src/main/java/org/jolokia/util/ClassUtil.java +++ b/agent/core/src/main/java/org/jolokia/util/ClassUtil.java @@ -214,7 +214,7 @@ public final class ClassUtil { if (!method.getName().equals(pMethod)) { continue; } - Parameter[] parameters = method.getParameters(); + Class[] parameters = method.getParameterTypes(); if (parametersMatch(parameters, pArgs)) { return method; } @@ -231,7 +231,7 @@ public final class ClassUtil { return argTypes; } - private static boolean parametersMatch(Parameter[] parameters, Object[] pArgs) { + private static boolean parametersMatch(Class[] parameters, Object[] pArgs) { if (parameters.length != pArgs.length) { return false; } @@ -240,7 +240,7 @@ public final class ClassUtil { continue; } Class argClass = pArgs[i].getClass(); - Class paramClass = parameters[i].getType(); + Class paramClass = parameters[i]; if (!paramClass.isAssignableFrom(argClass)) { if (checkForPrimitive(argClass, paramClass)) { continue;
Fix for compiling with Java 6/7 The usage of Parameter, which is only available since Java 8 was changed so that codes compile fine with Java 6 and 7 again.
rhuss_jolokia
train
java
6b9686f2dd771bc4a6321205cc799a50a4c54929
diff --git a/src/babel/transformation/file/plugin-manager.js b/src/babel/transformation/file/plugin-manager.js index <HASH>..<HASH> 100644 --- a/src/babel/transformation/file/plugin-manager.js +++ b/src/babel/transformation/file/plugin-manager.js @@ -68,7 +68,7 @@ export default class PluginManager { if (name) { if (typeof name === "object" && name.transformer) { - ({ plugin: name, position } = name); + ({ transformer: plugin, position } = name); } else if (typeof name !== "string") { // not a string so we'll just assume that it's a direct Transformer instance, if not then // the checks later on will complain
Fix plugin api typo when an object is passed in
babel_babel
train
js
736aaabd9181b81873f776936079e3885434df24
diff --git a/src/Components/TotalsRow.php b/src/Components/TotalsRow.php index <HASH>..<HASH> 100644 --- a/src/Components/TotalsRow.php +++ b/src/Components/TotalsRow.php @@ -51,14 +51,8 @@ class TotalsRow extends ArrayDataRow implements RenderableComponentInterface { $this->template = '*.components.totals'; $this->name = 'totals'; - - $this->field_names = $fieldNames; + $this->setFieldNames($fieldNames); $this->id = 'Totals'; - $this->src = []; - foreach ($this->field_names as $name) { - $this->src[$name] = 0; - } - } protected function provideFields() @@ -182,6 +176,10 @@ class TotalsRow extends ArrayDataRow implements RenderableComponentInterface public function setFieldNames(array $fieldNames) { $this->field_names = $fieldNames; + $this->src = []; + foreach ($this->field_names as $name) { + $this->src[$name] = 0; + } return $this; }
Totals row: bugfixed setting field names using setter
Nayjest_Grids
train
php
1a6d70af8c86ac1c54567b69171730e3239e9d09
diff --git a/openquake/commands/plot.py b/openquake/commands/plot.py index <HASH>..<HASH> 100644 --- a/openquake/commands/plot.py +++ b/openquake/commands/plot.py @@ -695,10 +695,10 @@ def plot_wkt(wkt_string): def plot_csv(fname): """ - Plot a CSV with columns (operation, time1, time2) + Plot a CSV with columns (title, time1, time2) """ df = pandas.read_csv(fname) - operation, col1, col2 = df.columns + title, col1, col2 = df.columns plt = import_plt() vals1 = df[col1].to_numpy() @@ -713,9 +713,8 @@ def plot_csv(fname): ax.bar_label(rects1) ax.bar_label(rects2) - ax.set_title('Time comparison') - ax.set_ylabel('Cumulative seconds') - ax.set_xticks(x, df[operation]) + ax.set_title(title) + ax.set_xticks(x, df[title]) ax.legend() fig.tight_layout()
Improved oq plot [ci skip]
gem_oq-engine
train
py
da33c4f6e2cdaf9307b826b513ce3ef3208fde38
diff --git a/aioice/ice.py b/aioice/ice.py index <HASH>..<HASH> 100644 --- a/aioice/ice.py +++ b/aioice/ice.py @@ -306,7 +306,7 @@ class Connection: """ Gather local candidates. - You **must** call this coroutine calling :meth:`connect`. + You **must** call this coroutine before calling :meth:`connect`. """ if not self._local_candidates_start: self._local_candidates_start = True
Fixes typo in gather_candidates docs
aiortc_aioice
train
py
bc15077ecc4b8242d35787b693541069cff283b7
diff --git a/test/common.js b/test/common.js index <HASH>..<HASH> 100644 --- a/test/common.js +++ b/test/common.js @@ -93,7 +93,8 @@ HTTPClient.prototype.request = function (path, opts, fn) { HTTPClient.prototype.end = function () { var self = this; Object.keys(this.agent.sockets).forEach(function (socket) { - if (self.agent.sockets[socket].length > 0) { + if (self.agent.sockets[socket].length > 0 && + self.agent.sockets[socket][0]._handle) { self.agent.sockets[socket][0]._handle.socket.end(); } });
further checks to not close sockets that aren't there
socketio_socket.io
train
js
44d4cd9b048a9b0079404b3ea143593474534c1d
diff --git a/lib/dill/matchers.rb b/lib/dill/matchers.rb index <HASH>..<HASH> 100644 --- a/lib/dill/matchers.rb +++ b/lib/dill/matchers.rb @@ -1,11 +1,19 @@ require 'rspec/matchers' RSpec::Matchers.define :see do |widget_name, *args| - match do |role| + match_for_should do |role| begin eventually { role.see?(widget_name, *args) } rescue Dill::Checkpoint::ConditionNotMet false end end + + match_for_should_not do |role| + begin + eventually { ! role.see?(widget_name, *args) } + rescue Dill::Checkpoint::ConditionNotMet + false + end + end end
[matchers] Implement waiting for negative #see.
mojotech_capybara-ui
train
rb
a4e81597dc82189c53dcd900d72093e8b908cf19
diff --git a/docs/js/drag-drop.js b/docs/js/drag-drop.js index <HASH>..<HASH> 100644 --- a/docs/js/drag-drop.js +++ b/docs/js/drag-drop.js @@ -38,10 +38,12 @@ var importedNode = document.importNode(templateNode.content, true) var fileNode = importedNode.querySelector('.dropped-files__file') var nameNode = importedNode.querySelector('.dropped-files__file__name') + var downloadNode = importedNode.querySelector('.dropped-files__file__action--save') var reader fileNode.classList.add('dropped-files__file--' + optimizationId) nameNode.innerText = file.name + downloadNode.download = file.name.replace(/\.css$/, '.min.css') if (file.type == 'text/css') { reader = new FileReader()
See #<I> - properly sets name of optimized file.
jakubpawlowicz_clean-css
train
js
95e933b36cfcd0c520d3d0bebd2d2d57d4a2b8e3
diff --git a/src/main/java/skadistats/clarity/model/FieldPath.java b/src/main/java/skadistats/clarity/model/FieldPath.java index <HASH>..<HASH> 100644 --- a/src/main/java/skadistats/clarity/model/FieldPath.java +++ b/src/main/java/skadistats/clarity/model/FieldPath.java @@ -42,7 +42,7 @@ public class FieldPath { if (o == null || getClass() != o.getClass()) return false; FieldPath fieldPath = (FieldPath) o; if (last != fieldPath.last) return false; - for (int i = 0; i < last; i++) { + for (int i = 0; i <= last; i++) { if (path[i] != fieldPath.path[i]) { return false; } @@ -53,7 +53,7 @@ public class FieldPath { @Override public int hashCode() { int result = 1; - for (int i = 0; i < last; i++) { + for (int i = 0; i <= last; i++) { result = 31 * result + path[i]; } return result;
fix hashcode and equals for fieldpaths
skadistats_clarity
train
java
80fb0804708acb77ea4b22191b702ee3a633c7bf
diff --git a/lib/UvReactor.php b/lib/UvReactor.php index <HASH>..<HASH> 100644 --- a/lib/UvReactor.php +++ b/lib/UvReactor.php @@ -427,6 +427,8 @@ class UvReactor implements SignalReactor { @uv_timer_stop($watcher->uvHandle); break; } + } elseif ($watcher->type == Watcher::IO_READER || $watcher->type == Watcher::IO_WRITER) { + $this->clearPollFromWatcher($watcher); } if (PHP_MAJOR_VERSION < 7) {
I/O watchers must be always cleared, even if disabled Not clearing I/O watcher lead to a leftover disabled watcher, so that streamIdPollMap still contains a disabled watcher with the flag. Which may lead to a new watcher of same type not triggering an uv_poll_start().
amphp_amp
train
php
e80ad164d03eba2bdffaf5434d6e2254a6716a65
diff --git a/src/network.js b/src/network.js index <HASH>..<HASH> 100644 --- a/src/network.js +++ b/src/network.js @@ -163,6 +163,7 @@ module.exports = class NetworkWrapper { if (err) return next(response) // then we can rebuffer the request loggerHttp(`Re-buffering call to ${httpOpts.url} since authenticated now`) + httpOpts.headers.Authorization = `Bearer ${this.tokens.access_token}` return this._axios.request(httpOpts).then(successNext).catch(next) }) })
fix: replay request on access token expires The HTTP headers were not updated with the new access_token when replaying the request, so the request failed again.
keymetrics_pm2-io-js-api
train
js
d209c1033d3bb4dd8a3a1c0069aa8c01f78be48d
diff --git a/lib/cli/generate.js b/lib/cli/generate.js index <HASH>..<HASH> 100644 --- a/lib/cli/generate.js +++ b/lib/cli/generate.js @@ -83,7 +83,7 @@ extend.console.register('generate', 'Generate static files', function(args){ }); }, // Load cache - cache: function(next){ + cache: ['check', function(next){ if (ignoreTheme && publicExist){ var cachePath = baseDir + '.cache'; @@ -100,7 +100,7 @@ extend.console.register('generate', 'Generate static files', function(args){ } else { next(); } - }, + }], // Install theme assets & Load theme layout install: ['check', 'cache', function(next, results){ if (ignoreTheme && publicExist){
check if public folder exists before loading cache
hexojs_hexo
train
js
482cc750ce083b6882d3cac7e90091eccb1535f6
diff --git a/test/seahorse/client/http/header_hash_test.rb b/test/seahorse/client/http/header_hash_test.rb index <HASH>..<HASH> 100644 --- a/test/seahorse/client/http/header_hash_test.rb +++ b/test/seahorse/client/http/header_hash_test.rb @@ -34,10 +34,21 @@ module Seahorse hash[:key].must_equal('value') end - it 'can be converted to a regular hash' do - hash.to_hash.must_equal({}) + describe '#to_hash' do + + it 'returns a regular hash' do + hash[:abc] = 'xyz' + hash.to_hash.must_equal({ 'abc' => 'xyz' }) + end + + it 'is aliased as #to_h' do + hash[:abc] = 'xyz' + hash.to_h.must_equal({ 'abc' => 'xyz' }) + end + end + end end end
Expanded HeaderHash#to_hash tests.
aws_aws-sdk-ruby
train
rb
62a996930e552b9d0076078b68e57347749593c0
diff --git a/tests/integration/nupic/opf/hotgym_regression_test.py b/tests/integration/nupic/opf/hotgym_regression_test.py index <HASH>..<HASH> 100644 --- a/tests/integration/nupic/opf/hotgym_regression_test.py +++ b/tests/integration/nupic/opf/hotgym_regression_test.py @@ -41,11 +41,9 @@ class HotgymRegressionTest(unittest.TestCase): def testHotgymRegression(self): - experimentDir = pkg_resources.resource_filename( - "nupic", - os.path.join(os.pardir, os.pardir, "examples", "opf", "experiments", - "multistep", "hotgym") - ) + experimentDir = os.path.join( + os.path.dirname(__file__).partition("tests/integration/nupic/opf")[0], + "examples", "opf", "experiments", "multistep", "hotgym") resultsDir = os.path.join(experimentDir, "inference") savedModelsDir = os.path.join(experimentDir, "savedmodels")
Calculate experimentDir as relative to __file__
numenta_nupic
train
py
2486929d02ab756d2db229260a9bb2bdbbf87aa7
diff --git a/src/Compressor/HtmlCompressor.php b/src/Compressor/HtmlCompressor.php index <HASH>..<HASH> 100644 --- a/src/Compressor/HtmlCompressor.php +++ b/src/Compressor/HtmlCompressor.php @@ -22,8 +22,8 @@ class HtmlCompressor extends Compressor */ protected function execute($string) { - // Replace newlines, returns and tabs with nothing - $string = str_replace(["\r", "\n", "\t"], '', $string); + // Replace newlines, returns and tabs with spaces + $string = str_replace(["\r", "\n", "\t"], ' ', $string); // Replace multiple spaces with a single space $string = preg_replace('/(\s+)/m', ' ', $string);
Condense \r, \n and \t down to spaces
WyriHaximus_HtmlCompress
train
php
05c94ea7681a763cf17f57a11a0b50948b98f824
diff --git a/sos/report/plugins/ceph.py b/sos/report/plugins/ceph.py index <HASH>..<HASH> 100644 --- a/sos/report/plugins/ceph.py +++ b/sos/report/plugins/ceph.py @@ -108,6 +108,7 @@ class Ceph(Plugin, RedHatPlugin, UbuntuPlugin): "fs dump", "pg dump", "pg stat", + "time-sync-status", ] self.add_cmd_output([
[ceph] include time-sync-status for ceph mon Ceph mons might get into time sync problems if ntp/chrony isn't installed or configured correctly. Since Luminous release, upstream support 'time-sync-status' to detect this more easily. Closes: #<I> Resolves: #<I>
sosreport_sos
train
py
f1ea1ca151e5812c9f92ee0aaf98c96904ee5063
diff --git a/sqlauth/__init__.py b/sqlauth/__init__.py index <HASH>..<HASH> 100644 --- a/sqlauth/__init__.py +++ b/sqlauth/__init__.py @@ -16,4 +16,4 @@ ## ############################################################################### -__version__ = "0.1.237" +__version__ = "0.1.238" diff --git a/sqlauth/twisted/sessiondb.py b/sqlauth/twisted/sessiondb.py index <HASH>..<HASH> 100644 --- a/sqlauth/twisted/sessiondb.py +++ b/sqlauth/twisted/sessiondb.py @@ -119,10 +119,10 @@ class SessionDb(object): return - def get(self, sessionid): - log.msg("SessionDb.get({})".format(sessionid)) - ## we return a deferred to simulate an asynchronous lookup - return self._sessiondb.get(sessionid, {}) + #def get(self, sessionid): + # log.msg("SessionDb.get({})".format(sessionid)) + # ## we return a deferred to simulate an asynchronous lookup + # return self._sessiondb.get(sessionid, {}) # # build an array of live sessions
sync with pypi version: <I>
lgfausak_sqlauth
train
py,py
9e4cce5583fdb8346cf35eeb3d7769127d6530e1
diff --git a/kite/kontrol.go b/kite/kontrol.go index <HASH>..<HASH> 100644 --- a/kite/kontrol.go +++ b/kite/kontrol.go @@ -11,7 +11,7 @@ import ( // Kontrol embeds RemoteKite which has additional special helper methods. type Kontrol struct { - RemoteKite + *RemoteKite // used for synchronizing methods that needs to be called after // successful connection. @@ -50,7 +50,7 @@ func (k *Kite) NewKontrol(addr string) *Kontrol { remoteKite.OnDisconnect(func() { k.Log.Warning("Disconnected from Kontrol. I will retry in background...") }) return &Kontrol{ - RemoteKite: *remoteKite, + RemoteKite: remoteKite, ready: ready, } }
kite: fix reconnect to kontrol bug
koding_kite
train
go
9cd0701aae957601ad896b6a6423e7f6f50e433b
diff --git a/astropy_helpers/setup_helpers.py b/astropy_helpers/setup_helpers.py index <HASH>..<HASH> 100644 --- a/astropy_helpers/setup_helpers.py +++ b/astropy_helpers/setup_helpers.py @@ -493,8 +493,10 @@ def generate_build_ext_command(packagename, release): if self.extensions: src_path = os.path.relpath( os.path.join(os.path.dirname(__file__), 'src')) + shutil.copy2(os.path.join(src_path, 'compiler.c'), + os.path.join(self.package_name, '_compiler.c')) ext = Extension(self.package_name + '._compiler', - [os.path.join(src_path, 'compiler.c')]) + [os.path.join(self.package_name, '_compiler.c')]) self.extensions.insert(0, ext) def run(self):
Copy the _compiler.c file to the package
astropy_astropy-helpers
train
py
5c9d2d07c9be67e75520a5ddfba477fba9ae8a60
diff --git a/fleece/connexion.py b/fleece/connexion.py index <HASH>..<HASH> 100644 --- a/fleece/connexion.py +++ b/fleece/connexion.py @@ -38,14 +38,14 @@ class FleeceApp(connexion.App): If `logger` is None, a default logger object will be created. """ - super(FleeceApp, self).__init__(*args, **kwargs) - logger = kwargs.pop('logger', None) if logger is None: self.logger = fleece.log.get_logger(__name__) else: self.logger = logger + super(FleeceApp, self).__init__(*args, **kwargs) + def call_api(self, event): """Make a request against the API defined by this app.
FleeceApp: don't pass `logger` kwarg to super constructor If you specify an explicit `logger` kwarg, the call to the super constructor (connexion.App) will blow up.
rackerlabs_fleece
train
py
caee2b20df80a33636cfe4d74c6503a17f09579d
diff --git a/lib/metadata/VmConfig/VmConfig.rb b/lib/metadata/VmConfig/VmConfig.rb index <HASH>..<HASH> 100644 --- a/lib/metadata/VmConfig/VmConfig.rb +++ b/lib/metadata/VmConfig/VmConfig.rb @@ -400,7 +400,7 @@ class VmConfig ems_display_text = "host(#{ems_host['use_vim_broker'] ? 'via broker' : 'directly'}):#{ems_host['host']}" $log.info "#{conn_reason}: Connecting to [#{ems_display_text}] for VM:[#{vmCfgFile}]" - require 'miq_fault_tolerant_vim' + require 'VMwareWebService/miq_fault_tolerant_vim' password_decrypt = MiqPassword.decrypt(ems_host['password']) hostVim = MiqFaultTolerantVim.new(:ip => ems_host['host'], :user => ems_host['user'], :pass => password_decrypt, :use_broker => ems_host['use_vim_broker'], :vim_broker_drb_port => ems_host['vim_broker_drb_port'])
Move MiqFaultTolerantVim to VMwareWebService (transferred from ManageIQ/manageiq-gems-pending@b<I>f7c<I>ddc3b9b2c<I>d<I>ec<I>b<I>f2)
ManageIQ_manageiq-smartstate
train
rb
cb1e96f9360f8017693cba3c2f07c1d1c703867b
diff --git a/library/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java b/library/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java index <HASH>..<HASH> 100644 --- a/library/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java +++ b/library/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java @@ -27,10 +27,12 @@ public abstract class NineViewGroup extends ViewGroup { //Fix for: // https://github.com/JakeWharton/ActionBarSherlock/issues/209 // https://github.com/JakeWharton/ActionBarSherlock/issues/246 - if (visibility == GONE) { - clearAnimation(); - } else if (visibility == VISIBLE && mProxy != null) { - setAnimation(mProxy); + if (mProxy != null) { + if (visibility == GONE) { + clearAnimation(); + } else if (visibility == VISIBLE) { + setAnimation(mProxy); + } } super.setVisibility(visibility); }
Save a method class if we are native.
JakeWharton_ActionBarSherlock
train
java
b564718a43eb5667e25ef9b14297a1e35a435f1f
diff --git a/examples/opengl3.go b/examples/opengl3.go index <HASH>..<HASH> 100644 --- a/examples/opengl3.go +++ b/examples/opengl3.go @@ -58,13 +58,17 @@ func main() { var context sdl.GLContext var event sdl.Event var running bool + var err error runtime.LockOSThread() if 0 != sdl.Init(sdl.INIT_EVERYTHING) { panic(sdl.GetError()) } - window = sdl.CreateWindow(winTitle, sdl.WINDOWPOS_UNDEFINED, + window, err = sdl.CreateWindow(winTitle, sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED, winWidth, winHeight, sdl.WINDOW_OPENGL) + if err != nil { + panic(err) + } if window == nil { panic(sdl.GetError()) }
Update CreateWindow to capture and report errors correctly
veandco_go-sdl2
train
go
88d5c20c079774781095bcc9fd9a0534604d47a5
diff --git a/src/array.js b/src/array.js index <HASH>..<HASH> 100644 --- a/src/array.js +++ b/src/array.js @@ -16,6 +16,14 @@ export const flatten = (arr) => arr.reduce((acc, el) => acc.concat(el), []) // +// Alias for "first". +// +export const head = first + + + + +// // Return last element of the given array. // export const last = (arr) => arr[arr.length-1] @@ -120,3 +128,11 @@ export const sparse = (...args) => { return Object.values(hash).sort((a, b) => a - b) } + + + + +// +// Returns array without its head (first element). +// +export const tail = (arr) => arr.slice(1)
array: head() and tail() introduced.
drmats_js-toolbox
train
js
5edbc1fd2034f79e41638d8e67324c7d357002d6
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index <HASH>..<HASH> 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -1130,6 +1130,9 @@ module ActionView # text_field(:post, :title, class: "create_input") # # => <input type="text" id="post_title" name="post[title]" value="#{@post.title}" class="create_input" /> # + # text_field(:post, :title, maxlength: 30, class: "title_input") + # # => <input type="text" id="post_title" name="post[title]" maxlength="30" size="30" value="#{@post.title}" class="title_input" /> + # # text_field(:session, :user, onchange: "if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }") # # => <input type="text" id="session_user" name="session[user]" value="#{@session.user}" onchange="if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }"/> #
Added maxlength example to text_field documentation The usage of maxlength in the text_field helper adds a size attribute to the generated text_field input with the same value as the maxlength. This implicit addition of size attribute by the method gives a false impression that it may be bug. By adding the implementation of the maxlength to the api docs, we explicitly tell the reader referring the api doc that addition of size along with maxlength is the expected behaviour. [ci skip]
rails_rails
train
rb
2fd55f84b60efab06ca22813af27b7bbdfe6d42b
diff --git a/lib/gir_ffi/builders/constructor_builder.rb b/lib/gir_ffi/builders/constructor_builder.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/builders/constructor_builder.rb +++ b/lib/gir_ffi/builders/constructor_builder.rb @@ -7,6 +7,7 @@ module GirFFI module Builders # Implements the creation of a Ruby constructor definition out of a # GIR IFunctionInfo. + # TODO: Derive from BaseMethodBuilder class ConstructorBuilder def initialize(info) @info = info diff --git a/lib/gir_ffi/builders/field_builder.rb b/lib/gir_ffi/builders/field_builder.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/builders/field_builder.rb +++ b/lib/gir_ffi/builders/field_builder.rb @@ -125,6 +125,7 @@ module GirFFI end # Builder for field getters + # TODO: Derive from BaseMethodBuilder class GetterBuilder def initialize(info) @info = info
Mark remaining builders as needing to be updated
mvz_gir_ffi
train
rb,rb
347db79979139be81e1d9989515640d59fb990d1
diff --git a/telethon/client/updates.py b/telethon/client/updates.py index <HASH>..<HASH> 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -16,6 +16,8 @@ class UpdateMethods(UserMethods): try: await self.disconnected except KeyboardInterrupt: + pass + finally: await self.disconnect() def run_until_disconnected(self): @@ -33,6 +35,8 @@ class UpdateMethods(UserMethods): try: return self.loop.run_until_complete(self.disconnected) except KeyboardInterrupt: + pass + finally: self.loop.run_until_complete(self.disconnect()) def on(self, event):
run_until_disconnected() should disconnect() on finally
LonamiWebs_Telethon
train
py
4ffc695e299f841650e5647141e68b3c2201e864
diff --git a/spec/adhearsion/cli_spec.rb b/spec/adhearsion/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/adhearsion/cli_spec.rb +++ b/spec/adhearsion/cli_spec.rb @@ -153,7 +153,6 @@ describe Adhearsion::CLI::AhnCommand do the_following_code { tmp_path = new_tmp_dir simulate_args "create", tmp_path - RubiGen::Base.default_options.merge! :quiet => true # capture_stdout { Adhearsion::CLI::AhnCommand.execute! } execute_ahn_command }.should_not raise_error diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,7 +19,6 @@ end bundler/setup flexmock/rspec active_support - rubigen stringio countdownlatch adhearsion
[BUGFIX] Remove some leftover references to rubigen
adhearsion_adhearsion
train
rb,rb
aa8a3ee08e0af40a0409fe287a9b3a7a51fa46d3
diff --git a/lib/eachSeries.js b/lib/eachSeries.js index <HASH>..<HASH> 100644 --- a/lib/eachSeries.js +++ b/lib/eachSeries.js @@ -4,6 +4,9 @@ import awaitify from './internal/awaitify' /** * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + * @name eachSeries * @static * @memberOf module:Collections
Fixes #<I> (#<I>)
caolan_async
train
js
dcce7a12960f9a7f8016d4a746566c36db8a7fdb
diff --git a/aa_composer.js b/aa_composer.js index <HASH>..<HASH> 100644 --- a/aa_composer.js +++ b/aa_composer.js @@ -104,8 +104,10 @@ function handlePrimaryAATrigger(mci, unit, address, arrDefinition, arrPostedUnit let assocBalances = {}; for (let { aa_address, balances } of arrResponses) assocBalances[aa_address] = balances; // overwrite if repeated - for (let r of arrResponses) + for (let r of arrResponses) { r.balances = assocBalances[r.aa_address]; + r.allBalances = assocBalances; + } } arrResponses.forEach(function (objAAResponse) { if (objAAResponse.objResponseUnit)
include the balances of all affected AAs in all responses
byteball_ocore
train
js
09beae7fc2cc95507ae474e04a5c777eee5ac4b8
diff --git a/lib/rest-core.rb b/lib/rest-core.rb index <HASH>..<HASH> 100644 --- a/lib/rest-core.rb +++ b/lib/rest-core.rb @@ -53,3 +53,5 @@ module RestCore autoload :Linkedin , 'rest-core/client/linkedin' autoload :Facebook , 'rest-core/client/facebook' end + +RC = RestCore unless Object.const_defined?(:RC)
rest-core.rb: provide a shorthand RC for RestCore as EM
godfat_rest-core
train
rb
f1840b3e4de00a7812f7c3d46a48e713951ad7d2
diff --git a/src/amsterdam.py b/src/amsterdam.py index <HASH>..<HASH> 100755 --- a/src/amsterdam.py +++ b/src/amsterdam.py @@ -26,7 +26,7 @@ from string import Template from OpenSSL import crypto from socket import gethostname -AMSTERDAM_VERSION = "0.7" +AMSTERDAM_VERSION = "0.8" class AmsterdamException(Exception): """
Set release number to <I>
StamusNetworks_Amsterdam
train
py
c722b4601f885605d660c5ef571abca8dde8a7d7
diff --git a/packages/blueprint/lib/index.js b/packages/blueprint/lib/index.js index <HASH>..<HASH> 100644 --- a/packages/blueprint/lib/index.js +++ b/packages/blueprint/lib/index.js @@ -11,12 +11,8 @@ exports.BaseController = BaseController; exports.ApplicationModule = ApplicationModule; exports.Messaging = Messaging; -// Make sure Blueprint has been initialized in the main module. -if (!process.mainModule.blueprint) - process.mainModule.blueprint = {}; - function theApp () { - return process.mainModule.blueprint.app; + return process.mainModule.blueprint; } function verifyInitialized () {
theApp() method do not return the global application
onehilltech_blueprint
train
js
0b1725a512e25f93fa8f31fa1030b93b0846f28b
diff --git a/spec/custom_requirer_spec.rb b/spec/custom_requirer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/custom_requirer_spec.rb +++ b/spec/custom_requirer_spec.rb @@ -182,7 +182,7 @@ module DeepCover $LOADED_FEATURES[0..-1] = tmp_loaded_features end - shared_examples 'resolve_path' do |method_name:, default_extension: nil| + shared_examples '#load & #require' do |method_name:, default_extension: nil| let(:execute_method_name) { method_name } define_method :with_extension do |path| @@ -350,7 +350,8 @@ module DeepCover end describe '#load' do - it_behaves_like 'resolve_path', method_name: :load, default_extension: '.rb' + include_examples '#load & #require', method_name: :load, default_extension: '.rb' + it 'fallbacks to checking relative to current work dir' do file_tree %w(one/test.rb) @@ -385,7 +386,7 @@ module DeepCover end describe '#require' do - it_behaves_like 'resolve_path', method_name: :require + include_examples '#load & #require', method_name: :require it "doesn't execute a file that was already required" do file_tree %w(one/test.rb
it_behaves_like -> include_examples and better name for the group
deep-cover_deep-cover
train
rb
ff0c078e5a1f60495165f4f68e4cb3c87553edd0
diff --git a/framework/core/src/Core/CoreServiceProvider.php b/framework/core/src/Core/CoreServiceProvider.php index <HASH>..<HASH> 100644 --- a/framework/core/src/Core/CoreServiceProvider.php +++ b/framework/core/src/Core/CoreServiceProvider.php @@ -247,5 +247,12 @@ class CoreServiceProvider extends ServiceProvider // @todo add limitations to time etc. according to a config setting } }); + + Discussion::allow('delete', function ($discussion, $user) { + if ($discussion->start_user_id == $user->id && $discussion->participants_count == 1) { + return true; + // @todo add limitations to time etc. according to a config setting + } + }); } }
Give author permission to delete discussion if there are no replies Forgot to commit this part in <I>f<I>ce3edfa<I>d0f<I>c<I>f6d<I>cdc :3
flarum_core
train
php
2f570c6b3a7927e1ae95e94f0fa13921e6eed8a3
diff --git a/BimServer/src/org/bimserver/database/actions/DownloadByNewJsonQueryDatabaseAction.java b/BimServer/src/org/bimserver/database/actions/DownloadByNewJsonQueryDatabaseAction.java index <HASH>..<HASH> 100644 --- a/BimServer/src/org/bimserver/database/actions/DownloadByNewJsonQueryDatabaseAction.java +++ b/BimServer/src/org/bimserver/database/actions/DownloadByNewJsonQueryDatabaseAction.java @@ -168,6 +168,8 @@ public class DownloadByNewJsonQueryDatabaseAction extends AbstractDownloadDataba } else if (r instanceof HashMapWrappedVirtualObject) { HashMapWrappedVirtualObject hashMapWrappedVirtualObject = (HashMapWrappedVirtualObject)r; IdEObject embeddedObject = ifcModel.create(hashMapWrappedVirtualObject.eClass()); + ((IdEObjectImpl)embeddedObject).setOid(-1); + ((IdEObjectImpl)embeddedObject).setPid(revision.getProject().getId()); idEObject.eSet(eReference, embeddedObject); for (EAttribute eAttribute : hashMapWrappedVirtualObject.eClass().getEAllAttributes()) { embeddedObject.eSet(eAttribute, hashMapWrappedVirtualObject.eGet(eAttribute));
Set the pid and also the oid to -1
opensourceBIM_BIMserver
train
java
d6b17977eca1004a5b0f732c3af19a141ee58160
diff --git a/lib/omniauth/strategy.rb b/lib/omniauth/strategy.rb index <HASH>..<HASH> 100644 --- a/lib/omniauth/strategy.rb +++ b/lib/omniauth/strategy.rb @@ -405,7 +405,7 @@ module OmniAuth uri.path = '' uri.query = nil #sometimes the url is actually showing http inside rails because the other layers (like nginx) have handled the ssl termination. - uri.scheme = 'https' if(request.env['HTTP_X_FORWARDED_PROTO'] == 'https') + uri.scheme = 'https' if request.ssl? uri.to_s end end
Rack::Request has an #ssl? method that handles this case. call that rather than reproducing its logic
omniauth_omniauth
train
rb
74b9b9321b1155bfcf0fc72e080f31194d2fdf39
diff --git a/src/includes/bootstrap.php b/src/includes/bootstrap.php index <HASH>..<HASH> 100644 --- a/src/includes/bootstrap.php +++ b/src/includes/bootstrap.php @@ -136,13 +136,17 @@ if(empty($skipWordPressInstall)){ codecept_debug('Installing WordPress in isolated process...'); ob_start(); $isolatedInstallationScript = __DIR__ . '/isolated-install.php'; - system(implode(' ', [ + $resultLine = system(implode(' ', [ WP_PHP_BINARY, escapeshellarg($isolatedInstallationScript), escapeshellarg(base64_encode(serialize($environment))), $multisite, - ])); + ]), $resultCode); codecept_debug("Isolated installation script output: \n\n" . ob_get_clean()); + + if ($resultCode !== 0) { + throw new \Exception($resultLine); + } } }
Allow errors from `isolated-install.php` to throw an exception in the main thread.
lucatume_wp-browser
train
php
79922373cfcbe5e68ad1a3e074f5c2af9f8f8205
diff --git a/plugins/org.eclipse.xtext.xbase/deprecated/org/eclipse/xtext/xbase/scoping/featurecalls/StaticImplicitMethodsFeatureForTypeProvider.java b/plugins/org.eclipse.xtext.xbase/deprecated/org/eclipse/xtext/xbase/scoping/featurecalls/StaticImplicitMethodsFeatureForTypeProvider.java index <HASH>..<HASH> 100644 --- a/plugins/org.eclipse.xtext.xbase/deprecated/org/eclipse/xtext/xbase/scoping/featurecalls/StaticImplicitMethodsFeatureForTypeProvider.java +++ b/plugins/org.eclipse.xtext.xbase/deprecated/org/eclipse/xtext/xbase/scoping/featurecalls/StaticImplicitMethodsFeatureForTypeProvider.java @@ -57,10 +57,12 @@ import com.google.inject.Inject; import com.google.inject.Singleton; /** + * use {@link org.eclipse.xtext.xbase.scoping.batch.ImplicitlyImportedTypes} instead. + * * @author Sven Efftinge - Initial contribution and API * @author Sebastian Zarnekow */ -@Deprecated +@Deprecated() public class StaticImplicitMethodsFeatureForTypeProvider extends AbstractStaticMethodsFeatureForTypeProvider { @Singleton
added a comment helpful for migrating from other Xtext versions
eclipse_xtext-extras
train
java
a8c6663344af1363a90edb8caefeb1a2f7b05b50
diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js index <HASH>..<HASH> 100644 --- a/webssh/static/js/main.js +++ b/webssh/static/js/main.js @@ -525,7 +525,7 @@ jQuery(function($){ function wrap_object(opts) { var obj = {}; - obj.getItem = obj.get =function(attr) { + obj.getItem = obj.get = function(attr) { return opts[attr] || ''; };
Appended a space to an equal sign
huashengdun_webssh
train
js
8de09f0a81a49a2c64646c4e501613b7012c341c
diff --git a/light_wallet.js b/light_wallet.js index <HASH>..<HASH> 100644 --- a/light_wallet.js +++ b/light_wallet.js @@ -164,7 +164,7 @@ function refreshLightClientHistory(addresses, handle){ ws.bRefreshingHistory = false; if (handle) handle(err); - if (!addresses) + if (!addresses && !err) eventBus.emit('refresh_light_done'); }; if (err)
emit refresh_light_done only after successful refresh
byteball_ocore
train
js
aaea2edab91558692a9316d0e7d77e34676c47d7
diff --git a/src/dataviews/histogram-dataview/histogram-data-model.js b/src/dataviews/histogram-dataview/histogram-data-model.js index <HASH>..<HASH> 100644 --- a/src/dataviews/histogram-dataview/histogram-data-model.js +++ b/src/dataviews/histogram-dataview/histogram-data-model.js @@ -1,4 +1,5 @@ var _ = require('underscore'); +var BackboneCancelSync = require('../../util/backbone-abort-sync'); var Model = require('../../core/model'); /** @@ -32,6 +33,7 @@ module.exports = Model.extend({ }, initialize: function () { + this.sync = BackboneCancelSync.bind(this); this.bind('change:url change:bins', function () { this.fetch(); }, this);
Fixed infinite calls in histogram data model
CartoDB_carto.js
train
js
52235ca0aef031c40116c4668553348b56eeab73
diff --git a/source/helpers/eachProperty.js b/source/helpers/eachProperty.js index <HASH>..<HASH> 100644 --- a/source/helpers/eachProperty.js +++ b/source/helpers/eachProperty.js @@ -2,10 +2,11 @@ define(function(){ 'use strict'; - function eachProperty(value, fn, ctx, args){ - for(var id in value){ + function eachProperty(value, fn, ctx, getEnum){ + var index = 0; + for(var key in value){ if(getEnum || value.hasOwnProperty(key)){ - if(fn.call(ctx || value[id], value[id], id, args) === false){ + if(fn.call(ctx || value[key], value[key], key, index++, value) === false){ break; } }
Update: eachProperty complexiity test
adriancmiranda_Proto
train
js
1380c1cf4d770d4e33b354d4236e88b5016aaecd
diff --git a/tensorflow_probability/python/internal/backend/meta/gen_linear_operators.py b/tensorflow_probability/python/internal/backend/meta/gen_linear_operators.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/internal/backend/meta/gen_linear_operators.py +++ b/tensorflow_probability/python/internal/backend/meta/gen_linear_operators.py @@ -147,6 +147,8 @@ def gen_module(module_name): 'linalg_ops.triangular_solve') code = code.replace('math_ops.cast', '_ops.cast') code = code.replace('math_ops.matmul', '_linalg.matmul') + code = code.replace('ops.convert_to_tensor_v2_with_dispatch(', + 'ops.convert_to_tensor(') code = code.replace('self.dtype.real_dtype', 'dtypes.real_dtype(self.dtype)') code = code.replace('dtype.real_dtype', 'dtypes.real_dtype(dtype)')
For LinOps generation for JAX, rewrite c2t_v2_with_dispatch to c2t . PiperOrigin-RevId: <I>
tensorflow_probability
train
py
dea64fb9b8f1024a00ae6873d2d4c37da01e0a47
diff --git a/fbchat/__init__.py b/fbchat/__init__.py index <HASH>..<HASH> 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -15,7 +15,7 @@ from .client import * __copyright__ = 'Copyright 2015 by Taehoon Kim' -__version__ = '0.5.0' +__version__ = '0.6.0' __license__ = 'BSD' __author__ = 'Taehoon Kim; Moreels Pieter-Jan' __email__ = '[email protected]' diff --git a/fbchat/client.py b/fbchat/client.py index <HASH>..<HASH> 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -728,7 +728,7 @@ class Client(object): log.info("%s said: %s"%(author_name, message)) - def on_friend_request(self, from_id): + def on_friend_request(self, from_id): ''' subclass Client and override this method to add custom behavior on event '''
fix typo and version up for merging multiple PRs
carpedm20_fbchat
train
py,py
4d8679d4ffe1d5368e739f306581cf9124fc9215
diff --git a/src/Components/Host.php b/src/Components/Host.php index <HASH>..<HASH> 100644 --- a/src/Components/Host.php +++ b/src/Components/Host.php @@ -96,11 +96,7 @@ final class Host extends Component implements IpHostInterface * * Domain name regular expression */ - private const REGEXP_DOMAIN_NAME = '/^ - (?<label>[a-z0-9]|[a-z0-9][a-z0-9-]{0,61}[a-z0-9]) - (\.(?&label)){0,126} - \.? - $/ix'; + private const REGEXP_DOMAIN_NAME = '/^(?<label>[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)(\.(?&label)){0,126}\.?$/ix'; /** * @see https://tools.ietf.org/html/rfc3986#section-3.2.2
Symplify domain name regexp readability
thephpleague_uri-components
train
php
aa1a563ab55743af4ad814d9ef4554fa0a557a72
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ setup( "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], keywords="pandas data-science data-analysis python jupyter ipython", long_description=long_description,
chore: add python <I> support
pandas-profiling_pandas-profiling
train
py
8385ce2741ab2a158fba5c08a5d5feccec9da7de
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -70,6 +70,8 @@ Funnel.prototype.handleReadTree = function(inputTreeRoot) { if (this.shouldLinkRoots()) { this._copy(inputPath, this.destPath); } else { + mkdirp.sync(this._tmpDir); + this.processFilters(inputPath); } diff --git a/tests/index.js b/tests/index.js index <HASH>..<HASH> 100644 --- a/tests/index.js +++ b/tests/index.js @@ -178,6 +178,21 @@ describe('broccoli-funnel', function(){ expect(walkSync(outputPath)).to.eql(expected); }); }); + + it('creates its output directory even if no files are matched', function() { + var inputPath = path.join(fixturePath, 'dir1'); + var tree = new Funnel(inputPath, { + exclude: [ /.*/ ] + }); + + builder = new broccoli.Builder(tree); + return builder.build() + .then(function(results) { + var outputPath = results.directory; + + expect(walkSync(outputPath)).to.eql([ ]); + }); + }); }); describe('includeFile', function() {
Ensure output directory is created on every rebuild. When all files are filtered out, it would previously not created the output directory. This causes a number of errors for downstream consumers.
broccolijs_broccoli-funnel
train
js,js
43ee4867fd0588435d50f9b428375285c6b66a22
diff --git a/webapps/ui/cockpit/plugins/base/app/views/processInstance/variableInstancesTab.js b/webapps/ui/cockpit/plugins/base/app/views/processInstance/variableInstancesTab.js index <HASH>..<HASH> 100644 --- a/webapps/ui/cockpit/plugins/base/app/views/processInstance/variableInstancesTab.js +++ b/webapps/ui/cockpit/plugins/base/app/views/processInstance/variableInstancesTab.js @@ -278,7 +278,7 @@ module.exports = function(ngModule) { return variableService .count(countParams) .then(function(response) { - $scope.total = response.count; + $scope.total = response; // get variables objects return variableService .instances(params)
fix(cockpit): show variable count in runtime view
camunda_camunda-bpm-platform
train
js
326acc90c5b09e8f4f254d54b8914fab05c8ceaf
diff --git a/src/Service/CategoryModel.php b/src/Service/CategoryModel.php index <HASH>..<HASH> 100644 --- a/src/Service/CategoryModel.php +++ b/src/Service/CategoryModel.php @@ -5,7 +5,7 @@ namespace Miaoxing\Category\Service; use Miaoxing\Category\Metadata\CategoryTrait; use Miaoxing\Plugin\Model\CastTrait; use Miaoxing\Plugin\Model\GetSetTrait; -use Miaoxing\Plugin\Model\QuickQueryTrait; +use Miaoxing\Plugin\Model\ReqQueryTrait; /** * CategoryModel @@ -14,7 +14,7 @@ class CategoryModel extends Category { use CategoryTrait; use CastTrait; - use QuickQueryTrait; + use ReqQueryTrait; use GetSetTrait; protected $table = 'category';
refactor: quickQuery => reqQuery
miaoxing_category
train
php
1f290c94b8657d914628f4080365158339636050
diff --git a/src/main/java/com/moandjiezana/toml/LiteralStringConverter.java b/src/main/java/com/moandjiezana/toml/LiteralStringConverter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/moandjiezana/toml/LiteralStringConverter.java +++ b/src/main/java/com/moandjiezana/toml/LiteralStringConverter.java @@ -1,8 +1,9 @@ package com.moandjiezana.toml; -import java.util.List; +import static com.moandjiezana.toml.ValueConverterUtils.parse; +import static com.moandjiezana.toml.ValueConverterUtils.parser; -import org.parboiled.Parboiled; +import java.util.List; class LiteralStringConverter implements ValueConverter { @@ -15,8 +16,7 @@ class LiteralStringConverter implements ValueConverter { @Override public Object convert(String s) { - ValueParser parser = Parboiled.createParser(ValueParser.class); - List<String> resultValue = ValueConverterUtils.parse(ValueConverterUtils.parser().LiteralString(), s); + List<String> resultValue = parse(parser().LiteralString(), s); if (resultValue == null) { return ValueConverterUtils.INVALID;
Removed unused variable and added static imports.
mwanji_toml4j
train
java
e006a68b7f386d12e60b56b9a9a69a0f9783bc83
diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -43,7 +43,6 @@ class Configuration implements ConfigurationInterface ->end() ->arrayNode('collectors')->canBeUnset() ->prototype('scalar')->end() - ->isRequired() ->useAttributeAsKey('name') ->end() ->arrayNode('monolog')->canBeUnset() diff --git a/DependencyInjection/LiuggioStatsDClientExtension.php b/DependencyInjection/LiuggioStatsDClientExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/LiuggioStatsDClientExtension.php +++ b/DependencyInjection/LiuggioStatsDClientExtension.php @@ -54,7 +54,7 @@ class LiuggioStatsDClientExtension extends Extension } } // monolog - if ($config['monolog'] && $config['monolog']['enable']) { + if (!empty($config['monolog']) && $config['monolog']['enable']) { $this->loadMonologHandler($config, $container); } // set the debug sender
* Fix notice if monolog is not set * collectors are not required (if enable_collector is false)
liuggio_StatsDClientBundle
train
php,php
5ab443f2d21bc02fd5f7dffda8924967f3ea3aca
diff --git a/api-spec-testing/test_file.rb b/api-spec-testing/test_file.rb index <HASH>..<HASH> 100644 --- a/api-spec-testing/test_file.rb +++ b/api-spec-testing/test_file.rb @@ -229,7 +229,6 @@ module Elasticsearch end def wait_for_cluster_tasks(client) - tasks_filter = ['delete-index', 'remove-data-stream', 'ilm-history'] time = Time.now.to_i count = 0 @@ -239,9 +238,7 @@ module Elasticsearch next if task.empty? LOGGER.debug "Pending cluster task: #{task}" - tasks_filter.map do |filter| - count += 1 if task['source'].include? filter - end + count += 1 end break unless count.positive? && Time.now.to_i < (time + 30) end
[CI] Test Runner: Remove filters in waiting for cluster tasks
elastic_elasticsearch-ruby
train
rb
8412dc1a2bc23c8cd2a13178486402bdd4f28a89
diff --git a/src/rez/vendor/distlib/util.py b/src/rez/vendor/distlib/util.py index <HASH>..<HASH> 100644 --- a/src/rez/vendor/distlib/util.py +++ b/src/rez/vendor/distlib/util.py @@ -215,6 +215,9 @@ def parse_requirement(req): if not ver_remaining or ver_remaining[0] != ',': break ver_remaining = ver_remaining[1:].lstrip() + # Some packages have a trailing comma which would break the matching + if not ver_remaining: + break m = COMPARE_OP.match(ver_remaining) if not m: raise SyntaxError('invalid constraint: %s' % ver_remaining)
Allow trailing comma in Legacy Metadata This fixes rez-pip install for packages that have a trailing comma on version requirements. For example openpyxl will now install properly with this line: > Requires-Python: >=<I>, Worth submitting upstream.
nerdvegas_rez
train
py
325d0e33fbd3125669d78a66a697c252ca72bc78
diff --git a/test/integration/test_slow.py b/test/integration/test_slow.py index <HASH>..<HASH> 100644 --- a/test/integration/test_slow.py +++ b/test/integration/test_slow.py @@ -23,8 +23,8 @@ def test_run_minimal_docker_container(): assert "ansible_minimal_1 exited with code 0" in result.stdout -def test_shipit_minimal_docker_container(): - env = ScriptTestEnvironment() - result = env.run('ansible-container', 'shipit', 'kube', cwd=project_dir('minimal'), expect_error=True) - assert result.returncode == 1 - assert "Role minimal created" in result.stderr +#def test_shipit_minimal_docker_container(): +# env = ScriptTestEnvironment() +# result = env.run('ansible-container', 'shipit', 'kube', cwd=project_dir('minimal'), expect_error=True) +# assert result.returncode == 1 +# assert "Role minimal created" in result.stderr
Disable shipit test for now.
ansible_ansible-container
train
py
556198566b0f381c6e4d878882d67d90dab92021
diff --git a/lib/utils/soap.js b/lib/utils/soap.js index <HASH>..<HASH> 100644 --- a/lib/utils/soap.js +++ b/lib/utils/soap.js @@ -419,7 +419,7 @@ class Soap { if (id && tag && url) { let tags = tag.split(':') // don't need Action tag - xml = '<SubscriptionId s:mustUnderstand="1" s:IsReferenceParameter="1"' + tags[0] + '="' + url + '">' + id + '</SubscriptionId>' + xml = '<SubscriptionId s:mustUnderstand="1" s:IsReferenceParameter="1" ' + tags[0] + '="' + url + '">' + id + '</SubscriptionId>' console.log(xml) } }
Fixes an issue in the XML
hawkeye64_onvif-nvt
train
js
42f77630f85d744e9148505e3c11692d42f68bb3
diff --git a/src/Generator/AbstractTypeGenerator.php b/src/Generator/AbstractTypeGenerator.php index <HASH>..<HASH> 100644 --- a/src/Generator/AbstractTypeGenerator.php +++ b/src/Generator/AbstractTypeGenerator.php @@ -71,7 +71,7 @@ EOF; * @param string $classNamespace The namespace to use for the classes. * @param string[]|string $skeletonDirs */ - public function __construct($classNamespace = self::DEFAULT_CLASS_NAMESPACE, $skeletonDirs = [], $cacheDirMask = 0777) + public function __construct($classNamespace = self::DEFAULT_CLASS_NAMESPACE, $skeletonDirs = [], $cacheDirMask = 0775) { parent::__construct($classNamespace, $skeletonDirs); $this->cacheDirMask = $cacheDirMask;
Update src/Generator/AbstractTypeGenerator.php Let <I> as default mask
overblog_GraphQLBundle
train
php
b2ff3f47445712468cee82b14fb1822e5f87adde
diff --git a/impl-base/src/test/java/org/jboss/arquillian/impl/DynamicServiceLoaderTestCase.java b/impl-base/src/test/java/org/jboss/arquillian/impl/DynamicServiceLoaderTestCase.java index <HASH>..<HASH> 100644 --- a/impl-base/src/test/java/org/jboss/arquillian/impl/DynamicServiceLoaderTestCase.java +++ b/impl-base/src/test/java/org/jboss/arquillian/impl/DynamicServiceLoaderTestCase.java @@ -79,6 +79,20 @@ public class DynamicServiceLoaderTestCase service.getClass()); } + @Test + public void shouldNotReturnDefaultServiceImplIfOtherIsFound() throws Exception + { + Service2 service = new DynamicServiceLoader().onlyOne( + Service2.class, + DefaultService2Impl.class); + + Assert.assertNotNull(service); + Assert.assertEquals( + "Verify that the default provided service class was returned", + Service2Impl.class, + service.getClass()); + } + private void verifyOrder(Collection<Service> services) { int i = 0; @@ -103,6 +117,7 @@ public class DynamicServiceLoaderTestCase public interface Service2 {} public static class Service2Impl implements Service2 {} + public static class DefaultService2Impl implements Service2 {} public interface NonRegisteredService {} public static class DefaultNonRegisteredServiceImpl implements NonRegisteredService {}
ARQ-<I> Add TestCase for not loading provided default implementation if another implementation is found.
arquillian_arquillian-core
train
java
7c2a41ef9391b12cbdc35e70517805c21d396f7e
diff --git a/BimServer/src/org/bimserver/changes/Transaction.java b/BimServer/src/org/bimserver/changes/Transaction.java index <HASH>..<HASH> 100644 --- a/BimServer/src/org/bimserver/changes/Transaction.java +++ b/BimServer/src/org/bimserver/changes/Transaction.java @@ -89,8 +89,10 @@ public class Transaction { return updated.values(); } - public void updated(HashMapVirtualObject object) { - updated.put(object.getOid(), object); + public void updated(HashMapVirtualObject object) { + if (!created.containsKey(object.getOid())) { + updated.put(object.getOid(), object); + } } public void deleted(HashMapVirtualObject object) {
Only add updated objects when they are not already created in the same transaction
opensourceBIM_BIMserver
train
java
cb27e33245a3aee81be36a3c2ac9a639007a1cbb
diff --git a/src/Intahwebz/Router.php b/src/Intahwebz/Router.php index <HASH>..<HASH> 100644 --- a/src/Intahwebz/Router.php +++ b/src/Intahwebz/Router.php @@ -6,13 +6,13 @@ namespace Intahwebz; interface Router { - static function generateCurrentURL($parameters, $absolute = FALSE); + function generateCurrentURL($parameters, $absolute = FALSE); - static function generateURLForRoute($routeName, $parameters = array(), $absolute = FALSE); + function generateURLForRoute($routeName, $parameters = array(), $absolute = FALSE); - static function forward($routeName, $parameters = array(), $absolute = FALSE); + function forward($routeName, $parameters = array(), $absolute = FALSE); - static function forwardToRoute($route, $parameters, $absolute = false); + function forwardToRoute($route, $parameters, $absolute = false); //Todo - probably shouldn't need to pass in the view function reRouteRequest($routeName, $view);
Removed static from calls as they are no longer static.
Danack_intahwebz-core
train
php
604374f5d08d4636ad5ef53765b4d614dd690455
diff --git a/visitors/SmileyVisitor.php b/visitors/SmileyVisitor.php index <HASH>..<HASH> 100644 --- a/visitors/SmileyVisitor.php +++ b/visitors/SmileyVisitor.php @@ -11,8 +11,6 @@ namespace JBBCode\visitors; */ class SmileyVisitor implements \JBBcode\NodeVisitor { - protected $frequencies = array(); - function visitDocumentElement(\JBBCode\DocumentElement $documentElement) { foreach( $documentElement->getChildren() as $child ) { $child->accept($this);
removed unused var in SmileyVisitor
jbowens_jBBCode
train
php
713ab84b26793569e11ff5afa78a2310aaf20786
diff --git a/stream/src/main/java/com/annimon/stream/Stream.java b/stream/src/main/java/com/annimon/stream/Stream.java index <HASH>..<HASH> 100644 --- a/stream/src/main/java/com/annimon/stream/Stream.java +++ b/stream/src/main/java/com/annimon/stream/Stream.java @@ -108,12 +108,12 @@ public class Stream<T> implements Closeable { * otherwise returns a {@code Stream} containing elements of this array. * * @param <T> the type of the stream elements - * @param array the array whose elements to be passed to stream + * @param elements elements to be passed to stream * @return the new stream * @since 1.1.9 */ - public static <T> Stream<T> ofNullable(final T[] array) { - return (array == null) ? Stream.<T>empty() : Stream.of(array); + public static <T> Stream<T> ofNullable(final T... elements) { + return (elements == null) ? Stream.<T>empty() : Stream.of(elements); } /**
Change Stream#onNullable(T[]) to use varargs
aNNiMON_Lightweight-Stream-API
train
java
d949cc81358dbaf45639dd8e93a836509cb8e235
diff --git a/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java b/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java +++ b/src/main/java/org/web3j/codegen/SolidityFunctionWrapperGenerator.java @@ -22,7 +22,7 @@ public class SolidityFunctionWrapperGenerator { private static final String USAGE = "solidity generate " + "<input binary file>.bin <input abi file>.abi " - + "[-p|--package <base package name>] " + + "-p|--package <base package name> " + "-o|--output <destination base directory>"; private String binaryFileLocation;
Correct usage string to specify package as mandatory.
web3j_web3j
train
java
5f70e8d308bf2eaefd2086dcc2cdb1ff40fc6826
diff --git a/tasks/cordova.js b/tasks/cordova.js index <HASH>..<HASH> 100644 --- a/tasks/cordova.js +++ b/tasks/cordova.js @@ -81,7 +81,10 @@ module.exports = function (grunt) { if (error) { grunt.fail.warn(error); } - done(); + + // Adhoc bugfix: + // Do not run ios-simulator at `cordova emulate` + setTimeout(done, 50); }); }); };
Fix bug do not run ios-simulator at `ios-simulator`
GrayBullet_grunt-cordova-ng
train
js
ef857d25ba3ff60ec90d422cdd227a8c19973c9d
diff --git a/ghost/admin/mirage/config.js b/ghost/admin/mirage/config.js index <HASH>..<HASH> 100644 --- a/ghost/admin/mirage/config.js +++ b/ghost/admin/mirage/config.js @@ -51,7 +51,7 @@ export function testConfig() { // this.urlPrefix = ''; // make this `http://localhost:8080`, for example, if your API is on a different server this.namespace = '/ghost/api/v2/admin'; // make this `api`, for example, if your API is namespaced // this.timing = 400; // delay for each request, automatically set to 0 during testing - this.logging = true; + this.logging = false; mockApiKeys(this); mockAuthentication(this);
Disabled mirage logging in tests to fix Travis runs
TryGhost_Ghost
train
js
88c1fed0e846f468b57f68538cb8565974f1a878
diff --git a/src/pybel/grounding.py b/src/pybel/grounding.py index <HASH>..<HASH> 100644 --- a/src/pybel/grounding.py +++ b/src/pybel/grounding.py @@ -149,7 +149,8 @@ def ground_nodelink(graph_nodelink_dict) -> None: for data in tqdm(graph_nodelink_dict['links'], desc='grounding edges in {}'.format(name)): _process_edge_side(data.get(SUBJECT)) _process_edge_side(data.get(OBJECT)) - _process_annotations(data) + if ANNOTATIONS in data: + _process_annotations(data) for node in tqdm(graph_nodelink_dict['nodes'], desc='grounding nodes in {}'.format(name)): _process_node(node) @@ -168,7 +169,7 @@ _UNHANDLED_ANNOTATION = set() def _process_annotations(data, add_free_annotations: bool = False): x = [] y = [] - for prefix, names in data.get(ANNOTATIONS, {}).items(): + for prefix, names in data[ANNOTATIONS].items(): if prefix == 'CellLine': efo_name_to_id = get_name_id_mapping('efo') # clo_name_to_id = get_name_id_mapping('clo') # FIXME implement CLO import
Only ground if there are already annotations
pybel_pybel
train
py
70d57ebc7b7d6f4c1705143c28ec36e43c5a1488
diff --git a/lib/discordrb/gateway.rb b/lib/discordrb/gateway.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/gateway.rb +++ b/lib/discordrb/gateway.rb @@ -129,6 +129,12 @@ module Discordrb # The version of the gateway that's supposed to be used. GATEWAY_VERSION = 6 + # Heartbeat ACKs are Discord's way of verifying on the client side whether the connection is still alive. Setting + # this to true will use that functionality to detect zombie connections and reconnect in such a case, however it may + # lead to instability if there's some problem with the ACKs. + # @return [true, false] whether or not this gateway should check for heartbeat ACKs. + attr_accessor :check_heartbeat_acks + def initialize(bot, token, shard_key = nil) @token = token @bot = bot
Add a setting to Gateway of whether or not to check heartbeat acks
meew0_discordrb
train
rb
7d759138c985474e31cc5470ed11e56a1614aad7
diff --git a/src/python/test/test_dxclient.py b/src/python/test/test_dxclient.py index <HASH>..<HASH> 100755 --- a/src/python/test/test_dxclient.py +++ b/src/python/test/test_dxclient.py @@ -2739,7 +2739,8 @@ def main(): shell.close() self.assertEqual(3, shell.exitstatus) - @unittest.skipUnless(testutil.TEST_ONLY_MASTER, 'skipping test that requires latest server version') + @unittest.skipUnless(testutil.TEST_ONLY_MASTER and testutil.TEST_RUN_JOBS, + "skipping test that requires latest server version and that would run jobs") def test_bundledDepends_name_with_whitespaces(self): # upload a tar.gz file with spaces in its name bundle_name = "test bundle with spaces.tar.gz"
Updated to skip for both TEST_ONLY_MASTER and TEST_RUN_JOBS. Commit# e<I>
dnanexus_dx-toolkit
train
py
7b38412d4959a34c99f3c69e70d7a995fb373f7c
diff --git a/lib/form/yui/dateselector/dateselector.js b/lib/form/yui/dateselector/dateselector.js index <HASH>..<HASH> 100644 --- a/lib/form/yui/dateselector/dateselector.js +++ b/lib/form/yui/dateselector/dateselector.js @@ -222,7 +222,7 @@ YUI.add('moodle-form-dateselector', function(Y) { }, fix_position : function() { if (this.currentowner) { - this.panel.set('constrain', this.currentowner.get('node').ancestor('form')); + this.panel.set('constrain', Y.one(document.body)); this.panel.set('align', { node:this.currentowner.get('node').one('select'), points:[Y.WidgetPositionAlign.BL, Y.WidgetPositionAlign.TL]
MDL-<I> Forms: Date Picker JS popup is not constraint to parent form
moodle_moodle
train
js
8654bcaa28a87c529efa216d601ddc96c7952f8a
diff --git a/app/initializers/ember-cli-mirage.js b/app/initializers/ember-cli-mirage.js index <HASH>..<HASH> 100644 --- a/app/initializers/ember-cli-mirage.js +++ b/app/initializers/ember-cli-mirage.js @@ -13,7 +13,7 @@ import startMirageImpl from 'ember-cli-mirage/start-mirage'; // tests. // export default { - name: 'ember-cli-mirage-config', + name: 'ember-cli-mirage', initialize(application) { if (baseConfig) { application.register('mirage:base-config', baseConfig, { instantiate: false });
Revert initializer name (#<I>) I didn't mean to change this, and it breaks apps that have initializers that reference this one in their `before` or `after` fields.
samselikoff_ember-cli-mirage
train
js
f2f108686841a3f5946523b65baaccb56c3a47f5
diff --git a/python/ray/serve/http_proxy.py b/python/ray/serve/http_proxy.py index <HASH>..<HASH> 100644 --- a/python/ray/serve/http_proxy.py +++ b/python/ray/serve/http_proxy.py @@ -290,6 +290,11 @@ class HTTPProxy: scope, receive, send ) + if route_path == "/-/healthz": + return await starlette.responses.PlainTextResponse("success")( + scope, receive, send + ) + route_prefix, handle = self.prefix_router.match_route(route_path) if route_prefix is None: self.request_error_counter.inc( diff --git a/python/ray/serve/tests/test_http_routes.py b/python/ray/serve/tests/test_http_routes.py index <HASH>..<HASH> 100644 --- a/python/ray/serve/tests/test_http_routes.py +++ b/python/ray/serve/tests/test_http_routes.py @@ -41,6 +41,12 @@ def test_path_validation(serve_instance): D4.options(name="test2").deploy() +def test_routes_healthz(serve_instance): + resp = requests.get("http://localhost:8000/-/healthz") + assert resp.status_code == 200 + assert resp.content == b"success" + + def test_routes_endpoint(serve_instance): @serve.deployment class D1:
[serve] Add healthz endpoint for HttpProxy (#<I>)
ray-project_ray
train
py,py
9ba679a804b3e7736c69ad7809a873fdf4fcb165
diff --git a/UWG/UWG.py b/UWG/UWG.py index <HASH>..<HASH> 100644 --- a/UWG/UWG.py +++ b/UWG/UWG.py @@ -33,7 +33,6 @@ from BEMDef import BEMDef from schdef import SchDef from param import Param from UCMDef import UCMDef - from forcing import Forcing from UBLDef import UBLDef from RSMDef import RSMDef diff --git a/UWG/weather.py b/UWG/weather.py index <HASH>..<HASH> 100644 --- a/UWG/weather.py +++ b/UWG/weather.py @@ -10,11 +10,7 @@ class Weather(object): properties location # location name staTemp % air temperature (C) -<<<<<<< HEAD - staTdp % dry bulb -======= staTdp % dewpoint temperature (C) ->>>>>>> a923c1cef10d46cd50002b5a3994904ab34f528a staRhum % air relative humidity (%) staPres % air pressure (Pa) staInfra % horizontal Infrared Radiation Intensity (W m-2)
Fixing merge mistakes from sync in weather.py
ladybug-tools_uwg
train
py,py
9a7317591e24f266eda4b34a839eca214286119a
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -21,7 +21,8 @@ ko.ifyRoute = koifyRoute; * Wraps a generator or promise-returning callback function */ function ko(fn, isParamHandler) { - if (fn.hasOwnProperty('$$koified')) { + // handlers and middlewares may have safeguard properties to be skipped + if ('$$koified' in fn) { return fn; } @@ -68,7 +69,11 @@ function ko(fn, isParamHandler) { } // safeguard - Object.defineProperty(wrapper, '$$koified', { value: true }); + Object.defineProperty(wrapper, '$$koified', { + configurable: true, + writable: true, + value: true + }); return wrapper; } @@ -200,6 +205,13 @@ function koifyRouter(Router) { return routerPrototype_.param.apply(this, args); }; + // safeguard + Object.defineProperty(routerPrototype, '$$koified', { + configurable: true, + writable: true, + value: false + }); + return Router; }
Enhance $$koified safeguard
ex-machine_express-ko
train
js
d4261935974f86b272eb15b17a6bded8ba78404d
diff --git a/oauth2/heroku.go b/oauth2/heroku.go index <HASH>..<HASH> 100644 --- a/oauth2/heroku.go +++ b/oauth2/heroku.go @@ -7,6 +7,7 @@ import ( "github.com/influxdata/chronograf" "golang.org/x/oauth2" + hrk "golang.org/x/oauth2/heroku" ) // Ensure that Heroku is an oauth2.Provider @@ -29,7 +30,12 @@ type Heroku struct { // Config returns the OAuth2 exchange information and endpoints func (h *Heroku) Config() *oauth2.Config { - return &oauth2.Config{} + return &oauth2.Config{ + ClientID: h.ID(), + ClientSecret: h.Secret(), + Scopes: h.Scopes(), + Endpoint: hrk.Endpoint, + } } // ID returns the Heroku application client ID
Configure Heroku OAuth2 properly This was erroneously left unconfigured during dev.
influxdata_influxdb
train
go
e75ae96cc052002df0d334707e2c37a9309df949
diff --git a/src/DummyAdapter.php b/src/DummyAdapter.php index <HASH>..<HASH> 100644 --- a/src/DummyAdapter.php +++ b/src/DummyAdapter.php @@ -11,11 +11,49 @@ namespace Cache\AdapterBundle; +use Psr\Cache\CacheItemInterface; +use Psr\Cache\CacheItemPoolInterface; + /** * This client is used as a placeholder for the dependency injection. It will never be used. * * @author Tobias Nyholm <[email protected]> */ -class DummyAdapter +class DummyAdapter implements CacheItemPoolInterface { + public function getItem($key) + { + } + + public function getItems(array $keys = array()) + { + } + + public function hasItem($key) + { + } + + public function clear() + { + } + + public function deleteItem($key) + { + } + + public function deleteItems(array $keys) + { + } + + public function save(CacheItemInterface $item) + { + } + + public function saveDeferred(CacheItemInterface $item) + { + } + + public function commit() + { + } }
Make sure DummyAdapter implements CacheItemPoolInterface
php-cache_adapter-bundle
train
php
52b7759330d10138d1c886f09fbc106f64bfe64d
diff --git a/rebulk/__version__.py b/rebulk/__version__.py index <HASH>..<HASH> 100644 --- a/rebulk/__version__.py +++ b/rebulk/__version__.py @@ -4,4 +4,4 @@ Version module """ # pragma: no cover -__version__ = '2.0.1' +__version__ = '2.0.2.dev0'
Back to development: <I>
Toilal_rebulk
train
py
b1d3172a9a2f872966609c08ab9b1a3e07552a05
diff --git a/lib/simple_form/form_builder.rb b/lib/simple_form/form_builder.rb index <HASH>..<HASH> 100644 --- a/lib/simple_form/form_builder.rb +++ b/lib/simple_form/form_builder.rb @@ -450,7 +450,7 @@ module SimpleForm def lookup_model_names #:nodoc: @lookup_model_names ||= begin child_index = options[:child_index] - names = object_name.to_s.scan(/[a-zA-Z_]+\d*/) + names = object_name.to_s.scan(/(?!\d+)(\w+)/).flatten names.delete(child_index) if child_index names.each { |name| name.gsub!('_attributes', '') } names.freeze
using lookahead to skip sections only containing digits
plataformatec_simple_form
train
rb
27c8b31f4dd2d4ce6bede45465d4e8ac242c95cf
diff --git a/command.go b/command.go index <HASH>..<HASH> 100644 --- a/command.go +++ b/command.go @@ -85,10 +85,10 @@ func argsString(args []Arg) string { // Flag defines a flag for a command. // These will be parsed in Go and passed to the Run method in the Context struct. type Flag struct { - Name string `json:"name"` - Char string `json:"char"` - Help string `json:"help"` - HasValue bool `json:"hasValue"` + Name string `json:"name"` + Char string `json:"char"` + Description string `json:"description"` + HasValue bool `json:"hasValue"` } func (f *Flag) String() string { diff --git a/help.go b/help.go index <HASH>..<HASH> 100644 --- a/help.go +++ b/help.go @@ -54,7 +54,7 @@ func printCommandHelp(command *Command) { if len(command.Flags) > 1 { Println() for _, flag := range command.Flags { - Printf("%-20s # %s\n", flag.String(), flag.Help) + Printf("%-20s # %s\n", flag.String(), flag.Description) } Println() }
changed help field to description on flags
heroku_cli
train
go,go
8e3626157b94cb618084b32d9b2c52cadcaec9c6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name="OLCTools", - version="0.3.61", + version="0.3.62", packages=find_packages(), author="Andrew Low", author_email="[email protected]",
Forgot that I could update pypi, too
lowandrew_OLCTools
train
py
cff205b013d7f3acdd57c192e8011546e78daf81
diff --git a/test/main.js b/test/main.js index <HASH>..<HASH> 100644 --- a/test/main.js +++ b/test/main.js @@ -123,7 +123,12 @@ describe('gulp-sass -- async compile', function() { var stream = sass(); stream.on('error', function(err) { + // Error must include message body err.message.indexOf('property "font" must be followed by a \':\'').should.not.equal(-1); + // Error must include file error occurs in + err.message.indexOf('test/scss/error.scss').should.not.equal(-1); + // Error must include line and column error occurs on + err.message.indexOf('2:7').should.not.equal(-1); done(); }); stream.write(errorFile);
Add file name and line:column to error test
dlmanning_gulp-sass
train
js
0631834ad4897b93725d9b4cbe10dda051bb15c9
diff --git a/TOTP.php b/TOTP.php index <HASH>..<HASH> 100644 --- a/TOTP.php +++ b/TOTP.php @@ -108,7 +108,9 @@ class TOTP extends HOTP $valid = false; $offset = null; - for ($current = $counter; $current <= $counter + $window; ++$current) { + $counterLow = max(0, $counter - intval(floor($window / 2))); + $counterHigh = max(0, $counter + intval(ceil($window / 2))); + for ($current = $counterLow; $current <= $counterHigh; ++$current) { if ($otp == parent::calculate($current)) { $valid = true; $offset = $current - $counter;
Better account for clock drift in TOTP::validate() Since some devices may experience clock drift in both directions, and because may not be possible to sync the time on those devices, we need to account for bidirectional clock drift when validating TOTPs. This commit introduces a change which shifts the window parameter to the middle of the expected OTP range, so that a window of 4 will check two counters before and after the current counter value. This deviates from the original behavior of only checking $window counters after the current. Closes #1.
rchouinard_rych-otp
train
php
6aa963954c37627b114779842474488b424c715c
diff --git a/lib/formtastic.rb b/lib/formtastic.rb index <HASH>..<HASH> 100644 --- a/lib/formtastic.rb +++ b/lib/formtastic.rb @@ -15,7 +15,7 @@ module Formtastic autoload :Util # Deprecate support for Rails < 3.2 - if Util.deprecated_version_of_rails? + if defined?(::Rails) && Util.deprecated_version_of_rails? ::ActiveSupport::Deprecation.warn( "Support for Rails < 3.2.13 will be dropped from Formtastic 3.0", caller)
only check for deprecated rails if Rails is defined
justinfrench_formtastic
train
rb
7f5ecfab67450b6066bca2296db15111e08855a7
diff --git a/src/extensions.js b/src/extensions.js index <HASH>..<HASH> 100644 --- a/src/extensions.js +++ b/src/extensions.js @@ -373,7 +373,7 @@ Crafty.extend({ var l = 0; for (i in tweens) { var prop = tweens[i]; - if (prop.remTime >= 0) { + if (prop.remTime > 0) { prop.current += prop.diff; prop.remTime--; Crafty.viewport[i] = Math.floor(prop.current);
It continued for one frame to much, causing the entire movement to be prop.diff to long. Se testcase in tests/stage
craftyjs_Crafty
train
js
20b42afa4e4deb90ddf18e8fd8292310b5720c95
diff --git a/pywb/webapp/views.py b/pywb/webapp/views.py index <HASH>..<HASH> 100644 --- a/pywb/webapp/views.py +++ b/pywb/webapp/views.py @@ -73,6 +73,14 @@ class FileOnlyPackageLoader(PackageLoader): #================================================================= +class RelEnvironment(Environment): + """Override join_path() to enable relative template paths.""" + def join_path(self, template, parent): + print(parent) + return os.path.join(os.path.dirname(parent), template) + + +#================================================================= class J2TemplateView(object): shared_jinja_env = None @@ -94,7 +102,7 @@ class J2TemplateView(object): if overlay_env: jinja_env = overlay_env.overlay(loader=loader, trim_blocks=True) else: - jinja_env = Environment(loader=loader, trim_blocks=True) + jinja_env = RelEnvironment(loader=loader, trim_blocks=True) jinja_env.filters.update(FILTERS) J2TemplateView.shared_jinja_env = jinja_env
jinja2 include: use custom RelEnvironment overriding join_path() to make includes relative to current file, to allow for per-collection includes to be used more easily #<I>
webrecorder_pywb
train
py
fc3df7f05340f450acf172dcf34b7e798c5dd115
diff --git a/omego/artifacts.py b/omego/artifacts.py index <HASH>..<HASH> 100644 --- a/omego/artifacts.py +++ b/omego/artifacts.py @@ -133,6 +133,9 @@ class Artifacts(object): filename = os.path.basename(componenturl) unzipped = filename.replace(".zip", "") + if self.args.dry_run: + return + if os.path.exists(unzipped): return unzipped @@ -196,8 +199,5 @@ class DownloadCommand(Command): log.debug("% 20s => %s" % (dest, replacement)) setattr(args, dest, replacement) - if args.dry_run: - return - artifacts = Artifacts(args) artifacts.download(args.artifact)
--dry-run only stops the final download stage This means its possible to get a better idea of what would happen
ome_omego
train
py
c40dc1d110726193b5a37d5ff0357c16f95fbe67
diff --git a/src/Carbon/Carbon.php b/src/Carbon/Carbon.php index <HASH>..<HASH> 100644 --- a/src/Carbon/Carbon.php +++ b/src/Carbon/Carbon.php @@ -1578,6 +1578,8 @@ class Carbon extends DateTime /** * Determines if the instance is a long year * + * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates + * * @return bool */ public function isLongYear()
Add source for isLongYear() This source helps explain why we've used the <I>th of December to determine if a year is a long year. It is the only day of the year that *always* falls on week <I> or <I> of the year, and not year 1 of the following year. All the other dates in the last week of December will occasionally fall on week <I> or week 1.
briannesbitt_Carbon
train
php
a9f9945d2b9b16f526ae70180d89fc8bd6b0cc30
diff --git a/certipy/certipy.py b/certipy/certipy.py index <HASH>..<HASH> 100644 --- a/certipy/certipy.py +++ b/certipy/certipy.py @@ -263,6 +263,12 @@ class CertStore(): def __init__(self, containing_dir='out', store_file='certipy.json'): self.store = {} self.containing_dir = containing_dir + try: + os.stat(containing_dir) + except FileNotFoundError: + os.makedirs(containing_dir, mode=0o755, exist_ok=True) + finally: + os.chmod(containing_dir, mode=0o755) self.store_file_path = os.path.join(containing_dir, store_file)
Setup the containing directory for the store on init
LLNL_certipy
train
py
ba9d657b89f08bfbcbd316fde127e0a53bc1a00b
diff --git a/plugins/Widgetize/Controller.php b/plugins/Widgetize/Controller.php index <HASH>..<HASH> 100644 --- a/plugins/Widgetize/Controller.php +++ b/plugins/Widgetize/Controller.php @@ -9,6 +9,7 @@ namespace Piwik\Plugins\Widgetize; use Piwik\Access; +use Piwik\API\Request; use Piwik\Common; use Piwik\Container\StaticContainer; use Piwik\FrontController; @@ -31,11 +32,10 @@ class Controller extends \Piwik\Plugin\Controller public function iframe() { + // also called by FrontController, we call it explicitly as a safety measure in case something changes in the future $token_auth = Common::getRequestVar('token_auth', '', 'string'); - - if ($token_auth !== '' - && Access::getInstance()->isUserHasSomeWriteAccess()) { - throw new \Exception(Piwik::translate('Widgetize_ViewAccessRequired')); + if (!empty($token_auth)) { + Request::checkTokenAuthIsNotLimited('Widgetize', 'iframe'); } $this->init();
Use existing Request method w/ correct logic for limiting widgetize access. (#<I>)
matomo-org_matomo
train
php
b23d3a9f37a225eb418967a19c4ddddbf8a76c63
diff --git a/test/plugins.js b/test/plugins.js index <HASH>..<HASH> 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -3,7 +3,6 @@ var path = require('path'); var mock = require('./mock'); var registry = require('../lib/plugins/registry'); var Output = require('../lib/output/base'); -var error = require('../lib/utils/error'); var PluginsManager = require('../lib/plugins'); var BookPlugin = require('../lib/plugins/plugin'); @@ -78,6 +77,28 @@ describe('Plugins', function() { return plugin.load(PLUGINS_ROOT) .should.be.rejectedWith('Error with book\'s configuration: pluginsConfig.test-config.myProperty is required'); }); + + it('should extend configuration with default properties', function() { + return mock.setupBook({ + 'book.json': { + pluginsConfig: { + 'test-config': { + 'myProperty': 'world' + } + } + } + }) + .then(function(book2) { + return book2.config.load() + .then(function() { + var plugin = new BookPlugin(book2, 'test-config'); + return plugin.load(PLUGINS_ROOT); + }) + .then(function() { + book2.config.get('pluginsConfig.test-config.myDefaultProperty', '').should.equal('hello'); + }); + }); + }); }); });
Add test for extension of book's configuration
GitbookIO_gitbook
train
js
0e1f515de65a24821749c380925f48749573c5ce
diff --git a/rundeckapp/web-app/js/executionStateKO.js b/rundeckapp/web-app/js/executionStateKO.js index <HASH>..<HASH> 100644 --- a/rundeckapp/web-app/js/executionStateKO.js +++ b/rundeckapp/web-app/js/executionStateKO.js @@ -517,7 +517,7 @@ function NodeFlowViewModel(workflow,outputUrl){ }else if(since.asWeeks()<1){ return time.format('ddd h:mm a'); }else if(time.year()!=now.year()){ - return time.format('MMM do yyyy'); + return time.format('MMM do YYYY'); }else{ return time.format('M/d ha'); } @@ -552,6 +552,8 @@ function NodeFlowViewModel(workflow,outputUrl){ s++; } valarr.push(s+'s'); + }else if(ms<1000){ + valarr.push('0s'); } return valarr.join(' '); }
Fix formatting: incorrect year format, * fix humanized duration for < <I>ms
rundeck_rundeck
train
js
482a6f716fab5ea6431e15ee2603b62a1b2f0790
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -12,7 +12,7 @@ module ActiveRecord self.attribute_types_cached_by_default = ATTRIBUTE_TYPES_CACHED_BY_DEFAULT # Undefine id so it can be used as an attribute name - undef_method :id + undef_method(:id) if method_defined?(:id) end module ClassMethods
Ruby <I>: Object#id is gone now
rails_rails
train
rb
0e5aa0eebfd7f4b7db04e3ec890027f8ff000745
diff --git a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php @@ -16,6 +16,8 @@ use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Tests; +require_once __DIR__.'/../ClockMock.php'; + class ProgressBarTest extends \PHPUnit_Framework_TestCase { protected function setUp()
Ensure the ClockMock is loaded before using it in the testsuite
symfony_symfony
train
php