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
|
---|---|---|---|---|---|
884ddfb5160c5f9e94af229b5e85533dc6868105 | diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/readinput.py
+++ b/openquake/commonlib/readinput.py
@@ -1061,12 +1061,7 @@ def get_pmap_from_csv(oqparam, fnames):
:returns:
the site mesh and the hazard curves read by the .csv files
"""
- if not oqparam.imtls:
- oqparam.set_risk_imtls(get_risk_models(oqparam))
- if not oqparam.imtls:
- raise ValueError('Missing intensity_measure_types_and_levels in %s'
- % oqparam.inputs['job_ini'])
-
+ oqparam.set_risk_imtls(get_risk_models(oqparam))
read = functools.partial(hdf5.read_csv, dtypedict={None: float})
dic = {wrapper.imt: wrapper.array for wrapper in map(read, fnames)}
array = dic[next(iter(dic))] | Changed get_pmap_from_csv to extract the hazard levels from the risk levels always [skip hazardlib] | gem_oq-engine | train | py |
c1f37073b3a0dfe1f11c4bed6f4cbb57500a0561 | diff --git a/styles/colors.js b/styles/colors.js
index <HASH>..<HASH> 100644
--- a/styles/colors.js
+++ b/styles/colors.js
@@ -2,6 +2,12 @@ import { themeConfig } from '@shopgate/pwa-common/helpers/config';
const colors = (process.env.NODE_ENV !== 'test' && themeConfig && themeConfig.colors) ? themeConfig.colors : {};
+if (!(colors.ctaPrimary && colors.ctaPrimaryContrast)
+ && (colors.primary && colors.primaryContrast)) {
+ colors.ctaPrimary = colors.primary;
+ colors.ctaPrimaryContrast = colors.primaryContrast;
+}
+
export default {
accent: '#5ccee3',
accentContrast: '#fff',
@@ -26,5 +32,7 @@ export default {
shade12: '#939393',
success: '#35cc29',
warning: '#ff9300',
+ ctaPrimary: '#fa5400',
+ ctaPrimaryContrast: '#fff',
...colors,
}; | CCP-<I>: added support for ctaPrimary and ctaPrimaryContrast colors configurations | shopgate_pwa | train | js |
a689155612ef24eabc86361280c7cb54fb301765 | diff --git a/commons/all/src/main/java/org/infinispan/commons/marshall/WrappedByteArray.java b/commons/all/src/main/java/org/infinispan/commons/marshall/WrappedByteArray.java
index <HASH>..<HASH> 100644
--- a/commons/all/src/main/java/org/infinispan/commons/marshall/WrappedByteArray.java
+++ b/commons/all/src/main/java/org/infinispan/commons/marshall/WrappedByteArray.java
@@ -94,7 +94,7 @@ public class WrappedByteArray implements WrappedBytes {
public String toString() {
return "WrappedByteArray{" +
"bytes=" + Util.hexDump(bytes) +
- ", hashCode=" + hashCode +
+ ", hashCode=" + hashCode() +
'}';
} | ISPN-<I> WrappedByteArray compute the hash code during toString | infinispan_infinispan | train | java |
7be0b7e59cacbb6927477c77bb1420a2ff7dd90d | diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -1104,7 +1104,10 @@ class BasicsTest < ActiveRecord::TestCase
# TODO: extend defaults tests to other databases!
if current_adapter?(:PostgreSQLAdapter)
def test_default
+ tz = Default.default_timezone
+ Default.default_timezone = :local
default = Default.new
+ Default.default_timezone = tz
# fixed dates / times
assert_equal Date.new(2004, 1, 1), default.fixed_date | Set default_timezone explicitly for a test in activerecord/../base_test.rb | rails_rails | train | rb |
0b57ecf17f6672b1ccaca5626ca68586703dcdee | diff --git a/src/Extension/FluentExtension.php b/src/Extension/FluentExtension.php
index <HASH>..<HASH> 100644
--- a/src/Extension/FluentExtension.php
+++ b/src/Extension/FluentExtension.php
@@ -1016,6 +1016,12 @@ class FluentExtension extends DataExtension
return $this->owner->config()->get('frontend_publish_required');
}
+ if ($this->owner->config()->get('cms_publish_required') !== null) {
+ Deprecation::notice('5.0', 'Use cms_localisation_required instead');
+
+ return $this->owner->config()->get('cms_publish_required');
+ }
+
return $this->owner->config()->get('cms_localisation_required');
} | Add BC for old config with deprecation notice | tractorcow-farm_silverstripe-fluent | train | php |
cea0784510b8f297789df1dba34148dfeaf3863f | diff --git a/models.py b/models.py
index <HASH>..<HASH> 100644
--- a/models.py
+++ b/models.py
@@ -27,6 +27,19 @@ class AuthorizationCode(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
expires_at = models.DateTimeField(blank=True)
is_active = models.BooleanField(default=True)
+
+ def generate_token(self):
+ from django.utils.crypto import get_random_string
+
+ return get_random_string(100)
+
+ def save(self, *args, **kwargs):
+ import datetime
+
+ self.token = self.generate_token()
+ self.expires_at = datetime.datetime.now()
+
+ super(AuthorizationCode, self).save(*args, **kwargs)
class AuthorizationToken(models.Model): | Automatically generate the token when the authorization code is created | Rediker-Software_doac | train | py |
c7e7c5f27ab19b7cd8aef90cd114668f5ea8b16f | diff --git a/quilt/cli/top.py b/quilt/cli/top.py
index <HASH>..<HASH> 100644
--- a/quilt/cli/top.py
+++ b/quilt/cli/top.py
@@ -19,13 +19,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
-from optparse import OptionParser
+from quilt.cli.meta import Command
+from quilt.db import Db
-from quilt.top import Top
+class TopCommand(Command):
-def parse(args):
usage = "%prog top"
- parser = OptionParser(usage=usage)
- top = Top(".pc")
- print top.top_patch()
+ name = "top"
+
+ def run(self, options, args):
+ db = Db(self.get_pc_dir())
+ top = db.top_patch()
+ if not top:
+ self.exit_error("No patches applied.")
+
+ print top | Convert quilt.cli.top into Command class | bjoernricks_python-quilt | train | py |
e36694c05f7732d103ccad14c3aa8f74815e9ac8 | diff --git a/tests/inter-language-test/src/main/js/provider.js b/tests/inter-language-test/src/main/js/provider.js
index <HASH>..<HASH> 100644
--- a/tests/inter-language-test/src/main/js/provider.js
+++ b/tests/inter-language-test/src/main/js/provider.js
@@ -25,6 +25,28 @@ var testbase = require("test-base");
var log = testbase.logging.log;
var provisioning = testbase.provisioning_common;
+provisioning.logging.configuration = {
+ appenders : {
+ appender : [
+ {
+ type : "Console",
+ name : "STDOUT",
+ PatternLayout : {
+ pattern : "[%d{HH:mm:ss,SSS}][%c][%p] %m{2}"
+ }
+ }
+ ]
+ },
+ loggers : {
+ root : {
+ level : "debug",
+ AppenderRef : [{
+ ref : "STDOUT"
+ }]
+ }
+ }
+};
+
if (process.argv.length !== 3) {
log("please pass a domain as argument");
process.exit(0); | [JS, ILT] Extend log level of ILT provider
* Log with level debug to console in order to be able
to analyze problems more easily
Change-Id: I6b<I>ba<I>eb<I>daf2e<I>a9d<I>da<I>e<I> | bmwcarit_joynr | train | js |
c74370bf8246cefd22f87ee78c813409c796175c | diff --git a/lib/compel/validators/hash_validator.rb b/lib/compel/validators/hash_validator.rb
index <HASH>..<HASH> 100644
--- a/lib/compel/validators/hash_validator.rb
+++ b/lib/compel/validators/hash_validator.rb
@@ -91,7 +91,10 @@ module Compel
next
end
- if input[key].is_a?(Hash)
+ if schemas[key].type == Coercion::Hash &&
+ (schemas[key].required? ||
+ !input[key].nil?)
+
hash_validator = HashValidator.validate(input[key], schemas[key])
errors.add(key, hash_validator.errors) | fix bug when key value is an hash
- If a value were an Hash, I was always excepting a Builder::Hash
schema | joaquimadraz_compel | train | rb |
4bba570fd968552b9e9a85edbc4de7f3db3fe907 | diff --git a/resources/assets/js/files.app.js b/resources/assets/js/files.app.js
index <HASH>..<HASH> 100644
--- a/resources/assets/js/files.app.js
+++ b/resources/assets/js/files.app.js
@@ -155,6 +155,8 @@ Files.App = new Class({
this.setOptions(options);
+ this.fireEvent('onInitialize', this);
+
if (this.options.persistent && this.options.container) {
var container = typeof this.options.container === 'string' ? this.options.container : this.options.container.slug;
this.cookie = 'com.files.container.'+container; | Added onInitialize event. | joomlatools_joomlatools-framework | train | js |
8ab40b82ddf8e2f7f60b51a8cb72f641b427d857 | diff --git a/app/view/Gruntfile.js b/app/view/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/app/view/Gruntfile.js
+++ b/app/view/Gruntfile.js
@@ -73,7 +73,12 @@ module.exports = function(grunt) {
concat: {
js: {
options: {
- separator: '\n/**********************************************************************************************************************/\n\n'
+ separator: '\n/**********************************************************************************************************************/\n\n',
+ banner: "/**\n" +
+ " * These are Bolt's COMPILED JS files!\n" +
+ " * Do not edit these files, because all changes will be lost.\n" +
+ " * You can edit files in <js/src/*.js> and run 'grunt' to generate this file.\n" +
+ " */\n\n"
},
src: [
'js/src/jslint-conf.js', | Added a banner to concatenated bolt.js | bolt_bolt | train | js |
b71c7c6fcae6f161b8657f1413bfe86ace5e189f | diff --git a/authomatic/providers/oauth1.py b/authomatic/providers/oauth1.py
index <HASH>..<HASH> 100644
--- a/authomatic/providers/oauth1.py
+++ b/authomatic/providers/oauth1.py
@@ -865,10 +865,17 @@ class Tumblr(OAuth1):
class UbuntuOne(OAuth1):
"""
Ubuntu One |oauth1| provider.
+
+ .. note::
+
+ The UbuntuOne service
+ `has been shut down <http://blog.canonical.com/2014/04/02/
+ shutting-down-ubuntu-one-file-services/>`__.
.. warning::
- Uses the `PLAINTEXT <http://oauth.net/core/1.0a/#anchor21>`_ Signature method!
+ Uses the `PLAINTEXT <http://oauth.net/core/1.0a/#anchor21>`_
+ Signature method!
* Dashboard: https://one.ubuntu.com/developer/account_admin/auth/web
* Docs: https://one.ubuntu.com/developer/account_admin/auth/web | Added a note that UbuntuOne service was shut down. | authomatic_authomatic | train | py |
1211d3b137960fc7adceb50f25eef80f32561364 | diff --git a/packages/sample-client-react/webpack.config.js b/packages/sample-client-react/webpack.config.js
index <HASH>..<HASH> 100644
--- a/packages/sample-client-react/webpack.config.js
+++ b/packages/sample-client-react/webpack.config.js
@@ -50,6 +50,9 @@ var webpack_opts = {
}, {
test: /\.json?$/,
loaders: 'json-loader'
+ },{
+ test: /\.css$/,
+ loaders: 'css-loader'
},]
},
externals: [nodeExternals()] | Update webpack.config.js | cdmbase_fullstack-pro | train | js |
2c2588badf0910824058cbc1bb54889251836251 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -280,7 +280,29 @@
var args = arguments;
var returnValue;
this.each(function () {
- var value = $(this).data(DATA_ID)[optionOverrides].apply(null, [].slice.call(args, 1));
+ var obj = $.data(this, DATA_ID);
+ var value;
+ if (!obj) {
+ console.warn('Scrollable ' + optionOverrides + ' should not be called before initialization');
+ switch (optionOverrides) {
+ case 'scrollLeft':
+ case 'scrollTop':
+ value = 0;
+ break;
+ case 'scrollPadding':
+ value = { top: 0, left: 0, right: 0, bottom: 0 };
+ break;
+ case 'scrollBy':
+ case 'scrollTo':
+ case 'scrollByPage':
+ case 'scrollToPage':
+ case 'scrollToElement':
+ value = Promise.resolve();
+ break;
+ }
+ } else {
+ value = obj[optionOverrides].apply(null, [].slice.call(args, 1));
+ }
if (value !== undefined) {
returnValue = value;
return false; | fix: prevent exception when calling method on uninitialized element | misonou_jquery-scrollable | train | js |
dfde2fa4c001cf79ee958716b6f35c314bd236e3 | diff --git a/devices/rtx.js b/devices/rtx.js
index <HASH>..<HASH> 100644
--- a/devices/rtx.js
+++ b/devices/rtx.js
@@ -6,7 +6,7 @@ const ea = exposes.access;
module.exports = [
{
- fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_akjefhj5'}],
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_akjefhj5'}, {modelID: 'TS0601', manufacturerName: '_TZE200_2wg5qrjy'}],
model: 'ZVG1',
vendor: 'RTX',
description: 'Zigbee smart water valve', | Add _TZE<I>_2wg5qrjy to ZVG1 (#<I>)
* Update rtx.js
Add new fingerprint for Royal Gardineer BWV-<I>.zigbee (Pearl ZX-<I>-<I>)
* Update rtx.js
* Update rtx.js
* Update rtx.js
* Update rtx.js | Koenkk_zigbee-shepherd-converters | train | js |
8d43f11f91023a39204a6edd56eecba7e46fe887 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ setup(
install_requires=["pluginbase",
"future",
# "oic",
- # "pyjwkest",
+ "pyjwkest",
# "pysaml2 >= 3.0.2",
"requests",
"PyYAML", | Add pyjwkest as a dependency in setup.py. | IdentityPython_SATOSA | train | py |
c761dc7e8b2b367e6f3fbf95bd1639116fcb93d3 | diff --git a/examples/platformer/main.go b/examples/platformer/main.go
index <HASH>..<HASH> 100644
--- a/examples/platformer/main.go
+++ b/examples/platformer/main.go
@@ -25,10 +25,8 @@ import (
const (
// Settings
- width = 1024
- height = 512
- fullscreen = false
- runinbackground = true
+ width = 1024
+ height = 512
)
var (
@@ -100,9 +98,6 @@ func main() {
panic(err)
}
- ebiten.SetRunnableInBackground(runinbackground)
- ebiten.SetFullscreen(fullscreen)
-
// Starts the program
if err := ebiten.Run(update, width, height, 1, "Platformer (Ebiten Demo)"); err != nil {
panic(err) | examples/platform: Remove settings
Add them again when necessary. | hajimehoshi_ebiten | train | go |
a714664692f1ef9be59c12bcd04514bc2dbd29d2 | diff --git a/src/Tasks/Monitor/BackupDestinationStatusFactory.php b/src/Tasks/Monitor/BackupDestinationStatusFactory.php
index <HASH>..<HASH> 100644
--- a/src/Tasks/Monitor/BackupDestinationStatusFactory.php
+++ b/src/Tasks/Monitor/BackupDestinationStatusFactory.php
@@ -17,7 +17,7 @@ class BackupDestinationStatusFactory
->map(function (array $monitorProperties) {
return BackupDestinationStatusFactory::createForSingleMonitor($monitorProperties);
})
- ->flatten()
+ ->collapse()
->sortBy(function (BackupDestinationStatus $backupDestinationStatus) {
return "{$backupDestinationStatus->getBackupName()}-{$backupDestinationStatus->getFilesystemName()}";
}); | fix monitor in Laravel <I> | spatie_laravel-backup | train | php |
5a752fc17161413154b82b189e40d6f59b9020e4 | diff --git a/HARK/dcegm.py b/HARK/dcegm.py
index <HASH>..<HASH> 100644
--- a/HARK/dcegm.py
+++ b/HARK/dcegm.py
@@ -43,7 +43,7 @@ def calcCrossPoints(mGrid, condVs, optIdx):
# If no crossings, return an empty list
if len(idx_change) == 0:
- return []
+ return [], []
else:
# To find the crossing points we need the extremes of the intervals in | Return two empty lists when there are no xings | econ-ark_HARK | train | py |
3187a81365011adeb7b97e9e9a632d206d73506b | diff --git a/web/concrete/core/models/block.php b/web/concrete/core/models/block.php
index <HASH>..<HASH> 100644
--- a/web/concrete/core/models/block.php
+++ b/web/concrete/core/models/block.php
@@ -984,8 +984,8 @@ class Concrete5_Model_Block extends Object {
}
//then, we see whether or not this block is aliased to anything else
- $q = "select count(*) as total from CollectionVersionBlocks where bID = '$bID'";
- $totalBlocks = $db->getOne($q);
+ $totalBlocks = $db->GetOne('select count(*) from CollectionVersionBlocks where bID = ?', array($bID));
+ $totalBlocks += $db->GetOne('select count(*) from btCoreScrapbookDisplay where bOriginalID = ?', array($bID));
if ($totalBlocks < 1) {
$q = "delete from BlockRelations where originalBID = ? or bID = ?";
$r = $db->query($q, array($this->bID, $this->bID)); | Fix Clipboard Block On Collection Version Delete
Fix Clipboard Block On Collection Version Delete
- Check `btCoreScrapbookDisplay` to make sure block is not pasted from
clipboad elsewhere on site
Former-commit-id: 3ef<I>c8e6e<I>b<I>a<I>eb<I>ca1aa1e0cf5c<I>dd | concrete5_concrete5 | train | php |
50bc110a684dceb048cb5f95ca1bcdb514574923 | diff --git a/src/angular-leaflet-directive.js b/src/angular-leaflet-directive.js
index <HASH>..<HASH> 100644
--- a/src/angular-leaflet-directive.js
+++ b/src/angular-leaflet-directive.js
@@ -10,8 +10,7 @@ leafletDirective.directive("leaflet", ["$http", "$log", function ($http, $log) {
tilelayer: "=tilelayer",
markers: "=markers",
path: "=path",
- maxZoom: "@maxzoom",
- bounds: "=bounds"
+ maxZoom: "@maxzoom"
},
template: '<div class="angular-leaflet-map"></div>',
link: function (scope, element, attrs, ctrl) {
@@ -44,6 +43,11 @@ leafletDirective.directive("leaflet", ["$http", "$log", function ($http, $log) {
scope.$apply(function (s) {
s.center.lat = map.getCenter().lat;
s.center.lng = map.getCenter().lng;
+ });
+ });
+
+ map.on("zoomend", function(e) {
+ scope.$apply(function (s) {
s.center.zoom = map.getZoom();
});
}); | Capture and pass to the scope the ZOOM event | tombatossals_angular-leaflet-directive | train | js |
796d2780a31b83accae7b05bd539d480eb7d9787 | diff --git a/src/test/java/org/imgscalr/AsyncScalrMultiThreadTest.java b/src/test/java/org/imgscalr/AsyncScalrMultiThreadTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/imgscalr/AsyncScalrMultiThreadTest.java
+++ b/src/test/java/org/imgscalr/AsyncScalrMultiThreadTest.java
@@ -45,9 +45,15 @@ public class AsyncScalrMultiThreadTest extends AbstractScalrTest {
if (i % 100 == 0)
System.out.println("Scale Iteration " + i);
- Thread t = new ScaleThread();
- t.start();
- threadList.add(t);
+ try {
+ Thread t = new ScaleThread();
+ t.start();
+ threadList.add(t);
+ } catch (OutOfMemoryError error) {
+ System.out.println("Cannot create any more threads, last created was " + i);
+ ITERS = i;
+ break;
+ }
}
// Now wait for all the threads to finish | Fix AsyncScalrMultiThreadTest OOM on Mac OSX due to thread limit being hit | rkalla_imgscalr | train | java |
6d970d16155fd4ecc65693c6f2381235d2ca9120 | diff --git a/smite/servant.py b/smite/servant.py
index <HASH>..<HASH> 100644
--- a/smite/servant.py
+++ b/smite/servant.py
@@ -266,11 +266,15 @@ class SecureServantIdent(Servant):
self._lock = Lock()
def _recv(self, socket):
- msg_id, msg = super(SecureServantIdent, self)._recv(socket)
- ident = msg[:32]
- msg = msg[32:]
+ msg_id, orig_msg = super(SecureServantIdent, self)._recv(socket)
+ ident = orig_msg[:32]
+ msg = orig_msg[32:]
if ident not in self._ciphers:
- self._ciphers[ident] = AESCipher(self._get_key_fn(ident))
+ key = self._get_key_fn(ident)
+ if key is None:
+ return msg_id, orig_msg
+ else:
+ self._ciphers[ident] = AESCipher(self._get_key_fn(ident))
self._lock.acquire()
self._msg_id_to_ident[self._msg_id_hash(msg_id)] = ident | handle not found key in SecureServantIdent | pmdz_smite | train | py |
f5bc155e0aecb9a31a17563a778b77fbcbf6ad46 | diff --git a/influxdb/line_protocol.py b/influxdb/line_protocol.py
index <HASH>..<HASH> 100644
--- a/influxdb/line_protocol.py
+++ b/influxdb/line_protocol.py
@@ -116,6 +116,8 @@ def make_lines(data, precision=None):
key = _escape_tag(field_key)
value = _escape_value(point['fields'][field_key])
if key != '' and value != '':
+ if isinstance(value, int):
+ value = str(value) + 'i'
field_values.append("{key}={value}".format(
key=key,
value=value | if value is int, type cast and add 'i' per changes in new influx | influxdata_influxdb-python | train | py |
d66e8c9fab07f4dbcaabff97b7e08c7e9ebec4f7 | diff --git a/src/domain/rest/SearchAction.php b/src/domain/rest/SearchAction.php
index <HASH>..<HASH> 100644
--- a/src/domain/rest/SearchAction.php
+++ b/src/domain/rest/SearchAction.php
@@ -2,6 +2,7 @@
namespace yii2lab\rest\domain\rest;
+
use Yii;
use yii\web\BadRequestHttpException;
use yii2lab\domain\exceptions\UnprocessableEntityHttpException;
@@ -10,6 +11,7 @@ use yii2lab\domain\services\base\BaseActiveService;
use yii2lab\extension\activeRecord\helpers\SearchHelper;
use yii2lab\extension\web\helpers\ClientHelper;
+
/**
* @property BaseActiveService $service
*
@@ -25,6 +27,9 @@ class SearchAction extends IndexAction {
$text = Yii::$app->request->post('title');
$query->where(SearchHelper::SEARCH_PARAM_NAME, $text);
try {
+ if ( Yii::$app->request->headers->get('partner-name') ){
+ return \App::$domain->service->service->getSearchByPartnerName($query);
+ }
return $this->service->getDataProvider($query);
} catch(BadRequestHttpException $e) {
$error = new ErrorCollection; | Added search with partner-name in service/search | yii2lab_yii2-rest | train | php |
988d1202e31c7e75ca5e74500a8d28055d7e2e92 | diff --git a/lib/formslib.php b/lib/formslib.php
index <HASH>..<HASH> 100644
--- a/lib/formslib.php
+++ b/lib/formslib.php
@@ -146,7 +146,7 @@ class moodleform {
$names=null;
while (!$names){
$el = array_shift($elkeys);
- $names=$form->_getElNamesRecursive($el);
+ $names = $form->_getElNamesRecursive($el);
}
$name=array_shift($names);
$focus='forms[\''.$this->_form->getAttribute('id').'\'].elements[\''.$name.'\']';
@@ -1219,6 +1219,8 @@ function validate_' . $this->_formName . '(frm) {
$elNames = array($group->getElementName($el->getName()));
} elseif (is_a($el, 'HTML_QuickForm_header')) {
return null;
+ } elseif (is_a($el, 'HTML_QuickForm_hidden')) {
+ return null;
} elseif (method_exists($el, 'getPrivateName')) {
return array($el->getPrivateName());
} else { | fixed focus method which was tring to focus on hidden fields. | moodle_moodle | train | php |
7b9ad81cb77590744e74de42a117ae0e287eaeda | diff --git a/src/ossos-pipeline/validate.py b/src/ossos-pipeline/validate.py
index <HASH>..<HASH> 100755
--- a/src/ossos-pipeline/validate.py
+++ b/src/ossos-pipeline/validate.py
@@ -17,7 +17,7 @@ def launch_app(task, working_directory, output_directory, dry_run, debug, name_f
create_application(task, working_directory, output_directory,
dry_run=dry_run, debug=debug, name_filter=name_filter,
- user_id=None, skip_previous=None)
+ user_id=user_name, skip_previous=skip_previous)
def main():
@@ -55,6 +55,7 @@ def main():
else:
output = args.output
+
launch_app(args.task, args.input, output, args.dry_run, args.debug, args.name_filter,
args.username, args.skip_previous) | ossos/ssos.py
corrected issue with skip_previous being ignored | OSSOS_MOP | train | py |
1a809784133289a7ec9a29ec84a7c6eac8fab738 | diff --git a/rollup.config.js b/rollup.config.js
index <HASH>..<HASH> 100755
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -11,6 +11,8 @@ const output = {
},
};
+const extensions = ['.ts', '.tsx', '.js', '.jsx', '.json'];
+
export default [
{
input: 'src/index.tsx',
@@ -35,9 +37,11 @@ export default [
jsnext: true,
main: true,
browser: true,
+ extensions,
}),
babel({
exclude: 'node_modules/**',
+ extensions,
}),
commonjs(),
], | Configure TS extensions with rollup config | springload_react-accessible-accordion | train | js |
58151386af5bc7954065f34ef3d46e0edd8ab868 | diff --git a/node.go b/node.go
index <HASH>..<HASH> 100644
--- a/node.go
+++ b/node.go
@@ -534,5 +534,8 @@ func castBytesToCid(x []byte) (cid.Cid, error) {
}
func castCidToBytes(link cid.Cid) ([]byte, error) {
+ if !link.Defined() {
+ return nil, ErrEmptyLink
+ }
return append([]byte{0}, link.Bytes()...), nil
} | error when trying to encode an empty link | ipfs_go-ipld-cbor | train | go |
124f6dc441e1431d3a13c62c457f094fe05e2bbf | diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js
index <HASH>..<HASH> 100644
--- a/plugins/SegmentEditor/javascripts/Segmentation.js
+++ b/plugins/SegmentEditor/javascripts/Segmentation.js
@@ -842,7 +842,13 @@ $(document).ready(function() {
this.forceSegmentReload = function (segmentDefinition) {
segmentDefinition = this.uriEncodeSegmentDefinition(segmentDefinition);
- return broadcast.propagateNewPage('', true, 'segment=' + segmentDefinition);
+
+ if (piwikHelper.isAngularRenderingThePage()) {
+ return broadcast.propagateNewPage('', true, 'segment=' + segmentDefinition);
+ } else {
+ // eg in case of exported dashboard
+ return broadcast.propagateNewPage('segment=' + segmentDefinition, true, 'segment=' + segmentDefinition);
+ }
};
this.changeSegmentList = function () {}; | Make sure segment is updated in exported widget (#<I>)
fixes #<I> | matomo-org_matomo | train | js |
c17b182bf54d33750c4598563e93289c5cde3cc0 | diff --git a/wos/utils.py b/wos/utils.py
index <HASH>..<HASH> 100644
--- a/wos/utils.py
+++ b/wos/utils.py
@@ -25,7 +25,7 @@ def query(wosclient, wos_query, xml_query=None, count=5, offset=1, limit=100):
if xml_query:
return [el for res in results for el in res]
else:
- pattern = _re.compile(r'.*?<records>|</records>.*', _re.DOTALL)
+ pattern = _re.compile(r'^<\?xml.*?\n<records>\n|\n</records>$.*')
return ('<?xml version="1.0" ?>\n<records>' +
'\n'.join(pattern.sub('', res) for res in results) +
'</records>') | Update utils.py (#<I>)
fix the slowness caused by re.sub with option "DOATALL" | enricobacis_wos | train | py |
393fcfb7edf432b615dd50de2036221849833a2e | diff --git a/preshed/about.py b/preshed/about.py
index <HASH>..<HASH> 100644
--- a/preshed/about.py
+++ b/preshed/about.py
@@ -1,5 +1,5 @@
__title__ = "preshed"
-__version__ = "3.0.0.dev1"
+__version__ = "3.0.0.dev2"
__summary__ = "Cython hash table that trusts the keys are pre-hashed"
__uri__ = "https://github.com/explosion/preshed"
__author__ = "Matthew Honnibal" | Set version to <I>.dev2 | explosion_preshed | train | py |
4c4a5dc5d5aa80a26de8ea589ac51014f7057480 | diff --git a/pkg/datapath/linux/node.go b/pkg/datapath/linux/node.go
index <HASH>..<HASH> 100644
--- a/pkg/datapath/linux/node.go
+++ b/pkg/datapath/linux/node.go
@@ -788,7 +788,7 @@ func (n *linuxNodeHandler) insertNeighbor(ctx context.Context, newNode *nodeType
// issued arping after us, as it might have a more recent hwAddr value.
return
}
- n.neighLastPingByNextHop[nextHopStr] = time.Now()
+ n.neighLastPingByNextHop[nextHopStr] = now
if prevHwAddr, found := n.neighByNextHop[nextHopStr]; found && prevHwAddr.String() == hwAddr.String() {
// Nothing to update, return early to avoid calling to netlink. This
// is based on the assumption that n.neighByNextHop gets populated | node-neigh: Use arping ts in last ping hashmap
The change is probably noop, but itshould improve the last ping
timestamp precision. | cilium_cilium | train | go |
de6f0e02a68f6ef6a4d6d7c7c6b30eb2bff4190b | diff --git a/lib/plugins/jingle.js b/lib/plugins/jingle.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/jingle.js
+++ b/lib/plugins/jingle.js
@@ -69,15 +69,15 @@ module.exports = function (client) {
for (var i = 0; i < services.length; i++) {
var service = services[i];
var ice = {};
- if (service.type === 'stun') {
- ice.url = 'stun:' + service.host;
+ if (service.type === 'stun' || service.type === 'stuns') {
+ ice.url = service.type + ':' + service.host;
if (service.port) {
ice.url += ':' + service.port;
}
discovered.push(ice);
client.jingle.addICEServer(ice);
- } else if (service.type === 'turn') {
- ice.url = 'turn:' + service.host;
+ } else if (service.type === 'turn' || service.type === 'turns') {
+ ice.url = service.type + ':' + service.host;
if (service.port) {
ice.url += ':' + service.port;
} | support stuns and turns as well | legastero_stanza.io | train | js |
b42dcf3ad2a027ade20c39f126929be3e0fd3c2f | diff --git a/src/Commands/MakeCommand.php b/src/Commands/MakeCommand.php
index <HASH>..<HASH> 100644
--- a/src/Commands/MakeCommand.php
+++ b/src/Commands/MakeCommand.php
@@ -29,6 +29,7 @@ class MakeCommand extends Command
'policy' => 'Policy',
'provider' => 'Provider',
'request' => 'Request',
+ 'rule' => 'Rule',
'seeder' => 'Seeder',
'test' => 'Test',
];
@@ -271,6 +272,14 @@ class MakeCommand extends Command
}
/**
+ * all options for make:rule
+ */
+ public function makeRule()
+ {
+ $this->options['name'] = $this->ask('Request Name (Example: NewRule)');
+ }
+
+ /**
* all options for make:seeder
*/
public function makeSeeder() | Added make:rule
references #<I> | laracademy_interactive-make | train | php |
de372bb6b006e5156144acd4c8d01b96abfe7ac9 | diff --git a/cli/index.js b/cli/index.js
index <HASH>..<HASH> 100755
--- a/cli/index.js
+++ b/cli/index.js
@@ -38,11 +38,11 @@ function main() {
var data = '';
- process.stdin.on('data', function(chunk) {
+ process.stdin.on('data', function (chunk) {
data += chunk;
});
- process.stdin.on('end', function() {
+ process.stdin.on('end', function () {
resolve(data);
});
}); | chore: fix linting issues | remy_inliner | train | js |
0e6723fcab5dc53ae7c12ebf37439cfb1d858b3e | diff --git a/lib/rescue_from_duplicate/active_record.rb b/lib/rescue_from_duplicate/active_record.rb
index <HASH>..<HASH> 100644
--- a/lib/rescue_from_duplicate/active_record.rb
+++ b/lib/rescue_from_duplicate/active_record.rb
@@ -7,8 +7,9 @@ module RescueFromDuplicate
end
def self.missing_unique_indexes
- klasses = ::ActiveRecord::Base.subclasses.select do |klass|
- klass.validators.any? {|v| v.is_a?(::ActiveRecord::Validations::UniquenessValidator) || klass._rescue_from_duplicates.any? }
+ ar_subclasses = ObjectSpace.each_object(Class).select{ |klass| klass < ::ActiveRecord::Base }
+ klasses = ar_subclasses.select do |klass|
+ klass.validators.any? { |v| v.is_a?(::ActiveRecord::Validations::UniquenessValidator) || klass._rescue_from_duplicates.any? }
end
missing_unique_indexes = [] | Use all subclasses of AR::Base, not just direct descendants | Shopify_activerecord-rescue_from_duplicate | train | rb |
164a470be79f6219c9ad9a29506fd304928c4b3c | diff --git a/daemon/daemon_main.go b/daemon/daemon_main.go
index <HASH>..<HASH> 100644
--- a/daemon/daemon_main.go
+++ b/daemon/daemon_main.go
@@ -1230,9 +1230,10 @@ func runDaemon() {
restoreComplete := d.initRestore(restoredEndpoints)
if option.Config.IsFlannelMasterDeviceSet() {
- // health checking is not supported by flannel
- log.Warnf("Running Cilium in flannel mode doesn't support health checking. Changing %s mode to %t", option.EnableHealthChecking, false)
- option.Config.EnableHealthChecking = false
+ if option.Config.EnableEndpointHealthChecking {
+ log.Warn("Running Cilium in flannel mode doesn't support endpoint connectivity health checking. Disabling endpoint connectivity health check.")
+ option.Config.EnableEndpointHealthChecking = false
+ }
err := node.SetInternalIPv4From(option.Config.FlannelMasterDevice)
if err != nil { | flannel: Disable endpoint connectivity health check
No reason to disable endpoint health checking overall. Disabling endpoint
connectivity health checking is sufficient. | cilium_cilium | train | go |
84656aaca97b4c65291a49acc2340aa1a86a9079 | diff --git a/simuvex/procedures/syscalls/__init__.py b/simuvex/procedures/syscalls/__init__.py
index <HASH>..<HASH> 100644
--- a/simuvex/procedures/syscalls/__init__.py
+++ b/simuvex/procedures/syscalls/__init__.py
@@ -12,11 +12,13 @@ syscall_table['AMD64'][6] = 'stat'
syscall_table['AMD64'][9] = 'mmap'
syscall_table['AMD64'][11] = 'munmap'
syscall_table['AMD64'][12] = 'brk'
+syscall_table['AMD64'][13] = 'sigaction'
syscall_table['AMD64'][14] = 'sigprocmask'
syscall_table['AMD64'][39] = 'getpid'
syscall_table['AMD64'][60] = 'exit'
syscall_table['AMD64'][186] = 'gettid'
syscall_table['AMD64'][231] = 'exit' # really exit_group, but close enough
+syscall_table['AMD64'][234] = 'tgkill'
syscall_table['X86'] = { }
syscall_table['X86'][1] = 'exit' | add sigaction and tgkill to syscall list | angr_angr | train | py |
b2424a45b6cf184b506f239d85ad965f916721b0 | diff --git a/protobuf3/compiler/__init__.py b/protobuf3/compiler/__init__.py
index <HASH>..<HASH> 100644
--- a/protobuf3/compiler/__init__.py
+++ b/protobuf3/compiler/__init__.py
@@ -55,7 +55,8 @@ class Compiler(object):
imports = []
for it in self.__imports:
- imports.append("from {} import {}".format(it, ', '.join(self.__imports[it])))
+ if self.__imports[it]:
+ imports.append("from {} import {}".format(it, ', '.join(self.__imports[it])))
self.__fields_code.append('')
diff --git a/tests/test_compiler.py b/tests/test_compiler.py
index <HASH>..<HASH> 100644
--- a/tests/test_compiler.py
+++ b/tests/test_compiler.py
@@ -153,3 +153,9 @@ class TestCompiler(TestCase):
self.assertEqual(msg_a.d, msgs.Foo.Opt2)
self.assertEqual(msg_a.e, 1)
+ def test_message_without_fields(self):
+ msg_code = '''
+ message Foo {
+ }'''
+
+ self.run_protoc_compiler(msg_code) | Fixed code-generation bug with files without any fields | Pr0Ger_protobuf3 | train | py,py |
b5f2be84354eed0e0e9c4f0ac5fde208a933db55 | diff --git a/sigh/lib/sigh/runner.rb b/sigh/lib/sigh/runner.rb
index <HASH>..<HASH> 100644
--- a/sigh/lib/sigh/runner.rb
+++ b/sigh/lib/sigh/runner.rb
@@ -139,7 +139,7 @@ module Sigh
# Skip certificates that failed to download
next unless current_cert[:downloaded]
file = Tempfile.new('cert')
- file.write(current_cert[:downloaded])
+ file.write(current_cert[:downloaded].force_encoding('UTF-8'))
file.close
if FastlaneCore::CertChecker.installed?(file.path)
installed = true
@@ -315,7 +315,7 @@ module Sigh
certificates = certificates.find_all do |c|
file = Tempfile.new('cert')
raw_data = Base64.decode64(c.certificate_content)
- file.write(raw_data)
+ file.write(raw_data.force_encoding("UTF-8"))
file.close
FastlaneCore::CertChecker.installed?(file.path) | fixed "\x<I>" from ASCII-8BIT to UTF-8 (#<I>)
No matter what the encoding of your operating environment is, I will convert the content to utf-8 encoding | fastlane_fastlane | train | rb |
af74dd400555e5f2cbedef0fe989211570ace1fa | diff --git a/lib/init/controller.js b/lib/init/controller.js
index <HASH>..<HASH> 100644
--- a/lib/init/controller.js
+++ b/lib/init/controller.js
@@ -1,8 +1,8 @@
var fs = require('fs')
, path = require('path')
, controller = require('../controller')
- , utils = require('utilities')
- , useCoffee = false;
+ , utils = require('../utils')
+ , usingCoffee = false;
module.exports = new (function () {
var JSPAT = /\.(js|coffee)$/; | Fix variable naming error for CS support. | mde_ejs | train | js |
c3b602493be1a9b910a8b79668657a78f20b46dc | diff --git a/tensor2tensor/layers/common_video.py b/tensor2tensor/layers/common_video.py
index <HASH>..<HASH> 100644
--- a/tensor2tensor/layers/common_video.py
+++ b/tensor2tensor/layers/common_video.py
@@ -24,7 +24,8 @@ import numpy as np
from tensor2tensor.layers import common_layers
import tensorflow as tf
-from tensorflow.python.ops import summary_op_util
+from tensorflow.python.distribute import summary_op_util as distribute_summary_op_util # pylint: disable=g-direct-tensorflow-import
+from tensorflow.python.ops import summary_op_util # pylint: disable=g-direct-tensorflow-import
tfl = tf.layers
tfcl = tf.contrib.layers
@@ -475,7 +476,7 @@ def gif_summary(name, tensor, max_outputs=3, fps=10, collections=None,
"[batch, time, height, width, channels] but got one "
"of shape: %s" % str(tensor.get_shape()))
tensor = tf.cast(tensor, tf.uint8)
- if summary_op_util.skip_summary():
+ if distribute_summary_op_util.skip_summary():
return tf.constant("")
with summary_op_util.summary_scope(
name, family, values=[tensor]) as (tag, scope): | Separated out skip_summary() method from summary_op_util, fixing accordingly.
PiperOrigin-RevId: <I> | tensorflow_tensor2tensor | train | py |
dd5ee0c53ba9c1bd3764a52b8b5c7072537d9d81 | diff --git a/src/frontend/org/voltdb/utils/SQLCommand.java b/src/frontend/org/voltdb/utils/SQLCommand.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/utils/SQLCommand.java
+++ b/src/frontend/org/voltdb/utils/SQLCommand.java
@@ -690,7 +690,7 @@ public class SQLCommand
// VoltDB connection support
private static Client VoltDB;
private static final List<String> Types = Arrays.asList("tinyint","smallint","integer","bigint","float","decimal","varchar","timestamp","varbinary");
- private static final List<String> StatisticsComponents = Arrays.asList("INDEX","INITIATOR","IOSTATS","MANAGEMENT","MEMORY","PROCEDURE","TABLE","PARTITIONCOUNT","STARVATION","LIVECLIENTS", "WAN");
+ private static final List<String> StatisticsComponents = Arrays.asList("INDEX","INITIATOR","IOSTATS","MANAGEMENT","MEMORY","PROCEDURE","TABLE","PARTITIONCOUNT","STARVATION","LIVECLIENTS", "WAN", "SNAPSHOTSTATUS");
private static final List<String> SysInfoSelectors = Arrays.asList("OVERVIEW","DEPLOYMENT");
private static final List<String> MetaDataSelectors =
Arrays.asList("TABLES", "COLUMNS", "INDEXINFO", "PRIMARYKEYS", | Add snapshot status to list of system procedures in SQLCommand | VoltDB_voltdb | train | java |
2d525548f4830e1b2f3b3e9d92de155249b47386 | diff --git a/go/kbnm/main.go b/go/kbnm/main.go
index <HASH>..<HASH> 100644
--- a/go/kbnm/main.go
+++ b/go/kbnm/main.go
@@ -72,6 +72,11 @@ func process(h *handler, in nativemessaging.JSONDecoder, out nativemessaging.JSO
func main() {
flag.Parse()
+ if *versionFlag {
+ fmt.Println(Version)
+ os.Exit(0)
+ }
+
// Native messages include a prefix which describes the length of each message.
var in nativemessaging.JSONDecoder
var out nativemessaging.JSONEncoder | kbnm: Add --version support back in (#<I>)
It got removed accidentally at some point | keybase_client | train | go |
1cf86553c9cf707722b8514d968345d927715e9b | diff --git a/src/Cartalyst/Sentry/Sentry.php b/src/Cartalyst/Sentry/Sentry.php
index <HASH>..<HASH> 100644
--- a/src/Cartalyst/Sentry/Sentry.php
+++ b/src/Cartalyst/Sentry/Sentry.php
@@ -117,7 +117,7 @@ class Sentry {
{
$this->userProvider = $userProvider ?: new UserProvider(new NativeHasher);
$this->groupProvider = $groupProvider ?: new GroupProvider;
- $this->throttleProvider = $throttleProvider ?: new ThrottleProvider($userProvider);
+ $this->throttleProvider = $throttleProvider ?: new ThrottleProvider($this->userProvider);
$this->session = $session ?: new NativeSession;
$this->cookie = $cookie ?: new NativeCookie; | Update Sentry.php Fixes #<I>. | cartalyst_sentry | train | php |
f65ad78f73aaf0df3223f8cd4dc98fc927348b6c | diff --git a/lib/sfn/command/destroy.rb b/lib/sfn/command/destroy.rb
index <HASH>..<HASH> 100644
--- a/lib/sfn/command/destroy.rb
+++ b/lib/sfn/command/destroy.rb
@@ -45,12 +45,17 @@ module Sfn
end
if config[:poll]
if stacks.size == 1
+ pstack = stacks.first
begin
- poll_stack(stacks.first)
- rescue Miasma::Error::ApiError::RequestError => error
- unless error.response.code == 404
- raise error
+ poll_stack(pstack)
+ stack = provider.connection.stacks.get(pstack)
+ stack.reload
+ if stack.state.to_s.end_with?("failed")
+ ui.error("Stack #{ui.color(pstack, :bold)} still exists after polling complete.")
+ raise "Failed to successfully destroy stack!"
end
+ rescue Miasma::Error::ApiError::RequestError => error
+ # Ignore if stack cannot be reloaded
end
else
ui.error "Stack polling is not available when multiple stack deletion is requested!" | Validate stack is destroyed after destroy polling | sparkleformation_sfn | train | rb |
1d455b2cf0786b2022e2b50a09e364f2c5387156 | diff --git a/lib/processor.js b/lib/processor.js
index <HASH>..<HASH> 100644
--- a/lib/processor.js
+++ b/lib/processor.js
@@ -171,7 +171,7 @@ exports = module.exports = function processor(FfmpegCommand) {
if (!self._codecDataAlreadySent && self.listeners('codecData').length) {
self._checkStdErrForCodec(stderr);
}
- if (self.listeners('progress').length) {
+ if (self.listeners('progress').length && typeof self.metaData.durationsec === 'number') {
self._getProgressFromStdErr(stderr, self.metaData.durationsec);
}
}); | Fix #<I> by not emitting progress if the duration hasn't previously been set | fluent-ffmpeg_node-fluent-ffmpeg | train | js |
ad197b78f42bb114e934881b24b86b442acde10f | diff --git a/volapi/volapi.py b/volapi/volapi.py
index <HASH>..<HASH> 100644
--- a/volapi/volapi.py
+++ b/volapi/volapi.py
@@ -47,7 +47,7 @@ from autobahn.asyncio.websocket import WebSocketClientProtocol
from .multipart import Data
-__version__ = "1.2.3"
+__version__ = "1.2.4"
BASE_URL = "https://volafile.io"
BASE_ROOM_URL = BASE_URL + "/r/"
@@ -967,7 +967,7 @@ class File:
self._info = info.get(self._type) or {}
self.name = info['name']
self._size = info['size']
- self._expire_time = info['expires']
+ self._expire_time = info['expires'] / 1000
self._uploader = info['user']
self._event.set() | fix file expire time, <I> | volafiled_python-volapi | train | py |
84ce8f26754d64a72e2c65db338e20fce425c1fc | diff --git a/filer/utils/filer_easy_thumbnails.py b/filer/utils/filer_easy_thumbnails.py
index <HASH>..<HASH> 100644
--- a/filer/utils/filer_easy_thumbnails.py
+++ b/filer/utils/filer_easy_thumbnails.py
@@ -71,7 +71,8 @@ class ActionThumbnailerMixin(object):
thumbnail_subdir = ''
thumbnail_prefix = ''
- def get_thumbnail_name(self, thumbnail_options, transparent=False):
+ def get_thumbnail_name(self, thumbnail_options, transparent=False,
+ high_resolution=False):
"""
A version of ``Thumbnailer.get_thumbnail_name`` that returns the original
filename to resize. | Changed function signature get_thumbnail_name to be compatible with easy_thumbnails supporting hires images | divio_django-filer | train | py |
650135ee3a8177f73e5f45d3ae35f7be9376ea80 | diff --git a/outbound.js b/outbound.js
index <HASH>..<HASH> 100644
--- a/outbound.js
+++ b/outbound.js
@@ -647,8 +647,13 @@ HMailItem.prototype.read_todo = function () {
});
td_reader.on('end', function () {
if (todo.length !== todo_len) {
- self.logerror("Didn't find right amount of data in todo!");
- self.emit('error', "Didn't find right amount of data in todo!");
+ self.logcrit("Didn't find right amount of data in todo!");
+ fs.rename(self.path, path.join(queue_dir, "error." + self.filename), function (err) {
+ if (err) {
+ self.logerror("Error creating error file after todo read failure (" + self.filename + "): " + err);
+ }
+ });
+ self.emit('error', "Didn't find right amount of data in todo!"); // Note nothing picks this up yet
}
})
}); | If we fail to read the todo file, rename file | haraka_Haraka | train | js |
83c5903fe00def7d6bccb8b11b7b84282f641792 | diff --git a/stage1_fly/run/main.go b/stage1_fly/run/main.go
index <HASH>..<HASH> 100644
--- a/stage1_fly/run/main.go
+++ b/stage1_fly/run/main.go
@@ -334,7 +334,7 @@ func stage1() int {
}
}
- if err = stage1common.WritePid(os.Getpid(), "ppid"); err != nil {
+ if err = stage1common.WritePid(os.Getpid(), "pid"); err != nil {
log.Error(err)
return 1
} | stage1_fly: write pid instead of ppid
Currently the stage1 fly flavor writes a ppid file. This implies it will
have a child pid eventually. For the fly flavor this assumption does not
hold. fly may or may not spawn children hence a ppid doesn't make sense.
This fixes it and writes a pid file instead.
Fixes partially #<I> | rkt_rkt | train | go |
068c957e4c43edaefac3bc6401481ea572b033a5 | diff --git a/sos/plugins/tuned.py b/sos/plugins/tuned.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/tuned.py
+++ b/sos/plugins/tuned.py
@@ -31,6 +31,10 @@ class Tuned(Plugin, RedHatPlugin):
"tuned-adm recommend"
])
self.add_copy_spec([
+ "/etc/tuned.conf",
+ "/etc/tune-profiles"
+ ])
+ self.add_copy_spec([
"/etc/tuned",
"/usr/lib/tuned",
"/var/log/tuned/tuned.log" | [tuned] Collect additional configurations files and profiles.
Collect additional configurations files and profiles for tuned. | sosreport_sos | train | py |
9bd28824e039c6a510de6cd77de8b6a3e4be51c0 | diff --git a/nomad/heartbeat.go b/nomad/heartbeat.go
index <HASH>..<HASH> 100644
--- a/nomad/heartbeat.go
+++ b/nomad/heartbeat.go
@@ -101,18 +101,6 @@ func (s *Server) invalidateHeartbeat(id string) {
if err := s.endpoints.Node.UpdateStatus(&req, &resp); err != nil {
s.logger.Printf("[ERR] nomad.heartbeat: update status failed: %v", err)
}
-
- if resp.LeaderRPCAddr == "" {
- s.logger.Printf("[TRACE] nomad.heartbeat: no leader address returned during heartbeat")
- } else {
- s.logger.Printf("[TRACE] nomad.heartbeat: current leader address according to server %q is %v", s.rpcAdvertise.String(), resp.LeaderRPCAddr)
- }
-
- if len(resp.Servers) == 0 {
- s.logger.Printf("[TRACE] nomad.heartbeat: no servers returned during heartbeat")
- } else {
- s.logger.Printf("[TRACE] nomad.heartbeat: current servers according to server is %v", resp.Servers)
- }
}
// clearHeartbeatTimer is used to clear the heartbeat time for | Nuke trace-level logging in heartbeats | hashicorp_nomad | train | go |
04c0a94d09d6f5d03010dde7c1fa5cbe281ea34d | diff --git a/tests/test_pipreqs.py b/tests/test_pipreqs.py
index <HASH>..<HASH> 100755
--- a/tests/test_pipreqs.py
+++ b/tests/test_pipreqs.py
@@ -24,6 +24,10 @@ class TestPipreqs(unittest.TestCase):
self.assertEqual(len(imports),4, "Incorrect Imports array length")
for item in imports:
self.assertTrue(item in self.modules, "Import is missing")
+ self.assertFalse("time" in imports)
+ self.assertFalse("logging" in imports)
+ self.assertFalse("curses" in imports)
+ self.assertFalse("__future__" in imports)
def test_get_imports_info(self):
path = os.path.join(os.path.dirname(__file__),"_data") | fix(tests): Add more assertions | bndr_pipreqs | train | py |
d446c9fc38ba2290e6e072a91aaed7ebc2fee974 | diff --git a/watson_developer_cloud/discovery_v1.py b/watson_developer_cloud/discovery_v1.py
index <HASH>..<HASH> 100644
--- a/watson_developer_cloud/discovery_v1.py
+++ b/watson_developer_cloud/discovery_v1.py
@@ -222,7 +222,7 @@ class DiscoveryV1(WatsonDeveloperCloudService):
environment_id)
return self.request(method='POST',
url=url_string,
- data=data_dict,
+ json=data_dict,
params={'version': self.version},
accept_json=True) | Discovery create_collection must send JSON
This fixes the problem described here:
<URL> | watson-developer-cloud_python-sdk | train | py |
63bc8399e320ac835af20b3d1347d571772a6db5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -45,9 +45,9 @@ for reqs in extras_require.values():
install_requires = [
'invenio-base>=1.2.3',
'Flask-Alembic>=2.0.1',
- 'Flask-SQLAlchemy>=2.1,<2.5.0',
- 'SQLAlchemy>=1.2.18,<1.4.0',
- 'SQLAlchemy-Utils>=0.33.1,<0.36',
+ 'Flask-SQLAlchemy>=2.1,<2.6.0',
+ 'SQLAlchemy>=1.2.18,<1.5.0',
+ 'SQLAlchemy-Utils>=0.33.1,<0.38',
]
packages = find_packages() | installation: version bumps for SQLAlchemy <I> | inveniosoftware_invenio-db | train | py |
b807b2866579a1fa444cdca260ebb253bb9f74f2 | diff --git a/pattern/src/main/java/org/openbase/jul/pattern/ConfigurableRemote.java b/pattern/src/main/java/org/openbase/jul/pattern/ConfigurableRemote.java
index <HASH>..<HASH> 100644
--- a/pattern/src/main/java/org/openbase/jul/pattern/ConfigurableRemote.java
+++ b/pattern/src/main/java/org/openbase/jul/pattern/ConfigurableRemote.java
@@ -31,7 +31,7 @@ import org.openbase.jul.iface.Manageable;
* @param <M> Message
* @param <CONFIG> Configuration
*/
-public interface ConfigurableRemote<ID, M, CONFIG> extends IdentifiableRemote<ID, M>, Manageable<CONFIG> {
+public interface ConfigurableRemote<ID, M, CONFIG> extends IdentifiableRemote<ID, M>, Manageable<CONFIG>, Remote<M> {
/**
* Method returns the current configuration of this remote instance. | Remote interface added to ConfigurableRemote | openbase_jul | train | java |
65614d74f87851c200f4603f019d9acae44f35b8 | diff --git a/src/ol/featureloader.js b/src/ol/featureloader.js
index <HASH>..<HASH> 100644
--- a/src/ol/featureloader.js
+++ b/src/ol/featureloader.js
@@ -11,6 +11,7 @@ goog.require('ol.xml');
/**
+ * @api
* @typedef {function(this:ol.source.Vector, ol.Extent, number,
* ol.proj.Projection)}
*/
diff --git a/src/ol/loadingstrategy.js b/src/ol/loadingstrategy.js
index <HASH>..<HASH> 100644
--- a/src/ol/loadingstrategy.js
+++ b/src/ol/loadingstrategy.js
@@ -6,6 +6,7 @@ goog.require('ol.TileCoord');
/**
* @typedef {function(ol.Extent, number): Array.<ol.Extent>}
+ * @api
*/
ol.LoadingStrategy; | Add missing @api
These types are referenced in the externs but were not declared.
Found by ol3-cesium. | openlayers_openlayers | train | js,js |
f9ff3eb6d09e3ef38c78f1094c71e4510805a670 | diff --git a/app/controllers/admin/admin_controller.rb b/app/controllers/admin/admin_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/admin/admin_controller.rb
+++ b/app/controllers/admin/admin_controller.rb
@@ -1,7 +1,4 @@
# Public: A base controller for admin pages.
-#
-# Routing:
-# Routing can be dple `resource` route.
class Admin::AdminController < ApplicationController
before_action :find_thing, only: [:show, :edit, :update, :destroy] | Remove old comment from admin_controller.rb | littlelines_ceo | train | rb |
fc371014d589723fd0983c5e38d25829fe340a76 | diff --git a/gcloud_requests/requests_connection.py b/gcloud_requests/requests_connection.py
index <HASH>..<HASH> 100644
--- a/gcloud_requests/requests_connection.py
+++ b/gcloud_requests/requests_connection.py
@@ -42,7 +42,7 @@ class RequestsProxy(object):
# credentials.
if credentials.create_scoped_required():
credentials = credentials.create_scoped(cls.SCOPE)
- instance = super(RequestsProxy, cls).__new__(cls, credentials)
+ instance = super(RequestsProxy, cls).__new__(cls)
return credentials.authorize(instance)
def __init__(self, credentials): | Fix deprecation warning (#<I>)
Deprecation warning removal, and compatibility with Python 3 | LeadPages_gcloud_requests | train | py |
f7608273a0f4dfd0dc3910d4a9db8834a0c3b631 | diff --git a/examples/server/src/main/java/net/kuujo/copycat/examples/server/ServerExample.java b/examples/server/src/main/java/net/kuujo/copycat/examples/server/ServerExample.java
index <HASH>..<HASH> 100644
--- a/examples/server/src/main/java/net/kuujo/copycat/examples/server/ServerExample.java
+++ b/examples/server/src/main/java/net/kuujo/copycat/examples/server/ServerExample.java
@@ -17,11 +17,11 @@ package net.kuujo.copycat.examples.server;
import net.kuujo.copycat.Copycat;
import net.kuujo.copycat.CopycatServer;
-import net.kuujo.copycat.transport.NettyTransport;
-import net.kuujo.copycat.Members;
-import net.kuujo.copycat.Member;
-import net.kuujo.copycat.log.Log;
-import net.kuujo.copycat.log.StorageLevel;
+import net.kuujo.copycat.raft.Member;
+import net.kuujo.copycat.raft.Members;
+import net.kuujo.copycat.raft.log.Log;
+import net.kuujo.copycat.raft.log.StorageLevel;
+import net.kuujo.copycat.raft.transport.NettyTransport;
/**
* Server example. | Updated server example for .raft packaged imports | atomix_atomix | train | java |
f427bfd3092a35974f667e5b0ca9005ad5857559 | diff --git a/inc/fetch_cached.php b/inc/fetch_cached.php
index <HASH>..<HASH> 100644
--- a/inc/fetch_cached.php
+++ b/inc/fetch_cached.php
@@ -15,7 +15,7 @@
global $rah_cache;
$rah_cache = $opt;
- if(txpinterface != 'public' || !empty($_POST) || !empty($_GET)) {
+ if(txpinterface != 'public' || !empty($_POST) || !empty($_GET) || !empty($_COOKIE['txp_login_public'])) {
return;
} | Don't pull a page from the cache if the user sent Textpattern's login cookies.
Todo: needs some type of extending. Ability to set checked cookies and so on. | gocom_rah_cache | train | php |
a830bf718bfc5707ec56854ffc190fc7f0703dda | diff --git a/dmf_control_board/calibrate/impedance.py b/dmf_control_board/calibrate/impedance.py
index <HASH>..<HASH> 100644
--- a/dmf_control_board/calibrate/impedance.py
+++ b/dmf_control_board/calibrate/impedance.py
@@ -307,4 +307,4 @@ def update_fb_calibration(proxy, calibration):
proxy.set_series_capacitance(1, calibration.C_fb[i])
# Reconnect to update settings.
- proxy.connect(port, baud_rate)
+ proxy.connect(port, int(baud_rate)) | Convert baud_rate to int to match Boost signature | wheeler-microfluidics_dmf-control-board-firmware | train | py |
af5e8d251681ed39936e73eb3f45324d1d514cbc | diff --git a/galpy/potential.py b/galpy/potential.py
index <HASH>..<HASH> 100644
--- a/galpy/potential.py
+++ b/galpy/potential.py
@@ -33,6 +33,8 @@ plotplanarPotentials= planarPotential.plotplanarPotentials
plotlinearPotentials= linearPotential.plotlinearPotentials
calcRotcurve= plotRotcurve.calcRotcurve
vcirc= plotRotcurve.vcirc
+epifreq= Potential.epifreq
+verticalfreq= Potential.verticalfreq
omegac= plotRotcurve.omegac
epifreq= plotRotcurve.epifreq
lindbladR= plotRotcurve.lindbladR | add vertical and epicycle frequencies for lists of potentials | jobovy_galpy | train | py |
55127a715b76d21355f83c672799818472212350 | diff --git a/lib/model.js b/lib/model.js
index <HASH>..<HASH> 100644
--- a/lib/model.js
+++ b/lib/model.js
@@ -433,9 +433,16 @@ module.exports = function loadModel( file, callback ) {
size = arr[1];
pos += word.length + 1;
- pos += size * 4 + 1;
- var values = new Float32Array( buffer, word.length + 1, size );
- var o = new WordVec( word, Array.prototype.slice.call( values, 0, size ) );
+ pos += size * 4;
+
+ var values = new Float32Array( size );
+ var off = word.length + 1;
+ for ( var i = 0; i < size; i++ ) {
+ values[ i ] = buffer.readFloatLE( off );
+ off += 4;
+ }
+ var o = new WordVec( word.trim(), Array.prototype.slice.call( values, 0, size ) );
+
var a;
var len = 0;
for ( a = 0; a < size; a++ ) { | [FIX] readBinary function | Planeshifter_node-word2vec | train | js |
3b636ce2d184d1462919427ae08f64dcffb4b5f7 | diff --git a/src/core/orderbook.js b/src/core/orderbook.js
index <HASH>..<HASH> 100644
--- a/src/core/orderbook.js
+++ b/src/core/orderbook.js
@@ -255,7 +255,7 @@ OrderBook.prototype.unsubscribe = function() {
* @param {Function} callback
*/
-OrderBook.prototype.requestOffers = function(callback) {
+OrderBook.prototype.requestOffers = function(callback=function() {}) {
const self = this;
if (!this._shouldSubscribe) {
@@ -1207,6 +1207,8 @@ OrderBook.prototype.mergeDirectAndAutobridgedBooks = function() {
const self = this;
if (_.isEmpty(this._offers) && _.isEmpty(this._offersAutobridged)) {
+ // still emit empty offers list to indicate that load is completed
+ this.emit('model', []);
return;
} | [FIX] emit empty offers list (RT-<I>)
For autobridged order books, emit 'model' event,
even if offers is empty, to indicate that
orderbook is loaded | ChainSQL_chainsql-lib | train | js |
46f33c80e3c0255bcf07ece95ecbb246a1ef451c | diff --git a/src/test/java/org/seqdoop/hadoop_bam/TestBAMOutputFormat.java b/src/test/java/org/seqdoop/hadoop_bam/TestBAMOutputFormat.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/seqdoop/hadoop_bam/TestBAMOutputFormat.java
+++ b/src/test/java/org/seqdoop/hadoop_bam/TestBAMOutputFormat.java
@@ -159,6 +159,20 @@ public class TestBAMOutputFormat {
}
@Test
+ public void testEmptyBAM() throws Exception {
+ String bam = BAMTestUtil.writeBamFile(0,
+ SAMFileHeader.SortOrder.coordinate).toURI().toString();
+ conf.setBoolean(BAMOutputFormat.WRITE_SPLITTING_BAI, true);
+ final Path outputPath = doMapReduce(bam);
+ final File outFile = File.createTempFile("testBAMWriter", ".bam");
+ outFile.deleteOnExit();
+ SAMFileMerger.mergeParts(outputPath.toUri().toString(), outFile.toURI().toString(),
+ SAMFormat.BAM, new SAMRecordSetBuilder(true, SAMFileHeader.SortOrder.coordinate).getHeader());
+ final int actualCount = getBAMRecordCount(outFile);
+ assertEquals(0, actualCount);
+ }
+
+ @Test
public void testBAMWithSplittingBai() throws Exception {
int numPairs = 20000;
// create a large BAM with lots of index points | Failing test for empty splitting bai. | HadoopGenomics_Hadoop-BAM | train | java |
0a34d9b7e8ffbaa9bae6332c594b0a7bdb060c81 | diff --git a/lib/components/request-factory.js b/lib/components/request-factory.js
index <HASH>..<HASH> 100644
--- a/lib/components/request-factory.js
+++ b/lib/components/request-factory.js
@@ -19,13 +19,12 @@ function RequestFactory() {
*/
RequestFactory.prototype.newRequest = function(opts) {
var req = new Request(opts);
- var self = this;
- req.getPromise().done(function(resolve) {
- self._resolves.forEach(function(resolveFn) {
- resolveFn(req, resolve);
+ req.getPromise().then(() => {
+ this._resolves.forEach((resolveFn) => {
+ resolveFn(req);
});
- }, function(err) {
- self._rejects.forEach(function(rejectFn) {
+ }).catch((err) => {
+ this._rejects.forEach((rejectFn) => {
rejectFn(req, err);
});
}); | Replace .done() with .then/catch | matrix-org_matrix-appservice-bridge | train | js |
4ebb847df90a9c2ef9c9d0bcb49325b84fadcebb | diff --git a/marshmallow/fields.py b/marshmallow/fields.py
index <HASH>..<HASH> 100755
--- a/marshmallow/fields.py
+++ b/marshmallow/fields.py
@@ -1012,7 +1012,6 @@ class Url(ValidatedField, String):
error=getattr(self, 'error')
)(value)
-URL = Url
class Email(ValidatedField, String):
"""A validated email field. Validation occurs during both serialization and
@@ -1288,6 +1287,7 @@ class QuerySelectList(QuerySelect):
return items
# Aliases
+URL = Url
Enum = Select
Str = String
Bool = Boolean | Move URL alias to botom of file | marshmallow-code_marshmallow | train | py |
9c3e51b1715db2d174ee5eb9544febc91807f8bb | diff --git a/addon/components/models-table.js b/addon/components/models-table.js
index <HASH>..<HASH> 100644
--- a/addon/components/models-table.js
+++ b/addon/components/models-table.js
@@ -630,7 +630,7 @@ export default Component.extend({
cellValue = cellValue.toLowerCase();
filterString = filterString.toLowerCase();
}
- return c.filterFunction(cellValue, filterString);
+ return c.filterFunction(cellValue, filterString, row);
}
}
return true; | Passing 3rd argument (row) to filterFunction() (#<I>)
The 3rd argument represents current row. It enables user to create more fine-tuned customization of filterFunction().
Like for example filter by multiple properties at once when columns shows only one value (eg: localized names but only current locale name is visible) | onechiporenko_ember-models-table | train | js |
6c84356278bb55c067ae0f336cd18cc6d914faa0 | diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
index <HASH>..<HASH> 100644
--- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
+++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java
@@ -863,6 +863,8 @@ public class SmackIntegrationTestFramework {
}
testMethod.invoke(test, connectionsArray);
}
+
+ connectionManager.recycle(connections);
}
@Override | [sinttest] Recycle low-level test connections | igniterealtime_Smack | train | java |
d004c91f85810ab767e7dd65f308b970ff549580 | diff --git a/samples/sigsmacross/sigsmacross.py b/samples/sigsmacross/sigsmacross.py
index <HASH>..<HASH> 100644
--- a/samples/sigsmacross/sigsmacross.py
+++ b/samples/sigsmacross/sigsmacross.py
@@ -31,16 +31,17 @@ class SmaCross(bt.SignalStrategy):
params = dict(sma1=10, sma2=20)
def notify_order(self, order):
- print('{} {} {}@{}'.format(
- bt.num2date(order.executed.dt),
- 'buy' if order.isbuy() else 'sell',
- order.executed.size,
- order.executed.price)
- )
+ if not order.alive():
+ print('{} {} {}@{}'.format(
+ bt.num2date(order.executed.dt),
+ 'buy' if order.isbuy() else 'sell',
+ order.executed.size,
+ order.executed.price)
+ )
def notify_trade(self, trade):
if trade.isclosed:
- print('protif {}'.format(trade.pnlcomm))
+ print('profit {}'.format(trade.pnlcomm))
def __init__(self):
sma1 = bt.ind.SMA(period=self.params.sma1) | Improve sigsmacross sample | backtrader_backtrader | train | py |
1b281765d72838fbdda4a9efa723ea24f1b0be1a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -68,7 +68,7 @@ else:
setup(
name='nodeconductor',
- version='0.96.0',
+ version='0.97.0',
author='OpenNode Team',
author_email='[email protected]',
url='https://github.com/opennode/nodeconductor', | Preparing new release: <I> | opennode_waldur-core | train | py |
57699633dc296c083a27f02145ecb204aee352e6 | diff --git a/lib/lumberg/whm/server.rb b/lib/lumberg/whm/server.rb
index <HASH>..<HASH> 100644
--- a/lib/lumberg/whm/server.rb
+++ b/lib/lumberg/whm/server.rb
@@ -35,7 +35,7 @@ module Lumberg
def initialize(options)
requires!(options, :host, :hash)
- @ssl_verify ||= true
+ @ssl_verify ||= false
@host = options.delete(:host)
@hash = Whm::format_hash(options.delete(:hash))
@user = (options.has_key?(:user) ? options.delete(:user) : 'root')
diff --git a/spec/whm/server_spec.rb b/spec/whm/server_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/whm/server_spec.rb
+++ b/spec/whm/server_spec.rb
@@ -57,11 +57,16 @@ module Lumberg
end
describe "ssl_verify" do
- it "should verify SSL certs for HTTP requests by default" do
+ it "should no verify SSL certs for HTTP requests by default" do
+ @whm.ssl_verify.should be(false)
+ end
+
+ it "should verify SSL certs for HTTP requests when asked" do
+ @whm.ssl_verify = true
@whm.ssl_verify.should be(true)
end
- it "should not verify SSL certs for HTTP requests when the user is irresponsible" do
+ it "should not verify SSL certs for HTTP requests when asked" do
@whm.ssl_verify = false
@whm.ssl_verify.should be(false)
end | Most WHM servers do not have valid SSL certs. :sadface: | pressednet_lumberg | train | rb,rb |
732681fc13f70d43155ad198e46cae9e6122eae7 | diff --git a/salt/utils/aws.py b/salt/utils/aws.py
index <HASH>..<HASH> 100644
--- a/salt/utils/aws.py
+++ b/salt/utils/aws.py
@@ -239,6 +239,8 @@ def sig4(method, endpoint, params, prov_dict,
amzdate = timenow.strftime('%Y%m%dT%H%M%SZ')
datestamp = timenow.strftime('%Y%m%d')
new_headers = {}
+ if isinstance(headers, dict):
+ new_headers = headers.copy()
# Create payload hash (hash of the request body content). For GET
# requests, the payload is an empty string ('').
@@ -250,9 +252,6 @@ def sig4(method, endpoint, params, prov_dict,
new_headers['x-amz-content-sha256'] = payload_hash
a_canonical_headers = []
a_signed_headers = []
- if isinstance(headers, dict):
- for key, value in six.iteritems(headers):
- new_headers[key] = value
if token != '':
new_headers['X-Amz-security-token'] = token | salt/utils/aws.py: Changed manual dict copying to a .copy()-call | saltstack_salt | train | py |
76143b76ca3f95a09746be08cd7ea3c3d4224116 | diff --git a/salt/modules/ebuild.py b/salt/modules/ebuild.py
index <HASH>..<HASH> 100644
--- a/salt/modules/ebuild.py
+++ b/salt/modules/ebuild.py
@@ -266,14 +266,12 @@ def _get_upgradable():
call = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
if call['retcode'] != 0:
- comment = ''
- if 'stderr' in call:
- comment += call['stderr']
- if 'stdout' in call:
- comment += call['stdout']
- raise CommandExecutionError(
- '{0}'.format(comment)
- )
+ msg = 'Failed to get upgrades'
+ for key in ('stderr', 'stdout'):
+ if call[key]:
+ msg += ': ' + call[key]
+ break
+ raise CommandExecutionError(msg)
else:
out = call['stdout']
@@ -296,7 +294,7 @@ def _get_upgradable():
return ret
-def list_upgrades(refresh=True):
+def list_upgrades(refresh=True, **kwargs): # pylint: disable=W0613
'''
List all available package upgrades. | salt/modules/ebuild.py: add kwargs to list_upgrades
This is done for API compatibility | saltstack_salt | train | py |
ae35c0f70e96de011ad376c8fffba8e8a52ec21f | diff --git a/libcontainerd/process_windows.go b/libcontainerd/process_windows.go
index <HASH>..<HASH> 100644
--- a/libcontainerd/process_windows.go
+++ b/libcontainerd/process_windows.go
@@ -38,17 +38,14 @@ func createStdInCloser(pipe io.WriteCloser, process hcsshim.Process) io.WriteClo
return err
}
- // We do not need to lock container ID here, even though
- // we are calling into hcsshim. This is safe, because the
- // only place that closes this process handle is this method.
err := process.CloseStdin()
- if err != nil && !hcsshim.IsNotExist(err) {
+ if err != nil && !hcsshim.IsNotExist(err) && !hcsshim.IsAlreadyClosed(err) {
// This error will occur if the compute system is currently shutting down
if perr, ok := err.(*hcsshim.ProcessError); ok && perr.Err != hcsshim.ErrVmcomputeOperationInvalidState {
return err
}
}
- return err
+ return nil
})
} | Stop returning errors that should be ignored while closing stdin | moby_moby | train | go |
debadb6a71eb40498a1dd43ed9e53ce78e1e0f8a | diff --git a/src/Console.php b/src/Console.php
index <HASH>..<HASH> 100644
--- a/src/Console.php
+++ b/src/Console.php
@@ -83,11 +83,17 @@ class Console
* Logs current time with optional message
*
* @param string $name
+ * @param float $literalTime
*/
- public function logSpeed($name = 'Point in Time')
+ public function logSpeed($name = 'Point in Time', $literalTime = null)
{
+ $time = microtime(true);
+ if (!is_null($literalTime) && is_float($literalTime)) {
+ $time = $literalTime;
+ }
+
array_push($this->store, array(
- 'data' => microtime(true),
+ 'data' => $time,
'name' => $name,
'type' => 'speed'
)); | Adds option to pass in literal timestamp | jacobemerick_pqp | train | php |
537e8c00d8e13a7b571c66b81dcf99174657967c | diff --git a/test/plugins/jquery.test.js b/test/plugins/jquery.test.js
index <HASH>..<HASH> 100644
--- a/test/plugins/jquery.test.js
+++ b/test/plugins/jquery.test.js
@@ -8,8 +8,11 @@ it("should call the second attached callback", function(){
var $div = $("<div></div>");
// Create a callback function creator
+ var result = [];
var makeCallback = function(number){
- return function(){result = number};
+ return function() {
+ result.push(number);
+ };
}
// Create two seperate callback functions.
@@ -34,5 +37,5 @@ it("should call the second attached callback", function(){
// Expect the result to equal the second callback that should still
// be attached.
- expect(result).to.equal(2);
+ expect(result).to.deep.equal([2]);
}); | More robust test for fix for #<I>
Ensures that the test passes if and only if the desired callback (func2)
is called. The previous test would also pass if both callbacks were
called, as long as func2 was called last. | rollbar_rollbar.js | train | js |
dc18c5bc9cde6f00abf64ba05a8f7a3f55dd9fa7 | diff --git a/utool/util_grabdata.py b/utool/util_grabdata.py
index <HASH>..<HASH> 100755
--- a/utool/util_grabdata.py
+++ b/utool/util_grabdata.py
@@ -837,7 +837,8 @@ def grab_file_url(file_url, ensure=True, appname='utool', download_dir=None,
args = (hash_remote, hash_local, )
print('[utool] Remote Hash: %r, Local Hash: %r' % args)
if hash_remote == hash_local:
- print('[utool] Hash verified...')
+ if verbose:
+ print('[utool] Hash verified...')
success = True
break
except (AssertionError, ValueError): | Added flag for verbose | Erotemic_utool | train | py |
2a77337ca08fa9b939aab85f98aa30cc9838fbcd | diff --git a/bin/storjshare-create.js b/bin/storjshare-create.js
index <HASH>..<HASH> 100755
--- a/bin/storjshare-create.js
+++ b/bin/storjshare-create.js
@@ -86,7 +86,10 @@ console.log(`\n * configuration written to ${outfile}`);
if (!storjshare_create.noedit) {
console.log(' * opening in your favorite editor to tweak before running');
- editor(outfile, () => {
+ editor(outfile, {
+ // NB: Not all distros ship with vim, so let's use GNU Nano
+ editor: process.platform === 'win32' ? null : 'nano'
+ }, () => {
console.log(' ...');
console.log(` * use new config: storjshare start --config ${outfile}`);
}); | default to nano on nix systems, since not all distros ship with vim | storj_storjshare-daemon | train | js |
7b336b515fdbd98df51f3e3b4425dbd0d408bd22 | diff --git a/lib/ufo/config.rb b/lib/ufo/config.rb
index <HASH>..<HASH> 100644
--- a/lib/ufo/config.rb
+++ b/lib/ufo/config.rb
@@ -59,9 +59,9 @@ module Ufo
config.elb.default_actions = nil # full override
config.elb.enabled = "auto" # "auto", true or false
- config.elb.health_check_interval_seconds = 10
+ config.elb.health_check_interval_seconds = 10 # keep at 10 in case of network ELB, which is min 10
config.elb.health_check_path = nil # When nil its AWS default /
- config.elb.healthy_threshold_count = 5
+ config.elb.healthy_threshold_count = 3 # The AWS usual default is 5
config.elb.unhealthy_threshold_count = 2
config.elb.port = 80 # default listener port | adjust elb healthy_threshold_count default to 3 | tongueroo_ufo | train | rb |
d8da246c5de9e84d3885f561b150055dea8bf954 | diff --git a/webapp.js b/webapp.js
index <HASH>..<HASH> 100644
--- a/webapp.js
+++ b/webapp.js
@@ -136,7 +136,11 @@ function registerEvents(emitter) {
cb = cmd
var cmd = cwd.cmd
var args = cwd.args
- env = cwd.env || env
+ // Merge/override any variables
+ for (var i=0; i < Object.keys(cwd.env).length; i++) {
+ env[Object.keys(cwd.env)[i]] = cwd.env[Object.keys(cwd.env)[i]]
+ }
+ cwd = cwd.cwd
}
if (typeof(cmd) === 'string' && typeof(args) === 'function') {
var split = shell.split(/\s+/) | merge and override env k/v's from forkProc arg | Strider-CD_strider-simple-runner | train | js |
339ee187e90cf6eab5ce2fd3f2c94d7fffde3038 | diff --git a/scapy/layers/tls/__init__.py b/scapy/layers/tls/__init__.py
index <HASH>..<HASH> 100644
--- a/scapy/layers/tls/__init__.py
+++ b/scapy/layers/tls/__init__.py
@@ -5,6 +5,7 @@
"""
Tools for handling TLS sessions and digital certificates.
+Use load_layer('tls') to load them to the main namespace.
Prerequisites: | Add loading instruction to the TLS init | secdev_scapy | train | py |
76729b3c6b9ca8d1f893251a2c680c10656ee6d3 | diff --git a/app/src/Bolt/Storage.php b/app/src/Bolt/Storage.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Storage.php
+++ b/app/src/Bolt/Storage.php
@@ -1610,10 +1610,15 @@ class Storage
$offset = ($decoded['parameters']['page'] - 1) * $decoded['parameters']['limit'];
$limit = $decoded['parameters']['limit'];
- // @todo this will can fail when actually using params on certain databases
+ // @todo this will fail when actually using params on certain databases
$statement = $this->app['db']->getDatabasePlatform()->modifyLimitQuery($statement, $limit, $offset);
}
+ if (!empty($decoded['parameters']['printquery'])) {
+ // @todo formalize this
+ echo nl2br(htmlentities($statement));
+ }
+
$rows = $this->app['db']->fetchAll($statement, $query['params']);
$subresults = $this->hydrateRows($query['contenttype'], $rows); | Printquery now works for regular queries. fixes #<I> | bolt_bolt | train | php |
b5f2ca40778d7aeffa061cc22b5d1f3e1d2b3078 | diff --git a/src/Engine/SocketIO/Version1X.php b/src/Engine/SocketIO/Version1X.php
index <HASH>..<HASH> 100644
--- a/src/Engine/SocketIO/Version1X.php
+++ b/src/Engine/SocketIO/Version1X.php
@@ -49,6 +49,7 @@ class Version1X extends AbstractSocketIO
try {
$this->stream = new Stream(fsockopen($host, $server['port'], $errors[0], $errors[1]));
+ $this->logger && $this->logger->info('Connected to the server');
} catch (InvalidArgumentException $e) {
$this->logger && $this->logger->error('Could not connect to the server', ['exception' => $e, 'error' => $errors]);
@@ -58,6 +59,21 @@ class Version1X extends AbstractSocketIO
}
/** {@inheritDoc} */
+ public function close()
+ {
+ if (!$this->stream instanceof Stream) {
+ return;
+ }
+
+ $this->logger && $this->logger->info('Sending a closing message to the server');
+ $this->send(EngineInterface::CLOSE);
+
+ $this->logger && $this->logger->info('Closing the connection to the server');
+ $this->stream->close();
+ $this->stream = null;
+ }
+
+ /** {@inheritDoc} */
public function getName()
{
return 'SocketIO Version 1.X'; | Implement close method on Socket 1.x | Wisembly_elephant.io | train | php |
63ca58ae7bbafa0983ed8968ea6310ef33956261 | diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -416,6 +416,7 @@ module ActiveRecord
#
# t.references(:user)
# t.belongs_to(:supplier, foreign_key: true)
+ # t.belongs_to(:supplier, foreign_key: true, type: :integer)
#
# See {connection.add_reference}[rdoc-ref:SchemaStatements#add_reference] for details of the options you can use.
def references(*args, **options) | Adding type option example to the documentation [ci skip] (#<I>)
* Adding type option example to the documentation [ci skip]
It was hard for me looking <URL> | rails_rails | train | rb |
c2ff663c7ed6632735abd79cd6b7fbe73ae9a828 | diff --git a/twitter4j-core/src/main/java/twitter4j/GeoQuery.java b/twitter4j-core/src/main/java/twitter4j/GeoQuery.java
index <HASH>..<HASH> 100644
--- a/twitter4j-core/src/main/java/twitter4j/GeoQuery.java
+++ b/twitter4j-core/src/main/java/twitter4j/GeoQuery.java
@@ -28,6 +28,7 @@ import java.util.List;
public final class GeoQuery implements java.io.Serializable {
private GeoLocation location;
+ private String query;
private String ip;
private String accuracy;
private String granularity;
@@ -60,6 +61,20 @@ public final class GeoQuery implements java.io.Serializable {
return location;
}
+ /**
+ * Gets and Sets the query to filter Place results from geo/search
+ *
+ * @param query filters the results from geo/search by name
+ */
+
+ public String getQuery() {
+ return query
+ }
+
+ public String setQuery(String query) {
+ return this.query
+ }
+
public String getIp() {
return ip;
}
@@ -186,6 +201,7 @@ public final class GeoQuery implements java.io.Serializable {
public String toString() {
return "GeoQuery{" +
"location=" + location +
+ ", query='" + query + '\'' +
", ip='" + ip + '\'' +
", accuracy='" + accuracy + '\'' +
", granularity='" + granularity + '\'' + | Added query parameter to filter results from geo/search by name | Twitter4J_Twitter4J | train | java |
022d69c468cc1a2db679b04a26e36fdc55ca6cfa | diff --git a/rados/ioctx.go b/rados/ioctx.go
index <HASH>..<HASH> 100644
--- a/rados/ioctx.go
+++ b/rados/ioctx.go
@@ -444,10 +444,10 @@ func (ioctx *IOContext) ListOmapValues(oid string, startAfter string, filterPref
ret := C.rados_read_op_operate(op, ioctx.ioctx, c_oid, 0)
- if int(c_prval) != 0 {
- return RadosError(int(c_prval))
- } else if int(ret) != 0 {
+ if int(ret) != 0 {
return GetRadosError(int(ret))
+ } else if int(c_prval) != 0 {
+ return RadosError(int(c_prval))
}
for { | ioctx: check high-level error first
the problem was that the C-API was returning an error, but the error
pointer (from the op) was getting -EIO. That makes sense as the outer
error was resulting in junk being decode somewhere. | ceph_go-ceph | train | go |
3e1d3d0f21d1b292fe721b4f483b3a3bc2dadd86 | diff --git a/src/ajax.js b/src/ajax.js
index <HASH>..<HASH> 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -291,18 +291,16 @@ jQuery.extend({
// Main method
ajax: function( url , options ) {
- // Handle varargs
- if ( arguments.length === 1 ) {
+ // If options is not an object,
+ // we simulate pre-1.5 signature
+ if ( typeof( options ) !== "object" ) {
options = url;
- url = options ? options.url : undefined;
+ url = undefined;
}
// Force options to be an object
options = options || {};
- // Get the url if provided separately
- options.url = url || options.url;
-
var // Create the final options object
s = jQuery.extend( true , {} , jQuery.ajaxSettings , options ),
// jQuery lists
@@ -630,7 +628,8 @@ jQuery.extend({
};
// Remove hash character (#7531: and string promotion)
- s.url = ( "" + s.url ).replace( rhash , "" );
+ // We also use the url parameter if available
+ s.url = ( "" + ( url || s.url ) ).replace( rhash , "" );
// Extract dataTypes list
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( /\s+/ ); | Revises the way arguments are handled in ajax. | jquery_jquery | train | js |
fa24958570432ee6eadaadc9a7fb92e1ee380dfc | diff --git a/py/selenium/webdriver/remote/webdriver.py b/py/selenium/webdriver/remote/webdriver.py
index <HASH>..<HASH> 100644
--- a/py/selenium/webdriver/remote/webdriver.py
+++ b/py/selenium/webdriver/remote/webdriver.py
@@ -723,12 +723,12 @@ class WebDriver(object):
driver.set_page_load_timeout(30)
"""
try:
- self.execute(Command.SET_TIMEOUTS, {
- 'pageLoad': int(float(time_to_wait) * 1000)})
+ self.execute(Command.SET_TIMEOUTS, {
+ 'pageLoad': int(float(time_to_wait) * 1000)})
except WebDriverException:
- self.execute(Command.SET_TIMEOUTS, {
- 'ms': float(time_to_wait) * 1000,
- 'type': 'page load'})
+ self.execute(Command.SET_TIMEOUTS, {
+ 'ms': float(time_to_wait) * 1000,
+ 'type': 'page load'})
def find_element(self, by=By.ID, value=None):
""" | [py] Fix indentation to satisfy PEP8
Fixes flake8 errors:
selenium/webdriver/remote/webdriver.py:<I>:<I>: E<I> indentation is not a multiple of four
selenium/webdriver/remote/webdriver.py:<I>:<I>: E<I> indentation is not a multiple of four | SeleniumHQ_selenium | train | py |
e8f839edc655b60393e4083c1836610c72dcc956 | diff --git a/engine.js b/engine.js
index <HASH>..<HASH> 100644
--- a/engine.js
+++ b/engine.js
@@ -15,9 +15,9 @@ module.exports = function(source, config){
function loadViews(source) {
for (let item of source.flatten(true)) {
- partials[item.handle] = item.content;
+ partials[item.handle] = item.viewPath;
if (item.alias) {
- partials[item.alias] = item.content;
+ partials[item.alias] = item.viewPath;
}
}
viewsLoaded = true;
@@ -27,7 +27,8 @@ module.exports = function(source, config){
source.on('changed', loadViews);
return {
- engine: consolidate[config.engine],
+ engine: consolidate[config.engine],
+ requires: consolidate.requires,
render: function(tplPath, str, context, meta){
if (!viewsLoaded) loadViews(source);
context.partials = {}; | Expose consolidate.requires object to allow for customisation | frctl_consolidate | train | js |
4bf2abeb90458f6a9e1bb9d17199728a04bd5d23 | diff --git a/cattle.py b/cattle.py
index <HASH>..<HASH> 100755
--- a/cattle.py
+++ b/cattle.py
@@ -13,7 +13,8 @@ class Client(gdapi.Client):
def wait_success(self, obj, timeout=DEFAULT_TIMEOUT):
obj = self.wait_transitioning(obj, timeout)
- assert obj.transitioning == 'no'
+ if obj.transitioning != 'no':
+ raise gdapi.ClientApiError(obj.transitioningMessage)
return obj
def wait_transitioning(self, obj, timeout=DEFAULT_TIMEOUT): | Don't assert but raise exception on error | rancher_cattle-cli | train | py |
e23d79a55f3944bcfe997ef02d5d79a3e8a1b17e | diff --git a/Net/OpenID/Association.php b/Net/OpenID/Association.php
index <HASH>..<HASH> 100644
--- a/Net/OpenID/Association.php
+++ b/Net/OpenID/Association.php
@@ -67,11 +67,12 @@ class Net_OpenID_Association {
* at this time is C{'HMAC-SHA1'}, but new types may be
* defined in the future.
*/
- function fromExpiresIn($cls, $expires_in, $handle, $secret, $assoc_type)
+ function fromExpiresIn($expires_in, $handle, $secret, $assoc_type)
{
$issued = time();
$lifetime = $expires_in;
- return $class_name($handle, $secret, $issued, $lifetime, $assoc_type);
+ return new Net_OpenID_Association($handle, $secret,
+ $issued, $lifetime, $assoc_type);
}
/**
@@ -233,7 +234,7 @@ class Net_OpenID_Association {
function sign($pairs)
{
assert($this->assoc_type == 'HMAC-SHA1');
- $kv = Net_OpenID_arrayToKV($pairs);
+ $kv = Net_OpenID_KVForm::arrayToKV($pairs);
return Net_OpenID_hmacSha1($this->secret, $kv);
} | [project @ Fixed some small bugs] | openid_php-openid | train | php |
3667575ff4dff6f3445ed8c4d4148a74b6e9833e | diff --git a/watson_streaming.py b/watson_streaming.py
index <HASH>..<HASH> 100644
--- a/watson_streaming.py
+++ b/watson_streaming.py
@@ -68,7 +68,8 @@ def start_communicate(ws, settings):
ws.send(json.dumps(settings).encode('utf8'))
# Spin off a dedicated thread where we are going to read and
# stream out audio.
- t = threading.Thread(target=send_audio, args=(ws, ), daemon=True)
+ t = threading.Thread(target=send_audio, args=(ws, ))
+ t.daemon = True # Not passed to the constructor to support python 2
t.start() | Fix failure to start background thread in python 2. Fix #8 | Nagasaki45_watson-streaming | train | py |
b07ffb773703acd5005f92de270b12e263a824e1 | diff --git a/src/Modules/Extractors/MetaExtractor.php b/src/Modules/Extractors/MetaExtractor.php
index <HASH>..<HASH> 100644
--- a/src/Modules/Extractors/MetaExtractor.php
+++ b/src/Modules/Extractors/MetaExtractor.php
@@ -74,7 +74,7 @@ class MetaExtractor extends AbstractModule implements ModuleInterface {
foreach (self::$SPLITTER_CHARS as $char) {
if (strpos($title, $char) !== false) {
- $title = array_reduce(explode($char, $title), function($carry, $item) {
+ $part = array_reduce(explode($char, $title), function($carry, $item) {
if (mb_strlen($item) > mb_strlen($carry)) {
return $item;
}
@@ -82,7 +82,8 @@ class MetaExtractor extends AbstractModule implements ModuleInterface {
return $carry;
});
- if (!empty($title)) {
+ if (!empty($part)) {
+ $title = $part;
break;
}
} | Fix bug with in getTitle() | scotteh_php-goose | train | php |
3e3582cf65cc991717b8fd2dfe3c8aa95957dfb6 | diff --git a/mcfit/mcfit.py b/mcfit/mcfit.py
index <HASH>..<HASH> 100644
--- a/mcfit/mcfit.py
+++ b/mcfit/mcfit.py
@@ -302,7 +302,7 @@ class mcfit(object):
to_axis = [1] * a.ndim
to_axis[axis] = -1
- _extrap, extrap_ = extrap, extrap if numpy.isscalar(extrap) else extrap
+ _extrap, extrap_ = (extrap, extrap) if numpy.isscalar(extrap) else extrap
Npad = self.N - self.Nin
if out: | Fix bug when extrap is tuple | eelregit_mcfit | train | py |
e57c764410db3d60481a45e4fc452bfa6357bbeb | diff --git a/public/app/plugins/datasource/elasticsearch/datasource.js b/public/app/plugins/datasource/elasticsearch/datasource.js
index <HASH>..<HASH> 100644
--- a/public/app/plugins/datasource/elasticsearch/datasource.js
+++ b/public/app/plugins/datasource/elasticsearch/datasource.js
@@ -220,8 +220,10 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes
}
// intervalSec: interval in seconds
- payload = payload.replace(/\$intervalSec/g, kbn.interval_to_seconds(options.interval));
- payload = payload.replace(/\$intervalMs/g, kbn.interval_to_ms(options.interval));
+ if (options.interval && options.interval.match(kbn.interval_regex)) {
+ payload = payload.replace(/\$intervalSec/g, kbn.interval_to_seconds(options.interval));
+ payload = payload.replace(/\$intervalMs/g, kbn.interval_to_ms(options.interval));
+ }
payload = payload.replace(/\$interval/g, options.interval);
payload = payload.replace(/\$timeFrom/g, options.range.from.valueOf());
payload = payload.replace(/\$timeTo/g, options.range.to.valueOf()); | check validation of interval string before converting to seconds | grafana_grafana | train | js |
38148903fb23c0983497cf5b300bddfe9de1c251 | diff --git a/activerecord/lib/active_record/relation/merger.rb b/activerecord/lib/active_record/relation/merger.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/relation/merger.rb
+++ b/activerecord/lib/active_record/relation/merger.rb
@@ -13,6 +13,13 @@ module ActiveRecord
@hash = hash
end
+ # It allows to do a join, and filter by a scope on the joined model:
+ # class Account < ActiveRecord::Base
+ # # Returns all the accounts that have unread messages.
+ # def self.with_unread_messages
+ # joins(:messages).merge( Message.unread )
+ # end
+ # end
def merge
Merger.new(relation, other).merge
end | [ci skip] merge docs | rails_rails | train | rb |
Subsets and Splits