diff stringlengths 65 26.7k | message stringlengths 7 9.92k |
|---|---|
diff --git a/tensor2tensor/models/research/universal_transformer_util.py b/tensor2tensor/models/research/universal_transformer_util.py
index <HASH>..<HASH> 100644
--- a/tensor2tensor/models/research/universal_transformer_util.py
+++ b/tensor2tensor/models/research/universal_transformer_util.py
@@ -125,8 +125,6 @@ def universal_transformer_encoder(encoder_input,
x, extra_output = universal_transformer_layer(
x, hparams, ffn_unit, attention_unit, pad_remover=pad_remover)
- if hparams.get("use_memory_as_last_state", False):
- x = extra_output # which is memory
return common_layers.layer_preprocess(x, hparams), extra_output
@@ -251,8 +249,9 @@ def universal_transformer_layer(x,
output, _, extra_output = tf.foldl(
ut_function, tf.range(hparams.num_rec_steps), initializer=initializer)
- # This is possible only when we are using lstm as transition function.
- if hparams.get("use_memory_as_final_state", False):
+ # Right now, this is only possible when the transition function is an lstm
+ if (hparams.recurrence_type == "lstm" and
+ hparams.get("use_memory_as_final_state", False)):
output = extra_output
if hparams.mix_with_transformer == "after_ut": | setting the default for use_memory_as_final_state flag to False (#<I>) |
diff --git a/examples/src/main/python/ml/dataframe_example.py b/examples/src/main/python/ml/dataframe_example.py
index <HASH>..<HASH> 100644
--- a/examples/src/main/python/ml/dataframe_example.py
+++ b/examples/src/main/python/ml/dataframe_example.py
@@ -28,6 +28,7 @@ import shutil
from pyspark.sql import SparkSession
from pyspark.mllib.stat import Statistics
+from pyspark.mllib.util import MLUtils
if __name__ == "__main__":
if len(sys.argv) > 2:
@@ -55,7 +56,8 @@ if __name__ == "__main__":
labelSummary.show()
# Convert features column to an RDD of vectors.
- features = df.select("features").rdd.map(lambda r: r.features)
+ features = MLUtils.convertVectorColumnsFromML(df, "features") \
+ .select("features").rdd.map(lambda r: r.features)
summary = Statistics.colStats(features)
print("Selected features column with average values:\n" +
str(summary.mean())) | [SPARK-<I>][PYSPARK][ML][EXAMPLES] dataframe_example.py fails to convert ML style vectors
## What changes were proposed in this pull request?
Need to convert ML Vectors to the old MLlib style before doing Statistics.colStats operations on the DataFrame
## How was this patch tested?
Ran example, local tests |
diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -16,6 +16,7 @@ const heartbeatDuration = time.Minute
type Connection interface {
OpenQueue(name string) Queue
CollectStats() Stats
+ GetOpenQueues() []string
}
// Connection is the entry point. Use a connection to access queues, consumers and deliveries
diff --git a/test_connection.go b/test_connection.go
index <HASH>..<HASH> 100644
--- a/test_connection.go
+++ b/test_connection.go
@@ -49,3 +49,7 @@ func (connection TestConnection) Reset() {
queue.Reset()
}
}
+
+func (connection TestConnection) GetOpenQueues() []string {
+ return []string{}
+} | matching queue name with regexp and return reject for all matches |
diff --git a/auth.go b/auth.go
index <HASH>..<HASH> 100644
--- a/auth.go
+++ b/auth.go
@@ -32,12 +32,13 @@ func (auth *PlainAuth) Response() string {
return fmt.Sprintf("\000%s\000%s", auth.Username, auth.Password)
}
-// AMQPLAINAuth is similar to PlainAuth
+// AMQPlainAuth is similar to PlainAuth
type AMQPlainAuth struct {
Username string
Password string
}
+// Mechanism returns "AMQPLAIN"
func (auth *AMQPlainAuth) Mechanism() string {
return "AMQPLAIN"
}
diff --git a/uri.go b/uri.go
index <HASH>..<HASH> 100644
--- a/uri.go
+++ b/uri.go
@@ -125,7 +125,7 @@ func (uri URI) PlainAuth() *PlainAuth {
}
}
-// PlainAuth returns a PlainAuth structure based on the parsed URI's
+// AMQPlainAuth returns a PlainAuth structure based on the parsed URI's
// Username and Password fields.
func (uri URI) AMQPlainAuth() *AMQPlainAuth {
return &AMQPlainAuth{ | Fixes pre-existing golint issues |
diff --git a/LiSE/LiSE/proxy.py b/LiSE/LiSE/proxy.py
index <HASH>..<HASH> 100644
--- a/LiSE/LiSE/proxy.py
+++ b/LiSE/LiSE/proxy.py
@@ -2934,9 +2934,10 @@ class EngineProxy(AbstractEngine):
for f in self._time_listeners:
f(b, t, branch, tick)
- def __init__(self, handle_out, handle_in, eventq):
+ def __init__(self, handle_out, handle_in, logger, eventq):
self._handle_out = handle_out
self._handle_in = handle_in
+ self.logger = logger
self._q = eventq
self.eternal = EternalVarProxy(self)
self.universal = GlobalVarProxy(self)
@@ -3544,6 +3545,7 @@ class EngineProcessManager(object):
self.engine_proxy = EngineProxy(
self._handle_out_pipe_send,
handle_in_pipe_recv,
+ self.logger,
callbacq
)
return self.engine_proxy | let EngineHandle at the logger, too |
diff --git a/conf/lex.go b/conf/lex.go
index <HASH>..<HASH> 100644
--- a/conf/lex.go
+++ b/conf/lex.go
@@ -13,7 +13,7 @@ import (
)
const spaces = " \t"
-const whitespace = spaces + "\n\r"
+const whitespace = spaces + "\n"
const wordRunes = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVXYZ_"
const quotes = `'"`
@@ -232,6 +232,7 @@ func (l *lexer) nextSignificantItem() item {
// lex creates a new scanner for the input string.
func lex(name, input string) *lexer {
+ input = strings.Replace(input, "\r\n", "\n", -1)
l := &lexer{
name: name,
input: input, | Adjust our CRLF strategy - convert before lexing. |
diff --git a/test/api-configuration.test.js b/test/api-configuration.test.js
index <HASH>..<HASH> 100644
--- a/test/api-configuration.test.js
+++ b/test/api-configuration.test.js
@@ -71,10 +71,10 @@ suite('Configuration API', function() {
var dump = database.commandSync('dump', {
tables: 'companies'
});
- var expected = 'table_create companies TABLE_HASH_KEY ShortText\n' +
- 'table_create companies_BigramTerms ' +
+ var expected = 'table_create companies_BigramTerms ' +
'TABLE_PAT_KEY|KEY_NORMALIZE ShortText ' +
'--default_tokenizer TokenBigram\n' +
+ 'table_create companies TABLE_HASH_KEY ShortText\n' +
'column_create companies name COLUMN_SCALAR ShortText\n' +
'column_create companies_BigramTerms companies_name ' +
'COLUMN_INDEX|WITH_POSITION companies name'; | Fix expected dump for DefineIndexField |
diff --git a/webapp/WEB-INF/setupdata/vfs/system/workplace/editors/msdhtml/edithtml.js b/webapp/WEB-INF/setupdata/vfs/system/workplace/editors/msdhtml/edithtml.js
index <HASH>..<HASH> 100644
--- a/webapp/WEB-INF/setupdata/vfs/system/workplace/editors/msdhtml/edithtml.js
+++ b/webapp/WEB-INF/setupdata/vfs/system/workplace/editors/msdhtml/edithtml.js
@@ -42,7 +42,7 @@ function hasSelectedText() {
selectedRange = range;
}
- if ((selectedRange == null) || (selectedRange.htmlText == "") || (selectedRange.htmlText == null)) {
+ if ((selectedRange == null) || (selectedRange.htmlText == null) || (selectedRange.htmlText == "") || (selectedRange.htmlText.search(/<P> <\/P>/) != -1)) {
// no text selected, check if an image is selected
try {
range = range.item(0); | fixed issue in getSelectedText method throwing JavaScript error |
diff --git a/__init__.py b/__init__.py
index <HASH>..<HASH> 100644
--- a/__init__.py
+++ b/__init__.py
@@ -17,3 +17,4 @@ from srl_data import *
from causal_data import *
from temporal_data import *
from factuality_data import *
+from markable_data import * | Added markable data to the init |
diff --git a/cassandra/cluster.py b/cassandra/cluster.py
index <HASH>..<HASH> 100644
--- a/cassandra/cluster.py
+++ b/cassandra/cluster.py
@@ -1940,7 +1940,7 @@ class Session(object):
increasing timestamps across clusters, or set it to to ``lambda:
int(time.time() * 1e6)`` if losing records over clock inconsistencies is
acceptable for the application. Custom :attr:`timestamp_generator` s should
- be callable, and calling them should return an integer representing seconds
+ be callable, and calling them should return an integer representing microseconds
since some point in time, typically UNIX epoch.
.. versionadded:: 3.8.0
diff --git a/cassandra/timestamps.py b/cassandra/timestamps.py
index <HASH>..<HASH> 100644
--- a/cassandra/timestamps.py
+++ b/cassandra/timestamps.py
@@ -70,7 +70,7 @@ class MonotonicTimestampGenerator(object):
call an instantiated ``MonotonicTimestampGenerator`` object.
:param int now: an integer to be used as the current time, typically
- representing the current time in seconds since the UNIX epoch
+ representing the current time in microseconds since the UNIX epoch
:param int last: an integer representing the last timestamp returned by
this object
""" | timestamp gen docstrings: sec-->usec |
diff --git a/ptpython/layout.py b/ptpython/layout.py
index <HASH>..<HASH> 100644
--- a/ptpython/layout.py
+++ b/ptpython/layout.py
@@ -1,6 +1,6 @@
from __future__ import unicode_literals
-from prompt_toolkit.enums import DEFAULT_BUFFER
+from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
from prompt_toolkit.filters import IsDone, HasCompletions, RendererHeightIsKnown, Always, HasFocus, Condition
from prompt_toolkit.key_binding.vi_state import InputMode
from prompt_toolkit.layout import Window, HSplit, VSplit, FloatContainer, Float, ConditionalContainer
@@ -400,7 +400,9 @@ def create_layout(python_input, key_bindings_manager,
ConditionalProcessor(
processor=HighlightMatchingBracketProcessor(chars='[](){}'),
filter=HasFocus(DEFAULT_BUFFER) & ~IsDone()),
- HighlightSearchProcessor(preview_search=Always()),
+ ConditionalProcessor(
+ processor=HighlightSearchProcessor(preview_search=Always()),
+ filter=HasFocus(SEARCH_BUFFER)),
HighlightSelectionProcessor()] + extra_buffer_processors,
menu_position=menu_position, | Only show search highlighting when the search is the current input buffer. |
diff --git a/cmd/jujud/machine.go b/cmd/jujud/machine.go
index <HASH>..<HASH> 100644
--- a/cmd/jujud/machine.go
+++ b/cmd/jujud/machine.go
@@ -84,7 +84,7 @@ func (a *MachineAgent) Run(_ *cmd.Context) error {
// that need a state connection Unless we're bootstrapping, we
// need to connect to the API server to find out if we need to
// call this, so we make the APIWorker call it when necessary if
- // the machine requires it. Note that startStateWorker can be
+ // the machine requires it. Note that ensureStateWorker can be
// called many times - StartWorker does nothing if there is
// already a worker started with the given name.
ensureStateWorker := func() {
@@ -126,7 +126,7 @@ var stateJobs = map[params.MachineJob]bool{
// APIWorker returns a Worker that connects to the API and starts any
// workers that need an API connection.
//
-// If a state worker is necessary, APIWorker calls startStateWorker.
+// If a state worker is necessary, APIWorker calls ensureStateWorker.
func (a *MachineAgent) APIWorker(ensureStateWorker func()) (worker.Worker, error) {
st, entity, err := openAPIState(a.Conf.Conf, a)
if err != nil { | cmd/jujud: fix comments |
diff --git a/src/sap.m/src/sap/m/upload/UploadSet.js b/src/sap.m/src/sap/m/upload/UploadSet.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/upload/UploadSet.js
+++ b/src/sap.m/src/sap/m/upload/UploadSet.js
@@ -272,6 +272,7 @@ sap.ui.define([
* <code>maxFileNameLength</code> property.</li>
* <li>When the file name length restriction changes, and the file to be uploaded fails to meet the new
* restriction.</li>
+ * <li>Listeners can use the item parameter to remove the incomplete item that failed to meet the restriction</li>
* </ul>
*/
fileNameLengthExceeded: {
@@ -290,6 +291,7 @@ sap.ui.define([
* <code>maxFileSize</code> property.</li>
* <li>When the file size restriction changes, and the file to be uploaded fails to meet the new
* restriction.</li>
+ * <li>Listeners can use the item parameter to remove the incomplete item that failed to meet the restriction</li>
* </ul>
*/
fileSizeExceeded: { | [INTERNAL] API Documentation change for file name and size exceeded
BCP: <I>
Change-Id: I7eddb9d4fced<I>c<I>bb<I>ef7f5ea<I>c<I>b |
diff --git a/object-assign.js b/object-assign.js
index <HASH>..<HASH> 100644
--- a/object-assign.js
+++ b/object-assign.js
@@ -10,7 +10,7 @@
var ToObject = function (val) {
if (val == null) {
- throw new TypeError('Object.assign can not be called with null or undefined');
+ throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val); | Update object-assign.js |
diff --git a/code/thirdparty/Apache/Solr/HttpTransport/Curl.php b/code/thirdparty/Apache/Solr/HttpTransport/Curl.php
index <HASH>..<HASH> 100644
--- a/code/thirdparty/Apache/Solr/HttpTransport/Curl.php
+++ b/code/thirdparty/Apache/Solr/HttpTransport/Curl.php
@@ -119,6 +119,9 @@ class Apache_Solr_HttpTransport_Curl extends Apache_Solr_HttpTransport_Abstract
// set the URL
CURLOPT_URL => $url,
+ // unset the content type, could be left over from previous request
+ CURLOPT_HTTPHEADER => array("Content-Type:"),
+
// set the timeout
CURLOPT_TIMEOUT => $timeout
)); | Remove Content-Type from Curl GET Request
Solr <I> does not like Content-Types on GET requests.
The Curl HttpTransport reuses the curl instance if you send multiple requests to Solr. This leads to an error if you send a post request, which sets the Content-Type Header and then send a GET request like search. |
diff --git a/vapi/library/finder/finder.go b/vapi/library/finder/finder.go
index <HASH>..<HASH> 100644
--- a/vapi/library/finder/finder.go
+++ b/vapi/library/finder/finder.go
@@ -78,6 +78,17 @@ func (f *Finder) find(ctx context.Context, ipath string) ([]FindResult, error) {
// Tokenize the path into its distinct parts.
parts := strings.Split(ipath, "/")
+ // If there are more than three parts then the file name contains
+ // the "/" character. In that case collapse any additional parts
+ // back into the filename.
+ if len(parts) > 3 {
+ parts = []string{
+ parts[0],
+ parts[1],
+ strings.Join(parts[2:], "/"),
+ }
+ }
+
libs, err := f.findLibraries(ctx, parts[0])
if err != nil {
return nil, err | lib/finder: Support filenames with "/"
This patch fixes the library's finder to support filenames containing
the "/" character. |
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
index <HASH>..<HASH> 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
@@ -24,7 +24,7 @@ class Review < ActiveRecord::Base
belongs_to :project, :class_name => "Project", :foreign_key => "project_id"
has_many :review_comments, :order => "created_at", :dependent => :destroy
alias_attribute :comments, :review_comments
- belongs_to :rule_failure, :foreign_key => 'rule_failure_permanent_id'
+ belongs_to :rule_failure, :foreign_key => 'rule_failure_permanent_id', :primary_key => 'permanent_id'
validates_presence_of :user, :message => "can't be empty"
validates_presence_of :review_type, :message => "can't be empty" | Fix display of source code in review detail
The problem occurs when the review relates to a violation tracked over time. |
diff --git a/consul/structs/prepared_query_test.go b/consul/structs/prepared_query_test.go
index <HASH>..<HASH> 100644
--- a/consul/structs/prepared_query_test.go
+++ b/consul/structs/prepared_query_test.go
@@ -4,7 +4,7 @@ import (
"testing"
)
-func TestStructs_PreparedQuery_GetACLInfo(t *testing.T) {
+func TestStructs_PreparedQuery_GetACLPrefix(t *testing.T) {
ephemeral := &PreparedQuery{}
if prefix := ephemeral.GetACLPrefix(); prefix != nil {
t.Fatalf("bad: %#v", prefix) | Renames a unit test. |
diff --git a/lib/compoundify.js b/lib/compoundify.js
index <HASH>..<HASH> 100644
--- a/lib/compoundify.js
+++ b/lib/compoundify.js
@@ -52,10 +52,11 @@ function compoundify(SuperConstructor) {
if (arguments.length < 2) {
value = {};
}
+ u = SuperConstructor.prototype.addNode.call(this, u, value);
this._parents[u] = null;
this._children[u] = new Set();
this._children[null].add(u);
- return SuperConstructor.prototype.addNode.call(this, u, value);
+ return u;
};
Constructor.prototype.delNode = function(u) {
diff --git a/test/abstract-compoundify-test.js b/test/abstract-compoundify-test.js
index <HASH>..<HASH> 100644
--- a/test/abstract-compoundify-test.js
+++ b/test/abstract-compoundify-test.js
@@ -114,6 +114,12 @@ module.exports = function(name, Constructor, superName, SuperConstructor) {
g.delNode("sg1");
assert.throws(function() { g.children("sg1"); });
});
+
+ it("can remove a node created with a automatically assigned id", function() {
+ var id = g.addNode();
+ g.delNode(id);
+ assert.lengthOf(g.nodes(), 0);
+ });
});
describe("from" + superName, function() { | Fix bug where auto-assigned id was not used for parent/children properties |
diff --git a/contrib/parseq-batching/src/main/java/com/linkedin/parseq/batching/BatchingSupport.java b/contrib/parseq-batching/src/main/java/com/linkedin/parseq/batching/BatchingSupport.java
index <HASH>..<HASH> 100644
--- a/contrib/parseq-batching/src/main/java/com/linkedin/parseq/batching/BatchingSupport.java
+++ b/contrib/parseq-batching/src/main/java/com/linkedin/parseq/batching/BatchingSupport.java
@@ -16,12 +16,12 @@ public class BatchingSupport implements PlanActivityListener {
}
@Override
- public void onPlanActivated(final PlanContext plaContext) {
+ public void onPlanActivated(final PlanContext planContext) {
}
@Override
- public void onPlanDeactivated(final PlanContext plaContext) {
- _strategies.forEach(strategy -> strategy.handleBatch(plaContext));
+ public void onPlanDeactivated(final PlanContext planContext) {
+ _strategies.forEach(strategy -> strategy.handleBatch(planContext));
}
} | Typos in BathingSupport class. |
diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js
index <HASH>..<HASH> 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -391,6 +391,7 @@ function determinePluginTarget(projectRoot, cfg, target, fetchOptions) {
}
// Require project pkgJson.
var pkgJsonPath = path.join(projectRoot, 'package.json');
+ var cordovaVersion = pkgJson.version;
if(fs.existsSync(pkgJsonPath)) {
pkgJson = cordova_util.requireNoCache(pkgJsonPath);
}
@@ -457,7 +458,7 @@ function determinePluginTarget(projectRoot, cfg, target, fetchOptions) {
return (shouldUseNpmInfo ? registry.info([id])
.then(function(pluginInfo) {
- return getFetchVersion(projectRoot, pluginInfo, pkgJson.version);
+ return getFetchVersion(projectRoot, pluginInfo, cordovaVersion);
}) : Q(null))
.then(function(fetchVersion) {
return fetchVersion ? (id + '@' + fetchVersion) : target; | CB-<I>: fixed incorrect plugin version fetching issue |
diff --git a/salt/grains/core.py b/salt/grains/core.py
index <HASH>..<HASH> 100644
--- a/salt/grains/core.py
+++ b/salt/grains/core.py
@@ -222,7 +222,7 @@ def os_data():
match = regex.match(line)
if match:
# Adds: lsb_distrib_{id,release,codename,description}
- grains['lsb_{0}'.format(match.groups()[0].lower())] = match.groups()[1]
+ grains['lsb_{0}'.format(match.groups()[0].lower())] = match.groups()[1].rstrip()
if os.path.isfile('/etc/arch-release'):
grains['os'] = 'Arch'
elif os.path.isfile('/etc/debian_version'): | Strip trailing \n off of lsb_* grains |
diff --git a/sos/archive.py b/sos/archive.py
index <HASH>..<HASH> 100644
--- a/sos/archive.py
+++ b/sos/archive.py
@@ -118,11 +118,18 @@ class FileCacheArchive(Archive):
self._check_path(dest)
try:
shutil.copy(src, dest)
+ except IOError:
+ self.log.info("caught IO error copying %s" % src)
+ try:
shutil.copystat(src, dest)
+ except PermissionError:
+ # SELinux xattrs in /proc and /sys throw this
+ pass
+ try:
stat = os.stat(src)
os.chown(dest, stat.st_uid, stat.st_gid)
- except IOError:
- self.log.info("caught IO error copying %s" % src)
+ except Exception as e:
+ self.log.debug("caught %s setting ownership of %s" % (e,dest))
self.log.debug("added %s to FileCacheArchive %s" %
(src, self._archive_root)) | Break up exception handling in FileCacheArchive.add_file()
An exception can occur at several points in add_file()
- Copying the source to the destination
- Propagating permissions with shutil.copystat
- Setting ownership via os.chown
The second of these can occur when copying SELinux xattrs from
/proc. Separate out the three cases and ignore failures in
copystat. |
diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py
index <HASH>..<HASH> 100644
--- a/superset/connectors/sqla/models.py
+++ b/superset/connectors/sqla/models.py
@@ -920,6 +920,7 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho
data_["is_sqllab_view"] = self.is_sqllab_view
data_["health_check_message"] = self.health_check_message
data_["extra"] = self.extra
+ data_["owners"] = self.owners_data
return data_
@property
diff --git a/tests/integration_tests/datasource_tests.py b/tests/integration_tests/datasource_tests.py
index <HASH>..<HASH> 100644
--- a/tests/integration_tests/datasource_tests.py
+++ b/tests/integration_tests/datasource_tests.py
@@ -290,6 +290,8 @@ class TestDatasource(SupersetTestCase):
self.compare_lists(datasource_post[k], resp[k], "metric_name")
elif k == "database":
self.assertEqual(resp[k]["id"], datasource_post[k]["id"])
+ elif k == "owners":
+ self.assertEqual([o["id"] for o in resp[k]], datasource_post["owners"])
else:
print(k)
self.assertEqual(resp[k], datasource_post[k]) | fix: properly set `owners` to Sqlatable.owners_data inside payload (#<I>)
* properly set owners_data for sqlatabl
* fix test |
diff --git a/shoebot/__init__.py b/shoebot/__init__.py
index <HASH>..<HASH> 100644
--- a/shoebot/__init__.py
+++ b/shoebot/__init__.py
@@ -993,10 +993,10 @@ class CairoCanvas(Canvas):
ctx.save()
x,y = item.metrics[0:2]
deltax, deltay = item.center
+ m = item._transform.get_matrix_with_center(deltax,deltay-item.baseline,item._transformmode)
+ ctx.transform(m)
ctx.translate(item.x,item.y)
ctx.translate(0,-item.baseline)
- m = item._transform.get_matrix_with_center(deltax,deltay,item._transformmode)
- ctx.transform(m)
self.drawtext(item)
elif isinstance(item, Image):
ctx.save() | transforms are correct for text objects too, finallyhg diff! now the transform system works almost perfectly |
diff --git a/psiturk/psiturk_config.py b/psiturk/psiturk_config.py
index <HASH>..<HASH> 100644
--- a/psiturk/psiturk_config.py
+++ b/psiturk/psiturk_config.py
@@ -28,7 +28,7 @@ class PsiturkConfig(SafeConfigParser):
local_defaults_file = os.path.join(defaults_folder, "local_config_defaults.txt")
global_defaults_file = os.path.join(defaults_folder, "global_config_defaults.txt")
if not os.path.exists(self.localFile):
- print "ERROR - no config.txt file in the current directory. \n\nAre you use this directory is a valid psiTurk experiment? If you are starting a new project run 'psiturk-setup-example' first."
+ print "ERROR - no config.txt file in the current directory. \n\nAre you sure this directory is a valid psiTurk experiment? If you are starting a new project run 'psiturk-setup-example' first."
exit()
self.localParser.read( self.localFile)
if not os.path.exists(self.globalFile): | typo (closes #<I>) |
diff --git a/git/util.py b/git/util.py
index <HASH>..<HASH> 100644
--- a/git/util.py
+++ b/git/util.py
@@ -20,7 +20,6 @@ import shutil
import stat
from sys import maxsize
import time
-from unittest import SkipTest
from urllib.parse import urlsplit, urlunsplit
import warnings
@@ -130,6 +129,7 @@ def rmtree(path: PathLike) -> None:
func(path) # Will scream if still not possible to delete.
except Exception as ex:
if HIDE_WINDOWS_KNOWN_ERRORS:
+ from unittest import SkipTest
raise SkipTest("FIXME: fails with: PermissionError\n {}".format(ex)) from ex
raise | import unittest adds <I>s to script launch time
This should not be imported at root level, since it adds a lot of initialization overhead without need. |
diff --git a/src/Malenki/Bah/S.php b/src/Malenki/Bah/S.php
index <HASH>..<HASH> 100644
--- a/src/Malenki/Bah/S.php
+++ b/src/Malenki/Bah/S.php
@@ -216,7 +216,6 @@ class S extends O implements \Countable, \IteratorAggregate
'r',
'first',
'last',
- 'a', //DEPRECATED to delete
'trans',
'rtl',
'ltr',
@@ -492,21 +491,6 @@ class S extends O implements \Countable, \IteratorAggregate
}
- // TODO Deprecated? Or must create `to_a`? Must use chunk feature as ref.
- protected function _a()
- {
- $a = new A();
- $i = new N(0);
-
- while ($i->less($this->_length())) {
- $a->add($this->sub($i->value));
- $i->incr;
- }
-
- return $a;
- }
-
-
protected function _trans()
{ | Class S: removed deprecated method |
diff --git a/environs/ec2/ec2.go b/environs/ec2/ec2.go
index <HASH>..<HASH> 100644
--- a/environs/ec2/ec2.go
+++ b/environs/ec2/ec2.go
@@ -419,7 +419,9 @@ func (e *environ) Destroy(insts []environs.Instance) error {
if err != nil {
return err
}
- // take an immutable reference to the current Storage
+ // to properly observe e.storageUnlocked we need to get it's value while
+ // holding e.configMutex. e.Storage() does this for us, then we convert
+ // back to the (*storage) to access the private deleteAll() method.
st := e.Storage().(*storage)
err = st.deleteAll()
if err != nil {
diff --git a/environs/interface.go b/environs/interface.go
index <HASH>..<HASH> 100644
--- a/environs/interface.go
+++ b/environs/interface.go
@@ -131,11 +131,13 @@ type Environ interface {
Instances(ids []string) ([]Instance, error)
// Storage returns storage specific to the environment.
- // The reference returned is immutable with respect to SetConfig.
+ // The configuration of the Storage returned is unaffected by
+ // subsiquent calls to SetConfig.
Storage() Storage
// PublicStorage returns storage shared between environments.
- // The reference returned is immutable with respect to SetConfig.
+ // The configuration of the Storage returned is unaffected by
+ // subsiquent calls to SetConfig.
PublicStorage() StorageReader
// Destroy shuts down all known machines and destroys the | responding to review comments; some wordsmithing |
diff --git a/lib/docker-sync/sync_strategy/unison.rb b/lib/docker-sync/sync_strategy/unison.rb
index <HASH>..<HASH> 100644
--- a/lib/docker-sync/sync_strategy/unison.rb
+++ b/lib/docker-sync/sync_strategy/unison.rb
@@ -158,7 +158,7 @@ module Docker_Sync
end
def get_host_port(container_name, container_port)
- cmd = 'docker inspect --format=" {{ .NetworkSettings.Ports }} " ' + container_name + ' | sed -r "s/.*map\[' + container_port + '[^ ]+\s([0-9]+).*/\1/"'
+ cmd = 'docker inspect --format=" {{ .NetworkSettings.Ports }} " ' + container_name + ' | /usr/bin/sed -E "s/.*map\[' + container_port + '[^ ]+ ([0-9]*)[^0-9].*/\1/"'
say_status 'command', cmd, :white if @options['verbose']
stdout, stderr, exit_status = Open3.capture3(cmd)
if not exit_status.success? | [BUGFIX] Unison reports too many roots
- PB: the sed expression to grab the used port in container is not
compatible with the default sed binary.
- FIX: force the use of the default sed binary /usr/bin/sed and update
the regexp accordingly |
diff --git a/hgvs/validator.py b/hgvs/validator.py
index <HASH>..<HASH> 100644
--- a/hgvs/validator.py
+++ b/hgvs/validator.py
@@ -96,7 +96,7 @@ class ExtrinsicValidator():
var_ref_seq = None
if var.posedit.edit.type == 'dup':
# Handle Dup and NADupN objects.
- var_ref_seq = getattr(var.posedit.edit, 'seq', None)
+ var_ref_seq = getattr(var.posedit.edit, 'ref', None)
else:
# use reference sequence of original variant, even if later converted (eg c_to_n)
if var.posedit.pos.start.offset != 0 or var.posedit.pos.end.offset != 0: | fixed missed seq/ref substitution in validator.py |
diff --git a/addon/file.js b/addon/file.js
index <HASH>..<HASH> 100644
--- a/addon/file.js
+++ b/addon/file.js
@@ -139,10 +139,11 @@ export default Ember.Object.extend({
});
let request = new HTTPRequest();
+ request.open(options.method, options.url);
+
Object.keys(options.headers).forEach(function (key) {
request.setRequestHeader(key, options.headers[key]);
});
- request.open(options.method, options.url);
if (options.timeout) {
request.timeout = options.timeout; | set headers after opening the XMLHttpRequest |
diff --git a/ggplot/utils/utils.py b/ggplot/utils/utils.py
index <HASH>..<HASH> 100644
--- a/ggplot/utils/utils.py
+++ b/ggplot/utils/utils.py
@@ -504,7 +504,7 @@ def remove_missing(df, na_rm=False, vars=None, name='', finite=False):
if finite:
lst = [np.inf, -np.inf]
- to_replace = dict((v, lst) for v in vars)
+ to_replace = {v: lst for v in vars}
df.replace(to_replace, np.nan, inplace=True)
txt = 'non-finite'
else:
@@ -514,7 +514,7 @@ def remove_missing(df, na_rm=False, vars=None, name='', finite=False):
df.reset_index(drop=True, inplace=True)
if len(df) < n and not na_rm:
msg = '{} : Removed {} rows containing {} values.'
- gg_warn(msg.format(name, n-len(df), txt))
+ gg_warn(msg.format(name, n-len(df), txt), stacklevel=3)
return df | Accurate file & line no. for missing values |
diff --git a/lib/dashboard/public/single_instances.js b/lib/dashboard/public/single_instances.js
index <HASH>..<HASH> 100644
--- a/lib/dashboard/public/single_instances.js
+++ b/lib/dashboard/public/single_instances.js
@@ -19,6 +19,10 @@ document.addEventListener('DOMContentLoaded', () => {
continue;
}
+ if (!newVal[url]) {
+ return;
+ }
+
const siEl = document.createElement('ncg-single-instance');
siEl.url = url;
instancesList.appendChild(siEl); | fix(single_instance): fix "Kill" buttons always being visible, even if no instance was open |
diff --git a/src/views/generators/seeder.blade.php b/src/views/generators/seeder.blade.php
index <HASH>..<HASH> 100644
--- a/src/views/generators/seeder.blade.php
+++ b/src/views/generators/seeder.blade.php
@@ -56,7 +56,7 @@ class LaratrustSeeder extends Seeder
$this->command->info("Creating '{$key}' user");
// Create default user for each role
$user = \{{ $user }}::create([
- 'name' => ucfirst($key),
+ 'name' => ucwords(str_replace("_", " ", $key)),
'email' => $key.'@app.com',
'password' => bcrypt('password'),
'remember_token' => str_random(10),
@@ -71,7 +71,7 @@ class LaratrustSeeder extends Seeder
$permissions = explode(',', $value);
// Create default user for each permission set
$user = \{{ $user }}::create([
- 'name' => ucfirst($key),
+ 'name' => ucwords(str_replace("_", " ", $key)),
'email' => $key.'@app.com',
'password' => bcrypt('password'),
'remember_token' => str_random(10), | Changes mentioned in #<I> |
diff --git a/parse.go b/parse.go
index <HASH>..<HASH> 100644
--- a/parse.go
+++ b/parse.go
@@ -81,7 +81,7 @@ func (p *parser) next() item {
}
func (p *parser) bug(format string, v ...interface{}) {
- log.Fatalf("BUG: %s\n\n", fmt.Sprintf(format, v...))
+ log.Panicf("BUG: %s\n\n", fmt.Sprintf(format, v...))
}
func (p *parser) expect(typ itemType) item { | Panic instead of os.Exit for illegal state situations in parser
Fixes #<I> |
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -1638,3 +1638,47 @@ test('dyadic ternary but(pref-0i1)', (t) => {
t.end();
});
+
+test('unary ternary instructions', (t) => {
+ const cpu = CPU();
+ let lines = [
+ 'LDA #%i010i',
+ 'STI A',
+ 'CMP #%10i01',
+ 'BNE fail',
+
+ 'LDA #%i010i',
+ 'PTI A',
+ 'CMP #%11i11',
+ 'BNE fail',
+
+ 'LDA #%i010i',
+ 'NTI A',
+ 'CMP #%1iii1',
+ 'BNE fail',
+
+ 'LDA #%i010i',
+ 'FD A',
+ 'CMP #%00100',
+ 'BNE fail',
+
+ 'LDA #%i010i',
+ 'RD A',
+ 'CMP #%i000i',
+ 'BNE fail',
+
+ 'HALTZ',
+
+ 'fail:',
+ 'HALTN',
+ ];
+
+ const machine_code = assembler(lines);
+
+ console.log(machine_code);
+ cpu.memory.writeArray(0, machine_code);
+ cpu.run();
+ t.equal(cpu.flags.H, 0);
+
+ t.end();
+}); | Add test for unary ternary instructions: STI, PTI, NTI, FD, and RD |
diff --git a/lang/en/langconfig.php b/lang/en/langconfig.php
index <HASH>..<HASH> 100644
--- a/lang/en/langconfig.php
+++ b/lang/en/langconfig.php
@@ -29,7 +29,7 @@ $string['decsep'] = '.';
$string['firstdayofweek'] = '0';
$string['iso6391'] = 'en';
$string['iso6392'] = 'eng';
-$string['labelsep'] = ' ';
+$string['labelsep'] = ': ';
$string['listsep'] = ',';
$string['locale'] = 'en_AU.UTF-8';
$string['localewin'] = 'English_Australia.1252';
diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php
index <HASH>..<HASH> 100644
--- a/lib/outputcomponents.php
+++ b/lib/outputcomponents.php
@@ -1373,6 +1373,8 @@ class html_writer {
$text = trim($text);
$label = self::tag('label', $text, $attributes);
+ /*
+ // TODO $colonize disabled for now yet - see MDL-12192 for details
if (!empty($text) and $colonize) {
// the $text may end with the colon already, though it is bad string definition style
$colon = get_string('labelsep', 'langconfig');
@@ -1386,6 +1388,7 @@ class html_writer {
}
}
}
+ */
return $label;
} | MDL-<I> temporarily disabled support for colonized labels
The code must be fixed so that the colon is not displayed when the label
is hidden by accessibility CSS. |
diff --git a/eventsourcing/application.py b/eventsourcing/application.py
index <HASH>..<HASH> 100644
--- a/eventsourcing/application.py
+++ b/eventsourcing/application.py
@@ -130,7 +130,7 @@ class NotificationLog(ABC):
@abstractmethod
def select(self, start: int, limit: int) -> List[Notification]:
"""
- Returns a list of class:`~eventsourcing.persistence.Notification` objects.
+ Returns a list of :class:`~eventsourcing.persistence.Notification` objects.
""" | Fixed class ref in docs. |
diff --git a/tests/unit/utils/vt_test.py b/tests/unit/utils/vt_test.py
index <HASH>..<HASH> 100644
--- a/tests/unit/utils/vt_test.py
+++ b/tests/unit/utils/vt_test.py
@@ -16,7 +16,7 @@ import random
import subprocess
# Import Salt Testing libs
-from salttesting import TestCase
+from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../') | Add skipIf import to fix the <I> tests |
diff --git a/test/unittests.js b/test/unittests.js
index <HASH>..<HASH> 100644
--- a/test/unittests.js
+++ b/test/unittests.js
@@ -55,8 +55,8 @@ describe('Unit Tests', function () {
});
}
+ require('./worker')();
require('./crypto')();
require('./general')();
- require('./worker')();
require('./security')();
}); | CI: run worker tests first to give enough time to download the required scripts (#<I>)
This should fix issues with Safari <I> not managing to load the worker in BrowserStack Automate. |
diff --git a/HTML/Auto.py b/HTML/Auto.py
index <HASH>..<HASH> 100644
--- a/HTML/Auto.py
+++ b/HTML/Auto.py
@@ -33,5 +33,5 @@ class Tag:
self.hash = hash
self.sorted = sorted
- def tag( params={} ):
+ def tag( self, params={} ):
return "<html />" | tag() needs self as 1st arg |
diff --git a/lib/paymill.rb b/lib/paymill.rb
index <HASH>..<HASH> 100644
--- a/lib/paymill.rb
+++ b/lib/paymill.rb
@@ -51,13 +51,15 @@ module Paymill
https_request = case http_method
when :post
Net::HTTP::Post.new(url)
+ when :put
+ Net::HTTP::Put.new(url)
when :delete
Net::HTTP::Delete.new(url)
else
Net::HTTP::Get.new(url)
end
https_request.basic_auth(api_key, "")
- https_request.set_form_data(data) if http_method == :post
+ https_request.set_form_data(data) if [:post, :put].include? http_method
@response = https.request(https_request)
end
raise AuthenticationError if @response.code.to_i == 401 | dangerous mock tests are dangerous. time for webmock, fakeweb or vcr style integration tests. |
diff --git a/libraries/joomla/database/database/mysql.php b/libraries/joomla/database/database/mysql.php
index <HASH>..<HASH> 100644
--- a/libraries/joomla/database/database/mysql.php
+++ b/libraries/joomla/database/database/mysql.php
@@ -175,6 +175,44 @@ class JDatabaseMySQL extends JDatabase
}
/**
+ * Gets an exporter class object.
+ *
+ * @return JDatbaseMySqlExporter An exporter object.
+ * @since 11.1
+ */
+ public function getExporter()
+ {
+ // Lazy load the exporter class.
+ if (!class_exists('JDatbaseMySqlExporter')) {
+ require dirname(__FILE__).'/mysqlexporter.php';
+ }
+
+ $o = new JDatbaseMySqlImporter;
+ $o->setDbo($this);
+
+ return $o;
+ }
+
+ /**
+ * Gets an exporter class object.
+ *
+ * @return JDatbaseMySqlImporter An importer object.
+ * @since 11.1
+ */
+ public function getImporter()
+ {
+ // Lazy load the importer class.
+ if (!class_exists('JDatbaseMySqlImporter')) {
+ require dirname(__FILE__).'/mysqlimporter.php';
+ }
+
+ $o = new JDatbaseMySqlImporter;
+ $o->setDbo($this);
+
+ return $o;
+ }
+
+ /**
* Execute the query
*
* @return mixed A database resource if successful, FALSE if not. | Add getExporter and getImporter methods to lazy load the respective helpers classes. |
diff --git a/client/modules/Weather.py b/client/modules/Weather.py
index <HASH>..<HASH> 100644
--- a/client/modules/Weather.py
+++ b/client/modules/Weather.py
@@ -76,12 +76,18 @@ def handle(text, mic, profile):
for entry in forecast:
try:
date_desc = entry['title'].split()[0].strip().lower()
+ if date_desc == 'forecast': #For global forecasts
+ date_desc = entry['title'].split()[2].strip().lower()
+ weather_desc = entry['summary']
- weather_desc = entry['summary'].split('-')[1]
+ elif date_desc == 'current': #For first item of global forecasts
+ continue
+ else:
+ weather_desc = entry['summary'].split('-')[1] #US forecasts
if weekday == date_desc:
output = date_keyword + \
- ", the weather will be" + weather_desc + "."
+ ", the weather will be " + weather_desc + "."
break
except:
continue | Weather module parses global forecasts correctly
The weather module now checks to see if it is a global forecast, as the
parsing needs to be slightly different if so |
diff --git a/testing/wd_wrapper.py b/testing/wd_wrapper.py
index <HASH>..<HASH> 100644
--- a/testing/wd_wrapper.py
+++ b/testing/wd_wrapper.py
@@ -25,7 +25,7 @@ class WorkDir:
return do(cmd, self.cwd)
- def write(self, name: str, content: "str | bytes", /, **kw: object) -> Path:
+ def write(self, name: str, content: "str | bytes", **kw: object) -> Path:
path = self.cwd / name
if kw:
assert isinstance(content, str) | restore python <I> support |
diff --git a/lib/chrome/websockets.js b/lib/chrome/websockets.js
index <HASH>..<HASH> 100644
--- a/lib/chrome/websockets.js
+++ b/lib/chrome/websockets.js
@@ -23,11 +23,13 @@ module.exports = function(tab) {
ws.on('open', () => {
resolve(chrome)
- chrome.send('Page.addScriptToEvaluateOnLoad', {
- scriptSource: contextMenuWarning()
- })
- chrome.send('Page.enable', () =>
- chrome.send('Debugger.enable', () => chrome.emit('Started'))
+ chrome.send('Page.disable', () => chrome.send('Debugger.disable', () =>
+ chrome.send('Page.enable', () => chrome.send('Debugger.enable', () => {
+ chrome.emit('Started')
+ chrome.send('Runtime.evaluate', {
+ expression: contextMenuWarning()
+ })
+ })))
)
}) | Reenable page and debugger to make scriptParsed fire |
diff --git a/test/specs/Routine.spec.js b/test/specs/Routine.spec.js
index <HASH>..<HASH> 100644
--- a/test/specs/Routine.spec.js
+++ b/test/specs/Routine.spec.js
@@ -1,6 +1,6 @@
/* global describe, it, beforeEach */
-import Routine from '../../lib/Routine';
+import Routine from '../../src/Routine';
import {expect, assert} from 'chai';
import {
diff --git a/test/specs/ensureThat.spec.js b/test/specs/ensureThat.spec.js
index <HASH>..<HASH> 100644
--- a/test/specs/ensureThat.spec.js
+++ b/test/specs/ensureThat.spec.js
@@ -1,6 +1,6 @@
/* global describe, it, beforeEach */
-import Routine, {ensureThat} from '../../lib/Routine';
+import Routine, {ensureThat} from '../../src/Routine';
import {expect} from 'chai';
import { | use src instead of lib files in tests (#5) |
diff --git a/lib/yard/server/commands/library_command.rb b/lib/yard/server/commands/library_command.rb
index <HASH>..<HASH> 100644
--- a/lib/yard/server/commands/library_command.rb
+++ b/lib/yard/server/commands/library_command.rb
@@ -60,9 +60,12 @@ module YARD
def initialize_gem
@gem = true
self.yardoc_file = Registry.yardoc_file_for_gem(library)
- return unless yardoc_file
- # Build gem docs on demand
- CLI::Gems.run(library) unless File.directory?(yardoc_file)
+ unless yardoc_file && File.directory?(yardoc_file)
+ # Build gem docs on demand
+ log.debug "Building gem docs for #{library}"
+ CLI::Gems.run(library)
+ self.yardoc_file = Registry.yardoc_file_for_gem(library)
+ end
spec = Gem.source_index.find_name(library).first
self.library_path = spec.full_gem_path
end | Fix on-demand building of gems |
diff --git a/lib/neo4j/tasks/neo4j_server.rb b/lib/neo4j/tasks/neo4j_server.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/tasks/neo4j_server.rb
+++ b/lib/neo4j/tasks/neo4j_server.rb
@@ -62,13 +62,12 @@ namespace :neo4j do
end
def install_location(args)
- "neo4j-#{get_environment(args)}"
+ FileUtils.mkdir_p('db') unless File.directory?('db')
+ "db/neo4j-#{get_environment(args)}"
end
desc "Install Neo4j, example neo4j:install[community-2.1.3,development]"
task :install, :edition, :environment do |_, args|
- args.with_defaults(:edition => "community")
-
file = args[:edition]
environment = get_environment(args)
puts "Installing Neo4j-#{file} environment: #{environment}"
@@ -77,7 +76,7 @@ namespace :neo4j do
if OS::Underlying.windows?
# Extract and move to neo4j directory
- unless File.exist?('neo4j')
+ unless File.exist?(install_location(args))
Zip::ZipFile.open(downloaded_file) do |zip_file|
zip_file.each do |f|
f_path=File.join(".", f.name) | Changed rake task so that it installs database in db folder |
diff --git a/myanimelist/media_list.py b/myanimelist/media_list.py
index <HASH>..<HASH> 100644
--- a/myanimelist/media_list.py
+++ b/myanimelist/media_list.py
@@ -38,7 +38,7 @@ class MediaList(Base, collections.Mapping):
def __init__(self, session, user_name):
super(MediaList, self).__init__(session)
self.username = user_name
- if not isinstance(self.username, unicode) or len(self.username) < 2:
+ if not isinstance(self.username, unicode) or len(self.username) < 1:
raise InvalidMediaListError(self.username)
self._list = None
self._stats = None
diff --git a/myanimelist/user.py b/myanimelist/user.py
index <HASH>..<HASH> 100644
--- a/myanimelist/user.py
+++ b/myanimelist/user.py
@@ -58,7 +58,7 @@ class User(Base):
"""
super(User, self).__init__(session)
self.username = username
- if not isinstance(self.username, unicode) or len(self.username) < 2:
+ if not isinstance(self.username, unicode) or len(self.username) < 1:
raise InvalidUserError(self.username)
self._picture = None
self._favorite_anime = None | Actually, one-letter names exist, too. |
diff --git a/openquake/engine/calculators/risk/scenario_risk/core.py b/openquake/engine/calculators/risk/scenario_risk/core.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/calculators/risk/scenario_risk/core.py
+++ b/openquake/engine/calculators/risk/scenario_risk/core.py
@@ -45,7 +45,6 @@ def scenario(workflow, getter, outputdict, params, monitor):
:param monitor:
A monitor instance
"""
- assets = getter.assets
hazards = getter.get_data()
epsilons = getter.get_epsilons()
agg, ins = {}, {}
@@ -54,6 +53,12 @@ def scenario(workflow, getter, outputdict, params, monitor):
outputdict = outputdict.with_args(
loss_type=loss_type, output_type="loss_map")
+ # ignore assets with missing costs
+ masked = [a.value(loss_type) is None for a in getter.assets]
+ assets = numpy.ma.masked_values(getter.assets, masked)
+ hazards = numpy.ma.masked_values(hazards, masked)
+ if all(masked):
+ continue
(assets, loss_ratio_matrix, aggregate_losses,
insured_loss_matrix, insured_losses) = workflow(
loss_type, assets, hazards, epsilons) | Moved the mask for arrays with missing costs in the engine |
diff --git a/modules/backend/formwidgets/PermissionEditor.php b/modules/backend/formwidgets/PermissionEditor.php
index <HASH>..<HASH> 100644
--- a/modules/backend/formwidgets/PermissionEditor.php
+++ b/modules/backend/formwidgets/PermissionEditor.php
@@ -55,11 +55,29 @@ class PermissionEditor extends FormWidgetBase
*/
public function getSaveValue($value)
{
- if (is_array($value)) {
- return $value;
+ $newPermissions = is_array($value) ? array_map('intval', $value) : [];
+
+ if (!empty($newPermissions)) {
+ $existingPermissions = $this->model->permissions;
+
+ $allowedPermissions = array_map(function ($permissionObject) {
+ return $permissionObject->code;
+ }, array_flatten($this->getFilteredPermissions()));
+
+ foreach ($newPermissions as $permission => $code) {
+ if ($code === 0) {
+ continue;
+ }
+
+ if (in_array($permission, $allowedPermissions)) {
+ $existingPermissions[$permission] = $code;
+ }
+ }
+
+ $newPermissions = $existingPermissions;
}
- return [];
+ return $newPermissions;
}
/** | Prevent privilege escalation from crafted requests
Follow up to <URL> |
diff --git a/packages/components/bolt-accordion/accordion.schema.js b/packages/components/bolt-accordion/accordion.schema.js
index <HASH>..<HASH> 100644
--- a/packages/components/bolt-accordion/accordion.schema.js
+++ b/packages/components/bolt-accordion/accordion.schema.js
@@ -22,6 +22,7 @@ module.exports = {
title: 'no_separator (twig) / no-separator (web component)',
description: 'Hides the separator in between items.',
default: false,
+ enum: [true, false],
},
box_shadow: {
type: 'boolean', | DS-<I>: Add bool enum back in, to be addressed in separate PR |
diff --git a/endless_pagination/models.py b/endless_pagination/models.py
index <HASH>..<HASH> 100644
--- a/endless_pagination/models.py
+++ b/endless_pagination/models.py
@@ -234,3 +234,7 @@ class PageList(utils.UnicodeMixin):
self._page.next_page_number(),
label=settings.NEXT_LABEL)
return ''
+
+ def paginated(self):
+ """Return True if this page list contains more than one page."""
+ return len(self) > 1
diff --git a/endless_pagination/tests/test_models.py b/endless_pagination/tests/test_models.py
index <HASH>..<HASH> 100644
--- a/endless_pagination/tests/test_models.py
+++ b/endless_pagination/tests/test_models.py
@@ -113,6 +113,14 @@ class PageListTest(TestCase):
# Ensure the length of the page list equals the number of pages.
self.assertEqual(self.paginator.num_pages, len(self.pages))
+ def test_paginated(self):
+ # Ensure the *paginated* method returns True if the page list contains
+ # more than one page, False otherwise.
+ page = DefaultPaginator(range(10), 10).page(1)
+ pages = models.PageList(self.request, page, self.page_label)
+ self.assertFalse(pages.paginated())
+ self.assertTrue(self.pages.paginated())
+
def test_first_page(self):
# Ensure the attrs of the first page are correctly defined.
page = self.pages.first() | Implemented and tested the PageList.paginated method. |
diff --git a/asset_allocation/loader.py b/asset_allocation/loader.py
index <HASH>..<HASH> 100644
--- a/asset_allocation/loader.py
+++ b/asset_allocation/loader.py
@@ -34,7 +34,7 @@ class AssetAllocationLoader:
cash_root_name = cfg.get(ConfigKeys.cash_root)
# Load cash from all accounts under the root.
gc_db = self.config.get(ConfigKeys.gnucash_book_path)
- with open_book(gc_db, open_if_lock=False) as book:
+ with open_book(gc_db, open_if_lock=True) as book:
svc = AccountsAggregate(book)
root_account = svc.get_by_fullname(cash_root_name)
acct_svc = AccountAggregate(book, root_account)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,7 @@ setup(
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
- version='1.2.2', # Required
+ version='1.2.3', # Required
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field: | allow opening gnucash book even if open in gnucash application.
<I> |
diff --git a/mod/quiz/review.php b/mod/quiz/review.php
index <HASH>..<HASH> 100644
--- a/mod/quiz/review.php
+++ b/mod/quiz/review.php
@@ -38,6 +38,7 @@
require_login($course->id, false, $cm);
$isteacher = isteacher($course->id);
+ $options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
$popup = $isteacher ? 0 : $quiz->popup; // Controls whether this is shown in a javascript-protected window.
if (!$isteacher) {
@@ -232,7 +233,6 @@
$number++; // Just guessing that the missing question would have lenght 1
continue;
}
- $options = quiz_get_reviewoptions($quiz, $attempt, $isteacher);
$options->validation = QUESTION_EVENTVALIDATE === $states[$i]->event;
$options->history = ($isteacher and !$attempt->preview) ? 'all' : 'graded';
// Print the question | mod/quiz/review quiz options loaded once per pageload, not once per qn.
Moved loading of quiz review options from loop iterating over each qn to be
displayed, to the top of the pageload. Should give efficency gains
on quizes with long pages, as well as making the options available
earlier in the process.
Credit: Peter Bulmer <EMAIL> |
diff --git a/libinput/constant.py b/libinput/constant.py
index <HASH>..<HASH> 100755
--- a/libinput/constant.py
+++ b/libinput/constant.py
@@ -145,7 +145,8 @@ class EventType(Enum):
if self in {type(self).GESTURE_SWIPE_BEGIN, type(self).GESTURE_SWIPE_END,
type(self).GESTURE_SWIPE_UPDATE, type(self).GESTURE_PINCH_BEGIN,
- type(self).GESTURE_PINCH_UPDATE, type(self).GESTURE_PINCH_END}:
+ type(self).GESTURE_PINCH_UPDATE, type(self).GESTURE_PINCH_END,
+ type(self).GESTURE_HOLD_END,type(self).GESTURE_HOLD_BEGIN}:
return True
else:
return False | Add the GESTURE_HOLD_START and GESTURE_HOLD_END to the is_gesture method. |
diff --git a/src/main/java/org/fxmisc/wellbehaved/event/EventHandlerHelper.java b/src/main/java/org/fxmisc/wellbehaved/event/EventHandlerHelper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fxmisc/wellbehaved/event/EventHandlerHelper.java
+++ b/src/main/java/org/fxmisc/wellbehaved/event/EventHandlerHelper.java
@@ -165,6 +165,17 @@ public final class EventHandlerHelper<T extends Event> {
}
}
+ public static <T extends Event> void installAfter(
+ ObjectProperty<EventHandler<? super T>> handlerProperty,
+ EventHandler<? super T> handler) {
+ EventHandler<? super T> oldHandler = handlerProperty.get();
+ if(oldHandler != null) {
+ handlerProperty.set(EventHandlerHelper.chain(oldHandler, handler));
+ } else {
+ handlerProperty.set(handler);
+ }
+ }
+
public static <T extends Event> void remove(
ObjectProperty<EventHandler<? super T>> handlerProperty,
EventHandler<? super T> handler) { | Add EventHandlerHelper.installAfter method
to install an event handler with the lowest priority. |
diff --git a/tilequeue/queue/file.py b/tilequeue/queue/file.py
index <HASH>..<HASH> 100644
--- a/tilequeue/queue/file.py
+++ b/tilequeue/queue/file.py
@@ -6,10 +6,10 @@ class OutputFileQueue(object):
def __init__(self, fp):
self.fp = fp
- self.lock = threading.RLock()
+ self._lock = threading.RLock()
def enqueue(self, coord):
- with self.lock:
+ with self._lock:
payload = serialize_coord(coord)
self.fp.write(payload + '\n')
@@ -21,7 +21,7 @@ class OutputFileQueue(object):
return n, 0
def read(self, max_to_read=1, timeout_seconds=20):
- with self.lock:
+ with self._lock:
coords = []
for _ in range(max_to_read):
try:
@@ -36,13 +36,13 @@ class OutputFileQueue(object):
pass
def clear(self):
- with self.lock:
+ with self._lock:
self.fp.seek(0)
self.fp.truncate()
return -1
def close(self):
- with self.lock:
+ with self._lock:
remaining_queue = "".join([ln for ln in self.fp])
self.clear()
self.fp.write(remaining_queue) | Rename lock to _lock to imply that it's private.
tilequeue/queue/file.py
-The `lock` instance variable shouldn't be used outside of the
`OutputFileQueue`'s methods. |
diff --git a/services/puppetforge/puppetforge-module-pdk-version.tester.js b/services/puppetforge/puppetforge-module-pdk-version.tester.js
index <HASH>..<HASH> 100644
--- a/services/puppetforge/puppetforge-module-pdk-version.tester.js
+++ b/services/puppetforge/puppetforge-module-pdk-version.tester.js
@@ -11,7 +11,7 @@ t.create('PDK version')
})
t.create("PDK version (library doesn't use the PDK)")
- .get('/camptocamp/openssl.json')
+ .get('/puppet/yum.json')
.expectBadge({
label: 'pdk version',
message: 'none', | tests: fix failing puppet forge service test (#<I>) |
diff --git a/Entity/CountryContext.php b/Entity/CountryContext.php
index <HASH>..<HASH> 100644
--- a/Entity/CountryContext.php
+++ b/Entity/CountryContext.php
@@ -45,7 +45,7 @@ class CountryContext
/**
* @var string
- * @ORM\Column(type="simple_array")
+ * @ORM\Column(type="simple_array", nullable=true)
*/
private $countries = array(); | fix nullable state of country context |
diff --git a/tika/tika.py b/tika/tika.py
index <HASH>..<HASH> 100644
--- a/tika/tika.py
+++ b/tika/tika.py
@@ -273,6 +273,8 @@ def getRemoteFile(urlOrPath, destPath):
urlp = urlparse(urlOrPath)
if urlp.scheme == '':
return (os.path.abspath(urlOrPath), 'local')
+ elif urlp.scheme not in ('http', 'https'):
+ return (urlOrPath, 'local')
else:
filename = urlOrPath.rsplit('/',1)[1]
destPath = destPath + '/' +filename | Fix for Windows-style paths with C: schemes and so forth. Identified by <EMAIL> this closes #<I> |
diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -110,7 +110,7 @@ func NewConnection(solrUrl string) (*Connection, error) {
}
func (c *Connection) Select(selectQuery string) (*SelectResponse, error) {
- r, err := HTTPGet(fmt.Sprintf("%s/select?%s", c.url.String(), selectQuery), nil)
+ r, err := HTTPGet(fmt.Sprintf("%s/select/?%s", c.url.String(), selectQuery), nil)
if err != nil {
return nil, err
} | Adding / to select url |
diff --git a/py/testdir_multi_jvm/test_GLM_big1_nopoll.py b/py/testdir_multi_jvm/test_GLM_big1_nopoll.py
index <HASH>..<HASH> 100644
--- a/py/testdir_multi_jvm/test_GLM_big1_nopoll.py
+++ b/py/testdir_multi_jvm/test_GLM_big1_nopoll.py
@@ -47,7 +47,8 @@ class Basic(unittest.TestCase):
# if we do another poll they should be done now, and better to get it that
# way rather than the inspect (to match what simpleCheckGLM is expected
for glm in glmInitial:
- print "Checking completed job, with no polling:", glm
+ print "Checking completed job, with no polling using initial response:", h2o.dump_json(glm)
+
a = h2o.nodes[0].poll_url(glm, noPoll=True)
h2o_glm.simpleCheckGLM(self, a, 57, **kwargs) | print some extra info for debug of ec2 fail |
diff --git a/src/grid/PartGridView.php b/src/grid/PartGridView.php
index <HASH>..<HASH> 100644
--- a/src/grid/PartGridView.php
+++ b/src/grid/PartGridView.php
@@ -205,7 +205,7 @@ class PartGridView extends BoxedGridView
'filter' => false,
'format' => 'raw',
'value' => function ($model) {
- return Html::tag('nobr', Yii::$app->formatter->asDateTime($model->create_time));
+ return Html::tag('nobr', Yii::$app->formatter->asDateTime($model->selling_time));
},
],
'place' => [ | Fixed typo for `selling_time` column in PartGridView |
diff --git a/test/cmd.js b/test/cmd.js
index <HASH>..<HASH> 100644
--- a/test/cmd.js
+++ b/test/cmd.js
@@ -14,7 +14,7 @@ var validateNpmName = require('validate-npm-package-name')
var APP_START_STOP_TIMEOUT = 10000
var PKG_PATH = path.resolve(__dirname, '..', 'package.json')
var BIN_PATH = path.resolve(path.dirname(PKG_PATH), require(PKG_PATH).bin.express)
-var NPM_INSTALL_TIMEOUT = 60000
+var NPM_INSTALL_TIMEOUT = 300000 // 5 minutes
var TEMP_DIR = utils.tmpDir()
describe('express(1)', function () { | tests: increase timeout for npm install |
diff --git a/org/postgresql/core/Parser.java b/org/postgresql/core/Parser.java
index <HASH>..<HASH> 100644
--- a/org/postgresql/core/Parser.java
+++ b/org/postgresql/core/Parser.java
@@ -83,6 +83,9 @@ public class Parser {
break;
case '?':
+ if (!withParameters)
+ break;
+
nativeSql.append(aChars, fragmentStart, i - fragmentStart);
if (i + 1 < aChars.length && aChars[i + 1] == '?') /* replace ?? with ? */
{ | Replace question marks only in PreparedStatements
Question marks in the query text should be replaced with positional
parameters ($1, $2, ...) only in java.sql.PreparedStatement.
In a java.sql.Statement they should be left alone. |
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -173,6 +173,10 @@ module.exports = function(grunt) {
},
});
+ // update various components
+ grunt.registerTask( 'update:iana', ['curl:update-iana'] );
+ grunt.registerTask( 'update:html5', ['shell:update_html5'] );
+
grunt.registerTask( 'build', [
// 'wp_readme_to_markdown',
'clean:build',
@@ -198,9 +202,6 @@ module.exports = function(grunt) {
'copy',
'wp_deploy:assets'
]);
- grunt.registerTask('iana', [
- 'curl:update-iana',
- ]);
grunt.registerTask( 'default', [
'phpunit:default', | Grunt: new alias naming pattern for updating components |
diff --git a/src/Converter/BaseConverter.php b/src/Converter/BaseConverter.php
index <HASH>..<HASH> 100644
--- a/src/Converter/BaseConverter.php
+++ b/src/Converter/BaseConverter.php
@@ -20,16 +20,10 @@ abstract class BaseConverter implements EventConverterInterface
{
$q = 'MERGE (user:User {id: {user_id}})
ON CREATE SET user.login = {user_login}
- CREATE (event:GithubEvent {id: {event_id}})
- SET event.type = {event_type}, event.time = {event_time}
+ MERGE (event:GithubEvent {id: {event_id}})
+ SET event.type = {event_type}, event.time = {event_time}, user_id: {user_id}
MERGE (et:EventType {type:{event_type}})
MERGE (event)-[:EVENT_TYPE]->(et)
- WITH user, event
- OPTIONAL MATCH (user)-[r:LAST_EVENT]->(lastEvent)
- DELETE r
- MERGE (user)-[:LAST_EVENT]->(event)
- WITH user, event, collect(lastEvent) as lastEvents
- FOREACH (x in lastEvents | CREATE (event)-[:PREVIOUS_EVENT]->(x))
RETURN event';
$p = [ | simpler event, user merge io create for event |
diff --git a/robovm/src/playn/robovm/RoboAudio.java b/robovm/src/playn/robovm/RoboAudio.java
index <HASH>..<HASH> 100644
--- a/robovm/src/playn/robovm/RoboAudio.java
+++ b/robovm/src/playn/robovm/RoboAudio.java
@@ -163,6 +163,10 @@ public class RoboAudio extends AudioImpl {
}
}
+ void delete(RoboSoundOAL sound) {
+ alDeleteBuffer(sound.bufferId());
+ }
+
void setLooping(int sourceIdx, RoboSoundOAL sound, boolean looping) {
if (active[sourceIdx] == sound) {
alSourcei(sources[sourceIdx], AL_LOOPING, looping ? AL_TRUE : AL_FALSE);
diff --git a/robovm/src/playn/robovm/RoboSoundOAL.java b/robovm/src/playn/robovm/RoboSoundOAL.java
index <HASH>..<HASH> 100644
--- a/robovm/src/playn/robovm/RoboSoundOAL.java
+++ b/robovm/src/playn/robovm/RoboSoundOAL.java
@@ -68,7 +68,6 @@ public class RoboSoundOAL extends AbstractSound<Integer> {
@Override
protected void releaseImpl() {
- // TODO
- // AL.DeleteBuffer(impl);
+ audio.delete(this);
}
} | Delete OAL sounds when released. |
diff --git a/rpi-gpio.js b/rpi-gpio.js
index <HASH>..<HASH> 100755
--- a/rpi-gpio.js
+++ b/rpi-gpio.js
@@ -414,18 +414,18 @@ function createListener(channel, pin, pollers, onChange) {
var fd = fs.openSync(PATH + '/gpio' + pin + '/value', 'r+');
clearInterrupt(fd);
poller.add(fd, Epoll.EPOLLPRI);
- pollers[pin] = {
- poller: poller,
- fd: fd
- };
+ // Append ready-to-use remove function
+ pollers[pin] = function() {
+ poller.remove(fd).close();
+ }
}
function removeListener(pin, pollers) {
if (!pollers[pin]) {
return
}
- data = pollers[pin]
- data.poller.remove(data.fd).close();
+ debug('remove listener for pin %d', pin)
+ pollers[pin]()
delete pollers[pin]
} | Make pollers store a self-removal function |
diff --git a/lib/ronin/database/database.rb b/lib/ronin/database/database.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/database/database.rb
+++ b/lib/ronin/database/database.rb
@@ -262,18 +262,22 @@ module Ronin
# The given block will be ran within the context of each Database
# repository.
#
- # @return [Array<Symbol>]
- # The Database repository names that the transactions were performed
- # within.
+ # @return [Array]
+ # The results from each database transaction.
#
# @since 0.4.0
#
- def Database.each(&block)
+ def Database.map(&block)
+ results = []
+
Database.repositories.each_key do |name|
- DataMapper.repository(name,&block)
+ DataMapper.repository(name) do
+ result = block.call()
+ results << result unless result.nil?
+ end
end
- return Database.repositories.keys
+ return results
end
end
end | Renamed Database.each to Database.map.
* Choosing `map` since we're applying a block to each DataMapper
repository, and returning the accumulated results. |
diff --git a/lib/sugarcrm/finders/finder_methods.rb b/lib/sugarcrm/finders/finder_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/sugarcrm/finders/finder_methods.rb
+++ b/lib/sugarcrm/finders/finder_methods.rb
@@ -225,7 +225,7 @@ module SugarCRM; module FinderMethods
end
VALID_FIND_OPTIONS = [ :conditions, :deleted, :fields, :include, :joins, :limit, :link_fields, :offset,
- :order_by, :select, :readonly, :group, :having, :from, :lock, :query ]
+ :order_by, :select, :readonly, :group, :having, :from, :lock ]
def validate_find_options(options) #:nodoc:
options.assert_valid_keys(VALID_FIND_OPTIONS) | remove :query from VALID_OPTIONS
snuck in previously by mistake |
diff --git a/packer/multi_error.go b/packer/multi_error.go
index <HASH>..<HASH> 100644
--- a/packer/multi_error.go
+++ b/packer/multi_error.go
@@ -37,10 +37,6 @@ func MultiErrorAppend(err error, errs ...error) *MultiError {
err = new(MultiError)
}
- if err.Errors == nil {
- err.Errors = make([]error, 0, len(errs))
- }
-
err.Errors = append(err.Errors, errs...)
return err
default: | packer: no need to check if nil since we're appending to slice |
diff --git a/anonymoususage/tables/statistic.py b/anonymoususage/tables/statistic.py
index <HASH>..<HASH> 100644
--- a/anonymoususage/tables/statistic.py
+++ b/anonymoususage/tables/statistic.py
@@ -36,15 +36,7 @@ class Statistic(Table):
return self
def __sub__(self, i):
- count = self.count - i
- try:
- self.tracker.dbcon.execute("DELETE FROM {name} WHERE Count = {count}".format(name=self.name, count=count))
- self.tracker.dbcon.commit()
- except sqlite3.Error as e:
- logger.error(e)
- else:
- self.count = count
- logging.debug('{s.name} count set to {s.count}'.format(s=self))
+ self += -i
return self
def increment(self, by): | In __sub__, rather than trying to delete the row with the specific count (which may not even exist, eg doing +=5 then -= 2), add a new row with the lower count |
diff --git a/lib/plugins/thirdparty/index.js b/lib/plugins/thirdparty/index.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/thirdparty/index.js
+++ b/lib/plugins/thirdparty/index.js
@@ -6,7 +6,8 @@ const urlParser = require('url');
const DEFAULT_THIRDPARTY_PAGESUMMARY_METRICS = [
'category.*.requests.*',
- 'category.*.tools.*'
+ 'category.*.tools.*',
+ 'requests'
];
module.exports = { | Store total number of 3rd party request (#<I>) |
diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -27,10 +27,6 @@ var path = require("path"),
var unclustered = ["memory", "disk", "leveldb"];
-function warnInternalConfig(key, log) {
- log.warn("`" + key + "` is an internal config value which will be overwritten and have no effect");
-}
-
function throwInternalConfig(key, log) {
throw new Error("`" + key + "` is an internal config value and cannot be manually configured");
} | Remove dead code from lib/config.js
In particular, this brings our line coverage for this module to
<I>%. Woot woot! |
diff --git a/lib/tri/declarative/__init__.py b/lib/tri/declarative/__init__.py
index <HASH>..<HASH> 100644
--- a/lib/tri/declarative/__init__.py
+++ b/lib/tri/declarative/__init__.py
@@ -373,13 +373,13 @@ def filter_show_recursive(item):
if isinstance(item, list):
return [filter_show_recursive(v) for v in item if should_show(v)]
- if isinstance(item, set):
- return {filter_show_recursive(v) for v in item if should_show(v)}
-
if isinstance(item, dict):
# The type(item)(** stuff is to preserve the original type
return type(item)(**{k: filter_show_recursive(v) for k, v in item.items() if should_show(v)})
+ if isinstance(item, set):
+ return {filter_show_recursive(v) for v in item if should_show(v)}
+
return item | Micro-optimization: dicts are more common than sets |
diff --git a/ReText/window.py b/ReText/window.py
index <HASH>..<HASH> 100644
--- a/ReText/window.py
+++ b/ReText/window.py
@@ -458,15 +458,14 @@ class ReTextWindow(QMainWindow):
cursor.beginEditBlock()
while block != end:
cursor.setPosition(block.position())
- if self.tabInsertsSpaces:
+ if editBox.document().characterAt(cursor.position()) == '\t':
+ cursor.deleteChar()
+ else:
pos = 0
while editBox.document().characterAt(cursor.position()) == ' ' \
and pos < self.tabWidth:
pos += 1
cursor.deleteChar()
- else:
- if editBox.document().characterAt(cursor.position()) == '\t':
- cursor.deleteChar()
block = block.next()
cursor.endEditBlock() | editBoxIndentLess: correctly de-dent both tabulated and "spaced" text |
diff --git a/keanu-project/src/test/java/io/improbable/keanu/vertices/dbl/nonprobabilistic/operators/multiple/LambdaModelVertexTest.java b/keanu-project/src/test/java/io/improbable/keanu/vertices/dbl/nonprobabilistic/operators/multiple/LambdaModelVertexTest.java
index <HASH>..<HASH> 100644
--- a/keanu-project/src/test/java/io/improbable/keanu/vertices/dbl/nonprobabilistic/operators/multiple/LambdaModelVertexTest.java
+++ b/keanu-project/src/test/java/io/improbable/keanu/vertices/dbl/nonprobabilistic/operators/multiple/LambdaModelVertexTest.java
@@ -205,7 +205,7 @@ public class LambdaModelVertexTest {
NetworkSamples posteriorSamples = MetropolisHastings.withDefaultConfig(random).getPosteriorSamples(
bayesianNetwork,
inputToModel,
- 250000
+ 2500
);
double averagePosteriorInput = posteriorSamples.getDoubleTensorSamples(inputToModel).getAverages().scalar(); | Reduce number of samples to fix broken build |
diff --git a/blocks/myoverview/lang/en/block_myoverview.php b/blocks/myoverview/lang/en/block_myoverview.php
index <HASH>..<HASH> 100644
--- a/blocks/myoverview/lang/en/block_myoverview.php
+++ b/blocks/myoverview/lang/en/block_myoverview.php
@@ -63,7 +63,7 @@ $string['privacy:metadata:overviewgroupingpreference'] = 'The Course overview bl
$string['privacy:metadata:overviewpagingpreference'] = 'The Course overview block paging preference.';
$string['removefromfavourites'] = 'Unstar this course';
$string['summary'] = 'Summary';
-$string['title'] = 'Title';
+$string['title'] = 'Course name';
$string['aria:hidecourse'] = 'Hide {$a} from view';
$string['aria:showcourse'] = 'Show {$a} in view';
$string['aria:hiddencourses'] = 'Show hidden courses'; | MDL-<I> block myoverview: change title string to course
change language string for Sort by "Title" to "Course" |
diff --git a/termformat/__init__.py b/termformat/__init__.py
index <HASH>..<HASH> 100644
--- a/termformat/__init__.py
+++ b/termformat/__init__.py
@@ -7,7 +7,7 @@ __is_cython__ = False
try:
# Python 2.7
long = long
-except NameError:
+except NameError: # pragma: no cover
# Python 3.3
unicode = str
xrange = range | Disable coverage for python3 stuff |
diff --git a/container/noxfile.py b/container/noxfile.py
index <HASH>..<HASH> 100644
--- a/container/noxfile.py
+++ b/container/noxfile.py
@@ -75,7 +75,7 @@ def system(session):
session.install('-e', '.')
# Run py.test against the system tests.
- session.run('py.test', '--quiet', 'tests/system/')
+ session.run('py.test', '--quiet', 'tests/system/', *session.posargs)
@nox.session(python='3.6') | Pass posargs to py.test (#<I>) |
diff --git a/lib/segment.rb b/lib/segment.rb
index <HASH>..<HASH> 100644
--- a/lib/segment.rb
+++ b/lib/segment.rb
@@ -18,6 +18,10 @@ class Segment
response = get "active", options
Hashie::Mash.new(response)
end
+
+ def clear_rules
+ response = CreateSend.delete "/segments/#{segment_id}/rules.json", {}
+ end
def delete
response = CreateSend.delete "/segments/#{segment_id}.json", {}
diff --git a/test/segment_test.rb b/test/segment_test.rb
index <HASH>..<HASH> 100644
--- a/test/segment_test.rb
+++ b/test/segment_test.rb
@@ -33,5 +33,10 @@ class SegmentTest < Test::Unit::TestCase
@segment.delete
end
+ should "clear a segment's rules" do
+ stub_delete(@api_key, "segments/#{@segment.segment_id}/rules.json", nil)
+ @segment.clear_rules
+ end
+
end
end | Added ability to clear a segment's rules. |
diff --git a/src/Conner/Tagging/TaggingUtil.php b/src/Conner/Tagging/TaggingUtil.php
index <HASH>..<HASH> 100644
--- a/src/Conner/Tagging/TaggingUtil.php
+++ b/src/Conner/Tagging/TaggingUtil.php
@@ -4,14 +4,14 @@ use Conner\Tagging\Tag;
/**
* Utility functions to help with various tagging functionality.
- *
+ *
* @author Rob Conner <rtconner@gmail.com>
*/
class TaggingUtil {
/**
* Converts input into array
- *
+ *
* @param $tagName string or array
* @return array
*/
@@ -42,7 +42,7 @@ class TaggingUtil {
public static function slug($str) {
// Make sure string is in UTF-8 and strip invalid UTF-8 characters
- $str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
+ $str = mb_convert_encoding((string)$str, 'UTF-8');
$options = array(
'delimiter' => '-',
@@ -144,7 +144,7 @@ class TaggingUtil {
/**
* Private! Please do not call this function directly, just let the Tag library use it.
* Increment count of tag by one. This function will create tag record if it does not exist.
- *
+ *
* @param string $tagString
*/
public static function incrementCount($tagString, $tagSlug, $count) { | trying a fix for hhvm |
diff --git a/stomp/backward.py b/stomp/backward.py
index <HASH>..<HASH> 100755
--- a/stomp/backward.py
+++ b/stomp/backward.py
@@ -3,15 +3,6 @@ import sys
#
# Functions for backwards compatibility
#
-
-def get_func_argcount(func):
- """
- Return the argument count for a function
- """
- if sys.hexversion >= 0x03000000:
- return func.__code__.co_argcount
- else:
- return func.func_code.co_argcount
def input_prompt(prompt):
"""
diff --git a/stomp/connect.py b/stomp/connect.py
index <HASH>..<HASH> 100755
--- a/stomp/connect.py
+++ b/stomp/connect.py
@@ -602,15 +602,12 @@ class Connection(object):
if frame_type == 'connecting':
listener.on_connecting(self.__current_host_and_port)
continue
+ elif frame_type == 'disconnected':
+ listener.on_disconnected()
+ continue
notify_func = getattr(listener, 'on_%s' % frame_type)
- params = backward.get_func_argcount(notify_func)
- if params >= 3:
- notify_func(headers, body)
- elif params == 2:
- notify_func(headers)
- else:
- notify_func()
+ notify_func(headers, body)
def __receiver_loop(self):
""" | change listener to use consistent number of args - two |
diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Test/Case/View/ViewTest.php
+++ b/lib/Cake/Test/Case/View/ViewTest.php
@@ -21,6 +21,7 @@ App::uses('View', 'View');
App::uses('Helper', 'View');
App::uses('Controller', 'Controller');
App::uses('CacheHelper', 'View/Helper');
+App::uses('HtmlHelper', 'View/Helper');
App::uses('ErrorHandler', 'Error'); | Add missing import that causes tests to fail in isolation. |
diff --git a/addon/serializers/contributor.js b/addon/serializers/contributor.js
index <HASH>..<HASH> 100644
--- a/addon/serializers/contributor.js
+++ b/addon/serializers/contributor.js
@@ -8,11 +8,12 @@ export default OsfSerializer.extend({
serialized.data.relationships = {
users: {
data: {
- id: snapshot.record.get('userId') || snapshot.record.id.split('-')[1],
+ // TODO changeme when https://github.com/CenterForOpenScience/osf.io/pull/5824 goes in
+ id: snapshot.record.get('id') || snapshot.record.get('userId') || snapshot.record.id.split('-')[1],
type: 'users'
}
}
};
return serialized;
- },
+ }
}); | Use Contrib.id until compound ids are ready |
diff --git a/spec/unit/type/exec_spec.rb b/spec/unit/type/exec_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/type/exec_spec.rb
+++ b/spec/unit/type/exec_spec.rb
@@ -755,7 +755,7 @@ describe Puppet::Type.type(:exec) do
end
describe "when providing a umask" do
it "should fail if an invalid umask is used" do
- resource = Puppet::Type.type(:exec).new :command => "/bin/true"
+ resource = Puppet::Type.type(:exec).new :command => @command
expect { resource[:umask] = '0028'}.to raise_error(Puppet::ResourceError, /umask specification is invalid/)
expect { resource[:umask] = '28' }.to raise_error(Puppet::ResourceError, /umask specification is invalid/)
end | (maint) Fixing build error on windows caused by command with unix path |
diff --git a/lib/trace.js b/lib/trace.js
index <HASH>..<HASH> 100644
--- a/lib/trace.js
+++ b/lib/trace.js
@@ -26,7 +26,7 @@
};
getUniqueId = function () {
- var random = new Int64(Math.random() * 0x7fffffff, Math.random() * 0x100000000);
+ var random = new Int64(Math.random() * 0x80000000, Math.random() * 0x100000000);
return random.toOctetString();
}; | 0x<I> is the proper upperbound as Math.random has <I> digit precision |
diff --git a/openquake/engine/db/models.py b/openquake/engine/db/models.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/db/models.py
+++ b/openquake/engine/db/models.py
@@ -1453,11 +1453,11 @@ class Gmf(djm.Model):
"""
# a set of GMFs generate by the same SES, one per rupture
gmfset = collections.defaultdict(list) # ses_ordinal -> GMFs
- for key, value in gmf_dict.iteritems():
+ for key in sorted(gmf_dict):
imt, sa_period, sa_damping, rupture_tag = key
# using a generator here saves a lot of memory
nodes = (_GroundMotionFieldNode(gmv, _Point(x, y))
- for x, y, gmv in value)
+ for x, y, gmv in gmf_dict[key])
ses_ordinal = extract_ses_ordinal(rupture_tag)
gmfset[ses_ordinal].append(
_GroundMotionField( | Fixed an ordering issue
Former-commit-id: 1cc<I>ae<I>f<I>e<I>f5bb5f2befedebc0 |
diff --git a/bin/webpack-dev-server.js b/bin/webpack-dev-server.js
index <HASH>..<HASH> 100755
--- a/bin/webpack-dev-server.js
+++ b/bin/webpack-dev-server.js
@@ -217,9 +217,6 @@ function processOptions(wpOpt) {
process.stdin.resume();
}
- if(!options.watchDelay && !options.watchOptions) // TODO remove in next major version
- options.watchDelay = firstWpOpt.watchDelay;
-
if(!options.hot)
options.hot = argv["hot"]; | Remove deprecated `watchDelay` option that was broken anyway |
diff --git a/shim.js b/shim.js
index <HASH>..<HASH> 100644
--- a/shim.js
+++ b/shim.js
@@ -1 +1 @@
-require('./src/contra.shim.js');
+require('./contra.shim.js'); | fix broken require in shim.js |
diff --git a/bundle/Command/GenerateImageVariationsCommand.php b/bundle/Command/GenerateImageVariationsCommand.php
index <HASH>..<HASH> 100644
--- a/bundle/Command/GenerateImageVariationsCommand.php
+++ b/bundle/Command/GenerateImageVariationsCommand.php
@@ -10,14 +10,14 @@ use eZ\Publish\API\Repository\Values\Content\Query;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\SPI\Variation\VariationHandler;
use Generator;
-use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Cache\Adapter\TagAwareAdapterInterface;
+use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
-class GenerateImageVariationsCommand extends ContainerAwareCommand
+class GenerateImageVariationsCommand extends Command
{
/**
* @var \eZ\Publish\API\Repository\Repository | Command does not need to be container aware |
diff --git a/saunter/po/webdriver/page.py b/saunter/po/webdriver/page.py
index <HASH>..<HASH> 100644
--- a/saunter/po/webdriver/page.py
+++ b/saunter/po/webdriver/page.py
@@ -40,6 +40,23 @@ class Page(object):
return False
else:
return False
+
+ def wait_for_available(self, locator):
+ """
+ Synchronization to deal with elements that are present, and are visible
+
+ :raises: ElementVisiblityTimeout
+ """
+ for i in range(timeout_seconds):
+ try:
+ if self.is_element_available(locator):
+ break
+ except:
+ pass
+ time.sleep(1)
+ else:
+ raise ElementVisiblityTimeout("%s availability timed out" % locator)
+ return True
def wait_for_visible(self, locator):
""" | adding wait_for_available to the webdriver page class |
diff --git a/lib/subprocess.rb b/lib/subprocess.rb
index <HASH>..<HASH> 100644
--- a/lib/subprocess.rb
+++ b/lib/subprocess.rb
@@ -499,7 +499,7 @@ module Subprocess
@stdin.close
wait_w.delete(@stdin)
end
- input[0...written] = ''
+ input = input[written..input.length]
if input.empty?
@stdin.close
wait_w.delete(@stdin) | Make Process#communicate do less work on every iteration (#<I>)
* Make Process#communicate do less work on every iteration |
diff --git a/src/BaseRepository.php b/src/BaseRepository.php
index <HASH>..<HASH> 100644
--- a/src/BaseRepository.php
+++ b/src/BaseRepository.php
@@ -94,6 +94,10 @@ abstract class BaseRepository implements BaseRepositoryInterface
$this->onceCriteria = new Collection();
$this->activeCriteria = new Collection();
+ if ( ! is_numeric($this->perPage) || $this->perPage < 1) {
+ $this->perPage = config('repository.perPage', 1);
+ }
+
$this->makeModel();
}
@@ -233,7 +237,7 @@ abstract class BaseRepository implements BaseRepositoryInterface
public function paginate($perPage, $columns = ['*'], $pageName = 'page', $page = null)
{
if ( ! $perPage) {
- $perPage = config('repository.perPage', $this->perPage);
+ $perPage = $this->perPage;
}
return $this->query() | Falling back to configuration value if perPage property is falsy or less than 1 |
diff --git a/coursera/test/test_credentials.py b/coursera/test/test_credentials.py
index <HASH>..<HASH> 100644
--- a/coursera/test/test_credentials.py
+++ b/coursera/test/test_credentials.py
@@ -46,8 +46,8 @@ def test_get_credentials_with_invalid_netrc_raises_exception():
def test_get_credentials_with_username_and_password_given():
- username, password = credentials.get_credentials(
- username='user', password='pass')
+ username, password = credentials.get_credentials(username='user',
+ password='pass')
assert username == 'user'
assert password == 'pass'
@@ -57,8 +57,8 @@ def test_get_credentials_with_username_given(use_keyring=False):
_getpass = getpass.getpass
getpass.getpass = lambda x: 'pass'
- username, password = credentials.get_credentials(
- username='user', use_keyring=use_keyring)
+ username, password = credentials.get_credentials(username='user',
+ use_keyring=use_keyring)
assert username == 'user'
assert password == 'pass'
@@ -76,7 +76,7 @@ def test_get_credentials_with_keyring():
test_get_credentials_with_username_given(True)
# Test again, this time without getpass
- username, password = credentials.get_credentials(
- username='user', use_keyring=True)
+ username, password = credentials.get_credentials(username='user',
+ use_keyring=True)
assert username == 'user'
assert password == 'pass' | test: test_credentials: Use more natural/readable wrapping. |
diff --git a/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.js b/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.js
+++ b/packages/neos-ui-contentrepository/src/registry/NodeTypesRegistry.js
@@ -163,4 +163,17 @@ export default class NodeTypesRegistry extends SynchronousRegistry {
return viewConfiguration;
}
+
+ getInlineEditorForProperty(nodeTypeName, propertyName) {
+ const nodeType = this.get(nodeTypeName);
+
+ return $get(['properties', propertyName, 'ui', 'inline', 'editor'], nodeType) || 'ckeditor';
+ }
+
+ getInlineEditorOptionsForProperty(nodeTypeName, propertyName) {
+ const nodeType = this.get(nodeTypeName);
+
+ return $get(['properties', propertyName, 'ui', 'inline', 'editorOptions'], nodeType) ||
+ $get(['properties', propertyName, 'ui', 'aloha'], nodeType);
+ }
} | TASK: Add logic to discover arbitrary inline editors |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.