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
|
---|---|---|---|---|---|
df3a96144fa93b11f657083bfcae6fd4be3cec34 | diff --git a/js/ui/ComponentLoader.js b/js/ui/ComponentLoader.js
index <HASH>..<HASH> 100644
--- a/js/ui/ComponentLoader.js
+++ b/js/ui/ComponentLoader.js
@@ -27,6 +27,12 @@ define(["js/ui/View", "require"], function(View, require) {
},
clear: function() {
+
+ var instance = this.$.instance;
+ if (instance) {
+ this.removeChild(instance);
+ }
+
this.set({
instance: null,
loading: false, | remove instance in clear method of ComponentLoader | rappid_rAppid.js | train | js |
e638cfca1aede66f7d1a6bdead5a92d59cfcc670 | diff --git a/chromedp.go b/chromedp.go
index <HASH>..<HASH> 100644
--- a/chromedp.go
+++ b/chromedp.go
@@ -4,6 +4,9 @@
//
// chromedp requires no third-party dependencies, implementing the async Chrome
// DevTools Protocol entirely in Go.
+//
+// This package includes a number of simple examples. Additionally,
+// https://github.com/chromedp/examples contains more complex examples.
package chromedp
import ( | point to chromedp/examples from the package's godoc
To ensure noone misses it when visiting via godoc.org. | chromedp_chromedp | train | go |
98a1dd72b312e630b374ca9c5f0deaad4b3d61ff | diff --git a/test/screenshot/infra/lib/diff-base-parser.js b/test/screenshot/infra/lib/diff-base-parser.js
index <HASH>..<HASH> 100644
--- a/test/screenshot/infra/lib/diff-base-parser.js
+++ b/test/screenshot/infra/lib/diff-base-parser.js
@@ -101,7 +101,7 @@ class DiffBaseParser {
const parsedDiffBase = await this.parseDiffBase_(rawDiffBase);
const parsedBranch = parsedDiffBase.git_revision ? parsedDiffBase.git_revision.branch : null;
- if (isOnline && isRealBranch(parsedBranch)) {
+ if (isOnline && isRealBranch(parsedBranch) && process.env.TRAVIS) {
const prNumber = await this.gitHubApi_.getPullRequestNumber(parsedBranch);
if (prNumber) {
parsedDiffBase.git_revision.pr_number = prNumber; | chore(infrastructure): Only try resolving PR ID on Travis CBT runs (#<I>) | material-components_material-components-web | train | js |
5e8a99a58bd64aac151758345d856e4d1b685e43 | diff --git a/test/introspection_test_helper.rb b/test/introspection_test_helper.rb
index <HASH>..<HASH> 100644
--- a/test/introspection_test_helper.rb
+++ b/test/introspection_test_helper.rb
@@ -63,6 +63,7 @@ module IntrospectionTestExtensions
end
VERSION_GUARDS = {
+ '1.61.1' => %w(Regress TestObj emit_sig_with_error),
'1.59.4' => %w(Regress test_array_struct_in_none),
'1.58.3' => %w(Regress TestReferenceCounters),
'1.57.2' => %w(Regress TestInterface emit_signal), | Add version check for gobject-introspection <I> | mvz_gir_ffi | train | rb |
df56314b95e3c8bf44bc17de7d35038843bb71bd | diff --git a/agent/logger/seelog_config.go b/agent/logger/seelog_config.go
index <HASH>..<HASH> 100644
--- a/agent/logger/seelog_config.go
+++ b/agent/logger/seelog_config.go
@@ -20,7 +20,7 @@ func loggerConfig() string {
<console />`
if logfile != "" {
config += `<rollingfile filename="` + logfile + `" type="date"
- datepattern="2006-01-02-15" archivetype="zip" maxrolls="5" />`
+ datepattern="2006-01-02-15" archivetype="none" maxrolls="24" />`
}
config += `
</outputs> | Change log archive to none
Logs should be retained for <I> hours and deleted. Previous retention
setting of "zip" unintentionally retained logs in a zip file internal to
the container, causing increased CPU load, memory, and disk usage
related to hourly rotation. | aws_amazon-ecs-agent | train | go |
a155b6d29dd7becae7e08bda1680ec6290d4911e | diff --git a/discovery/zookeeper/zookeeper.go b/discovery/zookeeper/zookeeper.go
index <HASH>..<HASH> 100644
--- a/discovery/zookeeper/zookeeper.go
+++ b/discovery/zookeeper/zookeeper.go
@@ -137,8 +137,11 @@ func NewDiscovery(
logger = log.NewNopLogger()
}
- conn, _, err := zk.Connect(srvs, timeout)
- conn.SetLogger(treecache.NewZookeeperLogger(logger))
+ conn, _, err := zk.Connect(
+ srvs, timeout,
+ func(c *zk.Conn) {
+ c.SetLogger(treecache.NewZookeeperLogger(logger))
+ })
if err != nil {
return nil
} | fix the zookeper race (#<I>) | prometheus_prometheus | train | go |
117d678749d740becd1d896bfdb244b3846625e0 | diff --git a/contrib/seccomp/seccomp_default.go b/contrib/seccomp/seccomp_default.go
index <HASH>..<HASH> 100644
--- a/contrib/seccomp/seccomp_default.go
+++ b/contrib/seccomp/seccomp_default.go
@@ -418,6 +418,28 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
Args: []specs.LinuxSeccompArg{
{
Index: 0,
+ Value: 0x20000,
+ Op: specs.OpEqualTo,
+ },
+ },
+ },
+ {
+ Names: []string{"personality"},
+ Action: specs.ActAllow,
+ Args: []specs.LinuxSeccompArg{
+ {
+ Index: 0,
+ Value: 0x20008,
+ Op: specs.OpEqualTo,
+ },
+ },
+ },
+ {
+ Names: []string{"personality"},
+ Action: specs.ActAllow,
+ Args: []specs.LinuxSeccompArg{
+ {
+ Index: 0,
Value: 0xffffffff,
Op: specs.OpEqualTo,
}, | seccomp: allow personality with UNAME<I> bit set
From personality(2):
Have uname(2) report a <I>+ version number rather than a 3.x version
number. Added as a stopgap measure to support broken applications that
could not handle the kernel version-numbering switch from <I>.x to 3.x.
This allows both "UNAME<I>|PER_LINUX" and "UNAME<I>|PER_LINUX<I>".
Fixes: "setarch broken in docker packages from Debian stretch" | containerd_containerd | train | go |
c91d00a0ace39504d9bf49ade1528165934d87a9 | diff --git a/gulp/tasks/compare.js b/gulp/tasks/compare.js
index <HASH>..<HASH> 100644
--- a/gulp/tasks/compare.js
+++ b/gulp/tasks/compare.js
@@ -37,7 +37,10 @@ gulp.task('compare', function (done) {
_.each(compareConfig.testPairs, function (pair, key) {
pair.testStatus = "running";
- testPairsLength = !testPairsLength && compareConfig.testPairs.length;
+
+ if (!testPairsLength) {
+ testPairsLength = Object.keys(compareConfig.testPairs).length;
+ }
var referencePath = path.join(paths.backstop, pair.reference); | fixing the CI report for mutiple CSS selectors | garris_BackstopJS | train | js |
60ca683709d825518e0bc69ea624626d0511dfaf | diff --git a/src/views/generators/migration.blade.php b/src/views/generators/migration.blade.php
index <HASH>..<HASH> 100644
--- a/src/views/generators/migration.blade.php
+++ b/src/views/generators/migration.blade.php
@@ -37,6 +37,8 @@ class EntrustSetupTables extends Migration {
{
$table->increments('id');
$table->string('name');
+ $table->string('display_name');
+ $table->timestamps();
});
// Creates the permission_role (Many-to-Many relation) table | 'display_name' was referenced in the README but not included in the migration generator. | Zizaco_entrust | train | php |
4a9e1e68c61a87c88aab9078e09c300fa90406c8 | diff --git a/src/Illuminate/Foundation/Console/RouteListCommand.php b/src/Illuminate/Foundation/Console/RouteListCommand.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Foundation/Console/RouteListCommand.php
+++ b/src/Illuminate/Foundation/Console/RouteListCommand.php
@@ -42,7 +42,7 @@ class RouteListCommand extends Command {
* @var array
*/
protected $headers = array(
- 'Domain', 'URI', 'Name', 'Action', 'Middleware'
+ 'Domain', 'Method', 'URI', 'Name', 'Action', 'Middleware'
);
/**
@@ -100,11 +100,10 @@ class RouteListCommand extends Command {
*/
protected function getRouteInformation(Route $route)
{
- $uri = implode('|', $route->methods()).' '.$route->uri();
-
return $this->filterRoute(array(
'host' => $route->domain(),
- 'uri' => $uri,
+ 'method' => implode('|', $route->methods()),
+ 'uri' => $route->uri(),
'name' => $route->getName(),
'action' => $route->getActionName(),
'middleware' => $this->getMiddleware($route) | Separate Method and Uri in route:list command | laravel_framework | train | php |
baf60d29d99aae9b5100181374b150075796342f | diff --git a/cmd/server/handler.go b/cmd/server/handler.go
index <HASH>..<HASH> 100644
--- a/cmd/server/handler.go
+++ b/cmd/server/handler.go
@@ -21,6 +21,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/urfave/negroni"
+ "github.com/gorilla/context"
)
func RunHost(c *config.Config) func(cmd *cobra.Command, args []string) {
@@ -59,7 +60,7 @@ func RunHost(c *config.Config) func(cmd *cobra.Command, args []string) {
var srv = graceful.WithDefaults(&http.Server{
Addr: c.GetAddress(),
- Handler: n,
+ Handler: context.ClearHandler(n),
TLSConfig: &tls.Config{
Certificates: []tls.Certificate{getOrCreateTLSCertificate(cmd, c)},
}, | cmd/server: resolve gorilla session mem leak - closes #<I> | ory_hydra | train | go |
c333a0f78d02273eb2eedf54f8bf62db7bd7846c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,6 +7,7 @@ setup(
author='David Sutherland',
author_email='[email protected]',
license='BSD',
+ license_files=['LICENSE'],
packages=find_packages(exclude=('tests', 'example')),
include_package_data=True,
install_requires=['django-debug-toolbar>=2.0'],
@@ -29,4 +30,4 @@ setup(
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries :: Python Modules',
],
-)
\ No newline at end of file
+) | Add LICENSE file to built distribution | djsutho_django-debug-toolbar-request-history | train | py |
5fd975563ddee74a5d97abf7d812be39232df504 | diff --git a/src/ResizeSensor.js b/src/ResizeSensor.js
index <HASH>..<HASH> 100644
--- a/src/ResizeSensor.js
+++ b/src/ResizeSensor.js
@@ -57,7 +57,7 @@ define(function() {
element.resizeSensor = document.createElement('div');
element.resizeSensor.className = 'resize-sensor';
- var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;';
+ var style = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden; opacity: 0;';
var styleChild = 'position: absolute; left: 0; top: 0; transition: 0s;';
element.resizeSensor.style.cssText = style; | fix an issue with chrome phantom scrollbar | normanzb_resize-sensor | train | js |
c66bee01c5af62cf77eff627fe484b0dcaa930b1 | diff --git a/spark.js b/spark.js
index <HASH>..<HASH> 100644
--- a/spark.js
+++ b/spark.js
@@ -176,7 +176,7 @@ Spark.readable('__initialise', [function initialise() {
//
spark.heartbeat();
- primus.decoder(raw, function decoding(err, data) {
+ primus.decoder.call(spark, raw, function decoding(err, data) {
//
// Do a "save" emit('error') when we fail to parse a message. We don't
// want to throw here as listening to errors should be optional.
@@ -369,7 +369,7 @@ Spark.readable('_write', function _write(data) {
//
if (Spark.CLOSED === spark.readyState) return false;
- primus.encoder(data, function encoded(err, packet) {
+ primus.encoder.call(spark, data, function encoded(err, packet) {
//
// Do a "save" emit('error') when we fail to parse a message. We don't
// want to throw here as listening to errors should be optional. | Provide the parser encode and decode methods with the spark in case it needs
some extra info from a custom spark as to its status etc. | primus_primus | train | js |
075fc1d54945f6da941dcd5ad6e852f1ea4bbefd | diff --git a/safe/impact_functions/test_plugin_core.py b/safe/impact_functions/test_plugin_core.py
index <HASH>..<HASH> 100644
--- a/safe/impact_functions/test_plugin_core.py
+++ b/safe/impact_functions/test_plugin_core.py
@@ -116,7 +116,7 @@ class SyntaxErrorFunction(FunctionProvider):
class Test_plugin_core(unittest.TestCase):
- """Tests of Risiko calculations
+ """Tests of InaSAFE calculations
"""
def test_basic_plugin_requirements(self): | Remove deprecated reference to risiko in comments | inasafe_inasafe | train | py |
ddc505b9eb09ab7b162fc6ee7d77505d8d0b9531 | diff --git a/lib/aasm/state.rb b/lib/aasm/state.rb
index <HASH>..<HASH> 100644
--- a/lib/aasm/state.rb
+++ b/lib/aasm/state.rb
@@ -50,6 +50,7 @@ module AASM
def localized_name
AASM::Localizer.new.human_state_name(@clazz, self)
end
+ alias human_name localized_name
def for_select
[display_name, name.to_s]
diff --git a/spec/unit/localizer_spec.rb b/spec/unit/localizer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/localizer_spec.rb
+++ b/spec/unit/localizer_spec.rb
@@ -30,11 +30,15 @@ describe 'localized state names' do
end
it 'should localize' do
- LocalizerTestModel.aasm.states.detect {|s| s == :opened}.localized_name.should == "It's open now!"
+ state = LocalizerTestModel.aasm.states.detect {|s| s == :opened}
+ state.localized_name.should == "It's open now!"
+ state.human_name.should == "It's open now!"
end
it 'should use fallback' do
- LocalizerTestModel.aasm.states.detect {|s| s == :closed}.localized_name.should == 'Closed'
+ state = LocalizerTestModel.aasm.states.detect {|s| s == :closed}
+ state.localized_name.should == 'Closed'
+ state.human_name.should == 'Closed'
end
end | provide state.human_name (in addition to state.localized_name) | aasm_aasm | train | rb,rb |
597e91c3acedd371142969b8732807864f82eb45 | diff --git a/src/sap.ui.core/src/sap/ui/core/UIArea.js b/src/sap.ui.core/src/sap/ui/core/UIArea.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/core/UIArea.js
+++ b/src/sap.ui.core/src/sap/ui/core/UIArea.js
@@ -540,7 +540,9 @@ sap.ui.define(['jquery.sap.global', 'sap/ui/base/ManagedObject', './Element', '.
var len = cleanUpDom(aContent, true);
for (var i = 0; i < len; i++) {
- this.oCore.oRenderManager.render(aContent[i], this.oRootNode, true);
+ if (aContent[i] && aContent[i].getParent() === this) {
+ this.oCore.oRenderManager.render(aContent[i], this.oRootNode, true);
+ }
}
bUpdated = true; | [FIX] sap.ui.core.UIArea: Avoid duplicate rendering when content is
moved in rendering phase
Change-Id: I<I>d<I>c4c<I>ad<I>b<I>ac9e<I>dddf6c<I>
BCP: <I> | SAP_openui5 | train | js |
20ca0bd7334343695580eeff10eaeeb0bb2f6e4f | diff --git a/jax/interpreters/xla.py b/jax/interpreters/xla.py
index <HASH>..<HASH> 100644
--- a/jax/interpreters/xla.py
+++ b/jax/interpreters/xla.py
@@ -327,8 +327,7 @@ class DeviceConstant(DeviceArray):
def constant_handler(c, constant_instance):
assert False
-# TODO(mattjj): tune cutoff
-def instantiate_device_constant(const, cutoff=0):
+def instantiate_device_constant(const, cutoff=1e6):
# dispatch an XLA Computation to build the constant on the device if it's
# large, or alternatively build it on the host and transfer it if it's small
assert isinstance(const, DeviceConstant) | add cutoff for materialize-and-xfer vs build-on-device
see <URL> | tensorflow_probability | train | py |
a974f1f176e2692fbb2a32c22bae4fc6bbe7069d | diff --git a/test/struct.js b/test/struct.js
index <HASH>..<HASH> 100644
--- a/test/struct.js
+++ b/test/struct.js
@@ -225,7 +225,7 @@ describe('Struct', function () {
var test15 = Struct({
'a': test1
- , 'b': test2
+ , 'b': test1
})
test(test15, 15) | test: fix incorrect struct definition causing test to fail | node-ffi-napi_ref-struct-di | train | js |
f4c87b497a9369e080fac81dcfb80e901624a9f7 | diff --git a/src/main/java/com/tumblr/jumblr/types/Post.java b/src/main/java/com/tumblr/jumblr/types/Post.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/tumblr/jumblr/types/Post.java
+++ b/src/main/java/com/tumblr/jumblr/types/Post.java
@@ -24,6 +24,7 @@ public class Post extends Resource {
private String post_url, short_url;
private String type;
private Long timestamp;
+ private Long liked_timestamp;
private String state;
private String format;
private String date;
@@ -151,6 +152,12 @@ public class Post extends Resource {
}
/**
+ * Get timestamp of when this post was liked
+ * @return the timestamp of when this post was liked
+ */
+ public Long getLikedTimestamp() { return liked_timestamp; }
+
+ /**
* Get the type of this post
* @return type as String
*/ | Updated to support the liked timestamp | tumblr_jumblr | train | java |
b3183e663ff7025c32902a0d6db27c215dc20085 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ yahdlc = Extension(
setup(
name = 'python4yahdlc',
- version = '0.1.0',
+ version = '1.0.0',
description = 'Python bindings for the yahdlc library',
license = 'GPLv3',
keywords = 'hdlc yahdlc bindings', | update version in 'setup.py' file | SkypLabs_python4yahdlc | train | py |
e130b42c357e0d112da46ccfdc490bd2c3a7797a | diff --git a/apply_patches.py b/apply_patches.py
index <HASH>..<HASH> 100755
--- a/apply_patches.py
+++ b/apply_patches.py
@@ -10,7 +10,7 @@ import subprocess
import sys
-PATCH_EXTENTIONS = (".diff", ".patch")
+PATCH_EXTENSIONS = (".diff", ".patch")
def apply_patch(patch_file, base_dir, dry_run=False, verbose=False):
@@ -48,7 +48,7 @@ def main(argv):
parser.error("Could not list patch directory: {}".format(e))
if not os.path.isdir(args.srctree):
parser.error("Source tree '{}' not a directory".format(args.srctree))
- patches = [f for f in maybe_patches if f.endswith(PATCH_EXTENTIONS)]
+ patches = [f for f in maybe_patches if f.endswith(PATCH_EXTENSIONS)]
patch_count = len(patches)
print(gettext.ngettext(
u"Applying {} patch", u"Applying {} patches", patch_count).format( | Fix typo noted by babbageclunk in review | juju_juju | train | py |
f9f0808a4bbe3f8b7490fc43da693848cb8f24cf | diff --git a/code/pages/NewsArticle.php b/code/pages/NewsArticle.php
index <HASH>..<HASH> 100644
--- a/code/pages/NewsArticle.php
+++ b/code/pages/NewsArticle.php
@@ -149,6 +149,15 @@ class NewsArticle extends Page
$holder = $section->getPartitionedHolderForArticle($this);
return $holder;
}
+
+ /**
+ * Indicates if this has an external URL link
+ *
+ * @return boolean
+ */
+ public function HasExternalLink() {
+ return strlen($this->ExternalURL) || $this->InternalFileID;
+ }
/**
* Link to the news article. If it has an external URL set, or a file, link to that instead. | Added a method to indicate if there's an external link or not | nyeholt_silverstripe-news | train | php |
9e86f471c72d270950e3925fdb4774a32b8d322f | diff --git a/src/main/java/com/couchbase/lite/support/Batcher.java b/src/main/java/com/couchbase/lite/support/Batcher.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/couchbase/lite/support/Batcher.java
+++ b/src/main/java/com/couchbase/lite/support/Batcher.java
@@ -53,6 +53,7 @@ public class Batcher<T> {
this.processor = processor;
this.inbox = Collections.synchronizedList(new ArrayList<T>());
this.scheduled = false;
+ this.lastProcessedTime = System.currentTimeMillis();
}
/////////////////////////////////////////////////////////////////////////// | Fixed #<I>
- At first time to call addObject(), lastProcessedTime is 0. So Batcher process immediatly. For testing purpose, set current time in constructor. | couchbase_couchbase-lite-java-core | train | java |
ae29297785da94ed29fe8e62dfa902c6822ecfc3 | diff --git a/salt/modules/restartcheck.py b/salt/modules/restartcheck.py
index <HASH>..<HASH> 100644
--- a/salt/modules/restartcheck.py
+++ b/salt/modules/restartcheck.py
@@ -547,10 +547,10 @@ def restartcheck(ignorelist=None, blacklist=None, excludepid=None, **kwargs):
service = __salt__['service.available'](packages[package]['process_name'])
if service:
- packages[package]['systemdservice'].append(packages[package]['process_name'])
- else:
if os.path.exists('/etc/init.d/' + packages[package]['process_name']):
packages[package]['initscripts'].append(packages[package]['process_name'])
+ else:
+ packages[package]['systemdservice'].append(packages[package]['process_name'])
restartable = []
nonrestartable = [] | restartcheck: fix initscripts detection
The fallback if's are reversed :)
__salt__['service.available'] currently returns only initscripts so
don't report them as systemd services by default (check first to see
if it's an initscript and if not add them to systemd because in the
future __salt__['service.available'] may return systemd services). | saltstack_salt | train | py |
083bfc6fa727e7a2770345a6aa6223bd61f5ca2c | diff --git a/salt/modules/iptables.py b/salt/modules/iptables.py
index <HASH>..<HASH> 100644
--- a/salt/modules/iptables.py
+++ b/salt/modules/iptables.py
@@ -13,6 +13,7 @@ import shlex
import salt.utils
from salt.state import STATE_INTERNAL_KEYWORDS as _STATE_INTERNAL_KEYWORDS
from salt.exceptions import SaltException
+import salt.modules.cmdmod as salt_cmd
HAS_CHECK = False
@@ -21,7 +22,7 @@ def __virtual__():
Only load the module if iptables is installed
'''
global HAS_CHECK
- if __salt__['cmd.run']('iptables --help').find('--check'):
+ if salt_cmd.run('iptables --help').find('--check'):
HAS_CHECK = True
if salt.utils.which('iptables'): | fix to __virtual__ function in iptables module. __salt__ is unavailable so was throwing an error when the minion started up. | saltstack_salt | train | py |
24bf68d467252d2912848802e350e2ff9b979ea0 | diff --git a/listmodel/models.py b/listmodel/models.py
index <HASH>..<HASH> 100644
--- a/listmodel/models.py
+++ b/listmodel/models.py
@@ -24,8 +24,8 @@ class RssModel(listmodel.XmlListModel):
timestamp = mktime_tz(parsedate_tz(value))
return datetime.datetime.utcfromtimestamp(timestamp)
- query = '//item'
- rowhandler = RssRow
+ __query__ = '//item'
+ __rowhandler__ = RssRow
title = listmodel.XmlRole('//channel/title/text()')
fetch_time = listmodel.Role( | Updated RssModel in acordense with XmlListModel changes | jackuess_listmodel | train | py |
c0ff0d2f716da7cb24e2b473abf03534ede8dd7d | diff --git a/pythonzombie/tests/test_browser.py b/pythonzombie/tests/test_browser.py
index <HASH>..<HASH> 100644
--- a/pythonzombie/tests/test_browser.py
+++ b/pythonzombie/tests/test_browser.py
@@ -65,11 +65,6 @@ class TestBrowser(BrowserClientTest):
self.path
).html
- def test_html(self):
- assert '<p>This is an HTML document</p>' in self.browser.visit(
- self.path
- ).html
-
def test_css(self):
self.browser.visit(self.path)
for tag in ['h1', 'p', 'form', 'input', 'button']: | Removing a duplicated test. | ryanpetrello_python-zombie | train | py |
2bc8d31c37d1b1474088f8781fa050f4f8015375 | diff --git a/fireplace/actions.py b/fireplace/actions.py
index <HASH>..<HASH> 100644
--- a/fireplace/actions.py
+++ b/fireplace/actions.py
@@ -452,6 +452,8 @@ class TargetedAction(Action):
ret = t.evaluate(source)
else:
ret = t.eval(source.game, source)
+ if not ret:
+ return []
if not hasattr(ret, "__iter__"):
# Bit of a hack to ensure we always get a list back
ret = [ret] | Prevent `None` targets from showing up after lazy evaluation | jleclanche_fireplace | train | py |
730a138aeebcce00a92d7d00cbd30031225ee2b0 | diff --git a/grimoire_elk/_version.py b/grimoire_elk/_version.py
index <HASH>..<HASH> 100644
--- a/grimoire_elk/_version.py
+++ b/grimoire_elk/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.49.0"
+__version__ = "0.50.0" | Update version number to <I> | chaoss_grimoirelab-elk | train | py |
6907f8f23588982a5f005f230c598ffeb4cf49f5 | diff --git a/google-cloud-pubsub/lib/google/cloud/pubsub/service.rb b/google-cloud-pubsub/lib/google/cloud/pubsub/service.rb
index <HASH>..<HASH> 100644
--- a/google-cloud-pubsub/lib/google/cloud/pubsub/service.rb
+++ b/google-cloud-pubsub/lib/google/cloud/pubsub/service.rb
@@ -35,7 +35,7 @@ module Google
client_config: nil
@project = project
@credentials = credentials
- @host = host || "pubsub.googleapis.com"
+ @host = host || V1::PublisherClient::SERVICE_ADDRESS
@timeout = timeout
@client_config = client_config || {}
end
@@ -62,7 +62,6 @@ module Google
return mocked_subscriber if mocked_subscriber
@subscriber ||= begin
V1::SubscriberClient.new(
- service_path: host,
credentials: channel,
timeout: timeout,
client_config: client_config,
@@ -76,7 +75,6 @@ module Google
return mocked_publisher if mocked_publisher
@publisher ||= begin
V1::PublisherClient.new(
- service_path: host,
credentials: channel,
timeout: timeout,
lib_name: "gccl", | Remove warning when using Pub/Sub Emulator
The emulator host value should only be specified on the GRPC Channel object.
Specifying the emulator host using the client's service_path argument will
raise a warning that users are unable to avoid. | googleapis_google-cloud-ruby | train | rb |
48bf6dbd1e63b89cc111bcc7a456e4fa43707310 | diff --git a/widgets/TbJEditableColumn.php b/widgets/TbJEditableColumn.php
index <HASH>..<HASH> 100644
--- a/widgets/TbJEditableColumn.php
+++ b/widgets/TbJEditableColumn.php
@@ -96,7 +96,7 @@ class TbJEditableColumn extends TbDataColumn
$this->jEditableOptions['id'] = @$this->htmlOptions['id'] ? $this->htmlOptions['id'] : $this->id;
}
- $this->event = (!isset($this->jEditableOptions['event'])) ? $this->jEditableOptions['event'] : 'click';
+ $this->event = (isset($this->jEditableOptions['event'])) ? $this->jEditableOptions['event'] : 'click';
$this->jEditableOptions['event'] = null; | fix wrong 'event' set for jEditable closes #<I> | clevertech_YiiBooster | train | php |
a512307c06f236c0d20436a98b972ed4f6f0edc9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -55,7 +55,6 @@ setup(
'django_mobile',
'django_mobile.cache',
],
- install_requires = ['setuptools'],
tests_require = ['Django', 'mock'],
test_suite = 'django_mobile_tests.runtests.runtests',
) | Removed setuptools from install_requires to unbreak pip install -t | gregmuellegger_django-mobile | train | py |
efa96980c5a27c499aaf9839d630e824a8f5c8bd | diff --git a/src/sap.m/src/sap/m/InputBase.js b/src/sap.m/src/sap/m/InputBase.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/InputBase.js
+++ b/src/sap.m/src/sap/m/InputBase.js
@@ -175,9 +175,8 @@ function(
* Defines the formatted text that appears in the value state message pop-up.
* It can include links. If both <code>valueStateText</code> and <code>formattedValueStateText</code>
* are set - the latter is shown.
- * @private
- * @experimental Since 1.76. This aggregation is experimental and provides only limited functionality. Also the API might be changed in future.
- * @since 1.76
+ * @experimental Since 1.78. This aggregation is experimental and provides only limited functionality. Also the API might be changed in future.
+ * @since 1.78
*/
formattedValueStateText: { type: "sap.m.FormattedText", multiple: false, defaultValue: null }, | [INTERNAL] sap.m.InputBase: formattedValueStateText aggregation is now no longer private
The private visibility flag of the experimental sap.m.FormattedText
aggregation is removed.
JIRA: BGSOFUIRILA-<I>
Change-Id: Ibdfcc<I>df<I>e<I>d<I>df<I>e<I>a<I>ac | SAP_openui5 | train | js |
92f78eca5b239a4242a771580a61c4448c6676f2 | diff --git a/fitsio/test.py b/fitsio/test.py
index <HASH>..<HASH> 100644
--- a/fitsio/test.py
+++ b/fitsio/test.py
@@ -565,8 +565,8 @@ class TestReadWrite(unittest.TestCase):
rrecords = rh.records()
from pprint import pprint
- print()
- pprint(rrecords)
+ # print()
+ # pprint(rrecords)
self.assertEqual(
rrecords[6]['name'],
@@ -601,12 +601,12 @@ class TestReadWrite(unittest.TestCase):
self.assertEqual(
- rrecords[5]['name'],
+ rrecords[9]['name'],
'COMMENT',
'checking name is COMMENT',
)
self.assertEqual(
- rrecords[5]['comment'],
+ rrecords[9]['comment'],
'testing',
"check comment",
) | use comment from right entry number
we had kludges it previously because they were returned in the wrong
order | esheldon_fitsio | train | py |
331cc3b1a08a6b21e4633d8b4b70603bf0ff7512 | diff --git a/src/Spryker/Zed/SalesOrderThresholdDataImport/SalesOrderThresholdDataImportConfig.php b/src/Spryker/Zed/SalesOrderThresholdDataImport/SalesOrderThresholdDataImportConfig.php
index <HASH>..<HASH> 100644
--- a/src/Spryker/Zed/SalesOrderThresholdDataImport/SalesOrderThresholdDataImportConfig.php
+++ b/src/Spryker/Zed/SalesOrderThresholdDataImport/SalesOrderThresholdDataImportConfig.php
@@ -15,6 +15,8 @@ class SalesOrderThresholdDataImportConfig extends DataImportConfig
public const IMPORT_TYPE_SALES_ORDER_THRESHOLD = 'sales-order-threshold';
/**
+ * @api
+ *
* @return \Generated\Shared\Transfer\DataImporterConfigurationTransfer
*/
public function getSalesOrderThresholdDataImporterConfiguration(): DataImporterConfigurationTransfer | Fix api docblocks. | spryker_sales-order-threshold-data-import | train | php |
a1ffaafa15b5b8e40a329abdd10d30bf73b0d757 | diff --git a/tests/spec/amd.spec.js b/tests/spec/amd.spec.js
index <HASH>..<HASH> 100644
--- a/tests/spec/amd.spec.js
+++ b/tests/spec/amd.spec.js
@@ -106,9 +106,36 @@ define([
api.request('foo').method.should.eql('DELETE');
});
+
+ it('should support HEAD', function () {
+ var api = superapi.default({
+ baseUrl: 'http://foo.domain.tld/api',
+ services: {
+ foo: {
+ path: 'bar',
+ method: 'HEAD'
+ }
+ }
+ });
+
+ api.request('foo').method.should.eql('HEAD');
+ });
+
+ it('should support PATCH', function () {
+ var api = superapi.default({
+ baseUrl: 'http://foo.domain.tld/api',
+ services: {
+ foo: {
+ path: 'bar',
+ method: 'PATCH'
+ }
+ }
+ });
+
+ api.request('foo').method.should.eql('PATCH');
+ });
});
describe.skip('request headers', function () {
-
});
}); | test(HTTP methods): add missing test for HEAD and PATCH methods | stephanebachelier_superapi | train | js |
659f8f490b1c2fd75e68c636a0e9652e031537a0 | diff --git a/src/DocumentManager.php b/src/DocumentManager.php
index <HASH>..<HASH> 100644
--- a/src/DocumentManager.php
+++ b/src/DocumentManager.php
@@ -17,18 +17,35 @@ class DocumentManager
public function insert($collectionName, $document)
{
- echo "Inserting entry into ".$collectionName.".\n";
+ $this->writeLines($collectionName, array($document));
+ }
+
+
+ public function insertMany($collectionName, $documents)
+ {
+ $this->writeLines($collectionName, $documents);
+ }
+
+
+
+ private function writeLines($collectionName, $documents)
+ {
// Open or create file
$collectionFilePath = $this->getDatabasePath().'/'.$collectionName.'.edb';
$collectionFileHandle = fopen($collectionFilePath, 'a');
- // Add entry to end of file
- fwrite($collectionFileHandle, json_encode($document)."\n");
+ // Add entris to end of file
+ foreach ($documents as $document) {
+ fwrite($collectionFileHandle, json_encode($document)."\n");
+ }
+
+ // Close file
fclose($collectionFileHandle);
- }
+ }
+
private function getDatabasePath()
{
return $this->config['database']['path']; | Added insertMany() to DocumentManager. | alexanderduring_php-ember-db | train | php |
698f3a2c941138377647f538fc1f3322ae3d1e04 | diff --git a/gcloud/credentials.py b/gcloud/credentials.py
index <HASH>..<HASH> 100644
--- a/gcloud/credentials.py
+++ b/gcloud/credentials.py
@@ -7,7 +7,7 @@ def get_for_service_account(client_email, private_key_path, scope=None):
"""Gets the credentials for a service account.
.. note::
- You should not need to use this method directly.
+ You should not need to use this function directly.
Instead, use the helper methods provided in
:func:`gcloud.datastore.__init__.get_connection`
and | Updating docstring on credentials.get_for_service_account function. | googleapis_google-cloud-python | train | py |
83dbcd6ddc22b9772e4b197488857ef9d05411a0 | diff --git a/napalm_junos/junos.py b/napalm_junos/junos.py
index <HASH>..<HASH> 100644
--- a/napalm_junos/junos.py
+++ b/napalm_junos/junos.py
@@ -160,9 +160,21 @@ class JunOSDriver(NetworkDriver):
def _detect_config_format(self, config):
fmt = 'text'
+ set_action_matches = [
+ 'set',
+ 'activate',
+ 'deactivate',
+ 'annotate',
+ 'copy',
+ 'delete',
+ 'insert',
+ 'protect',
+ 'rename',
+ 'unprotect',
+ ]
if config.strip().startswith('<'):
return 'xml'
- elif config.strip().startswith('set'):
+ elif config.split(' ')[0] in set_action_matches:
return 'set'
elif self._is_json_format(config):
return 'json' | Fixes #<I> - Adds more actions to config detection. | napalm-automation_napalm | train | py |
be60430b26087c1d61127dee7c67a1a9d1572f24 | diff --git a/src/uiSelectController.js b/src/uiSelectController.js
index <HASH>..<HASH> 100644
--- a/src/uiSelectController.js
+++ b/src/uiSelectController.js
@@ -305,7 +305,7 @@ uis.controller('uiSelectCtrl',
var refreshPromise = $scope.$eval(refreshAttr);
if (refreshPromise && angular.isFunction(refreshPromise.then) && !ctrl.refreshing) {
ctrl.refreshing = true;
- refreshPromise.then(function() {
+ refreshPromise.finally(function() {
ctrl.refreshing = false;
});
}}, ctrl.refreshDelay); | fix(uiSelectCtrl): Reset refreshing flag even if async request errors
Previously the `ctrl.refreshing` flag may not have been reset to `false` if the async request for data failed.
Closes #<I> | angular-ui_ui-select | train | js |
96176a9562f808e5a166a4c211730c23ed309e9d | diff --git a/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/operations/RxBleRadioOperationCharacteristicWrite.java b/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/operations/RxBleRadioOperationCharacteristicWrite.java
index <HASH>..<HASH> 100644
--- a/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/operations/RxBleRadioOperationCharacteristicWrite.java
+++ b/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/operations/RxBleRadioOperationCharacteristicWrite.java
@@ -28,7 +28,6 @@ public class RxBleRadioOperationCharacteristicWrite extends RxBleSingleGattRadio
super(bluetoothGatt, rxBleGattCallback, BleGattOperationType.CHARACTERISTIC_WRITE, timeoutConfiguration);
this.bluetoothGattCharacteristic = bluetoothGattCharacteristic;
this.data = data;
- bluetoothGattCharacteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT);
}
@Override | TEMPORARY (until <I>) Removed bogus line.
(#<I> #<I>) | Polidea_RxAndroidBle | train | java |
0ad001e7e957bf1c1c01d6ef305b159743758070 | diff --git a/cli/delete_collection.go b/cli/delete_collection.go
index <HASH>..<HASH> 100644
--- a/cli/delete_collection.go
+++ b/cli/delete_collection.go
@@ -17,7 +17,8 @@ func deleteCollection(c *cli.Context) {
route, found := stepman.ReadRoute(collectionURI)
if !found {
- log.Fatalln("No route found for lib: " + collectionURI)
+ log.Warn("No route found for lib: " + collectionURI)
+ return
}
if err := stepman.CleanupRoute(route); err != nil { | don't fail in delete if doesn't exist | bitrise-io_stepman | train | go |
a7fa3d134e220cfa55fd8827819933cccb2aaa96 | diff --git a/lib/lasso-unpack.js b/lib/lasso-unpack.js
index <HASH>..<HASH> 100644
--- a/lib/lasso-unpack.js
+++ b/lib/lasso-unpack.js
@@ -13,7 +13,12 @@ const isValidFunctionExpression = require('./utils').isValidFunctionExpression;
const isFunctionExpression = require('./utils').isFunctionExpression;
function parseLassoBundle(fileName) {
- const fileContent = fs.readFileSync(path.resolve(fileName), 'utf8');
+ let filePath = fileName;
+ // check absolute path.
+ if (!fs.existsSync(filePath)) {
+ filePath = path.resolve(fileName);
+ }
+ const fileContent = fs.readFileSync(filePath, 'utf8');
const ast = acorn.parse(fileContent, {
sourceType: 'script'
}); | handle absolute path for lasso plugin | ajay2507_lasso-unpack | train | js |
0a0073509c6d006f2d2583156800cca2087eea0d | diff --git a/hrapplications/models.py b/hrapplications/models.py
index <HASH>..<HASH> 100755
--- a/hrapplications/models.py
+++ b/hrapplications/models.py
@@ -7,7 +7,7 @@ from eveonline.models import EveApiKeyPair
from authentication.models import AuthServicesInfo
class ApplicationQuestion(models.Model):
- title = models.CharField(max_length=100)
+ title = models.CharField(max_length=254)
help_text = models.CharField(max_length=254, blank=True, null=True)
def __str__(self): | Increase ApplicationQuestion title size limit | allianceauth_allianceauth | train | py |
3adfdcd589dbcbec2bfc1b68b830fb606e10b9e5 | diff --git a/analysis/Debugger.php b/analysis/Debugger.php
index <HASH>..<HASH> 100644
--- a/analysis/Debugger.php
+++ b/analysis/Debugger.php
@@ -136,6 +136,7 @@ class Debugger {
*
* @param mixed $reference File or class name to inspect.
* @param integer $callLine Line number of class reference.
+ * @return mixed Returns the line number where the method called is defined.
*/
protected static function _definition($reference, $callLine) {
if (file_exists($reference)) {
@@ -171,6 +172,14 @@ class Debugger {
}
}
+ /**
+ * Helper method for caching closure function references to help the process of building the
+ * stack trace.
+ * @param array $frame Backtrace information.
+ * @param Closure $function The method related to $frame information.
+ * @return string Returns either the cached or the fetched closure function reference while
+ * writing its reference to the cache array `$_closureCache`.
+ */
protected static function _closureDef($frame, $function) {
$reference = '::';
$frame += array('file' => '??', 'line' => '??'); | Docblock for the Debugger class | UnionOfRAD_lithium | train | php |
a3bdd8c948ba22ff224ee7c70a8b05b3db2aebb3 | diff --git a/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverContext.java b/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverContext.java
index <HASH>..<HASH> 100644
--- a/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverContext.java
+++ b/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolverContext.java
@@ -100,6 +100,7 @@ abstract class DnsNameResolverContext<T> {
}
void resolve() {
+ InetSocketAddress nameServerAddrToTry = nameServerAddrs.next();
for (InternetProtocolFamily f: resolveAddressTypes) {
final DnsRecordType type;
switch (f) {
@@ -113,7 +114,7 @@ abstract class DnsNameResolverContext<T> {
throw new Error();
}
- query(nameServerAddrs.next(), new DefaultDnsQuestion(hostname, type));
+ query(nameServerAddrToTry, new DefaultDnsQuestion(hostname, type));
}
} | Don't cycle DNS servers while cycling DNS record types.
Motivation:
Each server should be checked for every record type. Currently, if there
are only two configured servers and the first is down, it is impossible
to query for IPv4 addresses because the second server is only ever
queried for type AAAA.
Modifications:
Do not cycle DNS servers while cycling DNS record types (A and AAAA)
Result:
Name resolution is less fragile when the number of available DNS servers
is 2. | netty_netty | train | java |
040980724fb34ea72c6700562b0075905994fbc2 | diff --git a/mir_eval/boundary.py b/mir_eval/boundary.py
index <HASH>..<HASH> 100644
--- a/mir_eval/boundary.py
+++ b/mir_eval/boundary.py
@@ -107,14 +107,14 @@ def detection(reference_intervals, estimated_intervals, window=0.5, beta=1.0, tr
return 0.0, 0.0, 0.0
matching = util.match_events(reference_boundaries,
- estimated_boundaries,
+ estimated_boundaries,
window)
-
+
precision = float(len(matching)) / len(estimated_boundaries)
recall = float(len(matching)) / len(reference_boundaries)
-
+
f_measure = util.f_measure(precision, recall, beta=beta)
-
+
return precision, recall, f_measure
@validate
@@ -170,4 +170,3 @@ def deviation(reference_intervals, estimated_intervals, trim=False):
METRICS = collections.OrderedDict()
METRICS['detection'] = detection
METRICS['deviation'] = deviation
- | Stripping whitespace. Sorry Brian, atom does this, and you introduced me to atom | craffel_mir_eval | train | py |
3d1f7fd67d81369be7c36d91233c9e642c5dbf32 | diff --git a/shell/src/main/java/org/jboss/seam/forge/shell/ShellImpl.java b/shell/src/main/java/org/jboss/seam/forge/shell/ShellImpl.java
index <HASH>..<HASH> 100644
--- a/shell/src/main/java/org/jboss/seam/forge/shell/ShellImpl.java
+++ b/shell/src/main/java/org/jboss/seam/forge/shell/ShellImpl.java
@@ -881,6 +881,7 @@ public class ShellImpl extends AbstractShellPrompt implements Shell
try
{
reader.print(new String(new byte[] { b }));
+ reader.flush();
}
catch (IOException e)
{ | fix: output buffer not flushing (redux) | forge_core | train | java |
289851f32f6774f02b239d41549dafd48715776b | diff --git a/lib/db_charmer/active_record/class_attributes.rb b/lib/db_charmer/active_record/class_attributes.rb
index <HASH>..<HASH> 100644
--- a/lib/db_charmer/active_record/class_attributes.rb
+++ b/lib/db_charmer/active_record/class_attributes.rb
@@ -11,13 +11,16 @@ module DbCharmer
end
#-----------------------------------------------------------------------------
- @@db_charmer_connection_proxies = {}
+ def db_charmer_connection_proxies
+ Thread.current[:db_charmer_connection_proxies] ||= {}
+ end
+
def db_charmer_connection_proxy=(proxy)
- @@db_charmer_connection_proxies[self.name] = proxy
+ db_charmer_connection_proxies[self.name] = proxy
end
def db_charmer_connection_proxy
- @@db_charmer_connection_proxies[self.name]
+ db_charmer_connection_proxies[self.name]
end
#----------------------------------------------------------------------------- | Multi-threading support: thread-local connection proxies hash for AR classes (each AR class now has one current connection proxy per thread) | kovyrin_db-charmer | train | rb |
25965d3de2c47901f0f2ab1f74b8fa65dacbb279 | diff --git a/compiler.js b/compiler.js
index <HASH>..<HASH> 100644
--- a/compiler.js
+++ b/compiler.js
@@ -17,7 +17,7 @@ globalObj.$nxCompileCreateBackup = createBackup
const proxies = new WeakMap()
const expressionCache = new Map()
const codeCache = new Map()
-const exposedGlobals = new Set()
+const globals = new Set()
const handlers = {has}
function compileExpression (src) {
@@ -60,14 +60,14 @@ function expose (globalName) {
if (typeof globalName !== 'string') {
throw new TypeError('first argument must be a string')
}
- exposedGlobals.add(globalName)
+ globals.add(globalName)
}
function hide (globalName) {
if (typeof globalName !== 'string') {
throw new TypeError('first argument must be a string')
}
- exposedGlobals.delete(globalName)
+ globals.delete(globalName)
}
function toSandbox (obj) {
@@ -93,5 +93,5 @@ function createBackup (context, tempVars) {
}
function has (target, key) {
- return exposedGlobals.has(key) ? Reflect.has(target, key) : true
+ return globals.has(key) ? Reflect.has(target, key) : true
} | refactor(expose, hide): rename exposedGlobals to globals | nx-js_compiler-util | train | js |
861d2aa95b5444c18d96d36764f91d7b39761246 | diff --git a/example/controller/tests/helper/web/aws/dynamodb/__init__.py b/example/controller/tests/helper/web/aws/dynamodb/__init__.py
index <HASH>..<HASH> 100644
--- a/example/controller/tests/helper/web/aws/dynamodb/__init__.py
+++ b/example/controller/tests/helper/web/aws/dynamodb/__init__.py
@@ -178,4 +178,7 @@ class DynamodbController(Controller):
except Exception as e:
self.logging.exception(e)
+ import time
+ time.sleep(10)
+
return self.finish_with_error(500)
diff --git a/example/controller/tests/helper/web/aws/s3/__init__.py b/example/controller/tests/helper/web/aws/s3/__init__.py
index <HASH>..<HASH> 100644
--- a/example/controller/tests/helper/web/aws/s3/__init__.py
+++ b/example/controller/tests/helper/web/aws/s3/__init__.py
@@ -121,4 +121,7 @@ class S3Controller(Controller):
except Exception as e:
self.logging.exception(e)
+ import time
+ time.sleep(10)
+
return self.finish_with_error(500) | add time.sleep. | why2pac_dp-tornado | train | py,py |
24b7f302ee2060b6590fdc0ed1be2b0a45e55d6f | diff --git a/chevron/renderer.py b/chevron/renderer.py
index <HASH>..<HASH> 100644
--- a/chevron/renderer.py
+++ b/chevron/renderer.py
@@ -251,7 +251,8 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache',
'end': '/',
'partial': '>',
'set delimiter': '=',
- 'no escape': '&'
+ 'no escape': '&',
+ 'variable': ''
}[tag_type], tag_key, def_rdel)
g_token_cache[text] = tags | Fix the rendering of lambdas
Variables are the most common tag types, yet they were not handled
during the generation of template text for lambda scopes. | noahmorrison_chevron | train | py |
5881ab5c340869d37a577ed29f95ab4fd2d14c2e | diff --git a/src/resources/views/api/joblog.blade.php b/src/resources/views/api/joblog.blade.php
index <HASH>..<HASH> 100644
--- a/src/resources/views/api/joblog.blade.php
+++ b/src/resources/views/api/joblog.blade.php
@@ -11,6 +11,12 @@
<div class="panel-heading">
<h3 class="panel-title">{{ trans('web::seat.api_all') }}
+ @if(!config('eveapi.config.enable_joblog'))
+ <span class="pull-right text-danger">
+ The job log is currently disabled.
+ </span>
+ @endif
+
</h3>
</div>
<div class="panel-body"> | Show if the joblog is disabled. | eveseat_web | train | php |
bd86b71b3ea9444b02f877e7fec6607e0019a3bf | diff --git a/core/src/main/java/com/google/common/truth/MultimapSubject.java b/core/src/main/java/com/google/common/truth/MultimapSubject.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/google/common/truth/MultimapSubject.java
+++ b/core/src/main/java/com/google/common/truth/MultimapSubject.java
@@ -165,7 +165,9 @@ public class MultimapSubject extends Subject<MultimapSubject, Multimap<?, ?>> {
@Override
public void isEqualTo(@NullableDecl Object other) {
- if (Objects.equal(actual(), other)) {
+ @SuppressWarnings("UndefinedEquals") // the contract of this method is to follow Multimap.equals
+ boolean isEqual = Objects.equal(actual(), other);
+ if (isEqual) {
return;
} | Suppress an ErrorProne warning in Truth.
The UndefinedEquals warning[*] triggers for MultimapSubject.ieEqualTo, because it calls Objects.equal on the multimaps. Whatever the issues with the contract of Multimap.equals, MultimapSubject.isEqualTo is required to follow that contract, so suppressing the warning seems like the right thing to do.
[*] <URL> | google_truth | train | java |
0989e526bdee8a640a68f025f977394dd84a9fd3 | diff --git a/app/controllers/renalware/medications_controller.rb b/app/controllers/renalware/medications_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/renalware/medications_controller.rb
+++ b/app/controllers/renalware/medications_controller.rb
@@ -22,7 +22,7 @@ module Renalware
@treatable = treatable_class.find(treatable_id)
medication = @patient.medications.new(
- medication_params.merge(treatable: @treatable)
+ medication_params.merge(by: current_user, treatable: @treatable)
)
if medication.save
@@ -43,7 +43,7 @@ module Renalware
medication = @patient.medications.find(params[:id])
@treatable = medication.treatable
- if medication.update(medication_params)
+ if medication.update(medication_params.merge(by: current_user))
render_index
else
render_form(medication, url: patient_medication_path(@patient, medication))
diff --git a/features/support/worlds/medications.rb b/features/support/worlds/medications.rb
index <HASH>..<HASH> 100644
--- a/features/support/worlds/medications.rb
+++ b/features/support/worlds/medications.rb
@@ -23,7 +23,8 @@ module World
medication_route: route,
frequency: frequency,
start_date: starts_on,
- provider: provider.downcase
+ provider: provider.downcase,
+ by: Renalware::SystemUser.find
}
if deleted_at.present? | include the :by param in medications create/update | airslie_renalware-core | train | rb,rb |
2265d81bd391741b320acd3a0355807b011acf86 | diff --git a/src/components/picker/PickerItem.js b/src/components/picker/PickerItem.js
index <HASH>..<HASH> 100644
--- a/src/components/picker/PickerItem.js
+++ b/src/components/picker/PickerItem.js
@@ -139,8 +139,9 @@ class PickerItem extends BaseComponent {
// TODO: deprecate the check for object
onPress = () => {
- const {label, value, onPress} = this.props;
- onPress(_.isObject(value) ? value : {value, label});
+ const {value, onPress} = this.props;
+ // onPress(_.isObject(value) ? value : {value, label});
+ onPress(value);
};
} | Fix missed issue with migrating Picker API - PickerItem needs to retrieve the correct value format | wix_react-native-ui-lib | train | js |
29e6ff23fa14bc79079037d10f1b7e6ae573ee39 | diff --git a/slim/Slim.php b/slim/Slim.php
index <HASH>..<HASH> 100644
--- a/slim/Slim.php
+++ b/slim/Slim.php
@@ -570,7 +570,7 @@ class Slim {
self::response()->status($status);
}
self::view()->appendData($data);
- self::view()->render($template);
+ self::view()->display($template);
}
/***** HTTP CACHING *****/ | Issue <I> where Slim::render would not output the rendered template | slimphp_Slim | train | php |
2bec7a52e1aa26f7dd70c9f7cc11faa5715d4f8a | diff --git a/datatableview/views.py b/datatableview/views.py
index <HASH>..<HASH> 100644
--- a/datatableview/views.py
+++ b/datatableview/views.py
@@ -246,6 +246,14 @@ class DatatableMixin(MultipleObjectMixin):
"""
if isinstance(name, (tuple, list)):
+ if len(name) == 3:
+ # Method name is explicitly given
+ method_name = name[2]
+ if callable(method_name):
+ return True, method_name
+ return True, getattr(self, method_name)
+
+ # Treat the 'nice name' as the starting point for looking up a method
name = name[0]
mangled_name = re.sub(r'[\W_]+', '_', name)
@@ -273,7 +281,7 @@ class DatatableMixin(MultipleObjectMixin):
if isinstance(name, (tuple, list)):
- name, field_lookup = name
+ name, field_lookup = name[0], name[1]
else:
field_lookup = name | Added initial support for 3-tuple entries in options['columns']
The third position can be the reference or name of a callable to handle
the data generation. This allows for a way to avoid an especially
convoluted mangling procedure, as with the column name "% Complete". | pivotal-energy-solutions_django-datatable-view | train | py |
ab074e5b93dd264e30e8349c8f15724d8f2be30c | diff --git a/test/sync/test_default-dataHandlers.js b/test/sync/test_default-dataHandlers.js
index <HASH>..<HASH> 100644
--- a/test/sync/test_default-dataHandlers.js
+++ b/test/sync/test_default-dataHandlers.js
@@ -8,19 +8,19 @@ var metaData = {};
// stubs when there is no real MongoDB
var collectionStub = {
- insertOne: sinon.stub().callsArgWith(1, null, {
+ insertOne: sinon.stub().yields(null, {
result: { ok: 1, n: 1},
connection: null,
insertedCount: 1,
insertedId: '58b3d9efde2810043a0ac99d'}),
find: sinon.stub().returns({
- toArray: sinon.stub().callsArgWith(0, null, [{
+ toArray: sinon.stub().yields(null, [{
"_id": '58b3d9efde2810043a0ac99d'}]),
}),
- findOne: sinon.stub().callsArgWith(1, null, {
+ findOne: sinon.stub().yields(null, {
"_id": '58b3d9efde2810043a0ac99d'
}),
- updateOne: sinon.stub().callsArgWith(2, null),
+ updateOne: sinon.stub().yields(null),
remove: sinon.stub().callsArgWith(1, null, {
result: { ok: 1, n: 1}
}), | use yields instead of callsArgWith | feedhenry_fh-mbaas-api | train | js |
176d3c15f51eac6aca92b8105bfb68c8de159508 | diff --git a/packages/dai-plugin-governance/src/ChiefService.js b/packages/dai-plugin-governance/src/ChiefService.js
index <HASH>..<HASH> 100644
--- a/packages/dai-plugin-governance/src/ChiefService.js
+++ b/packages/dai-plugin-governance/src/ChiefService.js
@@ -268,6 +268,20 @@ export default class ChiefService extends LocalService {
});
}
+ async getAllSlates() {
+ const chiefAddress = this._chiefContract().address;
+ const web3Service = this.get('web3');
+ const netId = web3Service.network;
+ const networkName = netIdToName(netId);
+ const etches = await web3Service.getPastLogs({
+ fromBlock: chiefInfo.inception_block[networkName],
+ toBlock: 'latest',
+ address: chiefAddress,
+ topics: [chiefInfo.events.etch]
+ });
+ return etches.map(e => e.topics[1]);
+ }
+
// Internal --------------------------------------------
_chiefContract({ web3js = false } = {}) { | add getAllSlates to chief service | makerdao_dai.js | train | js |
c61a49dce7934bf21a7235019668b681d3e10421 | diff --git a/lib/agent/index.js b/lib/agent/index.js
index <HASH>..<HASH> 100644
--- a/lib/agent/index.js
+++ b/lib/agent/index.js
@@ -22,7 +22,8 @@ var system = require('./../system'),
program = common.program,
self;
-var Agent = self = {
+var Agent = self = {
+
running: false,
interactive: process.stdout._type === 'tty',
drivers: {},
@@ -103,6 +104,7 @@ var Agent = self = {
this.running = true;
this.running_as = process.env.RUNNING_USER = system.get_running_user();
this.started_at = new Date();
+ this.connect_attempts = config.get('auto_connect') ? 3 : 0;
// if any actions were requested through the command line
if (program.run)
@@ -162,17 +164,16 @@ var Agent = self = {
hooks.trigger('connection_found');
if (callback) callback(true);
- } else if (attempt <= config.auto_connect_attempts){
+ } else if (attempt <= self.connect_attempts){
self.log_notice('Trying to connect to an open Wifi network...');
- common.os.auto_connect(function(e){
-
+ system.auto_connect(function(e){
if (e) return no_connection(e);
setTimeout(function(){
self.check_connection(attempt+1, callback);
- }, config.get('auto_connect_timeout') || 10000); // 10 secs to connect
+ }, 10000); // 10 secs to connect
}); | Fixed auto connect with boolean check. | prey_prey-node-client | train | js |
c923f780cabc6a38bc5e793054bcdbde208b6188 | diff --git a/Lib/pyhsm/__init__.py b/Lib/pyhsm/__init__.py
index <HASH>..<HASH> 100644
--- a/Lib/pyhsm/__init__.py
+++ b/Lib/pyhsm/__init__.py
@@ -42,6 +42,8 @@ __all__ = ["base"
"aead_cmd"
"aes_ecb_cmd"
"basic_cmd"
+ "buffer_cmd"
+ "db_cmd"
"debug_cmd"
"hmac_cmd"
"validate_cmd" | add missing buffer_cmd and db_cmd | Yubico_python-pyhsm | train | py |
9355b2cfb6feb74a715d2a1be7099db6970ae6cd | diff --git a/spyder/widgets/sourcecode/codeeditor.py b/spyder/widgets/sourcecode/codeeditor.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/sourcecode/codeeditor.py
+++ b/spyder/widgets/sourcecode/codeeditor.py
@@ -1639,7 +1639,7 @@ class CodeEditor(TextEditBaseWidget):
self.__remove_prefix(prefix, cursor, line_text)
def __remove_prefix(self, prefix, cursor, line_text):
- """Handle the remove of the prefix for a single line."""
+ """Handle the removal of the prefix for a single line."""
start_with_space = line_text.startswith(' ')
if start_with_space:
left_spaces = self.__even_number_of_spaces(line_text)
@@ -2048,9 +2048,12 @@ class CodeEditor(TextEditBaseWidget):
self.remove_prefix(self.comment_string)
def __blockcomment_bar(self, compatibility=False):
+ """Handle versions of blockcomment bar for backwards compatibility."""
+ # Blockcomment bar in Spyder version >= 4
blockcomment_bar = self.comment_string + ' ' + '=' * (
79 - len(self.comment_string + ' '))
if compatibility:
+ # Blockcomment bar in Spyder version < 4
blockcomment_bar = self.comment_string + '=' * (
79 - len(self.comment_string))
return blockcomment_bar | Improvements in docstrings. | spyder-ide_spyder | train | py |
68ae01ab732b75c7501509c1049b23b94f29d599 | diff --git a/src/conbo/utils/BindingUtils.js b/src/conbo/utils/BindingUtils.js
index <HASH>..<HASH> 100644
--- a/src/conbo/utils/BindingUtils.js
+++ b/src/conbo/utils/BindingUtils.js
@@ -309,7 +309,7 @@ conbo.BindingUtils = conbo.Class.extend({},
default:
{
- console.warn('cb-'+attributeName+' is invalid or does not exist on specified element');
+ console.warn('cb-'+attributeName+' is not recognised or does not exist on specified element');
break;
}
} | Updated warning messages in BindingUtils | mesmotronic_conbo | train | js |
219e0d2fb86000775e53af4a381f22411bd661d4 | diff --git a/src/mixins/data-iterable.js b/src/mixins/data-iterable.js
index <HASH>..<HASH> 100644
--- a/src/mixins/data-iterable.js
+++ b/src/mixins/data-iterable.js
@@ -471,8 +471,10 @@ export default {
return [this.$createElement('div', {
'class': this.actionsClasses
}, [
+ this.$slots['actions-prepend'] ? this.$createElement('div', {}, this.$slots['actions-prepend']) : null,
this.rowsPerPageItems.length > 1 ? this.genSelect() : null,
- rangeControls
+ rangeControls,
+ this.$slots['actions-append'] ? this.$createElement('div', {}, this.$slots['actions-append']) : null
])]
}
} | Allow for more customisability - New slot for the VDataTable (#<I>)
* Allow for more customisability - New slot for the VDataTable
* Changed name of the slot and added a new one
* Move slots around | vuetifyjs_vuetify | train | js |
53c249fd06044fd243180304828ba804301d2a4f | diff --git a/lib/linter.js b/lib/linter.js
index <HASH>..<HASH> 100644
--- a/lib/linter.js
+++ b/lib/linter.js
@@ -12,7 +12,7 @@ const ERROR_SEVERITY = 2;
function buildErrorMessage(moduleId, error) {
let message = {
fatal: true,
- severity: 2,
+ severity: ERROR_SEVERITY,
moduleId,
message: error.message,
source: error.stack,
@@ -54,7 +54,7 @@ class Linter {
}
}
- return 2;
+ return ERROR_SEVERITY;
}
buildRules(config) {
@@ -173,7 +173,7 @@ class Linter {
messages.push({
message: `Pending module (\`${options.moduleId}\`) passes all rules. Please remove \`${options.moduleId}\` from pending list.`,
moduleId: options.moduleId,
- severity: 2,
+ severity: ERROR_SEVERITY,
});
} | Linter: Use named severity: 2 -> ERROR_SEVERITY | ember-template-lint_ember-template-lint | train | js |
963bbb1da62fe65ff12bd4cb91b0a1705a16e762 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -262,7 +262,9 @@ Loader.prototype.fetchFiles = function (keys) {
Loader.prototype._processTxInfo = function (parsed) {
var self = this
- assert(TxInfo.validate(parsed), 'invalid parsed tx')
+ if (!TxInfo.validate(parsed)) {
+ return Q.reject('invalid parsed tx')
+ }
return this._lookupParties(parsed.addressesFrom, parsed.addressesTo)
.then(function (matches) { | reject txs without parseable contents | tradle_chainloader | train | js |
92710c69a304601fe6b35568e44d95dcc34e3458 | diff --git a/waldo/contrib/config.py b/waldo/contrib/config.py
index <HASH>..<HASH> 100644
--- a/waldo/contrib/config.py
+++ b/waldo/contrib/config.py
@@ -136,10 +136,10 @@ class Option(object):
"""Holds a configuration option and the names and locations for it.
Instantiate options using the same arguments as you would for an
- add_arguments call in argparse. However, you have tow additional kwargs
+ add_arguments call in argparse. However, you have two additional kwargs
available:
- env: the name fo the environment vasriable to use for this option
+ env: the name of the environment variable to use for this option
ini_section: the ini file section to look this value up from
""" | Fixes: spelling, docs, and minor fixes | rackerlabs_simpl | train | py |
85dde3e6d82d0ce855de100c2bfd0e95155d20ae | diff --git a/languagetool-server/src/test/java/org/languagetool/server/HTTPServerTest.java b/languagetool-server/src/test/java/org/languagetool/server/HTTPServerTest.java
index <HASH>..<HASH> 100644
--- a/languagetool-server/src/test/java/org/languagetool/server/HTTPServerTest.java
+++ b/languagetool-server/src/test/java/org/languagetool/server/HTTPServerTest.java
@@ -76,7 +76,7 @@ public class HTTPServerTest {
File beolingus = new File("../languagetool-standalone/src/test/resources/beolingus_test.txt");
assertTrue(beolingus.exists());
- Files.write(configFile.toPath(), Collections.singletonList("beolingusFile=" + beolingus.getAbsolutePath()));
+ Files.write(configFile.toPath(), Collections.singletonList("beolingusFile=" + beolingus.getAbsolutePath().replace('\\', '/'))); // path works under Windows and Linux
HTTPServer server = new HTTPServer(new HTTPServerConfig(new String[]{
"--port", String.valueOf(HTTPTools.getDefaultPort()), | try to make test work under Windows ('\' would need to be escaped, but we can also just use '/' on Windows) | languagetool-org_languagetool | train | java |
81277d0dc576c4e46966eeeee1d0ce5cef4fd641 | diff --git a/ghost.py b/ghost.py
index <HASH>..<HASH> 100644
--- a/ghost.py
+++ b/ghost.py
@@ -280,7 +280,7 @@ class SqlStash(_BaseStash):
return record
def _delete(self, key):
- self.db.execute(self.keys.delete(), name=key)
+ self.db.execute(self.keys.delete().where(self.keys.c.name == key))
def _get_current_time(): | Add a WHERE clause to the delete in sqlalchemy backend
Without this, any delete command will just remove the whole db :) | nir0s_ghost | train | py |
3887524ba00e2a60a7f6be6528a657edef4122b9 | diff --git a/converters/toZigbee.js b/converters/toZigbee.js
index <HASH>..<HASH> 100644
--- a/converters/toZigbee.js
+++ b/converters/toZigbee.js
@@ -563,6 +563,15 @@ const converters = {
brightness = 2;
}
+ // If this command is send to a group, and this group contains a device not supporting genLevelCtrl, e.g. a switch
+ // that device won't change state with the moveToLevelWithOnOff command.
+ // Therefore send the genOnOff command also.
+ if (entity.constructor.name === 'Group' && state !== undefined) {
+ if (entity.members.filter((e) => !e.supportsInputCluster('genLevelCtrl')).length !== 0) {
+ await converters.on_off.convertSet(entity, 'state', 'ON', meta);
+ }
+ }
+
globalStore.putValue(entity, 'brightness', brightness);
await entity.command(
'genLevelCtrl', | Fix switches/plugs not controllable in group. <URL> | Koenkk_zigbee-shepherd-converters | train | js |
7fdc34f95763a9af770b9ac373da029364ec205b | diff --git a/pylint/checkers/async.py b/pylint/checkers/async.py
index <HASH>..<HASH> 100644
--- a/pylint/checkers/async.py
+++ b/pylint/checkers/async.py
@@ -1,6 +1,5 @@
# Copyright (c) 2003-2015 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:[email protected]
-# Copyright (c) 2009-2010 Arista Networks, Inc.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software | Remove line from the license header, which was inadvertently copied from base.py | PyCQA_pylint | train | py |
c79f2a3e184fa5cc626637aa2e8514b7edabfef0 | diff --git a/src/system/modules/metamodels/MetaModelItem.php b/src/system/modules/metamodels/MetaModelItem.php
index <HASH>..<HASH> 100644
--- a/src/system/modules/metamodels/MetaModelItem.php
+++ b/src/system/modules/metamodels/MetaModelItem.php
@@ -215,7 +215,6 @@ class MetaModelItem implements IMetaModelItem
}
}
}
- //ToDo: this is just a quick patch
//get the right jumpto
$intJumpto = null;
$strDesiredLanguage = $this->getMetaModel()->getActiveLanguage();
@@ -262,7 +261,7 @@ class MetaModelItem implements IMetaModelItem
if ($strParams)
{
- $strUrl = MetaModelController::generateFrontendUrl($objPage->row(), '/' . $strParams);
+ $strUrl = MetaModelController::generateFrontendUrl($objPage->row(), $strParams);
$arrResult['jumpTo'] = array
(
'url' => $strUrl, | Removed an excess slash in frontend urls. | MetaModels_core | train | php |
41cfa4c7d3cdc8359ce64587271d840c4a9fe028 | diff --git a/pyes/filters.py b/pyes/filters.py
index <HASH>..<HASH> 100644
--- a/pyes/filters.py
+++ b/pyes/filters.py
@@ -141,26 +141,22 @@ class RangeFilter(Filter):
NumericRangeFilter = RangeFilter
class PrefixFilter(Filter):
- def __init__(self, field=None, prefix=None, boost=None, **kwargs):
+ _internal_name = "prefix"
+
+ def __init__(self, field=None, prefix=None, **kwargs):
super(PrefixFilter, self).__init__(**kwargs)
self._values = {}
if field is not None and prefix is not None:
self.add(field, prefix)
- def add(self, field, prefix, boost=None):
- match = {'prefix':prefix}
- if boost:
- if isinstance(boost, (float, int)):
- match['boost'] = boost
- else:
- match['boost'] = float(boost)
- self._values[field] = match
+ def add(self, field, prefix):
+ self._values[field] = prefix
def serialize(self):
if not self._values:
raise RuntimeError("A least a field/prefix pair must be added")
- return {"prefix":self._values}
+ return {self._internal_name:self._values}
class ScriptFilter(Filter):
_internal_name = "script" | Fix PrefixFilter, boost was removed since isn't used on filters; Also the serialization of the object was returning an invalid filter definition. | aparo_pyes | train | py |
d5cb7f9da85809f04ed354caefec24a066de4f13 | diff --git a/bundles/as3/test/test_helper.rb b/bundles/as3/test/test_helper.rb
index <HASH>..<HASH> 100644
--- a/bundles/as3/test/test_helper.rb
+++ b/bundles/as3/test/test_helper.rb
@@ -5,7 +5,7 @@ require 'test/unit'
# indiidually, SPROUT_HOME should be a system or vm var and set
# Your local path where you've checked out the following branch:
# https://projectsprouts.googlecode.com/svn/branches/rubygems/sprouts/sprout
-SPROUT_HOME = ENV['SPROUT_HOME']
+SPROUT_HOME = ENV['SPROUT_HOME'] || '../../../'
$:.push(SPROUT_HOME + '/sprout/lib')
$:.push(SPROUT_HOME + '/sprout/test') | bundles/as3/test/test_helper.rb:
* Added relative path if SPROUT_HOME is not defined. | lukebayes_project-sprouts | train | rb |
c8e8db1ab0413fb3da50c1dd936cefb2599ce5d6 | diff --git a/src/resources/views/search/show.blade.php b/src/resources/views/search/show.blade.php
index <HASH>..<HASH> 100644
--- a/src/resources/views/search/show.blade.php
+++ b/src/resources/views/search/show.blade.php
@@ -19,7 +19,7 @@
<h3 class="lead">{{trans('cms::search.results')}} <span class="keyword">{{$keyword}}</span></h3>
@forelse($articles as $article)
<li>
- <a href="{{ $article->getUrl() }}">{{ $article->present()->title }}</a>
+ <a href="{{ $article->getUrl() }}">{{ $article->present()->introTitle(80) }}</a>
<small class="muted">({{$article->category->title}})</small>
<small class="pull-right"><i class="fa fa-calendar-o"></i> {{$article->created_at->format('F d, Y')}}
</small> | Limit title to <I> chars. | yajra_cms-core | train | php |
54f6105275372ba8e04b6e80dfd49b4fe647eda4 | diff --git a/EventListener/LeadSubscriber.php b/EventListener/LeadSubscriber.php
index <HASH>..<HASH> 100644
--- a/EventListener/LeadSubscriber.php
+++ b/EventListener/LeadSubscriber.php
@@ -65,7 +65,7 @@ class LeadSubscriber extends CommonSubscriber
'|',
[
$lead->getFirstname(),
- $lead->getLastActive(),
+ $lead->getLastActive()->format('Y-m-d H:i:s'),
$lead->getEmail(),
$lead->getPhone(),
$lead->getMobile(), | Fixes issue preventing the lead key from being set from when the lead was last active | TheDMSGroup_mautic-enhancer | train | php |
1a8f109b6bfc073dc81bf4ea63a3b0878aa70360 | diff --git a/src/main/java/groovy/lang/IntRange.java b/src/main/java/groovy/lang/IntRange.java
index <HASH>..<HASH> 100644
--- a/src/main/java/groovy/lang/IntRange.java
+++ b/src/main/java/groovy/lang/IntRange.java
@@ -362,7 +362,8 @@ public class IntRange extends AbstractList<Integer> implements Range<Integer>, S
@Override
public int size() {
- return getTo() - getFrom() + 1;
+ // If fully exclusive and borders are one apart, the size would be negative, take that into account
+ return Math.max(getTo() - getFrom() + 1, 0);
}
@Override | GROOVY-<I>: Fix IntRange size being negative on some occasions | apache_groovy | train | java |
4ca98448e20e6143c02e48a1a183e047417aeeda | diff --git a/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java b/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java
index <HASH>..<HASH> 100644
--- a/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java
+++ b/test/com/google/javascript/jscomp/NewTypeInferenceES6Test.java
@@ -180,7 +180,6 @@ public final class NewTypeInferenceES6Test extends NewTypeInferenceTestBase {
GlobalTypeInfo.INVALID_PROP_OVERRIDE);
typeCheck(LINE_JOINER.join(
- "/** @constructor */",
"class Foo {",
" /** @param {...number} var_args */",
" method(var_args) {}",
@@ -192,7 +191,6 @@ public final class NewTypeInferenceES6Test extends NewTypeInferenceTestBase {
NewTypeInference.INVALID_ARGUMENT_TYPE);
typeCheck(LINE_JOINER.join(
- "/** @constructor */",
"class Foo {",
" /** @param {...number} var_args */",
" method(var_args) {}", | [NTI] Delete some unnecessary annotations from the ES6 tests.
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
374f4946972673f86e06a011e20fc039bb73e234 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -294,7 +294,7 @@ jasmine.Expectation.prototype.wrapCompare = function(name, matcherFactory) {
message = expectation.util.buildFailureMessage.apply(null, args);
} else {
if (Object.prototype.toString.apply(result.message) === '[object Function]') {
- message = result.message();
+ message = result.message(expectation.isNot);
} else {
message = result.message;
} | Allow to specify a function as a custom matcher's message. (#<I>)
In case the matcher assigns a promise to the "pass" property, it wasn't possible to distinguish between positive and negative expectations to form a correct failure message. After this change a function taking an "isNot" argument and returning a failure message can be specified. Since it's called only when the matcher fails, there is enough information to produce that message. | angular_jasminewd | train | js |
fbd98fdcf373ddbe09843c3ad5a7db9bc3651c3b | diff --git a/src/Validator.php b/src/Validator.php
index <HASH>..<HASH> 100644
--- a/src/Validator.php
+++ b/src/Validator.php
@@ -126,7 +126,11 @@ class Validator
*/
public function isEmail($email)
{
- return (bool) preg_match('/^.+@.+\..+$/i', $email);
+ if (is_string($email)) {
+ return (bool) preg_match('/^.+@.+\..+$/i', $email);
+ }
+
+ return false;
}
/**
diff --git a/tests/IsEmailTest.php b/tests/IsEmailTest.php
index <HASH>..<HASH> 100644
--- a/tests/IsEmailTest.php
+++ b/tests/IsEmailTest.php
@@ -34,6 +34,14 @@ class IsEmailTest extends PHPUnit_Framework_TestCase
$this->validator->isEmail('example[AT]example.com')
);
+ $this->assertFalse(
+ $this->validator->isEmail(null)
+ );
+
+ $this->assertFalse(
+ $this->validator->isEmail(['this', 'is', 'array'])
+ );
+
// Valid
$this->assertTrue(
$this->validator->isEmail('[email protected]') | Ensure $email is a string. | nojacko_email-validator | train | php,php |
8a01660f6b1d692bafd6689b2b63ad0e54759e97 | diff --git a/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarController.java b/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarController.java
index <HASH>..<HASH> 100644
--- a/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarController.java
+++ b/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarController.java
@@ -59,7 +59,7 @@ public class SidecarController {
public String home() {
return "<head><title>Sidecar</title></head><body>\n"
+ "<a href='/ping'>ping</a><br/>\n"
- + "<a href='/health'>health</a><br/>\n" + "<a href='/hosts/"
+ + "<a href='/actuator/health'>health</a><br/>\n" + "<a href='/hosts/"
+ this.appName + "'>hosts/" + this.appName + "</a><br/>\n" + "</body>";
} | fix SidecarController's broken link. (#<I>)
fix SidecarController's broken link. | spring-cloud_spring-cloud-netflix | train | java |
378532082730b38247616b83fd3daac542125d24 | diff --git a/src/Links/Link.php b/src/Links/Link.php
index <HASH>..<HASH> 100644
--- a/src/Links/Link.php
+++ b/src/Links/Link.php
@@ -30,27 +30,4 @@ class Link extends Model
{
return (bool) $this->new_tab;
}
-
- /**
- * @return string
- */
- public function getTarget()
- {
- return $this->isNewTab() ? '_blank' : '';
- }
-
- /**
- * @return string
- */
- public function getAttributes()
- {
- $target = $this->getTarget();
-
- if( !$target )
- {
- return (string) null;
- }
-
- return 'target=\'' . $target . '\'';
- }
} | Remove getAttributes() method from Link due to conflict with Laravel method | arbory_arbory | train | php |
a8ddd1e85a477dc88f2513065e2d7a92ab36632b | diff --git a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
+++ b/languagetool-language-modules/de/src/main/java/org/languagetool/rules/de/GermanSpellerRule.java
@@ -295,6 +295,8 @@ public class GermanSpellerRule extends CompoundAwareHunspellRule {
} else if (word.equals("Ladies")) {
return Collections.singletonList("Ladys");
} else if (word.equals("Hallochen")) {
+ return Arrays.asList("Hallöchen", "hallöchen");
+ } else if (word.equals("hallochen")) {
return Collections.singletonList("hallöchen");
} else if (word.matches("[mM]issionarie?sie?rung")) {
return Collections.singletonList("Missionierung"); | [de] improve "hallochen" | languagetool-org_languagetool | train | java |
6c35c7ce0f517b181b1440a646abd2a45a5b3b69 | diff --git a/java/org/gem/calc/CalcUtils.java b/java/org/gem/calc/CalcUtils.java
index <HASH>..<HASH> 100644
--- a/java/org/gem/calc/CalcUtils.java
+++ b/java/org/gem/calc/CalcUtils.java
@@ -94,6 +94,12 @@ public class CalcUtils
}
};
+ /**
+ * Useful for checking that an array contains at least `len` elements.
+ * @param len
+ * @return A Closure that throws an InputValidationException if the minimum
+ * length of an input array is not met.
+ */
public static final Closure lenGE(final int len)
{
return new Closure ()
@@ -113,6 +119,13 @@ public class CalcUtils
};
}
+ /**
+ * Given an Earthquake Rupture Forecast, check each Source verify that it is
+ * a poissonian source. If any non-poissonian sources are detected in the
+ * ERF, throw a RuntimeException. (Currently, we do not support
+ * non-poissonian sources.)
+ * @param erf
+ */
public static void assertPoissonian(EqkRupForecastAPI erf)
{
for (int i = 0; i < erf.getSourceList().size(); i++) | Added some javadoc for lenGE and assertPoissonian
Former-commit-id: 4b<I>b2a<I>d7e0c<I>d<I>cfc<I>fbd<I>d | gem_oq-engine | train | java |
c18fe68f86d36e77b7f5f9627c29fff54f695f9e | diff --git a/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Wrapper.java b/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Wrapper.java
index <HASH>..<HASH> 100644
--- a/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Wrapper.java
+++ b/plugins/org.eclipse.xtext.util/src/org/eclipse/xtext/util/Wrapper.java
@@ -37,5 +37,10 @@ public class Wrapper<T> {
public void set(T value) {
this.value = value;
}
+
+ @Override
+ public String toString() {
+ return "Wrapper of ("+value+")";
+ }
} | [xbase lib] don't use ToStringHelper.ToString for other objects than the passed one. | eclipse_xtext-core | train | java |
963f9ef048324fe1facfd643520a306993585923 | diff --git a/ggplot/scales/utils.py b/ggplot/scales/utils.py
index <HASH>..<HASH> 100644
--- a/ggplot/scales/utils.py
+++ b/ggplot/scales/utils.py
@@ -54,7 +54,7 @@ def calc_axis_breaks_and_limits(minval, maxval, nlabs=None):
tick_range = diff / float(nlabs)
# make the tick range nice looking...
power = math.ceil(math.log(tick_range, 10))
- step = round(tick_range / (10**power), 1) * 10**power
+ step = np.round(tick_range / (10**power), 1) * 10**power
labs = list(drange(minval-(step/3), maxval+(step/3), step)) | Python round() to numpy.round()
`round()` changed between python 2 and 3
**Problematic outcome**
A testcase with different axes for python 3 compared to python 2
and so could not agree across versions.
**Solution**
`numpy.round()` | has2k1_plotnine | train | py |
88b59f27e59f3e789b6c43188b2ce7079c52c4ac | diff --git a/lib/yql_query.rb b/lib/yql_query.rb
index <HASH>..<HASH> 100644
--- a/lib/yql_query.rb
+++ b/lib/yql_query.rb
@@ -17,7 +17,15 @@ module YqlQuery
private
def select_statement
- stmt = "select #{@select || '*'}"
+ stmt = 'select '
+ stmt << case @select
+ when String
+ @select
+ when Array
+ @select.join(', ')
+ else
+ '*'
+ end
stmt << " from "
stmt << @table if @table
stmt | handle query generation when select is an array | stve_yql-query | train | rb |
b4fdf258ca95b45a051b57a19db3e8f8f6c785fe | diff --git a/test/cursor.test.js b/test/cursor.test.js
index <HASH>..<HASH> 100644
--- a/test/cursor.test.js
+++ b/test/cursor.test.js
@@ -1135,6 +1135,26 @@ describe('Cursor', function () {
done();
});
+ it('Can have many live queries in one model', function (done) {
+ done = _.once(done);
+
+ var liveFind, liveCount;
+
+ // comment one of these two to work
+ liveFind = d.find({}).live();
+ liveCount = d.find({}).count().live();
+
+ d.on("liveQueryUpdate", function() {
+ if (liveFind)
+ liveFind.res.length.should.equal(7);
+
+ if (liveCount)
+ liveCount.res.should.equal(7);
+
+ done();
+ });
+ });
+
}); // End of 'Live Query'
}); | Test case: Can have many live queries in one model | Ivshti_linvodb3 | train | js |
f83b7002e7feadb0ca6d4075929409c87716a186 | diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js
index <HASH>..<HASH> 100644
--- a/lib/core/engine/iteration.js
+++ b/lib/core/engine/iteration.js
@@ -154,6 +154,8 @@ class Iteration {
await delay(ANDROID_DELAY_TIME);
}
+ await delay(options.timeToSettle || 100);
+
if (recordVideo && options.videoParams.debug) {
await this.video.record(0, index);
}
diff --git a/lib/support/cli.js b/lib/support/cli.js
index <HASH>..<HASH> 100644
--- a/lib/support/cli.js
+++ b/lib/support/cli.js
@@ -521,6 +521,12 @@ module.exports.parseCommandLine = function parseCommandLine() {
default: 0,
describe: 'Delay between runs, in milliseconds'
})
+ .option('timeToSettle', {
+ type: 'number',
+ default: 0,
+ describe:
+ 'Extra time added for the browser to settle before starting to test a URL. This delay happens after the browser was opened and before the navigation to the URL'
+ })
.option('proxy.http', {
type: 'string',
describe: 'Http proxy (host:port)', | Configurable settle time for the browser before starting to test (#<I>)
* Configurable settle time for the browser before starting to test | sitespeedio_browsertime | train | js,js |
32eedf4208bb3d8ed96d0515d492885cbe68c126 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ setup(
version = version,
description = 'Python utilites for manipulating IPv4 addresses',
long_description = "Utilities for manipulating IPv4 addresses including a class that can be used to include CIDR network blocks in Django's INTERNAL_IPS setting.",
- url = 'http://python-iptools.googlecode.com',
+ url = 'https://github.com/bd808/python-iptools',
download_url = 'http://pypi.python.org/packages/source/i/iptools/',
author = 'Bryan Davis',
author_email = '[email protected]',
diff --git a/src/iptools/__init__.py b/src/iptools/__init__.py
index <HASH>..<HASH> 100644
--- a/src/iptools/__init__.py
+++ b/src/iptools/__init__.py
@@ -68,7 +68,7 @@
)
"""
-__version__ = '0.5.0-dev'
+__version__ = '0.5.0'
__all__ = (
'cidr2block', | Set version to <I>. | bd808_python-iptools | train | py,py |
dd846042010573afbce3bfb8d093d7d48266b7c7 | diff --git a/lib/action_args/abstract_controller.rb b/lib/action_args/abstract_controller.rb
index <HASH>..<HASH> 100644
--- a/lib/action_args/abstract_controller.rb
+++ b/lib/action_args/abstract_controller.rb
@@ -1,15 +1,21 @@
require_relative 'params_handler'
using ActionArgs::ParamsHandler
-module AbstractController
- class Base
+module ActionArgs
+ module AbstractControllerMethods
def send_action(method_name, *args)
- return send method_name, *args unless args.empty?
- return send method_name, *args unless defined?(params)
+ return super unless args.empty?
+ return super unless defined?(params)
- send_with_method_parameters_from_params method_name
+ strengthen_params! method_name
+ values = extract_method_arguments_from_params method_name
+ super method_name, *values
end
+ end
+end
+module AbstractController
+ class Base
# You can configure StrongParameters' `permit` attributes using this DSL method.
# The `permit` call will be invoked only against parameters having the resource
# model name inferred from the controller class name.
@@ -31,3 +37,5 @@ module AbstractController
end
end
end
+
+AbstractController::Base.send :prepend, ActionArgs::AbstractControllerMethods | Play nice with other plugins that redefine send_action | asakusarb_action_args | train | rb |
debc3a2e4fa0eb58f93c7bc2c0d5b08f6a23efd5 | diff --git a/demo/urls.py b/demo/urls.py
index <HASH>..<HASH> 100644
--- a/demo/urls.py
+++ b/demo/urls.py
@@ -12,7 +12,7 @@ from zinnia.sitemaps import CategorySitemap
from zinnia.sitemaps import AuthorSitemap
admin.autodiscover()
-handler500 = 'demo.views.server_error'
+handler500 = 'django.views.defaults.server_error'
handler404 = 'django.views.defaults.page_not_found'
handler403 = 'django.views.defaults.permission_denied'
@@ -46,7 +46,7 @@ urlpatterns += patterns(
'',
url(r'^403/$', 'django.views.defaults.permission_denied'),
url(r'^404/$', 'django.views.defaults.page_not_found'),
- url(r'^500/$', 'demo.views.server_error'),
+ url(r'^500/$', 'django.views.defaults.server_error'),
)
if settings.DEBUG: | Use the standard server_error views, because STATIC_URL is not needed anymore | Fantomas42_django-blog-zinnia | train | py |
7bfa6234ef651f66f6dc17d4fb78abcee576077f | diff --git a/projects/samskivert/src/java/com/samskivert/util/Interval.java b/projects/samskivert/src/java/com/samskivert/util/Interval.java
index <HASH>..<HASH> 100644
--- a/projects/samskivert/src/java/com/samskivert/util/Interval.java
+++ b/projects/samskivert/src/java/com/samskivert/util/Interval.java
@@ -1,5 +1,5 @@
//
-// $Id: Interval.java,v 1.3 2001/08/11 22:43:29 mdb Exp $
+// $Id: Interval.java,v 1.4 2002/05/23 23:43:17 ray Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -25,13 +25,9 @@ import java.util.*;
/**
* An interface for doing operations after some delay. Normally,
* <code>intervalExpired()</code> should not do anything that will take
- * very long. If you want to use the thread to do some serious stuff, look
- * at <code>incrementHelperThreads</code> and
- * <code>setMaxHelperThreads</code> in <code>IntervalManager</code>.
+ * very long.
*
* @see IntervalManager
- * @see IntervalManager#incrementHelperThreads
- * @see IntervalManager#setMaxHelperThreads
*/
public interface Interval
{ | updated documentation so that we don't get anyone excited about
nonexistant features
git-svn-id: <URL> | samskivert_samskivert | train | java |
78d825f56b5bb18a749a1e6f0e44054ee2261212 | diff --git a/scheduler/feasible.go b/scheduler/feasible.go
index <HASH>..<HASH> 100644
--- a/scheduler/feasible.go
+++ b/scheduler/feasible.go
@@ -290,7 +290,7 @@ func (c *ConstraintChecker) meetsConstraint(constraint *structs.Constraint, opti
// resolveConstraintTarget is used to resolve the LTarget and RTarget of a Constraint
func resolveConstraintTarget(target string, node *structs.Node) (interface{}, bool) {
// If no prefix, this must be a literal value
- if !strings.HasPrefix(target, "$") {
+ if !strings.HasPrefix(target, "${") {
return target, true
} | resolveConstraintTargets checks for bracket syntax | hashicorp_nomad | train | go |
c5d94e6af5e7a9d465d25fbcfb348457e9d22aeb | diff --git a/pyechonest/artist.py b/pyechonest/artist.py
index <HASH>..<HASH> 100644
--- a/pyechonest/artist.py
+++ b/pyechonest/artist.py
@@ -316,7 +316,7 @@ class Artist(ArtistProxy):
"""
if not (cache and ('foreign_ids' in self.cache) and filter(lambda d: d.get('catalog') == idspace, self.cache['foreign_ids'])):
response = self.get_attribute('profile', bucket=['id:'+idspace])
- foreign_ids = response['artist'].get("foreign_ids")
+ foreign_ids = response['artist'].get("foreign_ids", [])
self.cache['foreign_ids'] = self.cache.get('foreign_ids', []) + foreign_ids
cval = filter(lambda d: d.get('catalog') == idspace, self.cache.get('foreign_ids'))
return cval[0].get('foreign_id') if cval else None | can't add None and ListType | echonest_pyechonest | train | py |
55acea5fa9abdf9ff498ea2123a0842595aa6401 | diff --git a/src/Http/ApiClient.php b/src/Http/ApiClient.php
index <HASH>..<HASH> 100644
--- a/src/Http/ApiClient.php
+++ b/src/Http/ApiClient.php
@@ -58,7 +58,7 @@ class ApiClient
/**
* User agent constants.
*/
- const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/0.9.1';
+ const HEADER_USER_AGENT_BUNQ_SDK_DEFAULT = 'bunq-sdk-php/0.10.0';
/**
* Binary request constants. | bump the release version up to <I> | bunq_sdk_php | train | php |
195a9c4c96b8498c9f8d15c8908cc5436c7f4988 | diff --git a/azurerm/data_source_client_config.go b/azurerm/data_source_client_config.go
index <HASH>..<HASH> 100644
--- a/azurerm/data_source_client_config.go
+++ b/azurerm/data_source_client_config.go
@@ -68,6 +68,9 @@ func dataSourceArmClientConfigRead(d *schema.ResourceData, meta interface{}) err
if principal := servicePrincipal; principal != nil {
d.Set("service_principal_application_id", principal.AppID)
d.Set("service_principal_object_id", principal.ObjectID)
+ } else {
+ d.Set("service_principal_application_id", "")
+ d.Set("service_principal_object_id", "")
}
return nil | azurerm_client_config: always set all properties (#<I>) | terraform-providers_terraform-provider-azurerm | train | go |
ef287e56d3501f050b4a5e7f5981d081aa13575f | diff --git a/default_context.go b/default_context.go
index <HASH>..<HASH> 100644
--- a/default_context.go
+++ b/default_context.go
@@ -9,6 +9,7 @@ import (
"io"
"net/http"
"net/url"
+ "runtime"
"strconv"
"strings"
"time"
@@ -82,7 +83,14 @@ func (d *DefaultContext) Set(key string, value interface{}) {
// Get is deprecated. Please use Value instead.
func (d *DefaultContext) Get(key string) interface{} {
- d.Logger().Warn("Context#Get is deprecated. Please use Context#Value instead")
+ warningMsg := "Context#Get is deprecated. Please use Context#Value instead."
+
+ _, file, no, ok := runtime.Caller(1)
+ if ok {
+ warningMsg = fmt.Sprintf("Context#Get is deprecated. Please use Context#Value instead. Called from %s:%d\n", file, no)
+ }
+
+ d.Logger().Warn(warningMsg)
return d.Value(key)
} | [#<I>] adding line number to the Context#Get warning | gobuffalo_buffalo | train | go |
Subsets and Splits