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 |
|---|---|---|---|---|---|
5b6ec1b2435a6b0a1d53f742f86f1101d8755c51 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -44,11 +44,12 @@ NotFoundError = function(options) {
RelationshipError = function(options) {
const type = options.type;
const method = options.method;
+ const target = options.target;
this.status = 400;
this.name = `RelationshipError`;
this.title = `Relationship error`;
- this.detail = `You cannot ${method} a ${type} relationship.`;
+ this.detail = `You cannot ${method} a ${type} relationship with a ${target}.`;
}
util.inherits(AdapterError, RestleError); | Add a target option for RelationshipError | dylnslck_restle-error | train | js |
882f9840107be9af6e2379482d72f1f79424c0d2 | diff --git a/packages/crafty-runner-webpack/src/webpack.js b/packages/crafty-runner-webpack/src/webpack.js
index <HASH>..<HASH> 100644
--- a/packages/crafty-runner-webpack/src/webpack.js
+++ b/packages/crafty-runner-webpack/src/webpack.js
@@ -75,7 +75,9 @@ module.exports = function(crafty, bundle, webpackPort) {
const PnpWebpackPlugin = require(`pnp-webpack-plugin`);
chain.resolve
.plugin("pnp-webpack-plugin")
- .init(Plugin => Plugin)
+ // Cloning the plugin exports as this would otherwise
+ // fail with `Cannot redefine property: __pluginArgs`
+ .init(Plugin => ({...Plugin}))
.use(PnpWebpackPlugin);
chain.resolveLoader | Fix pnp issue in webpack with multiple bundles | swissquote_crafty | train | js |
f2969b1eb4adac9ba9550c8b1be4c433f77325d2 | diff --git a/tests/fixture/__init__.py b/tests/fixture/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/fixture/__init__.py
+++ b/tests/fixture/__init__.py
@@ -25,7 +25,7 @@ def start_tangelo():
"--host", host,
"--port", port,
"--root", "tests/web",
- "--plugin-config", "plugin.conf"],
+ "--plugin-config", "venv/share/tangelo/plugin/plugin.conf"],
stderr=subprocess.PIPE)
buf = [] | Fixing bug in tests resulting from deploying plugins into package | Kitware_tangelo | train | py |
52672eab26fdffdd421be7128d6c28c623d43d80 | diff --git a/slick.editors.js b/slick.editors.js
index <HASH>..<HASH> 100644
--- a/slick.editors.js
+++ b/slick.editors.js
@@ -285,12 +285,12 @@
};
this.loadValue = function(item) {
- $input.val((defaultValue = item[args.column.field]) ? "yes" : "no");
- $input.select();
+ $select.val((defaultValue = item[args.column.field]) ? "yes" : "no");
+ $select.select();
};
this.serializeValue = function() {
- return ($input.val() == "yes");
+ return ($select.val() == "yes");
};
this.applyValue = function(item,state) { | - FIXED: corrected variable reference in YesNoSelectCellEditor | coatue-oss_slickgrid2 | train | js |
ca70119ae2239071f0ea881de4b6016cb0e6582a | diff --git a/src/js/components/InfiniteScroll/InfiniteScroll.js b/src/js/components/InfiniteScroll/InfiniteScroll.js
index <HASH>..<HASH> 100644
--- a/src/js/components/InfiniteScroll/InfiniteScroll.js
+++ b/src/js/components/InfiniteScroll/InfiniteScroll.js
@@ -177,6 +177,11 @@ const InfiniteScroll = ({
}
}, 100);
return () => clearTimeout(timer);
+ // Omitting scrollShow as a dependency due to concern that setScrollShow
+ // is being called within the timer. If left included, re-renders and other
+ // dependency values could change in an unpredictable manner during timer
+ // and potentially result in an infinite loop.
+ // eslint-disable-next-line react-hooks/exhaustive-deps
}, [renderPageBounds, show, step]);
// calculate and keep track of page heights | Disabled missing dependency warning to InfiniteScroll useLayoutEffect (#<I>)
* add dependency to useLayoutEffect
* disabling eslint warning and adding documentation | grommet_grommet | train | js |
17da435d01c43dfb099ad00d1c5bea710d5a2379 | diff --git a/src/engine.js b/src/engine.js
index <HASH>..<HASH> 100644
--- a/src/engine.js
+++ b/src/engine.js
@@ -12,7 +12,7 @@ class Mover {
class Health {
start() {
-
+ console.log("Initializing "+this.host.name+" health to max hps");
}
update() {
@@ -57,17 +57,35 @@ class Engine {
start() {
let deltaTime = 1000;
+
+ // call start method to let everything do initialization
+ this.scene.forEach(node => {
+ if(node.start) {
+ node.start();
+ }
+ if(node.components) {
+ node.components.forEach(component => {
+ if(component.start) {
+ component.start();
+ }
+ });
+ }
+ });
+
+ // lock frame rate and update components each frame
setInterval(f => {
console.log("Tick");
this.scene.forEach(node => {
if(node.update) {
node.update(deltaTime);
}
- node.components.forEach(component => {
- if(component.update) {
- component.update(deltaTime);
- }
- })
+ if(node.components) {
+ node.components.forEach(component => {
+ if(component.update) {
+ component.update(deltaTime);
+ }
+ })
+ }
})
}, deltaTime);
} | Added start method call to engine example | davedx_fabricant | train | js |
e0fb4d1da9d22d5aaec1ae85dd002343ebd97339 | diff --git a/build/ci.go b/build/ci.go
index <HASH>..<HASH> 100644
--- a/build/ci.go
+++ b/build/ci.go
@@ -236,6 +236,14 @@ func goToolArch(arch string, subcmd string, args ...string) *exec.Cmd {
gocmd := filepath.Join(runtime.GOROOT(), "bin", "go")
cmd := exec.Command(gocmd, subcmd)
cmd.Args = append(cmd.Args, args...)
+
+ if subcmd == "build" || subcmd == "install" || subcmd == "test" {
+ // Go CGO has a Windows linker error prior to 1.8 (https://github.com/golang/go/issues/8756).
+ // Work around issue by allowing multiple definitions for <1.8 builds.
+ if runtime.GOOS == "windows" && runtime.Version() < "go1.8" {
+ cmd.Args = append(cmd.Args, []string{"-ldflags", "-extldflags -Wl,--allow-multiple-definition"}...)
+ }
+ }
cmd.Env = []string{
"GO15VENDOREXPERIMENT=1",
"GOPATH=" + build.GOPATH(), | build: work around CGO linker bug on pre-<I> Go | ethereum_go-ethereum | train | go |
d09d125b972ce6addd6aa433576488ef6a8c00c2 | diff --git a/lib/service/extract-saz.js b/lib/service/extract-saz.js
index <HASH>..<HASH> 100644
--- a/lib/service/extract-saz.js
+++ b/lib/service/extract-saz.js
@@ -34,7 +34,8 @@ function parseMetaInfo(result) {
if (!req.headers.host) {
req.headers.host = options.host;
}
- port = options.port || (/^https:/i.test(req.url) ? 443 : 80);
+ req.isHttps = /^https:/i.test(req.url);
+ port = options.port || (req.isHttps ? 443 : 80);
req.url = options.path;
} else if (typeof req.headers.host !== 'string') {
req.headers.host = '';
@@ -77,7 +78,7 @@ function parseMetaInfo(result) {
result.url = req.url;
result.isHttps = true;
} else {
- result.url = 'http://' + req.headers.host + req.url;
+ result.url = 'http' + (req.isHttps ? 's' : '') +'://' + req.headers.host + req.url;
if (/\bwebsocket\b/i.test(req.headers.upgrade)) {
result.url = result.url.replace(/^http/, 'ws');
} | fix: import saz file | avwo_whistle | train | js |
1c9327656912cf96683849f92d260546af856adf | diff --git a/lib/perobs/SpaceTree.rb b/lib/perobs/SpaceTree.rb
index <HASH>..<HASH> 100644
--- a/lib/perobs/SpaceTree.rb
+++ b/lib/perobs/SpaceTree.rb
@@ -111,10 +111,12 @@ module PEROBS
if size <= 0
PEROBS.log.fatal "Size (#{size}) must be larger than 0."
end
- if has_space?(address, size)
- PEROBS.log.fatal "The space with address #{address} and size #{size} " +
- "can't be added twice."
- end
+ # The following check is fairly costly and should never trigger unless
+ # there is a bug in the PEROBS code. Only use this for debugging.
+ #if has_space?(address, size)
+ # PEROBS.log.fatal "The space with address #{address} and size " +
+ # "#{size} can't be added twice."
+ #end
root.add_space(address, size)
end | Remove costly but unnecessary check in SpaceTree code. | scrapper_perobs | train | rb |
2b7c927b8266c9dc2f86c4bfe188c912055ab010 | diff --git a/spyder_profiler/widgets/profilergui.py b/spyder_profiler/widgets/profilergui.py
index <HASH>..<HASH> 100644
--- a/spyder_profiler/widgets/profilergui.py
+++ b/spyder_profiler/widgets/profilergui.py
@@ -570,12 +570,10 @@ class ProfilerDataTree(QTreeWidget):
if len(x) == 2 and self.compare_file is not None:
difference = x[0] - x[1]
- if difference < 0:
- diff_str = "".join(['', fmt[1] % self.format_measure(difference)])
- color = "green"
- elif difference > 0:
- diff_str = "".join(['+', fmt[1] % self.format_measure(difference)])
- color = "red"
+ if difference:
+ color, sign = ('green', '-') if difference < 0 else ('red', '+')
+ diff_str = "".join(
+ [sign, fmt[1] % self.format_measure(abs(difference))])
return [fmt[0] % self.format_measure(x[0]), [diff_str, color]]
def format_output(self, child_key): | Issue <I>: Fix negative deltas on profiler | spyder-ide_spyder | train | py |
5bb8865a768f0052d223a50e4ed27f6763a69338 | diff --git a/lib/core/environment.js b/lib/core/environment.js
index <HASH>..<HASH> 100644
--- a/lib/core/environment.js
+++ b/lib/core/environment.js
@@ -57,8 +57,8 @@ exports.getConfig = function (platform, env, project_dir, argv) {
}
// option to configure custom ports
- if (argv.hasOwnProperty('custom_ports')) {
- var c_ports = argv['custom_ports'].split(',').reduce(function (memo, port) {
+ if (argv.hasOwnProperty('custom-ports')) {
+ var c_ports = argv['custom-ports'].split(',').reduce(function (memo, port) {
port = parseInt(port, 10);
if (port > 0) {
memo.push(port);
@@ -138,7 +138,7 @@ exports.getConfig = function (platform, env, project_dir, argv) {
});
}
- if (!process.env.COUCH_URL && !argv.hasOwnProperty('custom_ports')) {
+ if (!process.env.COUCH_URL && !argv.hasOwnProperty('custom-ports')) {
cfg.couch.port = ports.getPort(cfg.id + '-couch');
} | fix(custom-ports): unify on `custom-ports`
* * *
This commit was sponsored by The Hoodie Firm.
You can hire The Hoodie Firm:
<URL> | hoodiehq_hoodie-server | train | js |
e8deb0cebf98c820c84dfc3ed71dac2d91c23d36 | diff --git a/src/Wardrobe/Core/Controllers/AdminController.php b/src/Wardrobe/Core/Controllers/AdminController.php
index <HASH>..<HASH> 100644
--- a/src/Wardrobe/Core/Controllers/AdminController.php
+++ b/src/Wardrobe/Core/Controllers/AdminController.php
@@ -26,7 +26,7 @@ class AdminController extends BaseController {
$this->users = $users;
- $this->beforeFilter('core::wardrobe.auth');
+ $this->beforeFilter('wardrobe.auth');
}
/**
@@ -34,7 +34,7 @@ class AdminController extends BaseController {
*/
public function index()
{
- return View::make('admin.index')
+ return View::make('core::admin.index')
->with('users', $this->users->all())
->with('user', Auth::user())
->with('locale', $this->loadLanguage()); | Try to get the filter/view right | wardrobecms_core-archived | train | php |
d46b791409601b9b2c8c3b963f48ac75e21ea89d | diff --git a/fastTSNE/nearest_neighbors.py b/fastTSNE/nearest_neighbors.py
index <HASH>..<HASH> 100644
--- a/fastTSNE/nearest_neighbors.py
+++ b/fastTSNE/nearest_neighbors.py
@@ -64,7 +64,7 @@ class BallTree(KNNIndex):
self.index.fit(data)
def query_train(self, data, k):
- distances, neighbors = self.index.kneighbors(n_neighbors=k)
+ distances, neighbors = self.index.kneighbors(n_neighbors=k + 1)
return neighbors, distances
def query(self, query, k):
@@ -78,8 +78,7 @@ class VPTree(KNNIndex):
self.index = c_vptree(data)
def query_train(self, data, k):
- data = np.ascontiguousarray(data, dtype=np.float64)
- indices, distances = self.index.query(data, k, num_threads=self.n_jobs)
+ indices, distances = self.index.query_train(k + 1, num_threads=self.n_jobs)
return indices[:, 1:], distances[:, 1:]
def query(self, query, k): | Compute proper number of neighbors in query_train | pavlin-policar_openTSNE | train | py |
92d1ca6dfb3d5082fa07cc6254042f00f269ed92 | diff --git a/src/Message/ExpressPurchaseRequest.php b/src/Message/ExpressPurchaseRequest.php
index <HASH>..<HASH> 100644
--- a/src/Message/ExpressPurchaseRequest.php
+++ b/src/Message/ExpressPurchaseRequest.php
@@ -34,14 +34,25 @@ class ExpressPurchaseRequest extends BasePurchaseRequest
"_input_charset" => $this->getInputCharset(),
"extra_common_param" => $this->getExtraCommonParam(),
"extend_param" => $this->getExtendParam(),
+ "it_b_pay" => $this->getItBPay(),
+ "qr_pay_mode" => $this->getQrPayMode(),
);
- $data = array_filter($data);
+
+ // removes all NULL, FALSE and Empty Strings but leaves 0 (zero) values
+ $data = array_filter($data,'strlen');
$data['sign'] = $this->getParamsSignature($data);
$data['sign_type'] = $this->getSignType();
return $data;
}
+ public function setQrPayMode($value){
+ $this->setParameter('qr_pay_mode', $value);
+ }
+
+ public function getQrPayMode(){
+ return $this->getParameter('qr_pay_mode');
+ }
public function getAntiPhishingKey()
{ | Update ExpressPurchaseRequest.php
add "qr_pay_mode" to Qrcode pay & fix issue: when the value is zero(0) will be removed | lokielse_omnipay-alipay | train | php |
036760bfd4a3d06b534be06bc3a56843ccb84868 | diff --git a/twython/endpoints.py b/twython/endpoints.py
index <HASH>..<HASH> 100644
--- a/twython/endpoints.py
+++ b/twython/endpoints.py
@@ -542,8 +542,8 @@ class EndpointsMixin(object):
"""
return self.get('mutes/users/ids', params=params)
- list_mutes_ids.iter_mode = 'cursor'
- list_mutes_ids.iter_key = 'ids'
+ list_mute_ids.iter_mode = 'cursor'
+ list_mute_ids.iter_key = 'ids'
def create_mute(self, **params):
"""Mutes the specified user, preventing their tweets appearing | Fixed typo with list_mute_ids. | ryanmcgrath_twython | train | py |
06604ba7d889b2c081b48f34886640c5e07d82e6 | diff --git a/types/result_code.go b/types/result_code.go
index <HASH>..<HASH> 100644
--- a/types/result_code.go
+++ b/types/result_code.go
@@ -83,8 +83,8 @@ const (
// Client or server has timed out.
TIMEOUT ResultCode = 9
- // XDS product is not available.
- NO_XDS ResultCode = 10
+ // Operation not allowed in current configuration.
+ ALWAYS_FORBIDDEN ResultCode = 10
// Server is not accepting requests.
SERVER_NOT_AVAILABLE ResultCode = 11
@@ -340,8 +340,8 @@ func ResultCodeToString(resultCode ResultCode) string {
case TIMEOUT:
return "Timeout"
- case NO_XDS:
- return "XDS not available"
+ case ALWAYS_FORBIDDEN:
+ return "Operation not allowed in current configuration."
case SERVER_NOT_AVAILABLE:
return "Server not available" | Rename ResultCode NO_XDS to ALWAYS_FORBIDDEN | aerospike_aerospike-client-go | train | go |
b5ccd00ac224efe9ce898c2869f6d9b3fee3fda3 | diff --git a/samples/python/setup.py b/samples/python/setup.py
index <HASH>..<HASH> 100644
--- a/samples/python/setup.py
+++ b/samples/python/setup.py
@@ -8,5 +8,5 @@ setup(
author='Vyacheslav Gudkov',
author_email='vyacheslav.gudkov@dsr-company.com',
description='This is the sample of usage python wrapper for Hyperledger Indy Crypto.',
- install_requires=['python3-indy_crypto==0.0.1-dev12']
+ install_requires=['python3-indy_crypto==0.0.1-dev14']
) | Updated indy version in sample | hyperledger_indy-crypto | train | py |
cad54d6c31b0e79581787130c27bb90d50e95263 | diff --git a/src/amo-client.js b/src/amo-client.js
index <HASH>..<HASH> 100644
--- a/src/amo-client.js
+++ b/src/amo-client.js
@@ -571,6 +571,9 @@ export class PseudoProgress {
finish() {
this.clearInterval(this.interval);
this.fillBucket();
+ // The bucket has already filled to the terminal width at this point
+ // but for copy/paste purposes, add a new line:
+ this.stdout.write("\n");
}
randomlyFillBucket() { | fix: Added missing new line after download progress bar | mozilla_sign-addon | train | js |
e769781ac489dfd408c2f872b2d60603451fc677 | diff --git a/advanced_filters/__init__.py b/advanced_filters/__init__.py
index <HASH>..<HASH> 100644
--- a/advanced_filters/__init__.py
+++ b/advanced_filters/__init__.py
@@ -1 +1 @@
-__version__ = '1.0.7.1'
+__version__ = '1.1.0' | chore: bump to next minor release <I>
Since we're breaking backward compatiblity, by dropping Python <I> | modlinltd_django-advanced-filters | train | py |
709335f1c2ce507073576ba956d649984dc9f389 | diff --git a/server/const.go b/server/const.go
index <HASH>..<HASH> 100644
--- a/server/const.go
+++ b/server/const.go
@@ -41,7 +41,7 @@ var (
const (
// VERSION is the current version for the server.
- VERSION = "2.2.0-RC.7.3"
+ VERSION = "2.2.0-RC.7.4"
// PROTO is the currently supported protocol.
// 0 was the original | Bump to RC<I> | nats-io_gnatsd | train | go |
41a604025ad1ea23c556baa3943b6b6db4108d9e | diff --git a/tornado/test/process_test.py b/tornado/test/process_test.py
index <HASH>..<HASH> 100644
--- a/tornado/test/process_test.py
+++ b/tornado/test/process_test.py
@@ -235,7 +235,7 @@ class SubprocessTest(AsyncTestCase):
os.kill(subproc.pid, signal.SIGTERM)
try:
- ret = self.wait(timeout=1.0)
+ ret = self.wait()
except AssertionError:
# We failed to get the termination signal. This test is
# occasionally flaky on pypy, so try to get a little more
@@ -246,7 +246,7 @@ class SubprocessTest(AsyncTestCase):
fut = subproc.stdout.read_until_close()
fut.add_done_callback(lambda f: self.stop()) # type: ignore
try:
- self.wait(timeout=1.0)
+ self.wait()
except AssertionError:
raise AssertionError("subprocess failed to terminate")
else: | test: Use default timeouts in sigchild test
The 1s timeout used here has become flaky with the introduction of a
sleep (before the timeout even starts). | tornadoweb_tornado | train | py |
184801db1998f3208b7749316a633242794d6283 | diff --git a/salt/modules/systemd.py b/salt/modules/systemd.py
index <HASH>..<HASH> 100644
--- a/salt/modules/systemd.py
+++ b/salt/modules/systemd.py
@@ -389,7 +389,8 @@ def unmask(name):
'''
if _untracked_custom_unit_found(name) or _unit_file_changed(name):
systemctl_reload()
- return not __salt__['cmd.retcode'](_systemctl_cmd('unmask', name))
+ return not (__salt__['cmd.retcode'](_systemctl_cmd('unmask', name))
+ or __salt__['cmd.retcode'](_systemctl_cmd('unmask --runtime', name)))
def mask(name): | Unmask a runtime masked services too | saltstack_salt | train | py |
17fc508e644092a6702234a7065a393e9b469e6f | diff --git a/src/Engine/MySQL/Quote.php b/src/Engine/MySQL/Quote.php
index <HASH>..<HASH> 100644
--- a/src/Engine/MySQL/Quote.php
+++ b/src/Engine/MySQL/Quote.php
@@ -4,6 +4,7 @@ namespace G4\DataMapper\Engine\MySQL;
use G4\DataMapper\Common\RangeValue;
use G4\DataMapper\Common\SingleValue;
+use G4\DataMapper\Exception\NotAnInstanceException;
class Quote
{
@@ -18,7 +19,7 @@ class Quote
public function __construct($value)
{
if(!($value instanceof SingleValue) && !($value instanceof RangeValue)) {
- throw new \Exception('Something is not right.');
+ throw new NotAnInstanceException('Value should be an instance of SingleValue or RangeValue object.');
}
$this->value = $value; | <I> - Added more specific Exception class. | g4code_data-mapper | train | php |
b8d481108e3f8c34940d15b2c92254875be74174 | diff --git a/src/views/post/_form.php b/src/views/post/_form.php
index <HASH>..<HASH> 100755
--- a/src/views/post/_form.php
+++ b/src/views/post/_form.php
@@ -42,7 +42,6 @@ $this->registerJS($script);
'draggable' => true,
'appendixView' => '/post/appendix.php',
'cropAllowed' => true,
- 'limit' => 2,
]) ?>
<br> | Any pictures can be uploaded for post (change 2 to 0 for Uploader::limit). | sergmoro1_yii2-blog-tools | train | php |
5102d1fc18a0fbda441af1a6c018b31417b18bc5 | diff --git a/admin/index.php b/admin/index.php
index <HASH>..<HASH> 100644
--- a/admin/index.php
+++ b/admin/index.php
@@ -285,7 +285,7 @@
echo '<input type="hidden" name="confirmupgrade" value="1" />';
echo '<input type="hidden" name="confirmrelease" value="1" />';
echo '</div>';
- echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="0" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
+ echo '<div class="continuebutton"><input name="autopilot" id="autopilot" type="checkbox" value="1" /><label for="autopilot">'.get_string('unattendedoperation', 'admin').'</label>';
echo '<br /><br /><input type="submit" value="'.get_string('continue').'" /></div>';
echo '</form>';
} | MDL-<I> unattended upgrade fixed; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
3be35c55956775ce922e8bd46520242a1e5a34b2 | diff --git a/lib/Algo/Methods/InstantRunoff/InstantRunoff.php b/lib/Algo/Methods/InstantRunoff/InstantRunoff.php
index <HASH>..<HASH> 100644
--- a/lib/Algo/Methods/InstantRunoff/InstantRunoff.php
+++ b/lib/Algo/Methods/InstantRunoff/InstantRunoff.php
@@ -124,7 +124,7 @@ class InstantRunoff extends Method implements MethodInterface
if (count($oneRank) !== 1) :
break;
elseif (!in_array($this->_selfElection->getCandidateKey($oneCandidate), $candidateDone, true)) :
- $score[$this->_selfElection->getCandidateKey(reset($oneRank))] += 1;
+ $score[$this->_selfElection->getCandidateKey($oneRank[array_key_first($oneRank)])] += 1;
break 2;
endif;
endforeach; | PHP <I> Optimization: Not use reset for InstantRunoff | julien-boudry_Condorcet | train | php |
ca63134901d0c09b6d33f32f98dadc1c4e8fb4be | diff --git a/src/test/java/org/minimalj/util/CsvReaderTest.java b/src/test/java/org/minimalj/util/CsvReaderTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/minimalj/util/CsvReaderTest.java
+++ b/src/test/java/org/minimalj/util/CsvReaderTest.java
@@ -82,6 +82,12 @@ public class CsvReaderTest {
reader = reader("\"ab\",");
Assert.assertEquals("ab", reader.readEscaped());
+
+ reader = reader("\"a,b\",");
+ Assert.assertEquals("a,b", reader.readEscaped());
+
+ reader = reader("\"a\"\"b\",");
+ Assert.assertEquals("a\"b", reader.readEscaped());
}
@Test | Test escaped separator and escaping character | BrunoEberhard_minimal-j | train | java |
974d74799f4a85c9df1d4e75d4a4d2999e40c5a5 | diff --git a/code/tasks/OrderMigrationTask.php b/code/tasks/OrderMigrationTask.php
index <HASH>..<HASH> 100644
--- a/code/tasks/OrderMigrationTask.php
+++ b/code/tasks/OrderMigrationTask.php
@@ -35,7 +35,7 @@ class OrderMigrationTask extends MigrationTask {
}
}
- $this->log("Updated {$updated} items");
+ $this->log("Updated Delivery Names on {$updated} items");
}
public function log($message) | Add more comprehensive message on delivery firstnames migration class | silvercommerce_checkout | train | php |
019826e44739dedbc68f175cb318f5c14ce19db2 | diff --git a/src/Malenki/Math/Stats/ParametricTest/Anova.php b/src/Malenki/Math/Stats/ParametricTest/Anova.php
index <HASH>..<HASH> 100644
--- a/src/Malenki/Math/Stats/ParametricTest/Anova.php
+++ b/src/Malenki/Math/Stats/ParametricTest/Anova.php
@@ -90,9 +90,9 @@ class Anova implements \Countable
public function withinGroupDegreesOfFreedom()
{
- //TODO: I am not sure…
if(is_null($this->int_wgdof)){
$arr = array();
+
foreach($this->arr_samples as $s){
$arr[] = count($s) - 1;
} | I am sure now, so, I removed TODO | malenkiki_math | train | php |
349131c6386e29a7c727ec05ee1581f60ab275b4 | diff --git a/shared/flex.go b/shared/flex.go
index <HASH>..<HASH> 100644
--- a/shared/flex.go
+++ b/shared/flex.go
@@ -3,7 +3,7 @@
*/
package shared
-var Version = "2.0.0.rc5"
+var Version = "2.0.0.rc6"
var UserAgent = "LXD " + Version
/* | Release LXD <I>.rc6 | lxc_lxd | train | go |
b544a9e50e645e081802b3a37254f3c5a6a0d1da | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -54,6 +54,7 @@ setup(name='httpretty',
tests_require=test_packages(),
install_requires=['urllib3'],
license='MIT',
+ test_suite='nose.collector',
classifiers=["Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Testing"], | Tell setuptools to use nose testsuite
This allows us to run the full test suite (unit and functional) by using
the python setup.py test command. | gabrielfalcao_HTTPretty | train | py |
5b7c57e3ad31c3381a2ccdc26f0eeef9c8d81fdc | diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider.rb
+++ b/lib/puppet/provider.rb
@@ -551,6 +551,11 @@ class Puppet::Provider
"#{@resource}(provider=#{self.class.name})"
end
+ # @return [String] Returns a human readable string with information about the resource and the provider.
+ def inspect
+ to_s
+ end
+
# Makes providers comparable.
include Comparable
# Compares this provider against another provider. | (maint) Implement inspect method on base type provider.
It looks like RSpec was changed to call inspect rather than to_s when
displaying error messages on expected values. This results in
uninformative error messages when a type provider is passed to expect,
such as in:
```
expect(provider).to be_insync(is)
```
This simply adds an `#inspect` method that calls the existing `#to_s`
implementation to restore the expected error messages. | puppetlabs_puppet | train | rb |
b907a71ce9b93690174b0feca91ace5d6ed88274 | diff --git a/lib/arjdbc/mysql/adapter.rb b/lib/arjdbc/mysql/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/mysql/adapter.rb
+++ b/lib/arjdbc/mysql/adapter.rb
@@ -240,23 +240,6 @@ module ArJdbc
end
end
- # DATABASE STATEMENTS ======================================
-
- # @override
- def exec_insert(sql, name, binds, pk = nil, sequence_name = nil)
- execute sql, name, binds
- end
-
- # @override
- def exec_update(sql, name, binds)
- execute sql, name, binds
- end
-
- # @override
- def exec_delete(sql, name, binds)
- execute sql, name, binds
- end
-
# @override make it public just like native MySQL adapter does
def update_sql(sql, name = nil)
super | [mysql] use prepared statement support with AR's exec_xxx methods | jruby_activerecord-jdbc-adapter | train | rb |
71638e851e05d45f049ba932ceac32b1f49a30a3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,6 @@ setup(
author_email='jared.dillard@gmail.com',
install_requires=['six', 'sphinx >= 1.2'],
url="https://github.com/jdillard/sphinx-sitemap",
- download_url="https://github.com/jdillard/sphinx-sitemap/archive/0.1.tar.gz",
+ download_url="https://github.com/jdillard/sphinx-sitemap/archive/0.2.tar.gz",
packages=['sphinx_sitemap'],
) | update download version in setup.py | jdillard_sphinx-sitemap | train | py |
09149592b55d4a0e87296bb8a3acc3f9015a6c79 | diff --git a/lib/gollum/app.rb b/lib/gollum/app.rb
index <HASH>..<HASH> 100644
--- a/lib/gollum/app.rb
+++ b/lib/gollum/app.rb
@@ -95,7 +95,7 @@ module Precious
@css = settings.wiki_options[:css]
@js = settings.wiki_options[:js]
@mathjax_config = settings.wiki_options[:mathjax_config]
- @allow_editing = settings.wiki_options[:allow_editing]
+ @allow_editing = settings.wiki_options.fetch(:allow_editing, true)
end
get '/' do | Set allow_editing in Precious::App to true by default. Closes #<I> | gollum_gollum | train | rb |
73852a89294d63f046796273e0d271fa9ce0eac0 | diff --git a/src/main/java/io/vlingo/actors/Directory.java b/src/main/java/io/vlingo/actors/Directory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/vlingo/actors/Directory.java
+++ b/src/main/java/io/vlingo/actors/Directory.java
@@ -79,7 +79,7 @@ final class Directory {
void register(final Address address, final Actor actor) {
if (isRegistered(address)) {
- throw new IllegalArgumentException("The actor address is already registered: " + address);
+ throw new ActorAddressAlreadyRegistered(actor, address);
}
this.maps[mapIndex(address)].put(address, actor);
}
@@ -116,4 +116,13 @@ final class Directory {
private int mapIndex(final Address address) {
return Math.abs(address.hashCode() % maps.length);
}
+
+
+ public static final class ActorAddressAlreadyRegistered extends IllegalArgumentException {
+ public ActorAddressAlreadyRegistered(Actor actor, Address address) {
+ super(String.format("Failed to register Actor of type %s. Address is already registered: %s",
+ actor.getClass(),
+ address));
+ }
+ }
} | changes to more specific exception in Directory#register address already registered | vlingo_vlingo-actors | train | java |
79c0ac2a01efc647718c7eacbb55db2560eb814c | diff --git a/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb b/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb
index <HASH>..<HASH> 100644
--- a/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb
+++ b/acceptance/tests/resource/file/ticket_8740_should_not_enumerate_root_directory.rb
@@ -16,7 +16,7 @@ agents.each do |agent|
step "query for all files, which should return nothing"
on(agent, puppet_resource('file'), :acceptable_exit_codes => [1]) do
- assert_match(%r{Listing all file instances is not supported. Please specify a file or directory, e.g. puppet resource file /etc}, stderr)
+ assert_match(%r{Listing all file instances is not supported. Please specify a file or directory, e.g. puppet resource file /etc}, stdout)
end
["/", "/etc"].each do |file| | re-fix acceptance test related to logging changes | puppetlabs_puppet | train | rb |
753381e13c017d3362d9c91becb18499d5943f09 | diff --git a/app/models/deal_redemptions/redeem_code.rb b/app/models/deal_redemptions/redeem_code.rb
index <HASH>..<HASH> 100644
--- a/app/models/deal_redemptions/redeem_code.rb
+++ b/app/models/deal_redemptions/redeem_code.rb
@@ -12,7 +12,7 @@ module DealRedemptions
# Validate redemption code as an active voucher
def validate_code(params)
- if self.company.slug == params[:company] && self.code == params[:code] && self.active?
+ if self.company.slug == params[:company] && self.active?
true
else
false | Removed code params requirement from validate code model action | iamcutler_deal-redemptions | train | rb |
08bc4eaa56176583051863a8e15df6ea52701537 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -54,9 +54,9 @@ author = u'abidibo'
# built documents.
#
# The short X.Y version.
-version = u'1.2.0'
+version = u'1.2.1'
# The full version, including alpha/beta/rc tags.
-release = u'1.2.0'
+release = u'1.2.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-baton',
- version='1.2.0',
+ version='1.2.1',
packages=['baton', 'baton.autodiscover', 'baton.templatetags'],
include_package_data=True,
license='MIT License', | bumped version number to <I> | otto-torino_django-baton | train | py,py |
83e83949822118e5d64b2ab0d30a4b53f9c87779 | diff --git a/packages/ocap-util/jest.config.js b/packages/ocap-util/jest.config.js
index <HASH>..<HASH> 100644
--- a/packages/ocap-util/jest.config.js
+++ b/packages/ocap-util/jest.config.js
@@ -171,10 +171,4 @@ module.exports = {
// Indicates whether each individual test should be reported during the run
// verbose: null,
-
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
- // watchPathIgnorePatterns: [],
-
- // Whether to use watchman for file crawling
- // watchman: true,
}; | fake change to test lerna publish | ArcBlock_ocap-javascript-sdk | train | js |
9561fcd7d62d543624c02c2af4d192ede4674914 | diff --git a/logrus_test.go b/logrus_test.go
index <HASH>..<HASH> 100644
--- a/logrus_test.go
+++ b/logrus_test.go
@@ -191,7 +191,7 @@ func TestUserSuppliedLevelFieldHasPrefix(t *testing.T) {
log.WithField("level", 1).Info("test")
}, func(fields Fields) {
assert.Equal(t, fields["level"], "info")
- assert.Equal(t, fields["fields.level"], 1)
+ assert.Equal(t, fields["fields.level"], 1.0) // JSON has floats only
})
} | assertify changed behavior and consider float<I> != int | sirupsen_logrus | train | go |
12a97d16512d74ad732ca2f6b87d0d50d8ca70b5 | diff --git a/simuvex/s_irop.py b/simuvex/s_irop.py
index <HASH>..<HASH> 100644
--- a/simuvex/s_irop.py
+++ b/simuvex/s_irop.py
@@ -57,6 +57,11 @@ def generic_DivS(args, size):
# TODO: not sure if this should be extended *before* or *after* multiplication
return args[0] / args[1]
+def generic_DivU(args, size):
+ # TODO: not sure if this should be extended *before* or *after* multiplication
+ # TODO: Make it unsigned division
+ return args[0] / args[1]
+
# Count the leading zeroes
def generic_Clz(args, size):
wtf_expr = symexec.BitVecVal(size, size) | Implemented Iop_DivU. | angr_angr | train | py |
44f4bf24785208cb3a4e01f28441108f442681c5 | diff --git a/cli/version.js b/cli/version.js
index <HASH>..<HASH> 100644
--- a/cli/version.js
+++ b/cli/version.js
@@ -9,7 +9,7 @@ const logger = require('winston');
* @name version
*/
function version() {
- const packageJson = require(path.resolve(__dirname, '..', '..', 'package.json'));
+ const packageJson = require(path.resolve(process.cwd(), 'package.json'));
logger.info('@blackbaud/skyux-builder: %s', packageJson.version);
}
diff --git a/test/cli-version.spec.js b/test/cli-version.spec.js
index <HASH>..<HASH> 100644
--- a/test/cli-version.spec.js
+++ b/test/cli-version.spec.js
@@ -11,7 +11,7 @@ describe('cli version', () => {
const version = 'this.should.match';
let stubs = {};
- stubs[path.join(__dirname, '..', '..', 'package.json')] = {
+ stubs[path.join(process.cwd(), 'package.json')] = {
'@noCallThru': true,
version: version
}; | Using SPA path instead of relying on ../../ (#<I>)
* Using SPA path instead of relying on ../../
* Fixed ../../ reference in test | blackbaud_skyux-builder | train | js,js |
1ba0e8718b5403d10a2fa29166a3d78d9932f5fc | diff --git a/ChernoffFaces.js b/ChernoffFaces.js
index <HASH>..<HASH> 100644
--- a/ChernoffFaces.js
+++ b/ChernoffFaces.js
@@ -170,12 +170,14 @@
ChernoffFaces.prototype.randomize = function() {
var fv = FaceVector.random();
this.fp.redraw(fv);
- var sc_options = {
- features: JSUS.mergeOnValue(FaceVector.defaults, fv),
- change: this.change
- };
- this.sc.init(sc_options);
- this.sc.refresh();
+ if (this.sc.root) {
+ var sc_options = {
+ features: JSUS.mergeOnValue(FaceVector.defaults, fv),
+ change: this.change
+ };
+ this.sc.init(sc_options);
+ this.sc.refresh();
+ }
return true;
}; | Minor Changes in CF. Still not working | nodeGame_nodegame-widgets | train | js |
29ba790e071268c7d466ccf8374fc33da77694d9 | diff --git a/test/models/rememberable_test.rb b/test/models/rememberable_test.rb
index <HASH>..<HASH> 100644
--- a/test/models/rememberable_test.rb
+++ b/test/models/rememberable_test.rb
@@ -18,19 +18,19 @@ class RememberableTest < ActiveSupport::TestCase
test 'forget_me should clear remember token and save the record without validating' do
user = create_user
user.remember_me!
- assert user.remember_token?
+ assert_not user.remember_token.nil?
user.expects(:valid?).never
user.forget_me!
- assert_not user.remember_token?
+ assert user.remember_token.nil?
assert_not user.changed?
end
test 'forget_me should clear remember_created_at' do
user = create_user
user.remember_me!
- assert user.remember_created_at?
+ assert_not user.remember_created_at.nil?
user.forget_me!
- assert_not user.remember_created_at?
+ assert user.remember_created_at.nil?
end
test 'forget should do nothing if no remember token exists' do | Do not use ActiveRecord only methods in tests. | plataformatec_devise | train | rb |
af7231a520c8296a0569286572d321e787ba064b | diff --git a/lib/stripe/engine.rb b/lib/stripe/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe/engine.rb
+++ b/lib/stripe/engine.rb
@@ -81,7 +81,9 @@ environment file directly.
end
initializer 'stripe.assets.precompile' do |app|
- app.config.assets.precompile += %w( stripe_elements.js stripe_elements.css )
+ unless ::Rails.env.test?
+ app.config.assets.precompile += %w( stripe_elements.js stripe_elements.css )
+ end
end
rake_tasks do | Skip asset precompilation in test env | tansengming_stripe-rails | train | rb |
48893203366cfc6bc8e49b85e85d22c4faf59c9b | diff --git a/src/Sonata/ProductBundle/Entity/BaseProduct.php b/src/Sonata/ProductBundle/Entity/BaseProduct.php
index <HASH>..<HASH> 100644
--- a/src/Sonata/ProductBundle/Entity/BaseProduct.php
+++ b/src/Sonata/ProductBundle/Entity/BaseProduct.php
@@ -485,7 +485,7 @@ abstract class BaseProduct implements ProductInterface
public function __toString()
{
- return $this->getName();
+ return (string) $this->getName();
}
public function preUpdate() | Added type to avoid issue if name is NULL | sonata-project_ecommerce | train | php |
fbe6d54b9763e919b2ca0500f01e291bcb3f4489 | diff --git a/app/assets/javascripts/validations.js b/app/assets/javascripts/validations.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/validations.js
+++ b/app/assets/javascripts/validations.js
@@ -55,7 +55,7 @@ function validate(formContainer) {
// Do not check disabled form fields.
if (!$(this).is(':disabled')) {
var validatorTypes = $(this).attr("data-validate").split(" ");
- for (var i = 0; i < validatorTypes.length; i++) {
+ for (var i = 0; (!errors && i < validatorTypes.length); i++) {
errors = dispatchRuleValidation($(this), validatorTypes[i]);
}
} | Stop validating when first error is found | Graylog2_graylog2-server | train | js |
3e5342e3c439b6b444a661aa68a2103a38913704 | diff --git a/Model/TokenConfig.php b/Model/TokenConfig.php
index <HASH>..<HASH> 100644
--- a/Model/TokenConfig.php
+++ b/Model/TokenConfig.php
@@ -51,6 +51,10 @@ class TokenConfig
return $this->defaultKey;
}
+ if (!isset($this->tokens[$key])) {
+ throw new \LogicException(sprintf('Token with name %s could not be found', $key));
+ }
+
return $key;
} | Added exception if token name is not defiend | Happyr_GoogleSiteAuthenticatorBundle | train | php |
7d96be8214afd159d134a2c11d69709baf089725 | diff --git a/comments/request.js b/comments/request.js
index <HASH>..<HASH> 100644
--- a/comments/request.js
+++ b/comments/request.js
@@ -17,6 +17,10 @@ function Request(req) {
}
Request.prototype = {
+ login: function(user, pass, callback) {
+ this.db.users().login(user, pass, callback);
+ },
+
getCommentCountsPerTarget: function(callback) {
this.db.comments().countsPerTarget(function(err, counts) {
callback(counts);
diff --git a/comments/validator.js b/comments/validator.js
index <HASH>..<HASH> 100644
--- a/comments/validator.js
+++ b/comments/validator.js
@@ -73,8 +73,8 @@ var validator = {
return;
}
- this.req.session = req.session || {};
- this.req.session.user = user;
+ req.session = req.session || {};
+ req.session.user = user;
next();
}.bind(this));
@@ -84,7 +84,7 @@ var validator = {
* Performs the logout.
*/
doLogout: function(req, res, next) {
- this.req.session.user = null;
+ req.session.user = null;
next();
} | Fix login. Regression caused by previous refactor. | senchalabs_jsduck | train | js,js |
a32691c3f38dab7e5a528bf271e550566a88c2a0 | diff --git a/mathparse/mathparse.py b/mathparse/mathparse.py
index <HASH>..<HASH> 100644
--- a/mathparse/mathparse.py
+++ b/mathparse/mathparse.py
@@ -100,8 +100,13 @@ def replace_word_tokens(string, language):
operators.update(words['unary_operators'])
# Ensures unicode string processing
- if not isinstance(string, unicode):
- string = unicode(string, "utf-8")
+ import sys
+ if sys.version_info.major == 3:
+ if not isinstance(string, str):
+ string.decode("utf-8")
+ else:
+ if not isinstance(string, unicode):
+ string = unicode(string, "utf-8")
for operator in list(operators.keys()):
if operator in string: | Added portability between python versions | gunthercox_mathparse | train | py |
143d2d4c41e800fcaba9448f235751cb240df6fd | diff --git a/springy.js b/springy.js
index <HASH>..<HASH> 100644
--- a/springy.js
+++ b/springy.js
@@ -1,7 +1,7 @@
/**
* Springy v2.0.1
*
- * Copyright (c) 2010 Dennis Hotson
+ * Copyright (c) 2010-2013 Dennis Hotson
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation | updated copyright year
The <I> made me think that the project was abandoned. Also, arbor.js writes that it's based on springy. Only now that I take a closer look I see that there are recent commits. | dhotson_springy | train | js |
a7bc2aef1730c84c63cbefd66f27647cd248dbe4 | diff --git a/lib/util/storage.js b/lib/util/storage.js
index <HASH>..<HASH> 100644
--- a/lib/util/storage.js
+++ b/lib/util/storage.js
@@ -14,14 +14,14 @@ const proxyHandler = {
return true;
},
ownKeys(storage) {
- return Reflect.ownKeys(storage.getAll());
+ return Reflect.ownKeys(storage._store);
},
has(target, prop) {
return target.get(prop) !== undefined;
},
getOwnPropertyDescriptor(target, key) {
return {
- value: () => this.get(target, key),
+ get: () => this.get(target, key),
enumerable: true,
configurable: true
}; | Use private property at proxy, deepClone is not required for it. | yeoman_generator | train | js |
18c568bc82c35f352f2f69ae93bc56176bed92a1 | diff --git a/etcdserver/cluster.go b/etcdserver/cluster.go
index <HASH>..<HASH> 100644
--- a/etcdserver/cluster.go
+++ b/etcdserver/cluster.go
@@ -223,6 +223,13 @@ func (c *cluster) Recover() {
c.members, c.removed = membersFromStore(c.store)
c.version = clusterVersionFromStore(c.store)
MustDetectDowngrade(c.version)
+
+ for _, m := range c.members {
+ plog.Infof("added member %s %v to cluster %s from store", m.ID, m.PeerURLs, c.id)
+ }
+ if c.version != nil {
+ plog.Infof("set the cluster version to %v from store", version.Cluster(c.version.String()))
+ }
}
// ValidateConfigurationChange takes a proposed ConfChange and
diff --git a/etcdserver/server.go b/etcdserver/server.go
index <HASH>..<HASH> 100644
--- a/etcdserver/server.go
+++ b/etcdserver/server.go
@@ -292,9 +292,6 @@ func NewServer(cfg *ServerConfig) (*EtcdServer, error) {
plog.Infof("recovered store from snapshot at index %d", snapshot.Metadata.Index)
}
cfg.Print()
- if snapshot != nil {
- plog.Infof("loaded cluster information from store: %s", cl)
- }
if !cfg.ForceNewCluster {
id, cl, n, s, w = restartNode(cfg, snapshot)
} else { | etcdserver: print out correct restored cluster info
Before this PR, it always prints nil because cluster info has not been
covered when print:
```
<I>-<I>-<I> <I>:<I>:<I> I | etcdserver: loaded cluster information
from store: <nil>
``` | etcd-io_etcd | train | go,go |
38614acb5c992e1fa7907fefdd9feb71da647743 | diff --git a/keanu-project/src/test/java/io/improbable/keanu/algorithms/mcmc/MetropolisHastingsTest.java b/keanu-project/src/test/java/io/improbable/keanu/algorithms/mcmc/MetropolisHastingsTest.java
index <HASH>..<HASH> 100644
--- a/keanu-project/src/test/java/io/improbable/keanu/algorithms/mcmc/MetropolisHastingsTest.java
+++ b/keanu-project/src/test/java/io/improbable/keanu/algorithms/mcmc/MetropolisHastingsTest.java
@@ -149,7 +149,7 @@ public class MetropolisHastingsTest {
@Category(Slow.class)
@Test
- public void samplesComplexDiscreteWithMultipleVariableSelect() {
+ public void samplesComplexDiscreteWithFullVariableSelect() {
MCMCTestCase testCase = new MultiVariateDiscreteTestCase(); | change MH test name to say full variable select like the variable selector | improbable-research_keanu | train | java |
df623cc114659aa9b0c68b12e8e33f0f87e21c50 | diff --git a/lib/regexp-examples/helpers.rb b/lib/regexp-examples/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/regexp-examples/helpers.rb
+++ b/lib/regexp-examples/helpers.rb
@@ -26,10 +26,8 @@ module RegexpExamples
end
def self.generic_map_result(repeaters, method)
- repeaters
- .map { |repeater| repeater.public_send(method) }
- .instance_eval do |partial_results|
- RegexpExamples.permutations_of_strings(partial_results)
- end
+ permutations_of_strings(
+ repeaters.map { |repeater| repeater.public_send(method) }
+ )
end
end | Minor refactor/simplification
I was being unnecessarily clever here... | tom-lord_regexp-examples | train | rb |
fc314675bda4e75c52ffd2691208522b2effd829 | diff --git a/core-bundle/src/Framework/ContaoFramework.php b/core-bundle/src/Framework/ContaoFramework.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Framework/ContaoFramework.php
+++ b/core-bundle/src/Framework/ContaoFramework.php
@@ -265,7 +265,7 @@ class ContaoFramework implements ContaoFrameworkInterface, ContainerAwareInterfa
try {
$route = $this->router->generate($attributes->get('_route'), $attributes->get('_route_params'));
- } catch (\InvalidArgumentException $e) {
+ } catch (\Exception $e) {
return null;
} | [Core] Catch all exceptions when generating a route (see #<I>). | contao_contao | train | php |
eaab789ee08d3cc53b649a78d3cfe0ca833d2285 | diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/transaction.rb
+++ b/spec/unit/transaction.rb
@@ -20,8 +20,8 @@ describe Puppet::Transaction do
describe "when generating resources" do
it "should finish all resources" do
- generator = stub 'generator', :depthfirst? => true
- resource = stub 'resource'
+ generator = stub 'generator', :depthfirst? => true, :tags => []
+ resource = stub 'resource', :tag => nil
@catalog = Puppet::Resource::Catalog.new
@transaction = Puppet::Transaction.new(@catalog)
@@ -36,8 +36,8 @@ describe Puppet::Transaction do
end
it "should skip generated resources that conflict with existing resources" do
- generator = mock 'generator'
- resource = stub 'resource'
+ generator = mock 'generator', :tags => []
+ resource = stub 'resource', :tag => nil
@catalog = Puppet::Resource::Catalog.new
@transaction = Puppet::Transaction.new(@catalog) | Fix failing tests introduced by #<I> | puppetlabs_puppet | train | rb |
a7ec6ef0063772f915f3ff4527bd7f4f582c017b | diff --git a/lib/fugit/cron.rb b/lib/fugit/cron.rb
index <HASH>..<HASH> 100644
--- a/lib/fugit/cron.rb
+++ b/lib/fugit/cron.rb
@@ -97,19 +97,14 @@ module Fugit
inc((24 - @t.hour) * 3600 - @t.min * 60 - @t.sec)
- #inc( - @t.hour * 3600) if @t.hour != 0 # compensate for entering DST
- #inc( - @t.hour * 3600) if @t.hour > 0 && @t.hour < 7
- # leads to gh-60...
-
- if @t.hour == 0
- # it's good, carry on...
- elsif @t.hour < 12
- @t =
- begin
- ::EtOrbi.make(@t.year, @t.month, @t.day, @t.zone)
- rescue ::TZInfo::PeriodNotFound
- ::EtOrbi.make(@t.year, @t.month, @t.day + 1, @t.zone)
- end
+ return if @t.hour == 0
+
+ if @t.hour < 12
+ begin
+ @t = ::EtOrbi.make(@t.year, @t.month, @t.day, @t.zone)
+ rescue ::TZInfo::PeriodNotFound
+ inc((24 - @t.hour) * 3600)
+ end
else
inc((24 - @t.hour) * 3600)
end | Simplify inc_day, gh-<I> | floraison_fugit | train | rb |
75a5b7e53fe6149591df707f662d02a5c80720fc | diff --git a/eZ/Publish/API/Repository/Tests/RoleServiceTest.php b/eZ/Publish/API/Repository/Tests/RoleServiceTest.php
index <HASH>..<HASH> 100644
--- a/eZ/Publish/API/Repository/Tests/RoleServiceTest.php
+++ b/eZ/Publish/API/Repository/Tests/RoleServiceTest.php
@@ -1328,9 +1328,9 @@ class RoleServiceTest extends BaseTest
array( 1, 'user', 'login' ),
array( 1, 'user', 'login' ),
array( 1, 'user', 'login' ),
- array( 6, 'notification', 'use' ),
- array( 6, 'user', 'password' ),
- array( 6, 'user', 'selfedit' ),
+ array( $role->id, 'notification', 'use' ),
+ array( $role->id, 'user', 'password' ),
+ array( $role->id, 'user', 'selfedit' ),
),
$policies
); | Fixed: Do not rely on hardcoded role IDs in role service tests | ezsystems_ezpublish-kernel | train | php |
43075a25e377211ccf593e9e5ec2582fb6f8b544 | diff --git a/tasks/webdriver.js b/tasks/webdriver.js
index <HASH>..<HASH> 100644
--- a/tasks/webdriver.js
+++ b/tasks/webdriver.js
@@ -27,9 +27,9 @@ module.exports = function(grunt) {
timeout: 1000000,
updateSauceJob: false
}),
- capabilities = deepmerge(options,this.data.options),
- tunnelIdentifier = options['tunnel-identifier'] || capabilities.desiredCapabilities['tunnel-identifier'] || null,
- tunnelFlags = capabilities.desiredCapabilities['tunnel-flags'] || [],
+ capabilities = deepmerge(options,this.data.options || {}),
+ tunnelIdentifier = options['tunnel-identifier'] || (capabilities.desiredCapabilities ? capabilities.desiredCapabilities['tunnel-identifier'] : null) || null,
+ tunnelFlags = (capabilities.desiredCapabilities ? capabilities.desiredCapabilities['tunnel-flags'] : []) || [],
isLastTask = grunt.task._queue.length - 2 === 0;
/** | make task work with absolute minimum required options - closes #<I> | webdriverio_grunt-webdriver | train | js |
de2156618e81d4b751bfdb50ef3de2e2cdbd32d6 | diff --git a/html/pfappserver/root/static/admin/users.js b/html/pfappserver/root/static/admin/users.js
index <HASH>..<HASH> 100644
--- a/html/pfappserver/root/static/admin/users.js
+++ b/html/pfappserver/root/static/admin/users.js
@@ -63,7 +63,7 @@ function init() {
return false;
});
- /* Save a node (from the modal editor) */
+ /* Save a user (from the modal editor) */
$('body').on('click', '#updateUser', function(event) {
var btn = $(this),
modal = $('#modalUser'),
@@ -71,9 +71,9 @@ function init() {
modal_body = modal.find('.modal-body'),
url = $(this).attr('href'),
valid = false;
- btn.button('loading');
valid = isFormValid(form);
if (valid) {
+ btn.button('loading');
$.ajax({
type: 'POST',
url: url, | Reset the save btn when user form is invalid | inverse-inc_packetfence | train | js |
70db54eba970f8e8f6c42587675f1525002ea12f | diff --git a/hug/redirect.py b/hug/redirect.py
index <HASH>..<HASH> 100644
--- a/hug/redirect.py
+++ b/hug/redirect.py
@@ -45,7 +45,7 @@ def see_other(location):
def temporary(location):
- """Redirects to the specified location using HTTP 304 status code"""
+ """Redirects to the specified location using HTTP 307 status code"""
to(location, falcon.HTTP_307) | Update wrong status code stated in docstring | hugapi_hug | train | py |
9a10f16f70238844e582d2978c4ad4bb16b7508b | diff --git a/packages/upload-core/upload.js b/packages/upload-core/upload.js
index <HASH>..<HASH> 100644
--- a/packages/upload-core/upload.js
+++ b/packages/upload-core/upload.js
@@ -49,6 +49,8 @@ class Upload {
'X-XSRF-TOKEN': this.getToken(),
'X-Availity-Customer-ID': this.options.customerId,
'X-Client-ID': this.options.clientId,
+ 'Availity-Filename': file.name,
+ 'Availity-Content-Type': file.type,
},
onError: err => {
this.error = err; | fix(upload-core): add additional headers | Availity_sdk-js | train | js |
6791b1799e801ea550f106504f17002551613034 | diff --git a/packages/ember/tests/helpers/setup-sentry.js b/packages/ember/tests/helpers/setup-sentry.js
index <HASH>..<HASH> 100644
--- a/packages/ember/tests/helpers/setup-sentry.js
+++ b/packages/ember/tests/helpers/setup-sentry.js
@@ -28,9 +28,13 @@ export function setupSentryTest(hooks) {
this.fetchStub = sinon.stub(window, 'fetch');
/**
- * Stops global test suite failures from unhandled rejections and allows assertion on them
+ * Stops global test suite failures from unhandled rejections and allows assertion on them.
+ * onUncaughtException is used in QUnit 2.17 onwards.
*/
- this.qunitOnUnhandledRejection = sinon.stub(QUnit, 'onUnhandledRejection');
+ this.qunitOnUnhandledRejection = sinon.stub(
+ QUnit,
+ QUnit.onUncaughtException ? 'onUncaughtException' : 'onUnhandledRejection',
+ );
QUnit.onError = function({ message }) {
errorMessages.push(message.split('Error: ')[1]); | ref(ember): Fix Qunit causing flake
A recent update to QUnit (<I>) changed onUnhandledRejection to onUncaughtException. Ember try seems to be re-installing the latest qunit. This fix should make both sides of the QUnit change work. | getsentry_sentry-javascript | train | js |
22418cd8c4cc5c8f15cc1b729f97b3d39b512a4a | diff --git a/bindinfo/handle.go b/bindinfo/handle.go
index <HASH>..<HASH> 100644
--- a/bindinfo/handle.go
+++ b/bindinfo/handle.go
@@ -1058,7 +1058,7 @@ func runSQL(ctx context.Context, sctx sessionctx.Context, sql string, resultChan
}
// HandleEvolvePlanTask tries to evolve one plan task.
-// It only handle one tasks once because we want each task could use the latest parameters.
+// It only processes one task at a time because we want each task to use the latest parameters.
func (h *BindHandle) HandleEvolvePlanTask(sctx sessionctx.Context, adminEvolve bool) error {
originalSQL, db, binding := h.getOnePendingVerifyJob()
if originalSQL == "" { | bindinfo: fix the comment typo (#<I>) | pingcap_tidb | train | go |
d5763b8d78bc5f8c329c0b0fa4fa64c4526d4d86 | diff --git a/PHPCI/Plugin/PhpMessDetector.php b/PHPCI/Plugin/PhpMessDetector.php
index <HASH>..<HASH> 100755
--- a/PHPCI/Plugin/PhpMessDetector.php
+++ b/PHPCI/Plugin/PhpMessDetector.php
@@ -115,7 +115,7 @@ class PhpMessDetector implements \PHPCI\Plugin
protected function overrideSetting($options, $key)
{
- if (isset($options[$key]) && is_array($options['key'])) {
+ if (isset($options[$key]) && is_array($options[$key])) {
$this->{$key} = $options[$key];
}
} | Fix bug where options could not be overridden in PHPMessdetector plugin | dancryer_PHPCI | train | php |
fde7676aff9243fb04046640c7155661a0bc5308 | diff --git a/eliot/tests/test_output.py b/eliot/tests/test_output.py
index <HASH>..<HASH> 100644
--- a/eliot/tests/test_output.py
+++ b/eliot/tests/test_output.py
@@ -249,7 +249,7 @@ class MemoryLoggerTests(TestCase):
for i in range(write_count):
logger.write(msg, serializer)
- msgs = list({} for i in range(thread_count))
+ msgs = list({u"i": i} for i in range(thread_count))
serializers = list(object() for i in range(thread_count))
write_args = zip(msgs, serializers)
threads = list(Thread(target=write, args=args) for args in write_args) | Make the msg dicts distinct values
Otherwise list.index always just picks the first one. | itamarst_eliot | train | py |
1282951422fd575be34aa642ee6513dc6748fad1 | diff --git a/molgenis-data-migrate/src/main/java/org/molgenis/data/version/v1_5/Step1UpgradeMetaData.java b/molgenis-data-migrate/src/main/java/org/molgenis/data/version/v1_5/Step1UpgradeMetaData.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-migrate/src/main/java/org/molgenis/data/version/v1_5/Step1UpgradeMetaData.java
+++ b/molgenis-data-migrate/src/main/java/org/molgenis/data/version/v1_5/Step1UpgradeMetaData.java
@@ -132,10 +132,10 @@ public class Step1UpgradeMetaData extends MetaDataUpgrade
for (Entity v15EntityMetaDataEntity : entityRepository)
{
LOG.info("Setting attribute order for entity: "
- + v15EntityMetaDataEntity.get(EntityMetaDataMetaData1_4.SIMPLE_NAME));
+ + v15EntityMetaDataEntity.get(EntityMetaDataMetaData1_4.FULL_NAME));
List<Entity> attributes = Lists.newArrayList(searchService.search(
EQ(AttributeMetaDataMetaData1_4.ENTITY,
- v15EntityMetaDataEntity.getString(EntityMetaDataMetaData.SIMPLE_NAME)),
+ v15EntityMetaDataEntity.getString(EntityMetaDataMetaData.FULL_NAME)),
new AttributeMetaDataMetaData1_4()));
for(Entity attribute : attributes)
LOG.info("Setting attribute : " | fix upgrading of attributes: use fullname instead of simplename for the entity | molgenis_molgenis | train | java |
08b66a13a1db65097c36cee73efc339a30ee20c1 | diff --git a/lib/libPDF.php b/lib/libPDF.php
index <HASH>..<HASH> 100644
--- a/lib/libPDF.php
+++ b/lib/libPDF.php
@@ -222,7 +222,7 @@ class libPDF extends FPDF implements libPDFInterface {
$doc->loadXML("<root/>");
- $html = preg_replace("/&(?![a-z\d]+|#\d+|#x[a-f\d]+);/i", "&", $html);
+ $html = preg_replace("/&(?!([a-z\d]+|#\d+|#x[a-f\d]+);)/i", "&", $html);
$f = $doc->createDocumentFragment();
if( !$f->appendXML($html) ) | Fix HTMLText()'s entity detection not working all the time | SkUrRiEr_pdflib | train | php |
9f76836a6c8f5502e9e0f616baa457b2cd9b3edb | diff --git a/salt/modules/mac_ports.py b/salt/modules/mac_ports.py
index <HASH>..<HASH> 100644
--- a/salt/modules/mac_ports.py
+++ b/salt/modules/mac_ports.py
@@ -306,13 +306,13 @@ def install(name=None, refresh=False, pkgs=None, **kwargs):
if pkgs is None:
version_num = kwargs.get('version')
variant_spec = kwargs.get('variant')
- spec = None
+ spec = {}
if version_num:
- spec = (spec or '') + '@' + version_num
+ spec['version'] = version_num
if variant_spec:
- spec = (spec or '') + variant_spec
+ spec['variant'] = variant_spec
pkg_params = {name: spec}
@@ -321,7 +321,14 @@ def install(name=None, refresh=False, pkgs=None, **kwargs):
formulas_array = []
for pname, pparams in six.iteritems(pkg_params):
- formulas_array.append(pname + (pparams or ''))
+ formulas_array.append(pname)
+
+ if pparams:
+ if 'version' in pparams:
+ formulas_array.append('@' + pparams['version'])
+
+ if 'variant' in pparams:
+ formulas_array.append(pparams['variant'])
old = list_pkgs()
cmd = ['port', 'install'] | emit port cli version, variants as separate args | saltstack_salt | train | py |
0438987f931760233ff975aa5998bf6b8dd8de46 | diff --git a/backports/datetime_timestamp/__init__.py b/backports/datetime_timestamp/__init__.py
index <HASH>..<HASH> 100644
--- a/backports/datetime_timestamp/__init__.py
+++ b/backports/datetime_timestamp/__init__.py
@@ -27,6 +27,9 @@ def timestamp(dt):
>>> timestamp(datetime.datetime.now()) > 1494638812
True
+
+ >>> timestamp(datetime.datetime.now()) % 1 > 0
+ True
"""
if dt.tzinfo is None:
return time.mktime(( | Add test ensuring that fractional seconds are present on naive datetimes. | jaraco_backports.datetime_timestamp | train | py |
4917be4cd2ab9968691d36f446dfecc143f318e7 | diff --git a/tests/test_tools.py b/tests/test_tools.py
index <HASH>..<HASH> 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -37,7 +37,7 @@ def compare_nifti(nifti_file_1, nifti_file_2):
if nifti_1.get_data_dtype() != nifti_2.get_data_dtype():
logging.warning('dtype mismatch')
result = False
- if not numpy.allclose(nifti_1.get_data(), nifti_2.get_data()):
+ if not numpy.allclose(nifti_1.get_data(), nifti_2.get_data(), rtol=1e-04, atol=1e-04,):
logging.warning('data mismatch')
result = False | icometrix/dicom2nifti#<I>:
Allow for rounding differences | icometrix_dicom2nifti | train | py |
e272b6da15b20a51cfc1beb5d249cb854b88f4b6 | diff --git a/lib/spree/adyen/engine.rb b/lib/spree/adyen/engine.rb
index <HASH>..<HASH> 100644
--- a/lib/spree/adyen/engine.rb
+++ b/lib/spree/adyen/engine.rb
@@ -8,6 +8,7 @@ module Spree
initializer "spree.spree-adyen.payment_methods", :after => "spree.register.payment_methods" do |app|
app.config.spree.payment_methods << Gateway::AdyenPayment
app.config.spree.payment_methods << Gateway::AdyenHPP
+ app.config.spree.payment_methods << Gateway::AdyenPaymentEncrypted
end
end
end | Add additional payment method using Client Side Encrytion | StemboltHQ_solidus-adyen | train | rb |
1b95b7d679aa8209cb9d446764b65229a1680c1f | diff --git a/modeltranslation/admin.py b/modeltranslation/admin.py
index <HASH>..<HASH> 100644
--- a/modeltranslation/admin.py
+++ b/modeltranslation/admin.py
@@ -215,7 +215,7 @@ class TranslationBaseModelAdmin(BaseModelAdmin):
TranslationAdmin and TranslationInlineModelAdmin.
"""
base_fields = self.replace_orig_field(form.base_fields.keys())
- fields = base_fields + list(self.get_readonly_fields(request, obj))
+ fields = list(base_fields) + list(self.get_readonly_fields(request, obj))
return [(None, {'fields': self.replace_orig_field(fields)})]
def get_translation_field_excludes(self, exclude_languages=None): | Fix TypeError in admin when all fields are read-only | deschler_django-modeltranslation | train | py |
5f7d8c15297778a342f2bc93c49c0dad9bc0e671 | diff --git a/src/mutable.js b/src/mutable.js
index <HASH>..<HASH> 100644
--- a/src/mutable.js
+++ b/src/mutable.js
@@ -1,4 +1,4 @@
-import ItemSelection from './immutable'
+import { ItemSelection } from './immutable'
class MutableItemSelection extends ItemSelection {
set (selection, lastIndex) { | extend MutableItemSelection from superclass instead of factory function | goto-bus-stop_item-selection | train | js |
a52bdb5c8e3e3a9e7e37807f454c97d389b063f8 | diff --git a/site/src/_layout.js b/site/src/_layout.js
index <HASH>..<HASH> 100644
--- a/site/src/_layout.js
+++ b/site/src/_layout.js
@@ -260,7 +260,7 @@ const Hits = ({ searchResults }) => {
},
},
}
- const slug = highlightedHit.url.replace(/https:\/\/cli.netlify.com/, '')
+ const slug = highlightedHit.url.replace('https://cli.netlify.com', '')
return (
<HitsOverlay key={index}>
<a href={slug}> | chore(site): fix wrong regex (#<I>) | netlify_cli | train | js |
ae6e887eb3b09629a5e45b827ac0ca366c3100ea | diff --git a/lib/puppet/version.rb b/lib/puppet/version.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/version.rb
+++ b/lib/puppet/version.rb
@@ -7,7 +7,7 @@
module Puppet
- PUPPETVERSION = '3.3.1-rc3'
+ PUPPETVERSION = '3.3.1'
##
# version is a public API method intended to always provide a fast and | (packaging) Update PUPPETVERSION for <I> | puppetlabs_puppet | train | rb |
06f838427a39dbb4fee82c8769cbd0059cae7804 | diff --git a/liquibase-core/src/test/java/liquibase/verify/AbstractVerifyTest.java b/liquibase-core/src/test/java/liquibase/verify/AbstractVerifyTest.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/test/java/liquibase/verify/AbstractVerifyTest.java
+++ b/liquibase-core/src/test/java/liquibase/verify/AbstractVerifyTest.java
@@ -33,10 +33,11 @@ public class AbstractVerifyTest {
this.testGroup = testGroup;
this.stateName = stateName;
- File liquibaseRootDir = new File(".");
- if (liquibaseRootDir.getName().equals("liquibase-core")) {
- liquibaseRootDir = liquibaseRootDir.getParentFile();
+ File liquibaseRootDir = new File("");
+ if (liquibaseRootDir.getAbsolutePath().endsWith("liquibase-core")) { //sometimes running in liquibase-core, especially in maven
+ liquibaseRootDir = liquibaseRootDir.getAbsoluteFile().getParentFile();
}
+
this.savedStateDir = new File(liquibaseRootDir, "liquibase-core/src/test/java/liquibase/verify/saved_state/"+testName+"/"+testGroup);
this.stateFile = new File(savedStateDir, stateName+"."+type.name().toLowerCase()); | Fixed problem where maven was using a different root for running the VerifyTests | liquibase_liquibase | train | java |
767edd6e59e4c17bbea6f392b9f6101287473271 | diff --git a/photutils/aperture/mask.py b/photutils/aperture/mask.py
index <HASH>..<HASH> 100644
--- a/photutils/aperture/mask.py
+++ b/photutils/aperture/mask.py
@@ -237,14 +237,14 @@ class ApertureMask:
input ``data``.
"""
- # make a copy to prevent changing the input data
- cutout = self.cutout(data, fill_value=fill_value, copy=True)
-
+ cutout = self.cutout(data, fill_value=fill_value)
if cutout is None:
return None
else:
+ weighted_cutout = cutout * self.data
+
# needed to zero out non-finite data values outside of the
- # aperture mask but within the bounding box
- cutout[self._mask] = 0.
+ # mask but within the bounding box
+ weighted_cutout[self._mask] = 0.
- return cutout * self.data
+ return weighted_cutout | Improve performance of ApetureMask.multiply | astropy_photutils | train | py |
33d003141387f3390c83ee46c058752fc08b8d4b | diff --git a/commands/commands.rb b/commands/commands.rb
index <HASH>..<HASH> 100644
--- a/commands/commands.rb
+++ b/commands/commands.rb
@@ -68,8 +68,13 @@ command :fetch do |user, branch|
branch ||= 'master'
GitHub.invoke(:track, user) unless helper.tracking?(user)
+ die "Unknown branch (#{branch}) specified" unless helper.remote_branch?(user, branch)
+ die "Unable to switch branches, your current branch has uncommitted changes" if helper.branch_dirty?
+
+ puts "Fetching #{user}/#{branch}"
git "fetch #{user} #{branch}:refs/remotes/#{user}/#{branch}"
- git_exec "checkout -b #{user}/#{branch} refs/remotes/#{user}/#{branch}"
+ git "update-ref refs/heads/#{user}/#{branch} refs/remotes/#{user}/#{branch}"
+ git_exec "checkout #{user}/#{branch}"
end
desc "Pull from a remote." | Make sure it exists on the remote and force it to update on the local.
These changes ensures that the branch actually exists on the remote
repository and that the locally created branch is a pristine copy
of the remote branch. | defunkt_github-gem | train | rb |
93f91a37c162166b1d650e1407d806b9f867230c | diff --git a/lib/middleware/init.js b/lib/middleware/init.js
index <HASH>..<HASH> 100644
--- a/lib/middleware/init.js
+++ b/lib/middleware/init.js
@@ -20,6 +20,8 @@ module.exports = function (req, res, next) {
// 本次请求附加的静态模版变量
res.templateData = {};
+ res.set('X-Powered-By', 'Rebas');
+
next();
});
}; | Add `X-Powered-By` | ecomfe_rebas | train | js |
1928e6db98500ddbb48234457073add653d09b52 | diff --git a/lib/common/error_codes.js b/lib/common/error_codes.js
index <HASH>..<HASH> 100644
--- a/lib/common/error_codes.js
+++ b/lib/common/error_codes.js
@@ -13,6 +13,7 @@ module.exports = {
unexpectedEqualsSignBeforeAttributeName: 'unexpected-equals-sign-before-attribute-name',
missingEndTagName: 'missing-end-tag-name',
unexpectedCharacterInAttributeName: 'unexpected-character-in-attribute-name',
+ missingSemicolonAfterCharacterReference: 'missing-semicolon-after-character-reference',
eofBeforeTagName: 'eof-before-tag-name',
eofInTag: 'eof-in-tag',
missingAttributeValue: 'missing-attribute-value',
diff --git a/lib/tokenizer/index.js b/lib/tokenizer/index.js
index <HASH>..<HASH> 100644
--- a/lib/tokenizer/index.js
+++ b/lib/tokenizer/index.js
@@ -2402,8 +2402,10 @@ _[HEXADEMICAL_CHARACTER_REFERENCE_STATE] = function hexademicalCharacterReferenc
else if (cp === $.SEMICOLON)
this.state = NUMERIC_CHARACTER_REFERENCE_END_STATE;
- else
+ else {
+ this._err(ERR.missingSemicolonAfterCharacterReference);
this._reconsumeInState(NUMERIC_CHARACTER_REFERENCE_END_STATE);
+ }
}; | Add Hexademical character reference state errors. | inikulin_parse5 | train | js,js |
77351a779d527c69cc9fbebfc918cb1e291ce7bf | diff --git a/brothon/analysis/dataframe_to_matrix.py b/brothon/analysis/dataframe_to_matrix.py
index <HASH>..<HASH> 100644
--- a/brothon/analysis/dataframe_to_matrix.py
+++ b/brothon/analysis/dataframe_to_matrix.py
@@ -107,6 +107,10 @@ class DataFrameToMatrix(object):
def _normalize_series(series):
smin = series.min()
smax = series.max()
+ if smax - smin == 0:
+ print('Cannot normalize series (div by 0) so not normalizing...')
+ smin = 0
+ smax = 1
return (series - smin) / (smax - smin), smin, smax | fix possible div by zero in normalization | SuperCowPowers_bat | train | py |
5f9a0e7b005ccf909d7745fb19c2d43d75968c39 | diff --git a/client-js/QueryResultDataTable.js b/client-js/QueryResultDataTable.js
index <HASH>..<HASH> 100644
--- a/client-js/QueryResultDataTable.js
+++ b/client-js/QueryResultDataTable.js
@@ -86,7 +86,7 @@ var QueryResultDataTable = React.createClass({
top: 0,
bottom: 0,
width: (Math.abs(value) / range) * 100 + '%',
- backgroundColor: '#ffcf78'
+ backgroundColor: '#bae6f7'
}
numberBar = <div style={barStyle} />
} | change cell bar to light blue
orange isn’t really used anywhere else so it looks out of place | rickbergfalk_sqlpad | train | js |
903785ecad1757643419cfb67094e529deb85df5 | diff --git a/elytron/src/main/java/org/wildfly/extension/elytron/CertificateAuthorityAccountDefinition.java b/elytron/src/main/java/org/wildfly/extension/elytron/CertificateAuthorityAccountDefinition.java
index <HASH>..<HASH> 100644
--- a/elytron/src/main/java/org/wildfly/extension/elytron/CertificateAuthorityAccountDefinition.java
+++ b/elytron/src/main/java/org/wildfly/extension/elytron/CertificateAuthorityAccountDefinition.java
@@ -79,7 +79,7 @@ class CertificateAuthorityAccountDefinition extends SimpleResourceDefinition {
enum CertificateAuthority {
- LETS_ENCRYPT("LetsEncrypt", "https://acme-v02.api.letsencrypt.org/directory", "https://acme-staging.api.letsencrypt.org/directory");
+ LETS_ENCRYPT("LetsEncrypt", "https://acme-v02.api.letsencrypt.org/directory", "https://acme-staging-v02.api.letsencrypt.org/directory");
private final String name;
private final String url; | [WFCORE-<I>] Fix the staging URL for the Let's Encrypt certificate-authority | wildfly_wildfly-core | train | java |
ab523f9fd8bfdf8db55106ea456d2a32ff4e93fb | diff --git a/spec/unit/mongoid/identity_map_spec.rb b/spec/unit/mongoid/identity_map_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/mongoid/identity_map_spec.rb
+++ b/spec/unit/mongoid/identity_map_spec.rb
@@ -439,6 +439,7 @@ describe Mongoid::IdentityMap do
end
it "gets the object from the identity map" do
+ pending "segfault on 1.9.2-p290 on Intel i7 OSX Lion"
fiber.resume
end
end | Pend spec getting segfault on Lion | mongodb_mongoid | train | rb |
571c74380e228d80547135f749b5b8f6da885bc6 | 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
@@ -1619,7 +1619,7 @@ module ActionView
@index = options[:index] || options[:child_index]
end
- (field_helpers - [:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each do |selector|
+ (field_helpers - [:label, :check_box, :radio_button, :fields_for, :fields, :hidden_field, :file_field]).each do |selector|
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def #{selector}(method, options = {}) # def text_field(method, options = {})
@template.send( # @template.send( | Fix warning: method redefined; discarding old fields
Follow up to #<I>. | rails_rails | train | rb |
40aee3c6cd4e27c1b9b76023ad0ad0b59db1650f | diff --git a/build.php b/build.php
index <HASH>..<HASH> 100755
--- a/build.php
+++ b/build.php
@@ -3,7 +3,7 @@
chdir(__DIR__);
$returnStatus = null;
-passthru('composer install --dev', $returnStatus);
+passthru('composer install', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
} | Remove --dev from composer install.
--dev is the default. | traderinteractive_solvemedia-client-php | train | php |
76bb0d20a3cf44108a2337d119b92066968b1c84 | diff --git a/lib/environmentlib.php b/lib/environmentlib.php
index <HASH>..<HASH> 100644
--- a/lib/environmentlib.php
+++ b/lib/environmentlib.php
@@ -630,8 +630,8 @@ function environment_check_database($version) {
*/
function process_environment_bypass($xml, &$result) {
-/// Only try to bypass if we were in error
- if ($result->getStatus()) {
+/// Only try to bypass if we were in error and it was required
+ if ($result->getStatus() || $result->getLevel() == 'optional') {
return;
} | We only allow to bypass "required" checks. | moodle_moodle | train | php |
698b32d228593ab227ae3d8161ec4d2452e43d64 | diff --git a/pypet/storageservice.py b/pypet/storageservice.py
index <HASH>..<HASH> 100644
--- a/pypet/storageservice.py
+++ b/pypet/storageservice.py
@@ -1950,7 +1950,7 @@ class HDF5StorageService(StorageService, HasLogger):
if col_name == 'example_item_run_name':
# The example item run name has changed due to merging
- old_run_name = not_inserted_row[col_name]
+ old_run_name = compat.tostr(not_inserted_row[col_name])
# Get the old name
old_full_name = key.replace(run_mask, old_run_name)
# Find the new name | fixed unicode/str problem in python 3 in test | SmokinCaterpillar_pypet | train | py |
00af3f2c9706d7b1c5adb4abd92afa53c5b93e44 | 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
@@ -1,5 +1,7 @@
+require 'rubygems'
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+require 'sequel'
require 'sequel/migration_builder'
require 'spec'
require 'spec/autorun' | Requiring sequel in spec helper. | knaveofdiamonds_sequel_migration_builder | train | rb |
2d5e6f8117d4b1b2a8e1189dc391f5c9882c7ee5 | diff --git a/salt/cloud/clouds/azurearm.py b/salt/cloud/clouds/azurearm.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/azurearm.py
+++ b/salt/cloud/clouds/azurearm.py
@@ -390,7 +390,7 @@ def list_nodes(conn=None, call=None): # pylint: disable=unused-argument
try:
provider, driver = __active_provider_name__.split(':')
active_resource_group = __opts__['providers'][provider][driver]['resource_group']
- except:
+ except KeyError:
pass
for node in nodes: | Add "KeyError" to bare except in azurearm
Fixes pylint, refs #<I>. | saltstack_salt | train | py |
e8dfe728ca92a50daa91088da671ae6073af3c0b | diff --git a/src/pusher_connection.js b/src/pusher_connection.js
index <HASH>..<HASH> 100644
--- a/src/pusher_connection.js
+++ b/src/pusher_connection.js
@@ -34,7 +34,7 @@
}
connection.connectedTimeout = 2000;
connection.connectionSecure = connection.compulsorySecure;
- connection.connectionAttempts = 0;
+ connection.failedAttempts = 0;
}
function Connection(key, options) {
@@ -86,18 +86,18 @@
self.emit('connecting_in', self.connectionWait);
}
- if (self.netInfo.isOnLine() && self.connectionAttempts <= 4) {
- updateState('connecting');
- } else {
- updateState('unavailable');
- }
-
- // When in the unavailable state we attempt to connect, but don't
- // broadcast that fact
if (self.netInfo.isOnLine()) {
+ if (self.failedAttempts < 5) {
+ updateState('connecting');
+ } else {
+ updateState('unavailable');
+ }
self._waitingTimer = setTimeout(function() {
+ // Even when unavailable we try connecting (not changing state)
self._machine.transition('connecting');
}, connectionDelay());
+ } else {
+ updateState('unavailable');
}
},
@@ -255,7 +255,7 @@
self.connectionSecure = !self.connectionSecure;
}
- self.connectionAttempts++;
+ self.failedAttempts++;
}
function connectBaseURL(isSecure) { | Refactor waitingPre code
The logic should now be clearer to understand | pusher_pusher-js | train | js |
3f83b9508bf5ed98967625943669a1f65be8b861 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -41,7 +41,7 @@ function slang(opt) {
}
// create full URL for curl path
- URL = 'http://' + USER + ':' + PASS + '@' +
+ URL = 'http://' + USER + ':' + encodeURIComponent(PASS) + '@' +
HOST + ':' + PORT + '/' + path.dirname(destPath) + ".json";
var options = { | UPDATE: Apply the encodeURIComponent function to Password
- If a special character is used in an URL without encoding, a bug that can not be
accessed normally has been found and fixed. | icfnext_gulp-slang | train | js |
3d714d3016f88c4c84f95ae00692314c512725bb | diff --git a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java
index <HASH>..<HASH> 100644
--- a/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java
+++ b/spring-boot-cli/src/test/java/org/springframework/boot/cli/SampleIntegrationTests.java
@@ -71,7 +71,7 @@ public class SampleIntegrationTests {
@Before
public void setup() throws Exception {
- System.setProperty("disableSpringSnapshotRepos", "true");
+ System.setProperty("disableSpringSnapshotRepos", "false");
new CleanCommand().run("org.springframework");
} | Allow snapshot repositories in integration tests
Update CLI SampleIntegrationTests to no longer disable snapshot repos. | spring-projects_spring-boot | train | java |
84d352dc49979d7c8504f1449dddff6c6b0ba403 | diff --git a/lib/Stripe/ApiResource.php b/lib/Stripe/ApiResource.php
index <HASH>..<HASH> 100644
--- a/lib/Stripe/ApiResource.php
+++ b/lib/Stripe/ApiResource.php
@@ -118,10 +118,10 @@ abstract class Stripe_ApiResource extends Stripe_Object
return Stripe_Util::convertToStripeObject($response, $apiKey);
}
- protected function _scopedSave($class, $apiKey=null)
+ protected function _scopedSave($class)
{
self::_validateCall('save');
- $requestor = new Stripe_ApiRequestor($apiKey);
+ $requestor = new Stripe_ApiRequestor($this->_apiKey);
$params = $this->serializeParameters();
if (count($params) > 0) {
diff --git a/lib/Stripe/Customer.php b/lib/Stripe/Customer.php
index <HASH>..<HASH> 100644
--- a/lib/Stripe/Customer.php
+++ b/lib/Stripe/Customer.php
@@ -44,7 +44,7 @@ class Stripe_Customer extends Stripe_ApiResource
public function save()
{
$class = get_class();
- return self::_scopedSave($class, $this->_apiKey);
+ return self::_scopedSave($class);
}
/** | Always try to pass a local API key when saving | stripe_stripe-php | train | php,php |
f32098d2be75599dc82cd024cdf84f7bac8425c0 | diff --git a/src/Sentry/Laravel/EventHandler.php b/src/Sentry/Laravel/EventHandler.php
index <HASH>..<HASH> 100644
--- a/src/Sentry/Laravel/EventHandler.php
+++ b/src/Sentry/Laravel/EventHandler.php
@@ -173,7 +173,7 @@ class EventHandler
*/
public function __call($method, $arguments)
{
- $handlerMethod = $handlerMethod = "{$method}Handler";
+ $handlerMethod = "{$method}Handler";
if (!method_exists($this, $handlerMethod)) {
throw new RuntimeException("Missing event handler: {$handlerMethod}"); | Fix variable duplication (#<I>) | getsentry_sentry-laravel | train | php |
e8c6c56069292078aaa8809ed82d52f3bc09a0be | diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -1798,6 +1798,16 @@ class TestDataFrame(unittest.TestCase, CheckIndexing,
self.assert_(not self.frame._is_mixed_type)
self.assert_(self.mixed_frame._is_mixed_type)
+ def test_constructor_ordereddict(self):
+ from pandas.util.compat import OrderedDict
+ import random
+ nitems = 100
+ nums = range(nitems)
+ random.shuffle(nums)
+ expected=['A%d' %i for i in nums]
+ df=DataFrame(OrderedDict(zip(expected,[[0]]*nitems)))
+ self.assertEqual(expected,list(df.columns))
+
def test_constructor_dict(self):
frame = DataFrame({'col1' : self.ts1,
'col2' : self.ts2}) | TST: DataFrame ctor should respect col order when given OrderedDict | pandas-dev_pandas | train | py |
fda1058b320eec5dbd84a9c2e7a8b12bfd594c28 | diff --git a/lib/rabl/builder.rb b/lib/rabl/builder.rb
index <HASH>..<HASH> 100644
--- a/lib/rabl/builder.rb
+++ b/lib/rabl/builder.rb
@@ -110,7 +110,7 @@ module Rabl
def extends(file, options={}, &block)
options = @options.slice(:child_root).merge(:object => @_object).merge(options)
result = self.partial(file, options, &block)
- @_result.merge!(result) if result
+ @_result.merge!(result) if result && result.is_a?(Hash)
end
# resolve_condition(:if => true) => true | [builder] Only merge in a result if the result is a hash | nesquena_rabl | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.