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 |
|---|---|---|---|---|---|
409d3097a5fca5a407c1250e0157ff66201b0d3f | diff --git a/spyder/plugins/editor/utils/autosave.py b/spyder/plugins/editor/utils/autosave.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/utils/autosave.py
+++ b/spyder/plugins/editor/utils/autosave.py
@@ -4,7 +4,26 @@
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
-"""Autosave components for the Editor plugin and the EditorStack widget"""
+"""
+Autosave components for the Editor plugin and the EditorStack widget
+
+The autosave system regularly checks the contents of all opened files and saves
+a copy in the autosave directory if the contents are different from the
+autosave file (if it exists) or original file (if there is no autosave file).
+
+The mapping between original files and autosave files is stored in the
+variable `name_mapping` and saved in the file `pidNNN.txt` in the autosave
+directory, where `NNN` stands for the pid. This filename is chosen so that
+multiple instances of Spyder can run simultaneously.
+
+File contents are compared using their hash. The variable `file_hashes`
+contains the hash of all files currently open in the editor and all autosave
+files.
+
+On startup, the contents of the autosave directory is checked and if autosave
+files are found, the user is asked whether to recover them;
+see `spyder/plugins/editor/widgets/recover.py`.
+"""
# Standard library imports
import ast | Editor: Add comment with description of autosave system | spyder-ide_spyder | train | py |
156c929e37c5ccf284f4814fb41d38f29ecf5f1f | diff --git a/pygount/command.py b/pygount/command.py
index <HASH>..<HASH> 100644
--- a/pygount/command.py
+++ b/pygount/command.py
@@ -28,8 +28,11 @@ _HELP_ENCODING = '''encoding to use when reading source code; use "automatic"
different fallback encoding than CP1252; use "chardet" to let the chardet
package determine the encoding; default: "%(default)s"'''
-_HELP_EPILOG = '''By default PATTERNS are shell patterns using *, ? and
- ranges like [a-z] as placeholders.'''
+_HELP_EPILOG = '''SHELL-PATTERN is a pattern using *, ? and ranges like [a-z]
+ as placeholders. PATTERNS is a comma separated list of SHELL-PATTERN. The
+ prefix [regex] indicated that the PATTERNS use regular expression syntax. If
+ default values are available, [...] indicates that the PATTERNS extend the
+ existing default values.'''
_HELP_FORMAT = 'output format, one of: {0}; default: "%(default)s"'.format(
', '.join(['"' + format + '"' for format in _VALID_FORMATS])) | Improved online help on PATTERNS options. | roskakori_pygount | train | py |
3a2f9b6e15668837ec6e8306075b6b24da82a53a | diff --git a/test/sourcemaps/loaders/_config.js b/test/sourcemaps/loaders/_config.js
index <HASH>..<HASH> 100644
--- a/test/sourcemaps/loaders/_config.js
+++ b/test/sourcemaps/loaders/_config.js
@@ -10,9 +10,9 @@ module.exports = {
plugins: [
{
load: function ( id ) {
- if ( id.endsWith( 'foo.js' ) ) {
+ if ( /foo.js$/.test( id ) ) {
id = id.replace( /foo.js$/, 'bar.js' );
- } else if ( id.endsWith( 'bar.js' ) ) {
+ } else if ( /bar.js$/.test( id ) ) {
id = id.replace( /bar.js$/, 'foo.js' );
}
@@ -22,7 +22,7 @@ module.exports = {
comments: false // misalign the columns
});
- if ( id.endsWith( 'main.js' ) ) {
+ if ( /main.js$/.test( id ) ) {
delete out.map.sources;
} else {
const slash = out.map.sources[0].lastIndexOf( '/' ) + 1; | Don't use endsWith. Will this fix the <I> build? | rollup_rollup | train | js |
598e403ad48c644e4c1d05e678a9217a6d8b4387 | diff --git a/pynspect/__init__.py b/pynspect/__init__.py
index <HASH>..<HASH> 100644
--- a/pynspect/__init__.py
+++ b/pynspect/__init__.py
@@ -16,4 +16,4 @@ data structures.
"""
-__version__ = "0.14"
+__version__ = "0.15" | DEPLOY: Increased package version to '<I>' to build new distribution. | honzamach_pynspect | train | py |
493d5ffb50815420155bbc0de98d9f4c307f7abf | diff --git a/tests/test_post_punct.py b/tests/test_post_punct.py
index <HASH>..<HASH> 100644
--- a/tests/test_post_punct.py
+++ b/tests/test_post_punct.py
@@ -39,3 +39,9 @@ def test_three_same_close(close_puncts):
assert len(tokens) == 4
assert tokens[0].string == word_str
assert tokens[1].string == p
+
+
+def test_double_end_quote():
+ assert len(EN.tokenize("Hello''")) == 2
+ assert len(EN.tokenize("''")) == 1
+ | * Add test for '' in punct | explosion_spaCy | train | py |
925225365c495f849910bcc55106372b9745f2fb | diff --git a/spec/aptly/repo_spec.rb b/spec/aptly/repo_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/aptly/repo_spec.rb
+++ b/spec/aptly/repo_spec.rb
@@ -123,14 +123,6 @@ module Aptly
end
end
- describe "Publish Repos" do
- it "should publish an existing repo" do
- repo = Aptly.create_repo 'repo_to_publish'
- repo.add 'spec/pkgs/pkg1_1.0.1-1_amd64.deb'
- repo.publish :dist => 'repo_to_publish'
- end
- end
-
describe "Modify Repo" do
it "should modify the repo metadata" do
repoA = Aptly.create_repo 'modify' | Removed publish test for the time being | ryanuber_ruby-aptly | train | rb |
07f83686d0bab200125cef04f0e59386f1e3f0ab | diff --git a/lib/puppet/functions/map.rb b/lib/puppet/functions/map.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/functions/map.rb
+++ b/lib/puppet/functions/map.rb
@@ -125,7 +125,7 @@ Puppet::Functions.create_function(:map) do
index = 0
loop do
result << yield(index, enum.next)
- index = index +1
+ index = index + 1
end
rescue StopIteration
end | (PUP-<I>) Remove '`+' after local variable or literal is interpreted as binary operator' warning | puppetlabs_puppet | train | rb |
4fb6826b4f0f6e5b56f81d8f721ff1103e1e913a | diff --git a/app/controllers/effective/datatables_controller.rb b/app/controllers/effective/datatables_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/effective/datatables_controller.rb
+++ b/app/controllers/effective/datatables_controller.rb
@@ -24,7 +24,7 @@ module Effective
private
def find_datatable(id)
- id = id.to_s.gsub(/-\d{12}\z/, '').gsub('-', '/')
+ id = id.to_s.gsub(/-+\d{9,12}\z/, '')
id.classify.safe_constantize || id.classify.pluralize.safe_constantize
end | Fixed find_datatable, take multiple - symbols into account | code-and-effect_effective_datatables | train | rb |
ccd979aa28187b2dda48bf55a4c808f738207872 | diff --git a/tcpip/transport/tcp/endpoint.go b/tcpip/transport/tcp/endpoint.go
index <HASH>..<HASH> 100644
--- a/tcpip/transport/tcp/endpoint.go
+++ b/tcpip/transport/tcp/endpoint.go
@@ -1164,9 +1164,12 @@ func (e *endpoint) HandleControlPacket(id stack.TransportEndpointID, typ stack.C
// in the send buffer. The number of newly available bytes is v.
func (e *endpoint) updateSndBufferUsage(v int) {
e.sndBufMu.Lock()
- notify := e.sndBufUsed >= e.sndBufSize
+ notify := e.sndBufUsed >= e.sndBufSize>>1
e.sndBufUsed -= v
- notify = notify && e.sndBufUsed < e.sndBufSize
+ // We only notify when there is half the sndBufSize available after
+ // a full buffer event occurs. This ensures that we don't wake up
+ // writers to queue just 1-2 segments and go back to sleep.
+ notify = notify && e.sndBufUsed < e.sndBufSize>>1
e.sndBufMu.Unlock()
if notify { | Change the wakeup policy for waiters.
It ensures that we don't wake up waiters everytime a single segment or
two are drained from the send queue. After a full sndbuf we let the
available space drop to half the sndbuf size before waking up waiters.
PiperOrigin-RevId: <I> | google_netstack | train | go |
1482160f1f0905dd4b5f06afcf2a268d9819699b | diff --git a/pyfakefs/fake_filesystem.py b/pyfakefs/fake_filesystem.py
index <HASH>..<HASH> 100644
--- a/pyfakefs/fake_filesystem.py
+++ b/pyfakefs/fake_filesystem.py
@@ -360,6 +360,7 @@ class FakeFile(object):
def set_contents(self, contents, encoding=None):
"""Sets the file contents and size and increases the modification time.
+ Also executes the side_effects if available.
Args:
contents: (str, bytes, unicode) new content of file. | Added mention of side_effects in set_contents docstring | jmcgeheeiv_pyfakefs | train | py |
3f2153780a43dc363f37f8842e5882eed94118d2 | diff --git a/jre_emul/Tests/java/lang/ThrowableTest.java b/jre_emul/Tests/java/lang/ThrowableTest.java
index <HASH>..<HASH> 100644
--- a/jre_emul/Tests/java/lang/ThrowableTest.java
+++ b/jre_emul/Tests/java/lang/ThrowableTest.java
@@ -67,7 +67,7 @@ public class ThrowableTest extends TestCase {
testException.printStackTrace(out);
out.flush();
String trace = baos.toString("UTF-8");
- assertTrue(trace.contains("[JavaLangThrowableTest testStackTraceWithPrintStream]"));
+ assertTrue(trace.contains("JavaLangThrowableTest.testStackTraceWithPrintStream()"));
}
public void testStackTraceWithPrintWriter() throws Exception {
@@ -77,6 +77,6 @@ public class ThrowableTest extends TestCase {
testException.printStackTrace(out);
out.flush();
String trace = sw.toString();
- assertTrue(trace.contains("[JavaLangThrowableTest testStackTraceWithPrintWriter]"));
+ assertTrue(trace.contains("JavaLangThrowableTest.testStackTraceWithPrintWriter()"));
}
} | Fixed expected stacktrace output in tests. | google_j2objc | train | java |
949172ef36a590077b67186e4ec851f9174b8b75 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,7 @@
var stream = require('readable-stream')
var util = require('util')
-var SIGNAL_END = new Buffer(0)
+var SIGNAL_END = new Buffer([0])
module.exports = MultiWrite | use none-empty buffer for signalling | mafintosh_multi-write-stream | train | js |
61c05836f926c9474429ef5c33cafdc8fdc37591 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,22 +17,6 @@
import sys
from setuptools import setup, find_packages
-mainscript = "pylon/main.py"
-
-if sys.platform == "darwin":
- extra_opts = {"app": [mainscript],
- "setup_requires": ["py2app"],
- "options": {"py2app": {"argv_emulation": True,
-# "plist": {"LSPrefersPPC": True},
- "packages": ["numpy", "scipy"],
- "includes": ["pips", "pyparsing"]}}}
-elif sys.platform == "win32":
- extra_opts = {"app": [mainscript],
- "setup_requires": ["py2exe"]}
-else:
- extra_opts = {}
-
-
setup(author="Richard Lincoln",
author_email="r.w.lincoln@gmail.com",
description="Port of MATPOWER to Python.",
@@ -47,7 +31,6 @@ setup(author="Richard Lincoln",
packages=["pylon", "pylon.readwrite", "pylon.test"],#find_packages(),
py_modules=["pips"],
test_suite="pylon.test",
- zip_safe=True,
- **extra_opts)
+ zip_safe=True)
# EOF ------------------------------------------------------------------------- | Removing py2exe and py2app dependencies. | rwl_pylon | train | py |
ab549e3fdb8fe8a24352c198f085f006bb7e982e | diff --git a/tests/integration/states/test_network.py b/tests/integration/states/test_network.py
index <HASH>..<HASH> 100644
--- a/tests/integration/states/test_network.py
+++ b/tests/integration/states/test_network.py
@@ -1,14 +1,10 @@
-# -*- encoding: utf-8 -*-
"""
:codeauthor: :email: `Justin Anderson <janderson@saltstack.com>`
tests.integration.states.network
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
-# Python libs
-from __future__ import absolute_import, print_function, unicode_literals
-# Import salt testing libs
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest, slowTest
from tests.support.mixins import SaltReturnAssertsMixin
@@ -63,7 +59,7 @@ class NetworkTest(ModuleCase, SaltReturnAssertsMixin):
global_settings = self.run_function("ip.get_network_settings")
ret = self.run_function("state.sls", mods="network.system", test=True)
self.assertIn(
- "Global network settings are set to be {0}".format(
+ "Global network settings are set to be {}".format(
"added" if not global_settings else "updated"
),
ret[state_key]["comment"], | Drop Py2 and six on tests/integration/states/test_network.py | saltstack_salt | train | py |
615a4ce1b4c20e5b538332d0a6e19157243a9471 | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -945,7 +945,7 @@ jQuery.extend({
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
- if ( context.createElement === undefined )
+ if ( typeof context.createElement === "undefined" )
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
jQuery.each(elems, function(i, elem){ | IE doesn't care for boolean checks of .createElement - reverted back to using typeof instead. | jquery_jquery | train | js |
d7812888a07735c753ba10ef987aac7e8c830394 | diff --git a/morphia/src/main/java/org/mongodb/morphia/DatastoreImpl.java b/morphia/src/main/java/org/mongodb/morphia/DatastoreImpl.java
index <HASH>..<HASH> 100644
--- a/morphia/src/main/java/org/mongodb/morphia/DatastoreImpl.java
+++ b/morphia/src/main/java/org/mongodb/morphia/DatastoreImpl.java
@@ -435,7 +435,7 @@ public class DatastoreImpl implements AdvancedDatastore {
final DBObject dbResult = database.command(BasicDBObjectBuilder.start("collstats", collName).get());
if (dbResult.containsField("capped")) {
// TODO: check the cap options.
- LOG.warning("DBCollection already exists is capped already; doing nothing. " + dbResult);
+ LOG.debug("DBCollection already exists and is capped already; doing nothing. " + dbResult);
} else {
LOG.warning("DBCollection already exists with same name(" + collName
+ ") and is not capped; not creating capped version!"); | Downgrade from WARN to DEBUG message about capped collection existing
Sample warning being changed to debug level:
WARN org.mongodb.morphia.DatastoreImpl: DBCollection already exists is
capped already; doing nothing.
This should not be a warning as there is no problem. The DBCollection
will already exist on every application startup except the first one.
Also fixes grammar of the log message.
Fixes Morphia issue [#<I>](<URL>) | MorphiaOrg_morphia | train | java |
419dd00c2d84509e18270fdf54bcd6681576d4d9 | diff --git a/tests/index.js b/tests/index.js
index <HASH>..<HASH> 100644
--- a/tests/index.js
+++ b/tests/index.js
@@ -676,7 +676,8 @@ describe('inputNumber', () => {
});
// https://github.com/ant-design/ant-design/issues/5012
- it('controller InputNumber should be able to input number like 1.00*', () => {
+ // https://github.com/react-component/input-number/issues/64
+ it('controller InputNumber should be able to input number like 1.00* and 1.10*', () => {
let num;
const Demo = createReactClass({
getInitialState() {
@@ -706,6 +707,13 @@ describe('inputNumber', () => {
Simulate.blur(inputElement);
expect(inputElement.value).to.be('6');
expect(num).to.be(6);
+ Simulate.focus(inputElement);
+ Simulate.change(inputElement, { target: { value: '6.10' } });
+ expect(inputElement.value).to.be('6.10');
+ expect(num).to.be('6.10');
+ Simulate.blur(inputElement);
+ expect(inputElement.value).to.be('6.1');
+ expect(num).to.be(6.1);
});
it('onChange should not be called when input is not changed', () => { | test: add test for #<I> | react-component_input-number | train | js |
60b0fff7e4ae78ac7df78ce86ac0b239c38d90f5 | diff --git a/app/search_engines/bento_search/google_site_search_engine.rb b/app/search_engines/bento_search/google_site_search_engine.rb
index <HASH>..<HASH> 100644
--- a/app/search_engines/bento_search/google_site_search_engine.rb
+++ b/app/search_engines/bento_search/google_site_search_engine.rb
@@ -99,7 +99,7 @@ class BentoSearch::GoogleSiteSearchEngine
10
end
- def self.required_configuation
+ def self.required_configuration
[:api_key, :cx]
end | google_site, typo in #required_configuration class method | jrochkind_bento_search | train | rb |
6e95274413d573abeb525201c0df21d47ba20b63 | diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go
index <HASH>..<HASH> 100644
--- a/cmd/torrent/main.go
+++ b/cmd/torrent/main.go
@@ -100,7 +100,9 @@ func addTorrents(client *torrent.Client) error {
return nil, xerrors.Errorf("error loading torrent file %q: %s\n", arg, err)
}
t, err := client.AddTorrent(metaInfo)
- return nil, xerrors.Errorf("adding torrent: %w", err)
+ if err != nil {
+ return nil, xerrors.Errorf("adding torrent: %w", err)
+ }
return t, nil
}
}() | fix if statement in `cmd/torrent/main.go` (#<I>) | anacrolix_torrent | train | go |
8939494b849316420433a567cb8ea9d3d2f497c4 | diff --git a/packages/nexrender-core/src/tasks/render.js b/packages/nexrender-core/src/tasks/render.js
index <HASH>..<HASH> 100644
--- a/packages/nexrender-core/src/tasks/render.js
+++ b/packages/nexrender-core/src/tasks/render.js
@@ -70,8 +70,10 @@ module.exports = (job, settings) => {
return new Promise((resolve, reject) => {
renderStopwatch = Date.now();
- const instance = spawn(settings.binary, params);
const output = [];
+ const instance = spawn(settings.binary, params, {
+ env: { PATH: path.dirname(settings.binary) },
+ });
instance.on('error', err => reject(new Error(`Error starting aerender process: ${err}`)));
instance.stdout.on('data', (data) => output.push(parse(data.toString('utf8')))); | added fix by @ddcrobert from #<I>, focring PATH for arender | inlife_nexrender | train | js |
6fb405bc0b06fa55d8c631777ba45848106e6988 | diff --git a/core/View.php b/core/View.php
index <HASH>..<HASH> 100644
--- a/core/View.php
+++ b/core/View.php
@@ -50,7 +50,7 @@ class Piwik_View implements Piwik_iView
}
$this->smarty->template_dir = $smConf->template_dir->toArray();
- array_walk($this->smarty->template_dir, array("Piwik_View","addPiwikPath"), PIWIK_USER_PATH);
+ array_walk($this->smarty->template_dir, array("Piwik_View","addPiwikPath"), PIWIK_INCLUDE_PATH);
$this->smarty->plugins_dir = $smConf->plugins_dir->toArray();
array_walk($this->smarty->plugins_dir, array("Piwik_View","addPiwikPath"), PIWIK_INCLUDE_PATH); | fix 'unable to read resource' error (should have used PIWIK_INCLUDE_PATH here)
git-svn-id: <URL> | matomo-org_matomo | train | php |
5c64b5bdc334e2e28f1b6d599579d3270c59ba48 | diff --git a/symbionts/custom-metadata/js/custom-metadata-manager.js b/symbionts/custom-metadata/js/custom-metadata-manager.js
index <HASH>..<HASH> 100644
--- a/symbionts/custom-metadata/js/custom-metadata-manager.js
+++ b/symbionts/custom-metadata/js/custom-metadata-manager.js
@@ -177,13 +177,15 @@
// init the datepicker fields
$( '.custom-metadata-field.datepicker' ).find( 'input' ).datepicker({
changeMonth: true,
- changeYear: true
+ changeYear: true,
+ dateFormat: 'mm/dd/yy'
});
// init the datetimepicker fields
$( '.custom-metadata-field.datetimepicker' ).find( 'input' ).datetimepicker({
changeMonth: true,
- changeYear: true
+ changeYear: true,
+ dateFormat: 'mm/dd/yy'
});
// init the timepicker fields | Publication date not saving (fixes #<I>) (#<I>)
The custom metadata plugin we use formats dates like: `date( 'm/d/Y', $v ) )`
This sometimes conflicts with `wp_localize_jquery_ui_datepicker`, espcially when not in english. | pressbooks_pressbooks | train | js |
51176189849cc4ebf0cd3c9d0de47b9d0939deb7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,11 @@ coffee_files = [
'struct.coffee',
'class.coffee',
'namespace.coffee',
- 'typedef.coffee'
+ 'typedef.coffee',
+ 'variable.coffee',
+ 'function.coffee',
+ 'field.coffee',
+ 'constructor.coffee'
]
class cldoc_build(build): | Added missing coffee files to setup.py | jessevdk_cldoc | train | py |
2139e6aac040005a6172ca5bc9fa52547679f1eb | diff --git a/packages/list-view/lib/list_item_view.js b/packages/list-view/lib/list_item_view.js
index <HASH>..<HASH> 100644
--- a/packages/list-view/lib/list_item_view.js
+++ b/packages/list-view/lib/list_item_view.js
@@ -65,7 +65,9 @@ function rerender() {
set(this, 'element', element);
- this.transitionTo('inDOM');
+ var transitionTo = this._transitionTo ? this._transitionTo : this.transitionTo;
+
+ transitionTo.call(this, 'inDOM');
if (hasChildViews) {
this.invokeRecursively(didInsertElementIfNeeded, false); | [fixes #<I>] support both new and old transitionTo method | emberjs_list-view | train | js |
6c6316eb19d54e886594ed479e069ceb55fb427f | diff --git a/packages/cli/tests/watch.test.js b/packages/cli/tests/watch.test.js
index <HASH>..<HASH> 100644
--- a/packages/cli/tests/watch.test.js
+++ b/packages/cli/tests/watch.test.js
@@ -89,7 +89,7 @@ describe('should determine the correct port', () => {
expect(await determinePort('3999')).toBe(3999);
});
- it('should use $PORT in the abscence of --port', async () => {
+ it('should use $PORT in the absence of --port', async () => {
process.env.PORT = '4001';
expect(await determinePort()).toBe(4001);
});
@@ -105,14 +105,10 @@ describe('should determine the correct port', () => {
});
it('should return an error if requested --port is taken', async () => {
- await Promise.all([determinePort(4003), determinePort(4003)]).catch(
- error => {
- expect(error.message).toMatch(
- new RegExp(
- /^Another process is already running on port 4003. Please choose a different port./g
- )
- );
- }
+ expect(
+ Promise.all([determinePort(4003), determinePort(4003)])
+ ).rejects.toThrow(
+ 'Another process is already running on port 4003. Please choose a different port.'
);
}); | fix silent failing test (#<I>) | developit_preact-cli | train | js |
be9b84606bc313137e847fc58a752808efe3b703 | diff --git a/library/CM/View/Abstract.js b/library/CM/View/Abstract.js
index <HASH>..<HASH> 100644
--- a/library/CM/View/Abstract.js
+++ b/library/CM/View/Abstract.js
@@ -153,10 +153,9 @@ var CM_View_Abstract = Backbone.View.extend({
* @param {Boolean} [skipTriggerRemove]
*/
remove: function(skipDomRemoval, skipTriggerRemove) {
- this.trigger('destruct');
- if (!skipTriggerRemove) {
- this.trigger('remove');
- }
+ _.each(_.clone(this.getChildren()), function(child) {
+ child.remove();
+ });
if (this.getParent()) {
var siblings = this.getParent().getChildren();
@@ -167,12 +166,13 @@ var CM_View_Abstract = Backbone.View.extend({
}
}
- _.each(_.clone(this.getChildren()), function(child) {
- child.remove();
- });
-
delete cm.views[this.getAutoId()];
+ this.trigger('destruct');
+ if (!skipTriggerRemove) {
+ this.trigger('remove');
+ }
+
if (!skipDomRemoval) {
this.$el.remove();
} | Move destruct/remove triggers after removal of children views | cargomedia_cm | train | js |
71bd32ecf28da0158daed5d82692b3783b44dd3c | diff --git a/src/DataTable/utils/routeDoubleClick.js b/src/DataTable/utils/routeDoubleClick.js
index <HASH>..<HASH> 100644
--- a/src/DataTable/utils/routeDoubleClick.js
+++ b/src/DataTable/utils/routeDoubleClick.js
@@ -1,8 +1,10 @@
import pluralize from "pluralize";
+import { kebabCase } from "lodash";
+
export default function routeDoubleClick(row, rowIndex, history) {
- const recordType = row["__typename"];
+ const recordType = row["__typename"] || "";
const recordId = row["dbId"] || row["id"];
- const route = "/" + pluralize(recordType) + "/" + recordId;
+ const route = "/" + pluralize(kebabCase(recordType)) + "/" + recordId;
history
? history.push(route)
: console.warn("react router history not passed to datatable"); | update route double click for kebab case routes | TeselaGen_teselagen-react-components | train | js |
f42d716b7df46b87c771f9b0ae9f34ecdd2de38f | diff --git a/src/test/UberTestCase3.java b/src/test/UberTestCase3.java
index <HASH>..<HASH> 100644
--- a/src/test/UberTestCase3.java
+++ b/src/test/UberTestCase3.java
@@ -11,7 +11,7 @@ import groovy.util.AllTestSuite;
public class UberTestCase3 extends TestCase {
public static Test suite() {
- return AllTestSuite.suite("src/test/groovy", "*/**Test.groovy");
+ return AllTestSuite.suite("src/test/groovy", "*/**/*Test.groovy");
}
// no tests inside (should we have an AbstractGroovyTestCase???) | GROOVY-<I>: UTC3 seems to have been missing some tests
git-svn-id: <URL> | apache_groovy | train | java |
6f2a1916105453ef2d6eea480b91fb590e5981f1 | diff --git a/examples/simple_app.py b/examples/simple_app.py
index <HASH>..<HASH> 100644
--- a/examples/simple_app.py
+++ b/examples/simple_app.py
@@ -18,9 +18,7 @@ from remi import start, App
class MyApp(App):
def __init__(self, *args):
- kwargs = {k:k for k in ('js_body_end', 'css_head', 'html_head', 'html_body_start', 'html_body_end', 'js_body_start', 'js_head')}
- kwargs['js_body_end'] = ('js_body_end1','js_body_end2')
- super(MyApp, self).__init__(*args, **kwargs)
+ super(MyApp, self).__init__(*args)
def main(self, name='world'):
# the arguments are width - height - layoutOrientationOrizontal | sample_app: rm code accidentally added in #<I>e<I> | dddomodossola_remi | train | py |
4f63f7fca9d04e3322ea1c6ad626de5a8e5d1600 | diff --git a/lib/ImageHelper.php b/lib/ImageHelper.php
index <HASH>..<HASH> 100644
--- a/lib/ImageHelper.php
+++ b/lib/ImageHelper.php
@@ -308,7 +308,7 @@ class ImageHelper {
protected static function process_delete_generated_files( $filename, $ext, $dir, $search_pattern, $match_pattern = null ) {
$searcher = '/'.$filename.$search_pattern;
$files = glob($dir.$searcher);
- if ( $files === false ) {
+ if ( $files === false || empty($files) ) {
return;
}
foreach ( $files as $found_file ) {
diff --git a/tests/test-timber-image-helper.php b/tests/test-timber-image-helper.php
index <HASH>..<HASH> 100644
--- a/tests/test-timber-image-helper.php
+++ b/tests/test-timber-image-helper.php
@@ -72,6 +72,12 @@
$exists = file_exists( $resized_path );
$this->assertTrue( $exists );
}
+ /**
+ * @doesNotPerformAssertions
+ */
+ function testDeleteFalseFile() {
+ TimberImageHelper::delete_generated_files('/etc/www/image.jpg');
+ }
function testLetterbox() {
$file_loc = TestTimberImage::copyTestImage( 'eastern.jpg' ); | ref #<I> -- try hitting false to confirm functionality | timber_timber | train | php,php |
4178a59384430bac474371ea6db85d90b1ed3b58 | diff --git a/cmd/viewcore/main.go b/cmd/viewcore/main.go
index <HASH>..<HASH> 100644
--- a/cmd/viewcore/main.go
+++ b/cmd/viewcore/main.go
@@ -286,7 +286,13 @@ func runRoot(cmd *cobra.Command, args []string) {
// Create a dummy root to run in shell.
root := &cobra.Command{}
// Make all subcommands of viewcore available in the shell.
- root.AddCommand(cmd.Commands()...)
+ for _, subcmd := range cmd.Commands() {
+ if subcmd.Name() == "help" {
+ root.SetHelpCommand(subcmd)
+ continue
+ }
+ root.AddCommand(subcmd)
+ }
// Also, add exit command to terminate the shell.
root.AddCommand(&cobra.Command{
Use: "exit", | cmd/viewcore: dedup 'help' subcommand in interactive mode
Available commands will stop printing 'help' subcommand twice.
Change-Id: Ibf<I>cda<I>a<I>fa6a<I>b8c<I>a<I>f2ec
Reviewed-on: <URL> | golang_debug | train | go |
c5cefdbc617a041a7da61ed8139c78d3ea535f05 | diff --git a/mpd.py b/mpd.py
index <HASH>..<HASH> 100644
--- a/mpd.py
+++ b/mpd.py
@@ -23,6 +23,12 @@ ERROR_PREFIX = "ACK "
SUCCESS = "OK"
NEXT = "list_OK"
+try:
+ # workaround to get unicode strings in all python versions
+ str = unicode
+except NameError:
+ pass
+
class MPDError(Exception):
pass
diff --git a/test.py b/test.py
index <HASH>..<HASH> 100755
--- a/test.py
+++ b/test.py
@@ -151,7 +151,11 @@ class TestMPDClient(unittest.TestCase):
self.assertFalse(imple_cmds - avaible_cmds, long_desc)
def test_unicode_in_command_args(self):
- self.assertIsInstance(self.client.find("file", "☯☾☝♖✽"), list)
+ if sys.version_info < (3, 0):
+ arg = "☯☾☝♖✽".decode("utf-8")
+ else:
+ arg = "☯☾☝♖✽"
+ self.assertIsInstance(self.client.find("file",arg), list)
if __name__ == '__main__':
unittest.main() | Fix crash when sending unicode strings to socket
It's only an issue with Python 2: it would try to coerce the Unicode
string to ASCII, which will not work unless all characters are part of ASCII.
Overwrite str() with unicode() in python 2.x, solve this.
Fix issue #4 | Mic92_python-mpd2 | train | py,py |
2bb03d6cd61e8809a91ec4359e65b9a0b3e1db92 | diff --git a/integration-test/lolex-integration-test.js b/integration-test/lolex-integration-test.js
index <HASH>..<HASH> 100644
--- a/integration-test/lolex-integration-test.js
+++ b/integration-test/lolex-integration-test.js
@@ -48,4 +48,14 @@ describe("withGlobal", function () {
clock.uninstall();
});
+
+ it("Date is instanceof itself", function () {
+ assert(new jsdomGlobal.Date() instanceof jsdomGlobal.Date);
+
+ var clock = withGlobal.install({target: jsdomGlobal, toFake: timers});
+
+ assert(new jsdomGlobal.Date() instanceof jsdomGlobal.Date);
+
+ clock.uninstall();
+ });
});
diff --git a/src/lolex-src.js b/src/lolex-src.js
index <HASH>..<HASH> 100644
--- a/src/lolex-src.js
+++ b/src/lolex-src.js
@@ -41,7 +41,7 @@ function withGlobal(_global) {
_global.clearTimeout(timeoutResult);
- var NativeDate = Date;
+ var NativeDate = _global.Date;
var uniqueTimerId = 1;
function isNumberFinite(num) { | Access Date on `_global` | sinonjs_lolex | train | js,js |
2076421647bd2dd1599d015cd718ac0ce35dd1eb | diff --git a/lib/qizer.js b/lib/qizer.js
index <HASH>..<HASH> 100644
--- a/lib/qizer.js
+++ b/lib/qizer.js
@@ -10,6 +10,9 @@ module.exports = function (Promise) {
});
q.when = function (p) { return ( p && p.then ) ? p : Promise.resolve(p); };
+ q.usePolyfill = function () {
+ Promise = require('./promise-polyfill');
+ };
return q; | added .usePolyfill() | kiltjs_parole | train | js |
681f921c94a0fa1fdd80c8196496f28cb7fce18c | diff --git a/lib/loop.js b/lib/loop.js
index <HASH>..<HASH> 100644
--- a/lib/loop.js
+++ b/lib/loop.js
@@ -3,8 +3,6 @@ var EventEmitter = require('events').EventEmitter;
var _ = require('lodash');
var clock = require('./clock')();
-var instance;
-
var start = function( loop, clock ) {
return function() {
@@ -29,7 +27,6 @@ var createLoop = function( emitter, clock, customizeEvent ) {
return function runLoop() {
this.rafHandle = raf( runLoop.bind(this) );
- console.log( this.rafHandle );
var dt = clock.delta();
var event = customizeEvent({
@@ -49,7 +46,6 @@ var createLoop = function( emitter, clock, customizeEvent ) {
var passThrough = function( a ) { return a; };
module.exports = function configurePoemLoop( properties ) {
-
var config = _.extend({
emitter: new EventEmitter(),
@@ -62,8 +58,6 @@ module.exports = function configurePoemLoop( properties ) {
rafHandle: null
});
- instance = state;
-
var loop = createLoop(
config.emitter,
clock, | Removed some errant debug code | gregtatum_poem-loop | train | js |
72739d5cc94d0ad6ef2ebde24e8315bd7ffe8ca4 | diff --git a/cobra/test/solvers.py b/cobra/test/solvers.py
index <HASH>..<HASH> 100644
--- a/cobra/test/solvers.py
+++ b/cobra/test/solvers.py
@@ -199,8 +199,9 @@ def add_new_test(TestCobraSolver, solver_name, solver):
Cone_production.add_metabolites({production_capacity_constraint: cone_production_cost })
Popsicle_production.add_metabolites({production_capacity_constraint: popsicle_production_cost })
- cobra_model.optimize()
+ cobra_model.optimize(solver=solver_name)
self.assertEqual(133, cobra_model.solution.f)
+ self.assertEqual(33, cobra_model.solution.x_dict["Cone_consumption"])
def solve_infeasible(self):
solver.solve(self.infeasible_model) | fix testing of mip solvers | opencobra_cobrapy | train | py |
d68f13d871fe747ac7bbe6d672f28a1fc8d59322 | diff --git a/packages/ra-core/src/sideEffect/undo.js b/packages/ra-core/src/sideEffect/undo.js
index <HASH>..<HASH> 100644
--- a/packages/ra-core/src/sideEffect/undo.js
+++ b/packages/ra-core/src/sideEffect/undo.js
@@ -34,7 +34,10 @@ export function* handleUndoRace(undoableAction) {
// if not cancelled, redispatch the action, this time immediate, and without success side effect
yield put({
...action,
- meta: metaWithoutSuccessSideEffects,
+ meta: {
+ ...metaWithoutSuccessSideEffects,
+ onSuccess: { refresh: true },
+ },
});
} else {
yield put(showNotification('ra.notification.canceled')); | Force refresh once a server action succeeds
Closes #<I> | marmelab_react-admin | train | js |
82541fbabd41548a2e1a39440a8b3bbd093b298d | diff --git a/src/main/java/org/springframework/social/evernote/api/StoreClientHolder.java b/src/main/java/org/springframework/social/evernote/api/StoreClientHolder.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/springframework/social/evernote/api/StoreClientHolder.java
+++ b/src/main/java/org/springframework/social/evernote/api/StoreClientHolder.java
@@ -1,8 +1,10 @@
package org.springframework.social.evernote.api;
+import org.springframework.aop.RawTargetAccess;
+
/**
* @author Tadaya Tsuyukubo
*/
-public interface StoreClientHolder {
+public interface StoreClientHolder extends RawTargetAccess {
<T> T getStoreClient();
} | add RawTargetAccess marker to work with proxy object | ttddyy_spring-social-evernote | train | java |
a6170b0c35025b2ff097fac756e2c8334145eba5 | diff --git a/builder/vsphere/common/config_location.go b/builder/vsphere/common/config_location.go
index <HASH>..<HASH> 100644
--- a/builder/vsphere/common/config_location.go
+++ b/builder/vsphere/common/config_location.go
@@ -3,7 +3,11 @@
package common
-import "fmt"
+import (
+ "fmt"
+ "path"
+ "strings"
+)
type LocationConfig struct {
// Name of the new VM to create.
@@ -38,5 +42,9 @@ func (c *LocationConfig) Prepare() []error {
errs = append(errs, fmt.Errorf("'host' or 'cluster' is required"))
}
+ // clean Folder path and remove leading slash as folders are relative within vsphere
+ c.Folder = path.Clean(c.Folder)
+ c.Folder = strings.TrimLeft(c.Folder, "/")
+
return errs
} | clean up folder path so that it is what vsphere expects | hashicorp_packer | train | go |
0721c18cc4c4d174160c44c1c95568a384250ebe | diff --git a/test/config.js b/test/config.js
index <HASH>..<HASH> 100644
--- a/test/config.js
+++ b/test/config.js
@@ -1,6 +1,6 @@
require('chai').should();
-describe.only('the ghapi.json config file', function(){
+describe('the ghapi.json config file', function(){
'use strict';
var Request = require('../lib/utils/request'), | Removing the .only flag from config tests. | grasshopper-cms_grasshopper-api-js | train | js |
fe92eb757829079d62b81d409faa1e3bfdf4dc5d | diff --git a/fs/inode/dir.go b/fs/inode/dir.go
index <HASH>..<HASH> 100644
--- a/fs/inode/dir.go
+++ b/fs/inode/dir.go
@@ -437,11 +437,15 @@ func (d *DirInode) LookUpChild(
o = fileRecord
}
- // TODO(jacobsa): Update the cache to say file here if fileRecord != nil
- panic("TODO")
+ // Update the cache.
+ now = time.Now()
+ if fileRecord != nil {
+ d.cache.NoteFile(now, name)
+ }
- // TODO(jacobsa): Update the cache to say dir here if dirRecord != nil
- panic("TODO")
+ if dirRecord != nil {
+ d.cache.NoteDir(now, name)
+ }
return
} | Update the type cache in LookUpChild. | jacobsa_timeutil | train | go |
1900703997b5b6ed6ff98ff934e165dd1d1b43a3 | diff --git a/db_tests/db_loader_unittest.py b/db_tests/db_loader_unittest.py
index <HASH>..<HASH> 100644
--- a/db_tests/db_loader_unittest.py
+++ b/db_tests/db_loader_unittest.py
@@ -103,6 +103,13 @@ class NrmlModelLoaderDBTestCase(unittest.TestCase):
class CsvModelLoaderDBTestCase(unittest.TestCase):
+ def setUp(self):
+ csv_file = "ISC_sampledata1.csv"
+ self.csv_path = helpers.get_data_path(csv_file)
+ self.db_loader = db_loader.CsvModelLoader(self.csv_path, None, 'eqcat')
+ self.db_loader._read_model()
+ self.csv_reader = self.db_loader.csv_reader
+
def test_csv_to_db_loader_end_to_end(self):
"""
* Serializes the csv into the database | added missing setUp method, probably merging conflicts has broken something
Former-commit-id: <I>d<I>ddd<I>a<I>fd<I>ce8fd7b3c0a<I>e<I> | gem_oq-engine | train | py |
7ff5a0e84593dad6fbd50551343618d7956b3c71 | diff --git a/trie.go b/trie.go
index <HASH>..<HASH> 100644
--- a/trie.go
+++ b/trie.go
@@ -284,6 +284,9 @@ func (p *prefixTrie) remove(network rnet.Network) (RangerEntry, error) {
}
return entry, nil
}
+ if p.targetBitPosition() < 0 {
+ return nil, nil
+ }
bit, err := p.targetBitFromIP(network.Number)
if err != nil {
return nil, err
diff --git a/trie_test.go b/trie_test.go
index <HASH>..<HASH> 100644
--- a/trie_test.go
+++ b/trie_test.go
@@ -137,6 +137,16 @@ func TestPrefixTrieRemove(t *testing.T) {
},
{
rnet.IPv4,
+ []string{"192.168.0.1/32"},
+ []string{"192.168.0.1/24"},
+ []string{""},
+ []string{"192.168.0.1/32"},
+ `0.0.0.0/0 (target_pos:31:has_entry:false)
+| 1--> 192.168.0.1/32 (target_pos:-1:has_entry:true)`,
+ "remove from ranger that contains a single ip block",
+ },
+ {
+ rnet.IPv4,
[]string{"1.2.3.4/32", "1.2.3.5/32"},
[]string{"1.2.3.5/32"},
[]string{"1.2.3.5/32"}, | Prevent checking beyond lsb in a network in a remove call (#<I>) | yl2chen_cidranger | train | go,go |
2cb16d8f9be3788cbf75bd61232a208d7805ce50 | diff --git a/question/type/shortanswer/edit_shortanswer_form.php b/question/type/shortanswer/edit_shortanswer_form.php
index <HASH>..<HASH> 100644
--- a/question/type/shortanswer/edit_shortanswer_form.php
+++ b/question/type/shortanswer/edit_shortanswer_form.php
@@ -68,13 +68,10 @@ class question_edit_shortanswer_form extends question_edit_form {
$answers = $data['answer'];
$answercount = 0;
$maxgrade = false;
- foreach ($answers as $key => $answer){
+ foreach ($answers as $key => $answer) {
$trimmedanswer = trim($answer);
if (!empty($trimmedanswer)){
$answercount++;
- }
- // Check grades
- if ($answer != '') {
if ($data['fraction'][$key] == 1) {
$maxgrade = true;
} | Minor improvement to validation code. Merged from MOODLE_<I>_STABLE. | moodle_moodle | train | php |
d6da9d0459189989ae4b08256c09df0369cdc30c | diff --git a/tools/TestProcedureDoc/generateTestCampaignDoc.py b/tools/TestProcedureDoc/generateTestCampaignDoc.py
index <HASH>..<HASH> 100644
--- a/tools/TestProcedureDoc/generateTestCampaignDoc.py
+++ b/tools/TestProcedureDoc/generateTestCampaignDoc.py
@@ -200,7 +200,7 @@ def aggregateTestCaseDoc(testCaseName, testCaseDir, selectedRows, selectedRowsFo
if tag == "th":
et.SubElement(trElem, tag, {'width':'3%'}).text = 'Result'
elif tag == "td":
- et.SubElement(trElem, tag).text = ' ' # non-breakable space
+ et.SubElement(trElem, tag).text = u'\u00A0' # non-breakable space
testStepsTable = et.tostring(testStepsTableHtmlTree, 'utf-8')
if DUPLICATE_STEPS_PER_TEST_DATA_ROW:
contentBeforeSteps = content[:testStepsTableMatch.start(0)] | Issue #<I>: use real non-breakable space, not normal whitespace | qspin_qtaste | train | py |
66f7f25adb2ec1c33420417f34c5628c4337c130 | diff --git a/test/unit/rubyext_test.rb b/test/unit/rubyext_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/rubyext_test.rb
+++ b/test/unit/rubyext_test.rb
@@ -22,8 +22,7 @@ module Tire
end
- should "have a to_json method from Yajl" do
- assert defined?(Yajl)
+ should "have a to_json method from a JSON serialization library" do
assert_respond_to( {}, :to_json )
assert_equal '{"one":1}', { :one => 1}.to_json
end | [TEST] Do not test for `Yajl` presence (eg. on jRuby) | karmi_retire | train | rb |
dc94ebc42f984ed5b1de6c08eba87c808d790bc7 | diff --git a/lark/load_grammar.py b/lark/load_grammar.py
index <HASH>..<HASH> 100644
--- a/lark/load_grammar.py
+++ b/lark/load_grammar.py
@@ -511,12 +511,12 @@ class Grammar:
simplify_rule = SimplifyRule_Visitor()
compiled_rules = []
- for i, rule_content in enumerate(rules):
+ for rule_content in rules:
name, tree, options = rule_content
simplify_rule.visit(tree)
expansions = rule_tree_to_text.transform(tree)
- for expansion, alias in expansions:
+ for i, (expansion, alias) in enumerate(expansions):
if alias and name.startswith('_'):
raise GrammarError("Rule %s is marked for expansion (it starts with an underscore) and isn't allowed to have aliases (alias=%s)" % (name, alias)) | Fix Earley non-determinism
Rule.order should be set as the index of each expansion with rules
of the same name (e.g: a : b # rule.order 1 | c # rule.order 2). | lark-parser_lark | train | py |
bc46abaa40816cdfad9573ab074202a7a198a5f4 | diff --git a/src/test/groovy/security/SignedJarTest.java b/src/test/groovy/security/SignedJarTest.java
index <HASH>..<HASH> 100644
--- a/src/test/groovy/security/SignedJarTest.java
+++ b/src/test/groovy/security/SignedJarTest.java
@@ -40,4 +40,4 @@ public class SignedJarTest extends SecurityTestSupport {
executeTest(c, null);
}
-}
\ No newline at end of file
+} | Dummy commit on SignedJarTest to see whether BeetleJuice has badly checked out the file or something?
git-svn-id: <URL> | apache_groovy | train | java |
8b829930a048122920fee9c955df8f0800931336 | diff --git a/livetests.py b/livetests.py
index <HASH>..<HASH> 100755
--- a/livetests.py
+++ b/livetests.py
@@ -52,7 +52,7 @@ def _initialize(api):
@pytest.fixture(
- scope="module", params=["2.16.22", "3.0.13", "3.1.8", "3.2.3", "3.3.0-rc3"]
+ scope="module", params=["2.16.23", "3.0.13", "3.1.8", "3.2.3", "3.3.0-rc3"]
)
def gerrit_api(request):
"""Create a Gerrit container for the given version and return an API.""" | Set the <I> version in livetests | dpursehouse_pygerrit2 | train | py |
788ac507199d36ecbd6b5ad3ed74d5e25261c6e2 | diff --git a/cli50/__main__.py b/cli50/__main__.py
index <HASH>..<HASH> 100644
--- a/cli50/__main__.py
+++ b/cli50/__main__.py
@@ -46,7 +46,7 @@ def main():
# Check if Docker running
try:
- stdout = subprocess.check_call(["docker", "info"], stderr=subprocess.DEVNULL, timeout=10)
+ stdout = subprocess.check_call(["docker", "info"], stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL, timeout=10)
except subprocess.CalledProcessError:
sys.exit("Docker not running.")
except subprocess.TimeoutExpired:
@@ -176,7 +176,8 @@ def main():
print(ports(container))
# Let user interact with container
- os.execlp("docker", "docker", "attach", container)
+ print(subprocess.check_output(["docker", "logs", container]).decode("utf-8"), end="")
+ os.execvp("docker", ["docker", "attach", container])
except (subprocess.CalledProcessError, OSError):
sys.exit(1) | fixed buffering of stdout, removed docker info | cs50_cli50 | train | py |
5f5a04a9d85ea7e60ccaeadb64a2fee3d4deef00 | diff --git a/test/StoragelessSessionTest/Http/SessionMiddlewareTest.php b/test/StoragelessSessionTest/Http/SessionMiddlewareTest.php
index <HASH>..<HASH> 100644
--- a/test/StoragelessSessionTest/Http/SessionMiddlewareTest.php
+++ b/test/StoragelessSessionTest/Http/SessionMiddlewareTest.php
@@ -170,7 +170,7 @@ final class SessionMiddlewareTest extends PHPUnit_Framework_TestCase
->withCookieParams([
SessionMiddleware::DEFAULT_COOKIE => (string) (new Builder())
->setExpiration((new \DateTime('+1 day'))->getTimestamp())
- ->set(SessionMiddleware::SESSION_CLAIM, DefaultSessionData::fromTokenData(['foo' => 'bar']))
+ ->set(SessionMiddleware::SESSION_CLAIM, DefaultSessionData::newEmptySession())
->sign($this->getSigner($middleware), $this->getSignatureKey($middleware))
->getToken()
]); | Correcting test cases for when the `'iat'` claim is not available | psr7-sessions_storageless | train | php |
f5811d2460537c0e32245dd20f4e426be469720c | diff --git a/strategies/kubernetes.js b/strategies/kubernetes.js
index <HASH>..<HASH> 100644
--- a/strategies/kubernetes.js
+++ b/strategies/kubernetes.js
@@ -410,7 +410,7 @@ const engine = {
options.params.variables.push('SOAJS_DEPLOY_HA=kubernetes');
let service = utils.cloneObj(require(__dirname + '/../schemas/kubernetes/service.template.js'));
- service.metadata.name = options.params.name;
+ service.metadata.name = cleanLabel(options.params.name);
if (options.params.labels['soajs.service.name'] !== 'controller') {
service.metadata.name += '-service';
} | Updated kubernetes service name in deployService(), kubernetes driver | soajs_soajs.core.drivers | train | js |
b1d235907bb2dfe297fb5b5f8296a8263d2279a5 | diff --git a/src/Moltin/SDK/Facade/Gateway.php b/src/Moltin/SDK/Facade/Gateway.php
index <HASH>..<HASH> 100644
--- a/src/Moltin/SDK/Facade/Gateway.php
+++ b/src/Moltin/SDK/Facade/Gateway.php
@@ -46,7 +46,7 @@ class Gateway
public static function Update($slug, $data)
{
- return self::$sdk->put('gateway/'.$slug, $data);
+ return self::$sdk->put('gateways/'.$slug, $data);
}
public static function Enable($slug) | Facade - Gateway Plural Update | moltin_php-sdk | train | php |
3e1c894b88920ec1ac5ea59a6718b7dd308c5bae | diff --git a/lib/pod/command/lib/archive.rb b/lib/pod/command/lib/archive.rb
index <HASH>..<HASH> 100644
--- a/lib/pod/command/lib/archive.rb
+++ b/lib/pod/command/lib/archive.rb
@@ -26,9 +26,7 @@ module Pod
This tool is useful if your primary distribution mechanism is CocoaPods but a significat portion of your userbase does not yet use dependency management. Instead, they receive a closed-source version with manual integration instructions.
DESC
- self.arguments = [
- CLAide::Argument.new("[NAME]", :optional)
- ]
+ self.arguments = [ ["[NAME]", :optional] ]
attr_accessor :spec | Remove direct reference to CLAide::Argument | braintreeps_cocoapods-archive | train | rb |
f5d7402bc17c7274ba4ce5d85425282b43f13b2e | diff --git a/lib/middleware/nunjucks-configuration/nunjucks-configuration.js b/lib/middleware/nunjucks-configuration/nunjucks-configuration.js
index <HASH>..<HASH> 100644
--- a/lib/middleware/nunjucks-configuration/nunjucks-configuration.js
+++ b/lib/middleware/nunjucks-configuration/nunjucks-configuration.js
@@ -13,6 +13,9 @@ const nunjucksHelpers = require('@ministryofjustice/fb-components/templates/nunj
const cloneDeep = require('lodash.clonedeep')
+const debug = require('debug')
+const error = debug('runner:nunjucks-configuration:error')
+
let nunjucksAppEnv
const nunjucksConfiguration = (app, components = [], options = {}) => {
@@ -129,8 +132,7 @@ const getPageOutput = async (pageInstance, context = {}) => {
const renderContext = Object.assign({}, context, { page })
nunjucksAppEnv.render(templatePath, renderContext, (err, output) => {
if (err) {
- // TODO: log error not console.log(err)
- // console.log({templatePath, page})
+ error(`${templatePath} -> ${err.message}`)
reject(err)
}
Object.keys(sanitizeMatches).forEach(property => { | Add error logging in a place where someone said there should be error logging | ministryofjustice_fb-runner-node | train | js |
f0013cff260ed04be9b5eb0b9d3c9bc603adb78a | diff --git a/deployments.go b/deployments.go
index <HASH>..<HASH> 100644
--- a/deployments.go
+++ b/deployments.go
@@ -81,15 +81,23 @@ func (s *deployerService) Deploy(ctx context.Context, db *gorm.DB, opts DeployOp
return r, err
}
+ if err != nil {
+ return r, err
+ }
+
if s, ok := stream.(scheduler.SubscribableStream); ok {
for update := range s.Subscribe() {
msg := fmt.Sprintf("Status: %s", update.String())
- write(msg, opts.Output)
+ if err := write(msg, opts.Output); err != nil {
+ return r, err
+ }
}
if err := s.Error(); err != nil {
msg := fmt.Sprintf("Error: %s", err.Error())
- write(msg, opts.Output)
+ if err := write(msg, opts.Output); err != nil {
+ return r, err
+ }
}
} | Handle errors before subscribing to the stream | remind101_empire | train | go |
d7f778d559e16d8d52f261c57f24404ec920d211 | diff --git a/plugs/message/html/render/about.js b/plugs/message/html/render/about.js
index <HASH>..<HASH> 100644
--- a/plugs/message/html/render/about.js
+++ b/plugs/message/html/render/about.js
@@ -89,6 +89,8 @@ exports.create = function (api) {
function isRenderable (msg) {
if (msg.value.content.type !== 'about') return
if (!ref.isFeed(msg.value.content.about)) return
+ var c = msg.value.content
+ if (!c || !c.description || !c.image || !c.name) return
return true
}
} | don't include about messages in feed that can't be rendered
currently showing as empty FeedEvent divs | ssbc_patchwork | train | js |
90b2df1b662fcf639e9c36863b57da6027b4bfc6 | diff --git a/slither/core/declarations/function.py b/slither/core/declarations/function.py
index <HASH>..<HASH> 100644
--- a/slither/core/declarations/function.py
+++ b/slither/core/declarations/function.py
@@ -298,7 +298,7 @@ class Function(metaclass=ABCMeta): # pylint: disable=too-many-public-methods
def can_send_eth(self) -> bool:
"""
- Check if the function can send eth
+ Check if the function or any internal (not external) functions called by it can send eth
:return bool:
"""
from slither.slithir.operations import Call | improve docstring of Function.can_send_eth | crytic_slither | train | py |
0085042890d83840ca75d1783affaaceac2f7eb1 | diff --git a/autorun.php b/autorun.php
index <HASH>..<HASH> 100644
--- a/autorun.php
+++ b/autorun.php
@@ -15,6 +15,13 @@
function SimpleTestAutoRunner() {
global $SIMPLE_TEST_AUTORUNNER_INITIAL_CLASSES;
+ //are tests already executed? If yes no autorunning.
+ if ($ctx = SimpleTest :: getContext()) {
+ if ($ctx->getTest()) {
+ return;
+ }
+ }
+
$file = reset(get_included_files());
$diff_classes = array_diff(get_declared_classes(),
$SIMPLE_TEST_AUTORUNNER_INITIAL_CLASSES ? | Autorunning only works when scripts are executed directly with PHP, if tests are already included into test group and executed autorunning is skipped | simpletest_simpletest | train | php |
8b85cd7302ac55365e99bcdf738f9fa73c1546a3 | diff --git a/network/datadog_checks/network/network.py b/network/datadog_checks/network/network.py
index <HASH>..<HASH> 100644
--- a/network/datadog_checks/network/network.py
+++ b/network/datadog_checks/network/network.py
@@ -243,6 +243,10 @@ class Network(AgentCheck):
# Skip this network interface.
return False
+ # adding the device to the tags as device_name is deprecated
+ metric_tags = [] if tags is None else tags[:]
+ metric_tags.append('device:{}'.format(iface))
+
expected_metrics = [
'bytes_rcvd',
'bytes_sent',
@@ -257,7 +261,7 @@ class Network(AgentCheck):
count = 0
for metric, val in vals_by_metric.iteritems():
- self.rate('system.net.%s' % metric, val, device_name=iface, tags=tags)
+ self.rate('system.net.%s' % metric, val, tags=metric_tags)
count += 1
self.log.debug("tracked %s network metrics for interface %s" % (count, iface)) | Adding the device to the tags as device_name is deprecated. (#<I>) | DataDog_integrations-core | train | py |
44789719affb9aabe0a50744133206f67333817c | diff --git a/model/src/main/java/com/basistech/rosette/apimodel/Entity.java b/model/src/main/java/com/basistech/rosette/apimodel/Entity.java
index <HASH>..<HASH> 100644
--- a/model/src/main/java/com/basistech/rosette/apimodel/Entity.java
+++ b/model/src/main/java/com/basistech/rosette/apimodel/Entity.java
@@ -85,7 +85,7 @@ public class Entity {
/**
* @return the DBpediaType
*/
- private final String dbpediaType;
+ private final List<String> dbpediaType;
/**
* @return the PermID | WS-<I>: DBpedia response type is now an ArrayList of Strings. | rosette-api_java | train | java |
80f264c2b22adf51f5c488c3ca30c576ac707cf1 | diff --git a/src/Datagrid/ProxyQuery.php b/src/Datagrid/ProxyQuery.php
index <HASH>..<HASH> 100644
--- a/src/Datagrid/ProxyQuery.php
+++ b/src/Datagrid/ProxyQuery.php
@@ -192,7 +192,7 @@ class ProxyQuery implements ProxyQueryInterface
public function execute(array $params = [], $hydrationMode = null)
{
// NEXT_MAJOR: Remove this check and update method signature to `execute()`.
- if ([] !== $params || null !== $hydrationMode) {
+ if (\func_num_args() > 0) {
@trigger_error(sprintf(
'Passing arguments to "%s()" is deprecated since sonata-project/doctrine-orm-admin-bundle 3.x.',
__METHOD__, | Deprecate passing arguments to `ProxyQuery::execute()`, regardless its values | sonata-project_SonataDoctrineORMAdminBundle | train | php |
ac10f85b6a3f0732e43d67cfa890afa5f22eb333 | diff --git a/routes/api.js b/routes/api.js
index <HASH>..<HASH> 100644
--- a/routes/api.js
+++ b/routes/api.js
@@ -613,12 +613,28 @@ var clientReg = function (req, res, next) {
}
if (_(params).has('logo_url')) {
- // XXX: copy logo?
- props.logo_url = params.logo_url;
+ try {
+ check(params.logo_url).isUrl();
+ props.logo_url = params.logo_url;
+ } catch (e) {
+ next(new HTTPError("Invalid logo_url.", 400));
+ return;
+ }
}
if (_(params).has('redirect_uris')) {
props.redirect_uris = params.redirect_uris.split(" ");
+ if (!props.redirect_uris.every(function(uri) {
+ try {
+ check(uri).isUrl();
+ return true;
+ } catch (err) {
+ return false;
+ }
+ })) {
+ next(new HTTPError("redirect_uris must be space-separated URLs.", 400));
+ return;
+ }
}
if (type === 'client_associate') { | validate logo_url and redirect_uris | pump-io_pump.io | train | js |
52884c8dcb344e26a6a62c8e25b9360ece7e05af | diff --git a/pkg/fab/events/client/client.go b/pkg/fab/events/client/client.go
index <HASH>..<HASH> 100755
--- a/pkg/fab/events/client/client.go
+++ b/pkg/fab/events/client/client.go
@@ -120,12 +120,6 @@ func (c *Client) Close() {
func (c *Client) close(force bool) bool {
logger.Debug("Attempting to close event client...")
- if !c.setStoppped() {
- // Already stopped
- logger.Debug("Client already stopped")
- return true
- }
-
if !force {
// Check if there are any outstanding registrations
regInfoCh := make(chan *esdispatcher.RegistrationInfo)
@@ -144,6 +138,12 @@ func (c *Client) close(force bool) bool {
}
}
+ if !c.setStoppped() {
+ // Already stopped
+ logger.Debug("Client already stopped")
+ return true
+ }
+
logger.Debug("Stopping client...")
c.closeConnectEventChan()
@@ -389,6 +389,8 @@ func (c *Client) reconnect() {
if err := c.connectWithRetry(c.maxReconnAttempts, c.timeBetweenConnAttempts); err != nil {
logger.Warnf("Could not reconnect event client: %s. Closing.", err)
c.Close()
+ } else {
+ logger.Infof("Event client has reconnected")
}
} | [FABG-<I>] Fix bug in check for idle event client
Set the stopped flag after the check for outstanding
registrations..
Change-Id: I3ebb8a4a<I>a<I>b<I>c<I>c<I>bfec8c2a8f | hyperledger_fabric-sdk-go | train | go |
6561a05617486f49e2e6d310fb582a55df0e6e48 | diff --git a/src/pywws/__init__.py b/src/pywws/__init__.py
index <HASH>..<HASH> 100644
--- a/src/pywws/__init__.py
+++ b/src/pywws/__init__.py
@@ -1,3 +1,3 @@
__version__ = '18.4.2'
-_release = '1486'
-_commit = '7ef35ab'
+_release = '1487'
+_commit = 'd86023c'
diff --git a/src/pywws/service/metoffice.py b/src/pywws/service/metoffice.py
index <HASH>..<HASH> 100644
--- a/src/pywws/service/metoffice.py
+++ b/src/pywws/service/metoffice.py
@@ -36,7 +36,7 @@ logger = logging.getLogger(__package__ + '.' + service_name)
class ToService(pywws.service.BaseToService):
catchup = 7
fixed_data = {'softwaretype': 'pywws v' + pywws.__version__}
- interval = timedelta(seconds=290)
+ interval = timedelta(seconds=300)
logger = logger
service_name = service_name
template = """ | Set metoffice interval to five minutes exactly
Even a few seconds less causes the dreaded "duplicate data" messages. | jim-easterbrook_pywws | train | py,py |
2e38de484f3825053d1084c989dc44ccb8a7cb63 | diff --git a/src/main/java/javascalautils/concurrent/FutureCompanion.java b/src/main/java/javascalautils/concurrent/FutureCompanion.java
index <HASH>..<HASH> 100644
--- a/src/main/java/javascalautils/concurrent/FutureCompanion.java
+++ b/src/main/java/javascalautils/concurrent/FutureCompanion.java
@@ -31,8 +31,8 @@ import javascalautils.ThrowableFunction0;
* <pre>
* import static javascalautils.FutureCompanion.Future;
*
- * Future<Integer> resultSuccess = Future.(() -> 9 / 3); // The Future will at some point contain: Success(3)
- * Future<Integer> resultFailure = Future.(() -> 9 / 0); // The Future will at some point contain: Failure(ArithmeticException)
+ * Future<Integer> resultSuccess = Future(() -> 9 / 3); // The Future will at some point contain: Success(3)
+ * Future<Integer> resultFailure = Future(() -> 9 / 0); // The Future will at some point contain: Failure(ArithmeticException)
* </pre>
*
* </blockquote> | corrected javadoc for FutureCompanion | pnerg_java-scala-util | train | java |
c1291cbabb984e7fe34897b22f202cf776a3fe65 | diff --git a/simuvex/storage/file.py b/simuvex/storage/file.py
index <HASH>..<HASH> 100644
--- a/simuvex/storage/file.py
+++ b/simuvex/storage/file.py
@@ -220,6 +220,10 @@ class SimFile(SimStatePlugin):
[ o.content for o in others ], merge_conditions, common_ancestor=common_ancestor
)
+ def widen(self, others):
+ return self.merge(others, [])
+
+
class SimDialogue(SimFile):
"""
Emulates a dialogue with a program. Enables us to perform concrete short reads. | Add a dummy implementation for widening SimFiles. | angr_angr | train | py |
2c27ab9165e6d415a0335b089912fc7a1bc1942b | diff --git a/src/Library.php b/src/Library.php
index <HASH>..<HASH> 100644
--- a/src/Library.php
+++ b/src/Library.php
@@ -850,7 +850,7 @@ class Library
}
if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {
- $merged[$key] = array_merge_recursive_distinct($merged[$key], $value);
+ $merged[$key] = self::array_merge_recursive_distinct($merged[$key], $value);
} else {
$merged[$key] = $value;
} | array_merge_recursive_distinct() to
self:array_merge_recursive_distinct() in Bolt\Library | bolt_bolt | train | php |
b414bb5ff5366ad451934ea101193d76bfa706f4 | diff --git a/releaf-i18n_database/app/controllers/releaf/i18n_database/translations_controller.rb b/releaf-i18n_database/app/controllers/releaf/i18n_database/translations_controller.rb
index <HASH>..<HASH> 100644
--- a/releaf-i18n_database/app/controllers/releaf/i18n_database/translations_controller.rb
+++ b/releaf-i18n_database/app/controllers/releaf/i18n_database/translations_controller.rb
@@ -88,10 +88,12 @@ module Releaf::I18nDatabase
}
end
+ def action_views
+ super.merge(import: :edit)
+ end
+
def action_features
- {
- index: :index,
- }.with_indifferent_access
+ {index: :index}.with_indifferent_access
end
private | Fix translation import style, by defining import view as edit | cubesystems_releaf | train | rb |
3447894b914a177df8c753d25010971484e2c8c6 | diff --git a/lib/autoscaling.js b/lib/autoscaling.js
index <HASH>..<HASH> 100644
--- a/lib/autoscaling.js
+++ b/lib/autoscaling.js
@@ -92,16 +92,18 @@ module.exports = function (logger) {
}
]);
getParamFromParents(c, 'LoadBalancerName', function (err, loadBalancerName) {
+ var loadBalancerNames = [];
+ if (loadBalancerName) {
+ loadBalancerNames.push(loadBalancerName);
+ }
var params = {
AutoScalingGroupName: config.defaultGroupName || groupName,
MaxSize: 3, /* required */
MinSize: 1,
HealthCheckGracePeriod: 3 * 60, // three minutes, might be 5?
- HealthCheckType: 'ELB', // EC2 if a parent ELB could not be found
+ HealthCheckType: loadBalancerName ? 'ELB' : 'EC2', // EC2 if a parent ELB could not be found
LaunchConfigurationName: config.defaultLaunchName || launchName,
- LoadBalancerNames: [
- loadBalancerName
- ],
+ LoadBalancerNames: loadBalancerNames,
Tags: tags,
VPCZoneIdentifier: config.defaultSubnetId
}; | Support autoscaling groups without an ELB. | nearform_aws-autoscaling-container | train | js |
4dba6719eb5daa05bded442328a83cdcac6255ae | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,7 @@ setup(
license='MIT',
description='Double entry book keeping in Django',
long_description=open('README.rst').read() if exists("README.rst") else "",
+ include_package_data=True,
install_requires=[
'django>=1.8',
'django-mptt>=0.8', | setting include_package_data=True in setup.py to ensure static files are included | adamcharnock_django-hordak | train | py |
778df45d99bcfcea67556d7e054c07d344fddfca | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,8 @@
#!/usr/bin/env python
# coding=utf-8
+
+import codecs
+
from setuptools import setup
classifiers = """
@@ -54,5 +57,5 @@ setup(
classifiers=list(filter(None, classifiers.split('\n'))),
description='Facilitates automated and reproducible experimental research',
- long_description=open('README.rst').read()
+ long_description=codecs.open('README.rst', encoding='utf_8').read()
) | Fix a bug where a unicode char in README.rst would fail install (#<I>) | IDSIA_sacred | train | py |
2e3387dcf06e6692882a09d14e2df1ae222962bb | diff --git a/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/IO.java b/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/IO.java
index <HASH>..<HASH> 100644
--- a/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/IO.java
+++ b/core/codegen-runtime/src/main/java/org/overture/codegen/runtime/IO.java
@@ -86,11 +86,11 @@ public class IO {
}
public boolean echo(String text) {
- return fecho("", text, null);
+ return fecho("[]", text, null);
}
public boolean echo(VDMSeq text) {
- return fecho("", SeqUtil.toStr(text), null);
+ return fecho("[]", SeqUtil.toStr(text), null);
}
public boolean fecho(String filename, String text, Number fdir) { | Minor fix to the Java codegen runtime represention of the echo operation | overturetool_overture | train | java |
11ebf4af6ef79fa7253669abee298fa65d099829 | diff --git a/www/javascript/swat-checkbox-cell-renderer.js b/www/javascript/swat-checkbox-cell-renderer.js
index <HASH>..<HASH> 100644
--- a/www/javascript/swat-checkbox-cell-renderer.js
+++ b/www/javascript/swat-checkbox-cell-renderer.js
@@ -33,12 +33,22 @@ function SwatCheckboxCellRenderer(id, view)
YAHOO.util.Event.addListener(input_nodes[i], 'dblclick',
this.handleClick, this, true);
+
+ // prevent selecting label text when shify key is held
+ YAHOO.util.Event.addListener(input_nodes[i].parentNode, 'mousedown',
+ this.handleMouseDown, this, true);
}
}
this.last_clicked_index = null;
}
+SwatCheckboxCellRenderer.prototype.handleMouseDown = function(e)
+{
+ // prevent selecting label text when shify key is held
+ YAHOO.util.Event.preventDefault(e);
+}
+
SwatCheckboxCellRenderer.prototype.handleClick = function(e)
{
var checkbox_node = YAHOO.util.Event.getTarget(e); | Prevent bug that caused text to accidentally be selected when shift-clicking.
svn commit r<I> | silverorange_swat | train | js |
bbe686d579ba9e0c25156f4f83dd66943c7ced8c | diff --git a/bigquery/tests/system.py b/bigquery/tests/system.py
index <HASH>..<HASH> 100644
--- a/bigquery/tests/system.py
+++ b/bigquery/tests/system.py
@@ -107,6 +107,11 @@ TIME_PARTITIONING_CLUSTERING_FIELDS_SCHEMA = [
),
]
+# The VPC-SC team maintains a mirror of the GCS bucket used for code
+# samples. The public bucket crosses the configured security boundary.
+# See: https://github.com/googleapis/google-cloud-python/issues/8550
+SAMPLES_BUCKET = os.environ.get("GCLOUD_TEST_SAMPLES_BUCKET", "cloud-samples-data")
+
retry_storage_errors = RetryErrors(
(TooManyRequests, InternalServerError, ServiceUnavailable)
)
@@ -1877,7 +1882,9 @@ class TestBigQuery(unittest.TestCase):
language="JAVASCRIPT",
type_="SCALAR_FUNCTION",
return_type=float64_type,
- imported_libraries=["gs://cloud-samples-data/bigquery/udfs/max-value.js"],
+ imported_libraries=[
+ "gs://{}/bigquery/udfs/max-value.js".format(SAMPLES_BUCKET)
+ ],
)
routine.arguments = [
bigquery.RoutineArgument( | Use configurable bucket name for GCS samples data in systems tests. (#<I>)
* Use configurable bucket name for GCS samples data in systems tests.
This allows the VPC-SC team to use their private mirror which is within
the security boundary when testing BigQuery VPC-SC support.
* Blacken | googleapis_google-cloud-python | train | py |
9afa4bf6a5ae4bb9f67a6f0a431903a74b74985f | diff --git a/src/com/google/bitcoin/core/VersionMessage.java b/src/com/google/bitcoin/core/VersionMessage.java
index <HASH>..<HASH> 100644
--- a/src/com/google/bitcoin/core/VersionMessage.java
+++ b/src/com/google/bitcoin/core/VersionMessage.java
@@ -75,10 +75,13 @@ public class VersionMessage extends Message {
// Note that the official client doesn't do anything with these, and finding out your own external IP address
// is kind of tricky anyway, so we just put nonsense here for now.
try {
- myAddr = new PeerAddress(InetAddress.getLocalHost(), params.port, 0);
- theirAddr = new PeerAddress(InetAddress.getLocalHost(), params.port, 0);
+ // We hard-code the IPv4 localhost address here rather than use InetAddress.getLocalHost() because some
+ // mobile phones have broken localhost DNS entries, also, this is faster.
+ final byte[] localhost = new byte[] { 127, 0, 0, 1 };
+ myAddr = new PeerAddress(InetAddress.getByAddress(localhost), params.port, 0);
+ theirAddr = new PeerAddress(InetAddress.getByAddress(localhost), params.port, 0);
} catch (UnknownHostException e) {
- throw new RuntimeException(e); // Cannot happen.
+ throw new RuntimeException(e); // Cannot happen (illegal IP length).
}
subVer = "/BitCoinJ:0.4-SNAPSHOT/";
bestHeight = newBestHeight; | Create the localhost address without relying on a method that does DNS lookups behind the scenes. Resolves issue <I>. | bitcoinj_bitcoinj | train | java |
67dfa962acb6dabdf9dd5c015489e7220bd3339b | diff --git a/src/components/Tile/Tile.js b/src/components/Tile/Tile.js
index <HASH>..<HASH> 100644
--- a/src/components/Tile/Tile.js
+++ b/src/components/Tile/Tile.js
@@ -154,15 +154,14 @@ export class SelectableTile extends Component {
);
return (
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions,jsx-a11y/onclick-has-role
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<label
htmlFor={id}
className={classes}
tabIndex={tabIndex}
{...other}
onClick={this.handleClick}
- onKeyDown={this.handleKeyDown}
- role="presentation">
+ onKeyDown={this.handleKeyDown}>
<input
ref={input => {
this.input = input; | fix(a<I>y): remove role from label (#<I>) | carbon-design-system_carbon-components-react | train | js |
ae3425eaaa0b3f3be77fd21d808ed508269544a2 | diff --git a/hitch.go b/hitch.go
index <HASH>..<HASH> 100644
--- a/hitch.go
+++ b/hitch.go
@@ -101,8 +101,7 @@ const paramsKey key = 1
func wrap(handler http.Handler) httprouter.Handle {
return func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
ctx := context.WithValue(req.Context(), paramsKey, params)
- *req = *req.WithContext(ctx)
- handler.ServeHTTP(w, req)
+ handler.ServeHTTP(w, req.WithContext(ctx))
}
} | fixed to not dereference a request | nbio_hitch | train | go |
e426c400fb2e245c185d05428903d33c52c747d6 | diff --git a/server/webapp/WEB-INF/rails.new/spec/webpack/lib/plugin_endpoint_spec.js b/server/webapp/WEB-INF/rails.new/spec/webpack/lib/plugin_endpoint_spec.js
index <HASH>..<HASH> 100644
--- a/server/webapp/WEB-INF/rails.new/spec/webpack/lib/plugin_endpoint_spec.js
+++ b/server/webapp/WEB-INF/rails.new/spec/webpack/lib/plugin_endpoint_spec.js
@@ -39,9 +39,11 @@
}
};
- window.postMessage = function(message, _origin) {
- dispatch(mockEvent(message));
- };
+ Object.defineProperty(window, "postMessage", {
+ value: function(message, _origin) {
+ dispatch(mockEvent(message));
+ }
+ });
PluginEndpoint.ensure();
}); | Fix plugin_endpoint_spec in IE strict mode | gocd_gocd | train | js |
079e4f78e76c9043243d41f0d60dd9996467a809 | diff --git a/tests/src/test/java/org/sonarqube/tests/performance/scanner/HighlightingTest.java b/tests/src/test/java/org/sonarqube/tests/performance/scanner/HighlightingTest.java
index <HASH>..<HASH> 100644
--- a/tests/src/test/java/org/sonarqube/tests/performance/scanner/HighlightingTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/performance/scanner/HighlightingTest.java
@@ -100,7 +100,7 @@ public class HighlightingTest extends AbstractPerfTest {
perfRule.assertDurationAround(MavenLogs.extractTotalTime(result.getLogs()), 25700L);
Properties prof = readProfiling(baseDir, "highlighting");
- perfRule.assertDurationAround(Long.valueOf(prof.getProperty("Xoo Highlighting Sensor")), 9700L);
+ perfRule.assertDurationAround(Long.valueOf(prof.getProperty("Xoo Highlighting Sensor")), 8900L);
}
} | Fix excepted time of perf test | SonarSource_sonarqube | train | java |
600c3371a22255fb9cade4e5ae8507ea0c4b3832 | diff --git a/openstack_dashboard/dashboards/project/stacks/forms.py b/openstack_dashboard/dashboards/project/stacks/forms.py
index <HASH>..<HASH> 100644
--- a/openstack_dashboard/dashboards/project/stacks/forms.py
+++ b/openstack_dashboard/dashboards/project/stacks/forms.py
@@ -295,8 +295,8 @@ class CreateStackForm(forms.SelfHandlingForm):
if param in params:
params_in_order.append((param, params[param]))
else:
- # no parameter groups, so no way to determine order
- params_in_order = params.items()
+ # no parameter groups, simply sorted to make the order fixed
+ params_in_order = sorted(params.items())
for param_key, param in params_in_order:
field = None
field_key = self.param_prefix + param_key | Make params order fixed in stack forms
Horizon input fields may be swapped when launching stack instances
with some errors. The patch make params order fixed by simply sort
them.
Change-Id: Ied3e<I>cfa<I>a<I>bde<I>ddc<I>ff3c<I>b3cac3
Closes-Bug: #<I> | openstack_horizon | train | py |
aefb45fb8c1c9e18154453805050a57b0ff2addd | diff --git a/java/src/com/swiftnav/sbp/SBPMessage.java b/java/src/com/swiftnav/sbp/SBPMessage.java
index <HASH>..<HASH> 100644
--- a/java/src/com/swiftnav/sbp/SBPMessage.java
+++ b/java/src/com/swiftnav/sbp/SBPMessage.java
@@ -18,6 +18,7 @@ import java.lang.reflect.Array;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
+import java.util.Arrays;
import java.util.LinkedList;
/** Superclass of all SBP messages. */
@@ -188,9 +189,7 @@ public class SBPMessage {
}
private byte[] getPayload() {
- byte[] payload = new byte[buf.position()];
- buf.get(payload, 0, buf.position());
- return payload;
+ return Arrays.copyOf(buf.array(), buf.position());
}
public void putU8(int x) { | java: Fix rebuilding payload from expanded message classes. | swift-nav_libsbp | train | java |
d46d5858acb290f6412256ee8a49ea35f6cf3986 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -50,9 +50,6 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.0',
- 'Programming Language :: Python :: 3.1',
- 'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', | Also update Python versions in setup.py | NLeSC_scriptcwl | train | py |
4bfa39db5a828043822ed555b5df9b5dfc94fb21 | diff --git a/test/createLogicMiddleware-latest.spec.js b/test/createLogicMiddleware-latest.spec.js
index <HASH>..<HASH> 100644
--- a/test/createLogicMiddleware-latest.spec.js
+++ b/test/createLogicMiddleware-latest.spec.js
@@ -345,7 +345,7 @@ describe('createLogicMiddleware-latest', () => {
...action,
type: 'BAR'
});
- }, 20);
+ }, 100); // needs to be delayed so we can check next calls
}
});
mw = createLogicMiddleware([logicA]); | improve sporadic test due to timing issues | jeffbski_redux-logic | train | js |
4b4f62f02651b93f363eeff0d9883289e891ace5 | diff --git a/ropetest/reprtest.py b/ropetest/reprtest.py
index <HASH>..<HASH> 100644
--- a/ropetest/reprtest.py
+++ b/ropetest/reprtest.py
@@ -1,8 +1,9 @@
+import pathlib
import tempfile
import pytest
-from rope.base import libutils, resources, pyobjectsdef, pynames
+from rope.base import libutils, resources, pyobjectsdef
from rope.base.project import Project
from ropetest import testutils
@@ -27,6 +28,7 @@ def mod1(project):
def test_repr_project():
with tempfile.TemporaryDirectory() as folder:
+ folder = pathlib.Path(folder).resolve()
obj = testutils.sample_project(folder)
assert isinstance(obj, Project)
assert repr(obj) == f'<rope.base.project.Project "{folder}">' | resolve() path name
Fixes temporary folder name issue in MacOS | python-rope_rope | train | py |
b73d8a35c2eaa4d15be7d595d4d97513a25dff86 | diff --git a/lib/coursecatlib.php b/lib/coursecatlib.php
index <HASH>..<HASH> 100644
--- a/lib/coursecatlib.php
+++ b/lib/coursecatlib.php
@@ -596,6 +596,9 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
} else {
// parent not found. This is data consistency error but next fix_course_sortorder() should fix it
$all[0][] = $record->id;
+ if (!$record->visible) {
+ $all['0i'][] = $record->id;
+ }
}
$count++;
} | MDL-<I> Bug fix for orphaned invisible categories
thanks to L.Sanocki | moodle_moodle | train | php |
a8c694c8483a54b4dee747fe67b62f1ba04a6150 | diff --git a/src/EditorconfigChecker/Validation/FinalNewlineValidator.php b/src/EditorconfigChecker/Validation/FinalNewlineValidator.php
index <HASH>..<HASH> 100644
--- a/src/EditorconfigChecker/Validation/FinalNewlineValidator.php
+++ b/src/EditorconfigChecker/Validation/FinalNewlineValidator.php
@@ -44,7 +44,7 @@ class FinalNewlineValidator
if ($error) {
Logger::getInstance()->addError('Missing final newline', $filename);
- $eolChar = $rules['end_of_line'] == 'lf' ? "\n" : $rules['end_of_line'] == 'cr' ? "\r" : "\r\n";
+ $eolChar = $rules['end_of_line'] == 'lf' ? "\n" : ($rules['end_of_line'] == 'cr' ? "\r" : "\r\n");
if (FinalNewlineFix::insert($filename, $eolChar)) {
Logger::getInstance()->errorFixed();
} | BUGFIX: Put paranthesis around nested terneray operator | editorconfig-checker_editorconfig-checker.php | train | php |
d1043e38c54ddd0db431b461cb1aeafb12889b65 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -304,7 +304,6 @@ install_requires = [
'pylint',
'psutil',
'qtawesome',
- 'path.py',
'pickleshare'
] | Setuo.py: Remove path.py from our list of deps | spyder-ide_spyder | train | py |
f101c6e228d7e46286157e4941253f7a0a650201 | diff --git a/Test/Unit/DrupalCodeBuilderAssertionsTest.php b/Test/Unit/DrupalCodeBuilderAssertionsTest.php
index <HASH>..<HASH> 100644
--- a/Test/Unit/DrupalCodeBuilderAssertionsTest.php
+++ b/Test/Unit/DrupalCodeBuilderAssertionsTest.php
@@ -12,6 +12,13 @@ use PHPUnit\Framework\ExpectationFailedException;
class DrupalCodeBuilderAssertionsTest extends TestBase {
/**
+ * {@inheritdoc}
+ */
+ protected function setupDrupalCodeBuilder($version) {
+ // Do nothing; we don't need to set up DCB.
+ }
+
+ /**
* Tests the assertNoTrailingWhitespace() assertion.
*
* @dataProvider providerAssertNoTrailingWhitespace | Fixed assertions test setting up a DCB environment without a Drupal core version. | drupal-code-builder_drupal-code-builder | train | php |
e01deb2b401bc4d5b7ce169225dee40df36e045a | diff --git a/pymc3/step_methods/gibbs.py b/pymc3/step_methods/gibbs.py
index <HASH>..<HASH> 100644
--- a/pymc3/step_methods/gibbs.py
+++ b/pymc3/step_methods/gibbs.py
@@ -19,6 +19,9 @@ Created on May 12, 2012
"""
from warnings import warn
+import aesara.tensor as aet
+
+from aesara.graph.basic import graph_inputs
from numpy import arange, array, cumsum, empty, exp, max, nested_iters, searchsorted
from numpy.random import uniform
@@ -78,7 +81,7 @@ def elemwise_logp(model, var):
v_logp = logpt(v)
if var in graph_inputs([v_logp]):
terms.append(v_logp)
- return model.fn(add(*terms))
+ return model.fn(aet.add(*terms))
def categorical(prob, shape): | Add missing imports to pymc3.step_methods.gibbs | pymc-devs_pymc | train | py |
72a27f4144f9bd0f2f23b461cabfb73bc9d51c66 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -34,7 +34,7 @@ describe('migrator', function() {
fakeHexo.call('migrate', { _: ['rss', 'https://github.com/danmactough/node-feedparser/raw/master/test/feeds/rss2sample.xml'] },
function(err) {
if (err) throw err;
- fakeHexo.setValues.receivedPosts.length.should.be.gt(0);
+ fakeHexo.setValues.receivedPosts.length.should.eql(0);
should.not.exist(fakeHexo.setValues.receivedPosts[0].alias);
done();
});
@@ -46,7 +46,7 @@ describe('migrator', function() {
fakeHexo.call('migrate', { _: ['rss', 'https://github.com/danmactough/node-feedparser/raw/master/test/feeds/rss2sample.xml'], alias: true },
function(err) {
if (err) throw err;
- fakeHexo.setValues.receivedPosts.length.should.be.gt(0);
+ fakeHexo.setValues.receivedPosts.length.should.eql(0);
should.exist(fakeHexo.setValues.receivedPosts[0].alias, 'alias missing');
done();
}); | refactor: use should.eql | hexojs_hexo-migrator-rss | train | js |
418b0c0a0ab2bea47efecdb36aef266e7cccf912 | diff --git a/File/src/MarkdownFile.php b/File/src/MarkdownFile.php
index <HASH>..<HASH> 100644
--- a/File/src/MarkdownFile.php
+++ b/File/src/MarkdownFile.php
@@ -127,18 +127,20 @@ class MarkdownFile extends File
$content['header'] = array();
$content['frontmatter'] = array();
+ $frontmatter_regex = "/^---\n(.+?)\n---(\n\n|$)/uim";
+
// Normalize line endings to Unix style.
$var = preg_replace("/(\r\n|\r)/", "\n", $var);
// Parse header.
- preg_match("/---\n(.+?)\n---(\n\n|$)/uism", $var, $m);
- if (isset($m[1])) {
+ preg_match($frontmatter_regex, $var, $m);
+ if (isset($m[1]) && (isset($m[2]) && $m[2]!="")) {
$content['frontmatter'] = preg_replace("/\n\t/", "\n ", $m[1]);
$content['header'] = YamlParser::parse($content['frontmatter']);
}
// Strip header to get content.
- $content['markdown'] = trim(preg_replace("/---\n(.+?)\n---(\n\n|$)/uism", '', $var));
+ $content['markdown'] = trim(preg_replace($frontmatter_regex, '', $var, 1));
return $content;
} | Better isolation of YAML front matter | rockettheme_toolbox | train | php |
1406e740eb06a75ee7c06e956be95207af6ccbe5 | diff --git a/stats.js b/stats.js
index <HASH>..<HASH> 100644
--- a/stats.js
+++ b/stats.js
@@ -70,8 +70,6 @@ var conf;
// Flush metrics to each backend.
function flushMetrics() {
- setTimeout(flushMetrics, getFlushTimeout(flushInterval));
-
var time_stamp = Math.round(new Date().getTime() / 1000);
if (old_timestamp > 0) {
gauges[timestamp_lag_namespace] = (time_stamp - old_timestamp - (Number(conf.flushInterval)/1000));
@@ -141,7 +139,7 @@ function flushMetrics() {
}
}
- // normally gauges are not reset. so if we don't delete them, continue to persist previous value
+ // Normally gauges are not reset. so if we don't delete them, continue to persist previous value
conf.deleteGauges = conf.deleteGauges || false;
if (conf.deleteGauges) {
for (var gauge_key in metrics.gauges) {
@@ -154,6 +152,10 @@ function flushMetrics() {
backendEvents.emit('flush', time_stamp, metrics);
});
+ // Performing this setTimeout at the end of this method rather than the beginning
+ // helps ensure we adapt to negative clock skew by letting the method's latency
+ // introduce a short delay that should more than compensate.
+ setTimeout(flushMetrics, getFlushTimeout(flushInterval));
}
var stats = { | Account for negative clock skew in flushMetrics | statsd_statsd | train | js |
dc6944d91da0a999ac74f2d5408101c790003c1d | diff --git a/docs/storage/driver/oss/oss.go b/docs/storage/driver/oss/oss.go
index <HASH>..<HASH> 100644
--- a/docs/storage/driver/oss/oss.go
+++ b/docs/storage/driver/oss/oss.go
@@ -754,7 +754,7 @@ func (d *driver) ossPath(path string) string {
}
func parseError(path string, err error) error {
- if ossErr, ok := err.(*oss.Error); ok && ossErr.Code == "NoSuchKey" {
+ if ossErr, ok := err.(*oss.Error); ok && ossErr.StatusCode == 404 && (ossErr.Code == "NoSuchKey" || ossErr.Code == "") {
return storagedriver.PathNotFoundError{Path: path}
} | In HEAD request for missing resource, only <I> NOT FOUND is returned
Change-Id: I<I>caf<I>b<I>e6f4f<I>f7d<I>f5d4fd4ad9affcd | docker_distribution | train | go |
a49db23de81e59c9ef987321ef6cf0ebed22a7ca | diff --git a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/TypeConvertingCompiler.java b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/TypeConvertingCompiler.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/TypeConvertingCompiler.java
+++ b/plugins/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/TypeConvertingCompiler.java
@@ -91,6 +91,17 @@ public class TypeConvertingCompiler extends AbstractXbaseCompiler {
});
return;
}
+ } else {
+ JvmTypeReference actualType = getType(obj);
+ if (obj instanceof XAbstractFeatureCall && mustInsertTypeCast(obj, actualType)){
+ doCastConversion(actualType, appendable, obj, new Later() {
+ public void exec(ITreeAppendable appendable) {
+ appendable = appendable.trace(obj, true);
+ internalToConvertedExpression(obj, appendable);
+ }
+ });
+ return;
+ }
}
final ITreeAppendable trace = appendable.trace(obj, true);
internalToConvertedExpression(obj, trace); | [xbase][compiler] Fixed another regression in the compiler | eclipse_xtext-extras | train | java |
6c96097da363914f3663e420920d8e02ad65c686 | diff --git a/cli50/__main__.py b/cli50/__main__.py
index <HASH>..<HASH> 100644
--- a/cli50/__main__.py
+++ b/cli50/__main__.py
@@ -166,7 +166,7 @@ def main():
pull(IMAGE, args["tag"])
# Options
- workdir = "/home/ubuntu/workspace"
+ workdir = "/mnt"
options = ["--detach",
"--interactive",
"--label", LABEL,
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,6 +23,6 @@ setup(
"console_scripts": ["cli50=cli50.__main__:main"]
},
url="https://github.com/cs50/cli50",
- version="5.0.1",
+ version="5.1.0",
include_package_data=True
) | mounting at /mnt again instead of /home/ubuntu/workspace | cs50_cli50 | train | py,py |
7cc5c3dbe0f2e8e4cab372d539c0639c064cdec4 | diff --git a/cruddy/lambdaclient.py b/cruddy/lambdaclient.py
index <HASH>..<HASH> 100644
--- a/cruddy/lambdaclient.py
+++ b/cruddy/lambdaclient.py
@@ -17,7 +17,7 @@ import json
import boto3
import botocore.exceptions
-from response import CRUDResponse
+from cruddy.response import CRUDResponse
LOG = logging.getLogger(__name__) | Add more specific import in lambdaclient to allow both command line and lambda function to work | Min-ops_cruddy | train | py |
d709c14b13b88da371a5edb0eb1b21ad287838ee | diff --git a/lib/molecule.js b/lib/molecule.js
index <HASH>..<HASH> 100644
--- a/lib/molecule.js
+++ b/lib/molecule.js
@@ -37,10 +37,12 @@ module.exports = function (inchi) {
@param {Number} from Source atom
@param {Number} to Target atom
*/
- Molecule.prototype.addBond = function (from, to) {
+ Molecule.prototype.addBond = function (from, to, order) {
var self = this;
- self.bonds.push({from: from, to: to});
+ order = order || 1;
+
+ self.bonds.push({from: from, to: to, order: order});
};
/**
@@ -53,18 +55,9 @@ module.exports = function (inchi) {
*/
Molecule.prototype.getInchi = function (callback) {
var self = this,
- mol = {
- atom: []
- };
-
- self.atoms.forEach(function (atom) {
- mol.atom.push({
- elname: atom,
- neighbor: []
- });
- });
+ mol = new inchilib.Molecule(this);
- inchilib.GetINCHI(mol, function (err, result) {
+ mol.GetInChI(function (err, result) {
callback(err, result.inchi);
});
}; | molecule: delegate prep, calculation to addon | smikes_inchi | train | js |
2dc5b23e589d624b1c07fc97f910b3874801f5d2 | diff --git a/Bundle/CriteriaBundle/DataSource/RequestDataSource.php b/Bundle/CriteriaBundle/DataSource/RequestDataSource.php
index <HASH>..<HASH> 100644
--- a/Bundle/CriteriaBundle/DataSource/RequestDataSource.php
+++ b/Bundle/CriteriaBundle/DataSource/RequestDataSource.php
@@ -40,7 +40,11 @@ class RequestDataSource
return [
'type' => ChoiceType::class,
'options' => [
- 'choices' => $this->availableLocales,
+ 'choices' => $this->availableLocales,
+ 'choices_as_values' => true,
+ 'choice_label' => function ($value) {
+ return $value;
+ },
],
];
} | bugfix/local-criteria (#<I>)
Add choice as value to prevent criteria choice field to give int instead of local | Victoire_victoire | train | php |
8b5cbf2fd33caaf54f1309b4581dc431a2115302 | diff --git a/src/Control/InitialisationMiddleware.php b/src/Control/InitialisationMiddleware.php
index <HASH>..<HASH> 100644
--- a/src/Control/InitialisationMiddleware.php
+++ b/src/Control/InitialisationMiddleware.php
@@ -61,7 +61,7 @@ class InitialisationMiddleware implements HTTPMiddleware
* environment: dev
* ---
* CWP\Core\Control\InitialisationMiddleware:
- * strict_transport_security: 'max-age: 300'
+ * strict_transport_security: 'max-age=300'
* SilverStripe\Core\Injector\Injector:
* SilverStripe\Control\Middleware\CanonicalURLMiddleware:
* properties: | BUG max-age syntax in comments is incorrect
The syntax for the HSTS related 'max-age' is incorrect, see <URL> | silverstripe_cwp-core | 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.