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 |
|---|---|---|---|---|---|
e81f7024d5af92357ea612be18467e90d7177cf0 | diff --git a/test/applyBabelJob.js b/test/applyBabelJob.js
index <HASH>..<HASH> 100644
--- a/test/applyBabelJob.js
+++ b/test/applyBabelJob.js
@@ -5,6 +5,8 @@ var childProcess = require('child_process'),
temp = require('temp');
describe('applyBabelJob', function () {
+ this.timeout(20000);
+
it('should handle a complex test case', function (done) {
var babelDir = Path.resolve(__dirname, 'applyBabelJob/translationjob'),
tmpTestCaseCopyDir = temp.mkdirSync(),
diff --git a/test/processImages.js b/test/processImages.js
index <HASH>..<HASH> 100644
--- a/test/processImages.js
+++ b/test/processImages.js
@@ -3,6 +3,8 @@ var expect = require('./unexpected-with-plugins'),
AssetGraph = require('../lib/AssetGraph');
describe('processImages', function () {
+ this.timeout(20000);
+
it('should handle a Css test case', function (done) {
new AssetGraph({root: __dirname + '/processImages/css/'})
.loadAssets('style.css') | Up the timeouts of some tests that just failed on Travis because they didn't complete in 2 seconds. | assetgraph_assetgraph-builder | train | js,js |
f690da943a9e6352ff04f20981e982a936bd669a | diff --git a/GPy/kern/parts/white.py b/GPy/kern/parts/white.py
index <HASH>..<HASH> 100644
--- a/GPy/kern/parts/white.py
+++ b/GPy/kern/parts/white.py
@@ -51,10 +51,10 @@ class White(Kernpart):
pass
def psi0(self,Z,mu,S,target):
- target += self.variance
+ pass # target += self.variance
def dpsi0_dtheta(self,dL_dpsi0,Z,mu,S,target):
- target += dL_dpsi0.sum()
+ pass # target += dL_dpsi0.sum()
def dpsi0_dmuS(self,dL_dpsi0,Z,mu,S,target_mu,target_S):
pass | changed psi0 of white to be zero | SheffieldML_GPy | train | py |
83d19c834b2c0c78111c032a6972d3b81b9c98eb | diff --git a/src/codegeneration/FromOptionsTransformer.js b/src/codegeneration/FromOptionsTransformer.js
index <HASH>..<HASH> 100644
--- a/src/codegeneration/FromOptionsTransformer.js
+++ b/src/codegeneration/FromOptionsTransformer.js
@@ -178,7 +178,7 @@ export class FromOptionsTransformer extends MultiTransformer {
append(BlockBindingTransformer);
// generator must come after for of and rest parameters
- if (transformOptions.generators || transformOptions.asyncFuntions)
+ if (transformOptions.generators || transformOptions.asyncFunctions)
append(GeneratorTransformPass);
if (transformOptions.symbols)
diff --git a/test/feature/AsyncFunctions/Basics.js b/test/feature/AsyncFunctions/Basics.js
index <HASH>..<HASH> 100644
--- a/test/feature/AsyncFunctions/Basics.js
+++ b/test/feature/AsyncFunctions/Basics.js
@@ -1,5 +1,7 @@
-// Options: --async-functions
+// Options: --async-functions --generators=false
// Async.
+//
+// The --generators=false part is to test #1231
var f = (x, y) => ({x, y}); | Make sure async-functions work without generators.
This was due to a typo.
Fixes #<I> | google_traceur-compiler | train | js,js |
da5600adcc78b8103d262694f2da1e63bf7fe326 | diff --git a/test/TestOpenTokSDK.php b/test/TestOpenTokSDK.php
index <HASH>..<HASH> 100644
--- a/test/TestOpenTokSDK.php
+++ b/test/TestOpenTokSDK.php
@@ -64,7 +64,7 @@ function validate_token($token) {
assert_options(ASSERT_CALLBACK, 'my_assert_handler');
set_exception_handler('exception_handler');
-require_once 'OpenTokSDK.php';
+require_once '../OpenTokSDK.php';
$a = new OpenTokSDK(API_Config::API_KEY,API_Config::API_SECRET);
$token = $a->generate_token();
assert('$token'); | OpenTokSDK.php is 1 step back | opentok_OpenTok-PHP-SDK | train | php |
93d4cdf69752082cf1169ea5e2ffd25a5a574d3f | diff --git a/tests/QueryTest.php b/tests/QueryTest.php
index <HASH>..<HASH> 100644
--- a/tests/QueryTest.php
+++ b/tests/QueryTest.php
@@ -361,7 +361,7 @@ class QueryTest extends TestCase
public function testPostFilter()
{
$postFilter = [
- 'match' => ['status' => 2]
+ 'term' => ['status' => 2]
];
$query = new Query();
$query->from('yiitest', 'user'); | Fixed test for post_query ("match" is not a valid filter for older versions of ES, replaced with "term") | yiisoft_yii2-elasticsearch | train | php |
17e0a2afa76d55b7488ec0443fd1d95f6bafb11c | diff --git a/modules/backend/behaviors/ListController.php b/modules/backend/behaviors/ListController.php
index <HASH>..<HASH> 100644
--- a/modules/backend/behaviors/ListController.php
+++ b/modules/backend/behaviors/ListController.php
@@ -213,7 +213,6 @@ class ListController extends ControllerBehavior
* Filter the list when the scopes are changed
*/
$filterWidget->bindEvent('filter.update', function () use ($widget, $filterWidget) {
- $widget->addFilter([$filterWidget, 'applyAllScopesToQuery']);
return $widget->onRefresh();
}); | Fix doubble-applied filters | octobercms_october | train | php |
a2267c5f0af9a0b6c131f6011b087fc419362ba0 | diff --git a/src/main/resources/META-INF/resources/primefaces/datatable/datatable.js b/src/main/resources/META-INF/resources/primefaces/datatable/datatable.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/META-INF/resources/primefaces/datatable/datatable.js
+++ b/src/main/resources/META-INF/resources/primefaces/datatable/datatable.js
@@ -1707,10 +1707,11 @@ PrimeFaces.widget.DataTable = PrimeFaces.widget.BaseWidget.extend({
columnHeader.width(newWidth);
nextColumnHeader.width(nextColumnWidth);
-
+
if($this.cfg.scrollable) {
- $this.colgroup.children().eq(colIndex).width(columnHeader.innerWidth());
- $this.colgroup.children().eq(colIndex + 1).width(nextColumnHeader.innerWidth());
+ var padding = columnHeader.innerWidth() - columnHeader.width();
+ $this.colgroup.children().eq(colIndex).width(newWidth + padding + 1);
+ $this.colgroup.children().eq(colIndex + 1).width(nextColumnWidth + padding + 1);
if($this.footerCols.length > 0) {
var footerCol = $this.footerCols.eq(colIndex), | Improved resize support for scrollable datatable | primefaces_primefaces | train | js |
b064a27291f355179f72fca82a78efa60755393f | diff --git a/checkers/python3.py b/checkers/python3.py
index <HASH>..<HASH> 100644
--- a/checkers/python3.py
+++ b/checkers/python3.py
@@ -262,6 +262,11 @@ class Python3Checker(checkers.BaseChecker):
'Used when the round built-in is referenced '
'(backwards-incompatible semantics in Python 3)',
{'maxversion': (3, 0)}),
+ 'W1634': ('intern built-in referenced',
+ 'intern-builtin',
+ 'Used when the intern built-in is referenced '
+ '(Moved to sys.intern in Python 3)',
+ {'maxversion': (3, 0)}),
}
_bad_builtins = frozenset([
@@ -273,6 +278,7 @@ class Python3Checker(checkers.BaseChecker):
'execfile',
'file',
'input', # Not missing, but incompatible semantics
+ 'intern',
'long',
'raw_input',
'reduce',
diff --git a/test/unittest_checker_python3.py b/test/unittest_checker_python3.py
index <HASH>..<HASH> 100644
--- a/test/unittest_checker_python3.py
+++ b/test/unittest_checker_python3.py
@@ -49,6 +49,7 @@ class Python3CheckerTest(testutils.CheckerTestCase):
'execfile',
'file',
'input',
+ 'intern',
'long',
'raw_input',
'round', | Add warning for "intern" in Python 3
Closes issue #<I> | PyCQA_pylint | train | py,py |
315c8ca3d217ffb0fc5a31ab6c348e018beb480c | diff --git a/lib/jobs/dell-wsman-inventory.js b/lib/jobs/dell-wsman-inventory.js
index <HASH>..<HASH> 100644
--- a/lib/jobs/dell-wsman-inventory.js
+++ b/lib/jobs/dell-wsman-inventory.js
@@ -152,7 +152,6 @@ function DellWsmanInventoryJobFactory(BaseJob, Logger, Promise, util, waterline,
var request = {
credential: self.target,
callbackUri: callback,
- callbackGraph: 'Graph.Dell.Wsman.InventoryCallback',
type: type
} | Removing callbackGraph entry from the wsman inventory service payload | RackHD_on-tasks | train | js |
b36650071ce93205f22f4df9ddde7b84da0c8e8c | diff --git a/src/bosh-director/lib/bosh/director/api/release_manager.rb b/src/bosh-director/lib/bosh/director/api/release_manager.rb
index <HASH>..<HASH> 100644
--- a/src/bosh-director/lib/bosh/director/api/release_manager.rb
+++ b/src/bosh-director/lib/bosh/director/api/release_manager.rb
@@ -52,7 +52,7 @@ module Bosh::Director
def find_version(release, version)
dataset = release.versions_dataset
- release_version = dataset.filter(:version => version).first
+ release_version = dataset.filter(version: version.to_s).first
if release_version.nil?
begin
new_formatted_version = Bosh::Common::Version::ReleaseVersion.parse(version) | Ensure release version is sent as string when polling the DB
This change ensures that we adhere to postgres's strict type matching
[#<I>](<URL>) | cloudfoundry_bosh | train | rb |
00d8aa1549c00ab4bafc6ab9ade6317f2091a968 | diff --git a/src/Statistics/Regression/Methods/LeastSquares.php b/src/Statistics/Regression/Methods/LeastSquares.php
index <HASH>..<HASH> 100644
--- a/src/Statistics/Regression/Methods/LeastSquares.php
+++ b/src/Statistics/Regression/Methods/LeastSquares.php
@@ -432,7 +432,7 @@ trait LeastSquares
*/
public function getCI($x, $p)
{
- $V = regressionVariance(array $x);
+ $V = regressionVariance($x);
$σ² = $this->meanSquareResidual();
// The t-value | Update LeastSquares.php | markrogoyski_math-php | train | php |
69c0a33c859a0c0424b593c7c203e1a48d53eadc | diff --git a/spec/static/main.js b/spec/static/main.js
index <HASH>..<HASH> 100644
--- a/spec/static/main.js
+++ b/spec/static/main.js
@@ -5,6 +5,12 @@ const dialog = electron.dialog;
const BrowserWindow = electron.BrowserWindow;
const path = require('path');
+const url = require('url');
+
+var argv = require('yargs')
+ .boolean('ci')
+ .string('g').alias('g', 'grep')
+ .argv;
var window = null;
process.port = 0; // will be used by crash-reporter spec.
@@ -68,7 +74,13 @@ app.on('ready', function() {
javascript: true // Test whether web-preferences crashes.
},
});
- window.loadURL('file://' + __dirname + '/index.html');
+ window.loadURL(url.format({
+ pathname: __dirname + '/index.html',
+ protocol: 'file',
+ query: {
+ grep: argv.grep
+ }
+ }));
window.on('unresponsive', function() {
var chosen = dialog.showMessageBox(window, {
type: 'warning', | Pass mocha grep command line option through to spec app | electron_electron | train | js |
d6cd52c681ad164ebb83bae924d06bae805d7295 | diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index <HASH>..<HASH> 100644
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -42,17 +42,6 @@ gulp.task('jscs', [ 'eslint' ], function () {
});
gulp.task('istanbul:src', [ 'jscs' ], istanbulHandler.bind(null, SRC));
gulp.task('istanbul:dist', [ 'babel' ], istanbulHandler.bind(null, TRANSPILED_SRC));
-gulp.task('mocha:src', [ 'istanbul:src' ], function() {
- return gulp.src(TEST_SRC).pipe(mocha({
- reporter: 'spec'
- })).pipe(istanbul.writeReports({
- dir: 'coverage',
- reportOpts: {
- dir: 'coverage'
- },
- reporters: [ 'text', 'text-summary', 'html', 'cobertura' ]
- }));
-});
gulp.task(
'mocha:src',
[ 'istanbul:src' ], | removed duplicate src from gulpfile | angie-framework_angie-injector | train | js |
bdacdc7f3bcab06595d02a19d03a32519125b063 | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -7,7 +7,7 @@
var LessCssClean = require('less-plugin-clean-css'),
rootPath = '../../';
- global.version = '3.3.8';
+ global.version = '3.3.9';
global.bs = require('browser-sync').create();
global.fs = require('fs-extra'); | Update wee-framework version in anticipation of update | weepower_wee-core | train | js |
6084d11ed0eb20532a8e0f3fb87eb2ecbef15abd | diff --git a/lib/dm-validations/uniqueness_validator.rb b/lib/dm-validations/uniqueness_validator.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-validations/uniqueness_validator.rb
+++ b/lib/dm-validations/uniqueness_validator.rb
@@ -36,18 +36,15 @@ module DataMapper
end
end
-
resource = DataMapper.repository(repository_name) { target.model.first(opts) }
return true if resource.nil?
-
- # is target and found resource identic? same instance... but not ==
- return true if !target.new? && resource.repository.name == repository_name && resource.model == target.model && resource.key == target.key
+ return true if target.saved? && resource == target
error_message = @options[:message] || ValidationErrors.default_error_message(:taken, field_name)
add_error(target, error_message, field_name)
- return false
+ false
end
end # class UniquenessValidator | [dm-validations] Simplified uniqueness validation logic | emmanuel_aequitas | train | rb |
64ffa7cde9ddc70b608653dc5fd6f5f7c82339d3 | diff --git a/pavement.py b/pavement.py
index <HASH>..<HASH> 100644
--- a/pavement.py
+++ b/pavement.py
@@ -1,9 +1,10 @@
+import os
import sys
-from paver.path import path
-from paver.easy import task, needs, cmdopts, options
+from paver.easy import *
+import paver
from paver.setuputils import setup
-sys.path.insert(0, path(__file__).dirname())
+sys.path.insert(0, os.path.dirname(__file__))
from snakeguice import __pkginfo__ as pkg
@@ -40,13 +41,14 @@ try:
@cmdopts([('msg-only', 'm', 'Only generate messages (no reports)')])
def lint():
"""Check the module you're building with pylint."""
- build_dir = path(__file__).dirname()
+ build_dir = paver.runtime.path.getcwd()
args = ['--rcfile', build_dir / "pylint.cfg"]
if options.get('lint', {}).get('msg_only', 0):
args.append('-rn')
pkgs = list(set(p.split(".")[0] for p in options.setup.packages))
- linter.Run(args + pkgs)
+ args += pkgs
+ linter.Run(args)
except ImportError:
"""Pylint is not installed.""" | cleaned up the pavement.py a little bit | dstanek_snake-guice | train | py |
45bca4301ffbdec7fa216170ed29dcf3a659b667 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -42,7 +42,7 @@ else:
setup(
name='zipline',
- version='0.5.8',
+ version='0.5.9',
description='A backtester for financial algorithms.',
author='Quantopian Inc.',
author_email='opensource@quantopian.com', | REL: <I>
Highlights:
- Benchmark updating now permits empty ranges.
(Fixes runtime crash when running immediately after Easter <I>.)
- Risk metrics
- Performance improvents from converting to numpy and pandas.
<@wesm, <EMAIL>>
- Refactoring of risk metric calculation out of class structure. | quantopian_zipline | train | py |
9050de9d008132550f74e7a3ae4996ca250115c4 | diff --git a/ModelBundle/DependencyInjection/OpenOrchestraModelExtension.php b/ModelBundle/DependencyInjection/OpenOrchestraModelExtension.php
index <HASH>..<HASH> 100644
--- a/ModelBundle/DependencyInjection/OpenOrchestraModelExtension.php
+++ b/ModelBundle/DependencyInjection/OpenOrchestraModelExtension.php
@@ -23,7 +23,7 @@ class OpenOrchestraModelExtension extends Extension
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
- $immutableProperties = array_merge($config['content_immutable_properties'], array('linkedToSite'));
+ $immutableProperties = array_merge($config['content_immutable_properties'], array('linkedToSite', 'deleted'));
$container->setParameter('open_orchestra_model.content.immutable_properties', $immutableProperties);
foreach ($config['document'] as $class => $content) {
if (is_array($content)) { | fix delete all version and all language of a content | open-orchestra_open-orchestra-model-bundle | train | php |
68c55128f0977f478d54d234b452e09045a1bc7a | diff --git a/code/site/components/com_default/controllers/default.php b/code/site/components/com_default/controllers/default.php
index <HASH>..<HASH> 100644
--- a/code/site/components/com_default/controllers/default.php
+++ b/code/site/components/com_default/controllers/default.php
@@ -19,6 +19,19 @@
*/
class ComDefaultControllerDefault extends KControllerView
{
+ /**
+ * Constructor
+ *
+ * @param object An optional KConfig object with configuration options
+ */
+ public function __construct(KConfig $config)
+ {
+ parent::__construct($config);
+
+ //Enqueue the authorization command
+ $this->getCommandChain()->enqueue( KFactory::get('site::com.default.command.authorize'));
+ }
+
/**
* Set the request information
* | Added basic authorize command in the default controllers. Implemented authorize checks for add, edit and delete actions. | joomlatools_joomlatools-framework | train | php |
557db7c1799c1955e442d9a6c18fb8bc259a8501 | diff --git a/Parsedown.php b/Parsedown.php
index <HASH>..<HASH> 100755
--- a/Parsedown.php
+++ b/Parsedown.php
@@ -23,6 +23,19 @@ class Parsedown
function text($text)
{
+ $Elements = $this->textElements($text);
+
+ # convert to markup
+ $markup = $this->elements($Elements);
+
+ # trim line breaks
+ $markup = trim($markup, "\n");
+
+ return $markup;
+ }
+
+ protected function textElements($text)
+ {
# make sure no definitions are set
$this->DefinitionData = array();
@@ -36,18 +49,7 @@ class Parsedown
$lines = explode("\n", $text);
# iterate through lines to identify blocks
- $Elements = $this->linesElements($lines);
-
- # process elements
- $Elements = $this->process($Elements);
-
- # convert to markup
- $markup = $this->elements($Elements);
-
- # trim line breaks
- $markup = trim($markup, "\n");
-
- return $markup;
+ return $this->linesElements($lines);
}
#
@@ -1743,11 +1745,6 @@ class Parsedown
return $markup;
}
- protected function process(array $Elements)
- {
- return $Elements;
- }
-
# ~
protected function li($lines) | Split some of `text` into `textElements`
`process` is no longer needed | erusev_parsedown | train | php |
bdc4342a63f83d65c6b78405628a12edb4b21b55 | diff --git a/src/nsPopover.js b/src/nsPopover.js
index <HASH>..<HASH> 100644
--- a/src/nsPopover.js
+++ b/src/nsPopover.js
@@ -325,7 +325,7 @@
.css('top', top.toString() + 'px')
.css('left', left.toString() + 'px');
- if (triangle) {
+ if (triangle && triangle.length) {
if (placement === 'top' || placement === 'bottom') {
left = rect.left + rect.width / 2 - left;
triangle.css('left', left.toString() + 'px'); | Fix error `css not a function` when triangle is not an angular element | nohros_nsPopover | train | js |
950d40f2e237f9050f5e2f176a3207b1e1ee955f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setupopts = dict(
name="automate",
- version='0.10.0',
+ version='0.10.1.dev0',
packages=find_packages('src'),
include_package_data=True,
package_dir={'': 'src'}, | Back to development: <I> | tuomas2_automate | train | py |
69b896d3700c3874ad7cb9b319083b3bdbc3c22a | diff --git a/app/helpers/i18n.js b/app/helpers/i18n.js
index <HASH>..<HASH> 100644
--- a/app/helpers/i18n.js
+++ b/app/helpers/i18n.js
@@ -20,13 +20,18 @@ export default Ember.Helper.extend({
compute: function(params,hash) {
var explicit=false;
- var _params=Ember.A(),hash=Ember.assign ? Ember.assign({},hash) : hash;
+ var _attributes=Ember.A();
if(hash.explicit) {
- explicit=hash.explicit;
- delete hash.explicit;
+ explicit=hash.explicit;
}
- _params.pushObjects(params);
- var result = this.get('i18n')._translate(_params.shift(),hash.attributes ? hash.attributes : _params,explicit);
+
+ if(hash.attributes) {
+ _attributes.pushObjects(hash.attributes);
+ } else {
+ _attributes.pushObjects(params.slice(1));
+ }
+
+ var result = this.get('i18n')._translate(params[0],_attributes,explicit);
if(result instanceof Ember.RSVP.Promise) {
var instance=this;
result.then(function() { | Fixed issue with i<I>n template helper screwing with hash attributes | ember-furnace_ember-cli-furnace-i18n | train | js |
789ad7b9017a20cb27dc244c12d9f102e55149ea | diff --git a/salt/output/nested.py b/salt/output/nested.py
index <HASH>..<HASH> 100644
--- a/salt/output/nested.py
+++ b/salt/output/nested.py
@@ -55,7 +55,7 @@ class NestDisplay(object):
indent, color, prefix, msg, endc, suffix)
except UnicodeDecodeError:
return u'{0}{1}{2}{3}{4}{5}\n'.format(
- indent, color, prefix, msg.decode(encoding), endc, suffix)
+ indent, color, prefix, salt.utils.sdecode(msg), endc, suffix)
def display(self, ret, indent, prefix, out):
''' | Add new sdecode to nested outputter | saltstack_salt | train | py |
1cd761617293e37e94d12134f1e1f62ba7cb9700 | diff --git a/cli/sawtooth_cli/block.py b/cli/sawtooth_cli/block.py
index <HASH>..<HASH> 100644
--- a/cli/sawtooth_cli/block.py
+++ b/cli/sawtooth_cli/block.py
@@ -20,7 +20,7 @@ from sawtooth_cli.exceptions import CliException
def add_block_parser(subparsers, parent_parser):
- """Adds arguments parsers for the batch list and batch show commands
+ """Adds arguments parsers for the block list and block show commands
Args:
subparsers: Add parsers to this subparser object
diff --git a/cli/sawtooth_cli/state.py b/cli/sawtooth_cli/state.py
index <HASH>..<HASH> 100644
--- a/cli/sawtooth_cli/state.py
+++ b/cli/sawtooth_cli/state.py
@@ -21,7 +21,7 @@ from sawtooth_cli.exceptions import CliException
def add_state_parser(subparsers, parent_parser):
- """Adds arguments parsers for the batch list and batch show commands
+ """Adds arguments parsers for the state list and state show commands
Args:
subparsers: Add parsers to this subparser object | Fix wrong notes of state and block list/show commands | hyperledger_sawtooth-core | train | py,py |
d58b998517389271e083b1dcbc1f7252eeabd8cb | diff --git a/vendor/Krystal/Date/Helper.php b/vendor/Krystal/Date/Helper.php
index <HASH>..<HASH> 100644
--- a/vendor/Krystal/Date/Helper.php
+++ b/vendor/Krystal/Date/Helper.php
@@ -16,33 +16,10 @@ namespace Krystal\Date;
*/
abstract class Helper
{
- /**
- * @const integer
- */
const MINUTE = 60;
-
- /**
- * @const integer
- */
const SECOND = 1;
-
- /**
- * @const integer
- */
const DAY = 86400;
-
- /**
- * @const integer
- */
const WEEK = 604800;
-
- /**
- * @const integer
- */
const MONTH = 2592000;
-
- /**
- * @const integer
- */
const YEAR = 31536000;
} | Removed description
Description is not really needed there | krystal-framework_krystal.framework | train | php |
95cb2bfe2ca80df7913e74547f5a8abcde9df11c | diff --git a/flask_bower/__init__.py b/flask_bower/__init__.py
index <HASH>..<HASH> 100644
--- a/flask_bower/__init__.py
+++ b/flask_bower/__init__.py
@@ -57,11 +57,7 @@ def handle_url_error(error, endpoint, values):
"""
url = overlay_url_for(endpoint, **values)
if url is None:
- exc_type, exc_value, tb = sys.exc_info()
- if exc_value is error:
- raise exc_type(exc_value).with_traceback(tb)
- else:
- raise error
+ raise error
# url_for will use this result, instead of raising BuildError.
return url | Remove attempt to reraise BuildError in the context of the original traceback
This causes `TypeError: __init__() takes exactly 4 arguments (2 given)` instead of the original `BuildError`. Flask already fixes the traceback, despite what the docs say. | lobeck_flask-bower | train | py |
459bdd00efcaf9839aacb6f5094b33219816a4fa | diff --git a/porespy/__init__.py b/porespy/__init__.py
index <HASH>..<HASH> 100644
--- a/porespy/__init__.py
+++ b/porespy/__init__.py
@@ -79,7 +79,7 @@ Use some filters from PoreSpy:
'''
-__version__ = "1.0.1"
+__version__ = "1.1.0"
from . import tools
from . import filters | Updating version number to <I> | PMEAL_porespy | train | py |
9da9d7cb54eb4e2ea5d1138764f3fd54716628b4 | diff --git a/src/main/java/org/psjava/formula/Decrease.java b/src/main/java/org/psjava/formula/Decrease.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/psjava/formula/Decrease.java
+++ b/src/main/java/org/psjava/formula/Decrease.java
@@ -4,8 +4,8 @@ import org.psjava.ds.numbersystrem.MultipliableNumberSystem;
public class Decrease {
- public static <T> T calc(MultipliableNumberSystem<T> ns, T endKey) {
- return ns.subtract(endKey, ns.getOne());
+ public static <T> T calc(MultipliableNumberSystem<T> ns, T value) {
+ return ns.subtract(value, ns.getOne());
}
} | refactoring - rename | psjava_psjava | train | java |
1bbde5e52a7c698109ad8fd1f0b0d0a09fa72a6c | diff --git a/suite/suite_test.go b/suite/suite_test.go
index <HASH>..<HASH> 100644
--- a/suite/suite_test.go
+++ b/suite/suite_test.go
@@ -580,7 +580,7 @@ func (s *FailfastSuite) TearDownTest() {
func (s *FailfastSuite) Test_A_Fails() {
s.call("Test A Fails")
- s.Require().True(false)
+ s.T().Error("Test A meant to fail")
}
func (s *FailfastSuite) Test_B_Passes() { | Change Require to Error | stretchr_testify | train | go |
19b91a2cc3fea5741e59f3c5dd2a06249ee105ba | diff --git a/www/grid_view/src/module/main.module.js b/www/grid_view/src/module/main.module.js
index <HASH>..<HASH> 100644
--- a/www/grid_view/src/module/main.module.js
+++ b/www/grid_view/src/module/main.module.js
@@ -91,5 +91,5 @@ class State {
}
-angular.module('app', new BuildbotGridView())
-.config(['$stateProvider', 'glMenuServiceProvider', 'bbSettingsServiceProvider', State]);
\ No newline at end of file
+angular.module('grid_view', new BuildbotGridView())
+.config(['$stateProvider', 'glMenuServiceProvider', 'bbSettingsServiceProvider', State]); | www/grid_view: Fix references to the module | buildbot_buildbot | train | js |
c84617f50cb9cd5515f1b0bb156fff16940f7438 | diff --git a/examples/responsive/jcarousel.responsive.js b/examples/responsive/jcarousel.responsive.js
index <HASH>..<HASH> 100644
--- a/examples/responsive/jcarousel.responsive.js
+++ b/examples/responsive/jcarousel.responsive.js
@@ -4,7 +4,8 @@
jcarousel
.on('jcarousel:reload jcarousel:create', function () {
- var width = jcarousel.innerWidth();
+ var carousel = $(this),
+ width = carousel.innerWidth();
if (width >= 600) {
width = width / 3;
@@ -12,7 +13,7 @@
width = width / 2;
}
- jcarousel.jcarousel('items').css('width', width + 'px');
+ carousel.jcarousel('items').css('width', Math.ceil(width) + 'px');
})
.jcarousel({
wrap: 'circular' | Make responsive example work with multiple carousels | jsor_jcarousel | train | js |
88f655b0f53a1e93375a26eccc2435c69267aa2d | diff --git a/lib/build/webpack-config.js b/lib/build/webpack-config.js
index <HASH>..<HASH> 100644
--- a/lib/build/webpack-config.js
+++ b/lib/build/webpack-config.js
@@ -112,6 +112,7 @@ module.exports = function (cfg) {
layouts: appPaths.resolve.src(`layouts`),
pages: appPaths.resolve.src(`pages`),
assets: appPaths.resolve.src(`assets`),
+ plugins: appPaths.resolve.src(`plugins`),
variables: appPaths.resolve.app(`.quasar/variables.styl`),
// CLI using these ones: | feat: Add "plugins" webpack alias | quasarframework_quasar-cli | train | js |
892ccb24dd50d346582705df245a78c5210003db | diff --git a/server/src/test/java/com/orientechnologies/orient/server/network/http/HttpConnectionTest.java b/server/src/test/java/com/orientechnologies/orient/server/network/http/HttpConnectionTest.java
index <HASH>..<HASH> 100755
--- a/server/src/test/java/com/orientechnologies/orient/server/network/http/HttpConnectionTest.java
+++ b/server/src/test/java/com/orientechnologies/orient/server/network/http/HttpConnectionTest.java
@@ -19,7 +19,6 @@ public class HttpConnectionTest extends BaseHttpDatabaseTest {
Assert.assertEquals(get("connect/" + getDatabaseName()).getResponse().getStatusLine().getStatusCode(), 204);
}
-
public void testTooManyConnect() throws Exception {
if (isInDevelopmentMode())
// SKIP IT
@@ -54,18 +53,17 @@ public class HttpConnectionTest extends BaseHttpDatabaseTest {
}
}
- @Test
public void testConnectAutoDisconnectKeepAlive() throws Exception {
setKeepAlive(true);
testConnectAutoDisconnect();
}
- @Test
public void testConnectAutoDisconnectNoKeepAlive() throws Exception {
setKeepAlive(false);
testConnectAutoDisconnect();
}
+
protected void testConnectAutoDisconnect() throws Exception {
if (isInDevelopmentMode())
// SKIP IT | disabled test of http connection limits due to random failure that brought other tests to fail | orientechnologies_orientdb | train | java |
a6120d995c62b1a3209450b2e5eb6327a13b95bc | diff --git a/kytos/utils/napps.py b/kytos/utils/napps.py
index <HASH>..<HASH> 100644
--- a/kytos/utils/napps.py
+++ b/kytos/utils/napps.py
@@ -454,7 +454,7 @@ class NAppsManager:
"""
ignored_extensions = ['.swp', '.pyc', '.napp']
- ignored_dirs = ['__pycache__']
+ ignored_dirs = ['__pycache__', '.git', '.tox']
files = os.listdir()
for filename in files:
if os.path.isfile(filename) and '.' in filename and \ | Fix packaging in upload NApps (#<I>).
NApps upload does not package .tox and .git now. | kytos_kytos-utils | train | py |
48c18ee8d1f0d3c10b391dab9ad4b1ea8490e126 | diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js
index <HASH>..<HASH> 100644
--- a/src/app/services/influxdb/influxdbDatasource.js
+++ b/src/app/services/influxdb/influxdbDatasource.js
@@ -253,7 +253,7 @@ function (angular, _, kbn, InfluxSeries) {
var dashboardClone = angular.copy(dashboard);
var tags = dashboardClone.tags.join(',');
title = dashboardClone.title = title ? title : dashboard.title;
- var ttl = dashboard.loader.save_temp_ttl
+ var ttl = dashboard.loader.save_temp_ttl;
var ttlLength = ttl.substring(0, ttl.length-1);
var ttlTerm = ttl.substring(ttl.length-1, ttl.length).toLowerCase();
var expires = Date.now();
@@ -266,6 +266,7 @@ function (angular, _, kbn, InfluxSeries) {
break;
case "w":
expires += ttlLength * 604800000;
+ break;
default:
throw "Unknown ttl duration format";
} | fixed 2 coding errors noted by travis | grafana_grafana | train | js |
e0e96fd6efc92ef80e4907e56a78e777709b3570 | diff --git a/simpleyapsy/tests/file_getters/test_matching_regex.py b/simpleyapsy/tests/file_getters/test_matching_regex.py
index <HASH>..<HASH> 100644
--- a/simpleyapsy/tests/file_getters/test_matching_regex.py
+++ b/simpleyapsy/tests/file_getters/test_matching_regex.py
@@ -1,5 +1,6 @@
import unittest
import re
+import tempfile
from simpleyapsy.file_getters import MatchingRegexFileGetter
@@ -24,3 +25,13 @@ class TestMatchingRegexFileGetter(unittest.TestCase):
unvalid_name = self.file_getter.plugin_valid(unvalid_name)
self.assertTrue(valid_name)
self.assertFalse(unvalid_name)
+
+ def test_get_plugin_filepaths(self):
+ with tempfile.TempDirectory() as temp_dir:
+ valid = 'plugin_file.py'
+ unvalid = 'unvalid.py'
+ open(valid, 'a').close()
+ open(unvalid, 'a').close()
+ filepaths = self.file_getter.get_plugin_filepaths(temp_dir)
+ self.assertIn(valid, filepaths)
+ self.assertNotIn(unvalid, filepaths) | Added in tests for get plugin filepaths | benhoff_pluginmanager | train | py |
13490ae41929fa4d239c7cf6d417ca416fbd7f8d | diff --git a/tests/PHPUnit/Integration/AutoSuggestAPITest.php b/tests/PHPUnit/Integration/AutoSuggestAPITest.php
index <HASH>..<HASH> 100644
--- a/tests/PHPUnit/Integration/AutoSuggestAPITest.php
+++ b/tests/PHPUnit/Integration/AutoSuggestAPITest.php
@@ -31,7 +31,7 @@ class Test_Piwik_Integration_AutoSuggestAPITest extends IntegrationTestCase
{
// on Travis this test seg faults for no reason eg: https://github.com/piwik/piwik/commit/94d0ce393b2c496cda571571a0425af846406fda
- $isPhp53 = strpos(PHP_VERSION, '5.3') == 0;
+ $isPhp53 = strpos(PHP_VERSION, '5.3') === 0;
if($isPhp53) {
$this->markTestSkipped("Skipping this test as it seg faults on php 5.3 (bug triggered on travis)");
} | Skip test on php <I>
Trying to fix: PHP Fatal error: Call to a member function getCurrency() on a non-object in /home/travis/build/piwik/piwik/plugins/Live/API.php on line <I>
<URL> | matomo-org_matomo | train | php |
5b0884a8867d0fae20d7c6f94a3dff9e8baf667d | diff --git a/src/styles/MuiThemeProvider.js b/src/styles/MuiThemeProvider.js
index <HASH>..<HASH> 100644
--- a/src/styles/MuiThemeProvider.js
+++ b/src/styles/MuiThemeProvider.js
@@ -38,6 +38,7 @@ export const MUI_SHEET_ORDER = [
'ListItem',
'ListItemText',
'ListItemSecondaryAction',
+ 'ListSubheader',
'List',
'Menu', | [theme] Add ListSubheader to the list | mui-org_material-ui | train | js |
03f3ee254c2a1c4ebd91728263b66ff29e8b4f78 | diff --git a/defenses/torch/audio/input_tranformation/resampling.py b/defenses/torch/audio/input_tranformation/resampling.py
index <HASH>..<HASH> 100644
--- a/defenses/torch/audio/input_tranformation/resampling.py
+++ b/defenses/torch/audio/input_tranformation/resampling.py
@@ -1,7 +1,8 @@
import torchaudio
import librosa
-
+# There exist a limitation of this defense that it may lead to the problem of aliasing, and we can use the narrowband sample rate
+# rather than downsampling followed by upsampling.
# resampling reference https://core.ac.uk/download/pdf/228298313.pdf
# resampling input transformation defense for audio | Add limitation of this defence in the comment | tensorflow_cleverhans | train | py |
34cbf4411bafb2abc526467126ad779b54ce9f00 | diff --git a/lib/http/request/writer.rb b/lib/http/request/writer.rb
index <HASH>..<HASH> 100644
--- a/lib/http/request/writer.rb
+++ b/lib/http/request/writer.rb
@@ -36,8 +36,9 @@ module HTTP
# Stream the request to a socket
def stream
- send_request_header
- send_request_body
+ add_headers
+ add_body_type_headers
+ send_request
end
# Send headers needed to connect through proxy
@@ -64,23 +65,24 @@ module HTTP
@request_header.join(CRLF) + (CRLF) * 2
end
- def send_request_header
- add_headers
- add_body_type_headers
+ def send_request
+ headers = join_headers
- write(join_headers)
- end
+ case @body
+ when NilClass
+ write(headers)
+ when String
+ write(headers << @body)
+ when Enumerable
+ write(headers)
- def send_request_body
- if @body.is_a?(String)
- write(@body)
- elsif @body.is_a?(Enumerable)
@body.each do |chunk|
write(chunk.bytesize.to_s(16) << CRLF)
write(chunk << CRLF)
end
write(CHUNKED_END)
+ else fail TypeError, "invalid body type: #{@body.class}"
end
end | Send headers and body in one write if possible
This change tries to avoid a pathological case with Nagle's algorithm where two
small writes that would fit in a single TCP packet are performed in a row
(headers and body).
Instead, it tries to perform a single write if possible. | httprb_http | train | rb |
749d12eecec96bd2bd7c4604a1f4ef36643306ce | diff --git a/sheet.go b/sheet.go
index <HASH>..<HASH> 100644
--- a/sheet.go
+++ b/sheet.go
@@ -195,8 +195,10 @@ func replaceRelationshipsNameSpace(workbookMarshal string) string {
return strings.Replace(workbookMarshal, oldXmlns, newXmlns, -1)
}
-// SetActiveSheet provides function to set default active sheet of XLSX by given
-// index.
+// SetActiveSheet provides function to set default active worksheet of XLSX by
+// given index. Note that active index is different with the index that got by
+// function GetSheetMap, and it should be greater than 0 and less than total
+// worksheet numbers.
func (f *File) SetActiveSheet(index int) {
if index < 1 {
index = 1
@@ -227,7 +229,6 @@ func (f *File) SetActiveSheet(index int) {
}
}
}
- return
}
// GetActiveSheetIndex provides function to get active sheet of XLSX. If not
@@ -385,6 +386,7 @@ func (f *File) DeleteSheet(name string) {
f.SheetCount--
}
}
+ f.SetActiveSheet(len(f.GetSheetMap()))
}
// deleteSheetFromWorkbookRels provides function to remove worksheet | - Fix `DeleteSheet()` make broken file, relate issue #<I>;
- godoc updated | 360EntSecGroup-Skylar_excelize | train | go |
ddca806a4778d51d67ffc9cf1851a097fc3797ec | diff --git a/saucelabs.karma.conf.js b/saucelabs.karma.conf.js
index <HASH>..<HASH> 100644
--- a/saucelabs.karma.conf.js
+++ b/saucelabs.karma.conf.js
@@ -56,6 +56,7 @@ module.exports = (config) => {
'libs/polyfill.js',
'jspdf.js',
'plugins/acroform.js',
+ 'plugins/addimage.js',
'plugins/annotations.js',
'plugins/split_text_to_size.js',
'plugins/standard_fonts_metrics.js',
@@ -63,6 +64,7 @@ module.exports = (config) => {
'plugins/autoprint.js',
'plugins/addhtml.js',
'plugins/viewerpreferences.js',
+ 'plugins/setlanguage.js',
'libs/deflate.js',
'libs/png_support/png.js',
'libs/png_support/zlib.js', | Update saucelabs.karma.conf.js | MrRio_jsPDF | train | js |
2ef9b65d19393a27fae6b325e772adeef76c8a06 | diff --git a/lib/active_scaffold/tableless.rb b/lib/active_scaffold/tableless.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold/tableless.rb
+++ b/lib/active_scaffold/tableless.rb
@@ -1,8 +1,4 @@
class ActiveScaffold::Tableless < ActiveRecord::Base # rubocop:disable Rails/ApplicationRecord
- if Rails.version >= '6.0'
- class_attribute :implicit_order_column, instance_accessor: false
- end
-
class AssociationScope < ActiveRecord::Associations::AssociationScope
INSTANCE = create
def self.scope(association, connection) | remove unneeded line, class attribute is defined as tableless inherits from ActiveRecord::Base | activescaffold_active_scaffold | train | rb |
6f050b31545dc0527853e598b62a623717cdeb17 | diff --git a/command/v7/set_label_command.go b/command/v7/set_label_command.go
index <HASH>..<HASH> 100644
--- a/command/v7/set_label_command.go
+++ b/command/v7/set_label_command.go
@@ -63,7 +63,7 @@ func (cmd SetLabelCommand) Execute(args []string) error {
case "org":
err = cmd.executeOrg(username, labels)
default:
- err = fmt.Errorf("Unsupported resource type of %s", cmd.RequiredArgs.ResourceType)
+ err = fmt.Errorf("Unsupported resource type of '%s'", cmd.RequiredArgs.ResourceType)
}
if err != nil {
diff --git a/command/v7/set_label_command_test.go b/command/v7/set_label_command_test.go
index <HASH>..<HASH> 100644
--- a/command/v7/set_label_command_test.go
+++ b/command/v7/set_label_command_test.go
@@ -350,7 +350,7 @@ var _ = Describe("set-label command", func() {
})
It("errors", func() {
- Expect(executeErr).To(MatchError("Unsupported resource type of unrecognized-resource"))
+ Expect(executeErr).To(MatchError("Unsupported resource type of 'unrecognized-resource'"))
})
}) | Follow CLI style guidelines for error messages. (#<I>)
[Finishes #<I>] | cloudfoundry_cli | train | go,go |
0d0facfcd911d5be16c7753a780222bbf32ead56 | diff --git a/lib/listenFocusOutside.js b/lib/listenFocusOutside.js
index <HASH>..<HASH> 100644
--- a/lib/listenFocusOutside.js
+++ b/lib/listenFocusOutside.js
@@ -5,7 +5,15 @@ import ReactDOM from 'react-dom';
const handlers = [];
-events.addEventListener(document.body, 'focusin', handleNativeFocus);
+function addHandleEvent() {
+ events.addEventListener(document.body, 'focusin', handleNativeFocus);
+}
+
+if (document.readyState === 'complete') {
+ addHandleEvent();
+} else {
+ events.addEventListener(window, 'load', addHandleEvent);
+}
function handleNativeFocus(event: UIEvent) {
const target: HTMLElement = (event.target || event.srcElement: any); | Add focusin event listener only after document load (#<I>) | skbkontur_retail-ui | train | js |
b3040895770c4341a5a1564e1a5b28925e6e8006 | diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/classical.py
+++ b/openquake/calculators/classical.py
@@ -244,8 +244,8 @@ class ClassicalCalculator(base.HazardCalculator):
oq = self.oqparam
N = len(self.sitecol)
trt_sources = self.csm.get_trt_sources(optimize_dupl=True)
- maxweight = min(self.csm.get_maxweight(
- trt_sources, weight, oq.concurrent_tasks), 1E6)
+ maxweight = self.csm.get_maxweight(
+ trt_sources, weight, oq.concurrent_tasks)
maxdist = int(max(oq.maximum_distance.values()))
if oq.task_duration is None: # inferred
# from 1 minute up to 1 day | Removed maxweight limit to 1E6 [skip CI]
Former-commit-id: 1ad<I>f<I>c<I>c<I>ccf<I>db<I>a<I>fa9f1bd | gem_oq-engine | train | py |
6b509881f51c14c83b13fdfd93218c3179e90dbf | diff --git a/src/Klein/ServiceProvider.php b/src/Klein/ServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Klein/ServiceProvider.php
+++ b/src/Klein/ServiceProvider.php
@@ -179,19 +179,22 @@ class ServiceProvider
public function flashes($type = null)
{
$this->startSession();
+
if (!isset($_SESSION['__flashes'])) {
return array();
}
+
if (null === $type) {
$flashes = $_SESSION['__flashes'];
unset($_SESSION['__flashes']);
- } elseif (null !== $type) {
+ } else {
$flashes = array();
if (isset($_SESSION['__flashes'][$type])) {
$flashes = $_SESSION['__flashes'][$type];
unset($_SESSION['__flashes'][$type]);
}
}
+
return $flashes;
}
@@ -282,11 +285,11 @@ class ServiceProvider
$referer = $this->request->server()->get('HTTP_REFERER');
if (null !== $referer) {
- return $this->response->redirect($referer);
+ $this->response->redirect($referer);
+ } else {
+ $this->refresh();
}
- $this->refresh();
-
return $this;
} | Fixing some buggy/unexpected situations | klein_klein.php | train | php |
8750eb7d2bbe226eb7e6e33f1b75deb36e0306ac | diff --git a/tests/LocalizationTest.php b/tests/LocalizationTest.php
index <HASH>..<HASH> 100644
--- a/tests/LocalizationTest.php
+++ b/tests/LocalizationTest.php
@@ -471,6 +471,8 @@ class LocalizationTest extends TestCase
/** @test */
public function it_can_get_localized_url_with_relative_urls()
{
+ $this->assertEquals($this->testUrlOne . 'en', localization()->LocalizeURL('/'));
+
$urls = [
'/contact',
'/contact/', | Adding another assertion (Just in case) | ARCANEDEV_Localization | train | php |
704f292ed2363b6a9beea2869eeb1afc50066c10 | diff --git a/soccer/writers.py b/soccer/writers.py
index <HASH>..<HASH> 100644
--- a/soccer/writers.py
+++ b/soccer/writers.py
@@ -332,8 +332,8 @@ class Json(BaseWriter):
def team_players(self, team):
"""Store output of team players to a JSON file"""
- keys = 'jerseyNumber name position nationality dateOfBirth marketValue'.split()
- data = [{key: player[key] for key in keys} for player in team['players']]
+ keys = 'shirtNumber name position nationality dateOfBirth'.split()
+ data = [{key: player[key] for key in keys} for player in team]
self.generate_output({'players': data})
def league_scores(self, total_data, time): | Fix json team_players | architv_soccer-cli | train | py |
010f4fe51778682c31fa221fb06120a1804a9439 | diff --git a/Admin/ClientAdmin.php b/Admin/ClientAdmin.php
index <HASH>..<HASH> 100644
--- a/Admin/ClientAdmin.php
+++ b/Admin/ClientAdmin.php
@@ -56,14 +56,15 @@ class ClientAdmin extends Admin
->add('allowedGrantTypes', 'sonata_type_native_collection', array('type' => 'choice', 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false
,'options' => array(
'choices' => array(
- OAuth2::GRANT_TYPE_AUTH_CODE => "Authorization Code Grant Flow"
- , OAuth2::GRANT_TYPE_IMPLICIT => "Implicit Grant Flow"
- , OAuth2::GRANT_TYPE_USER_CREDENTIALS => "Resource Owner Password Credentials Grant Flow"
- , OAuth2::GRANT_TYPE_CLIENT_CREDENTIALS => "Client Credentials Grant Flow"
- )
+ OAuth2::GRANT_TYPE_AUTH_CODE => "Authorization Code Grant Flow",
+ OAuth2::GRANT_TYPE_IMPLICIT => "Implicit Grant Flow",
+ OAuth2::GRANT_TYPE_USER_CREDENTIALS => "Resource Owner Password Credentials Grant Flow",
+ OAuth2::GRANT_TYPE_CLIENT_CREDENTIALS => "Client Credentials Grant Flow",
+ OAuth2::GRANT_TYPE_REFRESH_TOKEN => "Refresh Token"
)
)
- );
+ )
+ );
}
/** | refresh_token grant type support on admin. | webwarejp_OpenppOAuthServerBundle | train | php |
bfb93a192814eedc1e29b3ee95f21dc3dc1dfcd0 | diff --git a/pkg/cloudprovider/openstack/openstack.go b/pkg/cloudprovider/openstack/openstack.go
index <HASH>..<HASH> 100644
--- a/pkg/cloudprovider/openstack/openstack.go
+++ b/pkg/cloudprovider/openstack/openstack.go
@@ -314,7 +314,11 @@ func (i *Instances) IPAddress(name string) (net.IP, error) {
// ExternalID returns the cloud provider ID of the specified instance.
func (i *Instances) ExternalID(name string) (string, error) {
- return "", fmt.Errorf("unimplemented")
+ srv, err := getServerByName(i.compute, name)
+ if err != nil {
+ return "", err
+ }
+ return srv.ID, nil
}
func (i *Instances) GetNodeResources(name string) (*api.NodeResources, error) { | openstack: report the nodes external id | kubernetes_kubernetes | train | go |
8fd084634d4873851c13c6eae37b0619a4213e64 | diff --git a/spec/unit/interface/face_collection_spec.rb b/spec/unit/interface/face_collection_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/interface/face_collection_spec.rb
+++ b/spec/unit/interface/face_collection_spec.rb
@@ -11,12 +11,12 @@ describe Puppet::Interface::FaceCollection do
# the 'subject' of the specs will differ.
before :all do
# Save FaceCollection's global state
- faces = subject.instance_variable_get(:@faces)
+ faces = described_class.instance_variable_get(:@faces)
@faces = faces.dup
faces.each do |k, v|
@faces[k] = v.dup
end
- @faces_loaded = subject.instance_variable_get(:@loaded)
+ @faces_loaded = described_class.instance_variable_get(:@loaded)
# Save the already required face files
@required = [] | (maint) Replace invocations of `subject` and `let` in `before(:all)` | puppetlabs_puppet | train | rb |
421df3a5e0d8d9b7fec909fdfe7f01551f6a335e | diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/jenkins/model/Jenkins.java
+++ b/core/src/main/java/jenkins/model/Jenkins.java
@@ -3070,7 +3070,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
public ContextMenu doContextMenu(StaplerRequest request, StaplerResponse response) throws IOException, JellyException {
ContextMenu menu = new ContextMenu().from(this, request, response);
for (MenuItem i : menu.items) {
- if (i.url.equals("/manage")) {
+ if (i.url.equals(request.getContextPath() + "/manage")) {
// add "Manage Jenkins" subitems
i.subMenu = new ContextMenu().from(this, request, response, "manage");
} | Url with contextPath for non-standalone installs. | jenkinsci_jenkins | train | java |
ca4b5ac4191344933e9fb7a78f953cf172d36272 | diff --git a/test_tube/argparse_hopt.py b/test_tube/argparse_hopt.py
index <HASH>..<HASH> 100644
--- a/test_tube/argparse_hopt.py
+++ b/test_tube/argparse_hopt.py
@@ -207,12 +207,7 @@ class HyperOptArgumentParser(ArgumentParser):
def arg_dict(self):
args = vars(self)
- non_fx_args = {}
- for k, v in args:
- if type(v) is function:
- non_fx_args[k] = v
-
- return args
+ return args['parsed_args']
def parse_args(self, args=None, namespace=None): | added fx to parse args without functions | williamFalcon_test-tube | train | py |
aaaed19a99800a1cb5c476d6d99654fadf432ab0 | diff --git a/grails-plugin-converters/src/main/groovy/org/grails/web/converters/marshaller/json/GenericJavaBeanMarshaller.java b/grails-plugin-converters/src/main/groovy/org/grails/web/converters/marshaller/json/GenericJavaBeanMarshaller.java
index <HASH>..<HASH> 100644
--- a/grails-plugin-converters/src/main/groovy/org/grails/web/converters/marshaller/json/GenericJavaBeanMarshaller.java
+++ b/grails-plugin-converters/src/main/groovy/org/grails/web/converters/marshaller/json/GenericJavaBeanMarshaller.java
@@ -55,6 +55,9 @@ public class GenericJavaBeanMarshaller extends IncludeExcludePropertyMarshaller<
for (PropertyDescriptor property : BeanUtils.getPropertyDescriptors(o.getClass())) {
String name = property.getName();
Method readMethod = property.getReadMethod();
+
+ if(!shouldInclude(includeExcludeSupport, includes, excludes, o, name)) continue;
+
if (readMethod != null && !(name.equals("metaClass"))&& !(name.equals("class"))) {
if(readMethod.getAnnotation(PersistenceMethod.class) != null) continue;
if(readMethod.getAnnotation(ControllerMethod.class) != null) continue; | Fix GenericJavaBeanMarshaller includes/excludes for methods | grails_grails-core | train | java |
3d8a1ec3fc21541e6840eafe0bc1f245c3250a96 | diff --git a/plugins/commands/login/plugin.rb b/plugins/commands/login/plugin.rb
index <HASH>..<HASH> 100644
--- a/plugins/commands/login/plugin.rb
+++ b/plugins/commands/login/plugin.rb
@@ -12,9 +12,9 @@ module VagrantPlugins
DESC
command(:login) do
- require_relative "login"
+ require_relative "command"
init!
- Push
+ Command
end
action_hook(:cloud_authenticated_boxes, :authenticate_box_url) do |hook| | Fix some rename shit | hashicorp_vagrant | train | rb |
a5628b12f63a4f639cb33b1d58154a5b6fc857f7 | diff --git a/src/rez/util.py b/src/rez/util.py
index <HASH>..<HASH> 100644
--- a/src/rez/util.py
+++ b/src/rez/util.py
@@ -686,7 +686,7 @@ def convert_old_commands(commands, annotate=True):
if idx in (0, len(parts) - 1):
func = "appendenv" if idx == 0 else "prependenv"
parts = parts[1:] if idx == 0 else parts[:-1]
- val = os.pathsep.join(parts)
+ val = separator.join(parts)
val = convert_old_environment_variable_references(val)
loc.append("%s('%s', '%s')" % (func, var, _en(val)))
continue | + Remove incorrect use of os.pathsep. | nerdvegas_rez | train | py |
f77a8c6790858d20e05f1917a238515f4dfc8bad | diff --git a/js/src/forum/addComposerAutocomplete.js b/js/src/forum/addComposerAutocomplete.js
index <HASH>..<HASH> 100644
--- a/js/src/forum/addComposerAutocomplete.js
+++ b/js/src/forum/addComposerAutocomplete.js
@@ -153,9 +153,9 @@ export default function addComposerAutocomplete() {
const height = dropdown.$().outerHeight();
const parent = dropdown.$().offsetParent();
let left = coordinates.left;
- let top = coordinates.top + 15;
+ let top = coordinates.top - this.scrollTop + 15;
if (top + height > parent.height()) {
- top = coordinates.top - height - 15;
+ top = coordinates.top - this.scrollTop - height - 15;
}
if (left + width > parent.width()) {
left = parent.width() - width; | Fix positioning of mention dropdown
Previously, the positioning logic did not account for the case
when the textarea was already scrolled down a bit, thus often
rendering the dropdown off-screen.
Fixes flarum/core#<I>. | flarum_mentions | train | js |
fe0ef13b852c1ea83f9c57d8c888a9a77377e4f0 | diff --git a/examples/python-embed-with-custom-prompt.py b/examples/python-embed-with-custom-prompt.py
index <HASH>..<HASH> 100755
--- a/examples/python-embed-with-custom-prompt.py
+++ b/examples/python-embed-with-custom-prompt.py
@@ -3,7 +3,6 @@
Example of embedding a Python REPL, and setting a custom prompt.
"""
from prompt_toolkit.formatted_text import HTML
-from pygments.token import Token
from ptpython.prompt_style import PromptStyle
from ptpython.repl import embed | Removed unused import in example. | prompt-toolkit_ptpython | train | py |
07a08278f6c62cdc215e112d2b7dc3278b1965f9 | diff --git a/gulpfile.babel.js b/gulpfile.babel.js
index <HASH>..<HASH> 100755
--- a/gulpfile.babel.js
+++ b/gulpfile.babel.js
@@ -379,6 +379,8 @@ function eslintTargets() {
'gulpfile.babel.js',
'docs/packages/**/*.js',
'core/src/**/*.js',
+ '!core/src/polyfills/**/*.js',
+ '!core/src/vendor/**/*.js',
'bindings/angular1/js/**/*.js',
'bindings/angular1/directives/**/*.js',
'bindings/angular1/services/**/*.js', | chore(sling): Ignore third-party modules. | OnsenUI_OnsenUI | train | js |
9eac548e357d342214fdae28034dcaa1c3b37799 | diff --git a/app/models/graph_starter/asset.rb b/app/models/graph_starter/asset.rb
index <HASH>..<HASH> 100644
--- a/app/models/graph_starter/asset.rb
+++ b/app/models/graph_starter/asset.rb
@@ -268,7 +268,9 @@ module GraphStarter
id: id,
title: title,
name: title,
- model_slug: self.class.model_slug
+ model_slug: self.class.model_slug,
+ summary: summary,
+ image_urls: @asset.reload.image_array.map(&:source_url)
}.tap do |result|
result[:images] = images.map {|image| image.source.url } if self.class.has_images?
result[:image] = image.source_url if self.class.has_image? && image | Add summary and image_urls to as_json | neo4j-examples_graph_starter | train | rb |
a6b5a2662eeefb2063c09e39baf4104828f3d589 | diff --git a/compiler/natives/runtime/pprof/pprof.go b/compiler/natives/runtime/pprof/pprof.go
index <HASH>..<HASH> 100644
--- a/compiler/natives/runtime/pprof/pprof.go
+++ b/compiler/natives/runtime/pprof/pprof.go
@@ -33,6 +33,3 @@ func WriteHeapProfile(w io.Writer) error {
func Lookup(name string) *Profile {
return nil
}
-
-func StartTrace(w io.Writer) error { return nil }
-func StopTrace() {}
diff --git a/compiler/natives/runtime/runtime.go b/compiler/natives/runtime/runtime.go
index <HASH>..<HASH> 100644
--- a/compiler/natives/runtime/runtime.go
+++ b/compiler/natives/runtime/runtime.go
@@ -170,3 +170,7 @@ func UnlockOSThread() {}
func Version() string {
return theVersion
}
+
+func StartTrace() error { return nil }
+func StopTrace() {}
+func ReadTrace() []byte | go<I>: trace functions moved to runtime package (#<I>) | gopherjs_gopherjs | train | go,go |
a22f118dbb143398c04af43faa5adbfd4a26f7a7 | diff --git a/dottie.js b/dottie.js
index <HASH>..<HASH> 100644
--- a/dottie.js
+++ b/dottie.js
@@ -3,18 +3,23 @@
// Object cloning function, uses jQuery/Underscore/Object.create depending on what's available
- var clone = function (object) {
- if (typeof Object.create !== 'undefined') {
- return Object.create(object);
- }
- if (typeof jQuery !== 'undefined') {
- return jQuery.extend({}, object);
- }
- if (typeof _ !== 'undefined') {
- return _.extend({}, object);
- }
-
- };
+ var clone = function (object) {
+ if (typeof Object.hasOwnProperty !== 'undefined') {
+ var target = {};
+ for (var i in object) {
+ if (object.hasOwnProperty(i)) {
+ target[i] = object[i];
+ }
+ }
+ return target;
+ }
+ if (typeof jQuery !== 'undefined') {
+ return jQuery.extend({}, object);
+ }
+ if (typeof _ !== 'undefined') {
+ return _.extend({}, object);
+ }
+ };
// Weird IE shit, objects do not have hasOwn, but the prototype does...
var hasOwnProp = Object.prototype.hasOwnProperty; | Object.create would utilize a prototype, this is good if we had one, but sometimes an object is just a... well object. | mickhansen_dottie.js | train | js |
6f8f652086bdb03c2a8baea0b9fb8c0b29afa7a9 | diff --git a/lib/util/simple-hint.js b/lib/util/simple-hint.js
index <HASH>..<HASH> 100644
--- a/lib/util/simple-hint.js
+++ b/lib/util/simple-hint.js
@@ -25,7 +25,10 @@
editor.replaceRange(str, result.from, result.to);
}
// When there is only one completion, use it directly.
- if (completions.length == 1) {insert(completions[0]); return true;}
+ if (options.completeSingle && completions.length == 1) {
+ insert(completions[0]);
+ return true;
+ }
// Build the select widget
var complete = document.createElement("div");
@@ -92,6 +95,7 @@
};
CodeMirror.simpleHint.defaults = {
closeOnBackspace: true,
- closeOnTokenChange: false
+ closeOnTokenChange: false,
+ completeSingle: true
};
})(); | [simplehint util] Support completeSingle option
To turn off the behavior where it'll always complete when only
a single option is left. | codemirror_CodeMirror | train | js |
2d1a80aa820e0c60ed4ca96be376423fd00d7ccb | diff --git a/rules/manager.go b/rules/manager.go
index <HASH>..<HASH> 100644
--- a/rules/manager.go
+++ b/rules/manager.go
@@ -65,7 +65,7 @@ type Metrics struct {
groupRules *prometheus.GaugeVec
}
-// NewGroupMetrics makes a new Metrics and registers them with the provided registerer,
+// NewGroupMetrics creates a new instance of Metrics and registers it with the provided registerer,
// if not nil.
func NewGroupMetrics(reg prometheus.Registerer) *Metrics {
m := &Metrics{ | rules: manager: clarify doc string for NewGroupMetrics (#<I>)
* rules: manager: clarify doc string for NewGroupMetrics | prometheus_prometheus | train | go |
98281b49ca3d19df75f3dfe908e0ce4496164349 | diff --git a/core/DataTable/Manager.php b/core/DataTable/Manager.php
index <HASH>..<HASH> 100644
--- a/core/DataTable/Manager.php
+++ b/core/DataTable/Manager.php
@@ -46,7 +46,7 @@ class Piwik_DataTable_Manager
* Id of the next inserted table id in the Manager
* @var int
*/
- protected $nextTableId = 0;
+ protected $nextTableId = 1;
/**
* Add a DataTable to the registry
@@ -104,7 +104,7 @@ class Piwik_DataTable_Manager
if($deleteWhenIdTableGreaterThan == 0)
{
$this->tables = array();
- $this->nextTableId = 0;
+ $this->nextTableId = 1;
}
} | Refs #<I> the "hack" in DataTable_Row to set tables loaded in memory with a negative ID implies that the table IDs are != 0 --- thanks Julien for the review and good catch
git-svn-id: <URL> | matomo-org_matomo | train | php |
e45c865056f0329c3b8b72d92819adeda25c76d0 | diff --git a/tensorboard/plugins/core/core_plugin.py b/tensorboard/plugins/core/core_plugin.py
index <HASH>..<HASH> 100644
--- a/tensorboard/plugins/core/core_plugin.py
+++ b/tensorboard/plugins/core/core_plugin.py
@@ -641,3 +641,4 @@ def _nonnegative_float(v):
raise argparse.ArgumentTypeError("invalid float: %r" % v)
if not (v >= 0): # no NaNs, please
raise argparse.ArgumentTypeError("must be non-negative: %r" % v)
+ return v | core: fix reload interval parsing (#<I>)
Summary:
Fixes an error in #<I>. Not sure how this slipped my testing; perhaps
I committed incorrectly.
Test Plan:
Follow the test plan from #<I>, and double-check that data actually
loads in the UI.
wchargin-branch: fix-reload-interval | tensorflow_tensorboard | train | py |
0498d33f48339a6b5bc18a2b16cf70aee7510d44 | diff --git a/lib/Elastica/ResultSet.php b/lib/Elastica/ResultSet.php
index <HASH>..<HASH> 100755
--- a/lib/Elastica/ResultSet.php
+++ b/lib/Elastica/ResultSet.php
@@ -97,14 +97,14 @@ class Elastica_ResultSet implements Iterator, Countable {
}
/**
- * Returns the total number of ms for this search to complete
- *
- * @return int Total time
- */
- public function getTotalTime() {
- return (int) $this->_totalHits;
- }
-
+ * Returns the total number of ms for this search to complete
+ *
+ * @return int Total time
+ */
+ public function getTotalTime() {
+ return (int) $this->_took;
+ }
+
/**
* Returns response object
* | fixes Elastica_ResultSet->getTotalTime() and indentation | ruflin_Elastica | train | php |
963d7e4623735a7cf02e57d85dc3e042bcf502c1 | diff --git a/omaha/omaha_test.go b/omaha/omaha_test.go
index <HASH>..<HASH> 100644
--- a/omaha/omaha_test.go
+++ b/omaha/omaha_test.go
@@ -36,7 +36,7 @@ func TestOmahaRequestUpdateCheck(t *testing.T) {
t.Error("Expected a Previous Boot Id")
}
- if v.Apps[0].Oem != "ec3000" {
+ if v.Apps[0].OEM != "ec3000" {
t.Error("Expected an OEM")
} | fix(omaha): fixup Oem test after change
I forgot to run the tests after making the change to OEM. Fix. | coreos_go-omaha | train | go |
3c081b60952616cb5fad858badabd5f33804db99 | diff --git a/law/decorator.py b/law/decorator.py
index <HASH>..<HASH> 100644
--- a/law/decorator.py
+++ b/law/decorator.py
@@ -122,9 +122,9 @@ def log(fn, opts, task, *args, **kwargs):
sys.stderr = tee
try:
ret = fn(task, *args, **kwargs)
- except Exception as e:
+ except:
traceback.print_exc(file=tee)
- raise e
+ raise
finally:
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__ | Fix re-raising in log decorator. | riga_law | train | py |
24d86fe61069c3a56d33a6db45fc8981bf767492 | diff --git a/js/coinbasepro.js b/js/coinbasepro.js
index <HASH>..<HASH> 100644
--- a/js/coinbasepro.js
+++ b/js/coinbasepro.js
@@ -869,18 +869,22 @@ module.exports = class coinbasepro extends Exchange {
const updated = this.parse8601 (this.safeString (transaction, 'processed_at'));
const currencyId = this.safeString (transaction, 'currency');
const code = this.safeCurrencyCode (currencyId, currency);
- let fee = undefined;
const status = this.parseTransactionStatus (transaction);
const amount = this.safeFloat (transaction, 'amount');
let type = this.safeString (transaction, 'type');
let address = this.safeString (details, 'crypto_address');
const tag = this.safeString (details, 'destination_tag');
address = this.safeString (transaction, 'crypto_address', address);
+ let fee = undefined;
if (type === 'withdraw') {
type = 'withdrawal';
address = this.safeString (details, 'sent_to_address', address);
- if (typeof details.fee === 'string') {
- fee = this.safeFloat (details, 'fee');
+ const feeCost = this.safeFloat (details, 'fee');
+ if (feeCost !== undefined) {
+ fee = {
+ 'cost': feeCost,
+ 'code': code,
+ };
}
}
return { | coinbasepro parseTransaction withdrawal fee | ccxt_ccxt | train | js |
1d69423f7bc93f7df3be23986fe48a652a1f2e8b | diff --git a/core/src/main/java/org/bitcoinj/core/PeerGroup.java b/core/src/main/java/org/bitcoinj/core/PeerGroup.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/bitcoinj/core/PeerGroup.java
+++ b/core/src/main/java/org/bitcoinj/core/PeerGroup.java
@@ -1524,6 +1524,8 @@ public class PeerGroup implements TransactionBroadcaster {
private long[] samples;
private int cursor;
+ private boolean syncDone;
+
@Override
public synchronized void onBlocksDownloaded(Peer peer, Block block, @Nullable FilteredBlock filteredBlock, int blocksLeft) {
blocksInLastSecond++;
@@ -1572,8 +1574,10 @@ public class PeerGroup implements TransactionBroadcaster {
warmupSeconds = 15;
}
- boolean inChainSync = chain != null && chain.getBestChainHeight() < getMostCommonChainHeight();
- if (inChainSync) {
+ boolean behindPeers = chain != null && chain.getBestChainHeight() < getMostCommonChainHeight();
+ if (!behindPeers)
+ syncDone = true;
+ if (!syncDone) {
if (warmupSeconds < 0) {
// Calculate the moving average.
samples[cursor++] = bytesInLastSecond; | PeerGroup: stop calculating speed stats and printing them once we chain sync has finished in a session. | bitcoinj_bitcoinj | train | java |
1501c7fcf90fcf3d9795ec2a3619d18bc46e0ac4 | diff --git a/src/libs/StatisticsHelper.php b/src/libs/StatisticsHelper.php
index <HASH>..<HASH> 100644
--- a/src/libs/StatisticsHelper.php
+++ b/src/libs/StatisticsHelper.php
@@ -97,7 +97,7 @@ class StatisticsHelper
*/
public static function getClassForKey($key, App $app)
{
- $className = '\\app\\statistics\\metrics\\' . Inflector::camelize($key);
+ $className = '\\app\\statistics\\metrics\\' . Inflector::camelize($key) . 'Metric';
if (class_exists($className))
return new $className($app); | add Metric suffix when looking up by key | infusephp_statistics | train | php |
77f8ea23d08f1cfbbd4be74b7b39c94d42f83267 | diff --git a/view/frontend/web/js/view/payment/method-renderer/applepay.js b/view/frontend/web/js/view/payment/method-renderer/applepay.js
index <HASH>..<HASH> 100755
--- a/view/frontend/web/js/view/payment/method-renderer/applepay.js
+++ b/view/frontend/web/js/view/payment/method-renderer/applepay.js
@@ -207,7 +207,7 @@ define(
addressLines: shippingAddress.street,
postalCode: shippingAddress.postcode,
locality: shippingAddress.city,
- countryCode: billingAddress.countryId
+ countryCode: shippingAddress.countryId
},
total: {
label: ap['storeName'], | Apple Pay shipping country id
Fixed incorrect shipping country id reference. | checkout_checkout-magento2-plugin | train | js |
7f9ab799541fb4d9ba46c3f43d5f22e44a75c88c | diff --git a/prom2json.go b/prom2json.go
index <HASH>..<HASH> 100644
--- a/prom2json.go
+++ b/prom2json.go
@@ -184,6 +184,7 @@ func ParseResponse(resp *http.Response, ch chan<- *dto.MetricFamily) error {
if err == nil && mediatype == "application/vnd.google.protobuf" &&
params["encoding"] == "delimited" &&
params["proto"] == "io.prometheus.client.MetricFamily" {
+ defer close(ch)
for {
mf := &dto.MetricFamily{}
if _, err = pbutil.ReadDelimited(resp.Body, mf); err != nil { | Close channel also when parsing protobuf | prometheus_prom2json | train | go |
059899565271a45da991dc873f2b3d39cb0f7950 | diff --git a/lib/compiler.js b/lib/compiler.js
index <HASH>..<HASH> 100644
--- a/lib/compiler.js
+++ b/lib/compiler.js
@@ -1,10 +1,6 @@
var hasOwn = Object.prototype.hasOwnProperty;
var assert = require("assert");
-var types = require("ast-types/fork")([
- require("ast-types/def/esprima"),
- require("ast-types/def/babel6-core")
-]);
-
+var types = require("ast-types");
var n = types.namedTypes;
var b = types.builders;
var MagicString = require("magic-string/dist/magic-string.cjs.js"); | Revert ast-types/fork changes to reinstate JSX types.
Fixes #5. | benjamn_reify | train | js |
2e40560356273b29d6ab4805cda1fc10bdd33ab6 | diff --git a/src/lib/mode_handler.js b/src/lib/mode_handler.js
index <HASH>..<HASH> 100644
--- a/src/lib/mode_handler.js
+++ b/src/lib/mode_handler.js
@@ -20,11 +20,6 @@ var ModeHandler = function(mode, DrawContext) {
fn: fn
});
},
- off: function(event, selector, fn) {
- handlers[event] = handlers[event].filter(handler => {
- return handler.selector !== selector || handler.fn !== fn;
- });
- },
render: function(id) {
DrawContext.store.featureChanged(id);
} | mode_handler.off is never used, lets drop it | mapbox_mapbox-gl-draw | train | js |
754c9c5e2df017525b112674c3e16d394689e5cf | diff --git a/app/modules/mobilizations/blocks/components/block-color-picker.js b/app/modules/mobilizations/blocks/components/block-color-picker.js
index <HASH>..<HASH> 100644
--- a/app/modules/mobilizations/blocks/components/block-color-picker.js
+++ b/app/modules/mobilizations/blocks/components/block-color-picker.js
@@ -1,7 +1,7 @@
import React, { PropTypes } from 'react'
import ReactS3Uploader from 'react-s3-uploader'
-import { ColorPicker } from '../../../../scripts/components'
+import { ColorPicker, Progress } from '../../../../scripts/components'
import { actions as BlockActions } from '../../../mobilizations/blocks'
const BlockColorPicker = ({ state, props, onChange }) => {
@@ -10,7 +10,7 @@ const BlockColorPicker = ({ state, props, onChange }) => {
return (
<div>
- <div className="absolute col-12 top-0 bg-darken-4 z5" style={{ left: '80px' }}>
+ <div className="absolute col-12 top-0 bg-darken-4 z5" style={{ left: '0px' }}>
<div className="col-7">
<ColorPicker
{...props} | Fix upload background block. Fixes #<I> | nossas_bonde-client | train | js |
9d38d72a80ae82652b7db7e2248d04c6799903a9 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -5040,6 +5040,14 @@ const devices = [
ota: ota.ledvance,
},
{
+ zigbeeModel: ['PAR16 RGBW Value'],
+ model: 'AC08560',
+ vendor: 'LEDVANCE',
+ description: 'SMART+ spot GU10 multicolor RGBW',
+ extend: preset.ledvance.light_onoff_brightness_colortemp_color(),
+ ota: ota.ledvance,
+ },
+ {
zigbeeModel: ['B40 TW Z3'],
model: '4058075208414',
vendor: 'LEDVANCE', | Added new device "LEDVANCE AC<I>" (#<I>)
* Added new device "LEDVANCE AC<I>"
* Update devices.js
* Update devices.js | Koenkk_zigbee-shepherd-converters | train | js |
65a9f1d186bb848ae971e0a9b0304589e53d8662 | diff --git a/Item/MenuItem.php b/Item/MenuItem.php
index <HASH>..<HASH> 100644
--- a/Item/MenuItem.php
+++ b/Item/MenuItem.php
@@ -91,7 +91,7 @@ class MenuItem implements ContainerAwareInterface
/**
* @var boolean
*/
- protected $visibleIfDisabled = true;
+ protected $visibleIfDisabled = false;
/**
* @var string | BC break: default disabled visibility is now false | vworldat_MenuBundle | train | php |
9d3bcb9dcc68e1869dc1e3538687c44be2e28ee2 | diff --git a/pylib/aeon/utils/__init__.py b/pylib/aeon/utils/__init__.py
index <HASH>..<HASH> 100644
--- a/pylib/aeon/utils/__init__.py
+++ b/pylib/aeon/utils/__init__.py
@@ -58,7 +58,7 @@ def get_device(target=None, user='admin', passwd='admin', nos_only=False):
raise TargetError('Unable to determine device type for %s' % target)
except pxssh.ExceptionPxssh as e:
- raise TargetError("Error logging in: %s" % e)
+ raise TargetError("Error logging in to {target} : {error}".format(target=target, error=e))
finally:
session.close()
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ packages = find_packages(libdir)
setup(
name="aeon-venos",
- version="0.9.2",
+ version="0.9.4",
author="Jeremy Schulman",
url='https://github.com/Apstra/aeon-venos',
author_email="jeremy@apstra.com", | Added IP address to target error exception | Apstra_aeon-venos | train | py,py |
8b8a40f9c10d67526e34c955762a338c198ca99c | diff --git a/trakt/interfaces/base/__init__.py b/trakt/interfaces/base/__init__.py
index <HASH>..<HASH> 100644
--- a/trakt/interfaces/base/__init__.py
+++ b/trakt/interfaces/base/__init__.py
@@ -59,7 +59,7 @@ class Interface(object):
if response is None:
return None
- if response.headers['content-type'] == 'application/json':
+ if response.headers['content-type'].startswith('application/json'):
# Try parse json response
try:
data = response.json() | Allow for charset definitions in "Content-Type" response header | fuzeman_trakt.py | train | py |
3269a7f8499803a2ccfefe25b4b5c081da4e65f8 | diff --git a/lib/transports/polling-xhr.js b/lib/transports/polling-xhr.js
index <HASH>..<HASH> 100644
--- a/lib/transports/polling-xhr.js
+++ b/lib/transports/polling-xhr.js
@@ -3,9 +3,15 @@
*/
var Polling = require('./polling')
- , EventEmitter = require('../event-emitter')
, util = require('../util')
- , debug = require('debug')('engine.io-client:polling-xhr');
+ , debug = require('debug')('engine.io-client:polling-xhr')
+ , Emitter;
+
+try {
+ Emitter = require('emitter');
+} catch(e){
+ Emitter = require('emitter-component');
+}
/**
* Module exports.
@@ -129,10 +135,10 @@ function Request(opts){
}
/**
- * Inherits from Polling.
+ * Mix in `Emitter`.
*/
-util.inherits(Request, EventEmitter);
+Emitter(Request.prototype);
/**
* Creates the XHR object and sends the request. | polling-xhr: implemented emitter component | socketio_engine.io-client | train | js |
baa5a8af1591ef3c8aa5d5cb1540bceb4a550b6e | diff --git a/stats/thresholds.go b/stats/thresholds.go
index <HASH>..<HASH> 100644
--- a/stats/thresholds.go
+++ b/stats/thresholds.go
@@ -228,9 +228,12 @@ func MarshalJSONWithoutHTMLEscape(t interface{}) ([]byte, error) {
encoder.SetEscapeHTML(false)
err := encoder.Encode(t)
bytes := buffer.Bytes()
- // Remove the newline appended by Encode() :-/
- // See https://github.com/golang/go/issues/37083
- return bytes[:len(bytes)-1], err
+ if err == nil && len(bytes) > 0 {
+ // Remove the newline appended by Encode() :-/
+ // See https://github.com/golang/go/issues/37083
+ bytes = bytes[:len(bytes)-1]
+ }
+ return bytes, err
}
var _ json.Unmarshaler = &Thresholds{} | Safer newline stripping when marshalling to JSON
This avoids a potential `slice bounds out of range` panic. | loadimpact_k6 | train | go |
bf880d2eda68934b9f15eeecd2f5962d40c6ef76 | diff --git a/src/app/readers/fasta.py b/src/app/readers/fasta.py
index <HASH>..<HASH> 100644
--- a/src/app/readers/fasta.py
+++ b/src/app/readers/fasta.py
@@ -27,6 +27,8 @@ def parse_biomart_fn(martfn, ensg_id, ensp_id, desc_id, symb_id, alt_symb_id):
symb = header.index(alt_symb_id)
for line in fp:
line = line.strip('\n').split('\t')
+ if line == ['']:
+ continue
protein = line[ensp]
if not protein:
continue | Empty lines in biomart tables are skipped | glormph_msstitch | train | py |
0743a5e046b7251843003ba8e762ccbcc0059406 | diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider/zone/solaris.rb
+++ b/lib/puppet/provider/zone/solaris.rb
@@ -263,7 +263,10 @@ Puppet::Type.type(:zone).provide(:solaris) do
unless Puppet::FileSystem.exist?(sysidcfg)
begin
- File.open(sysidcfg, "w", 0600) do |f|
+ # For compatibility reasons use System encoding for this OS file
+ # the manifest string is UTF-8 so this could result in conversion errors
+ # which should propagate to users
+ Puppet::FileSystem.open(sysidcfg, 0600, "w:#{Encoding.default_external.name}") do |f|
f.puts cfg
end
rescue => detail | (PUP-<I>) Explicit encoding for Solaris zones
- Continue to use the same encoding, just make it explicit
- Note that if there is a failure to convert a UTF-8 value obtained
from the sysidcfg attribute in a manifest to the system encoding
an UndefinedConversionError may be raised here.
That is acceptable behavior | puppetlabs_puppet | train | rb |
37c3f7109ddf56bd7bd8f1fa0b06a6b0c835f815 | diff --git a/src/js/listeners.js b/src/js/listeners.js
index <HASH>..<HASH> 100644
--- a/src/js/listeners.js
+++ b/src/js/listeners.js
@@ -317,7 +317,7 @@ class Listeners {
// Check for audio tracks on load
// We can't use `loadedmetadata` as it doesn't seem to have audio tracks at that point
- on.call(player, player.media, 'canplay', () => {
+ on.call(player, player.media, 'canplay loadeddata', () => {
toggleHidden(elements.volume, !player.hasAudio);
toggleHidden(elements.buttons.mute, !player.hasAudio);
}); | Additional listener for checking for audio tracks | sampotts_plyr | train | js |
4467c34cb794f0d8b92241d483ec8ac4245e72ad | diff --git a/javascript/web/TermDetails.js b/javascript/web/TermDetails.js
index <HASH>..<HASH> 100644
--- a/javascript/web/TermDetails.js
+++ b/javascript/web/TermDetails.js
@@ -235,7 +235,7 @@ function TermDetailsInit(){
// Two sticky filters.
gps.add_query_filter('document_category', 'annotation', ['*']);
gps.add_query_filter(default_closure_relation_set + '_closure',
- global_acc, ['*']);
+ global_acc);
//gps.add_query_filter('annotation_class', global_acc, ['*']);
// TODO: And or this in as well.
//gps.add_query_filter('annotation_class', global_acc, ['*']); | make relation filter non-sticky; work on #<I> | geneontology_amigo | train | js |
d859ad49522e6e1e74ff7ed70e45714caa2faa66 | diff --git a/lib/unexpected-sinon.js b/lib/unexpected-sinon.js
index <HASH>..<HASH> 100644
--- a/lib/unexpected-sinon.js
+++ b/lib/unexpected-sinon.js
@@ -143,17 +143,18 @@
prefix: function (output, value) {
return output.jsFunctionName(value.proxy.displayName).text('(');
},
- suffix: function (output) {
- return output.text(')');
+ suffix: function (output, value) {
+ output.text(')');
+ if (value.getStackFrames) {
+ var topStackFrame = makePathsRelativeToCwdOrLocation(value.getStackFrames()[0].replace(/^\s*(?:at\s+|@)?/, ''));
+ output.sp().gray('at ' + topStackFrame);
+ }
+ return output;
},
inspect: function (value, depth, output, inspect) {
this.prefix(output, value);
output.append(inspect(toSpyArguments(value.args), depth + 1));
this.suffix(output, value);
- if (value.getStackFrames) {
- var topStackFrame = makePathsRelativeToCwdOrLocation(value.getStackFrames()[0].replace(/^\s*(?:at\s+|@)?/, ''));
- output.sp().gray('at ' + topStackFrame);
- }
},
equal: function (actual, expected, equal) {
return equal(actual.args, expected.args); | spyCall: Inspect the top stack frame as part of the suffix so it also comes out when a spy call is rendered with an inline diff. | unexpectedjs_unexpected-sinon | train | js |
7a23a7a3b3e027f92b32d194982abf90082c00bc | diff --git a/jaraco/util/filesystem.py b/jaraco/util/filesystem.py
index <HASH>..<HASH> 100644
--- a/jaraco/util/filesystem.py
+++ b/jaraco/util/filesystem.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python
-from __future__ import division
+from __future__ import division, absolute_import
import os
import re
import tempfile
+import functools
class RelativePath(str):
"""
@@ -63,3 +64,23 @@ class save_to_file():
def __exit__(self, type, value, traceback):
os.remove(self.filename)
+def replace_extension(new_ext, filename):
+ """
+ >>> replace_extension('.pdf', 'myfile.doc')
+ 'myfile.pdf'
+ """
+ return os.path.splitext(filename)[0] + new_ext
+
+def ExtensionReplacer(new_ext):
+ """
+ A reusable function to replace a file's extension with another
+
+ >>> repl = ExtensionReplacer('.pdf')
+ >>> repl('myfile.doc')
+ 'myfile.pdf'
+ >>> repl('myfile.txt')
+ 'myfile.pdf'
+ >>> repl('myfile')
+ 'myfile.pdf'
+ """
+ return functools.partial(replace_extension, new_ext) | Moved ExtensionReplacer from doc-to-pdf | jaraco_jaraco.path | train | py |
90ff94e4ad41d2a14e38f68cf4e86f62cc94f09c | diff --git a/src/DataPool/SearchEngine/IntegrationTestSearchEngineAbstract.php b/src/DataPool/SearchEngine/IntegrationTestSearchEngineAbstract.php
index <HASH>..<HASH> 100644
--- a/src/DataPool/SearchEngine/IntegrationTestSearchEngineAbstract.php
+++ b/src/DataPool/SearchEngine/IntegrationTestSearchEngineAbstract.php
@@ -226,7 +226,7 @@ abstract class IntegrationTestSearchEngineAbstract implements SearchEngine, Clea
$newValues = [];
foreach ($attributeValuesCounts as $currentAttributeCode => $currentAttributeValues) {
- if ($currentAttributeCode !== $attributeCode) {
+ if ((string) $currentAttributeCode !== $attributeCode) {
$newValues[$currentAttributeCode] = $currentAttributeValues;
continue;
} | Issue #<I>: Enforce array key type to be a string | lizards-and-pumpkins_catalog | train | php |
6f43937f95b03720f33d045d0323f78abf56bc57 | diff --git a/languagetool-core/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java b/languagetool-core/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java
index <HASH>..<HASH> 100644
--- a/languagetool-core/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java
+++ b/languagetool-core/src/test/java/org/languagetool/rules/patterns/PatternRuleTest.java
@@ -99,7 +99,7 @@ public class PatternRuleTest extends TestCase {
}
private void runGrammarRuleForLanguage(Language lang) throws IOException {
- if (skipCountryVariant(lang) && !lang.getShortNameWithCountryAndVariant().equals("ca-ES")) {
+ if (skipCountryVariant(lang)) {
System.out.println("Skipping " + lang + " because there are no specific rules for that variant");
return;
}
@@ -107,6 +107,9 @@ public class PatternRuleTest extends TestCase {
}
private boolean skipCountryVariant(Language lang) {
+ if (Languages.get().get(0).equals(lang)) { // test always the first one
+ return false;
+ }
final ResourceDataBroker dataBroker = JLanguageTool.getDataBroker();
boolean hasGrammarFiles = false;
for (String grammarFile : getGrammarFileNames(lang)) { | Patern rule test: test always at least the first language variant | languagetool-org_languagetool | train | java |
62ec89199a287d1a98f60d7f4bb80a1592474498 | diff --git a/api/context/context.go b/api/context/context.go
index <HASH>..<HASH> 100644
--- a/api/context/context.go
+++ b/api/context/context.go
@@ -1,4 +1,4 @@
-// Copyright 2015 tsuru authors. All rights reserved.
+// Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. | api/context/context: fix license year. | tsuru_tsuru | train | go |
a1babea8cbbf15dd0e326d4c67d84fff6ebace5d | diff --git a/ctrlutil.go b/ctrlutil.go
index <HASH>..<HASH> 100644
--- a/ctrlutil.go
+++ b/ctrlutil.go
@@ -218,6 +218,10 @@ func NextControl(parent Control, curr Control, next bool) Control {
linear := getLinearControlList(parent, fnTab)
+ if len(linear) == 0 {
+ return nil
+ }
+
var pIndex, nIndex int
for i, ch := range linear { | ctrlutil: fix NextControl()
With this helper we may iterate over the control list and end up
not having any control that match the search criteria (namely: tabStop,
visible and enabled). In that case an index out of bounds error will
happen.
This patch checks for the resulting list and return if no control's
found. | VladimirMarkelov_clui | train | go |
36e50bbacd5bdf3403daf337cd4f8fd13b044672 | diff --git a/helpers_test.go b/helpers_test.go
index <HASH>..<HASH> 100644
--- a/helpers_test.go
+++ b/helpers_test.go
@@ -14,12 +14,6 @@ func assertIntsEqual(t *testing.T, expected, actual int) {
}
}
-func assertInts64Equal(t *testing.T, expected, actual int64) {
- if expected != actual {
- t.Errorf("failed asserting that \"%d\" is expected \"%d\"", actual, expected)
- }
-}
-
func assertTrue(t *testing.T, actual bool, errorMessage string) {
if !actual {
t.Error(errorMessage)
diff --git a/message_test.go b/message_test.go
index <HASH>..<HASH> 100644
--- a/message_test.go
+++ b/message_test.go
@@ -9,7 +9,7 @@ func TestCanParseMessage(t *testing.T) {
message := parseMessage(testMessage)
assertStringsEqual(t, "pajlada", message.Channel)
- assertInts64Equal(t, 78424343, message.UserID)
+ assertStringsEqual(t, "78424343", message.UserID)
assertIntsEqual(t, 6, message.Badges["subscriber"])
assertStringsEqual(t, "#FF0000", message.Color)
assertStringsEqual(t, "Redflamingo13", message.DisplayName) | update tests according to latest api changes with userids | gempir_go-twitch-irc | train | go,go |
c3e9da12f87da97da1fe31cfa810bfa81cd6d18f | diff --git a/packages/styled-components/src/base.js b/packages/styled-components/src/base.js
index <HASH>..<HASH> 100644
--- a/packages/styled-components/src/base.js
+++ b/packages/styled-components/src/base.js
@@ -45,8 +45,8 @@ if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' &&
// eslint-disable-next-line no-console
console.warn(
"It looks like there are several instances of 'styled-components' initialized in this application. " +
- 'This may cause dynamic styles not rendering properly, errors happening during rehydration process, ' +
- 'missing theme prop, and makes your application bigger without a good reason.\n\n' +
+ 'This may cause dynamic styles to not render properly, errors during the rehydration process, ' +
+ 'a missing theme prop, and makes your application bigger without good reason.\n\n' +
'See https://s-c.sh/2BAXzed for more info.'
);
} | Fix wording `src/packages/styled-components/base.js` | styled-components_styled-components | train | js |
6e7838133ddc54c0a6f08176cddfdfb2c136f8c2 | diff --git a/lib/moqueue/overloads.rb b/lib/moqueue/overloads.rb
index <HASH>..<HASH> 100644
--- a/lib/moqueue/overloads.rb
+++ b/lib/moqueue/overloads.rb
@@ -13,6 +13,9 @@ class MQ
end
+ def initialize(*args)
+ end
+
def queue(name)
Moqueue::MockQueue.new(name)
end | Need to override MQ#initialize or the ruse doesn't work | danielsdeleo_moqueue | train | rb |
a11f1953a66cb902a2fd3940bad06eedf0f7808a | diff --git a/tests/Queue/ConcurrencyTrait.php b/tests/Queue/ConcurrencyTrait.php
index <HASH>..<HASH> 100644
--- a/tests/Queue/ConcurrencyTrait.php
+++ b/tests/Queue/ConcurrencyTrait.php
@@ -16,8 +16,7 @@ trait ConcurrencyTrait
}
$client = new \GearmanClient();
- $client->addServer();
- //$client->setTimeout(30);
+ $client->addServer('127.0.0.1');
$workerIds = [];
$poppedItems = [];
diff --git a/tests/worker.php b/tests/worker.php
index <HASH>..<HASH> 100644
--- a/tests/worker.php
+++ b/tests/worker.php
@@ -2,7 +2,7 @@
include __DIR__.'/bootstrap.php';
-$worker = new \GearmanWorker();
+$worker = new \GearmanWorker('127.0.0.1');
$worker->addServer();
$workerId = uniqid(getmypid().'_', true);
@@ -20,7 +20,7 @@ $worker->addFunction('pop', function(\GearmanJob $job) use ($workerId) {
echo "Waiting for a job...\n";
while ($worker->work()) {
- if (GEARMAN_SUCCESS != $worker->returnCode()) {
+ if (GEARMAN_SUCCESS !== $worker->returnCode()) {
echo $worker->error()."\n";
exit(1);
} | Explicitly set Gearman job server host name | rybakit_phive-queue | train | php,php |
7e4f38588415f73cefdcfa10a700a58671dc9bf5 | diff --git a/src/WebServCo/Framework/Helpers/RequestHelper.php b/src/WebServCo/Framework/Helpers/RequestHelper.php
index <HASH>..<HASH> 100644
--- a/src/WebServCo/Framework/Helpers/RequestHelper.php
+++ b/src/WebServCo/Framework/Helpers/RequestHelper.php
@@ -30,10 +30,13 @@ final class RequestHelper
$parts = self::split($string);
$num = \count($parts);
for ($position = 0; $position < $num; $position += 2) {
+ if (!\array_key_exists($position, $parts)) {
+ // Prevents "Notice: Undefined offset: 2." in request like "&lang=/'/"
+ continue;
+ }
$data[$parts[$position]] = $position === $num - 1
? null
- :
- $parts[$position + 1];
+ : $parts[$position + 1];
}
return $data;
} | Prevent "Notice: Undefined offset: 2." in request like "&lang=/'/" | webservco_framework | train | php |
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.