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 |
|---|---|---|---|---|---|
61f866bb942d76955e3453e412d2e2a81f860176 | diff --git a/head.go b/head.go
index <HASH>..<HASH> 100644
--- a/head.go
+++ b/head.go
@@ -34,6 +34,11 @@ var (
ErrOutOfBounds = errors.New("out of bounds")
)
+type sample struct {
+ t int64
+ v float64
+}
+
// headBlock handles reads and writes of time series data within a time window.
type headBlock struct {
mtx sync.RWMutex | Add Sample Back
The compilation and tests are broken as head.go requires sample which
has been moved to another package while moving BufferedSeriesIterator.
Duplication seemed better compared to exposing sample from tsdbutil. | prometheus_prometheus | train | go |
877ab547381533ba8d2bd6c343a77aec6e8ce248 | diff --git a/bson/src/main/org/bson/codecs/DocumentCodec.java b/bson/src/main/org/bson/codecs/DocumentCodec.java
index <HASH>..<HASH> 100644
--- a/bson/src/main/org/bson/codecs/DocumentCodec.java
+++ b/bson/src/main/org/bson/codecs/DocumentCodec.java
@@ -84,7 +84,7 @@ public class DocumentCodec implements CollectibleCodec<Document> {
public DocumentCodec(final CodecRegistry registry, final BsonTypeClassMap bsonTypeClassMap, final Transformer valueTransformer) {
this.registry = Assertions.notNull("registry", registry);
this.bsonTypeClassMap = Assertions.notNull("bsonTypeClassMap", bsonTypeClassMap);
- this.idGenerator = Assertions.notNull("idGenerator", new ObjectIdGenerator());
+ this.idGenerator = new ObjectIdGenerator();
this.valueTransformer = valueTransformer != null ? valueTransformer : new Transformer() {
@Override
public Object transform(final Object value) { | Update DocumentCodec.java
The assertion is unnecessary because "new ObjectIdGenerator()" is never not null | mongodb_mongo-java-driver | train | java |
dc3ed86c38411a529b358f46a60247e586fd7edf | diff --git a/linux/hci.go b/linux/hci.go
index <HASH>..<HASH> 100644
--- a/linux/hci.go
+++ b/linux/hci.go
@@ -122,7 +122,7 @@ func (h *HCI) SetScanEnable(en bool, dup bool) error {
return h.c.SendAndCheckResp(
cmd.LESetScanEnable{
LEScanEnable: btoi(en),
- FilterDuplicates: btoi(dup),
+ FilterDuplicates: btoi(!dup),
}, []byte{0x00})
} | linux: fix the dup filter of Scan | paypal_gatt | train | go |
1797e534ec05a6278d31c4bcb70ffbffd89ce0cd | diff --git a/src/Artax/Client.php b/src/Artax/Client.php
index <HASH>..<HASH> 100644
--- a/src/Artax/Client.php
+++ b/src/Artax/Client.php
@@ -145,6 +145,11 @@ class Client {
private $requestStateMap;
/**
+ * @var array
+ */
+ private $streamIdRequestMap;
+
+ /**
* @var Mediator
*/
private $mediator; | added streamIdRequestMap property declaration | amphp_artax | train | php |
a4ac1be65c4d2b90dcbea08530afb8c3b8f8e0be | diff --git a/packages/lingui-i18n/src/compile.js b/packages/lingui-i18n/src/compile.js
index <HASH>..<HASH> 100644
--- a/packages/lingui-i18n/src/compile.js
+++ b/packages/lingui-i18n/src/compile.js
@@ -20,10 +20,10 @@ const defaultFormats = (language) => {
return {
plural: (value, { offset = 0, rules }) =>
- rules[value] || rules[pluralRules(value - offset)],
+ rules[value] || rules[pluralRules(value - offset)] || rules.other,
selectordinal: (value, { offset = 0, rules }) =>
- rules[value] || rules[pluralRules(value - offset, true)],
+ rules[value] || rules[pluralRules(value - offset, true)] || rules.other,
select: (value, { rules }) =>
rules[value] || rules.other, | fix: Return fallback plural form when the correct doesn't exist | lingui_js-lingui | train | js |
7f2a05c364e3a76da746bfd2b68eee3f28bed04d | diff --git a/example/app.py b/example/app.py
index <HASH>..<HASH> 100644
--- a/example/app.py
+++ b/example/app.py
@@ -30,9 +30,14 @@ def create_users():
('joe@lp.com', 'password', ['editor'], True),
('jill@lp.com', 'password', ['author'], True),
('tiya@lp.com', 'password', [], False)):
- current_app.security.datastore.create_user(
- email=u[0], password=u[1], roles=u[2], active=u[3],
- authentication_token='123abc')
+ current_app.security.datastore.create_user(**{
+ 'email': u[0],
+ 'password': u[1],
+ 'roles': u[2],
+ 'active': u[3],
+ 'authentication_token':
+ '123abc'
+ })
def populate_data(): | Try and fix an issue with python <I> | mattupstate_flask-security | train | py |
ac4e8360a887189782c735294a859279999563b0 | diff --git a/lib/node.io/processor.js b/lib/node.io/processor.js
index <HASH>..<HASH> 100644
--- a/lib/node.io/processor.js
+++ b/lib/node.io/processor.js
@@ -550,13 +550,13 @@ Processor.prototype.input = function(job, input, forWorker) {
//Called when a job instance wants to dynamically add input (outside of job.input())
Processor.prototype.addInput = function(job, add, dont_flatten) {
var j = this.jobs[job];
-
- if (isWorker && !isMaster) {
+
+ //if (isWorker && !isMaster) {
//Send the added input back to the master so that it is evenly distributed among workers
- master.send({type:'add',job:job,add:add,dont_flatten:dont_flatten});
+ //master.send({type:'add',job:job,add:add,dont_flatten:dont_flatten});
- } else {
+ //} else {
if (!dont_flatten && add instanceof Array) {
add.forEach(function(line) {
j.input.push(line);
@@ -564,7 +564,7 @@ Processor.prototype.addInput = function(job, add, dont_flatten) {
} else {
j.input.push(add);
}
- }
+ //}
}
Processor.prototype.output = function(job, output) { | Temporarily reverted addInput | node-js-libs_node.io | train | js |
eeaafaa12b6a0a3b72e33bda3e028e40d9b91d1f | diff --git a/spyderlib/utils/introspection/plugin_manager.py b/spyderlib/utils/introspection/plugin_manager.py
index <HASH>..<HASH> 100644
--- a/spyderlib/utils/introspection/plugin_manager.py
+++ b/spyderlib/utils/introspection/plugin_manager.py
@@ -17,7 +17,7 @@ from spyderlib.qt.QtCore import SIGNAL, QThread, QObject
PLUGINS = ['jedi', 'rope', 'fallback']
-PLUGINS = ['rope']
+PLUGINS = ['fallback']
LOG_FILENAME = get_conf_path('introspection.log')
DEBUG_EDITOR = DEBUG >= 3 | Tested completions with module completions using fallback. | spyder-ide_spyder | train | py |
3f39508271c406f1a31b26639e92ed52cec3b8d6 | diff --git a/spec/sidekiq/throttler_spec.rb b/spec/sidekiq/throttler_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/sidekiq/throttler_spec.rb
+++ b/spec/sidekiq/throttler_spec.rb
@@ -16,7 +16,7 @@ describe Sidekiq::Throttler do
let(:message) do
{
- args: 'Clint Eastwood'
+ 'args' => 'Clint Eastwood'
}
end | Fix bad message setup.
Message setup in the test was using symbols for the key, but, the tests themselves
were using a string as the key.
This doesn't seem to break anything... | gevans_sidekiq-throttler | train | rb |
2b66c77a1f3024e73cb1ebe3cd4ca431d9676aa8 | diff --git a/src/tools/Fsck.java b/src/tools/Fsck.java
index <HASH>..<HASH> 100644
--- a/src/tools/Fsck.java
+++ b/src/tools/Fsck.java
@@ -117,11 +117,11 @@ final class Fsck {
final AtomicLong vle_fixed = new AtomicLong();
/** Length of the metric + timestamp for key validation */
- private static int key_prefix_length = Const.SALT_WIDTH() +
+ private int key_prefix_length = Const.SALT_WIDTH() +
TSDB.metrics_width() + Const.TIMESTAMP_BYTES;
/** Length of a tagk + tagv pair for key validation */
- private static int key_tags_length = TSDB.tagk_width() + TSDB.tagv_width();
+ private int key_tags_length = TSDB.tagk_width() + TSDB.tagv_width();
/** How often to report progress */
private static long report_rows = 10000; | "tsdb fsck --fix-all" wrongly clears data points when salting enabled
Const.SALT_WIDTH() is actually not constant value, it mustn't be
called on class initialization. | OpenTSDB_opentsdb | train | java |
2eca62c5d5a1eecb11db244f5a61745d40274414 | diff --git a/quark/plugin.py b/quark/plugin.py
index <HASH>..<HASH> 100644
--- a/quark/plugin.py
+++ b/quark/plugin.py
@@ -1127,3 +1127,6 @@ class Plugin(quantum_plugin_base_v2.QuantumPluginBaseV2,
(context.tenant_id))
rules = db_api.security_group_rule_find(context, filters=filters)
return [self._make_security_group_rule_dict(rule) for rule in rules]
+
+ def update_security_group(self, context, id, security_group):
+ raise NotImplementedError() | Added non-implementation of abstract update_security_group | openstack_quark | train | py |
de947c621d8ee18caca574451c722a6e30c4e6d6 | diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -15,7 +15,7 @@ module ActiveRecord
# These are explicitly delegated to improve performance (avoids method_missing)
delegate :to_xml, :to_yaml, :length, :collect, :map, :each, :all?, :include?, :to => :to_a
delegate :table_name, :quoted_table_name, :primary_key, :quoted_primary_key,
- :connection, :column_hash, :auto_explain_threshold_in_seconds, :to => :klass
+ :connection, :columns_hash, :auto_explain_threshold_in_seconds, :to => :klass
attr_reader :table, :klass, :loaded
attr_accessor :extensions, :default_scoped | There isn't a column_hash. It was being invoked by method missing. | rails_rails | train | rb |
51f74cc5c8df0069f0389670e7a5c22d3c6b96ed | diff --git a/debug/viewer.js b/debug/viewer.js
index <HASH>..<HASH> 100644
--- a/debug/viewer.js
+++ b/debug/viewer.js
@@ -180,6 +180,9 @@ var Viewer = {
window.require = function (name) {
+ if (name == 'makerjs' || name == '../target/js/node.maker.js') {
+ return _makerjs;
+ }
return module.exports;
};
Viewer.Constructor = null; | allow require of published makerjs and local | Microsoft_maker.js | train | js |
e13664280743453bd2f7162504fa124100546400 | diff --git a/core/src/main/java/org/bitcoinj/core/Block.java b/core/src/main/java/org/bitcoinj/core/Block.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/bitcoinj/core/Block.java
+++ b/core/src/main/java/org/bitcoinj/core/Block.java
@@ -231,7 +231,7 @@ public class Block extends Message {
time = readUint32();
difficultyTarget = readUint32();
nonce = readUint32();
- hash = Sha256Hash.wrapReversed(Sha256Hash.hashTwice(payload, offset, cursor));
+ hash = Sha256Hash.wrapReversed(Sha256Hash.hashTwice(payload, offset, cursor - offset));
headerBytesValid = serializer.isParseRetainMode();
// transactions | Correct length of block header when hashing at an offset | bitcoinj_bitcoinj | train | java |
9fb56df9a0cc1258601dc942d19ff329e8777ed9 | diff --git a/system/src/Grav/Common/Cache.php b/system/src/Grav/Common/Cache.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Cache.php
+++ b/system/src/Grav/Common/Cache.php
@@ -64,7 +64,7 @@ class Cache extends Getters
$this->enabled = (bool) $this->config->get('system.cache.enabled');
// Cache key allows us to invalidate all cache on configuration changes.
- $this->key = substr(md5(($prefix ? $prefix : 'g') . $uri->rootUrl(true) . $this->config->key . GRAV_VERSION), 2, 8);
+ $this->key = substr(md5(($prefix ? $prefix : 'g') . $uri->rootUrl(true) . $this->config->key() . GRAV_VERSION), 2, 8);
$this->driver = $this->getCacheDriver();
diff --git a/system/src/Grav/Common/Config/Config.php b/system/src/Grav/Common/Config/Config.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Config/Config.php
+++ b/system/src/Grav/Common/Config/Config.php
@@ -105,6 +105,11 @@ class Config extends Data
$this->check();
}
+ public function key()
+ {
+ return $this->checksum;
+ }
+
public function reload()
{
$this->check(); | Add back configuration key to caching (was accidentally removed) | getgrav_grav | train | php,php |
0ab8c84c2c570157ffabd13974dcb05e091bea6f | diff --git a/src/main/java/eu/hansolo/tilesfx/skins/MatrixIconTileSkin.java b/src/main/java/eu/hansolo/tilesfx/skins/MatrixIconTileSkin.java
index <HASH>..<HASH> 100644
--- a/src/main/java/eu/hansolo/tilesfx/skins/MatrixIconTileSkin.java
+++ b/src/main/java/eu/hansolo/tilesfx/skins/MatrixIconTileSkin.java
@@ -94,7 +94,7 @@ public class MatrixIconTileSkin extends TileSkin {
getPane().getChildren().addAll(titleText, matrix, text);
- if (tile.isAnimated()) { timer.start(); }
+ if (tile.isAnimated() && tile.getMatrixIcons().size() > 1) { timer.start(); }
}
@Override protected void registerListeners() {
@@ -115,7 +115,9 @@ public class MatrixIconTileSkin extends TileSkin {
} else if (EventType.ANIMATED_ON.name().equals(EVENT_TYPE)) {
updateInterval = tile.getAnimationDuration() * 1_000_000l;
pauseInterval = tile.getPauseDuration() * 1_000_000l;
- timer.start();
+ if (tile.getMatrixIcons().size() > 1) {
+ timer.start();
+ }
} else if (EventType.ANIMATED_OFF.name().equals(EVENT_TYPE)) {
timer.stop();
updateMatrix(); | Only start timer if list of matrixicons contains at least 2 elements | HanSolo_tilesfx | train | java |
5d40621abbd3ee72772a757a46586e4e7dd324d5 | diff --git a/src/MaxMind/Db/Reader/Decoder.php b/src/MaxMind/Db/Reader/Decoder.php
index <HASH>..<HASH> 100644
--- a/src/MaxMind/Db/Reader/Decoder.php
+++ b/src/MaxMind/Db/Reader/Decoder.php
@@ -19,21 +19,37 @@ class Decoder
private $pointerTestHack;
private $switchByteOrder;
+ /** @ignore */
const _EXTENDED = 0;
+ /** @ignore */
const _POINTER = 1;
+ /** @ignore */
const _UTF8_STRING = 2;
+ /** @ignore */
const _DOUBLE = 3;
+ /** @ignore */
const _BYTES = 4;
+ /** @ignore */
const _UINT16 = 5;
+ /** @ignore */
const _UINT32 = 6;
+ /** @ignore */
const _MAP = 7;
+ /** @ignore */
const _INT32 = 8;
+ /** @ignore */
const _UINT64 = 9;
+ /** @ignore */
const _UINT128 = 10;
+ /** @ignore */
const _ARRAY = 11;
+ /** @ignore */
const _CONTAINER = 12;
+ /** @ignore */
const _END_MARKER = 13;
+ /** @ignore */
const _BOOLEAN = 14;
+ /** @ignore */
const _FLOAT = 15;
public function __construct( | Hide several defines from phpdoc | maxmind_MaxMind-DB-Reader-php | train | php |
1abdc137ce8724c3acfd41292208d402bf22196f | diff --git a/lib/omnibus/project.rb b/lib/omnibus/project.rb
index <HASH>..<HASH> 100644
--- a/lib/omnibus/project.rb
+++ b/lib/omnibus/project.rb
@@ -19,14 +19,6 @@ require 'time'
require 'json'
module Omnibus
- #
- # Omnibus project DSL reader
- #
- # @todo It seems like there's a bit of a conflation between a "project" and a
- # "package" in this class... perhaps the package-building portions should be
- # extracted to a separate class.
- #
- #
class Project
class << self
# | Remove comment about conflation with project and packager
This is no longer true now that a real packaging DSL exists. | chef_omnibus | train | rb |
8cfbf45c268b46bb0510af214bc531e4e045bcde | diff --git a/synapse/cores/common.py b/synapse/cores/common.py
index <HASH>..<HASH> 100644
--- a/synapse/cores/common.py
+++ b/synapse/cores/common.py
@@ -331,7 +331,7 @@ class Cortex(EventBus, DataModel, Runtime, s_ingest.IngestApi, s_telepath.Aware,
raise s_exc.NoSuchUser(name=name)
if not user.allowed(perm, elev=elev):
- raise s_exc.AuthDeny(perm=perm)
+ raise s_exc.AuthDeny(perm=perm, user=name)
def _initCoreSpliceHandlers(self):
self.spliceact.act('node:add', self._actNodeAdd) | When raising a AuthDeny include the name of the user being denied access. | vertexproject_synapse | train | py |
e81d68ae4bb5fa8b814dd69fde7b2077bcc81ad0 | diff --git a/int-tests/src/test/java/org/jboss/arquillian/integration/persistence/datasource/JdbcDriverArchiveAppender.java b/int-tests/src/test/java/org/jboss/arquillian/integration/persistence/datasource/JdbcDriverArchiveAppender.java
index <HASH>..<HASH> 100644
--- a/int-tests/src/test/java/org/jboss/arquillian/integration/persistence/datasource/JdbcDriverArchiveAppender.java
+++ b/int-tests/src/test/java/org/jboss/arquillian/integration/persistence/datasource/JdbcDriverArchiveAppender.java
@@ -36,7 +36,7 @@ public abstract class JdbcDriverArchiveAppender implements AuxiliaryArchiveAppen
}
private Archive<?> resolveDriverArtifact(final String driverCoordinates) {
- PomEquippedResolveStage resolver = Maven.resolver().offline().loadPomFromFile("pom.xml");
+ PomEquippedResolveStage resolver = Maven.configureResolver().workOffline().loadPomFromFile("pom.xml");
File[] jars = resolver.resolve(driverCoordinates).withoutTransitivity().asFile();
return ShrinkWrap.createFromZipFile(JavaArchive.class, jars[0]);
} | Adjusted maven resolver usage to the API changes. | arquillian_arquillian-extension-persistence | train | java |
58eabef320f36125791728755b3256480c2937ca | diff --git a/framework/directives/carousel.js b/framework/directives/carousel.js
index <HASH>..<HASH> 100755
--- a/framework/directives/carousel.js
+++ b/framework/directives/carousel.js
@@ -27,16 +27,16 @@
* @description
* [en]Fired just after the current carousel item has changed.[/en]
* [ja]現在表示しているカルーセルの要素が変わった時に発火します。[/ja]
- * @param {Object} event
+ * @param {Object} event
* [en]Event object.[/en]
* [ja]イベントオブジェクトです。[/ja]
- * @param {Object} event.details.carousel
+ * @param {Object} event.carousel
* [en]Carousel object.[/en]
* [ja]イベントが発火したCarouselオブジェクトです。[/ja]
- * @param {Number} event.details.activeIndex
+ * @param {Number} event.activeIndex
* [en]Current active index.[/en]
* [ja]現在アクティブになっている要素のインデックス。[/ja]
- * @param {Number} event.details.lastActiveIndex
+ * @param {Number} event.lastActiveIndex
* [en]Previous active index.[/en]
* [ja]以前アクティブだった要素のインデックス。[/ja]
*/ | docs(ons-carousel): Update event docs. | OnsenUI_OnsenUI | train | js |
03c454f0dfa99d8834780bcc0d61d4268479611c | diff --git a/multi_dict.py b/multi_dict.py
index <HASH>..<HASH> 100644
--- a/multi_dict.py
+++ b/multi_dict.py
@@ -56,7 +56,10 @@ class MultiDict():
for i in range(len(key)):
if not _isdict(value):
raise KeyError('Key {} not applicable. Under key {} is a value of type {}.'.format(key, key[:i], type(value)))
- value = value[key[i]]
+ try:
+ value = value[key[i]]
+ except TypeError as e:
+ raise KeyError('Key {} not applicable. The {}th value of the key is of type {}.'.format(key, i, type(key[i]))) from e
except KeyError as e:
# raise KeyError(key) from e
value = [] | BUG: util/multi_dict.py: now throws KeyError if number of dicts is smaller than dim of key | jor-_util | train | py |
39da34c4236b32c4024a86988a8bf7f7d761397f | diff --git a/src/Connector.php b/src/Connector.php
index <HASH>..<HASH> 100644
--- a/src/Connector.php
+++ b/src/Connector.php
@@ -44,6 +44,15 @@ class Connector {
return $connector->create($uri->getHost(), $port)->then(function(DuplexStreamInterface $stream) use ($request, $subProtocols) {
$futureWsConn = new Deferred;
+ $earlyClose = function() use ($futureWsConn) {
+ $futureWsConn->reject(new \RuntimeException('Connection closed before handshake'));
+ };
+
+ $stream->on('close', $earlyClose);
+ $futureWsConn->promise()->then(function() use ($stream, $earlyClose) {
+ $stream->removeListener('close', $earlyClose);
+ });
+
$buffer = '';
$headerParser = function($data, DuplexStreamInterface $stream) use (&$headerParser, &$buffer, $futureWsConn, $request, $subProtocols) {
$buffer .= $data; | Reject connection is socket closed before handshake | ratchetphp_Pawl | train | php |
5411867c89adcab5c35ea2cb773e2c4ca7f49e8d | diff --git a/server/helpers/launcher.js b/server/helpers/launcher.js
index <HASH>..<HASH> 100644
--- a/server/helpers/launcher.js
+++ b/server/helpers/launcher.js
@@ -69,5 +69,5 @@ switch (process.argv[2]) {
break;
default:
- console.log('Usage: [-f|start|stop|restart|status|reconfig|build [-c <config file>] [-p <pid file>]]');
+ console.log('Usage: [-f|start|stop|restart|status|reconfig|build [-v] [-c <config file>] [-p <pid file>]]');
} | Added -v verbose flag into available commands list | prawnsalad_KiwiIRC | train | js |
844d384174970768f097b351719f9d48b31ccad5 | diff --git a/falafel/mappers/installed_rpms.py b/falafel/mappers/installed_rpms.py
index <HASH>..<HASH> 100644
--- a/falafel/mappers/installed_rpms.py
+++ b/falafel/mappers/installed_rpms.py
@@ -75,15 +75,15 @@ class InstalledRpm(MapperOutput):
self["release"]
)
- @computed
+ @property
def name(self):
return self.get('name')
- @computed
+ @property
def version(self):
return self.get('version')
- @computed
+ @property
def release(self):
return self.get('release')
@@ -134,8 +134,12 @@ SOSREPORT_KEYS = [
]
+def arch_sep(s):
+ return "." if s.rfind(".") > s.rfind("-") else "-"
+
+
def parse_package(package_string):
- pkg, arch = rsplit(package_string, ".")
+ pkg, arch = rsplit(package_string, arch_sep(package_string))
if arch not in KNOWN_ARCHITECTURES:
pkg, arch = (package_string, None)
pkg, release = rsplit(pkg, "-") | Enhancements to installed_rpms mapper
- Switch several @computed properties to @property
- Handle case where the separator between release and arch is a dash
instead of a dot. | RedHatInsights_insights-core | train | py |
678471395888c464c6ef40cada45549392bcc80a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,24 +3,13 @@
from setuptools import setup
-try:
- from pypandoc import convert_file
-
- def read_md(f):
- return convert_file(f, 'rst')
-
-except ImportError:
- print("warning: pypandoc module not found, could not convert Markdown to RST")
-
- def read_md(f):
- return open(f, 'r').read()
-
setup(name='baron',
version='0.9',
description='Full Syntax Tree for python to make writing refactoring code a realist task',
author='Laurent Peuch',
- long_description=read_md("README.md") + "\n\n" + open("CHANGELOG", "r").read(),
+ long_description=open("README.md").read() + "\n\n" + open("CHANGELOG", "r").read(),
+ long_description_content_type="text/markdown",
author_email='cortex@worlddomination.be',
url='https://github.com/PyCQA/baron',
install_requires=['rply'], | fix: pypi now supports markdown | PyCQA_baron | train | py |
11c67552be719a476d8fa76963509fb4a8ef8b04 | diff --git a/system/core/controllers/cli/Install.php b/system/core/controllers/cli/Install.php
index <HASH>..<HASH> 100644
--- a/system/core/controllers/cli/Install.php
+++ b/system/core/controllers/cli/Install.php
@@ -79,7 +79,7 @@ class Install extends CliController
$host = $this->getSubmitted('store.host');
$basepath = $this->getSubmitted('store.basepath');
$vars = array('@url' => rtrim("$host/$basepath", '/'));
- return $this->text("Your store has been installed.\nURL: @url\nAdmin area: @url/admin", $vars);
+ return $this->text("Your store has been installed.\nURL: @url\nAdmin area: @url/admin\nGood luck!", $vars);
}
/** | Minor refactoring cli\Install controller | gplcart_gplcart | train | php |
ad81ed00da98179a0ba80b95834e1acc3b5eac1c | diff --git a/pupa/importers/base.py b/pupa/importers/base.py
index <HASH>..<HASH> 100644
--- a/pupa/importers/base.py
+++ b/pupa/importers/base.py
@@ -121,7 +121,11 @@ class BaseImporter(object):
if json_id.startswith('~'):
spec = get_psuedo_id(json_id)
spec = self.limit_spec(spec)
- return self.model_class.objects.get(**spec).id
+ try:
+ return self.model_class.objects.get(**spec).id
+ except self.model_class.DoesNotExist:
+ raise ValueError('cannot resolve psuedo-id to {}: {}'.format(
+ self.model_class.__name__, json_id))
# get the id that the duplicate points to, or use self
json_id = self.duplicates.get(json_id, json_id)
@@ -129,7 +133,7 @@ class BaseImporter(object):
try:
return self.json_to_db_id[json_id]
except KeyError:
- raise ValueError('cannot resolve id: {0}'.format(json_id))
+ raise ValueError('cannot resolve id: {}'.format(json_id))
def import_directory(self, datadir):
""" import a JSON directory into the database """ | better error message on failure to resolve psuedo-id | opencivicdata_pupa | train | py |
f3063b9cb1fde76057c4218682308df45267f52a | diff --git a/src/main/java/org/primefaces/extensions/component/layout/LayoutPane.java b/src/main/java/org/primefaces/extensions/component/layout/LayoutPane.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/primefaces/extensions/component/layout/LayoutPane.java
+++ b/src/main/java/org/primefaces/extensions/component/layout/LayoutPane.java
@@ -451,8 +451,7 @@ public class LayoutPane extends UIComponentBase {
return;
} else if (parent instanceof OutputPanel
- && Layout.STYLE_CLASS_LAYOUT_CONTENT.equals(((OutputPanel) parent).getStyleClass())
- && "block".equals(((OutputPanel) parent).getLayout())) {
+ && Layout.STYLE_CLASS_LAYOUT_CONTENT.equals(((OutputPanel) parent).getStyleClass())) {
// layout pane can be within p:outputPanel representing a HTML div
setOptions(parent.getParent()); | Fixed compilation error in LayoutPane | primefaces-extensions_core | train | java |
b6cfa0b8e3bd74aaa588dcb3b23720a6b4466fd1 | diff --git a/lib/irt/extensions/rails.rb b/lib/irt/extensions/rails.rb
index <HASH>..<HASH> 100644
--- a/lib/irt/extensions/rails.rb
+++ b/lib/irt/extensions/rails.rb
@@ -3,7 +3,8 @@ class ActiveSupport::BufferedLogger
alias_method :original_add, :add
def add(*args)
- message = original_add(*args)
+ original_add(*args)
+ message = args[1]
# no inline log when in rails server and not interactive mode
return message if IRB.CurrentContext.nil? || IRT.rails_server && IRB.CurrentContext.irt_mode != :interactive
if IRT.rails_log | fixes an issue with rails <I> | ddnexus_irt | train | rb |
ed9b45ecf1076cb5cf69735fc002273daca2d7c6 | diff --git a/mod/lesson/continue.php b/mod/lesson/continue.php
index <HASH>..<HASH> 100644
--- a/mod/lesson/continue.php
+++ b/mod/lesson/continue.php
@@ -42,6 +42,7 @@ $lessonoutput = $PAGE->get_renderer('mod_lesson');
$url = new moodle_url('/mod/lesson/continue.php', array('id'=>$cm->id));
$PAGE->set_url($url);
+$PAGE->set_pagetype('mod-lesson-view');
$PAGE->navbar->add(get_string('continue', 'lesson'));
// This is the code updates the lesson time for a timed test | MDL-<I> lesson: Fix for positioning of blocks on continue.php | moodle_moodle | train | php |
6c15788a386a3c7ef2bb7ab135853d343d585dc7 | diff --git a/lib/cli.js b/lib/cli.js
index <HASH>..<HASH> 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -6,17 +6,17 @@ var meow = require('meow');
module.exports = function () {
var config;
- var cli = meow({
+ var args = meow({
pkg: '../package.json'
});
try {
- config = configLoader(cli.flags.c || cli.flags.config);
+ config = configLoader(args.flags.c || args.flags.config);
} catch (e) {
console.log('Something\'s wrong with the config file.');
process.exit(1);
}
- linter.lint(cli.input[0], config);
+ linter.lint(args.input[0], config);
}; | Use 'args' instead of 'cli' | lesshint_lesshint | train | js |
66f984dcda9030297cf9d65d57e299c074ba5a32 | diff --git a/Slim/Container.php b/Slim/Container.php
index <HASH>..<HASH> 100644
--- a/Slim/Container.php
+++ b/Slim/Container.php
@@ -32,6 +32,22 @@
*/
namespace Slim;
+/**
+ * Container
+ *
+ * This is a very simple dependency injection (DI) container. I must
+ * give a hat tip to Fabien Potencier, because a few methods in this
+ * class are borrowed wholesale from his `Pimple` library.
+ *
+ * I wanted to avoid third-party dependencies, so I created this
+ * DI container as a simple derivative of Pimple. If you need a separate
+ * stand-alone DI container component, please use Pimple:
+ *
+ * @package Slim
+ * @author Fabien Potencier, Josh Lockhart
+ * @since 2.3.0
+ * @see https://github.com/fabpot/Pimple
+ */
class Container implements \ArrayAccess, \Countable, \IteratorAggregate
{
/** | Provide credit to Pimple in \Slim\Container | slimphp_Slim | train | php |
b1b6c883605fb0be0d9592931e872a61532e03bc | diff --git a/test/test_conf_in_symlinks.py b/test/test_conf_in_symlinks.py
index <HASH>..<HASH> 100755
--- a/test/test_conf_in_symlinks.py
+++ b/test/test_conf_in_symlinks.py
@@ -21,6 +21,7 @@
#
# This file is used to test reading and processing of config files
#
+import os
import sys
from shinken_test import *
@@ -28,10 +29,13 @@ from shinken_test import *
class TestConfigWithSymlinks(ShinkenTest):
def setUp(self):
+ if os.name == 'nt':
+ return
self.setup_with_file('etc/nagios_conf_in_symlinks.cfg')
def test_symlinks(self):
-
+ if os.name == 'nt':
+ return
if sys.version_info < (2 , 6):
print "************* WARNING********"*200
print "On python 2.4 and 2.5, the symlinks following is NOT managed" | Fix : test_conf_in_symlinks.py and windows is not a good mix.... | Alignak-monitoring_alignak | train | py |
11b4239a93badd5927e3d19c168900f9cbf710ae | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -21,6 +21,8 @@ import os
import sys
sys.path.append('/Users/thomassaunders/Workshop/neo-python/')
+# resolve module import errors for :automodule: and :autoclass:
+sys.path.append(os.path.abspath('../..'))
# need to mock plyvel so it will compile on rtd.org | Fix automodule imports such that SmartContract Parameter types are actually parsed. | CityOfZion_neo-python | train | py |
714744bd7e43a865d2da00da4bd851e39e175401 | diff --git a/library/CM/Model/User.php b/library/CM/Model/User.php
index <HASH>..<HASH> 100644
--- a/library/CM/Model/User.php
+++ b/library/CM/Model/User.php
@@ -202,10 +202,14 @@ class CM_Model_User extends CM_Model_Abstract {
}
/**
+ * @param bool|null $withDefault
* @return CM_Model_Currency|null
*/
- public function getCurrency() {
+ public function getCurrency($withDefault = null) {
if (!$this->_get('currencyId')) {
+ if ($withDefault) {
+ return CM_Model_Currency::getDefaultCurrency();
+ }
return null;
}
return new CM_Model_Currency($this->_get('currencyId')); | add $withDefault to be able to get the default currency | cargomedia_cm | train | php |
9f17704ae6edb479f23d5e38c86c52ef1019fc8b | diff --git a/spec/unit/azure_server_create_spec.rb b/spec/unit/azure_server_create_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/azure_server_create_spec.rb
+++ b/spec/unit/azure_server_create_spec.rb
@@ -274,9 +274,9 @@ describe Chef::Knife::AzureServerCreate do
@server_instance.run
end
-########## Uncomment the code below to test automatic certificate generation for ssl communication
-=begin
+
it 'create with automatic certificates creation if winrm-transport=ssl' do
+ pending "with automatic certificates creation if winrm-transport=ssl"
# set all params
Chef::Config[:knife][:azure_dns_name] = 'service001'
Chef::Config[:knife][:azure_vm_name] = 'vm002'
@@ -298,7 +298,6 @@ describe Chef::Knife::AzureServerCreate do
#Delete temp directory
FileUtils.remove_entry_secure dir
end
-=end
end
context "when --azure-dns-name is not specified" do | Added pending testcase for automatic certificate generation | chef_knife-azure | train | rb |
518a961050a0463265ee5892507ccbf94ef5a06c | diff --git a/tests/DrafterTest.php b/tests/DrafterTest.php
index <HASH>..<HASH> 100644
--- a/tests/DrafterTest.php
+++ b/tests/DrafterTest.php
@@ -78,8 +78,7 @@ class DrafterTest extends \PHPUnit_Framework_TestCase
// the drafter binary will add a line break at the end of the version string
$version = trim($version);
- // Assert the fixed version of drafter that this package currently supports
- $this->assertRegExp('/v1\.\d+\.\d+/', $version);
+ $this->assertNotEmpty($version);
}
/** | Do not care about the exact version of drafter binary | hendrikmaus_drafter-php | train | php |
1dad5ddf17c86d5e814f72c8d32525a9cd3e92e6 | diff --git a/lib/arjdbc/teradata/adapter.rb b/lib/arjdbc/teradata/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/teradata/adapter.rb
+++ b/lib/arjdbc/teradata/adapter.rb
@@ -111,7 +111,7 @@ module ::ArJdbc
output = nil
pk = primary_key(table)
if pk
- output = execute("SELECT TOP 1 #{pk} FROM #{table} ORDER BY #{pk} DESC").first[pk]
+ output = execute("SELECT TOP 1 #{quote_column_name(pk)} FROM #{quote_table_name(table)} ORDER BY #{quote_column_name(pk)} DESC").first[pk]
end
output
end | Quote table name and column name when looking for primary key | mrcsparker_activerecord-jdbcteradata-adapter | train | rb |
77b7931520b1c18cf4b6107826014b94664892b6 | diff --git a/lib/handlers/wallaby/cached_compiled_erb.rb b/lib/handlers/wallaby/cached_compiled_erb.rb
index <HASH>..<HASH> 100644
--- a/lib/handlers/wallaby/cached_compiled_erb.rb
+++ b/lib/handlers/wallaby/cached_compiled_erb.rb
@@ -3,8 +3,12 @@ require 'erubis'
# TODO: move this kind of logic into a gem called faster rails :)
class Wallaby::CachedCompiledErb < ActionView::Template::Handlers::ERB
def call(template)
- Rails.cache.fetch "wallaby/views/erb/#{ template.inspect }" do
+ if Rails.env.development?
super
+ else
+ Rails.cache.fetch "wallaby/views/erb/#{ template.inspect }" do
+ super
+ end
end
end
end | do not cache compiled era for dev env | reinteractive_wallaby | train | rb |
bf49c182d91486c3c2418a1ee21368e642c01799 | diff --git a/Source/fluent-ui.js b/Source/fluent-ui.js
index <HASH>..<HASH> 100644
--- a/Source/fluent-ui.js
+++ b/Source/fluent-ui.js
@@ -41,7 +41,7 @@ class FluentUI {
original_bg: $(selector).css("background-image"),
light_color: "rgba(255,255,255,0.15)",
light_effect_size: $(selector).outerWidth(),
- click_effect_enable: false,
+ click_effect_enable: true,
click_effect_size: 70
}
diff --git a/Test/main.js b/Test/main.js
index <HASH>..<HASH> 100644
--- a/Test/main.js
+++ b/Test/main.js
@@ -2,12 +2,13 @@
FluentUI.applyTo(".toolbar", {
light_color: "rgba(255,255,255,0.1)",
- light_effect_size: 400
+ light_effect_size: 400,
+ click_effect_enable: false
})
FluentUI.applyTo(".btn", {
light_color: "rgba(255,255,255,0.2)",
- click_effect_enable: true
+
}) | change the default option of click_effect_enable to true | d2phap_fluent-reveal-effect | train | js,js |
c45cf65415461617084ebce74043c8bd33b2203c | diff --git a/src/Graviton/SchemaBundle/Model/SchemaModel.php b/src/Graviton/SchemaBundle/Model/SchemaModel.php
index <HASH>..<HASH> 100644
--- a/src/Graviton/SchemaBundle/Model/SchemaModel.php
+++ b/src/Graviton/SchemaBundle/Model/SchemaModel.php
@@ -2,7 +2,6 @@
namespace Graviton\SchemaBundle\Model;
-use MyProject\Proxies\__CG__\OtherProject\Proxies\__CG__\stdClass;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; | damn ide, it does too much ;-) | libgraviton_graviton | train | php |
04f5876efb71c2766f3a8f705a6c35811b23c75b | diff --git a/inject/src/main/java/io/micronaut/context/DefaultApplicationContextBuilder.java b/inject/src/main/java/io/micronaut/context/DefaultApplicationContextBuilder.java
index <HASH>..<HASH> 100644
--- a/inject/src/main/java/io/micronaut/context/DefaultApplicationContextBuilder.java
+++ b/inject/src/main/java/io/micronaut/context/DefaultApplicationContextBuilder.java
@@ -63,7 +63,7 @@ public class DefaultApplicationContextBuilder implements ApplicationContextBuild
@Override
public boolean isEagerInitConfiguration() {
- return eagerInitSingletons;
+ return eagerInitConfiguration;
}
@NonNull | isEagerInitConfiguration should return eagerInitConfiguration | micronaut-projects_micronaut-core | train | java |
4244fb414d36cf07690dd76d48d7b705a375157f | diff --git a/examples/basic.py b/examples/basic.py
index <HASH>..<HASH> 100755
--- a/examples/basic.py
+++ b/examples/basic.py
@@ -7,6 +7,12 @@ import time
import pusherclient
+# Add a logging handler so we can see the raw communication data
+root = logging.getLogger()
+root.setLevel(logging.INFO)
+ch = logging.StreamHandler(sys.stdout)
+root.addHandler(ch)
+
global pusher
def print_usage(filename): | Examples - Include rootlogger in basic example. | ekulyk_PythonPusherClient | train | py |
fd8c306a5444b2a56b82a4a25f0777c868e36ad4 | diff --git a/test/helper.js b/test/helper.js
index <HASH>..<HASH> 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -11,7 +11,7 @@ exports.getStanza = function(file) {
}
var Eventer = function() {}
-Eventer.prototype = new Event()
+Eventer.prototype.__proto__ = Event.prototype
Eventer.prototype.send = function(stanza) {
this.emit('stanza', stanza.root())
} | Improvement to helper when splitting tests to multiple files | xmpp-ftw_xmpp-ftw-pubsub | train | js |
1a61e06096e8fc15ac38c5357c497861f3df850a | diff --git a/lib/deep_cloneable.rb b/lib/deep_cloneable.rb
index <HASH>..<HASH> 100644
--- a/lib/deep_cloneable.rb
+++ b/lib/deep_cloneable.rb
@@ -80,7 +80,7 @@ class ActiveRecord::Base
if association_reflection.options[:as]
fk = association_reflection.options[:as].to_s + "_id"
else
- fk = association_reflection.options[:foreign_key] || self.class.to_s.underscore + "_id"
+ fk = association_reflection.options[:foreign_key] || self.class.to_s.underscore.sub(/([^\/]*\/)*/, '') + "_id"
end
self.send(association).collect do |obj|
tmp = obj.clone(opts) | fix one bug:
when model has namespace, like class is Aaa::Bbb, then it will be raise a undefined method error "can't find aaa/bbb_id", generally, the foreign key
will be bbb_id for aaa object, this is a common case. | moiristo_deep_cloneable | train | rb |
f1c26e77c535598f84b01035ac8ac465def30c72 | diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py
index <HASH>..<HASH> 100644
--- a/scapy/layers/inet6.py
+++ b/scapy/layers/inet6.py
@@ -1023,6 +1023,12 @@ class IPv6ExtHdrFragment(_IPv6ExtHdr):
IntField("id", None)]
overload_fields = {IPv6: {"nh": 44}}
+ def guess_payload_class(self, p):
+ if self.offset > 0:
+ return Raw
+ else:
+ return super(IPv6ExtHdrFragment, self).guess_payload_class(p)
+
def defragment6(packets):
""" | IPv6: disable payload detection for non-first fragments | secdev_scapy | train | py |
c9d67a46efa9681a4462af9cab2cb614a70237af | diff --git a/classes/GemsEscort.php b/classes/GemsEscort.php
index <HASH>..<HASH> 100644
--- a/classes/GemsEscort.php
+++ b/classes/GemsEscort.php
@@ -527,7 +527,7 @@ class GemsEscort extends MUtil_Application_Escort
*/
protected function _initSession()
{
-
+ $this->bootstrap('project'); // Make sure the project is available
$session = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.session');
$idleTimeout = $this->project->getSessionTimeOut(); | Make session init failsafe and order independent when overruled from project bootstrap | GemsTracker_gemstracker-library | train | php |
e4f2d0f21fbff6e4d7504374a4e0c0f719a87b4a | diff --git a/src/Command/IssueTakeCommand.php b/src/Command/IssueTakeCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/IssueTakeCommand.php
+++ b/src/Command/IssueTakeCommand.php
@@ -69,7 +69,11 @@ EOF
'allow_failures' => true
],
[
- 'line' => sprintf('git checkout -b %s %s/%s', $slugTitle, 'origin', $baseBranch),
+ 'line' => sprintf('git checkout %s/%s', 'origin', $baseBranch),
+ 'allow_failures' => true
+ ],
+ [
+ 'line' => sprintf('git checkout -b %s', $slugTitle),
'allow_failures' => true
],
]; | fix #<I> fix bug with tracking on itake when that is the job of the pusher command | gushphp_gush | train | php |
e8982ab1c6fac92846d829675c103ee66bf7ace4 | diff --git a/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb b/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb
index <HASH>..<HASH> 100644
--- a/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb
+++ b/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb
@@ -104,8 +104,9 @@ module PhusionPassenger
# as the instance registry dir. See https://github.com/phusion/passenger/issues/1475
#
# systemd's PrivateTmp feature works like an inverted OSX, apache gets its own
- # TMPDIR and users use /tmp
- [string_env("TMPDIR"), "/tmp", "/var/run/passenger-instreg",*Dir['/tmp/systemd-private-*-{httpd,nginx}.service-*/tmp']].compact
+ # TMPDIR and users use /tmp, however the path is often too long because socket paths can
+ # only be up to 108 characters long.
+ [string_env("TMPDIR"), "/tmp", "/var/run/passenger-instreg",*Dir['/tmp/systemd-private-*-{httpd,nginx,apache2}.service-*/tmp']].compact
end
def string_env(name) | add missing apache name for ubuntu in instance registry dir detection | phusion_passenger | train | rb |
d5deeb27c0d7c6a55528478ddff3456d352688a4 | diff --git a/jams/version.py b/jams/version.py
index <HASH>..<HASH> 100644
--- a/jams/version.py
+++ b/jams/version.py
@@ -3,4 +3,4 @@
"""Version info"""
short_version = '0.2'
-version = '0.2.0'
+version = '0.2.0rc1' | changed version number to rc1 | marl_jams | train | py |
9b5e1b9cf1473699b54024a8d108ed891411c87d | diff --git a/odl/operator/tensor_ops.py b/odl/operator/tensor_ops.py
index <HASH>..<HASH> 100644
--- a/odl/operator/tensor_ops.py
+++ b/odl/operator/tensor_ops.py
@@ -858,6 +858,8 @@ class MatrixOperator(Operator):
def _call(self, x, out=None):
"""Return ``self(x[, out])``."""
+ from pkg_resources import parse_version
+
if out is None:
return self.range.element(self.matrix.dot(x))
else:
@@ -866,8 +868,14 @@ class MatrixOperator(Operator):
# sparse matrices
out[:] = self.matrix.dot(x)
else:
- with writable_array(out) as out_arr:
- self.matrix.dot(x, out=out_arr)
+ if (parse_version(np.__version__) < parse_version('1.13.0') and
+ x is out):
+ # Workaround for bug in Numpy < 1.13 with aliased in and
+ # out in np.dot
+ out[:] = self.matrix.dot(x)
+ else:
+ with writable_array(out) as out_arr:
+ self.matrix.dot(x, out=out_arr)
def __repr__(self):
"""Return ``repr(self)``.""" | MAINT: add workaround for Numpy bug in MatrixOperator | odlgroup_odl | train | py |
601fd557920424587e5d9f7c2a35909d25d73c47 | diff --git a/lib/node_modules/@stdlib/utils/merge/lib/mergefcn.js b/lib/node_modules/@stdlib/utils/merge/lib/mergefcn.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/utils/merge/lib/mergefcn.js
+++ b/lib/node_modules/@stdlib/utils/merge/lib/mergefcn.js
@@ -2,7 +2,7 @@
// MODULES //
-var isObject = require( '@stdlib/utils/is-object' ); // TODO: plain object
+var isObject = require( '@stdlib/utils/is-plain-object' );
var deepMerge = require( './deepmerge.js' ); | Use utility to test if a value is a plain object | stdlib-js_stdlib | train | js |
5700b3702b03a11000a381815460f35907087610 | diff --git a/core/ArchiveProcessing.php b/core/ArchiveProcessing.php
index <HASH>..<HASH> 100644
--- a/core/ArchiveProcessing.php
+++ b/core/ArchiveProcessing.php
@@ -994,7 +994,7 @@ abstract class Piwik_ArchiveProcessing
public static function isArchivingDisabledFor($segment, $period)
{
- if($period == 'range') {
+ if($period->getLabel() == 'range') {
return false;
}
$processOneReportOnly = !self::shouldProcessReportsAllPluginsFor($segment, $period); | Refs #<I> - Piwik_Period's toString method does not return the type of the Period and a "Array to String conversion" notice is triggered. So we use the getLabel accessor. | matomo-org_matomo | train | php |
7e7a526c8b6715bbf1a6e5305ce7eca38db84fe8 | diff --git a/library/src/main/java/trikita/anvil/Anvil.java b/library/src/main/java/trikita/anvil/Anvil.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/trikita/anvil/Anvil.java
+++ b/library/src/main/java/trikita/anvil/Anvil.java
@@ -11,6 +11,8 @@ import java.util.Map;
import java.util.WeakHashMap;
import static trikita.anvil.Nodes.*;
+import java.util.HashSet;
+import java.util.Set;
/**
* <p>
@@ -108,7 +110,11 @@ public final class Anvil {
skipNextRender = false;
return;
}
- for (Renderable r: mounts.keySet()) {
+ // We need to copy the keyset, otherwise a concurrent modification may
+ // happen if Renderables are nested
+ Set<Renderable> set = new HashSet<Renderable>();
+ set.addAll(mounts.keySet());
+ for (Renderable r: set) {
render(r);
}
} | fixed renderable iteration in Anvil to avoid concurrent modification exceptions | zserge_anvil | train | java |
2dd025760ee7cb305a62b3c5122325ea83f2d47b | diff --git a/lib/ooor/relation/finder_methods.rb b/lib/ooor/relation/finder_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/ooor/relation/finder_methods.rb
+++ b/lib/ooor/relation/finder_methods.rb
@@ -35,15 +35,7 @@ module Ooor
def find_first_or_last(options, ordering = "ASC")
options[:order] ||= "id #{ordering}"
options[:limit] = 1
- domain = options[:domain] || options[:conditions] || []
- context = options[:context] || {}
- ids = rpc_execute('search', to_openerp_domain(domain), options[:offset] || 0,
- options[:limit], options[:order], context.dup)
- if ids.empty?
- return nil
- else
- find_single(ids.first, options)
- end
+ find_single(nil, options)[0]
end
#actually finds many resources specified with scope = ids_array | major optimization: find_first_or_last now use search_read when using JSRPC transport | akretion_ooor | train | rb |
44d97089780424b5b0982dfc59185ce40d33672b | diff --git a/lib/decorate.js b/lib/decorate.js
index <HASH>..<HASH> 100644
--- a/lib/decorate.js
+++ b/lib/decorate.js
@@ -7,7 +7,7 @@ function decorate (callSpec, decorator) {
thisObj = callSpec.thisObj,
numArgsToCapture = callSpec.numArgsToCapture;
- return function () {
+ return function decoratedAssert () {
var context, message, args = slice.apply(arguments);
if (args.every(isNotCaptured)) { | refactor(empower): name function to make stacktrace a bit clean | twada_empower-core | train | js |
103f93c3eb4303d8cf38fe54fe0132668fba4cd2 | diff --git a/app/models/glue/pulp/repo.rb b/app/models/glue/pulp/repo.rb
index <HASH>..<HASH> 100644
--- a/app/models/glue/pulp/repo.rb
+++ b/app/models/glue/pulp/repo.rb
@@ -304,7 +304,7 @@ module Glue::Pulp::Repo
history = self.sync_status
return if history.nil? || history.state == ::PulpSyncStatus::Status::NOT_SYNCED
- Pulp::Repository.cancel(self.pulp_id, history)
+ Pulp::Repository.cancel(self.pulp_id, history.uuid)
end
def sync_finish | sync management - fixing repository cancel | Katello_katello | train | rb |
d022abee3896ea86a1b4795949027ce4a9dc0cdb | diff --git a/lib/PHPExif/Mapper/Native.php b/lib/PHPExif/Mapper/Native.php
index <HASH>..<HASH> 100644
--- a/lib/PHPExif/Mapper/Native.php
+++ b/lib/PHPExif/Mapper/Native.php
@@ -225,6 +225,14 @@ class Native implements MapperInterface
{
$parts = explode('/', $component);
- return count($parts) === 1 ? $parts[0] : (int) reset($parts) / (int) end($parts);
+ if (count($parts) > 0) {
+ if ($parts[1]) {
+ return (int) $parts[0] / (int) $parts[1];
+ }
+
+ return 0;
+ }
+
+ return $parts[0];
}
} | Fixed normalization of zero degrees coordinates in the native mapper | PHPExif_php-exif | train | php |
9fedc6635197d8ce3e1abd4a29625163022942da | diff --git a/pefile.py b/pefile.py
index <HASH>..<HASH> 100644
--- a/pefile.py
+++ b/pefile.py
@@ -2279,7 +2279,7 @@ def is_valid_dos_filename(s):
# charset we will assume the name is invalid.
allowed_function_name = b(
- string.ascii_lowercase + string.ascii_uppercase + string.digits + "_?@$()<>"
+ string.ascii_lowercase + string.ascii_uppercase + string.digits + "._?@$()<>"
) | Allow dot in PE symbol name
When building with optimization flag enable, it is possible to generate
symbol names such as 'PyErr_CheckSignals.part<I>' which contain a dot.
Simply add '.' to the allowed_function_name list. | erocarrera_pefile | train | py |
7e869ee04f92b4e1deda157735380a6f1f118c76 | diff --git a/pyemma/coordinates/clustering/uniform_time.py b/pyemma/coordinates/clustering/uniform_time.py
index <HASH>..<HASH> 100644
--- a/pyemma/coordinates/clustering/uniform_time.py
+++ b/pyemma/coordinates/clustering/uniform_time.py
@@ -82,7 +82,7 @@ class UniformTimeClustering(AbstractClustering):
# random access matrix
ra_stride = np.array([UniformTimeClustering._idx_to_traj_idx(x, cumsum) for x in linspace])
self.clustercenters = np.concatenate([X for X in
- iterable.iterator(stride=ra_stride, return_trajindex=False, **kw)])
+ iterable.iterator(stride=ra_stride, return_trajindex=False)])
assert len(self.clustercenters) == self.n_clusters
return self | [uniform-t-clustering] do not pass kw into iterator | markovmodel_PyEMMA | train | py |
d797c7b57f9920730aba3dab1c184b9984db3538 | diff --git a/lib/import.js b/lib/import.js
index <HASH>..<HASH> 100644
--- a/lib/import.js
+++ b/lib/import.js
@@ -118,6 +118,12 @@ function importFramework (framework, skip) {
*/
function resolve (framework) {
+ debug('resolving framework name or path:', framework)
+ // strip off a trailing slash if present
+ if (framework[framework.length-1] == '/') {
+ framework = framework.slice(0, framework.length-1)
+ debug('stripped trailing slash:', framework)
+ }
// already absolute, return as-is
if (~framework.indexOf('/')) return framework;
var i = 0 | Strip a trailing slash from the framework name if present.
Fixes #<I>. | TooTallNate_NodObjC | train | js |
43db56f1b6059e4800d9b87821e6a14bfe357efc | diff --git a/stun/discover.go b/stun/discover.go
index <HASH>..<HASH> 100644
--- a/stun/discover.go
+++ b/stun/discover.go
@@ -204,15 +204,15 @@ func discover(conn net.PacketConn, addr net.Addr, softwareName string) (NATType,
return NAT_FULL, host, nil
}
+ if changeAddr == nil {
+ return NAT_ERROR, host, errors.New("No changed address.")
+ }
+
otherConn, err := net.ListenUDP("udp", nil)
if err != nil {
return NAT_ERROR, nil, err
}
- if changeAddr == nil {
- return NAT_ERROR, host, errors.New("No changed address.")
- }
-
packet, _, identical, _, err = test1(otherConn, changeAddr, softwareName)
if err != nil {
return NAT_ERROR, host, err | check changed addr first then conn for test1 | ccding_go-stun | train | go |
a52b61e7c1f5df91bd511ba7d429db0d5acb8eda | diff --git a/src/Events/BaseViewListener.php b/src/Events/BaseViewListener.php
index <HASH>..<HASH> 100644
--- a/src/Events/BaseViewListener.php
+++ b/src/Events/BaseViewListener.php
@@ -186,30 +186,29 @@ abstract class BaseViewListener implements EventListenerInterface
{
$result = [];
- if (!$event->subject()->request->query('associated')) {
- return $result;
- }
-
- $table = $event->subject()->{$event->subject()->name};
- $associations = $table->associations();
+ $associations = $event->subject()->{$event->subject()->name}->associations();
if (empty($associations)) {
return $result;
}
+ // always include file associations
$result = $this->_containAssociations(
$associations,
- $this->_nestedAssociations
+ $this->_fileAssociations,
+ true
);
- // always include file associations
+ if (!$event->subject()->request->query('associated')) {
+ return $result;
+ }
+
$result = array_merge(
- $result,
$this->_containAssociations(
$associations,
- $this->_fileAssociations,
- true
- )
+ $this->_nestedAssociations
+ ),
+ $result
);
return $result; | always include file associations (task #<I>) | QoboLtd_cakephp-csv-migrations | train | php |
a554c9d0ab65d71d535c008d62603d4c1f9b6375 | diff --git a/lib/turn/runners/minirunner.rb b/lib/turn/runners/minirunner.rb
index <HASH>..<HASH> 100644
--- a/lib/turn/runners/minirunner.rb
+++ b/lib/turn/runners/minirunner.rb
@@ -66,7 +66,7 @@ module Turn
# suites are cases in minitest
@turn_case = @turn_suite.new_case(suite.name)
- filter = @turn_config.pattern || /./
+ filter = @options[:filter] || @turn_config.pattern || /./
suite.send("#{type}_methods").grep(filter).each do |test|
@turn_case.new_test(test) | Use MiniTest's filter option. | turn-project_turn | train | rb |
c31ec724c07c4181ec1bbd2a344b23fd6186b3a9 | diff --git a/__pkginfo__.py b/__pkginfo__.py
index <HASH>..<HASH> 100644
--- a/__pkginfo__.py
+++ b/__pkginfo__.py
@@ -49,8 +49,8 @@ install_requires = ['columnize >= 0.3.9',
'pygments >= 2.2.0',
'spark_parser >= 1.8.5, <1.9.0',
'tracer >= 0.3.2',
- 'uncompyle6 >= 3.1.0',
- 'xdis >= 3.7.0, < 3.8.0',
+ 'uncompyle6 >= 3.1.1',
+ 'xdis >= 3.8.0, < 3.9.0',
]
license = 'GPL3'
mailing_list = 'python-debugger@googlegroups.com' | Bump xdis and uncompyle6 min versions | rocky_python3-trepan | train | py |
c6d6e47d4fa47185cfbf2e24617d79deb04605ce | diff --git a/consumer_test.go b/consumer_test.go
index <HASH>..<HASH> 100644
--- a/consumer_test.go
+++ b/consumer_test.go
@@ -341,11 +341,11 @@ func TestBlueGreenDeployment(t *testing.T) {
blue := BlueGreenDeployment{activeTopic, "static", blueGroup}
green := BlueGreenDeployment{inactiveTopic, "static", greenGroup}
- time.Sleep(20 * time.Second)
+ time.Sleep(30 * time.Second)
coordinator.RequestBlueGreenDeployment(blue, green)
- time.Sleep(60 * time.Second)
+ time.Sleep(120 * time.Second)
//All Blue consumers should switch to Green group and change topic to inactive
greenConsumerIds, _ := coordinator.GetConsumersInGroup(greenGroup) | Increased timeout for blue-green test. | elodina_go_kafka_client | train | go |
66c5e19f9bd057644fab475499ea45bb428ba2b2 | diff --git a/runtime/graphdriver/devmapper/deviceset.go b/runtime/graphdriver/devmapper/deviceset.go
index <HASH>..<HASH> 100644
--- a/runtime/graphdriver/devmapper/deviceset.go
+++ b/runtime/graphdriver/devmapper/deviceset.go
@@ -821,6 +821,10 @@ func (devices *DeviceSet) Shutdown() error {
info.lock.Unlock()
}
+ if err := devices.deactivateDevice(""); err != nil {
+ utils.Debugf("Shutdown deactivate base , error: %s\n", err)
+ }
+
if err := devices.deactivatePool(); err != nil {
utils.Debugf("Shutdown deactivate pool , error: %s\n", err)
} | devmapper: Ensure we shut down thin pool cleanly.
The change in commit a9fa1a<I>c3b0a<I>a<I>be<I>ff7ec<I>e<I>b<I>
made us only deactivate devices that were mounted. Unfortunately
this made us not deactivate the base device. Which caused
us to not be able to deactivate the pool.
This fixes that by always just deactivating the base device.
Docker-DCO-<I>- | moby_moby | train | go |
8d2054411cfc7a6265dc73ad78bce71fbda3c36b | diff --git a/question/type/questiontype.php b/question/type/questiontype.php
index <HASH>..<HASH> 100644
--- a/question/type/questiontype.php
+++ b/question/type/questiontype.php
@@ -9,10 +9,11 @@
* {@link http://maths.york.ac.uk/serving_maths}
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package quiz
-*/
+*//** */
-/// Question type class //////////////////////////////////////////////
+require_once($CFG->libdir . '/questionlib.php');
+/// Question type class //////////////////////////////////////////////
class default_questiontype {
/** | Tweak to unbreak unit tests. | moodle_moodle | train | php |
92a456cc25b5a65b4a8be7f6ac96474544d87806 | diff --git a/cmd2.py b/cmd2.py
index <HASH>..<HASH> 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -141,7 +141,7 @@ def options(option_list):
arg = newArgs
result = func(instance, arg, opts)
return result
- newFunc.__doc__ = '%s\n%s' % (func.__doc__, optionParser.format_help())
+ new_func.__doc__ = '%s\n%s' % (func.__doc__, optionParser.format_help())
return new_func
return option_setup | oops, had to fix a reference to newFunc | python-cmd2_cmd2 | train | py |
19b9cc473d6deb1826ffa33b5c3194d1d442b50f | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -23,7 +23,7 @@ window.CodeMirror = (function() {
replaceSelection: operation(replaceSelection),
focus: function(){window.focus(); focusInput(); onFocus(); fastPoll();},
setOption: function(option, value) {
- if (options[option] == value) return;
+ if (options[option] == value && option != "mode") return;
options[option] = value;
if (option == "mode" || option == "indentUnit") loadMode();
else if (option == "readOnly" && value == "nocursor") {onBlur(); input.blur();} | Always force a re-highlight when the 'mode' option is set
Closes #<I> | codemirror_CodeMirror | train | js |
1fc945f6c80fee684d36e008e36eb11b333f0bbb | diff --git a/sos/report/reporting.py b/sos/report/reporting.py
index <HASH>..<HASH> 100644
--- a/sos/report/reporting.py
+++ b/sos/report/reporting.py
@@ -191,7 +191,10 @@ class PlainTextReport(object):
def process_subsection(self, section, key, header, format_, footer):
if key in section:
self.line_buf.append(header)
- for item in section.get(key):
+ for item in sorted(
+ section.get(key),
+ key=lambda x: x["name"] if isinstance(x, dict) else ''
+ ):
self.line_buf.append(format_ % item)
if (len(footer) > 0):
self.line_buf.append(footer) | [reporting] Sort order of report contents by name
When using `reporting.py`, e.g. for `sos.txt`, sort the content on a
per-section basis so that comparison between multiple sos reports is
easier.
Closes: #<I>
Resolves: #<I> | sosreport_sos | train | py |
4a762767af6c6f05b7af7989389f13a840f6a895 | diff --git a/src/Shell/ImportShell.php b/src/Shell/ImportShell.php
index <HASH>..<HASH> 100644
--- a/src/Shell/ImportShell.php
+++ b/src/Shell/ImportShell.php
@@ -74,8 +74,6 @@ class ImportShell extends Shell
$this->hr();
$this->info('Preparing records ..');
- // skip if failed to generate import results records
- if (!$this->createImportResults($import, $count)) {
continue;
}
@@ -217,6 +215,8 @@ class ImportShell extends Shell
$progress->init();
$this->info('Importing records ..');
+ // generate import results records
+ $this->createImportResults($import, $count);
$reader = Reader::createFromPath($import->filename, 'r'); | Generate import results during data imports (task #<I>) | QoboLtd_cakephp-csv-migrations | train | php |
1db9d608b85ad474afb356ef4781e5f8c74d1981 | diff --git a/src/android/CropPlugin.java b/src/android/CropPlugin.java
index <HASH>..<HASH> 100644
--- a/src/android/CropPlugin.java
+++ b/src/android/CropPlugin.java
@@ -27,7 +27,7 @@ public class CropPlugin extends CordovaPlugin {
String imagePath = args.getString(0);
this.inputUri = Uri.parse(imagePath);
- this.outputUri = Uri.fromFile(new File(getTempDirectoryPath() + "/cropped.jpg"));
+ this.outputUri = Uri.fromFile(new File(getTempDirectoryPath() + "/" + System.currentTimeMillis()+ "-cropped.jpg"));
PluginResult pr = new PluginResult(PluginResult.Status.NO_RESULT);
pr.setKeepCallback(true);
@@ -92,4 +92,4 @@ public class CropPlugin extends CordovaPlugin {
cache.mkdirs();
return cache.getAbsolutePath();
}
-}
\ No newline at end of file
+} | Fixes #<I> - File was overwritten in temporary path (#<I>) | jeduan_cordova-plugin-crop | train | java |
2be4a2f8af40b71b73ab8363ef13c9336097b5dd | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -1,3 +1,18 @@
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ------------------------------------------------------------------------------
+
# -*- coding: utf-8 -*-
#
# Sawtooth documentation build configuration file, created by | Add license to docs conf.py | hyperledger_sawtooth-core | train | py |
e9773931ac1d1f494ddf5f4e75ebf8a4930509e4 | diff --git a/multiqc/modules/bcl2fastq/bcl2fastq.py b/multiqc/modules/bcl2fastq/bcl2fastq.py
index <HASH>..<HASH> 100644
--- a/multiqc/modules/bcl2fastq/bcl2fastq.py
+++ b/multiqc/modules/bcl2fastq/bcl2fastq.py
@@ -83,6 +83,8 @@ class MultiqcModule(BaseMultiqcModule):
run_data[lane] = {"total": 0, "perfectIndex": 0, "samples": dict()}
for demuxResult in conversionResult["DemuxResults"]:
sample = demuxResult["SampleName"]
+ if sample in run_data[lane]["samples"]:
+ log.debug("Duplicate runId/lane/sample combination found! Overwriting: {}, {}".format(self.prepend_runid(runId, lane),sample))
run_data[lane]["samples"][sample] = {"total": 0, "perfectIndex": 0, "filename": os.path.join(myfile['root'],myfile["fn"])}
run_data[lane]["total"] += demuxResult["NumberReads"]
run_data[lane]["samples"][sample]["total"] += demuxResult["NumberReads"] | Add warning for duplicate runID/lane/sample combination | ewels_MultiQC | train | py |
2eb23dfef0184a0c6abb13faf4dfc5867bc6a271 | diff --git a/lib/logger.js b/lib/logger.js
index <HASH>..<HASH> 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -34,15 +34,9 @@ Logger.prototype = {
},
log: function(message) {
var timestamp = '[' + this.getTimestamp() + ']';
- message = message.split('\n');
- if (message.length == 1) {
- this.stream.write(timestamp + ' ' + message[0] + '\n');
- } else {
- this.stream.write(timestamp + '\n');
- message.forEach(function(line) {
- this.stream.write(' ' + line + '\n');
- }, this);
- }
+ message.split('\n').forEach(function(line) {
+ this.stream.write(timestamp + ' ' + line + '\n');
+ }, this);
}
}; | Output timestamp for all lines | groonga_gcs | train | js |
6c694c1a9735bb182b9bdcfc43cc4c0b97a64d6e | diff --git a/App/Ui/DataProvider/Grid/Query/Builder.php b/App/Ui/DataProvider/Grid/Query/Builder.php
index <HASH>..<HASH> 100644
--- a/App/Ui/DataProvider/Grid/Query/Builder.php
+++ b/App/Ui/DataProvider/Grid/Query/Builder.php
@@ -56,7 +56,9 @@ abstract class Builder
/* limit pages */
$pageSize = $search->getPageSize();
$pageIndx = $search->getCurrentPage();
- $query->limitPage($pageIndx, $pageSize);
+ if ($pageSize || $pageIndx) {
+ $query->limitPage($pageIndx, $pageSize);
+ }
$result = $this->conn->fetchAll($query);
return $result;
} | MOBI-<I> PV transfers batch upload | praxigento_mobi_mod_core | train | php |
4ddd22c9c98aa576e176b3a062cf6a2a5a9ab7a1 | diff --git a/test/e2e/windows/dns.go b/test/e2e/windows/dns.go
index <HASH>..<HASH> 100644
--- a/test/e2e/windows/dns.go
+++ b/test/e2e/windows/dns.go
@@ -30,7 +30,7 @@ import (
"github.com/onsi/ginkgo"
)
-var _ = SIGDescribe("DNS", func() {
+var _ = SIGDescribe("[Feature:Windows] DNS", func() {
ginkgo.BeforeEach(func() {
e2eskipper.SkipUnlessNodeOSDistroIs("windows")
@@ -50,6 +50,9 @@ var _ = SIGDescribe("DNS", func() {
Nameservers: []string{testInjectedIP},
Searches: []string{testSearchPath},
}
+ testUtilsPod.Spec.NodeSelector = map[string]string{
+ "kubernetes.io/os": "windows",
+ }
testUtilsPod, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).Create(context.TODO(), testUtilsPod, metav1.CreateOptions{})
framework.ExpectNoError(err)
framework.Logf("Created pod %v", testUtilsPod) | adding windows os selector to the dnsPolicy tests
adding a feature selector to the windows Describe dns test | kubernetes_kubernetes | train | go |
755484c4bc4701d181ffd69ee02d41e916e6f471 | diff --git a/src/Services/Air/AirParser.js b/src/Services/Air/AirParser.js
index <HASH>..<HASH> 100644
--- a/src/Services/Air/AirParser.js
+++ b/src/Services/Air/AirParser.js
@@ -779,10 +779,10 @@ function importRequest(data) {
function extractFareRules(obj) {
const rulesList = obj['air:FareRule'];
- _.forEach(rulesList, (item) => {
+ rulesList.forEach((item) => {
const result = [];
const listName = (item['air:FareRuleLong']) ? 'air:FareRuleLong' : 'air:FareRuleShort';
- _.forEach(item[listName], (rule) => {
+ item[listName].forEach((rule) => {
const ruleCategoryNumber = parseInt(rule.Category, 10);
if (rule['air:FareRuleNameValue']) {
// for short rules | #<I> rewrite parser without lodash | Travelport-Ukraine_uapi-json | train | js |
8ad1dbdf1fbf34116b66d7f9a15aafa79d987d18 | diff --git a/hap.conf.js b/hap.conf.js
index <HASH>..<HASH> 100644
--- a/hap.conf.js
+++ b/hap.conf.js
@@ -10,6 +10,11 @@ module.exports = function(config) {
basePath: '',
browserNoActivityTimeout: 100000,
+ browserConsoleLogOptions: {
+ level: 'log',
+ format: '%b %T: %m',
+ terminal: true,
+ },
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | Enable console.log output in karma logs | hola_hap.js | train | js |
4e762ae41f24a51640163f43b80fc61db31d5102 | diff --git a/lib/nucleon/action/node/facts.rb b/lib/nucleon/action/node/facts.rb
index <HASH>..<HASH> 100644
--- a/lib/nucleon/action/node/facts.rb
+++ b/lib/nucleon/action/node/facts.rb
@@ -11,13 +11,6 @@ class Facts < CORL.plugin_class(:nucleon, :cloud_action)
super(:node, :facts, 570)
end
- #----
-
- def prepare
- CORL.quiet = true
- super
- end
-
#-----------------------------------------------------------------------------
# Settings
@@ -29,7 +22,7 @@ class Facts < CORL.plugin_class(:nucleon, :cloud_action)
ensure_node(node) do
facter_facts = node.facts
- puts Util::Data.to_json(facter_facts, true)
+ $stderr.puts Util::Data.to_json(facter_facts, true)
myself.result = facter_facts
end
end | Reworking the node facts action provider to work with updated lookup architecture. | coralnexus_corl | train | rb |
c57a1bdb2d4471af543399f46d344802986c6cd9 | diff --git a/handler/src/main/java/io/netty/handler/ssl/OpenSsl.java b/handler/src/main/java/io/netty/handler/ssl/OpenSsl.java
index <HASH>..<HASH> 100644
--- a/handler/src/main/java/io/netty/handler/ssl/OpenSsl.java
+++ b/handler/src/main/java/io/netty/handler/ssl/OpenSsl.java
@@ -112,6 +112,8 @@ public final class OpenSsl {
UNAVAILABILITY_CAUSE = cause;
if (cause == null) {
+ logger.debug("netty-tcnative using native library: {}", SSL.versionString());
+
final Set<String> availableOpenSslCipherSuites = new LinkedHashSet<String>(128);
boolean supportsKeyManagerFactory = false;
boolean useKeyManagerFactory = false; | Log used native library by netty-tcnative
Motivation:
As netty-tcnative can be build against different native libraries and versions we should log the used one.
Modifications:
Log the used native library after netty-tcnative was loaded.
Result:
Easier to understand what native SSL library was used. | netty_netty | train | java |
a4367afb18fbe138cbaecaf328b36fd67fdcfcd4 | diff --git a/spec/acceptance/examples_spec.rb b/spec/acceptance/examples_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/examples_spec.rb
+++ b/spec/acceptance/examples_spec.rb
@@ -11,7 +11,7 @@ describe "Regression on" do
gsub('example/','example/output/')
end
- it "runs successfully" do
+ it "runs successfully", :ruby => 1.9 do
stdin, stdout, stderr = Open3.popen3("ruby #{example}")
handle_map = { | . only run examples on <I> as part of the spec
Output of <I> and <I> differs largely. <I> will have to be verified manually. | kschiess_parslet | train | rb |
14f04834e0bde13913afde1b25a4cb428b532ca6 | diff --git a/casper.js b/casper.js
index <HASH>..<HASH> 100644
--- a/casper.js
+++ b/casper.js
@@ -536,7 +536,7 @@
utils: encodeURIComponent(phantom.Casper.ClientUtils.toString())
}));
if (!injected) {
- casper.log('Failed to inject Casper client-side utilities!', "debug");
+ casper.log('Failed to inject Casper client-side utilities!', "warning");
} else {
casper.log('Successfully injected Casper client-side utilities', "debug");
} | log message when failed injecting client-side utils raised to 'warning' | casperjs_casperjs | train | js |
031619776cf5b1e0713d647c5a843efc772bd0dc | diff --git a/pkg/cache/resource.go b/pkg/cache/resource.go
index <HASH>..<HASH> 100644
--- a/pkg/cache/resource.go
+++ b/pkg/cache/resource.go
@@ -30,6 +30,7 @@ type Resource interface {
// Common names for Envoy filters.
const (
+ CORS = "envoy.cors"
Router = "envoy.router"
HTTPConnectionManager = "envoy.http_connection_manager"
TCPProxy = "envoy.tcp_proxy" | Add CORS filter string (#<I>) | envoyproxy_go-control-plane | train | go |
190a0a4ce812bad91e185d3c1f332344ced442a6 | diff --git a/fixtures/go-server/server.go b/fixtures/go-server/server.go
index <HASH>..<HASH> 100644
--- a/fixtures/go-server/server.go
+++ b/fixtures/go-server/server.go
@@ -1,6 +1,7 @@
package main
import (
+ "flag"
"fmt"
"io/ioutil"
"net/http"
@@ -10,6 +11,11 @@ import (
"syscall"
)
+var (
+ memoryAllocated = flag.Uint("allocate-memory-b", 0, "allocate this much memory (in mb) on the heap and do not release it")
+ someGarbage []uint8
+)
+
func main() {
http.HandleFunc("/", hello)
http.HandleFunc("/env", env)
@@ -21,6 +27,10 @@ func main() {
http.HandleFunc("/cf-instance-key", cfInstanceKey)
http.HandleFunc("/cat", catFile)
+ if memoryAllocated != nil {
+ someGarbage = make([]uint8, *memoryAllocated*1024*1024)
+ }
+
fmt.Println("listening...")
ports := os.Getenv("PORT") | add a flag to cause the go-server to consume constant amount of memory | cloudfoundry_inigo | train | go |
2ae28bd74def24b71e04133246c190ed35fbdf3e | diff --git a/src/main/java/net/openhft/chronicle/network/WanSimulator.java b/src/main/java/net/openhft/chronicle/network/WanSimulator.java
index <HASH>..<HASH> 100755
--- a/src/main/java/net/openhft/chronicle/network/WanSimulator.java
+++ b/src/main/java/net/openhft/chronicle/network/WanSimulator.java
@@ -2,6 +2,8 @@ package net.openhft.chronicle.network;
import net.openhft.chronicle.core.Jvm;
+import java.util.Random;
+
/**
* Created by peter.lawrey on 16/07/2015.
*/
@@ -9,11 +11,12 @@ public enum WanSimulator {
;
private static final int NET_BANDWIDTH = Integer.getInteger("wanMB", 0);
private static final int BYTES_PER_MS = NET_BANDWIDTH * 1000;
+ private static final Random RANDOM = new Random();
private static long totalRead = 0;
public static void dataRead(int bytes) {
if (NET_BANDWIDTH <= 0) return;
- totalRead += bytes + 128;
+ totalRead += bytes + RANDOM.nextInt(BYTES_PER_MS);
int delay = (int) (totalRead / BYTES_PER_MS);
if (delay > 0) {
Jvm.pause(delay); | Add a wan simulator to reproduce timing sensitive issues with a random <I> ms delay. | OpenHFT_Chronicle-Network | train | java |
e1b969c3623533dfaab12c48f22e6057315e0949 | diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index <HASH>..<HASH> 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -66,8 +66,11 @@ class Manager extends Singleton
'AnonymizeIP',
'DBStats',
'DevicesDetection',
-// 'Events',
- 'TreemapVisualization', // should be moved to marketplace
+ 'ExampleCommand',
+ 'ExampleSettingsPlugin',
+ 'ExampleUI',
+ 'ExampleVisualization',
+ 'ExamplePluginTemplate'
);
public function getCorePluginsDisabledByDefault() | refs #<I> mark does plugins as core plugins | matomo-org_matomo | train | php |
c9b3eb13effbfe6d36448d691923e79598f42dea | diff --git a/molmod/molecular_graphs.py b/molmod/molecular_graphs.py
index <HASH>..<HASH> 100644
--- a/molmod/molecular_graphs.py
+++ b/molmod/molecular_graphs.py
@@ -165,7 +165,7 @@ class MolecularGraph(Graph):
# actual removal
edges = [edges[i] for i in range(len(edges)) if mask[i]]
if do_orders:
- bond_order = [bond_order[i] for i in range(len(bond_order)) if mask[i]]
+ orders = [orders[i] for i in range(len(orders)) if mask[i]]
result = cls(edges, molecule.numbers, orders)
else:
result = cls(edges, molecule.numbers) | Fixed small bug in (bond) orders attribute assignation | molmod_molmod | train | py |
4625881c54d256e6fae17c906fae3a076ca1c527 | diff --git a/src/structures/MessageEmbed.js b/src/structures/MessageEmbed.js
index <HASH>..<HASH> 100644
--- a/src/structures/MessageEmbed.js
+++ b/src/structures/MessageEmbed.js
@@ -7,6 +7,13 @@ const Util = require('../util/Util');
* Represents an embed in a message (image/video preview, rich embed, etc.)
*/
class MessageEmbed {
+ /**
+ * @name MessageEmbed
+ * @kind constructor
+ * @memberof MessageEmbed
+ * @param {MessageEmbed|Object} [data={}] MessageEmbed to clone or raw embed data
+ */
+
constructor(data = {}, skipValidation = false) {
this.setup(data, skipValidation);
} | docs(MessageEmbed): document the constructor (#<I>) | discordjs_discord.js | train | js |
edd14db9644929ea904b20350f13fb064e1a4c22 | diff --git a/addon/components/ember-remodal.js b/addon/components/ember-remodal.js
index <HASH>..<HASH> 100644
--- a/addon/components/ember-remodal.js
+++ b/addon/components/ember-remodal.js
@@ -53,6 +53,7 @@ export default Component.extend({
},
willDestroy() {
+ scheduleOnce('destroy', this, '_destroyDomElements');
scheduleOnce('afterRender', this, '_deregisterObservers');
},
@@ -127,6 +128,14 @@ export default Component.extend({
Ember.$(document).off('closed', modal);
},
+ _destroyDomElements() {
+ const modal = this.get('modal');
+
+ if (modal) {
+ modal.destroy();
+ }
+ },
+
_createInstanceAndOpen() {
let modal = Ember.$(this.get('modalId')).remodal({
hashTracking: this.get('hashTracking'), | call remodal's native destroy on willDestroyElement
without calling remodal’s native `destroy()`, the dom elements that it
creates are left around after the `ember-remodal` component instance
has been destroyed, resulting in a resource leak. Closes #<I> | sethbrasile_ember-remodal | train | js |
e8dc4628ae09382288d60a0de922cf82dfc0080b | diff --git a/lib/6to5/generation/generators/statements.js b/lib/6to5/generation/generators/statements.js
index <HASH>..<HASH> 100644
--- a/lib/6to5/generation/generators/statements.js
+++ b/lib/6to5/generation/generators/statements.js
@@ -23,7 +23,11 @@ exports.IfStatement = function (node, print) {
if (node.alternate) {
if (this.isLast("}")) this.push(" ");
this.keyword("else");
- this.push(" ");
+
+ if (this.format.format && !t.isBlockStatement(node.alternate)) {
+ this.push(" ");
+ }
+
print.indentOnComments(node.alternate);
}
}; | better handle spaces in IfStatement generator | babel_babel | train | js |
60995e57bc9e1b417693231f1818faf80feff641 | diff --git a/src/es5.js b/src/es5.js
index <HASH>..<HASH> 100644
--- a/src/es5.js
+++ b/src/es5.js
@@ -19,7 +19,7 @@ else {
var str = {}.toString;
var proto = {}.constructor.prototype;
- function ObjectKeys(o) {
+ var ObjectKeys = function ObjectKeys(o) {
var ret = [];
for (var key in o) {
if (has.call(o, key)) {
@@ -29,16 +29,16 @@ else {
return ret;
}
- function ObjectDefineProperty(o, key, desc) {
+ var ObjectDefineProperty = function ObjectDefineProperty(o, key, desc) {
o[key] = desc.value;
return o;
}
- function ObjectFreeze(obj) {
+ var ObjectFreeze = function ObjectFreeze(obj) {
return obj;
}
- function ObjectGetPrototypeOf(obj) {
+ var ObjectGetPrototypeOf = function ObjectGetPrototypeOf(obj) {
try {
return Object(obj).constructor.prototype;
}
@@ -47,7 +47,7 @@ else {
}
}
- function ArrayIsArray(obj) {
+ var ArrayIsArray = function ArrayIsArray(obj) {
try {
return str.call(obj) === "[object Array]";
} | Change function defs to variable defs in block scope.
Function definitions in blocks cause chrome to throw syntax error in
strict mode. | petkaantonov_bluebird | train | js |
737afbd9e7ea548d478cf4eacc76c11224030b5b | diff --git a/Kwc/User/Login/Form/Success/Component.js b/Kwc/User/Login/Form/Success/Component.js
index <HASH>..<HASH> 100644
--- a/Kwc/User/Login/Form/Success/Component.js
+++ b/Kwc/User/Login/Form/Success/Component.js
@@ -1,6 +1,6 @@
var onReady = require('kwf/on-ready');
-onReady.onShow('.kwcUserLoginFormSuccess', function(el) {
+onReady.onShow('.kwcClass', function(el) {
var url = el.find('input.redirectTo').val();
if (!url) url = location.href;
location.href = url; | fixed redirect after login, onReady has to use kwcClass to find correct element | koala-framework_koala-framework | train | js |
b465ccc9b26bdf6f06cfc3f72df2cbdb01c597e4 | diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py
index <HASH>..<HASH> 100644
--- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py
+++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/taskapp/celery.py
@@ -4,6 +4,10 @@ import os
from celery import Celery
from django.apps import AppConfig
from django.conf import settings
+{% if cookiecutter.use_sentry == "y" -%}
+from raven import Client
+from raven.contrib.celery import register_signal
+{%- endif %}
if not settings.configured:
# set the default Django settings module for the 'celery' program.
@@ -23,6 +27,13 @@ class CeleryConfig(AppConfig):
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS, force=True)
+ {% if cookiecutter.use_sentry == "y" -%}
+ if hasattr(settings, 'RAVEN_CONFIG'):
+ # Celery signal registration
+ client = Client(dsn=settings.RAVEN_CONFIG['dsn'])
+ register_signal(client)
+ {%- endif %}
+
@app.task(bind=True)
def debug_task(self): | fix sentry logging in conjunction with celery | pydanny_cookiecutter-django | train | py |
05a6f2d57fdd82748b595ce615ad69e9beddd144 | diff --git a/tests/test_chain.py b/tests/test_chain.py
index <HASH>..<HASH> 100644
--- a/tests/test_chain.py
+++ b/tests/test_chain.py
@@ -403,8 +403,7 @@ def test_invalid_transaction():
blk = mine_next_block(blk, transactions=[tx])
assert blk.get_balance(v) == 0
assert blk.get_balance(v2) == utils.denoms.ether * 1
- # should invalid transaction be included in blocks?
- assert tx in blk.get_transactions()
+ assert tx not in blk.get_transactions()
def test_add_side_chain(): | invalid tx must not be included in block | ethereum_pyethereum | train | py |
73615e57787a98ccb39d2781348b991ce8d4443d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,8 @@ rules_lib = ('rules_py',
rules = Extension('rules',
sources = ['src/rulespy/rules.c'],
- include_dirs=['src/rules'])
+ include_dirs=['src/rules'],
+ extra_compile_args = ['-std=c99'])
here = path.abspath(path.dirname(__file__)) + '/docs/py'
with open(path.join(here, 'README.txt'), encoding='utf-8') as f:
@@ -36,7 +37,7 @@ with open(path.join(here, 'README.txt'), encoding='utf-8') as f:
setup (
name = 'durable_rules',
- version = '0.33.04',
+ version = '0.33.05',
description = 'for real time analytics',
long_description=long_description,
url='https://github.com/jruizgit/rules', | python build for POSIX | jruizgit_rules | train | py |
18033addc2515dc9f87ea069a69c6a6f5de8d4ea | diff --git a/mongo_import.py b/mongo_import.py
index <HASH>..<HASH> 100755
--- a/mongo_import.py
+++ b/mongo_import.py
@@ -571,7 +571,7 @@ def insert_infocontent_data(germanet_db):
# Although Resnik (1995) suggests dividing count by the number
# of synsets, Patwardhan et al (2003) argue against doing
# this.
- #count /= len(synsets)
+ count = float(count) / len(synsets)
for synset in synsets:
total_count += count
paths = synset.hypernym_paths | mongo_import: revert to resnik's method for information content | wroberts_pygermanet | train | py |
56a721f05941d65c20a3f1768f28aebad7e098a0 | diff --git a/umbra/controller.py b/umbra/controller.py
index <HASH>..<HASH> 100644
--- a/umbra/controller.py
+++ b/umbra/controller.py
@@ -138,8 +138,9 @@ class AmqpBrowserController:
self.logger.info('browser={} client_id={} url={}'.format(browser, client_id, url))
try:
browser.browse_page(url, on_request=on_request)
- finally:
self._browser_pool.release(browser)
+ except:
+ self.logger.critical("problem browsing page, may have lost browser process", exc_info=True)
import random
threadName = "BrowsingThread{}-{}".format(browser.chrome_port, | dump stack trace and don't return browser to pool on critical error where chrome process might still be running | internetarchive_brozzler | train | 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.