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 |
|---|---|---|---|---|---|
2082ff82b581dfbe252338829c1ce7c31797f66c | diff --git a/runconfig/parse.go b/runconfig/parse.go
index <HASH>..<HASH> 100644
--- a/runconfig/parse.go
+++ b/runconfig/parse.go
@@ -336,18 +336,15 @@ func parseRestartPolicy(policy string) (RestartPolicy, error) {
name = parts[0]
)
+ p.Name = name
switch name {
case "always":
- p.Name = name
-
if len(parts) == 2 {
return p, fmt.Errorf("maximum restart count not valid with restart policy of \"always\"")
}
case "no":
// do nothing
case "on-failure":
- p.Name = name
-
if len(parts) == 2 {
count, err := strconv.Atoi(parts[1])
if err != nil { | log: Add restart policy name to the inspect information of container
Under the restart policy "--restart=no", there is no record about it
in the information from docker inspect.
To keep it consistent around the three(maybe more in the future) restart
policies and distinguish with no restart policy specified cases, it's
worth to record it even though it is the default restart policy which
will not restart the container. | moby_moby | train | go |
a0459eafa566b88b7f4b61c17e4d8550195d6139 | diff --git a/manybugs/php/prepare.py b/manybugs/php/prepare.py
index <HASH>..<HASH> 100755
--- a/manybugs/php/prepare.py
+++ b/manybugs/php/prepare.py
@@ -5,6 +5,7 @@ import subprocess
import multiprocessing
NASTY_REVISIONS = [
+ "147382033a",
"e7a1d5004e",
"0a1cc5f01c",
"51a4ae6576", | Fixes another php bug similar to #<I> | squaresLab_BugZoo | train | py |
e452ea7624878f0ba4a2557ad02ec9660dd6eaa9 | diff --git a/example/node-xml/run.js b/example/node-xml/run.js
index <HASH>..<HASH> 100644
--- a/example/node-xml/run.js
+++ b/example/node-xml/run.js
@@ -1,10 +1,10 @@
-var sys = require('sys');
-process.mixin(GLOBAL, require("../../lib/jsdom/level1/core").dom.level1.core);
+var sys = require('sys'),
+ dom = require("../../lib/jsdom/level1/core").dom.level1.core;
// git clone git://github.com/robrighter/node-xml.git into ~/.node_libraries
var xml = require("node-xml/lib/node-xml");
-var doc = new Document();
+var doc = new dom.Document();
var currentElement = doc;
var totalElements = 0;
var parser = new xml.SaxParser(function(cb) { | Modified example to work without process.mixin | jsdom_jsdom | train | js |
c1ed623617d18e7ec108898bf117f83aef5c9b8f | diff --git a/lib/chef_attrdoc.rb b/lib/chef_attrdoc.rb
index <HASH>..<HASH> 100644
--- a/lib/chef_attrdoc.rb
+++ b/lib/chef_attrdoc.rb
@@ -89,11 +89,11 @@ module ChefAttrdoc
def to_s
strings = []
@groups.each do |code, doc|
- strings << doc.gsub(/^# /, '')
+ strings << doc.gsub(/^#[[:blank:]]*/, '')
strings << "\n"
- strings << "```ruby"
+ strings << "```ruby\n"
strings << code
- strings << "```\n"
+ strings << "```\n\n"
end
strings.join
end
diff --git a/spec/chef_attrdoc_spec.rb b/spec/chef_attrdoc_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/chef_attrdoc_spec.rb
+++ b/spec/chef_attrdoc_spec.rb
@@ -128,4 +128,26 @@ END
" }\n",
"# platform specific attributes\n"]])
end
+
+ it "handles comments over several lines which include blank lines" do
+ text = <<END
+# my comment
+#
+# continued comment
+#
+default["some"]["actual"]["code"] = 42
+END
+ ca = ChefAttrdoc::AttributesFile.new(text)
+ expect(ca.to_s).to eq(<<-END)
+my comment
+
+continued comment
+
+
+```ruby
+default["some"]["actual"]["code"] = 42
+```
+
+END
+ end
end | handle empty comment lines
comment lines with just one '#' at the beginning of the line did not
have the # removed in the final output | mapleoin_chef_attrdoc | train | rb,rb |
2526827b6d2700b094f6760202bb7063a5bc3043 | diff --git a/lnd_test.go b/lnd_test.go
index <HASH>..<HASH> 100644
--- a/lnd_test.go
+++ b/lnd_test.go
@@ -2129,15 +2129,16 @@ func testSphinxReplayPersistence(net *lntest.NetworkHarness, t *harnessTest) {
t.Fatalf("received payment error: %v", resp.PaymentError)
}
- // Since the payment failed, the balance should still be left unaltered.
+ // Since the payment failed, the balance should still be left
+ // unaltered.
assertAmountSent(0)
ctxt, _ = context.WithTimeout(ctxb, timeout)
- closeChannelAndAssert(ctxt, t, net, carol, chanPoint, false)
+ closeChannelAndAssert(ctxt, t, net, carol, chanPoint, true)
- // Finally, shutdown the nodes we created for the duration of the tests,
- // only leaving the two seed nodes (Alice and Bob) within our test
- // network.
+ // Finally, shutdown the nodes we created for the duration of the
+ // tests, only leaving the two seed nodes (Alice and Bob) within our
+ // test network.
if err := net.ShutdownNode(carol); err != nil {
t.Fatalf("unable to shutdown carol: %v", err)
} | test: modify sphinx replay test to force close the final channel
In this commit, we modify the sphinx replay test to actually force close
that final channel. We do this, as otherwise, we'll now reject the co-op
close attempt as the channel still has active HTLCs. | lightningnetwork_lnd | train | go |
557886c9b7d7074275b38deacf10c5899142de57 | diff --git a/pyxmpp/client.py b/pyxmpp/client.py
index <HASH>..<HASH> 100644
--- a/pyxmpp/client.py
+++ b/pyxmpp/client.py
@@ -69,6 +69,7 @@ class Client:
self.port,self.auth_methods,self.enable_tls,self.require_tls)
stream.debug=self.debug
stream.print_exception=self.print_exception
+ self.stream_created(stream)
stream.connect()
stream.post_auth=self.__post_auth
stream.post_disconnect=self.__post_disconnect
@@ -184,11 +185,14 @@ class Client:
def __post_disconnect(self):
self.state_changed.acquire()
- if self.stream:
- self.stream.close()
- self.stream=None
- self.state_changed.notify()
- self.state_changed.release()
+ try:
+ if self.stream:
+ self.stream.close()
+ self.stream_closed(self.stream)
+ self.stream=None
+ self.state_changed.notify()
+ finally:
+ self.state_changed.release()
self.disconnected()
def __disco_info(self,iq):
@@ -213,6 +217,12 @@ class Client:
if stream:
stream.idle()
+ def stream_created(self,stream):
+ pass
+
+ def stream_closed(self,stream):
+ pass
+
def session_started(self):
p=Presence()
self.stream.send(p) | - stream_created and stream_closed methods to override for low-level stream setup | Jajcus_pyxmpp2 | train | py |
1e36cb65d88b6be5f7e58cad412dc9703e041037 | diff --git a/src/java/com/threerings/presents/dobj/DSet.java b/src/java/com/threerings/presents/dobj/DSet.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/presents/dobj/DSet.java
+++ b/src/java/com/threerings/presents/dobj/DSet.java
@@ -1,5 +1,5 @@
//
-// $Id: DSet.java,v 1.14 2002/02/08 04:44:32 mdb Exp $
+// $Id: DSet.java,v 1.15 2002/02/08 05:14:22 mdb Exp $
package com.threerings.presents.dobj;
@@ -358,6 +358,9 @@ public class DSet
for (int i = 0; i < elength; i++) {
Element elem = _elements[i];
if (elem != null) {
+ if (_elementType == null) {
+ out.writeUTF(elem.getClass().getName());
+ }
elem.writeTo(out);
}
} | Need to prefix heterogenous set elements with their classname.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
642de46c4edd1cc151665c0528fddce6b20dc5ac | diff --git a/client/extensions/wp-job-manager/state/data-layer/index.js b/client/extensions/wp-job-manager/state/data-layer/index.js
index <HASH>..<HASH> 100644
--- a/client/extensions/wp-job-manager/state/data-layer/index.js
+++ b/client/extensions/wp-job-manager/state/data-layer/index.js
@@ -1,16 +1,14 @@
/**
* Internal dependencies
*/
-import { mergeHandlers } from 'state/action-watchers/utils';
import { addHandlers } from 'state/data-layer/extensions-middleware';
import settings from './settings';
import debugFactory from 'debug';
const debug = debugFactory( 'wp-job-manager:errors' );
-const handlers = mergeHandlers( settings );
export default function installActionHandlers() {
- const added = addHandlers( 'wp-job-manager', handlers );
+ const added = addHandlers( 'wp-job-manager', settings );
if ( ! added ) {
debug( 'Failed to add action handlers for "wp-job-manager"' ); | Remove use of mergeHandlers as there's currently only one | Automattic_wp-calypso | train | js |
2aae6d635000ec2923c4e170792e3dcf4a4dd86d | diff --git a/tests/src/main/java/org/hibernate/beanvalidation/tck/util/TestUtil.java b/tests/src/main/java/org/hibernate/beanvalidation/tck/util/TestUtil.java
index <HASH>..<HASH> 100644
--- a/tests/src/main/java/org/hibernate/beanvalidation/tck/util/TestUtil.java
+++ b/tests/src/main/java/org/hibernate/beanvalidation/tck/util/TestUtil.java
@@ -393,7 +393,9 @@ public final class TestUtil {
return new WebArchiveBuilder().withClasses(
BaseExecutableValidatorTest.class,
BaseValidatorTest.class,
- WebArchiveBuilder.class
+ WebArchiveBuilder.class,
+ TestUtil.class,
+ ConstraintViolationAssert.class
);
} | BVTCK-<I> Include TestUtil and ConstraintViolationAssert in the package
deployed by Arquillian
This is necessary for the incontainer build. | beanvalidation_beanvalidation-tck | train | java |
66cc51b583daf137aff91928c0292fabde0be0ca | diff --git a/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java b/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
index <HASH>..<HASH> 100755
--- a/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
+++ b/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
@@ -138,6 +138,7 @@ public class OverlyConcreteParameter extends BytecodeScanningDetector {
for (AnnotationEntry entry : obj.getAnnotationEntries()) {
if (CONVERSION_ANNOTATIONS.contains(entry.getAnnotationType())) {
methodSignatureIsConstrained = true;
+ break;
}
}
} | break out of a loop if found | mebigfatguy_fb-contrib | train | java |
c088850b2813b9d32f4709e2bcddd585ff3ed46c | diff --git a/graphs/tests/test_analysis.py b/graphs/tests/test_analysis.py
index <HASH>..<HASH> 100644
--- a/graphs/tests/test_analysis.py
+++ b/graphs/tests/test_analysis.py
@@ -73,6 +73,9 @@ class TestAnalysis(unittest.TestCase):
for G in self.graphs:
assert_array_equal(G.betweenness(kind='vertex'), [1,0,1,0,0])
assert_array_equal(G.betweenness(kind='edge'), [2,1,2,3,1,1])
+ g = Graph.from_adj_matrix([[0,1,2],[1,0,0],[2,0,0]])
+ assert_array_equal(g.betweenness(kind='vertex'), [2,0,0])
+ assert_array_equal(g.betweenness(kind='edge'), [2,2,2,2])
def test_eccentricity(self):
for G in self.graphs: | Adding a weighted test case for betweenness
[ci skip] | all-umass_graphs | train | py |
ef1eb33837c28650c5ff8954d9b85d27bbc6c586 | diff --git a/src/Decoda/Decoda.php b/src/Decoda/Decoda.php
index <HASH>..<HASH> 100644
--- a/src/Decoda/Decoda.php
+++ b/src/Decoda/Decoda.php
@@ -1372,7 +1372,7 @@ class Decoda {
* @param array $wrapper
* @return array
*/
- protected function _extractNodes(array $chunks, array $wrapper = array()) {
+ protected function _extractNodes(array $chunks, array $wrapper = array(), $depth = 0) {
$chunks = $this->_cleanChunks($chunks, $wrapper);
$nodes = array();
$tag = array();
@@ -1416,7 +1416,8 @@ class Decoda {
// Slice a section of the array if the correct closing tag is found
$node = $chunks[$openIndex];
- $node['children'] = $this->_extractNodes(array_slice($chunks, ($openIndex + 1), $index), $chunks[$openIndex]);
+ $node['depth'] = $depth;
+ $node['children'] = $this->_extractNodes(array_slice($chunks, ($openIndex + 1), $index), $chunks[$openIndex], $depth + 1);
$nodes[] = $node;
// There is no opening or a broken opening tag, which means
@@ -1620,4 +1621,4 @@ class Decoda {
return trim($string, "\t\n\r\0\x0B");
}
-}
\ No newline at end of file
+} | Update Decoda.php
Store node's depth in returned nodes in _extractNodes | milesj_decoda | train | php |
42b0e28fb622acc93712c49fdff122d8cf4d5bf4 | diff --git a/lib/plugin.js b/lib/plugin.js
index <HASH>..<HASH> 100644
--- a/lib/plugin.js
+++ b/lib/plugin.js
@@ -12,16 +12,22 @@ module.exports = postcss.plugin('postcss-selector-namespace', (options = {}) =>
selfSelector = regexpToGlobalRegexp(selfSelector)
return (css, result) => {
+ const computedNamespace = typeof namespace === 'string' ?
+ namespace :
+ namespace(css.source.input.file)
+
+ if (!computedNamespace) {
+ return
+ }
+
css.walkRules(rule => {
if (canNamespaceSelectors(rule)) {
return
}
- const computedNamespace = typeof namespace === 'string' ? namespace : namespace(css.source.input.file)
-
- if (computedNamespace) {
- rule.selectors = rule.selectors.map(selector => namespaceSelector(selector, computedNamespace))
- }
+ rule.selectors = rule.selectors.map(selector =>
+ namespaceSelector(selector, computedNamespace)
+ )
})
} | Don't compute namespace for each rule | topaxi_postcss-selector-namespace | train | js |
c3bbce3bd2e5aae28101a8ea3539432aa6988fd3 | diff --git a/lib/ronin/ui/command_line/command_line.rb b/lib/ronin/ui/command_line/command_line.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/ui/command_line/command_line.rb
+++ b/lib/ronin/ui/command_line/command_line.rb
@@ -49,6 +49,10 @@ module Ronin
Installation.each_file_in(commands_dir) do |path|
# remove the .rb file extension
name = path.chomp('.rb')
+
+ # replace any file separators with a ':', to mimic the
+ # naming convention of Rake/Thor.
+ name.tr!(File::SEPARATOR,':')
# replace all _ and - characters with a single _
name.gsub!(/[_-]+/,'_') | Begin supporting the listing of commands within sub-directories of 'lib/ronin/ui/command_line/commands'. | ronin-ruby_ronin | train | rb |
fbdf7fa03db5ea08b6820ba13584edad9f0c1baa | diff --git a/src/sos/hosts.py b/src/sos/hosts.py
index <HASH>..<HASH> 100755
--- a/src/sos/hosts.py
+++ b/src/sos/hosts.py
@@ -129,7 +129,8 @@ class LocalHost:
'''For local host, no path map, send and receive ...'''
def __init__(self, config):
- self.alias = config['alias'] if 'alias' in config else 'localhost'
+ # even if the config has an alias, we use localhost to make it clear that the host is localhost
+ self.alias = 'localhost'
self.address = 'localhost'
# we checkk local jobs more aggressively
self.config = {'alias': 'localhost', 'status_check_interval': 2} | Fix alias of localhost to avoid confusion | vatlab_SoS | train | py |
ecd33018effd36e80819bc3d72ae0f76985bb13d | diff --git a/raven/handlers/logbook.py b/raven/handlers/logbook.py
index <HASH>..<HASH> 100644
--- a/raven/handlers/logbook.py
+++ b/raven/handlers/logbook.py
@@ -41,7 +41,7 @@ class SentryHandler(logbook.Handler):
def emit(self, record):
try:
# Avoid typical config issues by overriding loggers behavior
- if record.channel.startswith('sentry.errors'):
+ if record.channel.startswith(('sentry.errors', 'raven')):
print >> sys.stderr, to_string(self.format(record))
return
diff --git a/raven/handlers/logging.py b/raven/handlers/logging.py
index <HASH>..<HASH> 100644
--- a/raven/handlers/logging.py
+++ b/raven/handlers/logging.py
@@ -52,7 +52,7 @@ class SentryHandler(logging.Handler, object):
self.format(record)
# Avoid typical config issues by overriding loggers behavior
- if record.name.startswith('sentry.errors'):
+ if record.name.startswith(('sentry.errors', 'raven')):
print(to_string(record.message), sys.stderr)
return | Exclude raven from SentryHandler | getsentry_raven-python | train | py,py |
e8a6731495902c8a0c9f603e5ffcd42204e0b7d8 | diff --git a/app/src/js/.eslintrc.js b/app/src/js/.eslintrc.js
index <HASH>..<HASH> 100644
--- a/app/src/js/.eslintrc.js
+++ b/app/src/js/.eslintrc.js
@@ -35,6 +35,8 @@ module.exports = {
"wrap-iife": ["error", "any"],
// Disallow the use of arguments.caller or arguments.callee
"no-caller": "error",
+ // Disallow assignments to native objects or read-only global variables
+ "no-native-reassign": ["error", {"exceptions": ["console"]}],
// Disallow comma operators
"no-sequences": "error",
// Disallow new operators outside of assignments or comparisons
diff --git a/app/src/js/console.js b/app/src/js/console.js
index <HASH>..<HASH> 100644
--- a/app/src/js/console.js
+++ b/app/src/js/console.js
@@ -2,7 +2,6 @@
* Don't break on browsers without console.log()
*/
if (typeof console === "undefined") {
- /* jshint -W020 */
console = {
log: function () {
"use strict";
@@ -11,5 +10,4 @@ if (typeof console === "undefined") {
"use strict";
}
};
- /* jshint +W020 */
} | Add an exception to allow reassign console | bolt_bolt | train | js,js |
b0f884616f8bd760cca6d203a8ff6c0142ff8610 | diff --git a/ui/ToggleTool.js b/ui/ToggleTool.js
index <HASH>..<HASH> 100644
--- a/ui/ToggleTool.js
+++ b/ui/ToggleTool.js
@@ -60,7 +60,7 @@ class ToggleTool extends Component {
let commandState = this.props.commandState
let Button = this.getComponent('button')
let btn = $$(Button, {
- icon: this.props.name,
+ icon: this.getIconName(),
active: commandState.active,
disabled: commandState.disabled,
theme: this.props.theme
@@ -83,6 +83,10 @@ class ToggleTool extends Component {
return this.props.name
}
+ getIconName() {
+ return this.props.name
+ }
+
onClick(e) {
e.preventDefault()
e.stopPropagation() | Allow Tools to override icon name. | substance_substance | train | js |
0771f4975eef12e97256dc8c7768c0c7a678fdbd | diff --git a/test/test_examples.py b/test/test_examples.py
index <HASH>..<HASH> 100644
--- a/test/test_examples.py
+++ b/test/test_examples.py
@@ -3,6 +3,7 @@
import os
import watson_developer_cloud
import pytest
+import sys
from os import getcwd
from subprocess import Popen, PIPE
from os.path import join, dirname
@@ -19,7 +20,7 @@ examples_path = join(dirname(__file__), '../', 'examples', '*.py')
dotenv_path = join(dirname(__file__), '../', '.env')
load_dotenv(dotenv_path)
-@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
+@pytest.mark.skipif(os.getenv('VCAP_SERVICES') is None and sys.version_info < (3,3), reason='requires VCAP_SERVICES and Python != 3.3')
def test_examples():
examples = glob(examples_path)
for example in examples: | skip integration tests in Python <I> | watson-developer-cloud_python-sdk | train | py |
5ecbbb95f8a2f6b9491942b2013ff013b52f4615 | diff --git a/src/Application/Config/Parser/Xml/Mail.php b/src/Application/Config/Parser/Xml/Mail.php
index <HASH>..<HASH> 100644
--- a/src/Application/Config/Parser/Xml/Mail.php
+++ b/src/Application/Config/Parser/Xml/Mail.php
@@ -35,8 +35,11 @@ class Mail implements XmlParserInterface
if($childNode->nodeType !== XML_ELEMENT_NODE) {
continue;
}
+ $mail->mailer->{$childNode->nodeName} = trim($childNode->nodeValue);
+ }
- $mail->mailer->{$node->nodeName} = trim($node->nodeValue);
+ if(!isset($mail->mailer->host)) {
+ throw new ConfigException('Mailer requires a configured host.');
}
} | fix: parsing of mailer settings; added a check for mailer host as minimal requirement | Vectrex_vxPHP | train | php |
352d64ab0d88311e42f99dc50ff77a28aacd17e5 | diff --git a/pkg/registry/core/service/rest.go b/pkg/registry/core/service/rest.go
index <HASH>..<HASH> 100644
--- a/pkg/registry/core/service/rest.go
+++ b/pkg/registry/core/service/rest.go
@@ -556,6 +556,8 @@ func shouldAssignNodePorts(service *api.Service) bool {
return true
case api.ServiceTypeClusterIP:
return false
+ case api.ServiceTypeExternalName:
+ return false
default:
glog.Errorf("Unknown service type: %v", service.Spec.Type)
return false | Eliminate "Unknown service type: ExternalName"
As the ExternalName service is supported, the warning message: "Unknown
service type: ExternalName" should be eliminated from rest.go. | kubernetes_kubernetes | train | go |
96eff0096dc173c93cec3bde09a245dfc33468b2 | diff --git a/internal/buffer_pool.go b/internal/buffer_pool.go
index <HASH>..<HASH> 100644
--- a/internal/buffer_pool.go
+++ b/internal/buffer_pool.go
@@ -44,7 +44,7 @@ type BufferPool struct {
maxBuffersPerHandle int64
}
-const BUF_SIZE = 5 * 1024 * 1024
+const BUF_SIZE = 10 * 1024 * 1024
func NewBufferPool(maxSizeGlobal int64, maxSizePerHandle int64) *BufferPool {
pool := &BufferPool{ | up the part size to allow for larger files
ref #<I> | kahing_goofys | train | go |
9eb952b84cf3d6bb5aa95eaf249e6871172a0b17 | diff --git a/src/styles/points/points.js b/src/styles/points/points.js
index <HASH>..<HASH> 100755
--- a/src/styles/points/points.js
+++ b/src/styles/points/points.js
@@ -385,6 +385,7 @@ Object.assign(Points, {
draw.text.repeat_group = draw.text.repeat_group || draw.repeat_group; // inherit repeat group by default
draw.text.anchor = draw.text.anchor || this.default_anchor;
draw.text.optional = (typeof draw.text.optional === 'boolean') ? draw.text.optional : false; // default text to required
+ draw.text.interactive = draw.text.interactive || draw.interactive; // inherits from point
}
return draw; | `interactive` flag on `points`-nested `text` should inherit from parent point
NB: better default behavior and matches ES, but may create a slightly larger than desirable hit area given the transparent buffer around the text label - leaving as-is for now | tangrams_tangram | train | js |
0b4ce9b7e22ddfcdb99596d82a8efffcb0957e9f | diff --git a/examples/pyreto/opf.py b/examples/pyreto/opf.py
index <HASH>..<HASH> 100644
--- a/examples/pyreto/opf.py
+++ b/examples/pyreto/opf.py
@@ -21,7 +21,7 @@ logger.setLevel(logging.DEBUG)
case = pylon.Case.load("../data/case6ww.pkl")
# Assume initial demand is peak demand and save it.
-Pd0 = [b.p_demand for b in case.buses if b.type == PQ]
+Pd0 = [b.p_demand for b in case.buses if b.type == pylon.PQ]
# Define a 24-hour load profile with hourly values.
p1h = [0.52, 0.54, 0.52, 0.50, 0.52, 0.57, 0.60, 0.71, 0.89, 0.85, 0.88, 0.94,
@@ -49,7 +49,7 @@ print "Min: %.3f" % -max(max(all_rewards))
# Determine minimum cost using PIPS.
min_cost = numpy.zeros(len(p1h))
for i, fraction in enumerate(p1h):
- for j, bus in enumerate([b for b in case.buses if b.type == PQ]):
+ for j, bus in enumerate([b for b in case.buses if b.type == pylon.PQ]):
bus.p_demand = p1h[i] * Pd0[j]
s = pylon.OPF(case).solve()
min_cost[i] = s["f"] | Fixing Pylon import in RL OPF. | rwl_pylon | train | py |
a79a73fe5b596db2ac8c36297dacb28981ffdbee | diff --git a/src/googleclouddebugger/deferred_modules.py b/src/googleclouddebugger/deferred_modules.py
index <HASH>..<HASH> 100644
--- a/src/googleclouddebugger/deferred_modules.py
+++ b/src/googleclouddebugger/deferred_modules.py
@@ -245,12 +245,14 @@ def _FindBestMatch(source_path, module_name, paths):
best_suffix_len = 0
for path in paths:
try:
- (f, p, unused_d) = imp.find_module(module_name, [path])
+ fp, p, unused_d = imp.find_module(module_name, [path])
# find_module returns f=None when it finds a package, in which case we
# should be finding common suffix against __init__.py in that package.
- if not f:
+ if not fp:
p = os.path.join(p, '__init__.py')
+ else:
+ fp.close()
suffix_len = _CommonSuffix(source_path, p) | Close file opened by imp.find_module
-------------
Created by MOE: <URL> | GoogleCloudPlatform_cloud-debug-python | train | py |
c88c8ba668a1316608bcf06827a9e10b9822c02b | diff --git a/mov.py b/mov.py
index <HASH>..<HASH> 100755
--- a/mov.py
+++ b/mov.py
@@ -145,6 +145,8 @@ def play():
connection.text_factory = str
cursor = connection.cursor()
if args.pattern:
+ if not args.strict:
+ args.pattern = '%{0}%'.format(args.pattern)
cursor.execute('SELECT * FROM Movies WHERE Name LIKE (?)',
[args.pattern])
try: | Always be greedy unless --strict is used | hph_mov | train | py |
fbbe56b6b61487cbbfe47aa41a57e9c86018b994 | diff --git a/src/tracing/timing_tool.js b/src/tracing/timing_tool.js
index <HASH>..<HASH> 100644
--- a/src/tracing/timing_tool.js
+++ b/src/tracing/timing_tool.js
@@ -122,7 +122,7 @@ base.exportTo('tracing', function() {
if (e.button !== 0)
return;
- if (!this.activeMarker_.selected)
+ if (!this.activeMarker_ || !this.activeMarker_.selected)
return;
// Check if a range selection is finished now. | Fix error in timing tool when dragging outside the timeline track view
BUG=
R=<EMAIL>
Review URL: <URL> | catapult-project_catapult | train | js |
5f562cf862856fd04f860be997382036a1b98e42 | diff --git a/prow/apis/prowjobs/v1/types.go b/prow/apis/prowjobs/v1/types.go
index <HASH>..<HASH> 100644
--- a/prow/apis/prowjobs/v1/types.go
+++ b/prow/apis/prowjobs/v1/types.go
@@ -484,9 +484,10 @@ func (d *DecorationConfig) Validate() error {
if d.GCSConfiguration == nil {
return errors.New("GCS upload configuration is not specified")
}
- if d.GCSCredentialsSecret == "" && d.S3CredentialsSecret == "" {
- return errors.New("neither GCS nor S3 credential secret are specified")
- }
+ // Intentionally allow d.GCSCredentialsSecret and d.S3CredentialsSecret to
+ // be unset in which case we assume GCS permissions are provided by GKE
+ // Workload Identity: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity
+
if err := d.GCSConfiguration.Validate(); err != nil {
return fmt.Errorf("GCS configuration is invalid: %v", err)
} | Allow pod utilities to upload to GCS with implicit Workload Identity credentials. | kubernetes_test-infra | train | go |
638df724cdcf70b444ea91d5e970c09b464ab730 | diff --git a/Generator/Base.php b/Generator/Base.php
index <HASH>..<HASH> 100644
--- a/Generator/Base.php
+++ b/Generator/Base.php
@@ -182,7 +182,7 @@ abstract class BaseGenerator {
* @param $property_name
* The name of a property in $component_data.
*/
- function getComponentDataDefaultValue($component_data, $property_name) {
+ function getComponentDataDefaultValue(&$component_data, $property_name) {
}
/** | Issue #<I> by pokap: Fixed inconsistent declaration of getComponentDataDefaultValue(). | drupal-code-builder_drupal-code-builder | train | php |
60b4af005b32269b4105454b4228bd8bf39515f4 | diff --git a/lib/meurio_ui/version.rb b/lib/meurio_ui/version.rb
index <HASH>..<HASH> 100644
--- a/lib/meurio_ui/version.rb
+++ b/lib/meurio_ui/version.rb
@@ -1,5 +1,5 @@
module MeurioUi
module Rails
- VERSION = "1.3.5"
+ VERSION = "1.3.6"
end
end | [#<I>] release version <I> | nossas_meurio_ui | train | rb |
50703703b4af9730d8e32b69a28ebed877d1b96a | diff --git a/actionpack/lib/action_view/dependency_tracker.rb b/actionpack/lib/action_view/dependency_tracker.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/dependency_tracker.rb
+++ b/actionpack/lib/action_view/dependency_tracker.rb
@@ -22,7 +22,7 @@ module ActionView
@trackers.delete(handler)
end
- class ErbTracker
+ class ERBTracker
EXPLICIT_DEPENDENCY = /# Template Dependency: (\S+)/
# Matches:
@@ -81,6 +81,6 @@ module ActionView
end
end
- register_tracker Template::Handlers::ERB, ErbTracker
+ register_tracker Template::Handlers::ERB, ERBTracker
end
end | Rename ErbTracker to ERBTracker | rails_rails | train | rb |
217aeea0bb15cc4d24cf7fe1805fd7b4beccfce7 | diff --git a/safe/impact_function_v4/impact_function.py b/safe/impact_function_v4/impact_function.py
index <HASH>..<HASH> 100644
--- a/safe/impact_function_v4/impact_function.py
+++ b/safe/impact_function_v4/impact_function.py
@@ -419,7 +419,7 @@ class ImpactFunction(object):
"""Return the current datastore.
:return: The datastore.
- :rtype: Datastore
+ :rtype: Datastore.Datastore
"""
return self._datastore | Small change to make PyCharm knows the type. | inasafe_inasafe | train | py |
56fdc4a28f252b2ef2e4fee2c885c3adfc5fd8e7 | diff --git a/lib/podio/models/experiment.rb b/lib/podio/models/experiment.rb
index <HASH>..<HASH> 100644
--- a/lib/podio/models/experiment.rb
+++ b/lib/podio/models/experiment.rb
@@ -42,6 +42,10 @@ class Podio::Experiment < ActivePodio::Base
list Podio.connection.get('/experiment/').body
end
+ def find(experiment)
+ member Podio.connection.get("/experiment/#{experiment}").body
+ end
+
def create_variation(experiment, variation)
Podio.connection.post("/experiment/#{experiment}/variation/#{variation}")
end | Added method to get single experiment to Experiment model | podio_podio-rb | train | rb |
d4b587af8e63253c775c8b9e13c9eb00cd24f42c | diff --git a/src/currencyEngine/indexEngine.js b/src/currencyEngine/indexEngine.js
index <HASH>..<HASH> 100644
--- a/src/currencyEngine/indexEngine.js
+++ b/src/currencyEngine/indexEngine.js
@@ -683,6 +683,8 @@ export default (bcoin:any, txLibInfo:any) => class CurrencyEngine implements Abc
}
async subscribeToAddress (address: string) {
+ const addressFromScriptHash = this.scriptHashToAddress(address)
+ address = addressFromScriptHash !== '' ? addressFromScriptHash : address
let scriptHash
if (!this.transactions[address]) {
scriptHash = this.addressToScriptHash(address) | ugly hack for now until we stop using address all together and only use hashs | EdgeApp_edge-currency-bitcoin | train | js |
b2668bf3c460b26c2adaddc13aca556e24979238 | diff --git a/sporco/linalg.py b/sporco/linalg.py
index <HASH>..<HASH> 100644
--- a/sporco/linalg.py
+++ b/sporco/linalg.py
@@ -55,6 +55,30 @@ def complex_dtype(dtype):
+def pyfftw_byte_aligned(array, dtype=None, n=None):
+ """
+ Construct a byte-aligned array for efficient use by :mod:`pyfftw`.
+ This function is a wrapper for :func:`pyfftw.byte_aligned`
+
+ Parameters
+ ----------
+ array : ndarray
+ Input array
+ dtype : dtype, optional (default None)
+ Output array dtype
+ n : int, optional (default None)
+ Output array should be aligned to n-byte boundary
+
+ Returns
+ -------
+ a : ndarray
+ Array with required byte-alignment
+ """
+
+ return pyfftw.byte_align(array, n=n, dtype=dtype)
+
+
+
def pyfftw_empty_aligned(shape, dtype, order='C', n=None):
"""
Construct an empty byte-aligned array for efficient use by :mod:`pyfftw`. | Added pyfftw_byte_aligned function | bwohlberg_sporco | train | py |
56bf1ade7987c4b41cffd9c795f7c60575fc5b62 | diff --git a/Generator/File.php b/Generator/File.php
index <HASH>..<HASH> 100644
--- a/Generator/File.php
+++ b/Generator/File.php
@@ -54,8 +54,9 @@ class File extends BaseGenerator {
* @return
* An array keyed by an arbitrary ID for the file, whose value is an array
* of file info. Values in this array are:
- * - path: The path to the file, relative to the future component folder. An
- * empty string means the base folder of the component.
+ * - path: The path to the file, relative to the future component folder,
+ * without the trailing slash. An empty string means the base folder of the
+ * component.
* - filename: The file name. This may contain tokens, to be replaced using
* the root component class's getReplacements().
* - body: An array of pieces to assemble in order to form the body of the | Fixed omission in docs. | drupal-code-builder_drupal-code-builder | train | php |
152193aaea26bc10509305b0a3637e793011c832 | diff --git a/src/python/pants/backend/jvm/tasks/checkstyle.py b/src/python/pants/backend/jvm/tasks/checkstyle.py
index <HASH>..<HASH> 100644
--- a/src/python/pants/backend/jvm/tasks/checkstyle.py
+++ b/src/python/pants/backend/jvm/tasks/checkstyle.py
@@ -35,6 +35,8 @@ class Checkstyle(NailgunTask):
register('--confs', default=['default'],
help='One or more ivy configurations to resolve for this target. This parameter is '
'not intended for general use. ')
+ register('--jvm-options', action='append', metavar='<option>...', advanced=True,
+ help='Run checkstyle with these extra jvm options.')
cls.register_jvm_tool(register, 'checkstyle')
@classmethod
@@ -91,6 +93,7 @@ class Checkstyle(NailgunTask):
# with Xargs since checkstyle does not accept, for example, @argfile style arguments.
def call(xargs):
return self.runjava(classpath=union_classpath, main=self._CHECKSTYLE_MAIN,
+ jvm_options=self.get_options().jvm_options,
args=args + xargs, workunit_name='checkstyle')
checks = Xargs(call) | JVM checkstyle should obey jvm_options
- Local fix for checkstyle not accepting jvm_options
We're interested in following up to get this option from a jvm Subsystem sometime soon, but for now we need a brief fix for an upcoming release.
Testing Done:
local tests that both DEFAULT and local jvm_options are respected
<URL> | pantsbuild_pants | train | py |
44c51bfb2cb08fce0cd164e0f24ba9e5adbd4f6e | diff --git a/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js b/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js
+++ b/src/main/resources/META-INF/resources/primefaces/schedule/1-schedule.js
@@ -106,7 +106,7 @@ PrimeFaces.widget.Schedule = PrimeFaces.widget.DeferredWidget.extend({
if ($this.cfg.noOpener) {
targetWindow.opener = null;
}
- targetWindow.location = targetWindow.event.url;
+ targetWindow.location = eventClickInfo.event.url;
return false;
} | #<I> fix typo, use url of event (#<I>) | primefaces_primefaces | train | js |
254c11656911083e26eb767579618050a1e39815 | diff --git a/peer.go b/peer.go
index <HASH>..<HASH> 100644
--- a/peer.go
+++ b/peer.go
@@ -241,8 +241,12 @@ func (l *PeerList) updatePeer(p *Peer) {
type peerScore struct {
*Peer
+ // score according to the current peer list's ScoreCalculator.
score uint64
+ // index of the peerScore in the peerHeap. Used to interact with container/heap.
index int
+ // order is the tiebreaker for when score is equal. It is set when a peer
+ // is pushed to the heap based on peerHeap.order with jitter.
order uint64
} | Better documentation of fields in peerScore | uber_tchannel-go | train | go |
ad340ad9d01ae498f7ea911034557363b777b12d | diff --git a/openid/consumer/interface.py b/openid/consumer/interface.py
index <HASH>..<HASH> 100644
--- a/openid/consumer/interface.py
+++ b/openid/consumer/interface.py
@@ -75,8 +75,28 @@ the fallback cases are much more secure than pure dumb mode, as they
still are making use the consumer's ability to store state.
-== SPECIAL CASES ==
+== IMMEDIATE MODE ==
+In the flow described above, there's a step which may occur if the
+user needs to confirm to the identity server that it's ok to authorize
+his or her identity. The server may draw pages asking for information
+from the user before it redirects the browser back to the consumer's
+site. This is generally transparent to the consumer site, so it is
+typically ignored as an implementation detail.
+
+There can be times, however, where the consumer site wants to get a
+response immediately. When this is the case, the consumer can put the
+library in immediate mode. In immediate mode, there is an extra
+response possible from the server, which is essentially the server
+reporting that it doesn't have enough information to answer the
+question yet. In addition to saying that, the identity server
+provides a URL to which the user can be sent to provide the needed
+information and let the server finish handling the original request.
+
+
+== USING THIS LIBRARY ==
+
+********* Waiting on resolution of structure
"""
class OpenIDConsumerFacade(object): | [project @ continuing doc project] | openid_python-openid | train | py |
f72c824d7d5af687f78527cf90216e9a8a9220d8 | diff --git a/cli/src/main/java/org/jboss/as/cli/CommandLineMain.java b/cli/src/main/java/org/jboss/as/cli/CommandLineMain.java
index <HASH>..<HASH> 100644
--- a/cli/src/main/java/org/jboss/as/cli/CommandLineMain.java
+++ b/cli/src/main/java/org/jboss/as/cli/CommandLineMain.java
@@ -706,6 +706,7 @@ public class CommandLineMain {
+ host + ":" + port);
} else {
printLine("The controller is not available at " + host + ":" + port);
+ disconnectController(false);
}
} catch (UnknownHostException e) {
printLine("Failed to resolve host '" + host + "': " + e.getLocalizedMessage()); | reset the client and host/port variables if connection failed (otherwise the prompt will be misleading) | wildfly_wildfly | train | java |
ba1de8136ce4c62f93465814919a62ebaff968e9 | diff --git a/test/test_example_match.rb b/test/test_example_match.rb
index <HASH>..<HASH> 100755
--- a/test/test_example_match.rb
+++ b/test/test_example_match.rb
@@ -974,7 +974,7 @@ class TestExampleMatch < Test::Unit::TestCase
format3 = workbook.add_format(
:color => 'blue',
- :underline => 1,
+ :underline => 1
)
worksheet.write(2, 0, 'This workbook demonstrates some of', format) | * typo in test_example_match.rb
method(a=>b, c=>d,) accepted on ruby <I> and <I> but fail on ruby <I>
method(a=>b, c=>d) passes all ruby version. | cxn03651_write_xlsx | train | rb |
03bea1a018126e33ba8a48034bced956d0fd5069 | diff --git a/lib/gem/release/version.rb b/lib/gem/release/version.rb
index <HASH>..<HASH> 100644
--- a/lib/gem/release/version.rb
+++ b/lib/gem/release/version.rb
@@ -1,5 +1,5 @@
module Gem
module Release
- VERSION = '2.0.0.rc.2'
+ VERSION = '2.0.0.rc.3'
end
end | Bump gem-release to <I>.rc<I> | svenfuchs_gem-release | train | rb |
57ffe3ead4b9b7499fc97140cd843d845a250e38 | diff --git a/test/function.js b/test/function.js
index <HASH>..<HASH> 100644
--- a/test/function.js
+++ b/test/function.js
@@ -94,8 +94,8 @@ describe('function declarations', () => {
const info = getInstrumentedVersion(contract, filePath);
const coverage = new CoverageMap();
coverage.addContract(info, filePath);
- // The vm runs out of gas here - but we can verify line / statement / fn
- // coverage is getting mapped.
+ // We try and call a contract at an address where it doesn't exist and the VM
+ // throws, but we can verify line / statement / fn coverage is getting mapped.
vm.execute(info.contract, 'a', []).then(events => {
const mapping = coverage.generate(events, pathPrefix);
assert.deepEqual(mapping[filePath].l, { | Clarify comment explaining what test is doing | sc-forks_solidity-coverage | train | js |
025968a0e7f471952ec35f19c7d226299960bd1c | diff --git a/src/Rocketeer/Igniter.php b/src/Rocketeer/Igniter.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/Igniter.php
+++ b/src/Rocketeer/Igniter.php
@@ -57,6 +57,11 @@ class Igniter
*/
public function getConfigurationPath()
{
+ $laravel = $this->app['path'].'/config/packages/anahkiasen/rocketeer';
+ if (file_exists($laravel)) {
+ return $laravel;
+ }
+
return $this->app['path.rocketeer.config'];
}
diff --git a/src/Rocketeer/Server.php b/src/Rocketeer/Server.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/Server.php
+++ b/src/Rocketeer/Server.php
@@ -80,6 +80,7 @@ class Server
$salt = '';
$folder = $this->app['rocketeer.igniter']->getConfigurationPath();
$files = glob($folder.'/*.php');
+ dd($files);
// Compute the salts
foreach ($files as $file) { | Return correct path for Laravel configurations | rocketeers_rocketeer | train | php,php |
a989b09b3c0112332ac6110625f0f06538ca0083 | diff --git a/fuzzy/node.go b/fuzzy/node.go
index <HASH>..<HASH> 100644
--- a/fuzzy/node.go
+++ b/fuzzy/node.go
@@ -6,7 +6,6 @@ import (
"time"
"github.com/hashicorp/go-hclog"
-
"github.com/hashicorp/raft"
rdb "github.com/hashicorp/raft-boltdb"
)
@@ -21,14 +20,14 @@ type raftNode struct {
dir string
}
-func newRaftNode(logger *log.Logger, tc *transports, h TransportHooks, nodes []string, name string) (*raftNode, error) {
+func newRaftNode(logger hclog.Logger, tc *transports, h TransportHooks, nodes []string, name string) (*raftNode, error) {
var err error
var datadir string
datadir, err = resolveDirectory(fmt.Sprintf("data/%v", name), true)
if err != nil {
return nil, err
}
- logger.Printf("[INFO] Creating new raft Node with data in dir %v", datadir)
+ logger.Info("[INFO] Creating new raft Node with data in dir %v", datadir)
var ss *raft.FileSnapshotStore
ss, err = raft.NewFileSnapshotStoreWithLogger(datadir, 5, logger) | Fix: Failed to build since the inappropriate logger parameter (#<I>) | hashicorp_raft | train | go |
241d234e44afc4422f346f2f3f15a034e5b3a37f | diff --git a/test/functional/associations/test_many_documents_as_proxy.rb b/test/functional/associations/test_many_documents_as_proxy.rb
index <HASH>..<HASH> 100644
--- a/test/functional/associations/test_many_documents_as_proxy.rb
+++ b/test/functional/associations/test_many_documents_as_proxy.rb
@@ -141,7 +141,7 @@ class ManyDocumentsAsProxyTest < Test::Unit::TestCase
end
should "work with order" do
- comments = @post.comments.find(:all, :order => '$natural desc')
+ comments = @post.comments.find(:all, :order => 'body desc')
comments.should == [@comment2, @comment1]
end
end | Minor: Order by something more predictable than $natural in test for many documents as proxy. | mongomapper_mongomapper | train | rb |
a7a5c745b8c6a358c5a5a1fb835cf99274d7aea8 | diff --git a/lib/Message.php b/lib/Message.php
index <HASH>..<HASH> 100644
--- a/lib/Message.php
+++ b/lib/Message.php
@@ -52,9 +52,8 @@ abstract class Message implements MessageInterface {
fwrite($stream, $body);
rewind($stream);
return $stream;
- } else {
- return $body;
}
+ return $body;
}
@@ -71,11 +70,11 @@ abstract class Message implements MessageInterface {
$body = $this->getBody();
if (is_string($body)) {
return $body;
- } elseif (is_null($body)) {
+ }
+ if (is_null($body)) {
return '';
- } else {
- return stream_get_contents($body);
}
+ return stream_get_contents($body);
}
@@ -195,9 +194,7 @@ abstract class Message implements MessageInterface {
*/
function setHeader($name, $value) {
- $this->headers[
- strtolower($name)
- ] = [$name, (array)$value];
+ $this->headers[strtolower($name)] = [$name, (array)$value];
}
@@ -279,10 +276,9 @@ abstract class Message implements MessageInterface {
$name = strtolower($name);
if (!isset($this->headers[$name])) {
return false;
- } else {
- unset($this->headers[$name]);
- return true;
}
+ unset($this->headers[$name]);
+ return true;
} | Remove unnecessary else and elseif with return. | sabre-io_http | train | php |
f6bdeea6e24abeb1dd9f00d7e947001e232d175f | diff --git a/Pdf/Engine/WkHtmlToPdfEngine.php b/Pdf/Engine/WkHtmlToPdfEngine.php
index <HASH>..<HASH> 100644
--- a/Pdf/Engine/WkHtmlToPdfEngine.php
+++ b/Pdf/Engine/WkHtmlToPdfEngine.php
@@ -44,7 +44,7 @@ class WkHtmlToPdfEngine extends AbstractPdfEngine {
throw new CakeException("WKHTMLTOPDF didn't return any data");
}
- if ((int)$content['return'] > 1) {
+ if ((int)$content['return'] !== 0 && !empty($content['stdout'])) {
throw new CakeException("Shell error, return code: " . (int)$content['return']);
} | Fixing edge case where wkhtmltopdf returns an exit code 2 on success too | FriendsOfCake_CakePdf | train | php |
b273b47a1972c84ae0bfe3fc73e46121306a17e6 | diff --git a/src/info/digibyte.js b/src/info/digibyte.js
index <HASH>..<HASH> 100644
--- a/src/info/digibyte.js
+++ b/src/info/digibyte.js
@@ -10,7 +10,7 @@ const bcoinInfo: BcoinCurrencyInfo = {
formats: ['bip49', 'bip84', 'bip44', 'bip32'],
forks: [],
keyPrefix: {
- privkey: 0x80,
+ privkey: 0x9e,
xpubkey: 0x0488b21e,
xprivkey: 0x0488ade4,
xpubkey58: 'xpub', | set the correct digibyte param | EdgeApp_edge-currency-bitcoin | train | js |
0cfecbf244e001efc11736269003e5c4a5a9c823 | diff --git a/lib/large_hadron_migration.rb b/lib/large_hadron_migration.rb
index <HASH>..<HASH> 100644
--- a/lib/large_hadron_migration.rb
+++ b/lib/large_hadron_migration.rb
@@ -101,9 +101,9 @@ class LargeHadronMigration < ActiveRecord::Migration
raise "chunk_size must be >= 1" unless chunk_size >= 1
started = Time.now.strftime("%Y_%m_%d_%H_%M_%S_%3N")
- new_table = "lhmn_#{curr_table}"
- old_table = "lhmo_%s_#{curr_table}" % started
- journal_table = "lhmc_%s_#{curr_table}" % started
+ new_table = "lhmn_%s" % curr_table
+ old_table = "lhmo_%s_%s" % [started, curr_table]
+ journal_table = "lhmj_%s_%s" % [started, curr_table]
last_insert_id = last_insert_id(curr_table)
say "last inserted id in #{curr_table}: #{last_insert_id}" | rename table schema to lhmj to keep conistency | soundcloud_lhm | train | rb |
4d28ddb87b5c0a8766ce885ab95428759b8818f1 | diff --git a/src/playground/playground.go b/src/playground/playground.go
index <HASH>..<HASH> 100644
--- a/src/playground/playground.go
+++ b/src/playground/playground.go
@@ -138,7 +138,15 @@ const js_evalScript = `
throw new Go$Panic("Syscall not supported: " + trap);
}
};
- eval(script);
+ try {
+ eval(script);
+ } catch (err) {
+ scope.native.output.push(new OutputLine("err", "panic: " + err.message.v));
+ var stack = err.stack.split("\n").slice(1, -12);
+ for (var i = 0; i < stack.length; i++) {
+ scope.native.output.push(new OutputLine("err", stack[i].split(" (eval at ")[0]));
+ }
+ }
`
type FileEntry struct { | playground: Handling of runtime errors. | gopherjs_gopherjs | train | go |
3ed5ba12d710df2cc003787bf198aa6b40e1417c | diff --git a/src/extensions/fanart-tv/loader.js b/src/extensions/fanart-tv/loader.js
index <HASH>..<HASH> 100644
--- a/src/extensions/fanart-tv/loader.js
+++ b/src/extensions/fanart-tv/loader.js
@@ -40,7 +40,7 @@ export default function createLoader(options) {
})
.then(body => {
if (entityType === 'artist') {
- const releaseGroupIDs = Object.keys(body.albums)
+ const releaseGroupIDs = Object.keys(body.albums || {})
debug(
`Priming album cache with ${releaseGroupIDs.length} album(s).`
) | Fix for missing albums property on fanart.tv artists | exogen_graphbrainz | train | js |
224d632e7eb29d7632883fb59bf0538cfee32a67 | diff --git a/new-src/util2.js b/new-src/util2.js
index <HASH>..<HASH> 100644
--- a/new-src/util2.js
+++ b/new-src/util2.js
@@ -27,7 +27,7 @@ export const record2tuple = ({nodeType, position, ...data}) => {
const {nodeName, nodeValue, childNodes} = data
return [nodeType, position, nodeName, nodeValue, childNodes]
}
- return ([nodeType, position, ...data.data])
+ return [nodeType, position, ...data.data]
}
export function query(f, order) {
@@ -51,8 +51,12 @@ export function queryAll(f, order) {
}
export function traverse(f, order = 'pre', traverseAll) {
- if (skip(this)) return this
-
+ if (skip(this)) {
+ if (!traverseAll) return this
+ const node = tuple2record(this)
+ f(node)
+ return record2tuple(node)
+ }
if (isNode(this)) {
const node = tuple2record(this)
if (order === 'post') traverseChildNodes(node) | allow traverse skip node with traverseAll=true | baixing_jedi | train | js |
6534a3d93cdbaaf49ff7c6ef43849e81dbddc115 | diff --git a/src/Command/Snapshot/SnapshotCreateCommand.php b/src/Command/Snapshot/SnapshotCreateCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/Snapshot/SnapshotCreateCommand.php
+++ b/src/Command/Snapshot/SnapshotCreateCommand.php
@@ -20,6 +20,7 @@ class SnapshotCreateCommand extends CommandBase
->addNoWaitOption('Do not wait for the snapshot to complete');
$this->setHiddenAliases(['backup', 'environment:backup']);
$this->addExample('Make a snapshot of the current environment');
+ $this->addExample('Request a snapshot (and exit quickly)', '--no-wait');
}
protected function execute(InputInterface $input, OutputInterface $output)
@@ -45,6 +46,14 @@ class SnapshotCreateCommand extends CommandBase
if (!$input->getOption('no-wait')) {
$this->stdErr->writeln('Waiting for the snapshot to complete...');
+
+ // Strongly recommend using --no-wait in a cron job.
+ if (!$this->isTerminal(STDIN)) {
+ $this->stdErr->writeln(
+ '<comment>Warning:</comment> use the --no-wait (-W) option if you are running this in a cron job.'
+ );
+ }
+
/** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
$activityMonitor = $this->getService('activity_monitor');
$success = $activityMonitor->waitAndLog( | Recommend --no-wait if snapshot:create is run in a non-TTY | platformsh_platformsh-cli | train | php |
8f52baaf70b8b57b5d8f1d048e862757b141a361 | diff --git a/bumpr/config.py b/bumpr/config.py
index <HASH>..<HASH> 100644
--- a/bumpr/config.py
+++ b/bumpr/config.py
@@ -165,7 +165,7 @@ class Config(ObjectDict):
if hasattr(parsed_args, 'nocommit'):
self.commit = not parsed_args.nocommit
- for attr in 'bump_only' 'prepare_only', 'push', 'skip_tests':
+ for attr in 'bump_only', 'prepare_only', 'push', 'skip_tests':
if hasattr(parsed_args, attr):
self[attr] = getattr(parsed_args, attr) | Fix small issue in config.py
Add a comma to separate strings in a 'for' in override_from_args | noirbizarre_bumpr | train | py |
8e0e862c84f44dfa3e429275b3a3a5d29b5836a8 | diff --git a/testing/test_pytester.py b/testing/test_pytester.py
index <HASH>..<HASH> 100644
--- a/testing/test_pytester.py
+++ b/testing/test_pytester.py
@@ -418,7 +418,7 @@ def test_testdir_run_with_timeout(testdir):
duration = end - start
assert result.ret == EXIT_OK
- assert duration < 1
+ assert duration < 5
def test_testdir_run_timeout_expires(testdir): | Stretch out the time assertion for slow AppVeyor | pytest-dev_pytest | train | py |
7d5937c07032b7a08ca0999a289285dd12aec243 | diff --git a/pystatsd/server.py b/pystatsd/server.py
index <HASH>..<HASH> 100644
--- a/pystatsd/server.py
+++ b/pystatsd/server.py
@@ -112,6 +112,16 @@ class Server(object):
self.counters[key] = 0
self.counters[key] += float(fields[0] or 1) * (1 / sample_rate)
+ def on_timer(self):
+ """Executes flush(). Ignores any errors to make sure one exception
+ doesn't halt the whole flushing process.
+ """
+ try:
+ self.flush()
+ except Exception, e:
+ log.exception('Error while flushing: %s', e)
+ self._set_timer()
+
def flush(self):
ts = int(time.time())
stats = 0
@@ -231,14 +241,12 @@ class Server(object):
if self.debug:
print "Error communicating with Graphite: %s" % e
- self._set_timer()
-
if self.debug:
print "\n================== Flush completed. Waiting until next flush. Sent out %d metrics =======" \
% (stats)
def _set_timer(self):
- self._timer = threading.Timer(self.flush_interval / 1000, self.flush)
+ self._timer = threading.Timer(self.flush_interval / 1000, self.on_timer)
self._timer.start()
def serve(self, hostname='', port=8125): | Improve exception handling
Ignore exceptions while flushing and make sure a new timer is always
set.
With the old code if there was any exception while flushing, e.g. an
error while connecting to Graphite, the process would not flush anymore. | sivy_pystatsd | train | py |
c4542fa6c28d6445b810aa4dbfc119c08e274f1f | diff --git a/tests/View/SummaryDoc.php b/tests/View/SummaryDoc.php
index <HASH>..<HASH> 100644
--- a/tests/View/SummaryDoc.php
+++ b/tests/View/SummaryDoc.php
@@ -91,7 +91,10 @@ class SummaryDoc
*/
public function doc3()
{
- // {{ i + 1 }}
+ /*
+ # _
+ {{ i + 1 }}
+ */
}
/** | docs<view>: add summary doc for view component | hunzhiwange_framework | train | php |
e937375e1e605e3157283c6d59a827d81feb1d76 | diff --git a/molgenis-core-ui/src/main/resources/js/settingsmanager.js b/molgenis-core-ui/src/main/resources/js/settingsmanager.js
index <HASH>..<HASH> 100644
--- a/molgenis-core-ui/src/main/resources/js/settingsmanager.js
+++ b/molgenis-core-ui/src/main/resources/js/settingsmanager.js
@@ -23,7 +23,7 @@
query : {
operator : 'NESTED',
nestedRules : [
- {field : 'package', operator : 'EQUALS', value : 'settings'},
+ {field : 'package', operator : 'EQUALS', value : 'sys_set'},
{operator : 'AND'},
{operator : 'NOT'},
{field : 'abstract', operator : 'EQUALS', value : 'true'} | fix the name of the settings package (settings -> sys_set) | molgenis_molgenis | train | js |
08110da980c017a8ccd51e1395c5550ac1087ea9 | diff --git a/org.jrebirth/core/src/test/java/org/jrebirth/core/concurrent/ThreadTest.java b/org.jrebirth/core/src/test/java/org/jrebirth/core/concurrent/ThreadTest.java
index <HASH>..<HASH> 100644
--- a/org.jrebirth/core/src/test/java/org/jrebirth/core/concurrent/ThreadTest.java
+++ b/org.jrebirth/core/src/test/java/org/jrebirth/core/concurrent/ThreadTest.java
@@ -6,6 +6,7 @@ import junit.framework.Assert;
import org.jrebirth.core.application.ApplicationTest;
+import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -15,7 +16,7 @@ import org.slf4j.LoggerFactory;
*
* @author Sébastien Bordes
*/
-// @Ignore("JavaFX can't be run in headless mode yet")
+@Ignore("JavaFX can't be run in headless mode yet")
public class ThreadTest extends ApplicationTest<ThreadApplication> {
public ThreadTest() { | Headless not available yet .... for full integration purposes | JRebirth_JRebirth | train | java |
8b2a3417e380a95b3a3b9a20cfbb5b03b9354c15 | diff --git a/openstack_dashboard/test/helpers.py b/openstack_dashboard/test/helpers.py
index <HASH>..<HASH> 100644
--- a/openstack_dashboard/test/helpers.py
+++ b/openstack_dashboard/test/helpers.py
@@ -24,6 +24,7 @@ import unittest
from ceilometerclient.v2 import client as ceilometer_client
from cinderclient import client as cinder_client
+import django
from django.conf import settings
from django.contrib.messages.storage import default_storage # noqa
from django.core.handlers import wsgi
@@ -229,8 +230,12 @@ class TestCase(horizon_helpers.TestCase):
Asserts that the given response issued a 302 redirect without
processing the view which is redirected to.
"""
- self.assertEqual(response._headers.get('location', None),
- ('Location', settings.TESTSERVER + expected_url))
+ if django.VERSION >= (1, 9):
+ self.assertEqual(response._headers.get('location', None),
+ ('Location', expected_url))
+ else:
+ self.assertEqual(response._headers.get('location', None),
+ ('Location', settings.TESTSERVER + expected_url))
self.assertEqual(response.status_code, 302)
def assertNoFormErrors(self, response, context_name="form"): | [Django <I>] Remove testserver from expected_url
This patch removes the 'http://testserver' section from the test URLs
Ref:
<URL> | openstack_horizon | train | py |
f4214437000086ee14afaf16e45fcb7c15f04107 | diff --git a/lib/express/collection.js b/lib/express/collection.js
index <HASH>..<HASH> 100644
--- a/lib/express/collection.js
+++ b/lib/express/collection.js
@@ -256,10 +256,9 @@ Collection = Class({
*/
keys: function() {
- return $(this.reduce([], function(array, val, key){
- array.push(key)
- return array
- }))
+ return this.map(function(val, key){
+ return key
+ })
},
/** | Refactored Collection#keys() with #map() | expressjs_express | train | js |
7dae8b4459047aa57132260e5e7d863d29a667d8 | diff --git a/ReText/editor.py b/ReText/editor.py
index <HASH>..<HASH> 100644
--- a/ReText/editor.py
+++ b/ReText/editor.py
@@ -182,7 +182,7 @@ class ReTextEdit(QTextEdit):
def resizeEvent(self, event):
QTextEdit.resizeEvent(self, event)
- if not globalSettings.lineNumbersEnabled:
+ if not hasattr(self, 'lineNumberArea'):
return
rect = self.contentsRect()
self.lineNumberArea.setGeometry(rect.left(), rect.top(), | Correctly handle resize after line numbers area has been activated. | retext-project_retext | train | py |
ae5484dd73a1a0e21fe66252668859b2aa642daf | diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -1,10 +1,12 @@
-var references = require('./gulp/resolve');
+var references = require('gulp-utilities').resolve;
+
+var libraries = require('./libReferences.json');
// Karma configuration
module.exports = function (config) {
- var files = references.getBowerReferences();
+ var files = references.getReferences(libraries);
files = files.concat([
- 'libraries/bower/angular-mocks/angular-mocks.js',
+ 'libraries/angular-mocks/angular-mocks.js',
'source/**/*.tests.ts',
]); | Update karma config to use new gulp utility tools for resolve references. | RenovoSolutions_TypeScript-Angular-Utilities | train | js |
ea038726ba51909a268784620766e914de626c47 | diff --git a/app/code/community/Varien/Profiler.php b/app/code/community/Varien/Profiler.php
index <HASH>..<HASH> 100755
--- a/app/code/community/Varien/Profiler.php
+++ b/app/code/community/Varien/Profiler.php
@@ -173,7 +173,7 @@ class Varien_Profiler
'type' => $type,
);
- if ($name == '__EAV_LOAD_MODEL__' && self::getConfiguration()->captureModelInfo) {
+ if ($name == '__EAV_LOAD_MODEL__' && !empty(self::getConfiguration()->captureModelInfo)) {
$trace = debug_backtrace();
$className = get_class($trace[1]['args'][0]);
$entityId = isset($trace[1]['args'][1]) ? $trace[1]['args'][1] : 'not set'; | CaptureModelInfo may not exist
Profiler can be enabled without config file and without captureModelInfo setting. In this instance a notice is thrown. Using empty instead avoids this but maintains original boolean check. | AOEpeople_Aoe_Profiler | train | php |
cf82b0d3a9ba6179ff07a772d7af520f0a2d695f | diff --git a/openquake/server/dbserver.py b/openquake/server/dbserver.py
index <HASH>..<HASH> 100644
--- a/openquake/server/dbserver.py
+++ b/openquake/server/dbserver.py
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>.
+import os.path
import logging
from Queue import Queue
from threading import Thread
@@ -120,6 +121,11 @@ def runserver(dbpathport=None, logfile=DATABASE['LOG'], loglevel='WARN'):
else:
addr = config.DBS_ADDRESS
+ # create the db directory if needed
+ dirname = os.path.dirname(DATABASE['NAME'])
+ if not os.path.exists(dirname):
+ os.makedirs(dirname)
+
# create and upgrade the db if needed
connection.cursor() # bind the db
actions.upgrade_db() | The dbserver now performs a makedirs call if needed | gem_oq-engine | train | py |
6b92b55cdfc1dec76e419b4c313eca42df852a99 | diff --git a/evergreen/core/loop.py b/evergreen/core/loop.py
index <HASH>..<HASH> 100644
--- a/evergreen/core/loop.py
+++ b/evergreen/core/loop.py
@@ -248,7 +248,7 @@ class EventLoop(object):
def switch(self):
if not self._started:
- self._run(forever=False)
+ self.run()
return
current = Fiber.current()
assert current is not self.task, 'Cannot switch to MAIN from MAIN' | Fixed staring loop if switch() was called and it wasn't started yet | saghul_evergreen | train | py |
afd4b95ed046379076a170e3f0da7d58d87616b9 | diff --git a/org/mozilla/javascript/regexp/RegExpImpl.java b/org/mozilla/javascript/regexp/RegExpImpl.java
index <HASH>..<HASH> 100644
--- a/org/mozilla/javascript/regexp/RegExpImpl.java
+++ b/org/mozilla/javascript/regexp/RegExpImpl.java
@@ -34,6 +34,11 @@ public class RegExpImpl implements RegExpProxy {
return obj instanceof NativeRegExp;
}
+ public Object newRegExp(Scriptable scope, String source, String global)
+ {
+ return new NativeRegExp(scope, source, global);
+ }
+
public Object executeRegExp(Object regExp, Scriptable scopeObj,
String str, int indexp[], boolean test)
{
diff --git a/src/org/mozilla/javascript/regexp/RegExpImpl.java b/src/org/mozilla/javascript/regexp/RegExpImpl.java
index <HASH>..<HASH> 100644
--- a/src/org/mozilla/javascript/regexp/RegExpImpl.java
+++ b/src/org/mozilla/javascript/regexp/RegExpImpl.java
@@ -34,6 +34,11 @@ public class RegExpImpl implements RegExpProxy {
return obj instanceof NativeRegExp;
}
+ public Object newRegExp(Scriptable scope, String source, String global)
+ {
+ return new NativeRegExp(scope, source, global);
+ }
+
public Object executeRegExp(Object regExp, Scriptable scopeObj,
String str, int indexp[], boolean test)
{ | Added method to construct a new RegExp. | mozilla_rhino | train | java,java |
08aebcec9f477f8ba15f0d1cecf92c16f2b470a2 | diff --git a/jss/distribution_points.py b/jss/distribution_points.py
index <HASH>..<HASH> 100644
--- a/jss/distribution_points.py
+++ b/jss/distribution_points.py
@@ -130,8 +130,6 @@ class DistributionPoints(object):
share_name = repo['share_name']
# Domain is not used for AFP.
domain = repo.get('workgroup_or_domain')
- # If port isn't given, assume it's the std of 139.
- port = repo.get('share_port') or '139'
username = repo['username']
password = repo['password']
@@ -139,12 +137,16 @@ class DistributionPoints(object):
(name + share_name).replace(' ', ''))
if connection_type == 'AFP':
+ # If port isn't given, assume it's the std of 548.
+ port = repo.get('share_port') or '548'
dp = AFPDistributionPoint(URL=URL, port=port,
share_name=share_name,
mount_point=mount_point,
username=username,
password=password)
elif connection_type == 'SMB':
+ # If port isn't given, assume it's the std of 139.
+ port = repo.get('share_port') or '139'
dp = SMBDistributionPoint(URL=URL, port=port,
share_name=share_name,
mount_point=mount_point, | Set port based on type
-- <I> for AFP / <I> for SMB | jssimporter_python-jss | train | py |
d22b30152a883539425bdd358965f61f31f58963 | diff --git a/weld/src/main/java/org/jboss/as/weld/WeldDeploymentMarker.java b/weld/src/main/java/org/jboss/as/weld/WeldDeploymentMarker.java
index <HASH>..<HASH> 100644
--- a/weld/src/main/java/org/jboss/as/weld/WeldDeploymentMarker.java
+++ b/weld/src/main/java/org/jboss/as/weld/WeldDeploymentMarker.java
@@ -40,11 +40,7 @@ public class WeldDeploymentMarker {
*
*/
public static void mark(DeploymentUnit unit) {
- if (unit.getParent() == null) {
- unit.putAttachment(MARKER, Boolean.TRUE);
- } else {
- unit.getParent().putAttachment(MARKER, Boolean.TRUE);
- }
+ unit.putAttachment(MARKER, Boolean.TRUE);
}
/** | Fix weld merker issue | wildfly_wildfly | train | java |
3ad290f7eb1f75b2fea3b3db587ccb6a6b71db8c | diff --git a/Generative-Adversarial-Networks/pygan/generativemodel/conditionalgenerativemodel/conditional_convolutional_model.py b/Generative-Adversarial-Networks/pygan/generativemodel/conditionalgenerativemodel/conditional_convolutional_model.py
index <HASH>..<HASH> 100644
--- a/Generative-Adversarial-Networks/pygan/generativemodel/conditionalgenerativemodel/conditional_convolutional_model.py
+++ b/Generative-Adversarial-Networks/pygan/generativemodel/conditionalgenerativemodel/conditional_convolutional_model.py
@@ -36,7 +36,7 @@ class ConditionalConvolutionalModel(ConditionalGenerativeModel):
This model observes not only random noises but also any other prior
information as a previous knowledge and outputs feature points.
- Due to the `Conditoner`, this model has the capacity to exploit
+ Due to the `Conditioner`, this model has the capacity to exploit
whatever prior knowledge that is available and can be represented
as a matrix or tensor. | Update for pre learning, typo, and verbose. | chimera0_accel-brain-code | train | py |
33b4839eb2fff1aba62a26362b0e7e273bbf321a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,8 +11,8 @@ from urllib.request import urlopen
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
-VERSION = "2.11.1"
-LIBUAST_VERSION = "v1.9.4"
+VERSION = "2.11.2"
+LIBUAST_VERSION = "v1.9.5"
SDK_VERSION = "v1.16.1"
SDK_MAJOR = SDK_VERSION.split('.')[0]
FORMAT_ARGS = globals() | Bump libuast dependency version | bblfsh_client-python | train | py |
f1810b31c4c5aa356921bb6f8b6d362c78d41805 | diff --git a/Context/AbstractShopContext.php b/Context/AbstractShopContext.php
index <HASH>..<HASH> 100755
--- a/Context/AbstractShopContext.php
+++ b/Context/AbstractShopContext.php
@@ -29,14 +29,6 @@ abstract class AbstractShopContext
/**
* {@inheritdoc}
*/
- public function setCurrentShop(ShopInterface $shop)
- {
- $this->currentShop = $shop;
- }
-
- /**
- * {@inheritdoc}
- */
public function getCurrentShop()
{
return $this->currentShop;
@@ -45,9 +37,9 @@ abstract class AbstractShopContext
/**
* {@inheritdoc}
*/
- public function hasCurrentShop()
+ public function setCurrentShop(ShopInterface $shop)
{
- return $this->currentShop instanceof ShopInterface;
+ $this->currentShop = $shop;
}
/**
@@ -61,4 +53,12 @@ abstract class AbstractShopContext
return null;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hasCurrentShop()
+ {
+ return $this->currentShop instanceof ShopInterface;
+ }
} | Code reformatted
(cherry picked from commit 1af<I>b<I>c<I>a<I>deaa<I>bca1d4a0) | WellCommerce_WishlistBundle | train | php |
0017346306c917cfc93035dc6382a917d17ed437 | diff --git a/shared/subprocess/proc.go b/shared/subprocess/proc.go
index <HASH>..<HASH> 100644
--- a/shared/subprocess/proc.go
+++ b/shared/subprocess/proc.go
@@ -47,16 +47,20 @@ func (p *Process) Stop() error {
if err == nil {
err = pr.Kill()
if err == nil {
+ if p.hasMonitor {
+ <-p.chExit
+ }
+
return nil // Killed successfully.
}
}
- if p.hasMonitor {
- <-p.chExit
- }
-
// Check if either the existence check or the kill resulted in an already finished error.
if strings.Contains(err.Error(), "process already finished") {
+ if p.hasMonitor {
+ <-p.chExit
+ }
+
return ErrNotRunning
} | shared/subprocess: Fix Stop handling | lxc_lxd | train | go |
9bc6a5ff453966172077abc28720b3e6f3f096d1 | diff --git a/src/sap.ui.core/src/sap/ui/base/ManagedObject.js b/src/sap.ui.core/src/sap/ui/base/ManagedObject.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/base/ManagedObject.js
+++ b/src/sap.ui.core/src/sap/ui/base/ManagedObject.js
@@ -3361,7 +3361,7 @@ sap.ui.define([
}
// if property is already bound, unbind it first
- if (this.getBinding(sName)) {
+ if (this.isBound(sName)) {
this.unbindProperty(sName, true);
}
@@ -3836,7 +3836,7 @@ sap.ui.define([
}
// if aggregation is already bound, unbind it first
- if (this.getBinding(sName)) {
+ if (this.isBound(sName)) {
this.unbindAggregation(sName);
} | [FIX] sap/ui/base/ManagedObject: Check for isBound
- Revert check for getBinding to isBound in bindProperty
and bindAggregration
BCP: <I>
Change-Id: I1c7c<I>c<I>e7e<I>fa<I>f<I>be8a<I>ff | SAP_openui5 | train | js |
fa246a1c81e21d30668198e8a351fe43ff81a6fb | diff --git a/spec/e2e/active_rel_spec.rb b/spec/e2e/active_rel_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/e2e/active_rel_spec.rb
+++ b/spec/e2e/active_rel_spec.rb
@@ -32,6 +32,16 @@ describe 'ActiveRel' do
let(:from_node) { FromClass.create }
let(:to_node) { ToClass.create }
+ describe 'unpersisted nodes' do
+ let(:from_node) { FromClass.new }
+ let(:to_node) { ToClass.new }
+ let(:rel) { MyRelClass.new(from_node: from_node, to_node: to_node) }
+
+ it 'persists both nodes' do
+ expect { rel.save }.to change { [from_node, to_node].all?(&:persisted?) }.from(false).to true
+ end
+ end
+
describe 'from_class, to_class' do
it 'spits back the current variable if no argument is given' do
expect(MyRelClass.from_class).to eq FromClass | failing spec for activerel w/unpersisted nodes | neo4jrb_neo4j | train | rb |
1c3d70cce795fe2daaeb4b57ce4013fd08b997aa | diff --git a/src/utils/innerSliderUtils.js b/src/utils/innerSliderUtils.js
index <HASH>..<HASH> 100644
--- a/src/utils/innerSliderUtils.js
+++ b/src/utils/innerSliderUtils.js
@@ -259,6 +259,7 @@ export const changeSlide = (spec, options) => {
slidesToShow,
slideCount,
currentSlide,
+ targetSlide: previousTargetSlide,
lazyLoad,
infinite
} = spec;
@@ -273,6 +274,9 @@ export const changeSlide = (spec, options) => {
previousInt = currentSlide - slideOffset;
targetSlide = previousInt === -1 ? slideCount - 1 : previousInt;
}
+ if (!infinite) {
+ targetSlide = previousTargetSlide - slidesToScroll;
+ }
} else if (options.message === "next") {
slideOffset = indexOffset === 0 ? slidesToScroll : indexOffset;
targetSlide = currentSlide + slideOffset;
@@ -280,6 +284,9 @@ export const changeSlide = (spec, options) => {
targetSlide =
((currentSlide + slidesToScroll) % slideCount) + indexOffset;
}
+ if (!infinite) {
+ targetSlide = previousTargetSlide + slidesToScroll;
+ }
} else if (options.message === "dots") {
// Click on dots
targetSlide = options.index * options.slidesToScroll; | fix in an issue with changing slides with keys in finite mode | akiran_react-slick | train | js |
0de30334148e2d5a8b980ea4bf95c7828d2c391d | diff --git a/rtv/__main__.py b/rtv/__main__.py
index <HASH>..<HASH> 100644
--- a/rtv/__main__.py
+++ b/rtv/__main__.py
@@ -45,7 +45,10 @@ def main():
config = Config()
config.update(**fargs)
config.update(**args)
- config.keymap.update(**bindings)
+
+ # If key bindings are supplied in the config file, overwrite the defaults
+ if bindings:
+ config.keymap.set_bindings(bindings)
# Copy the default config file and quit
if config['copy_config']:
diff --git a/rtv/objects.py b/rtv/objects.py
index <HASH>..<HASH> 100644
--- a/rtv/objects.py
+++ b/rtv/objects.py
@@ -610,6 +610,7 @@ class KeyMap(object):
"""
def __init__(self, bindings):
+ self._keymap = None
self.set_bindings(bindings)
def set_bindings(self, bindings): | Updated bindings in __main__. | michael-lazar_rtv | train | py,py |
dc3d9f5edb388db8665a9b666b6477749746faaf | diff --git a/nolds/test_measures.py b/nolds/test_measures.py
index <HASH>..<HASH> 100644
--- a/nolds/test_measures.py
+++ b/nolds/test_measures.py
@@ -132,7 +132,7 @@ class TestNoldsLyap(unittest.TestCase):
"trajectory_len": np.random.randint(2,10)
}
min_len = nolds.lyap_r_len(**kwargs)
- for i in reversed(range(min_len-5,min_len+5)):
+ for i in reversed(range(max(1,min_len-5),min_len+5)):
data = np.random.random(i)
if i < min_len:
## too few data points => execution should fail | bugfix: enures that we do not try to test with negative sequence lengths | CSchoel_nolds | train | py |
423dbae884eb049e33835393af8ebee5d00383ff | diff --git a/lxd/storage/backend_lxd.go b/lxd/storage/backend_lxd.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/backend_lxd.go
+++ b/lxd/storage/backend_lxd.go
@@ -1277,7 +1277,7 @@ func (b *lxdBackend) CreateCustomVolumeFromCopy(volName, desc string, config map
// to negotiate a common transfer method between pool types.
logger.Debug("CreateCustomVolumeFromCopy cross-pool mode detected")
- // Create in-memory pipe pair to simulate a connection between the sender and receiver.
+ // Use in-memory pipe pair to simulate a connection between the sender and receiver.
aEnd, bEnd := memorypipe.NewPipePair()
// Negotiate the migration type to use. | lxd/storage/backend/lxd: Comment consistency in CreateCustomVolumeFromCopy | lxc_lxd | train | go |
3a5a61c762baa81ef3dcb057fe8cbaa8c8a9f9d1 | diff --git a/src/common/View.js b/src/common/View.js
index <HASH>..<HASH> 100644
--- a/src/common/View.js
+++ b/src/common/View.js
@@ -330,7 +330,7 @@ var View = FC.View = Class.extend({
this.clearView();
this.displayView();
if (wasEventsRendered) { // only render and trigger handlers if events previously rendered
- this.displayEvents();
+ this.displayEvents(this.calendar.getEventCache());
}
}
}, | fix bug with View::redisplay after events rendered (needed for Scheduler bug) | fullcalendar_fullcalendar | train | js |
fa6c9d2334431193c029b0e316ba5b43f9958d71 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,7 @@ setup(
long_description=read('README.rst'),
long_description_content_type='text/x-rst',
classifiers=[
- "Development Status :: 4 - Beta",
+ "Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python", | Set as Production/Stable in setup.py | lipoja_URLExtract | train | py |
3f7b0482d8be78066f6d14eb34b22c4a70332d12 | diff --git a/dataviews/ndmapping.py b/dataviews/ndmapping.py
index <HASH>..<HASH> 100644
--- a/dataviews/ndmapping.py
+++ b/dataviews/ndmapping.py
@@ -487,24 +487,7 @@ class NdIndexableMapping(param.Parameterized, Dimensional):
def __iter__(self):
- return self
-
- def next(self): # For Python 2 and 3 compatibility
- return self.__next__()
-
- def __next__(self):
- """
- Implements the iterable interface, returning values unlike a standard
- dictionary.
- """
- if self._next_ind < len(self.keys()):
- val = list(self.values())[self._next_ind]
- self._next_ind += 1
- return val
- else:
- self._next_ind = 0
- raise StopIteration
-
+ return iter(self.values())
def __contains__(self, key):
if self.ndims == 1: | Simplified the iterator interface for NdIndexableMapping | pyviz_holoviews | train | py |
ee0cefda33132494aa1e41da193d22cb274b70af | diff --git a/src/App.php b/src/App.php
index <HASH>..<HASH> 100644
--- a/src/App.php
+++ b/src/App.php
@@ -141,13 +141,6 @@ class App
public $call_exit = true;
/**
- * Error types to be in set_error_handler.
- *
- * @var int
- */
- protected $catch_error_types = E_ALL & ~E_NOTICE;
-
- /**
* @var string|null
*/
public $page;
@@ -207,7 +200,7 @@ class App
static function ($severity, $msg, $file, $line) {
throw new \ErrorException($msg, 0, $severity, $file, $line);
},
- $this->catch_error_types
+ \E_ALL
);
} | Catch all errors by App handler incl. php notices (#<I>)
* Catch all errors by App handler incl. php notices
* improve constant loopkup | atk4_ui | train | php |
4b81c77e3d11229fbfe96f9fd357548457e68d5d | diff --git a/context.go b/context.go
index <HASH>..<HASH> 100644
--- a/context.go
+++ b/context.go
@@ -128,12 +128,11 @@ func (ctx *Context) Write(content string) {
ctx.Body = []byte(content)
}
-// Return a 404 not found response.
// Retuns an HTTP Error by indicating the status code, the corresponding
// handler inside `App.errorHandler` will be called, if user does not set
// the corresponding error handler, the defaultErrorHandler will be called.
-func (ctx *Context) Error(statusCode int) {
- ctx.StatusCode = 404
+func (ctx *Context) Abort(statusCode int) {
+ ctx.StatusCode = statusCode
ctx.App.handleError(ctx, statusCode)
} | Change `Context.Error` to `Context.Abort`, and fix the problem that context always set the status code to <I>. | dinever_golf | train | go |
1ef37c556dc93ccff44d2e1e32a3a1b78bfb126a | diff --git a/raiden/tests/integration/api/test_restapi.py b/raiden/tests/integration/api/test_restapi.py
index <HASH>..<HASH> 100644
--- a/raiden/tests/integration/api/test_restapi.py
+++ b/raiden/tests/integration/api/test_restapi.py
@@ -951,26 +951,6 @@ def test_api_payments_conflicts(test_api_server, raiden_network, token_addresses
])
assert all(response.status_code == HTTPStatus.OK for response in responses)
- # two transfers with same identifier: payment conflict
- token_network_identifier = views.get_token_network_identifier_by_token_address(
- views.state_from_app(app0),
- app0.raiden.default_registry.address,
- token_address,
- )
-
- app1.stop()
- mediated_transfer(
- initiator_app=app0,
- target_app=app1,
- token_network_identifier=token_network_identifier,
- amount=80,
- identifier=42,
- timeout=.1,
- )
-
- request = grequests.post(payment_url, json={'amount': 80, 'identifier': 42})
- assert_payment_conflict([request.send().response])
-
@pytest.mark.parametrize('number_of_tokens', [0])
@pytest.mark.parametrize('number_of_nodes', [1]) | Fix test_api_payments_conflicts
The test was previously using a direct transfer to compare direct and
mediated transfers in flight. This is no longer needed. | raiden-network_raiden | train | py |
bfea955904b0eeed4088fbd3155a49a17c70c47b | diff --git a/ddsc/core/d4s2.py b/ddsc/core/d4s2.py
index <HASH>..<HASH> 100644
--- a/ddsc/core/d4s2.py
+++ b/ddsc/core/d4s2.py
@@ -115,7 +115,8 @@ class D4S2Api(object):
if response.status_code == 401:
raise D4S2Error(UNAUTHORIZED_MESSAGE)
if not 200 <= response.status_code < 300:
- raise D4S2Error("Request to {} failed with {}.".format(response.url, response.status_code))
+ raise D4S2Error("Request to {} failed with {}:\n{}.".format(response.url, response.status_code,
+ response.text))
class D4S2Item(object): | Include response text in D4S2Error for more diagnostic information | Duke-GCB_DukeDSClient | train | py |
a4e77666ae6bd07cc359797c98a5c9b31cec5a4f | diff --git a/lib/helpers/index.js b/lib/helpers/index.js
index <HASH>..<HASH> 100644
--- a/lib/helpers/index.js
+++ b/lib/helpers/index.js
@@ -12,7 +12,6 @@ module.exports = {
render: require('./render'),
sanitizeFormData: require('./sanitize-form-data'),
setTempCookie: require('./set-temp-cookie'),
- title: require('./title'),
validateAccount: require('./validate-account'),
xsrfValidator: require('./xsrf-validator')
}; | remove broken require
this file does not exist | stormpath_express-stormpath | train | js |
a1a35f43175187091f028474db2ebef5bfc77bc0 | diff --git a/semantic_release/pypi.py b/semantic_release/pypi.py
index <HASH>..<HASH> 100644
--- a/semantic_release/pypi.py
+++ b/semantic_release/pypi.py
@@ -2,7 +2,7 @@ from invoke import run
from twine.commands import upload as twine_upload
-def upload_to_pypi(dists='bdist_wheel'):
+def upload_to_pypi(dists='sdist bdist_wheel'):
"""
Creates the wheel and uploads to pypi with twine.
diff --git a/tests/test_pypi.py b/tests/test_pypi.py
index <HASH>..<HASH> 100644
--- a/tests/test_pypi.py
+++ b/tests/test_pypi.py
@@ -12,7 +12,7 @@ class PypiTests(TestCase):
upload_to_pypi()
self.assertEqual(
mock_run.call_args_list,
- [mock.call('python setup.py bdist_wheel'), mock.call('rm -rf build dist')]
+ [mock.call('python setup.py sdist bdist_wheel'), mock.call('rm -rf build dist')]
)
mock_upload.assert_called_once_with(
dists=['dist/*'], | fix(pypi): Add sdist as default in addition to bdist_wheel
There are a lot of outdated pip installations around which leads to
confusions if a package have had an sdist release at some point and
then suddenly is only available as wheel packages, because old pip
clients will then download the latest sdist package available. | relekang_python-semantic-release | train | py,py |
196b81600aba62edf389acd76127d8290b665ae6 | diff --git a/test/io_tests.rb b/test/io_tests.rb
index <HASH>..<HASH> 100644
--- a/test/io_tests.rb
+++ b/test/io_tests.rb
@@ -7,7 +7,7 @@ class TestSensuIO < TestCase
end
def test_popen_timed_out_command
- output, status = Sensu::IO.popen('sleep 2 && echo "Ruby 1.8"', 'r', 0.25)
+ output, status = Sensu::IO.popen('sleep 2 && echo -n "Ruby 1.8"', 'r', 0.25)
if RUBY_VERSION < '1.9.0'
assert_equal('Ruby 1.8', output)
assert_equal(0, status) | [popen] use echo -n to not produce \n in test output | sensu_sensu | train | rb |
a2a6fadf6c536eb22ff011075edf6f657da4fda1 | diff --git a/devices/gledopto.js b/devices/gledopto.js
index <HASH>..<HASH> 100644
--- a/devices/gledopto.js
+++ b/devices/gledopto.js
@@ -537,6 +537,7 @@ module.exports = [
zigbeeModel: ['GL-D-006P'],
model: 'GL-D-006P',
vendor: 'Gledopto',
+ ota: ota.zigbeeOTA,
description: 'Zigbee 6W anti-glare downlight RGB+CCT (pro)',
extend: gledoptoExtend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495]}),
}, | Support OTA for Gledopto GL-D-<I>P (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
7c66e369f2302fcfa93385964e9bf62f6ed05bbf | diff --git a/lib/feedisco/checks.rb b/lib/feedisco/checks.rb
index <HASH>..<HASH> 100644
--- a/lib/feedisco/checks.rb
+++ b/lib/feedisco/checks.rb
@@ -8,8 +8,6 @@ module Feedisco::Checks
feed_content_type?(url)
end
- private
-
# Determines if the specified URL looks like a feed. We consider it does if:
# - it ends with a 'feed-suffix': .rdf, .xml, .rss
# - it contains a 'feed=rss' or 'feed=atom' query param (well, we don't check
@@ -18,7 +16,9 @@ module Feedisco::Checks
def looks_like_feed?(url)
(url =~ %r{(\.(rdf|xml|rss)$|feed=(rss|atom)(&(.)+)?$|(atom|feed)/?$)}i) != nil
end
-
+
+ private
+
# Open the specified URL and check its content type. Returns true if the content type
# is a feed content type (in Feedisco.feed_content_types)
# | Method made public again. Specs green again | rchampourlier_feedisco | train | rb |
2053ea9d3c25420004d9c2a5f6b3c0d4cab5def7 | diff --git a/lib/lumber/transports/file.js b/lib/lumber/transports/file.js
index <HASH>..<HASH> 100644
--- a/lib/lumber/transports/file.js
+++ b/lib/lumber/transports/file.js
@@ -183,6 +183,12 @@ File.prototype._drain = function(cb) {
File.prototype._flush = function(cb) {
var self = this;
+ if(self._buffer.length == 0) {
+ self.emit('flush');
+ if(cb) cb(null);
+ return;
+ }
+
//start a write for each one
self._buffer.forEach(function(log) {
var msg = log[0], | Fixed an issue with flush never emitting on empty buffer | englercj_lumber | train | js |
eccd55dd6b971c1a488e351072a429045152a48a | diff --git a/grs/realtime.py b/grs/realtime.py
index <HASH>..<HASH> 100644
--- a/grs/realtime.py
+++ b/grs/realtime.py
@@ -61,6 +61,7 @@ class RealtimeStock(object):
crosspic: K線圖 by Google Chart
"""
def __init__(self, no):
+ assert isinstance(no, str), '`no` must be a string'
self.__raw = ''
page = urllib2.urlopen(
'http://mis.tse.com.tw/data/{0}.csv?r={1}'.format( | Add assert into realtime. #9 | toomore_grs | train | py |
de8e746959d2e92b8a465761aa87c9eab0e4e062 | diff --git a/lib/socket.js b/lib/socket.js
index <HASH>..<HASH> 100644
--- a/lib/socket.js
+++ b/lib/socket.js
@@ -100,6 +100,10 @@ Socket.prototype.emit = function(ev){
// access last argument to see if it's an ACK callback
if ('function' == typeof args[args.length - 1]) {
+ if (this.rooms || (this.flags && this.flags.broadcast)) {
+ throw new Error('Callbacks are not supported when broadcasting');
+ }
+
debug('emitting packet with ack id %d', this.nsp.ids);
this.acks[this.nsp.ids] = args.pop();
packet.id = this.nsp.ids++; | socket: rooms and flags are now hashes | socketio_socket.io | train | js |
7d6d4385663222b0f517d859db6be330c747132a | diff --git a/spacy/about.py b/spacy/about.py
index <HASH>..<HASH> 100644
--- a/spacy/about.py
+++ b/spacy/about.py
@@ -4,7 +4,7 @@
# fmt: off
__title__ = "spacy"
-__version__ = "2.2.0.dev1"
+__version__ = "2.2.0.dev2"
__summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython"
__uri__ = "https://spacy.io"
__author__ = "Explosion AI" | Set version to <I>.dev2 | explosion_spaCy | train | py |
08a273f77309f49d5119ea0a5b914e1f510e5044 | diff --git a/test/db/derby/xml_column_test.rb b/test/db/derby/xml_column_test.rb
index <HASH>..<HASH> 100644
--- a/test/db/derby/xml_column_test.rb
+++ b/test/db/derby/xml_column_test.rb
@@ -5,7 +5,7 @@ class DerbyXmlColumnTest < Test::Unit::TestCase
include FixtureSetup
include XmlColumnTestMethods
- def xml_sql_type; 'xml'; end
+ def xml_sql_type;ArJdbc::AR42 ? 'XML(2147483647)':'xml';end
# @override
def test_use_xml_column | ActiveRecord <I> reports xml columns as XML(<I>) | jruby_activerecord-jdbc-adapter | train | rb |
f1dc39a01c01269f798fa9c61a3bc834175f0d43 | diff --git a/lib/github/html/email_reply_filter.rb b/lib/github/html/email_reply_filter.rb
index <HASH>..<HASH> 100644
--- a/lib/github/html/email_reply_filter.rb
+++ b/lib/github/html/email_reply_filter.rb
@@ -39,9 +39,9 @@ module GitHub::HTML
def call
found_hidden = nil
paragraphs = EmailReplyParser.read(text.dup).fragments.map do |fragment|
- pieces = [escape_html(fragment.to_s.strip)]
+ pieces = [escape_html(fragment.to_s.strip).gsub(/^\s*(>|>)/, '')]
if fragment.quoted?
- if !fragment.hidden? && pieces[0] !~ /^\s*(>|>)/
+ if !fragment.hidden?
header, quoted = pieces[0].split("\n", 2)
pieces = ["<!-- #{header} -->\n#{quoted}"]
end | strip > from the front of email replies | jch_html-pipeline | train | rb |
13a0b312790749089e3db27b722b9365acedb931 | diff --git a/spacy/en/__init__.py b/spacy/en/__init__.py
index <HASH>..<HASH> 100644
--- a/spacy/en/__init__.py
+++ b/spacy/en/__init__.py
@@ -37,7 +37,9 @@ class English(Language):
def _fix_deprecated_glove_vectors_loading(overrides):
if 'data_dir' in overrides and 'path' not in overrides:
raise ValueError("The argument 'data_dir' has been renamed to 'path'")
- if overrides.get('path') is None:
+ if overrides.get('path') is False:
+ return overrides
+ if overrides.get('path') in (None, True):
data_path = get_data_path()
else:
path = overrides['path'] | Another tweak to GloVe path hackery. | explosion_spaCy | train | py |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.