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 |
|---|---|---|---|---|---|
53ec9d43373678390a1ad0dbba68f382caa81aad | diff --git a/lib/stormpath.js b/lib/stormpath.js
index <HASH>..<HASH> 100644
--- a/lib/stormpath.js
+++ b/lib/stormpath.js
@@ -242,6 +242,7 @@ module.exports.init = function(app, opts) {
router.get(app.get('stormpathRegistrationUrl'), controllers.idSiteRegister);
} else {
router.use(app.get('stormpathRegistrationUrl'), urlMiddleware);
+ router.get(app.get('stormpathRegistrationUrl'), bodyParser.json({ limit: '11mb' }));
router.get(app.get('stormpathRegistrationUrl'), controllers.register);
router.post(app.get('stormpathRegistrationUrl'), controllers.register);
} | Supporting JSON POST requests for the registration route. | stormpath_express-stormpath | train | js |
20de7f1e08c74bc0be28e14b98e57e055a4e805c | diff --git a/backtrader/broker.py b/backtrader/broker.py
index <HASH>..<HASH> 100644
--- a/backtrader/broker.py
+++ b/backtrader/broker.py
@@ -189,7 +189,6 @@ class BrokerBack(BrokerBase):
return o.status
def submit(self, order):
- order.plen = len(order.data)
if self.p.checksubmit:
order.submit()
self.submitted.append(order)
diff --git a/backtrader/brokers/ibbroker.py b/backtrader/brokers/ibbroker.py
index <HASH>..<HASH> 100644
--- a/backtrader/brokers/ibbroker.py
+++ b/backtrader/brokers/ibbroker.py
@@ -289,7 +289,6 @@ class IBBroker(with_metaclass(MetaIBBroker, BrokerBase)):
return o.status
def submit(self, order):
- order.plen = len(order.data)
order.submit(self)
self.orderbyid[order.m_orderId] = order
diff --git a/backtrader/order.py b/backtrader/order.py
index <HASH>..<HASH> 100644
--- a/backtrader/order.py
+++ b/backtrader/order.py
@@ -350,6 +350,7 @@ class OrderBase(with_metaclass(MetaParams, object)):
def submit(self, broker=None):
self.status = Order.Submitted
self.broker = broker
+ self.plen = len(self.data)
def accept(self, broker=None):
self.status = Order.Accepted | Move plen order mark inside order.submit (remove it from brokers) | backtrader_backtrader | train | py,py,py |
d57dd3f59fc752a44aa462c767565977dc18f047 | diff --git a/src/config/webpack/index.js b/src/config/webpack/index.js
index <HASH>..<HASH> 100644
--- a/src/config/webpack/index.js
+++ b/src/config/webpack/index.js
@@ -2,6 +2,7 @@
const merge = require('webpack-merge')
const webpack = require('webpack')
+const path = require('path')
const utils = require('../../utils')
const base = require('./base')
@@ -19,7 +20,7 @@ function webpackConfig () {
],
devtool: 'source-map',
output: {
- filename: entry.split('/').pop(),
+ filename: path.basename(entry),
library: libraryName,
path: utils.getPathToDist()
}, | fix: use rel paths on windows (#<I>) | ipfs_aegir | train | js |
3a9a162168ac41860846b9d511d30c34113df29d | diff --git a/WindowImplBrowser.js b/WindowImplBrowser.js
index <HASH>..<HASH> 100644
--- a/WindowImplBrowser.js
+++ b/WindowImplBrowser.js
@@ -108,7 +108,7 @@ WindowImplBrowser.prototype.setFullScreen = function(enable){
};
WindowImplBrowser.create = function(windowPex,settings){
- var canvas = document.createElement('canvas');
+ var canvas = settings.canvas || document.createElement('canvas');
var width, height;
if(settings.fullScreen){
@@ -233,7 +233,7 @@ WindowImplBrowser.create = function(windowPex,settings){
//TODO: add premultipliedAlpha support
//TODO: add preserveDrawingBuffer support
var options = DefaultWebGLContextOptions;
-
+
var gl = getWebGLContext(canvas,options);
if(gl === null){
throw new Error('WindowImplBrowser: No WebGL context is available.'); | WindowImplBorwser added support for passing existing canvas instance | pex-gl_pex-sys | train | js |
67dcd5848efe3a2cda60def7b3d1b93acda1bbe5 | diff --git a/test/service_test.rb b/test/service_test.rb
index <HASH>..<HASH> 100644
--- a/test/service_test.rb
+++ b/test/service_test.rb
@@ -8,13 +8,41 @@ end
class ServiceTest < Minitest::Test
def setup
+ super
Mailkick.services = [TestService.new]
end
def teardown
+ super
Mailkick.services = []
end
+ def test_process_opt_outs
+ user = User.create!(email: "test@example.com")
+ user.subscribe("sales")
+
+ previous_method = Mailkick.process_opt_outs_method
+ begin
+ Mailkick.process_opt_outs_method = lambda do |opt_outs|
+ emails = opt_outs.map { |v| v[:email] }
+ subscribers = User.includes(:mailkick_subscriptions).where(email: emails).index_by(&:email)
+
+ opt_outs.each do |opt_out|
+ subscriber = subscribers[opt_out[:email]]
+ next unless subscriber
+
+ subscriber.mailkick_subscriptions.each do |subscription|
+ subscription.destroy if subscription.created_at < opt_out[:time]
+ end
+ end
+ end
+ Mailkick.fetch_opt_outs
+ refute user.subscribed?("sales")
+ ensure
+ Mailkick.process_opt_outs_method = previous_method
+ end
+ end
+
def test_not_configured
error = assert_raises do
Mailkick.fetch_opt_outs | Added test for process opt-outs | ankane_mailkick | train | rb |
22f81681cf3e9439ad699091b528c5cd21e2a88f | diff --git a/system/rake-support/lib/torquebox/rake/tasks/server.rb b/system/rake-support/lib/torquebox/rake/tasks/server.rb
index <HASH>..<HASH> 100644
--- a/system/rake-support/lib/torquebox/rake/tasks/server.rb
+++ b/system/rake-support/lib/torquebox/rake/tasks/server.rb
@@ -28,7 +28,7 @@ namespace :torquebox do
desc "Run TorqueBox server"
task :run=>[ :check ] do
- TorqueBox::RakeUtils.run_server
+ TorqueBox::DeployUtils.run_server
end
end | Fix rake torquebox:run to actually work (thanks @rortian!)
Note to self: test *after* removing obsolete code from the source tree, not before. | torquebox_torquebox | train | rb |
923f36299d677e6cc5ff2734bd2fa254e2dbc2c1 | diff --git a/parsl/monitoring/monitoring.py b/parsl/monitoring/monitoring.py
index <HASH>..<HASH> 100644
--- a/parsl/monitoring/monitoring.py
+++ b/parsl/monitoring/monitoring.py
@@ -487,9 +487,9 @@ class MonitoringRouter:
try:
data, addr = self.sock.recvfrom(2048)
msg = pickle.loads(data)
+ self.logger.debug("Got UDP Message from {}: {}".format(addr, msg))
resource_msgs.put((msg, addr))
last_msg_received_time = time.time()
- self.logger.debug("Got UDP Message from {}: {}".format(addr, msg))
except socket.timeout:
pass | Log UDP received message as soon as it is received, without blocking on queue. (#<I>)
Previously after receiving a UDP message, there was a potential block on subsequent delivery to a queue before the log happened. | Parsl_parsl | train | py |
3c0b99f7e798108f3ba7e40ec29d607364f06a80 | diff --git a/godbg.go b/godbg.go
index <HASH>..<HASH> 100644
--- a/godbg.go
+++ b/godbg.go
@@ -303,7 +303,7 @@ func (pdbg *Pdbg) pdbgfw(format string, iow io.Writer, args ...interface{}) stri
}
msg = pmsg + spaces + " " + msg + "\n"
// fmt.Printf("==> MSG '%v'\n", msg) // DBG
- fmt.Fprint(pdbg.Err(), fmt.Sprint(msg))
+ fmt.Fprint(iow, fmt.Sprint(msg))
return res
} | godbg pdbgfw actually uses the io.Writer passed | VonC_godbg | train | go |
2006a0960d3fe7852d20484cf6ef14717b6270db | diff --git a/src/Http/Middleware/EncryptedCookieMiddleware.php b/src/Http/Middleware/EncryptedCookieMiddleware.php
index <HASH>..<HASH> 100644
--- a/src/Http/Middleware/EncryptedCookieMiddleware.php
+++ b/src/Http/Middleware/EncryptedCookieMiddleware.php
@@ -66,7 +66,7 @@ class EncryptedCookieMiddleware
* @param string $cipherType The cipher type to use. Defaults to 'aes', but can also be 'rijndael' for
* backwards compatibility.
*/
- public function __construct(array $cookieNames = [], $key, $cipherType = 'aes')
+ public function __construct(array $cookieNames, $key, $cipherType = 'aes')
{
$this->cookieNames = $cookieNames;
$this->key = $key; | Fix defaulted argument before required one. | cakephp_cakephp | train | php |
487cf1075135914c5b4ffa85b716189c74e1e664 | diff --git a/panthrMath/distributions/beta.js b/panthrMath/distributions/beta.js
index <HASH>..<HASH> 100644
--- a/panthrMath/distributions/beta.js
+++ b/panthrMath/distributions/beta.js
@@ -4,8 +4,16 @@ define(function(require) {
/**
* Provides density function, cumulative distribution function,
* quantile function, and random number generator
- * for the Beta distribution.
+ * for the Beta distribution, which is defined by the pdf
+ * $$p(x;a,b) = \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}x^{(a-1)}(1-x)^{(b-1)}$$
+ * where $x\in[0,1]$ and the parameters $a,b > 0$.
*
+ * `dbeta` provides access to this probability density function,
+ * `pbeta` to the cumulative density, `qbeta` to the quantile (inverse cdf)
+ * and `rbeta` to random deviates.
+ *
+ * Finally, you can use `betadistr` to obtain an object
+ * representing the distribution for some values of the parameters.
* @module distributions.beta
* @memberof distributions
* @author Haris Skiadas <skiadas@hanover.edu>, Barb Wahl <wahl@hanover.edu> | Expand doc for beta distribution. Ref #<I> | PanthR_panthrMath | train | js |
3a69c356ddd2a09eb58e52d2af2ef0aece564c36 | diff --git a/booty/__main__.py b/booty/__main__.py
index <HASH>..<HASH> 100644
--- a/booty/__main__.py
+++ b/booty/__main__.py
@@ -51,3 +51,6 @@ def main(hexfile, port, baudrate, load, verify):
logger.info('device verified!')
else:
logger.warning('device verification failed')
+
+if __name__ == '__main__':
+ main() | Added a 'if name == main' statement | slightlynybbled_booty | train | py |
851051cb6a0ef50e064689d17e90fcbf8716b41c | diff --git a/modules/angular-meteor-methods.js b/modules/angular-meteor-methods.js
index <HASH>..<HASH> 100644
--- a/modules/angular-meteor-methods.js
+++ b/modules/angular-meteor-methods.js
@@ -7,7 +7,7 @@ angularMeteorMethods.service('$methods', ['$q',
var deferred = $q.defer();
- [].push.call(arguments, function (err, data) {
+ Array.prototype.push.call(arguments, function (err, data) {
if (err)
deferred.reject(err);
else | Avoid creating a new array for each method calling - | Urigo_angular-meteor | train | js |
ca91bc95d694d7005dcc8f17a2f01ff1eb8e38d0 | diff --git a/lib/editor/tinymce/lib.php b/lib/editor/tinymce/lib.php
index <HASH>..<HASH> 100644
--- a/lib/editor/tinymce/lib.php
+++ b/lib/editor/tinymce/lib.php
@@ -81,17 +81,17 @@ class tinymce_texteditor extends texteditor {
$lang = current_language();
$contentcss = $PAGE->theme->editor_css_url()->out(false);
- $xmedia = '';
$context = empty($options['context']) ? get_context_instance(CONTEXT_SYSTEM) : $options['context'];
+
+ $xmedia = 'moodlemedia,'; // HQ thinks it should be always on, so it is no matter if it will actually work or not
+ /*
if (!empty($options['legacy'])) {
$xmedia = 'moodlemedia,';
} else {
if (!empty($options['noclean']) or !empty($options['trusted'])) {
}
- }
+ }*/
- // TODO: enabled moodlemedia
- $xmedia = 'moodlemedia,';
$filters = filter_get_active_in_context($context);
if (array_key_exists('filter/tex', $filters)) {
$xdragmath = 'dragmath,'; | just explaining the status of moodlemedia plugin | moodle_moodle | train | php |
851253723d3f83c6927e00e4ef423a16842faeca | diff --git a/src/helpers/DocsGenerator.js b/src/helpers/DocsGenerator.js
index <HASH>..<HASH> 100644
--- a/src/helpers/DocsGenerator.js
+++ b/src/helpers/DocsGenerator.js
@@ -4,7 +4,7 @@ const TAB = ' ';
const LINE_BREAK = '\n';
export function generateSnippet(instance) {
- const componentName = instance.constructor.name;
+ const componentName = instance.constructor.displayName;
const defaultProps = instance.constructor.defaultProps || {};
const componentProps = instance.props || {};
let snippet = `<${componentName}`; | fix DocsGenerator to use displayName instead of class name to avoid minify issues | wix_react-native-ui-lib | train | js |
df2b1a4758500d3ac538b30fad2e5a48126ea4a0 | diff --git a/esp8266/scripts/neopixel.py b/esp8266/scripts/neopixel.py
index <HASH>..<HASH> 100644
--- a/esp8266/scripts/neopixel.py
+++ b/esp8266/scripts/neopixel.py
@@ -8,7 +8,7 @@ class NeoPixel:
self.pin = pin
self.n = n
self.buf = bytearray(n * 3)
- self.pin.init(pin.OUT, pin.PULL_NONE)
+ self.pin.init(pin.OUT)
def __setitem__(self, index, val):
r, g, b = val
diff --git a/esp8266/scripts/onewire.py b/esp8266/scripts/onewire.py
index <HASH>..<HASH> 100644
--- a/esp8266/scripts/onewire.py
+++ b/esp8266/scripts/onewire.py
@@ -13,7 +13,7 @@ class OneWire:
def __init__(self, pin):
self.pin = pin
- self.pin.init(pin.OPEN_DRAIN, pin.PULL_NONE)
+ self.pin.init(pin.OPEN_DRAIN)
def reset(self):
return _ow.reset(self.pin) | esp<I>/scripts/: Remove use of pin.PULL_NONE.
This constant is no longer part of hardware API (replaced with just None),
and is a default, so not needed in calls. | micropython_micropython | train | py,py |
44c2f518d24c6d80014212977eab4220dbcb155d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,7 @@ setup(
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
'License :: OSI Approved :: BSD License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Intended Audience :: Developers', | setup: Mark Python <I> as supported | robgolding_tasklib | train | py |
4884f28c8035f98b6cacd68e6476254f553ae020 | diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb
index <HASH>..<HASH> 100644
--- a/railties/test/generators/mailer_generator_test.rb
+++ b/railties/test/generators/mailer_generator_test.rb
@@ -36,12 +36,12 @@ class MailerGeneratorTest < Rails::Generators::TestCase
def test_invokes_default_template_engine
run_generator
assert_file "app/views/notifier/foo.text.erb" do |view|
- assert_match /app\/views\/notifier\/foo$/, view
+ assert_match %r(app/views/notifier/foo\.text\.erb), view
assert_match /<%= @greeting %>/, view
end
assert_file "app/views/notifier/bar.text.erb" do |view|
- assert_match /app\/views\/notifier\/bar$/, view
+ assert_match %r(app/views/notifier/bar\.text\.erb), view
assert_match /<%= @greeting %>/, view
end
end | Also revert mailer generator test changes in 8b<I>f<I> | rails_rails | train | rb |
272161e2cb79d747d6fc08213fb6dba11aa03f86 | diff --git a/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/CallsModule.java b/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/CallsModule.java
index <HASH>..<HASH> 100644
--- a/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/CallsModule.java
+++ b/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/internal/CallsModule.java
@@ -130,7 +130,7 @@ public class CallsModule extends AbsModule {
//on end call update
public void onEndCall(long callId) {
- Log.d(TAG, "end call update");
+ Log.d(TAG, "end call update: " + callId);
ActorRef call = calls.get(callId);
if (call != null) {
Log.d(TAG, "call exist - end it");
@@ -143,7 +143,7 @@ public class CallsModule extends AbsModule {
//after end call update processed by CallActor
public void onCallEnded(long callId) {
- Log.d(TAG, "on callActor ended call");
+ Log.d(TAG, "on callActor ended call: " + callId);
calls.remove(callId);
} | chore(core): calls logging | actorapp_actor-platform | train | java |
1dc238479615ad0392b728ec9c0da449446e55e5 | diff --git a/src/elements/element.point.js b/src/elements/element.point.js
index <HASH>..<HASH> 100644
--- a/src/elements/element.point.js
+++ b/src/elements/element.point.js
@@ -50,7 +50,7 @@ export default class PointElement extends Element {
const me = this;
const options = me.options;
- if (me.skip || options.radius <= 0) {
+ if (me.skip || options.radius < 0.1) {
return;
} | Only draw points when radius >= <I> (#<I>) | chartjs_Chart.js | train | js |
44d696c4af5aa841364b051d2b01da7628de53f5 | diff --git a/dosagelib/comic.py b/dosagelib/comic.py
index <HASH>..<HASH> 100644
--- a/dosagelib/comic.py
+++ b/dosagelib/comic.py
@@ -106,14 +106,18 @@ class ComicImage(object):
with open(fn, 'wb') as comicOut:
for chunk in self.urlobj.iter_content(chunk_size=self.ChunkBytes):
comicOut.write(chunk)
+ comicOut.flush()
+ os.fsync(comicOut.fileno())
self.touch(fn)
+ size = os.path.getsize(fn)
+ if size == 0:
+ raise OSError("empty file %s" % fn)
except Exception:
if os.path.isfile(fn):
os.remove(fn)
raise
else:
- size = strsize(os.path.getsize(fn))
- out.info("Saved %s (%s)." % (fn, size))
+ out.info("Saved %s (%s)." % (fn, strsize(size)))
getHandler().comicDownloaded(self.name, fn)
return fn, True | Flush file contents to disk and check for empty files. | wummel_dosage | train | py |
ac38051a181a2af22de090621854dab7002b3bed | diff --git a/ipv6.js b/ipv6.js
index <HASH>..<HASH> 100644
--- a/ipv6.js
+++ b/ipv6.js
@@ -1066,7 +1066,7 @@ v6.Address.prototype.teredo = function() {
/*
* Returns an object containing the 6to4 properties of the address
*/
-v6.Address.prototype.6to4 = function() {
+v6.Address.prototype.six2four = function() {
/*
- Bits 0 to 15 are set to the 6to4 prefix (2002::/16).
- Bits 16 to 48 embed the IPv4 address of the 6to4 gateway that is used. | Renamed 6to4 to six2four. | beaugunderson_deprecated-javascript-ipv6 | train | js |
cfade6b58a18b8250addb5e29ad49cc3f007cc10 | diff --git a/lib/tmuxinator/project.rb b/lib/tmuxinator/project.rb
index <HASH>..<HASH> 100644
--- a/lib/tmuxinator/project.rb
+++ b/lib/tmuxinator/project.rb
@@ -123,7 +123,7 @@ module Tmuxinator
attach
end
- def pre_window
+ def pre_window
if rbenv?
params = "rbenv shell #{yaml['rbenv']}"
elsif rvm?
@@ -131,7 +131,7 @@ module Tmuxinator
elsif pre_tab?
params = yaml["pre_tab"]
else
- params = yaml["pre_window"]
+ params = yaml["pre_window"]
end
parsed_parameters(params)
end | Removed trailing whitespace causing CI to fail | tmuxinator_tmuxinator | train | rb |
0277c6e89eae6b26d24973440690b9e4984edd4c | diff --git a/tests/org.eclipse.xtext.xbase.tests/src/org/eclipse/xtext/xbase/tests/BasicDependencyCheckTest.java b/tests/org.eclipse.xtext.xbase.tests/src/org/eclipse/xtext/xbase/tests/BasicDependencyCheckTest.java
index <HASH>..<HASH> 100644
--- a/tests/org.eclipse.xtext.xbase.tests/src/org/eclipse/xtext/xbase/tests/BasicDependencyCheckTest.java
+++ b/tests/org.eclipse.xtext.xbase.tests/src/org/eclipse/xtext/xbase/tests/BasicDependencyCheckTest.java
@@ -17,7 +17,7 @@ import org.junit.Test;
public class BasicDependencyCheckTest {
/**
- * Check that org.eclipse.xtext.xbase do not depend on org.eclipse.jdt.core
+ * Check that org.eclipse.xtext.xbase doesn't depend on org.eclipse.jdt.core
* see Bug [364082] Optional dependency to JDT from xbase core bundle
*/
@Test | [mvn-tests] removed some accidently committed files (Ignore fsa test) | eclipse_xtext-extras | train | java |
8c5ce201dc1ec2973982cf88a7e647da1be74c3f | diff --git a/templates/js/atk4_univ.js b/templates/js/atk4_univ.js
index <HASH>..<HASH> 100644
--- a/templates/js/atk4_univ.js
+++ b/templates/js/atk4_univ.js
@@ -17,10 +17,12 @@ $.univ = function(){
$.univ._import=function(name,fn){
$.univ[name]=function(){
+ var ret;
+
if(!$.univ.ignore){
- fn.apply($.univ,arguments);
+ ret=fn.apply($.univ,arguments);
}
- return $.univ;
+ return ret?ret:$.univ;
}
}
@@ -203,7 +205,7 @@ $.each({
},$.univ._import
);
-
+////// Define deprecated functions ////////////
$.each([
'openExpander'
],function(name,val){ | univ chain will return function value if it was returned.. | atk4_atk4 | train | js |
efa3175007d2d4e392bc44e11a6419431686412e | diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -5,4 +5,4 @@
package gin
// Version is the current gin framework's version.
-const Version = "v1.7.3"
+const Version = "v1.7.4" | Update version.go (#<I>) | gin-gonic_gin | train | go |
5840e570799296b34f3c23d40ab4e091a3a486f9 | diff --git a/lib/pipeline.js b/lib/pipeline.js
index <HASH>..<HASH> 100644
--- a/lib/pipeline.js
+++ b/lib/pipeline.js
@@ -14,10 +14,8 @@ Pipeline.prototype.build = function(abi) {
var self = this;
for(var targetFile in this.assetFiles) {
- // TODO: run the plugin here instead, for each file
-
var contentFiles = this.assetFiles[targetFile].map(file => {
- self.logger.info("reading " + file.filename);
+ self.logger.trace("reading " + file.filename);
var pipelinePlugins = this.plugins.getPluginsFor('pipeline'); | log pipeline file read on a trace level instead of info to reduce initial console log size | embark-framework_embark | train | js |
a3323eb2cd14ff03c9aa9af4da51b32683191a4c | diff --git a/lib/server-code/runners/tasks/parse-service.js b/lib/server-code/runners/tasks/parse-service.js
index <HASH>..<HASH> 100644
--- a/lib/server-code/runners/tasks/parse-service.js
+++ b/lib/server-code/runners/tasks/parse-service.js
@@ -5,6 +5,15 @@ const logger = require('../../../util/logger'),
argsUtil = require('./util/args'),
ServerCodeModel = require('../../model');
+function getFilesToParse(codePath) {
+ const patterns = [
+ `${codePath}/**/*.js`,
+ `!${codePath}/node_modules/**`
+ ];
+
+ return file.expand(patterns, { nodir: true });
+}
+
/**
* @typedef {Object} CustomServiceParserArgs
* @property {String} fileName
@@ -19,7 +28,7 @@ const logger = require('../../../util/logger'),
function parseService(task) {
logger.debug(`PARSE SERVICE TASK: ${JSON.stringify(task)}`);
- const files = file.expand([`${task.codePath}/**`], { nodir: true });
+ const files = getFilesToParse(task.codePath);
const model = ServerCodeModel.build(task.codePath, files);
if (model.errors.length) { | fix (parse-service) node_modules folder should not be included into server-code analyse | Backendless_JS-Code-Runner | train | js |
f53ab637b07a45347ed15b2b66bca117caa6770d | diff --git a/vent/helpers/meta.py b/vent/helpers/meta.py
index <HASH>..<HASH> 100644
--- a/vent/helpers/meta.py
+++ b/vent/helpers/meta.py
@@ -1,4 +1,6 @@
+import docker
import os
+import platform
def Version():
version = ''
@@ -10,3 +12,34 @@ def Version():
except Exception as e: # pragma: no cover
pass
return version
+
+def System():
+ return platform.system()
+
+def Docker():
+ docker_info = {'server':{}, 'env':'', 'type':'', 'os':''}
+
+ # get docker server version
+ try:
+ d_client = docker.from_env()
+ docker_info['server'] = d_client.version()
+ except Exception as e: # pragma: no cover
+ pass
+
+ # get operating system
+ system = System()
+ docker_info['os'] = system
+
+ # check if native or using docker-machine
+ if 'DOCKER_MACHINE_NAME' in os.environ:
+ # using docker-machine
+ docker_info['env'] = os.environ['DOCKER_MACHINE_NAME']
+ docker_info['type'] = 'docker-machine'
+ elif 'DOCKER_HOST' in os.environ:
+ # not native
+ docker_info['env'] = os.environ['DOCKER_HOST']
+ docker_info['type'] = 'remote'
+ else:
+ # using "local" server
+ docker_info['type'] = 'native'
+ return docker_info | helpers for docker setup and system | CyberReboot_vent | train | py |
e60e525063fa7b963bcda550c16f261b7867d364 | diff --git a/components/ensureOldIEClassName.js b/components/ensureOldIEClassName.js
index <HASH>..<HASH> 100644
--- a/components/ensureOldIEClassName.js
+++ b/components/ensureOldIEClassName.js
@@ -4,6 +4,6 @@ if (global.document) {
const ieVerison = parseInt(div.innerHTML, 10);
if (ieVerison) {
- document.body.className += ' rt-ie' + ieVerison;
+ document.documentElement.className += ' rt-ie' + ieVerison;
}
} | Add old IE class to the html tag, since body may be unavailable yet. | skbkontur_retail-ui | train | js |
232709b1beb2577804b0737e33503255eccd6a49 | diff --git a/source/Internal/Module/Command/ModuleActivateCommand.php b/source/Internal/Module/Command/ModuleActivateCommand.php
index <HASH>..<HASH> 100644
--- a/source/Internal/Module/Command/ModuleActivateCommand.php
+++ b/source/Internal/Module/Command/ModuleActivateCommand.php
@@ -63,7 +63,7 @@ class ModuleActivateCommand extends Command
/** @var Module $module */
if (isset($modules[$moduleId])) {
- $this->activateModule($output, $modules[$moduleId], $moduleId);
+ $this->activateModule($output, $modules[$moduleId]);
} else {
$output->writeLn('<error>'.sprintf(static::MESSAGE_MODULE_NOT_FOUND, $moduleId).'</error>');
} | Remove argument in method call
Method accepts only 2 arguments. | OXID-eSales_oxideshop_ce | train | php |
ee61a5daf450ac4533cac8c9ccfb822e502b941e | diff --git a/server/src/components/App.js b/server/src/components/App.js
index <HASH>..<HASH> 100644
--- a/server/src/components/App.js
+++ b/server/src/components/App.js
@@ -166,7 +166,7 @@ export default class App extends Component {
<h6 className="d-flex flex-items-center text-gray mb-1"><Octicon icon={Pin} height={12} width={12} className="mr-1" /> Pinned</h6>
<ul className="Box list-style-none pl-0 mb-2">
{filtered.filter(this.isPinned).map((item, i, arr) => {
- const id = item['x-github-delivery']
+ const id = item['x-github-delivery'] || item.timestamp
return <ListItem key={id} pinned togglePinned={this.togglePinned} item={item} last={i === arr.length - 1} />
})}
</ul> | Handle missing x-github-delivery
Using timestamp for reactjs key when x-github-delivery header is not available | probot_smee-client | train | js |
9026e959105d9c956edead5e57a0f68b9129d446 | diff --git a/gist/client.py b/gist/client.py
index <HASH>..<HASH> 100644
--- a/gist/client.py
+++ b/gist/client.py
@@ -891,7 +891,6 @@ def main(argv=sys.argv[1:], config=None):
except UserError as e:
sys.stderr.write(u"ERROR: {}\n".format(str(e)))
- sys.stderr.write(u"\n{}".format(__doc__))
sys.stderr.flush()
sys.exit(1)
except GistError as e: | client: don't print usage on error | jdowner_gist | train | py |
c2dc137c52d17bf12aff94ad051370c0f106b322 | diff --git a/src/Manipulations.php b/src/Manipulations.php
index <HASH>..<HASH> 100644
--- a/src/Manipulations.php
+++ b/src/Manipulations.php
@@ -19,6 +19,7 @@ class Manipulations
public const CROP_BOTTOM_RIGHT = 'crop-bottom-right';
public const ORIENTATION_AUTO = 'auto';
+ public const ORIENTATION_0 = 0;
public const ORIENTATION_90 = 90;
public const ORIENTATION_180 = 180;
public const ORIENTATION_270 = 270; | Added constant to Manipulations.php (#<I>)
Added additional zero orientation constant to Manipulations.php to allow zero orientation value for correct rotation ignoring exif data | spatie_image | train | php |
b97ac84a34b38d39ffe1b13923f7a9021b355e3e | diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index <HASH>..<HASH> 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -927,7 +927,7 @@ class Validation extends Object {
trigger_error(sprintf(__('Could not find %s class, unable to complete validation.', true), $className), E_USER_WARNING);
return false;
}
- if (!method_exists($className, $method)) {
+ if (!is_callable(array($className, $method))) {
trigger_error(sprintf(__('Method %s does not exist on %s unable to complete validation.', true), $method, $className), E_USER_WARNING);
return false;
} | Fixing method_exists use in Validation for php4 compatibility. | cakephp_cakephp | train | php |
8fa05f64ccd6cd9b8e5d405c4581d5609406a2b0 | diff --git a/lib/searchkick/index.rb b/lib/searchkick/index.rb
index <HASH>..<HASH> 100644
--- a/lib/searchkick/index.rb
+++ b/lib/searchkick/index.rb
@@ -38,6 +38,10 @@ module Searchkick
client.indices.get_settings index: name
end
+ def update_settings(settings)
+ client.indices.put_settings index: name, body: settings
+ end
+
def promote(new_name)
old_indices =
begin | Added update_settings method [skip ci] | ankane_searchkick | train | rb |
1e2011681b2ed3bf65e556cd308aa8ba5dc69608 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -6,7 +6,7 @@ if (process.env.TRAVIS) {
repo = process.env.TRAVIS_REPO_SLUG
sha = process.env.TRAVIS_PULL_REQUEST_SHA || process.env.TRAVIS_COMMIT
event = process.env.TRAVIS_EVENT_TYPE
- commit_message = TRAVIS_COMMIT_MESSAGE
+ commit_message = process.env.TRAVIS_COMMIT_MESSAGE
branch = process.env.TRAVIS_EVENT_TYPE === 'push'
? process.env.TRAVIS_BRANCH | aah, am i sleepy? | siddharthkp_ci-env | train | js |
50cbbf77448c20a482b60e342796fc18845a908c | diff --git a/src/onelogin/saml2/response.py b/src/onelogin/saml2/response.py
index <HASH>..<HASH> 100644
--- a/src/onelogin/saml2/response.py
+++ b/src/onelogin/saml2/response.py
@@ -591,7 +591,7 @@ class OneLogin_Saml2_Response(object):
if attr_key:
if not allow_duplicates and attr_key in attributes:
raise OneLogin_Saml2_ValidationError(
- f'Found an Attribute element with duplicated {attr_name}',
+ 'Found an Attribute element with duplicated ' + attr_name,
OneLogin_Saml2_ValidationError.DUPLICATED_ATTRIBUTE_NAME_FOUND
) | Changed to support Python2 Syntax | onelogin_python3-saml | train | py |
bf5c9a513b9493085c9de60c9605881742020a61 | diff --git a/lib/builder/ios/modifyplist.js b/lib/builder/ios/modifyplist.js
index <HASH>..<HASH> 100644
--- a/lib/builder/ios/modifyplist.js
+++ b/lib/builder/ios/modifyplist.js
@@ -28,7 +28,7 @@ module.exports = exports = function () {
this.plistObject.CFBundleName = this.productName
}
- if (this.interfaceOrientations.iPhone) {
+ if (this.interfaceOrientations && this.interfaceOrientations.iPhone) {
this.plistObject.UISupportedInterfaceOrientations = []
for (let orientation in this.interfaceOrientations.iPhone) {
this.plistObject.UISupportedInterfaceOrientations.push('UIInterfaceOrientation' + orientation)
@@ -37,7 +37,7 @@ module.exports = exports = function () {
this.plistObject.UISupportedInterfaceOrientations = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown', 'UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight']
}
- if (this.interfaceOrientations.iPad) {
+ if (this.interfaceOrientations && this.interfaceOrientations.iPad) {
this.plistObject['UISupportedInterfaceOrientations~ipad'] = []
for (let orientation in this.interfaceOrientations.iPad) {
this.plistObject['UISupportedInterfaceOrientations~ipad'].push('UIInterfaceOrientation' + orientation) | Add checks in case package doesn't include orientation stuff | vigour-io_wrapper | train | js |
74dd9c52f0ff707b13b3273ba9b81537e8fa3667 | diff --git a/cherrypy/test/helper.py b/cherrypy/test/helper.py
index <HASH>..<HASH> 100644
--- a/cherrypy/test/helper.py
+++ b/cherrypy/test/helper.py
@@ -104,11 +104,11 @@ class LocalSupervisor(Supervisor):
if td:
td()
+ cherrypy.engine.exit()
+
for name, server in getattr(cherrypy, 'servers', {}).items():
server.unsubscribe()
del cherrypy.servers[name]
-
- cherrypy.engine.exit()
class NativeServerSupervisor(LocalSupervisor): | testAdditionalServers was causing test_states to hang because the former did not stop() all its servers. | cherrypy_cheroot | train | py |
1a3cf31dc47605ef09d3e9141d0c7c6bad29f52b | diff --git a/pgi/overrides/GLib.py b/pgi/overrides/GLib.py
index <HASH>..<HASH> 100644
--- a/pgi/overrides/GLib.py
+++ b/pgi/overrides/GLib.py
@@ -569,7 +569,8 @@ class Source(GLib.Source):
can_recurse = property(__get_can_recurse, __set_can_recurse)
Source = override(Source)
-__all__.append('Source')
+# FIXME
+#__all__.append('Source')
class Idle(Source):
@@ -583,7 +584,7 @@ class Idle(Source):
if priority != GLib.PRIORITY_DEFAULT:
self.set_priority(priority)
-__all__.append('Idle')
+#__all__.append('Idle')
class Timeout(Source):
@@ -596,7 +597,7 @@ class Timeout(Source):
if priority != GLib.PRIORITY_DEFAULT:
self.set_priority(priority)
-__all__.append('Timeout')
+#__all__.append('Timeout')
# backwards compatible API | Remove GLib.Source overrides for now; breaks docgen | pygobject_pgi | train | py |
e7ce6f943b26b012799e18f5f235f8e2949e8079 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -67,10 +67,13 @@ example_gallery_config = dict(
if on_rtd:
import subprocess as spr
print('Registering kernel')
- spr.check_call([sys.executable] +
- ('-m ipykernel install --user --name python3 '
- '--display-name python3').split(),
- stderr=sys.stderr, stdout=sys.stdout)
+ with open('output.log', 'w') as f:
+ spr.call([sys.executable] +
+ ('-m ipykernel install --user --name python3 '
+ '--display-name python3').split(),
+ stderr=f, stdout=f)
+ with open('output.log') as f:
+ print(f.read())
# The encoding of source files. | Output subprocess to logfile and print the content | Chilipp_sphinx-nbexamples | train | py |
bc66f8df524d909b1b712a7c9525bdbbf8c58361 | diff --git a/plenum/cli/cli.py b/plenum/cli/cli.py
index <HASH>..<HASH> 100644
--- a/plenum/cli/cli.py
+++ b/plenum/cli/cli.py
@@ -719,7 +719,12 @@ Commands:
client_action = matchedVars.get('cli_action')
if client_action == 'send':
msg = matchedVars.get('msg')
- actualMsgRepr = ast.literal_eval(msg)
+ try:
+ actualMsgRepr = ast.literal_eval(msg)
+ except Exception as ex:
+ self.print("error evaluating msg expression: {}".
+ format(ex), Token.BoldOrange)
+ return
self.sendMsg(client_name, actualMsgRepr)
elif client_action == 'show':
req_id = matchedVars.get('req_id') | cli now handles msg expression errors more elegantly | hyperledger_indy-plenum | train | py |
9594f26b1aba486fffd55c62fce999c64a871c9b | diff --git a/examples/thread-loader/webpack.config.js b/examples/thread-loader/webpack.config.js
index <HASH>..<HASH> 100644
--- a/examples/thread-loader/webpack.config.js
+++ b/examples/thread-loader/webpack.config.js
@@ -8,7 +8,7 @@ module.exports = {
entry: './src/index.ts',
output: { filename: 'dist/index.js' },
module: {
- rules: {
+ rules: [{
test: /\.tsx?$/,
use: [
{ loader: 'cache-loader' },
@@ -26,7 +26,7 @@ module.exports = {
}
}
]
- }
+ }]
},
resolve: {
extensions: ['.ts', '.tsx', 'js'] | Issue/thread loader webpack config (#<I>)
* syntax error instead of type error
* rules should be an array
* reset to upstream
* Fixed rules declaration in webpack.config.js | TypeStrong_ts-loader | train | js |
cf2ba83d66755e52d22b3ea4a9ba68ab495572d2 | diff --git a/packages/vuetify/src/components/VMenu/mixins/menu-keyable.js b/packages/vuetify/src/components/VMenu/mixins/menu-keyable.js
index <HASH>..<HASH> 100644
--- a/packages/vuetify/src/components/VMenu/mixins/menu-keyable.js
+++ b/packages/vuetify/src/components/VMenu/mixins/menu-keyable.js
@@ -53,13 +53,6 @@ export default {
}
},
changeListIndex (e) {
- if ([
- keyCodes.down,
- keyCodes.up,
- keyCodes.enter
- ].includes(e.keyCode)
- ) e.preventDefault()
-
// For infinite scroll and autocomplete, re-evaluate children
this.getTiles()
@@ -71,7 +64,9 @@ export default {
this.listIndex--
} else if (e.keyCode === keyCodes.enter && this.listIndex !== -1) {
this.tiles[this.listIndex].click()
- }
+ } else { return }
+ // One of the conditions was met, prevent default action (#2988)
+ e.preventDefault()
},
getTiles () {
this.tiles = this.$refs.content.querySelectorAll('.v-list__tile') | fix(VMenu): don't prevent default on keydown unless action taken (#<I>)
* fix(VMenu): don't prevent default on keydown unless action taken
fixes #<I>
* refactor: dry up code | vuetifyjs_vuetify | train | js |
77afe28eb1d5cf454f7e64be20420051c30596a2 | diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
@@ -405,8 +405,8 @@ public class Execution implements Serializable {
}
else {
if (!(success.equals(Messages.getAcknowledge()))) {
- markFailed(new Exception("Failed to deploy the task to slot " + slot +
- ": Response was not of type Acknowledge"));
+ markFailed(new Exception("Failed to deploy the task to slot. Response was not of type 'Acknowledge', but was " + success
+ + "\nSlot Details: " + slot));
}
}
} | [FLINK-<I>] [runtime] Clarify error message when Flink cannot deploy task to slot
This closes #<I> | apache_flink | train | java |
63226d002df55bc6029e90cac91c7007c4777ee4 | diff --git a/non-schema/java/src/org/whattf/checker/UnsupportedFeatureChecker.java b/non-schema/java/src/org/whattf/checker/UnsupportedFeatureChecker.java
index <HASH>..<HASH> 100644
--- a/non-schema/java/src/org/whattf/checker/UnsupportedFeatureChecker.java
+++ b/non-schema/java/src/org/whattf/checker/UnsupportedFeatureChecker.java
@@ -33,11 +33,11 @@ public class UnsupportedFeatureChecker extends Checker {
} else if ("bdi" == localName) {
warn("The \u201Cbdi\u201D element is not supported by browsers yet.");
} else if ("blockquote" == localName) {
- if (atts.getIndex("", "cite") > -1 && !w3cBranding) {
+ if (atts.getIndex("", "cite") > -1) {
warn("The \u201Ccite\u201D attribute on the \u201Cblockquote\u201D element is not supported by browsers yet.");
}
} else if ("q" == localName) {
- if (atts.getIndex("", "cite") > -1 && !w3cBranding) {
+ if (atts.getIndex("", "cite") > -1) {
warn("The \u201Ccite\u201D attribute on the \u201Cq\u201D element is not supported by browsers yet.");
}
} else if ("a" == localName) { | Restore warning about @cite for W3C service. | validator_validator | train | java |
f942682c3e51bc5fa80b070f9b0b107dfdbf91b1 | diff --git a/lib/dpl/provider/bintray.rb b/lib/dpl/provider/bintray.rb
index <HASH>..<HASH> 100644
--- a/lib/dpl/provider/bintray.rb
+++ b/lib/dpl/provider/bintray.rb
@@ -431,7 +431,7 @@ module DPL
return upload_files
end
- def deploy
+ def push_app
read_descriptor
check_and_create_package
check_and_create_version | Fix bintray provider
To conform to the convention (and not override
`DPL::Provider#deploy`), and call `#check_auth`, which will set
ivars necessary for authentication. | travis-ci_dpl | train | rb |
2b4bce1f90e9cb641107c5bb75a23daac7e25b06 | diff --git a/anonymoususage/analysis.py b/anonymoususage/analysis.py
index <HASH>..<HASH> 100644
--- a/anonymoususage/analysis.py
+++ b/anonymoususage/analysis.py
@@ -47,7 +47,7 @@ def plot_statistic(dbconn, table_names, uuid=None, date_limits=(None, None), dat
logging.warning('No data for found. Failed to create plot.')
return
- plt.figlegend(handles, plotted_tables, loc='upper left', ncol=max(1, 3 * (len(plotted_tables) / 3)), labelspacing=0.)
+ # plt.figlegend(handles, plotted_tables, loc='upper left', ncol=max(1, 3 * (len(plotted_tables) / 3)), labelspacing=0.)
plt.figlegend(handles, uuids, loc='lower left', labelspacing=0.)
if date_limits[0] and date_limits[1]: | don't show legend for table names.. does not make sense | lobocv_anonymoususage | train | py |
61b8f6f147556b381af37ce05166e6a3bf766120 | diff --git a/Generator/PluginYAML.php b/Generator/PluginYAML.php
index <HASH>..<HASH> 100644
--- a/Generator/PluginYAML.php
+++ b/Generator/PluginYAML.php
@@ -38,13 +38,20 @@ class PluginYAML extends BaseGenerator {
public static function componentDataDefinition() {
return parent::componentDataDefinition() + [
'plugin_type' => static::getPluginTypePropertyDefinition(),
+ 'prefix_name' => [
+ 'internal' => TRUE,
+ 'format' => 'boolean',
+ 'default' => TRUE,
+ ],
'plugin_name' => [
'label' => 'Plugin name',
'description' => 'The plugin name. A module name prefix is added automatically.',
'required' => TRUE,
'processing' => function($value, &$component_data, $property_name, &$property_info) {
- // YAML plugin names use dots as glue.
- $component_data['plugin_name'] = $component_data['root_component_name'] . '.' . $component_data['plugin_name'];
+ if ($component_data['prefix_name']) {
+ // YAML plugin names use dots as glue.
+ $component_data['plugin_name'] = $component_data['root_component_name'] . '.' . $component_data['plugin_name'];
+ }
},
],
// These are different for each plugin type, so internal for now. | Added option to YAML plugin to not prefix the plugin name with the module name. | drupal-code-builder_drupal-code-builder | train | php |
c4e43dbaa219548c2d6bfb4064e498a4ffac8ac0 | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -960,7 +960,9 @@ func (s *server) OutboundPeerConnected(connReq *connmgr.ConnReq, conn net.Conn)
// entry for this peer from the map.
if connReqs, ok := s.persistentConnReqs[pubStr]; ok {
for _, pConnReq := range connReqs {
- if pConnReq.ID() != connReq.ID() {
+ if connReq != nil &&
+ pConnReq.ID() != connReq.ID() {
+
s.connMgr.Remove(pConnReq.ID())
}
}
@@ -977,7 +979,11 @@ func (s *server) OutboundPeerConnected(connReq *connmgr.ConnReq, conn net.Conn)
srvrLog.Warnf("Established outbound connection to "+
"peer %x, but already connected, dropping conn",
nodePub.SerializeCompressed())
- s.connMgr.Remove(connReq.ID())
+
+ if connReq != nil {
+ s.connMgr.Remove(connReq.ID())
+ }
+
conn.Close()
return
} | server: avoid nil pointer deference within OutboundPeerConnected | lightningnetwork_lnd | train | go |
723e5dfc322da6bb9e4368759d4896585534acdc | diff --git a/core/loadOptions.js b/core/loadOptions.js
index <HASH>..<HASH> 100644
--- a/core/loadOptions.js
+++ b/core/loadOptions.js
@@ -9,7 +9,9 @@ var colors = require('colors'); // jshint ignore:line
var silent;
-var legacyOptionsWarn = function(oldStruct, newStruct){
+var legacyOptionsWarn = function(oldStruct, newStruct, fileName){
+ var _fileName = fileName || 'options.js';
+
// Shout warn message only once
if (global.legacyOptionsWarnOnce && global.legacyOptionsWarnOnce.indexOf(oldStruct) > -1) return; | return missed `_fileName` definition | sourcejs_Source | train | js |
20aafac02b158c99ed8fc62bf9bd0b618c639cb0 | diff --git a/src/jsonselect.js b/src/jsonselect.js
index <HASH>..<HASH> 100644
--- a/src/jsonselect.js
+++ b/src/jsonselect.js
@@ -209,11 +209,12 @@
}
}
if (m && cs.has) {
+ // perhaps we should augment forEach to handle a return value
+ // that indicates "client cancels traversal"?
+ var bail = function() { throw 42; };
for (var i = 0; i < cs.has.length; i++) {
try {
- forEach(cs.has[i], node, function() {
- throw 42;
- });
+ forEach(cs.has[i], node, bail);
} catch (e) {
if (e === 42) continue;
} | document the ugly, and comment on how to make it less so | lloyd_JSONSelect | train | js |
c5d7bc3f2e26b74d2dd67df853c4130057c4d550 | diff --git a/dropwizard-hibernate/src/test/java/io/dropwizard/hibernate/JerseyIntegrationTest.java b/dropwizard-hibernate/src/test/java/io/dropwizard/hibernate/JerseyIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/dropwizard-hibernate/src/test/java/io/dropwizard/hibernate/JerseyIntegrationTest.java
+++ b/dropwizard-hibernate/src/test/java/io/dropwizard/hibernate/JerseyIntegrationTest.java
@@ -78,12 +78,10 @@ public class JerseyIntegrationTest extends JerseyTest {
}
private SessionFactory sessionFactory;
- private TimeZone defaultTZ;
@Override
@After
public void tearDown() throws Exception {
- TimeZone.setDefault(defaultTZ);
super.tearDown();
if (sessionFactory != null) {
@@ -92,14 +90,6 @@ public class JerseyIntegrationTest extends JerseyTest {
}
@Override
- public void setUp() throws Exception {
- super.setUp();
-
- this.defaultTZ = TimeZone.getDefault();
- TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
- }
-
- @Override
protected Application configure() {
final MetricRegistry metricRegistry = new MetricRegistry();
final SessionFactoryFactory factory = new SessionFactoryFactory(); | Don't override the JVM timezone in a Hibernate integration test
HSQLDB correctly retrieves a timestamp from the DB in the
JVM timezone, Jadira converts it to DateTime and then Jackson
serializes it to JSON in UTC.
So all assertions in UTC will pass regardless of the JVM
timezone. | dropwizard_dropwizard | train | java |
d8101729711ac6aab9b2e7072dda06856df99abd | diff --git a/src/main/java/me/moocar/logbackgelf/Transport.java b/src/main/java/me/moocar/logbackgelf/Transport.java
index <HASH>..<HASH> 100644
--- a/src/main/java/me/moocar/logbackgelf/Transport.java
+++ b/src/main/java/me/moocar/logbackgelf/Transport.java
@@ -1,10 +1,7 @@
package me.moocar.logbackgelf;
import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.SocketException;
+import java.net.*;
import java.util.List;
/**
@@ -14,6 +11,7 @@ public class Transport {
private final InetAddress graylog2ServerAddress;
private final int graylog2ServerPort;
+ private final SocketAddress loopbackAddress = new InetSocketAddress("localhost", 0);
public Transport(int graylog2ServerPort, InetAddress graylog2ServerAddress) {
this.graylog2ServerPort = graylog2ServerPort;
@@ -67,7 +65,7 @@ public class Transport {
try {
- return new DatagramSocket();
+ return new DatagramSocket(loopbackAddress);
} catch (SocketException ex) { | Changed the DatagramSocket constructor to use the lookback address to bind on. This fixes an issue on Windows systems where the DatagramSocket.close() takes <I> ms to unbind when connecting to a non exisitig or disabled graylog server in the same subnet. | Moocar_logback-gelf | train | java |
ca1ea26ff8ad0c9832da3884ccfc1aad37e01852 | diff --git a/djangobot/client.py b/djangobot/client.py
index <HASH>..<HASH> 100644
--- a/djangobot/client.py
+++ b/djangobot/client.py
@@ -1,7 +1,7 @@
import json
from autobahn.twisted.websocket import (WebSocketClientProtocol,
- WebSocketClientFactory, connectWS)
+ WebSocketClientFactory, connectWS)
import channels
from twisted.internet import reactor, ssl
from twisted.internet.ssl import ClientContextFactory
@@ -78,7 +78,11 @@ class SlackClientProtocol(WebSocketClientProtocol):
pass
# translate channel
try:
- channel_id = message.pop('channel')
+ if type(message['channel']) == str:
+ channel_id = message.pop('channel')
+ else:
+ channel_id = message.pop('channel')['id']
+ self.slack.reload_channels()
channel = self.slack.channel_from_id(channel_id)
message[u'channel'] = channel['name']
except (KeyError, IndexError, ValueError):
diff --git a/djangobot/slack.py b/djangobot/slack.py
index <HASH>..<HASH> 100644
--- a/djangobot/slack.py
+++ b/djangobot/slack.py
@@ -123,3 +123,6 @@ class SlackAPI(object):
raise ValueError('Unknown channel for id: "{}"'.format(channel_id))
else:
return channel
+
+ def reload_channels(self):
+ self._channels = None | Recognize newly created channels and channels objects instead of channel ids. | djangobot_djangobot | train | py,py |
1eea4d9734acacbcc4729ad380f121529787d452 | diff --git a/src/CyberSpectrum/Translation/Contao/StringValue.php b/src/CyberSpectrum/Translation/Contao/StringValue.php
index <HASH>..<HASH> 100644
--- a/src/CyberSpectrum/Translation/Contao/StringValue.php
+++ b/src/CyberSpectrum/Translation/Contao/StringValue.php
@@ -33,6 +33,11 @@ class StringValue extends AbstractParser
$this->debug(' - enter.');
while (true) {
+ // String concatenation.
+ if ($this->tokenIs('.') || $this->tokenIs(T_COMMENT)) {
+ $this->getNextToken();
+ continue;
+ }
if ($this->tokenIs(T_CONSTANT_ENCAPSED_STRING)) {
$token = $this->getToken();
$this->data[] = stripslashes(substr($token[1], 1, -1)); | Fix issue in php parsing. | cyberspectrum_contao-toolbox | train | php |
cb457fb6249d52cb4e0070441a41f1bdd7eae1b7 | diff --git a/src/support/db/mongoose/schema.js b/src/support/db/mongoose/schema.js
index <HASH>..<HASH> 100644
--- a/src/support/db/mongoose/schema.js
+++ b/src/support/db/mongoose/schema.js
@@ -5,11 +5,6 @@ var mongoose = require('mongoose-q')(require('mongoose')),
waigo = require('waigo');
-var viewObjectMethodName = Object.keys(
- waigo.load('support/mixins').HasViewObject
-).pop();
-
-
/** @type {Object} Base schema class. */
@@ -77,13 +72,12 @@ exports.create = function(schemaDescription, options) {
});
-
/**
* Get view object representation of this model.
* @param {Object} ctx Request context.
* @return {Object}
*/
- schema.method(viewObjectMethodName, function*(ctx) {
+ schema.method('toViewObject', function*(ctx) {
var self = this;
var ret = {}; | remove dependency on waigo.load | waigo_mongo | train | js |
fc2c2be0875ec625d89acfb9b5ea641165c3a383 | diff --git a/app/controllers/alchemy/passwords_controller.rb b/app/controllers/alchemy/passwords_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/alchemy/passwords_controller.rb
+++ b/app/controllers/alchemy/passwords_controller.rb
@@ -1,6 +1,7 @@
module Alchemy
class PasswordsController < ::Devise::PasswordsController
- include Locale
+ include Alchemy::Locale
+ include Alchemy::SSLProtection
before_action { enforce_ssl if ssl_required? && !request.ssl? }
diff --git a/app/controllers/alchemy/user_sessions_controller.rb b/app/controllers/alchemy/user_sessions_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/alchemy/user_sessions_controller.rb
+++ b/app/controllers/alchemy/user_sessions_controller.rb
@@ -1,6 +1,7 @@
module Alchemy
class UserSessionsController < ::Devise::SessionsController
include Alchemy::Locale
+ include Alchemy::SSLProtection
before_action except: 'destroy' do
enforce_ssl if ssl_required? && !request.ssl? | Include new Alchemy::SSLProtection module
So we don't have to patch these controllers. | AlchemyCMS_alchemy-devise | train | rb,rb |
155448a76a0dbf332290da03ceb6078cfe0b78ab | diff --git a/Container/AbstractObjectContainer.php b/Container/AbstractObjectContainer.php
index <HASH>..<HASH> 100755
--- a/Container/AbstractObjectContainer.php
+++ b/Container/AbstractObjectContainer.php
@@ -159,6 +159,9 @@ abstract class AbstractObjectContainer extends AbstractGeneratorAware implements
*/
public function get($value)
{
+ if (!is_string($value) && !is_int($value)) {
+ throw new \InvalidArgumentException(sprintf('Value "%s" can\'t be used to get an object from "%s"', var_export($value, true), get_class($this)), __LINE__);
+ }
return array_key_exists($value, $this->objects) ? $this->objects[$value] : null;
}
} | mandevilla-generator_aware - add sanity check to secure get method | WsdlToPhp_PackageGenerator | train | php |
56c85275aede589713d5a5f3d1dc78d55e9de0cb | diff --git a/src/Context/User/UserContext.php b/src/Context/User/UserContext.php
index <HASH>..<HASH> 100644
--- a/src/Context/User/UserContext.php
+++ b/src/Context/User/UserContext.php
@@ -70,4 +70,14 @@ class UserContext extends RawUserContext
{
$this->logoutUser();
}
+
+ /**
+ * @AfterScenario
+ */
+ public function afterUserScenario() {
+ // Logout, when scenario finished an execution, is required for "Scenario Outline" because an
+ // object will not be instantiated for every iteration and user data, from previous one, will
+ // be kept.
+ $this->logoutUser();
+ }
} | Fixed #4: programmatically logout a user for every iteration of outlines. | BR0kEN-_TqExtension | train | php |
d86d8d9055110fd178cdee3cdfefc105482cb289 | diff --git a/src/Keboola/Syrup/Controller/IndexController.php b/src/Keboola/Syrup/Controller/IndexController.php
index <HASH>..<HASH> 100644
--- a/src/Keboola/Syrup/Controller/IndexController.php
+++ b/src/Keboola/Syrup/Controller/IndexController.php
@@ -8,6 +8,7 @@
namespace Keboola\Syrup\Controller;
+use Keboola\Syrup\Exception\SyrupComponentException;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Serializer\Encoder\JsonDecode;
@@ -53,11 +54,6 @@ class IndexController extends Controller
public function notFoundAction()
{
- return new JsonResponse(array(
- 'status' => 'error',
- 'error' => 'User error',
- 'code' => 404,
- 'message' => 'Route not found'
- ));
+ throw new SyrupComponentException(404, "Route not found");
}
} | refactor (IndexController): RouteNotFounAction now throws exception with <I> code | keboola_syrup | train | php |
fe4c6f6e115bb614a21c9878f4b751c09ff4ceaf | diff --git a/src/Map.php b/src/Map.php
index <HASH>..<HASH> 100644
--- a/src/Map.php
+++ b/src/Map.php
@@ -26,7 +26,8 @@ class Map implements \ArrayAccess, \IteratorAggregate, \Countable, \JsonSerializ
public function add(iterable $elements): self
{
foreach ($elements as $key => $element) {
- $this->set($key, $element);
+ // PHP converts numeric keys to integers, so we need to explicitly cast them to strings
+ $this->set((string)$key, $element);
}
return $this; | Bug fix: ensure keys are strings in maps when using Map::add | palmtreephp_collection | train | php |
c0776823ba8da82538d104d8f7e0fce5a297f648 | diff --git a/tests/linalg_test.py b/tests/linalg_test.py
index <HASH>..<HASH> 100644
--- a/tests/linalg_test.py
+++ b/tests/linalg_test.py
@@ -245,6 +245,9 @@ class NumpyLinalgTest(jtu.JaxTestCase):
for rng in [jtu.rand_default()]))
def testEigvalsh(self, shape, dtype, rng):
_skip_if_unsupported_type(dtype)
+ if jtu.device_under_test() == "tpu":
+ if np.issubdtype(dtype, np.complexfloating):
+ raise unittest.SkipTest("No complex eigh on TPU")
n = shape[-1]
def args_maker():
a = rng((n, n), dtype) | Disable complex eigvalsh test on TPU. (#<I>) | tensorflow_probability | train | py |
fd5f68c5ac718a1e9aede75458282025f9b541c5 | diff --git a/tests/plugins-webpack-2.js b/tests/plugins-webpack-2.js
index <HASH>..<HASH> 100644
--- a/tests/plugins-webpack-2.js
+++ b/tests/plugins-webpack-2.js
@@ -70,7 +70,7 @@ describeWP2('plugin webpack 2 use - builds changes', function() {
expect(output.run2['main.js'].toString()).to.match(/\/* fib/);
expect(Object.keys(output.run2).filter(function(key) {
return /\.hot-update\.json/.test(key);
- })).to.length.of(2);
+ })).to.length.of(1);
});
}); | Test for one hmr output in es<I> hmr test
ES<I> support no longer requires rebuilds that lead to doubling of HMR
outputs. | mzgoddard_hard-source-webpack-plugin | train | js |
c0c14e9e4c5d5566ab1e9310edfffd859ea5734a | diff --git a/.cz-config.js b/.cz-config.js
index <HASH>..<HASH> 100644
--- a/.cz-config.js
+++ b/.cz-config.js
@@ -12,8 +12,7 @@ module.exports = {
{value: 'test', name: 'test: Adding missing tests'},
{value: 'chore', name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation'},
{value: 'revert', name: 'revert: Revert to a commit'},
- {value: 'ts', name: 'ts: Typescript/Typings related changes'},
- {value: 'WIP', name: 'WIP: Work in progress'}
+ {value: 'ts', name: 'ts: Typescript/Typings related changes'}
],
scopes: [ | chore: remove WIP type from cz-config
Makes more sense to mark the PR as WIP. | cerebral_cerebral | train | js |
74c975423b57e5a6513317c635dfe05efef26f94 | 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.8.6'
+ PUPPETVERSION = '3.8.7'
##
# version is a public API method intended to always provide a fast and | (packaging) Update PUPPETVERSION to <I> | puppetlabs_puppet | train | rb |
cff3453b58aa77d5a4c7c62f43868aa094f00d55 | diff --git a/src/Config/auth.php b/src/Config/auth.php
index <HASH>..<HASH> 100644
--- a/src/Config/auth.php
+++ b/src/Config/auth.php
@@ -154,7 +154,7 @@ return [
|
*/
- 'id_column' => 'objectguid',
+ 'guid_column' => 'objectguid',
/*
|--------------------------------------------------------------------------
diff --git a/src/Resolvers/UserResolver.php b/src/Resolvers/UserResolver.php
index <HASH>..<HASH> 100644
--- a/src/Resolvers/UserResolver.php
+++ b/src/Resolvers/UserResolver.php
@@ -181,7 +181,7 @@ class UserResolver implements ResolverInterface
*/
public function getDatabaseIdColumn() : string
{
- return Config::get('ldap_auth.identifiers.database.id_column', 'objectguid');
+ return Config::get('ldap_auth.identifiers.database.guid_column', 'objectguid');
}
/** | Change id_column to guid_column | Adldap2_Adldap2-Laravel | train | php,php |
c37dc7140023d140232a1155ab12ecaa9b253414 | diff --git a/src/sap.m/src/sap/m/SelectionDetailsFacade.js b/src/sap.m/src/sap/m/SelectionDetailsFacade.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/SelectionDetailsFacade.js
+++ b/src/sap.m/src/sap/m/SelectionDetailsFacade.js
@@ -5,10 +5,7 @@
* Describes the public facade of the {@link sap.m.SelectionDetails} control.
* @name sap.m.SelectionDetailsFacade
* @class The public facade of the {@link sap.m.SelectionDetails} control.
- * @extends sap.ui.base.Interface
* @since 1.48.0
- * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
- * @alias sap.m.SelectionDetailsFacade
* @public
* @author SAP SE
* @version ${version}
@@ -41,10 +38,7 @@
* Describes the public facade of the {@link sap.m.SelectionDetailsItem} element.
* @name sap.m.SelectionDetailsItemFacade
* @class The public facade of the {@link sap.m.SelectionDetailsItem} element.
- * @extends sap.ui.base.Interface
* @since 1.48.0
- * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
- * @alias sap.m.SelectionDetailsItemFacade
* @public
* @author SAP SE
* @version ${version} | [INTERNAL] sap.m.SelectionDetailsFacade: Documentation tags removed which causes JsDoc build issues
Change-Id: Id4ddaba<I>d<I>ea5bccb<I>d3ed<I>adcb5fbf | SAP_openui5 | train | js |
0699daec89096bf50e51366a5ed591aad67a3196 | diff --git a/lib/spidr/version.rb b/lib/spidr/version.rb
index <HASH>..<HASH> 100644
--- a/lib/spidr/version.rb
+++ b/lib/spidr/version.rb
@@ -1,4 +1,4 @@
module Spidr
# Spidr version
- VERSION = '0.4.1'
+ VERSION = '0.5.0'
end | Version bump to <I>. | postmodern_spidr | train | rb |
e96a1efec3efbfec63cf32984b21bf98933042a2 | diff --git a/github/repos_contents.go b/github/repos_contents.go
index <HASH>..<HASH> 100644
--- a/github/repos_contents.go
+++ b/github/repos_contents.go
@@ -158,11 +158,11 @@ func (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path
}
fileUnmarshalError := json.Unmarshal(rawJSON, &fileContent)
if fileUnmarshalError == nil {
- return fileContent, nil, resp, fileUnmarshalError
+ return fileContent, nil, resp, nil
}
directoryUnmarshalError := json.Unmarshal(rawJSON, &directoryContent)
if directoryUnmarshalError == nil {
- return nil, directoryContent, resp, directoryUnmarshalError
+ return nil, directoryContent, resp, nil
}
return nil, nil, resp, fmt.Errorf("unmarshalling failed for both file and directory content: %s and %s ", fileUnmarshalError, directoryUnmarshalError)
} | Return nil error explicitly in RepositoriesService.GetContents. (#<I>)
This is simpler and more readable.
Helps #<I>. | google_go-github | train | go |
a93780b6b7764406fba09c64fe993b413d47a620 | diff --git a/linode/objects/account/settings.py b/linode/objects/account/settings.py
index <HASH>..<HASH> 100644
--- a/linode/objects/account/settings.py
+++ b/linode/objects/account/settings.py
@@ -1,5 +1,6 @@
from linode.objects import Base, Property
+
class AccountSettings(Base):
api_endpoint = "/account/settings"
id_attribute = 'email'
@@ -19,4 +20,5 @@ class AccountSettings(Base):
"email": Property(mutable=True),
"zip": Property(mutable=True),
"address_2": Property(mutable=True),
+ "vat_number": Property(mutable=True),
} | add vat_number to account/settings | linode_linode_api4-python | train | py |
2cf74e384bc502201412b00db6a5c9891f4521af | diff --git a/lib/pre-process.js b/lib/pre-process.js
index <HASH>..<HASH> 100644
--- a/lib/pre-process.js
+++ b/lib/pre-process.js
@@ -44,11 +44,20 @@ exports.styl.extension = 'css';
*/
exports.less = function less (content, index, total, next) {
+ var file = this;
+
canihas.less(function canihasLess (err, less) {
if (err) return next(err);
- var parser;
- try { parser = less.render(content); }
+ var meta = file.meta
+ , parser;
+
+ try {
+ parser = less.render(content, {
+ filename: meta.filename
+ , paths: [meta.path]
+ });
+ }
catch (e) { return next(e); }
parser.on('error', next); | Added filename & path for import | observing_square | train | js |
591d615b1c2cdeef3a409200cf6ebbf95e7d8d14 | diff --git a/src/create-cycle.js b/src/create-cycle.js
index <HASH>..<HASH> 100644
--- a/src/create-cycle.js
+++ b/src/create-cycle.js
@@ -20,7 +20,8 @@ export default function createCycle(renderer, data={}) {
fn = args.splice(0, 1)[0];
}
let p = key ? data[key] : data;
- if (fn) p = fn(p, ...args);
+ if (typeof fn==='function') p = fn(p, ...args);
+ else p = fn;
if (key) data[key] = p;
else data = p;
if (!debounce) debounce = setTimeout(render, 1); | Support passing values to mutate() in place of functions | developit_preact-cycle | train | js |
3b9e36f0bd46bf293854f0dba80d6562b9899ed0 | diff --git a/openid/server/server.py b/openid/server/server.py
index <HASH>..<HASH> 100644
--- a/openid/server/server.py
+++ b/openid/server/server.py
@@ -255,7 +255,7 @@ class CheckIDRequest(OpenIDRequest):
return True
tr = TrustRoot.parse(self.trust_root)
if tr is None:
- raise ValueError('Malformed trust_root: %r' % (self.trust_root,))
+ raise MalformedTrustRoot(self.trust_root)
return tr.validateURL(self.return_to)
def answer(self, allow, setup_url=None):
@@ -528,7 +528,7 @@ class EncodingError(Exception):
class AlreadySigned(EncodingError):
"""This response is already signed."""
-class UntrustedReturnURL(Exception):
+class UntrustedReturnURL(ProtocolError):
def __init__(self, return_to, trust_root):
self.return_to = return_to
self.trust_root = trust_root
@@ -539,3 +539,6 @@ class UntrustedReturnURL(Exception):
self.trust_root)
class MalformedReturnURL(ProtocolError):
pass
+
+class MalformedTrustRoot(ProtocolError):
+ pass | [project @ server.server: more exceptions are ProtocolErrors] | openid_python-openid | train | py |
705e94a0f0327c4d9376b357cddc76edbaa827f4 | diff --git a/salt/beacons/diskusage.py b/salt/beacons/diskusage.py
index <HASH>..<HASH> 100644
--- a/salt/beacons/diskusage.py
+++ b/salt/beacons/diskusage.py
@@ -68,7 +68,8 @@ def beacon(config):
'''
ret = []
- for mount in config:
+ for mounts in config:
+ mount = mounts.keys()[0]
try:
_current_usage = psutil.disk_usage(mount)
@@ -78,7 +79,7 @@ def beacon(config):
continue
current_usage = _current_usage.percent
- monitor_usage = config[mount]
+ monitor_usage = mounts[mount]
if '%' in monitor_usage:
monitor_usage = re.sub('%', '', monitor_usage)
monitor_usage = float(monitor_usage) | Fix diskusage beacon
Stop trying to load the entire mount dict as the mount point. | saltstack_salt | train | py |
91438198b7295f0460c9e701d0677fe8dddf950c | diff --git a/lib/octopress-ink/assets/asset.rb b/lib/octopress-ink/assets/asset.rb
index <HASH>..<HASH> 100644
--- a/lib/octopress-ink/assets/asset.rb
+++ b/lib/octopress-ink/assets/asset.rb
@@ -33,10 +33,6 @@ module Octopress
@plugin.disabled?(@base, filename)
end
- def disable
- @disabled = true
- end
-
def path
if @found_file and !@no_cache
@found_file | Removed unused disable method from asset class | octopress_ink | train | rb |
7b8a6b44f08b8d36fa7813a1299ad7431d0e9a09 | diff --git a/conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/MessageRequest.java b/conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/MessageRequest.java
index <HASH>..<HASH> 100644
--- a/conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/MessageRequest.java
+++ b/conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/model/MessageRequest.java
@@ -18,7 +18,7 @@ import com.google.gson.annotations.SerializedName;
import com.ibm.watson.developer_cloud.service.model.GenericModel;
/**
- * A request formatted for the Conversation service.
+ * A message request formatted for the Conversation service.
*/
public class MessageRequest extends GenericModel { | docs(Conversation): Tweak class description | watson-developer-cloud_java-sdk | train | java |
7dd08c3b1942427268975a878e13bb8b29122688 | diff --git a/netmiko/accedian/accedian.py b/netmiko/accedian/accedian.py
index <HASH>..<HASH> 100644
--- a/netmiko/accedian/accedian.py
+++ b/netmiko/accedian/accedian.py
@@ -29,7 +29,7 @@ class AccedianSSH(CiscoSSHConnection):
pass
def set_base_prompt(self, pri_prompt_terminator=':', alt_prompt_terminator='#',
- delay_factor=1):
+ delay_factor=2):
"""Sets self.base_prompt: used as delimiter for stripping of trailing prompt in output."""
super(AccedianSSH, self).set_base_prompt(pri_prompt_terminator=pri_prompt_terminator,
alt_prompt_terminator=alt_prompt_terminator, | increase delay_factor to make it more robust with this slow device | ktbyers_netmiko | train | py |
1008ec18452b58744b726c88f54bce088fee30ff | diff --git a/grok.go b/grok.go
index <HASH>..<HASH> 100644
--- a/grok.go
+++ b/grok.go
@@ -97,21 +97,24 @@ func (g *Grok) Match(pattern, text string) (bool, error) {
// Parse returns a string map with captured string based on provided pattern over the text
func (g *Grok) Parse(pattern string, text string) (map[string]string, error) {
- multiCaptures, err := g.ParseToMultiMap(pattern, text)
+ cr, err := g.compile(pattern)
if err != nil {
- return nil, err
+ return nil, err
}
+ match := cr.FindStringSubmatch(text)
captures := make(map[string]string)
- for name, capturesForName := range multiCaptures {
- captures[name] = capturesForName[0]
+ for i, name := range cr.SubexpNames() {
+ if len(match) > 0 {
+ captures[name] = match[i]
+ }
}
return captures, nil
}
// ParseToMultiMap works just like Parse, except that it allows to map multiple values to the same capture name.
-func (g* Grok) ParseToMultiMap(pattern string, text string) (map[string][]string, error) {
+func (g *Grok) ParseToMultiMap(pattern string, text string) (map[string][]string, error) {
multiCaptures := make(map[string][]string)
cr, err := g.compile(pattern)
if err != nil { | Parse() use less allocation when it does not use ParseToMultiMap() | vjeantet_grok | train | go |
bfeacd0b086717346e30afcd08240188cf2f31ed | diff --git a/satpy/scene.py b/satpy/scene.py
index <HASH>..<HASH> 100644
--- a/satpy/scene.py
+++ b/satpy/scene.py
@@ -1170,13 +1170,8 @@ class Scene(MetadataObject):
to be passed to geoviews
"""
- try:
- import geoviews as gv
- from cartopy import crs # noqa
- except ImportError:
- import warnings
- warnings.warn("This method needs the geoviews package installed.")
-
+ import geoviews as gv
+ from cartopy import crs # noqa
if gvtype is None:
gvtype = gv.Image | Fix geoviews only issuing a warning on critical import error | pytroll_satpy | train | py |
a3bfe4d95e75e237712ed1c2d3c7f94a8ec4bc19 | diff --git a/java/server/src/org/openqa/selenium/remote/server/Passthrough.java b/java/server/src/org/openqa/selenium/remote/server/Passthrough.java
index <HASH>..<HASH> 100644
--- a/java/server/src/org/openqa/selenium/remote/server/Passthrough.java
+++ b/java/server/src/org/openqa/selenium/remote/server/Passthrough.java
@@ -132,13 +132,12 @@ class Passthrough implements SessionCodec {
}
String charSet = connection.getContentEncoding() != null ? connection.getContentEncoding() : UTF_8.name();
- StringWriter logWriter = new StringWriter();
- try (Reader reader = new InputStreamReader(in, charSet)) {
+ try (Reader reader = new InputStreamReader(in, charSet)) {
String content = CharStreams.toString(reader);
- LOG.info("To downstream: " + logWriter.toString());
+ LOG.info("To downstream: " + content);
resp.setContent(content.getBytes(charSet));
} finally {
in.close();
}
}
-}
\ No newline at end of file
+} | Fix passthrough servlet downstream logging. | SeleniumHQ_selenium | train | java |
b5b02b2176707472ba433314773499ecc91785d2 | diff --git a/typedjsonrpc/registry.py b/typedjsonrpc/registry.py
index <HASH>..<HASH> 100644
--- a/typedjsonrpc/registry.py
+++ b/typedjsonrpc/registry.py
@@ -17,11 +17,17 @@ RETURNS_KEY = "returns"
class Registry(object):
"""The registry for storing and calling jsonrpc methods.
+ :attribute debug: Debug option which enables recording of tracebacks
+ :type debug: bool
:attribute tracebacks: Tracebacks for debugging
:type tracebacks: dict[int, werkzeug.debug.tbtools.Traceback]
"""
def __init__(self, debug=False):
+ """
+ :param debug: If True, the registry records tracebacks for debugging purposes
+ :type debug: bool
+ """
self._name_to_method_info = {}
self._register_describe()
self.debug = debug | Added documentation for debug attribute of registry | palantir_typedjsonrpc | train | py |
6b374b3c5cbc239fc124f759cf5dba32e19c6ace | diff --git a/lambda/asset/view.js b/lambda/asset/view.js
index <HASH>..<HASH> 100644
--- a/lambda/asset/view.js
+++ b/lambda/asset/view.js
@@ -206,7 +206,7 @@ function initBraceryView (config) {
function makeRefList (prefix, symbols, absentText) {
return (symbols.length
? (prefix + ': ' + symbols.map (function (name) {
- return '~<a href="' + baseViewUrl + name + '?edit=true" target="_blank">' + name + '</a>'
+ return '~<a href="' + baseViewUrl + name + '?edit=true">' + name + '</a>'
}).join(', '))
: (absentText || ''))
} | don't open symbol links in new tabs | ihh_bracery | train | js |
73d7b607d48287d7630e253db4189eb834e17c6f | diff --git a/src/Curl.php b/src/Curl.php
index <HASH>..<HASH> 100644
--- a/src/Curl.php
+++ b/src/Curl.php
@@ -16,6 +16,8 @@
$this->resource = curl_init();
$this->options = array(); // reset options store
+ $this->set(CURLOPT_HEADER, true); // default headers to on
+
if (is_array($options) === true)
{
foreach ($options as $option => $value) | Default curl headers option to on | irwtdvoys_bolt-core | train | php |
a11bd56a5d312446b6e9f4571455d093543938b6 | diff --git a/spec/awesome_spawn_spec.rb b/spec/awesome_spawn_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/awesome_spawn_spec.rb
+++ b/spec/awesome_spawn_spec.rb
@@ -80,6 +80,7 @@ describe AwesomeSpawn do
context "with real execution" do
before do
+ # Re-enable actual spawning just for these specs.
Kernel.stub(:spawn).and_call_original
end
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
@@ -14,6 +14,10 @@ RSpec.configure do |config|
# the seed, which is printed after each run.
# --seed 1234
config.order = 'random'
+
+ config.before do
+ Kernel.stub(:spawn).and_raise("Spawning is not permitted in specs. Please change your spec to use expectations/stubs.")
+ end
end
require 'awesome_spawn' | Disable actual spawning for specs, except where expected. | ManageIQ_awesome_spawn | train | rb,rb |
14fcc3b4fb0b4c290f6d9e1a8ae3357d686cbbc2 | diff --git a/app/controllers/spree/checkout_controller_decorator.rb b/app/controllers/spree/checkout_controller_decorator.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/spree/checkout_controller_decorator.rb
+++ b/app/controllers/spree/checkout_controller_decorator.rb
@@ -5,7 +5,7 @@ Spree::CheckoutController.class_eval do
def object_params
if @order.has_checkout_step?("payment") && @order.payment?
if params[:payment_source].present?
- source_params = params.delete(:payment_source)[non_wallet_payment_attributes(params[:order][:payments_attributes]).first[:payment_method_id].underscore]
+ source_params = params.delete(:payment_source)[non_wallet_payment_attributes(params[:order][:payments_attributes]).first.try(:payment_method_id)]
if source_params
non_wallet_payment_attributes(params[:order][:payments_attributes]).first[:source_attributes] = source_params | use try while getting source params | vinsol-spree-contrib_spree_wallet | train | rb |
e991972d04303a046cfbf4094fac53a0a27589c8 | diff --git a/pyca/ui/__init__.py b/pyca/ui/__init__.py
index <HASH>..<HASH> 100644
--- a/pyca/ui/__init__.py
+++ b/pyca/ui/__init__.py
@@ -72,7 +72,9 @@ def serve_image(image_id):
filepath = os.path.abspath(filepath)
if os.path.isfile(filepath):
directory, filename = filepath.rsplit('/', 1)
- return send_from_directory(directory, filename)
+ response = send_from_directory(directory, filename)
+ response.cache_control.no_cache = True
+ return response
except (IndexError, KeyError):
pass
return '', 404 | Prevent Caching of Preview Image
This patch prevents the preview image from being cached in Chrome and
potentially other browsers by sending a no-cache HTTP header. | opencast_pyCA | train | py |
a1ac833c10ef9c6003010b9db06956f76b69192f | diff --git a/i3situation/plugins/cmus.py b/i3situation/plugins/cmus.py
index <HASH>..<HASH> 100644
--- a/i3situation/plugins/cmus.py
+++ b/i3situation/plugins/cmus.py
@@ -1,4 +1,4 @@
-from subprocess import check_output
+import subprocess
import datetime
from i3situation.plugins._plugin import Plugin
@@ -49,7 +49,13 @@ class CmusPlugin(Plugin):
and converts it to unicode in order for it to be processed and finally
output.
"""
- cmusOutput = check_output(['cmus-remote', '-Q']).decode('utf-8')
+ try:
+ # Setting stderr to subprocess.STDOUT seems to stop the error
+ # message returned by the process from being output to STDOUT.
+ cmusOutput = subprocess.check_output(['cmus-remote', '-Q'],
+ stderr=subprocess.STDOUT).decode('utf-8')
+ except subprocess.CalledProcessError:
+ return self.output('Cmus is not running', 'Cmus is not running')
status = self.convertCmusOutput(cmusOutput)
outString = self.options['format']
for k, v in status.items(): | Added a message for when cmus isn't active. I have also noticed a bug that
means items don't appear on the bar in the order in which they were defined in
the config file. I know how to fix it and will write a fix later. | HarveyHunt_i3situation | train | py |
b83c906be3fa6f7791870444271b80dd2c2db35b | diff --git a/lib/devserver/index.js b/lib/devserver/index.js
index <HASH>..<HASH> 100644
--- a/lib/devserver/index.js
+++ b/lib/devserver/index.js
@@ -1,5 +1,6 @@
'use strict';
+var cli = require('../bincmd/cli.js');
var os = require('os');
var path = require('path');
@@ -24,6 +25,11 @@ function app_listening() {
function run(targetBuild, opts) {
build = targetBuild;
+ if (process.env.npm_config_global === true) {
+ cli.printErrorAndExit('Please install staticbuild locally ' +
+ 'or run `staticbuild setup` to create a new project.', 1007);
+ return;
+ }
if (!build.restart || opts.nodemonEntry) {
app = require('./app.js');
app.init(build); | Not allowing devserver to be run from global installation. | staticbuild_staticbuild | train | js |
a6145c71da0b7147287ef5091707d495deba57fe | diff --git a/src/Barryvdh/TranslationManager/Manager.php b/src/Barryvdh/TranslationManager/Manager.php
index <HASH>..<HASH> 100644
--- a/src/Barryvdh/TranslationManager/Manager.php
+++ b/src/Barryvdh/TranslationManager/Manager.php
@@ -69,7 +69,7 @@ class Manager
if (!in_array($group, $this->config()['exclude_groups']) && $this->config()['log_missing_keys'])
{
$lottery = 1;
- if ($useLottery)
+ if ($useLottery && $this->config()['missing_keys_lottery'] !== 1)
{
$lottery = Session::get('laravel_translation_manager.lottery', '');
if ($lottery === '') | fix don't use lottery even if session has lottery value but lottery setting is 1 in config. otherwise no way to reset session value when config changes. | vsch_laravel-translation-manager | train | php |
42d12ec930184572916fcc6a99debbce2769dd19 | diff --git a/src/Provider/PathServiceProvider.php b/src/Provider/PathServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Provider/PathServiceProvider.php
+++ b/src/Provider/PathServiceProvider.php
@@ -105,5 +105,7 @@ class PathServiceProvider implements ServiceProviderInterface
public function boot(Application $app)
{
+ $theme = $app['config']->get('general/theme');
+ $app['path_resolver']->define('theme', "%themes%/$theme");
}
} | Defining "theme" for PathResolver at boot. | bolt_bolt | train | php |
765dbb443d3c067e8a0455125ccf9f0c3f82a4c1 | diff --git a/upnp.go b/upnp.go
index <HASH>..<HASH> 100644
--- a/upnp.go
+++ b/upnp.go
@@ -110,8 +110,7 @@ func Discover() (nat NAT, err error) {
// HTTP header field names are case-insensitive.
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
locString := "\r\nlocation: "
- answer = strings.ToLower(answer)
- locIndex := strings.Index(answer, locString)
+ locIndex := strings.Index(strings.ToLower(answer), locString)
if locIndex < 0 {
continue
} | Fix a bug in fetching the XML URL.
In Discover, the reponse was lowercased for comparison. However,
this caused a <I> - Not found when fetching the url provided by
the location header if the url contained uppercase.
ok @owainga | btcsuite_btcd | train | go |
54615141b4056cdb7f99ac856ee8e9ee768a3211 | diff --git a/admin/editors.php b/admin/editors.php
index <HASH>..<HASH> 100644
--- a/admin/editors.php
+++ b/admin/editors.php
@@ -89,7 +89,7 @@ switch ($action) {
$pagename = 'editorsettings' . $editor;
admin_externalpage_setup($pagename);
$form = new $classname();
- $options = $classname::option_names();
+ $options = call_user_func($classname . '::option_names');
$data = $form->get_data();
if ($form->is_cancelled()){ | "MDL-<I>, php <I> don't understand ::static_func, use the old syntax" | moodle_moodle | train | php |
1265979c72fa9d53a32012baece1290d8f64fc82 | diff --git a/lib/parse/util.rb b/lib/parse/util.rb
index <HASH>..<HASH> 100644
--- a/lib/parse/util.rb
+++ b/lib/parse/util.rb
@@ -73,7 +73,7 @@ module Parse
def Parse.object_pointer_equality?(a, b)
classes = [Parse::Object, Parse::Pointer]
- return false unless classes.include?(a.class) && classes.include?(b.class)
+ return false unless classes.any? { |c| a.kind_of?(c) } && classes.any? { |c| b.kind_of?(c) }
return true if a.equal?(b)
return false if a.new? || b.new? | fix equality for _User | adelevie_parse-ruby-client | train | rb |
42c259c2b000e82215b2d70339465fb9780c0dfe | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,19 @@
-from setuptools import setup
+from setuptools import setup, Command
+import subprocess
+
+
+class PyTest(Command):
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ errno = subprocess.call(['py.test'])
+ raise SystemExit(errno)
setup(
@@ -16,6 +31,7 @@ setup(
'Flask',
'Redis >= 2.0'
],
+ cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment', | made it possible run tests with `python setup.py test` | jpvanhal_flask-split | train | py |
0a2578ee4b863ad757bc282985eff90169e8a7cb | diff --git a/para/src/main/java/com/erudika/para/rest/Api1.java b/para/src/main/java/com/erudika/para/rest/Api1.java
index <HASH>..<HASH> 100644
--- a/para/src/main/java/com/erudika/para/rest/Api1.java
+++ b/para/src/main/java/com/erudika/para/rest/Api1.java
@@ -111,7 +111,6 @@ public class Api1 extends ResourceConfig {
// current user/app object
Resource.Builder meRes = Resource.builder("me");
meRes.addMethod(GET).produces(JSON).handledBy(meHandler());
- meRes.addMethod(PUT).produces(JSON).handledBy(meHandler());
registerResources(meRes.build());
// util functions API
@@ -375,7 +374,6 @@ public class Api1 extends ResourceConfig {
return Response.ok(app).build();
}
}
- } else if(PUT.equals(ctx.getMethod())) {
}
return Response.status(Response.Status.UNAUTHORIZED).build();
} | minor fix to /me handler | Erudika_para | train | java |
56a24849dff21da13626dc7b0439562216c5e156 | diff --git a/src/hszinc/parser.py b/src/hszinc/parser.py
index <HASH>..<HASH> 100644
--- a/src/hszinc/parser.py
+++ b/src/hszinc/parser.py
@@ -6,7 +6,7 @@
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
from grid import Grid
-from metadata import Item, ItemPair
+from metadata import Item, ItemPair, MetadataObject
from grammar import zinc_grammar
from sortabledict import SortableDict
from datatypes import Quantity, Coordinate, Ref, Bin, Uri, MARKER, STR_SUB
@@ -61,7 +61,7 @@ def parse_grid(grid_str):
def parse_meta(meta):
assert meta.expr_name == 'meta'
- items = []
+ items = MetadataObject()
for item_parent in meta.children:
# There'll probably be a space beforehand
@@ -115,7 +115,7 @@ def parse_column(col):
if bool(col.children[1].children):
col_meta = parse_meta(col.children[1].children[0])
else:
- col_meta = []
+ col_meta = MetadataObject()
return (col_id, col_meta)
def parse_rows(grid, rows): | parser: Represent columns and metadata as MetadataObjects | vrtsystems_hszinc | train | py |
1efd0d7ac31f696d7204c01b8d846b2fa2dbffd9 | diff --git a/lxd/device/nic_p2p.go b/lxd/device/nic_p2p.go
index <HASH>..<HASH> 100644
--- a/lxd/device/nic_p2p.go
+++ b/lxd/device/nic_p2p.go
@@ -51,7 +51,13 @@ func (d *nicP2P) validateEnvironment() error {
}
// UpdatableFields returns a list of fields that can be updated without triggering a device remove & add.
-func (d *nicP2P) UpdatableFields() []string {
+func (d *nicP2P) UpdatableFields(oldDevice Type) []string {
+ // Check old and new device types match.
+ _, match := oldDevice.(*nicP2P)
+ if !match {
+ return []string{}
+ }
+
return []string{"limits.ingress", "limits.egress", "limits.max", "ipv4.routes", "ipv6.routes"}
} | lxd/device/nic/p2p: UpdatableFields signature change | lxc_lxd | train | go |
6434fc54d141b10356e4a1418d37f4409f9c6988 | diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java
@@ -647,7 +647,7 @@ public class Task
// the registration must also strictly be undone
// ----------------------------------------------------------------
- LOG.info("Registering task at network: {}.", this);
+ LOG.debug("Registering task at network: {}.", this);
setupPartitionsAndGates(consumableNotifyingPartitionWriters, inputGates); | [FLINK-<I>][task] Log task registration at network on DEBUG | apache_flink | train | java |
8f257a69806b1a6a73ae4bae9beeb39dca411cd5 | diff --git a/stagpy/_step.py b/stagpy/_step.py
index <HASH>..<HASH> 100644
--- a/stagpy/_step.py
+++ b/stagpy/_step.py
@@ -449,14 +449,6 @@ class Step:
self._isnap = None
return self._isnap
- @isnap.setter
- def isnap(self, isnap):
- """Fields snap corresponding to time step"""
- try:
- self._isnap = int(isnap)
- except ValueError:
- pass
-
class EmptyStep(Step):
diff --git a/stagpy/stagyydata.py b/stagpy/stagyydata.py
index <HASH>..<HASH> 100644
--- a/stagpy/stagyydata.py
+++ b/stagpy/stagyydata.py
@@ -403,7 +403,7 @@ class _Snaps(_Steps):
istep (int): time step index.
"""
self._isteps[isnap] = istep
- self.sdat.steps[istep].isnap = isnap
+ self.sdat.steps[istep]._isnap = isnap
@property
def last(self): | Remove public isnap setter | StagPython_StagPy | train | py,py |
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.