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
|
---|---|---|---|---|---|
441540a91ddf86810eef11734dfd45310103104e | diff --git a/lib/Core/Site/QueryType/CriteriaBuilder.php b/lib/Core/Site/QueryType/CriteriaBuilder.php
index <HASH>..<HASH> 100644
--- a/lib/Core/Site/QueryType/CriteriaBuilder.php
+++ b/lib/Core/Site/QueryType/CriteriaBuilder.php
@@ -167,14 +167,18 @@ final class CriteriaBuilder
private function buildLogicalNot(CriterionDefinition $definition): LogicalNot
{
$criteria = $this->build($definition->value);
+ $criterion = $this->reduceCriteria($criteria);
+ return new LogicalNot($criterion);
+ }
+
+ private function reduceCriteria(array $criteria): Criterion
+ {
if (count($criteria) === 1) {
- $criteria = reset($criteria);
- } else {
- $criteria = new LogicalAnd($criteria);
+ return reset($criteria);
}
- return new LogicalNot($criteria);
+ return new LogicalAnd($criteria);
}
/** | Extract method to get rid of else block | netgen_ezplatform-site-api | train | php |
1b7e2438133a680ee7eca7f3d85e8ecc9e81c5be | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100644
--- a/manifest.php
+++ b/manifest.php
@@ -32,7 +32,7 @@ return array(
'label' => 'Delivery core extension',
'description' => 'TAO delivery extension manges the administration of the tests',
'license' => 'GPL-2.0',
- 'version' => '8.5.0',
+ 'version' => '8.5.1',
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => array(
'tao' => '>=15.2.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -345,7 +345,7 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('7.1.0');
}
- $this->skip('7.1.0', '8.5.0');
+ $this->skip('7.1.0', '8.5.1');
}
} | Bump to version <I> | oat-sa_extension-tao-delivery | train | php,php |
7f5ad041cc26f8a0240c2efbf9be9e6bb6e4fc39 | diff --git a/lib/http-api.js b/lib/http-api.js
index <HASH>..<HASH> 100644
--- a/lib/http-api.js
+++ b/lib/http-api.js
@@ -117,13 +117,17 @@ module.exports.MatrixHttpApi.prototype = {
clearTimeout(xhr.timeout_timer);
if (!xhr.responseText) {
- cb(new Error('No response body.'));
+ var err = new Error('No response body.');
+ err.http_status = xhr.status;
+ cb(err);
return;
}
var resp = JSON.parse(xhr.responseText);
if (resp.content_uri === undefined) {
- cb(new Error('Bad response'));
+ var err = Error('Bad response');
+ err.http_status = xhr.status;
+ cb(err);
return;
} | Pass the http status out with the error so upper level can can see what went wrong. | matrix-org_matrix-js-sdk | train | js |
909dc4f7efed8293e31edc2f92b1603c1f36e65e | diff --git a/tango/test_context.py b/tango/test_context.py
index <HASH>..<HASH> 100644
--- a/tango/test_context.py
+++ b/tango/test_context.py
@@ -94,7 +94,7 @@ class DeviceTestContext(object):
nodb = "dbase=no"
command = "{0} {1} -ORBendPoint giop:tcp:{2}:{3} -file={4}"
- connect_timeout = 1.
+ connect_timeout = 3.
disconnect_timeout = connect_timeout
def __init__(self, device, device_cls=None, server_name=None,
diff --git a/tests/test_event.py b/tests/test_event.py
index <HASH>..<HASH> 100644
--- a/tests/test_event.py
+++ b/tests/test_event.py
@@ -78,7 +78,7 @@ def test_subscribe_event(event_device):
"attr", EventType.CHANGE_EVENT, callback, wait=True)
event_device.command_inout("send_event", wait=True)
# Wait for tango event
- retries = 10
+ retries = 20
for _ in range(retries):
event_device.read_attribute("state", wait=True)
if len(results) > 1: | Increase timeouts for unit-testing | tango-controls_pytango | train | py,py |
01af6da6013713918287cb032040003beb21a16a | diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -2627,6 +2627,17 @@ function authenticate_user_login($username, $password) {
}
}
}
+
+ /// Log in to a second system if necessary
+ if (!empty($CFG->sso)) {
+ include_once($CFG->dirroot .'/sso/'. $CFG->sso .'/lib.php');
+ if (function_exists('sso_user_login')) {
+ if (!sso_user_login($username, $password)) { // Perform the signon process
+ notify('Second sign-on failed');
+ }
+ }
+ }
+
return $user;
} else { | Added hooks for new SSO capability (Single-Sign-On or Second-Sign-On) | moodle_moodle | train | php |
6899900a462b5fa5e7d6e366d23f4f8c6ab9b976 | diff --git a/tftp_test.go b/tftp_test.go
index <HASH>..<HASH> 100644
--- a/tftp_test.go
+++ b/tftp_test.go
@@ -202,9 +202,6 @@ func testSendReceive(t *testing.T, client *Client, length int64) {
if err != nil {
t.Fatalf("requesting write %s: %v", filename, err)
}
- if ot, ok := writeTransfer.(OutgoingTransfer); ok {
- ot.SetSize(length)
- }
r := io.LimitReader(newRandReader(rand.NewSource(42)), length)
n, err := writeTransfer.ReadFrom(r)
if err != nil { | cleanup: SetSize does not work on client side | pin_tftp | train | go |
46c4b7b83e9e50426dfcf9c13f72ccb3ba84534a | diff --git a/views/v3/partials/sidebar.blade.php b/views/v3/partials/sidebar.blade.php
index <HASH>..<HASH> 100644
--- a/views/v3/partials/sidebar.blade.php
+++ b/views/v3/partials/sidebar.blade.php
@@ -1,9 +1,11 @@
@if(isset($id) && $id)
@php do_action('Municipio/sidebar/beforeSidebar', $id); @endphp
+ @section('sidebar.' . $id . '.before')@show
@if (is_active_sidebar($id))
<div id="sidebar-{{$id}}" class="sidebar-{{$id}} {{isset($classes) ? is_array($classes) ? implode(' ', $classes) : $classes : ''}}">
@php dynamic_sidebar($id); @endphp {{-- TODO: Move functions to Controller --}}
</div>
@endif
+ @section('sidebar.' . $id . '.after')@show
@php do_action('Municipio/sidebar/afterSidebar', $id); @endphp
@endif
\ No newline at end of file | Add before / after section to all sidebars | helsingborg-stad_Municipio | train | php |
96abf32b29fb5b1613e50404979ae4965c2656a2 | diff --git a/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java b/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java
index <HASH>..<HASH> 100644
--- a/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java
+++ b/protocols/raft/src/main/java/io/atomix/protocols/raft/roles/LeaderAppender.java
@@ -450,7 +450,7 @@ final class LeaderAppender extends AbstractAppender {
// Verify that the leader has contacted a majority of the cluster within the last two election timeouts.
// If the leader is not able to contact a majority of the cluster within two election timeouts, assume
// that a partition occurred and transition back to the FOLLOWER state.
- if (System.currentTimeMillis() - Math.max(getHeartbeatTime(), leaderTime) > raft.getElectionTimeout().toMillis() * 2) {
+ if (member.getFailureCount() >= 3 && System.currentTimeMillis() - Math.max(getHeartbeatTime(), leaderTime) > raft.getElectionTimeout().toMillis() * 2) {
log.warn("Suspected network partition. Stepping down");
raft.setLeader(null);
raft.transition(RaftServer.Role.FOLLOWER); | Wait minimum number of AppendRequest failures before detecting network partition to account for single request timeouts that are longer than the election timeout. | atomix_atomix | train | java |
3e41f772474975f8e95d45d555e37acfdef08280 | diff --git a/server/const.go b/server/const.go
index <HASH>..<HASH> 100644
--- a/server/const.go
+++ b/server/const.go
@@ -41,7 +41,7 @@ var (
const (
// VERSION is the current version for the server.
- VERSION = "2.9.0-RC.6"
+ VERSION = "2.9.0-RC.7"
// PROTO is the currently supported protocol.
// 0 was the original | Bump to <I>-RC<I> | nats-io_gnatsd | train | go |
3ba67e6c3f78c76f014d40fdf2b6aacc12ba6ac3 | diff --git a/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php b/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php
index <HASH>..<HASH> 100644
--- a/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php
+++ b/bundles/BlockManagerBundle/EventListener/LayoutResolverListener.php
@@ -50,7 +50,7 @@ class LayoutResolverListener implements EventSubscriberInterface
*/
public static function getSubscribedEvents()
{
- return array(KernelEvents::REQUEST => 'onKernelRequest');
+ return array(KernelEvents::REQUEST => array('onKernelRequest', -255));
}
/** | Make sure layout resolver listener runs last | netgen-layouts_layouts-core | train | php |
cdc0a53f92cce05bafcbc09b44be7b52a1f7485e | diff --git a/builder/vmware/common/driver_config.go b/builder/vmware/common/driver_config.go
index <HASH>..<HASH> 100644
--- a/builder/vmware/common/driver_config.go
+++ b/builder/vmware/common/driver_config.go
@@ -2,6 +2,7 @@ package common
import (
"fmt"
+ "os"
"github.com/mitchellh/packer/packer"
) | builder/vmware: fix compilation issues | hashicorp_packer | train | go |
d8062695941b0dc0fbd48007eb9c66963fe0b811 | diff --git a/lfs/credentials.go b/lfs/credentials.go
index <HASH>..<HASH> 100644
--- a/lfs/credentials.go
+++ b/lfs/credentials.go
@@ -105,6 +105,9 @@ func getCredURLForAPI(req *http.Request) (*url.URL, error) {
func fillCredentials(u *url.URL) (Creds, error) {
path := strings.TrimPrefix(u.Path, "/")
creds := Creds{"protocol": u.Scheme, "host": u.Host, "path": path}
+ if u.User != nil && u.User.Username() != "" {
+ creds["username"] = u.User.Username()
+ }
return execCreds(creds, "fill")
} | Include the username in the creds call if present
This is needed to disambiguate cases where a user has multiple usernames
on the same host. Without this the first item will be silently used
which might be wrong & cause a loop of incorrect password prompts (&
possibly a lockout on the server) | git-lfs_git-lfs | train | go |
75eda3be9f1a76073d600260669cb90299be8498 | diff --git a/broqer/hub.py b/broqer/hub.py
index <HASH>..<HASH> 100644
--- a/broqer/hub.py
+++ b/broqer/hub.py
@@ -108,7 +108,7 @@ True
import asyncio
from collections import OrderedDict
from types import MappingProxyType
-from typing import Any, Optional
+from typing import Any, Optional, Dict # noqa: F401
from broqer import Publisher, Subscriber, SubscriptionDisposable
@@ -118,6 +118,7 @@ class Topic(Publisher, Subscriber):
Publisher.__init__(self)
self._subject = None # type: Publisher
self._path = path
+ self._meta = dict() # type: Dict[str, Any]
def subscribe(self, subscriber: 'Subscriber') -> SubscriptionDisposable:
disposable = Publisher.subscribe(self, subscriber)
@@ -169,7 +170,7 @@ class Topic(Publisher, Subscriber):
@property
def meta(self) -> dict:
- return getattr(self, '_meta', None)
+ return self._meta
@property
def path(self) -> str:
@@ -231,7 +232,7 @@ class Hub:
non_keys = set(meta.keys()) - self._permitted_meta_keys
if non_keys:
raise KeyError('Not permitted meta keys: %r' % non_keys)
- setattr(topic, '_meta', meta) # ._meta is not yet existing
+ topic._meta.update(meta)
if hasattr(topic, '_assignment_future'):
topic._assignment_future.set_result(None) | add .meta to every Topic | semiversus_python-broqer | train | py |
b013b0a473d70a51f5bce15841940b23a0dca69a | diff --git a/src/Illuminate/Database/Connection.php b/src/Illuminate/Database/Connection.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Connection.php
+++ b/src/Illuminate/Database/Connection.php
@@ -658,7 +658,11 @@ class Connection implements ConnectionInterface {
{
$message = $e->getPrevious()->getMessage();
- return str_contains($message, ['server has gone away', 'no connection to the server']);
+ return str_contains($message, [
+ 'server has gone away',
+ 'no connection to the server',
+ 'Lost connection'
+ ]);
}
/** | retry on 'Lost connection' also | laravel_framework | train | php |
424165f4f2af70274d9db7c5ef2acb308f9bf9ef | diff --git a/tests/changelog.py b/tests/changelog.py
index <HASH>..<HASH> 100644
--- a/tests/changelog.py
+++ b/tests/changelog.py
@@ -108,6 +108,16 @@ class releases(Spec):
assert isinstance(entries[0], issue)
eq_(entries[0].number, None)
+ def unreleased_items_go_in_unreleased_release(self):
+ issues = [
+ _release('1.0.2'), _entry(self.f), _entry(self.b), _release('1.0.0')
+ ]
+ releases = construct_releases(issues, self.app)
+ entries = releases[-1]['entries']
+ eq_(len(entries), 1)
+ assert self.f in entries
+ eq_(releases[-1]['obj'].number, 'unreleased')
+
class nodes(Spec):
""" | Test for 'unreleased' entry | bitprophet_releases | train | py |
4f35659de31fff0452a5f295df9e117fd16a54a1 | diff --git a/gcloud/datastore/test_key.py b/gcloud/datastore/test_key.py
index <HASH>..<HASH> 100644
--- a/gcloud/datastore/test_key.py
+++ b/gcloud/datastore/test_key.py
@@ -19,8 +19,7 @@ class TestKey(unittest2.TestCase):
pb.partition_id.namespace = namespace
for elem in path:
added = pb.path_element.add()
- if 'kind' in elem:
- added.kind = elem['kind']
+ added.kind = elem['kind']
if 'id' in elem:
added.id = elem['id']
if 'name' in elem: | <I>% branch coverage for gcloud.datastore.test_key.
Don't worry about path elem w/o kind. | googleapis_google-cloud-python | train | py |
7c601adbd68e80449929de5ac58218e80758d1b1 | diff --git a/dask_ml/model_selection/utils.py b/dask_ml/model_selection/utils.py
index <HASH>..<HASH> 100644
--- a/dask_ml/model_selection/utils.py
+++ b/dask_ml/model_selection/utils.py
@@ -4,6 +4,7 @@ from distutils.version import LooseVersion
import dask
import dask.array as da
+import dask.dataframe as dd
import scipy.sparse as sp
from dask.base import tokenize
from dask.delayed import Delayed, delayed
@@ -45,7 +46,7 @@ def to_indexable(*args, **kwargs):
else:
indexable = _indexable
for x in args:
- if x is None or isinstance(x, da.Array):
+ if x is None or isinstance(x, (da.Array, dd.DataFrame)):
yield x
elif is_dask_collection(x):
yield delayed(indexable, pure=True)(x) | update indexable() to just yield dask dataframes (issue #<I>) (#<I>)
* update indexable() to just yield dask dataframes, as mentioned in issue #<I> | dask_dask-ml | train | py |
e9aa74dbf809e13aeee224ddaa135250112afa89 | diff --git a/elasticsearch_dsl/filter.py b/elasticsearch_dsl/filter.py
index <HASH>..<HASH> 100644
--- a/elasticsearch_dsl/filter.py
+++ b/elasticsearch_dsl/filter.py
@@ -80,12 +80,9 @@ class Bool(BoolMixin, Filter):
if self.should and other.should:
selfshould, othershould = self.should[:], other.should[:]
# required subfilter, move to must
- if len(selfshould) == 1:
- f.must.append(selfshould.pop())
-
- # required subfilter, move to must
- if len(othershould) == 1:
- f.must.append(othershould.pop())
+ for s in (selfshould, othershould):
+ if len(s) == 1:
+ f.must.append(s.pop())
# we have leftover lists, nothing to do but add to must as bool(should)
if selfshould and othershould: | Cleaner code for filter __and__ | elastic_elasticsearch-dsl-py | train | py |
a9dff7f2dbd15c047da05959b40556668ffea833 | diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php
index <HASH>..<HASH> 100644
--- a/src/AbstractContainer.php
+++ b/src/AbstractContainer.php
@@ -456,6 +456,8 @@ abstract class AbstractContainer implements ContainerInterface
"Missing required parameter \"$name\" when instantiating \"$class\"."
);
}
+ } if ($dependency instanceof Closure) {
+ $dependencies[$index] = call_user_func($dependency, $this);
}
} | Added resolving `Closure` dependency | yiisoft_di | train | php |
45980fe097ca43d957ab6df3f2a62eaae6ce2ad3 | diff --git a/broqer/op/_operator.py b/broqer/op/_operator.py
index <HASH>..<HASH> 100644
--- a/broqer/op/_operator.py
+++ b/broqer/op/_operator.py
@@ -1,3 +1,5 @@
+from abc import ABCMeta, abstractmethod
+
from broqer import Publisher, Subscriber, SubscriptionDisposable
@@ -23,6 +25,10 @@ class Operator(Publisher, Subscriber): # pylint: disable=abstract-method
subscriber.emit(*args, who=self) # pylint: disable=E1133
return disposable
+ @abstractmethod
+ def get(self):
+ return None
+
def unsubscribe(self, subscriber: Subscriber) -> None:
Publisher.unsubscribe(self, subscriber)
if not self._subscriptions:
@@ -57,6 +63,9 @@ class MultiOperator(Publisher, Subscriber): # pylint: disable=abstract-method
for _publisher in self._publishers:
_publisher.unsubscribe(self)
+ @abstractmethod
+ def get(self):
+ return None
def build_operator(operator_cls):
""" This function is taking an operator class and is returning a function | make get() of Operator and MultiOperator an abstractmethod to prevent wrong usage | semiversus_python-broqer | train | py |
d9df25243f6f65218b61fbd9b3878b86213399be | diff --git a/src/adapters/pouch.idb.js b/src/adapters/pouch.idb.js
index <HASH>..<HASH> 100644
--- a/src/adapters/pouch.idb.js
+++ b/src/adapters/pouch.idb.js
@@ -354,6 +354,11 @@ var IdbPouch = function(opts, callback) {
});
});
} else {
+ if (doc._attachments){
+ for (var key in doc._attachments) {
+ doc._attachments[key].stub = true;
+ }
+ }
callback(null, doc);
}
};
diff --git a/tests/test.attachments.js b/tests/test.attachments.js
index <HASH>..<HASH> 100644
--- a/tests/test.attachments.js
+++ b/tests/test.attachments.js
@@ -74,4 +74,19 @@
});
});
+ asyncTest("Test remove doc with attachment", function() {
+ initTestDB(this.name, function(err, db) {
+ db.put({ _id: 'mydoc' }, function(err, resp) {
+ db.putAttachment('mydoc/mytext', resp.rev, 'Mytext', 'text/plain', function(err, res) {
+ db.get('mydoc',{attachments:false},function(err,doc){
+ db.remove(doc, function(err, resp){
+ ok(res.ok);
+ start();
+ });
+ });
+ });
+ });
+ });
+ });
+
}); | Test and fix for removing doc with attachments (via @chendricks) | pouchdb_pouchdb | train | js,js |
5e95a6afb8043d84a4a48efb4c925d68b94fc98c | diff --git a/lib/runner.js b/lib/runner.js
index <HASH>..<HASH> 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -169,14 +169,14 @@ Object.assign(Runner.prototype, {
this.builder.emit(
'query-response',
postProcessedResponse,
- Object.assign({ __knexUid: this.connection.__knexUid }, obj),
+ Object.assign({ __knexUid, __knexTxId }, obj),
this.builder
);
this.client.emit(
'query-response',
postProcessedResponse,
- Object.assign({ __knexUid: this.connection.__knexUid }, obj),
+ Object.assign({ __knexUid, __knexTxId }, obj),
this.builder
);
@@ -230,7 +230,7 @@ Object.assign(Runner.prototype, {
this.builder.emit(
'query-error',
error,
- Object.assign({ __knexUid: this.connection.__knexUid }, obj)
+ Object.assign({ __knexUid, __knexTxId }, obj)
);
throw error;
}); | Make sure query-response and query-error events contain _knexTxId (#<I>) | tgriesser_knex | train | js |
afe8eb55887c27a59d920fd94fee814963a85c41 | diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py
index <HASH>..<HASH> 100644
--- a/tests/integration/test_model.py
+++ b/tests/integration/test_model.py
@@ -298,7 +298,7 @@ async def test_add_manual_machine_ssh(event_loop):
'name': test_name,
'source': {
'type': 'image',
- 'alias': 'xenial',
+ 'alias': 'bionic',
'mode': 'pull',
'protocol': 'simplestreams',
'server': 'https://cloud-images.ubuntu.com/releases',
@@ -354,7 +354,6 @@ async def test_add_manual_machine_ssh(event_loop):
container.stop(wait=True)
container.delete(wait=True)
-
profile.delete()
@@ -415,7 +414,7 @@ async def test_add_manual_machine_ssh_root(event_loop):
'name': test_name,
'source': {
'type': 'image',
- 'alias': 'xenial',
+ 'alias': 'bionic',
'mode': 'pull',
'protocol': 'simplestreams',
'server': 'https://cloud-images.ubuntu.com/releases', | use bionic instead of xenial on the added container
Fixes #<I> | juju_python-libjuju | train | py |
46f73c6fbd74361a39c80880fad60e9292dcb0b0 | diff --git a/lib/parser_block.js b/lib/parser_block.js
index <HASH>..<HASH> 100644
--- a/lib/parser_block.js
+++ b/lib/parser_block.js
@@ -109,17 +109,13 @@ ParserBlock.prototype.parse = function (src, options, env) {
if (!src) { return ''; }
- if (src.indexOf('\r') >= 0) {
- src = src.replace(/\r/, '');
- }
-
- if (src.indexOf('\u00a0') >= 0) {
- src = src.replace(/\u00a0/g, ' ');
- }
+ // Normalize spaces
+ src = src.replace(/\u00a0/g, ' ');
- if (src.indexOf('\u2424') >= 0) {
- src = src.replace(/\u2424/g, '\n');
- }
+ // Normalize newlines
+ src = src.replace(/\r\n/, '\n');
+ src = src.replace(/\r\u0085/, '\n');
+ src = src.replace(/[\u2424\u2028\u0085]/g, '\n');
// Replace tabs with proper number of spaces (1..4)
if (src.indexOf('\t') >= 0) { | Extended spaces & line breaks normalization | markdown-it_markdown-it | train | js |
f2a982982b581d55eeb2c128652fd048170e5a2b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -387,6 +387,7 @@ function ApostropheSchemas(options, callback) {
var results = [];
return async.eachSeries(data, function(datum, callback) {
var result = {};
+ result.id = self._apos.sanitizeId(datum.id) || self._apos.generateId();
return self.convertFields(req, schema, 'form', datum, result, function(err) {
if (err) {
return callback(err);
diff --git a/public/js/editor.js b/public/js/editor.js
index <HASH>..<HASH> 100644
--- a/public/js/editor.js
+++ b/public/js/editor.js
@@ -198,6 +198,7 @@ function AposSchemas() {
}
var result = {};
var $element = $($elements[i]);
+ result.id = $element.attr('data-id');
return self.convertFields($element, field.schema, result, function(_err) {
if (_err) {
err = _err;
@@ -381,6 +382,8 @@ function AposSchemas() {
addRemoveHandler($element);
addMoveHandler($element);
+ $element.attr('data-id', data[i].id);
+
$elements.append($element);
return self.populateFields($element, field.schema, data[i], function() {
i++; | schema properties now have a globally unique id field | apostrophecms-legacy_apostrophe-schemas | train | js,js |
de9ce5a93f2d262da86381834de7b7eba97e12ce | diff --git a/src/Mouf/Composer/ComposerService.php b/src/Mouf/Composer/ComposerService.php
index <HASH>..<HASH> 100644
--- a/src/Mouf/Composer/ComposerService.php
+++ b/src/Mouf/Composer/ComposerService.php
@@ -530,6 +530,15 @@ class ComposerService {
$moufUiFileWriter = new MoufUIFileWritter($composer);
$moufUiFileWriter->writeMoufUI();
}
+
+ /**
+ * Returns the Composer config object
+ * @param string $param
+ * @return string
+ */
+ public function getComposerConfig() {
+ return $this->getComposer()->getConfig();
+ }
}
?>
\ No newline at end of file | Adding method to fetch Composer's config in Composer service. | thecodingmachine_mouf | train | php |
dee8495e096d7fb282c86f2b753f1f03aed9a5fb | diff --git a/lib/extract.js b/lib/extract.js
index <HASH>..<HASH> 100644
--- a/lib/extract.js
+++ b/lib/extract.js
@@ -31,16 +31,9 @@ module.exports = function (archive, dest, optionspath, options) {
// When a stdout is emitted, parse each line and search for a pattern. When
// the pattern is found, extract the file (or directory) name from it and
// pass it to an array. Finally returns this array.
- // Also check if a file is extracted using an Unsupported Method of 7-Zip.
.progress(function (data) {
var entries = [];
- var isUnsupportedMethod = (data.search('Unsupported Method'))
- ? true
- : false;
- if (isUnsupportedMethod) {
- return reject(new Error('Unsupported Method'))
- }
data.split('\n').forEach(function (line) {
if (line.substr(0, 12) === 'Extracting ') { | removed unsupported method check, give error on valid archives created on same host using same binary, seems like a bug to me | quentinrossetti_node-7z | train | js |
ab16933575c31ff59472e19b9b2e3a69d289fd40 | diff --git a/lnwallet/channel.go b/lnwallet/channel.go
index <HASH>..<HASH> 100644
--- a/lnwallet/channel.go
+++ b/lnwallet/channel.go
@@ -589,9 +589,6 @@ func createCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey
commitTx := wire.NewMsgTx()
commitTx.Version = 2
commitTx.AddTxIn(fundingOutput)
- // TODO(roasbeef): we default to blocks, make configurable as part of
- // channel reservation.
- commitTx.TxIn[0].Sequence = lockTimeToSequence(false, csvTimeout)
commitTx.AddTxOut(wire.NewTxOut(int64(amountToSelf), payToUsScriptHash))
commitTx.AddTxOut(wire.NewTxOut(int64(amountToThem), payToThemScriptHash)) | lnwallet: commit tx should have final sequence num | lightningnetwork_lnd | train | go |
2c3443244d7ac848c8c72ca6c0b739e41386ab0a | diff --git a/sirmordred/_version.py b/sirmordred/_version.py
index <HASH>..<HASH> 100644
--- a/sirmordred/_version.py
+++ b/sirmordred/_version.py
@@ -1,2 +1,2 @@
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
-__version__ = "0.1.31"
+__version__ = "0.1.32" | [release] Update version number to <I> | chaoss_grimoirelab-sirmordred | train | py |
e9b4bf998a7f10695b5e1b28ce62e63075882344 | diff --git a/src/lokijs.js b/src/lokijs.js
index <HASH>..<HASH> 100644
--- a/src/lokijs.js
+++ b/src/lokijs.js
@@ -1472,12 +1472,13 @@
* @memberof LokiFsAdapter
*/
LokiFsAdapter.prototype.saveDatabase = function saveDatabase(dbname, dbstring, callback) {
+ var self = this;
var tmpdbname = dbname + '~';
this.fs.writeFile(tmpdbname, dbstring, function writeFileCallback(err) {
if (err) {
callback(new Error(err));
} else {
- this.fs.rename(tmpdbname,dbname,callback);
+ self.fs.rename(tmpdbname,dbname,callback);
}
});
}; | Fixed 'this' scoping in saveDatabase | techfort_LokiJS | train | js |
d3b4e710aae1d82f8e4c4fbb2b7575441051772e | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -85,7 +85,9 @@ export default function prepareAxios(pageResponse, axiosInstance = null) {
return targetAxios.request(newConfig);
} else {
// return an empty promise instead of making the call from the server side
- return new Promise(() => {});
+ const emptyPromise = new Promise(() => {});
+ emptyPromise.empty = true;
+ return emptyPromise;
}
} | leave a way to tell if a promise is an empty promise, just in case | BernzSed_axios-push | train | js |
d979f829e5fd30ab95ed2a0d35acf235bd7c6d3e | diff --git a/contrib/sacrebleu/sacrebleu.py b/contrib/sacrebleu/sacrebleu.py
index <HASH>..<HASH> 100755
--- a/contrib/sacrebleu/sacrebleu.py
+++ b/contrib/sacrebleu/sacrebleu.py
@@ -165,7 +165,7 @@ from collections import Counter, namedtuple
from itertools import zip_longest
from typing import List, Iterable, Tuple
-VERSION = '1.2'
+VERSION = '1.2.1'
try:
# SIGPIPE is not available on Windows machines, throwing an exception.
@@ -1340,7 +1340,6 @@ def main():
if args.score_only:
print('{:.2f}'.format(chrf))
else:
- version_str = build_signature_chrf(args, len(refs))
print('CHRF = {:.2f}'.format(chrf))
if __name__ == '__main__': | small bugfix (#<I>) | awslabs_sockeye | train | py |
9eff093c2799cad19869a215f36a2d7946d00f34 | diff --git a/src/cloudant/design_document.py b/src/cloudant/design_document.py
index <HASH>..<HASH> 100644
--- a/src/cloudant/design_document.py
+++ b/src/cloudant/design_document.py
@@ -19,11 +19,12 @@ class DesignDocument(Document):
"""
def __init__(self, cloudant_database, document_id=None):
super(DesignDocument, self).__init__(cloudant_database, document_id)
+ self.setdefault('views', {})
@property
def views(self):
"""accessor property for views dictionary"""
- return self['views']
+ return self.get('views')
def add_view(self, view_name, map_func, reduce_func=None):
""" | Fix view manipulation in DesignDocument
- Initialize views sub dict | cloudant_python-cloudant | train | py |
536d1c1acec33f299438a96a7b2c8d382a88a63c | diff --git a/lib/rb-inotify/notifier.rb b/lib/rb-inotify/notifier.rb
index <HASH>..<HASH> 100644
--- a/lib/rb-inotify/notifier.rb
+++ b/lib/rb-inotify/notifier.rb
@@ -270,11 +270,11 @@ module INotify
events = []
cookies = {}
- while ev = Event.consume(data, self)
- events << ev
- next if ev.cookie == 0
- cookies[ev.cookie] ||= []
- cookies[ev.cookie] << ev
+ while event = Event.consume(data, self)
+ events << event
+ next if event.cookie == 0
+ cookies[event.cookie] ||= []
+ cookies[event.cookie] << event
end
cookies.each {|c, evs| evs.each {|ev| ev.related.replace(evs - [ev]).freeze}}
events | Rename conflict variable with the following block
This commit removes below interpreter warning.
* warning: shadowing outer local variable | guard_rb-inotify | train | rb |
2ada4dbc4bd2c6b929395f6e3e8f382b8fef23ad | diff --git a/benchexec/tools/witness2test.py b/benchexec/tools/witness2test.py
index <HASH>..<HASH> 100644
--- a/benchexec/tools/witness2test.py
+++ b/benchexec/tools/witness2test.py
@@ -30,7 +30,7 @@ class Tool(benchexec.tools.template.BaseTool):
(https://github.com/diffblue/cprover-sv-comp/pull/14).
"""
- REQUIRED_PATHS = ['test-gen.sh', 'process_witness.py', 'TestEnvGenerator.pl']
+ REQUIRED_PATHS = ['test-gen.sh', 'process_witness.py', 'TestEnvGenerator.pl', 'pycparser-master']
def executable(self):
""" | witness2test uses pycparser
Although test-gen.sh would take care of downloading it, the container-based set up requires preparation beforehand. | sosy-lab_benchexec | train | py |
eae1014d05bc1ded3927cccdc0a21d0160a65c70 | diff --git a/slave/buildslave/bot.py b/slave/buildslave/bot.py
index <HASH>..<HASH> 100644
--- a/slave/buildslave/bot.py
+++ b/slave/buildslave/bot.py
@@ -526,6 +526,7 @@ class BuildSlave(service.MultiService):
if not self.bf.perspective:
log.msg("No active connection, shutting down NOW")
reactor.stop()
+ return
log.msg("Telling the master we want to shutdown after any running builds are finished")
d = self.bf.perspective.callRemote("shutdown") | don't assume that reactor.stop doesn't return (it does) | buildbot_buildbot | train | py |
07a7443efc448e12ee00528a9141abb821993d43 | diff --git a/lib/caruby/csv/csvio.rb b/lib/caruby/csv/csvio.rb
index <HASH>..<HASH> 100644
--- a/lib/caruby/csv/csvio.rb
+++ b/lib/caruby/csv/csvio.rb
@@ -1,6 +1,3 @@
-require 'rubygems'
-gem 'fastercsv'
-
require 'fileutils'
require 'faster_csv'
require 'caruby/util/options' | Don't need gem requires with bundle. | caruby_core | train | rb |
9bf86bf3d922a35c0dd6f38d4fdc3f96e54e9b23 | diff --git a/classes/Pods.php b/classes/Pods.php
index <HASH>..<HASH> 100644
--- a/classes/Pods.php
+++ b/classes/Pods.php
@@ -3739,10 +3739,13 @@ class Pods implements Iterator {
$field['name'] = trim( $name );
}
- $to_merge = pods_v( $field['name'], $all_fields );
+ $to_merge = $this->pod_data->get_field( $field['name'] );
if ( $to_merge ) {
$field = pods_config_merge_data( $to_merge, $field );
+
+ // Override the name field as the alias should not be used.
+ $field['name'] = $to_merge['name'];
}
// Never show the ID field.
@@ -3881,10 +3884,13 @@ class Pods implements Iterator {
$field['name'] = trim( $name );
}
- $to_merge = pods_v( $field['name'], $all_fields );
+ $to_merge = $this->pod_data->get_field( $field['name'] );
if ( $to_merge ) {
$field = pods_config_merge_data( $to_merge, $field );
+
+ // Override the name field as the alias should not be used.
+ $field['name'] = $to_merge['name'];
}
if ( pods_v( 'hidden', $field, false, true ) || 'hidden' === $field['type'] ) { | Support field aliases in form() and view() | pods-framework_pods | train | php |
8da25d79aed41865722a120ebea86a5bf4b17c5b | diff --git a/app/services/action_trigger_factory.rb b/app/services/action_trigger_factory.rb
index <HASH>..<HASH> 100644
--- a/app/services/action_trigger_factory.rb
+++ b/app/services/action_trigger_factory.rb
@@ -238,9 +238,10 @@ class ActionTriggerFactory
path_messages << c.message(text: "Hi, #{app.name} will reply as soon as they can.", uuid: 1)
end
- path_messages << route_support
-
- path_messages.flatten!
+ if user.email.blank?
+ path_messages << route_support
+ path_messages.flatten!
+ end
routing = app.lead_tasks_settings["routing"] | Update action_trigger_factory.rb
skip route support if there is an email | michelson_chaskiq | train | rb |
37c25d5c511b9222ea384fd4ea1551f06d52a09a | diff --git a/src/Jaspersoft/Service/ReportService.php b/src/Jaspersoft/Service/ReportService.php
index <HASH>..<HASH> 100644
--- a/src/Jaspersoft/Service/ReportService.php
+++ b/src/Jaspersoft/Service/ReportService.php
@@ -89,7 +89,12 @@ class ReportService extends JRSService
*/
public function getInputControlStructure($uri) {
$url = $this->service_url . '/reports' . $uri . '/inputControls';
- $data = $this->service->prepAndSend($url, array(200), 'GET', null, true);
+ $data = $this->service->prepAndSend($url, array(200, 204), 'GET', null, true);
+
+ if(!$data) {
+ return [];
+ }
+
$json_obj = json_decode($data);
$result = array(); | Fix for the case of no parameters. | Jaspersoft_jrs-rest-php-client | train | php |
8e71bde3332365ca3fa77660c94018ccbd2a4608 | diff --git a/ucms_site/src/Access.php b/ucms_site/src/Access.php
index <HASH>..<HASH> 100644
--- a/ucms_site/src/Access.php
+++ b/ucms_site/src/Access.php
@@ -53,24 +53,29 @@ final class Access
const OP_DELETE = 'delete';
/**
+ * Request new site permission
+ */
+ const PERM_SITE_REQUEST = 'site request';
+
+ /**
* User can view global labeled content permission.
*/
- const PERM_GLOBAL_LABELED_VIEW = 'view global labeled content';
+ const PERM_GLOBAL_LABELED_VIEW = 'site content labeled view';
/**
* User can view global content permission.
*/
- const PERM_GLOBAL_VIEW = 'view global content';
+ const PERM_GLOBAL_VIEW = 'site content global view';
/**
* User can edit global labeled content permission.
*/
- const PERM_GLOBAL_LABELED_EDIT = 'edit global labeled content';
+ const PERM_GLOBAL_LABELED_EDIT = 'site content labeled edit';
/**
* User can edit global content permission.
*/
- const PERM_GLOBAL_EDIT = 'edit global content';
+ const PERM_GLOBAL_EDIT = 'site content global edit';
/**
* Functional administrator role. | site: renamed permissions | makinacorpus_drupal-ucms | train | php |
3ae21f089184590c6628fc0aa568d1e611cdb869 | diff --git a/builtin/providers/aws/resource_aws_db_subnet_group.go b/builtin/providers/aws/resource_aws_db_subnet_group.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_db_subnet_group.go
+++ b/builtin/providers/aws/resource_aws_db_subnet_group.go
@@ -165,8 +165,9 @@ func resourceAwsDbSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) er
}
_, err := conn.ModifyDBSubnetGroup(&rds.ModifyDBSubnetGroupInput{
- DBSubnetGroupName: aws.String(d.Id()),
- SubnetIds: sIds,
+ DBSubnetGroupName: aws.String(d.Id()),
+ DBSubnetGroupDescription: aws.String(d.Get("description").(string)),
+ SubnetIds: sIds,
})
if err != nil { | Add the description as a part of the update request | hashicorp_terraform | train | go |
6425799d65117af84266bddcffb8c0bc2c213d29 | diff --git a/lib/vcoworkflows/vcosession.rb b/lib/vcoworkflows/vcosession.rb
index <HASH>..<HASH> 100644
--- a/lib/vcoworkflows/vcosession.rb
+++ b/lib/vcoworkflows/vcosession.rb
@@ -7,6 +7,9 @@ require 'rest_client'
module VcoWorkflows
# VcoSession
class VcoSession
+
+ attr_reader :rest_resource
+
# Initialize the session
#
# @param [String] uri URI for the vCenter Orchestrator API endpoint | Added accessor to aid unit testing | activenetwork-automation_vcoworkflows | train | rb |
9d15d4bc720a17c4701284890813d075b3172270 | diff --git a/src/hamster/db.py b/src/hamster/db.py
index <HASH>..<HASH> 100644
--- a/src/hamster/db.py
+++ b/src/hamster/db.py
@@ -479,6 +479,8 @@ class Storage(storage.Storage):
WHERE fact_id = ?"""
self.execute(tag_update, (new_fact_id, fact["id"])) #clone tags
+ trophies.unlock("split")
+
# overlap start
elif start_time < fact["start_time"] < end_time:
logging.info("Overlapping start of %s" % fact["name"])
@@ -526,6 +528,8 @@ class Storage(storage.Storage):
if not category_id:
category_id = self.__add_category(fact.category)
+ trophies.unlock("no_hands")
+
# try to find activity, resurrect if not temporary
activity_id = self.__get_activity_by_name(fact.activity,
category_id, | split and no-hands trophies | projecthamster_hamster | train | py |
f65b008c05f047dc2615438d8bf131eb326ec51f | diff --git a/pydivert/__init__.py b/pydivert/__init__.py
index <HASH>..<HASH> 100644
--- a/pydivert/__init__.py
+++ b/pydivert/__init__.py
@@ -20,7 +20,7 @@ from .packet import Packet
from .windivert import WinDivert
__author__ = 'fabio'
-__version__ = '2.0.7'
+__version__ = '2.0.8'
if _sys.version_info < (3, 4):
# add socket.inet_pton on Python < 3.4
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ workdir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(workdir, "pydivert", "__init__.py")) as fp:
__version__ = fp.read().split("__version__ = '", 1)[1].split("'", 1)[0]
-with open(os.path.join(workdir, 'README.rst'), encoding='utf-8') as f:
+with open(os.path.join(workdir, 'README.rst')) as f:
long_description = f.read()
setup( | Something goes wrong on PKG-INFO when encoding is set to UTF-8 | ffalcinelli_pydivert | train | py,py |
7d005f656b2782d6f4e231035a41757a84e7742c | diff --git a/test/ReadabilityTest.php b/test/ReadabilityTest.php
index <HASH>..<HASH> 100644
--- a/test/ReadabilityTest.php
+++ b/test/ReadabilityTest.php
@@ -115,6 +115,6 @@ class ReadabilityTest extends \PHPUnit_Framework_TestCase
$parser = new Readability(new Configuration());
$this->expectException(ParseException::class);
$this->expectExceptionMessage('Could not parse text.');
- $parser->parse('<html><body><p>hello</p></body></html>');
+ $parser->parse('<html><body><p></p></body></html>');
}
} | Fix "unable to parse" test case | andreskrey_readability.php | train | php |
7911c87c1a9de287d807b65993a4911889cc206f | diff --git a/db/doc.go b/db/doc.go
index <HASH>..<HASH> 100644
--- a/db/doc.go
+++ b/db/doc.go
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package db defines common Data Broker types, and it the parent package
-// containing Data Broker client implementations for various key-value and
-// SQL data stores.
+// Package db defines the common Data Broker types, and it is the parent
+// package for Data Broker client implementations for various key-value
+// and SQL data stores.
package db
diff --git a/httpmux/doc.go b/httpmux/doc.go
index <HASH>..<HASH> 100644
--- a/httpmux/doc.go
+++ b/httpmux/doc.go
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// Package httpmux provides a plugin that allows app plugins to
-// register and afterwords handle http requests (usually REST based).
+// Package httpmux provides an HTTP server to app plugins, where a plugin
+// can register at specified URLs one or more HTTP request handlers that
+// will handle HTTP requests at run time.
package httpmux | Editorial changes to docs.go | ligato_cn-infra | train | go,go |
4ba3b2b61b47aa3bc531245519446282edcb3fa1 | diff --git a/test/map/NearCachedMapStressTest.js b/test/map/NearCachedMapStressTest.js
index <HASH>..<HASH> 100644
--- a/test/map/NearCachedMapStressTest.js
+++ b/test/map/NearCachedMapStressTest.js
@@ -57,7 +57,7 @@ describe('NearCachedMapStress', function () {
}
it('stress test with put, get and remove', function (done) {
- this.timeout(20000);
+ this.timeout(120000);
var map = client1.getMap(mapName);
(function innerOperation() {
if (completedOperations >= totalNumOperations) { | increases timeout for near cache stress test | hazelcast_hazelcast-nodejs-client | train | js |
09e36bfeeaaca3607eb2db9611030049d824fdb1 | diff --git a/modules/social_features/social_group/src/Controller/SocialGroupController.php b/modules/social_features/social_group/src/Controller/SocialGroupController.php
index <HASH>..<HASH> 100644
--- a/modules/social_features/social_group/src/Controller/SocialGroupController.php
+++ b/modules/social_features/social_group/src/Controller/SocialGroupController.php
@@ -3,6 +3,7 @@
namespace Drupal\social_group\Controller;
use Drupal\Core\Controller\ControllerBase;
+use Drupal\group\Entity\Group;
/**
* Returns responses for Social Group routes.
@@ -21,15 +22,11 @@ class SocialGroupController extends ControllerBase {
* The page title.
*/
public function groupMembersTitle($group) {
- if (is_object($group)) {
- $group_label = $group->label();
+ // If it's not a group then it's a gid.
+ if (!$group instanceof Group) {
+ $group = Group::load($group);
}
- else {
- $storage = \Drupal::entityTypeManager()->getStorage('group');
- $group_entity = $storage->load($group);
- $group_label = empty($group_entity) ? 'group' : $group_entity->label();
- }
- return $this->t('Members of @name', ['@name' => $group_label]);
+ return $this->t('Members of @name', ['@name' => $group->label()]);
}
/** | SHN-<I> by jochemvn: Simplify function | goalgorilla_open_social | train | php |
2540c43cadbcdc0b994d6bc846f93a8658045ebf | diff --git a/immutable-history/src/Controller/ChangeLogListController.php b/immutable-history/src/Controller/ChangeLogListController.php
index <HASH>..<HASH> 100644
--- a/immutable-history/src/Controller/ChangeLogListController.php
+++ b/immutable-history/src/Controller/ChangeLogListController.php
@@ -71,7 +71,8 @@ class ChangeLogListController implements MiddlewareInterface
$humanReadableEvents = $this->getHumanReadableChangeLogByDateRange->__invoke($greaterThanYear, $lessThanYear);
$description = 'Content change log events for ' . $days . ' days'
- . ' from ' . $greaterThanYear->format('c') . ' to ' . $lessThanYear->format('c');
+ . ' from ' . $greaterThanYear->format('c') . ' to ' . $lessThanYear->format('c')
+ . '. Text in parentheses is from current lookups and is not guaranteed to be historically accurate.';
$contentType = isset($queryParams['content-type'])
? html_entity_decode($queryParams['content-type']) | work on immutable history proof of concept by cleaning up code | reliv_Rcm | train | php |
d07b7359a0074fac0dcbab93698cc17ee0a61027 | diff --git a/fake-timers.js b/fake-timers.js
index <HASH>..<HASH> 100644
--- a/fake-timers.js
+++ b/fake-timers.js
@@ -105,7 +105,6 @@ module.exports = function every(obj, fn) {
var pass = true;
try {
- /* eslint-disable-next-line local-rules/no-prototype-methods */
obj.forEach(function() {
if (!fn.apply(this, arguments)) {
// Throwing an error is the only way to break `forEach`
@@ -205,7 +204,6 @@ module.exports = copyPrototype(Array.prototype);
var call = Function.call;
module.exports = function copyPrototypeMethods(prototype) {
- /* eslint-disable local-rules/no-prototype-methods */
return Object.getOwnPropertyNames(prototype).reduce(function(result, name) {
// ignore size because it throws from Map
if (
@@ -283,7 +281,6 @@ module.exports = function typeOf(value) {
function valueToString(value) {
if (value && value.toString) {
- /* eslint-disable-next-line local-rules/no-prototype-methods */
return value.toString();
}
return String(value); | Remove misleading comment
This repository doesn't use the `no-prototype-methods` rule that is
managed with `local-rules` plugin, so the comments make no sense.
ESLint should really throw an error here... | sinonjs_lolex | train | js |
3869a4d2d98148b2d4de6164fb0e1eabe8cf3874 | diff --git a/core/lib/engine_util.js b/core/lib/engine_util.js
index <HASH>..<HASH> 100644
--- a/core/lib/engine_util.js
+++ b/core/lib/engine_util.js
@@ -213,6 +213,21 @@ function renderVariables (str, vars) {
let rxmatch;
let result = str.substring(0, str.length);
+
+ // Special case for handling integer/boolean/object substitution:
+ //
+ // Does the template string contain one variable and nothing else?
+ // e.g.: "{{ myvar }" or "{{ myvar }", but NOT " {{ myvar }"
+ // If so, we treat it as a special case.
+ const matches = str.match(RX);
+ if (matches && matches.length === 1) {
+ if (matches[0] === str) {
+ // there's nothing else in the template but the variable
+ const varName = str.replace(/{/g, '').replace(/}/g, '').trim();
+ return vars[varName] || '';
+ }
+ }
+
while (result.search(RX) > -1) {
let templateStr = result.match(RX)[0];
const varName = templateStr.replace(/{/g, '').replace(/}/g, '').trim(); | fix: Using a template with exactly one variable keeps its type | artilleryio_artillery | train | js |
5be54c643d8c29394f8836c94d69d055472bf925 | diff --git a/pymatgen/electronic_structure/tests/test_plotter.py b/pymatgen/electronic_structure/tests/test_plotter.py
index <HASH>..<HASH> 100644
--- a/pymatgen/electronic_structure/tests/test_plotter.py
+++ b/pymatgen/electronic_structure/tests/test_plotter.py
@@ -190,8 +190,13 @@ class BoltztrapPlotterTest(unittest.TestCase):
os.path.join(test_dir, "boltztrap/transp/"))
plotter = BoltztrapPlotter(bz)
plotter.plot_seebeck_eff_mass_mu()
- plotter.plot_seebeck_temp()
- plotter.plot_seebeck_dop()
+
+ # TODO: These two tests fail. Whoever is responsible for the
+ # BoltztrapPlotter needs to fix these. The fact that there are not tests
+ # for the plotter is atrocious. I will reject all future additions to
+ # the plotter until these are fixed.
+ # plotter.plot_seebeck_temp()
+ # plotter.plot_seebeck_dop()
plotter.plot_complexity_factor_mu()
plotter.plot_conductivity_dop() | Comment out tests with an angry message at the person who coded the
BzTPlotter. | materialsproject_pymatgen | train | py |
1ee410b4128385e533b609708f8e9aa71e42053e | diff --git a/src/javascript/xhr/XMLHttpRequest.js b/src/javascript/xhr/XMLHttpRequest.js
index <HASH>..<HASH> 100644
--- a/src/javascript/xhr/XMLHttpRequest.js
+++ b/src/javascript/xhr/XMLHttpRequest.js
@@ -913,6 +913,7 @@ define("moxie/xhr/XMLHttpRequest", [
_p('responseText', _xhr.responseText);
_p('responseXML', _getDocument(_xhr));
_p('response', (_p('responseType') === 'document' ? _p('responseXML') : _p('responseText')));
+ _responseHeaders = _xhr.getAllResponseHeaders();
self.dispatchEvent('load');
} | XHR: Populate response headers in native mode as well. | moxiecode_moxie | train | js |
085eb92e160b9b993b51a1e9d6c9d9a7b7c9ab76 | diff --git a/docs/src/vendor/doc-components/editor/editor.js b/docs/src/vendor/doc-components/editor/editor.js
index <HASH>..<HASH> 100644
--- a/docs/src/vendor/doc-components/editor/editor.js
+++ b/docs/src/vendor/doc-components/editor/editor.js
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
+import _ from 'lodash';
let CodeMirror;
if (typeof document !== 'undefined') {
@@ -25,6 +26,12 @@ class Editor extends React.Component {
theme: 'oceanic-next',
};
+ constructor(props) {
+ super(props);
+
+ this.debouncedOnChange = _.debounce(props.onChange, 500);
+ }
+
componentDidMount() {
if (!CodeMirror) {
return;
@@ -51,15 +58,10 @@ class Editor extends React.Component {
handleChange = () => {
if (!this.props.readOnly && this.props.onChange) {
- this.props.onChange(this.editor.getValue());
+ this.debouncedOnChange(this.editor.getValue());
}
};
- setCode(code) {
- this.editor.getDoc().setValue(code);
- this.handleChange();
- }
-
render() {
const { className, style } = this.props; | Debounce updates to the example code block | jamesplease_materialish | train | js |
ce8b798a1a846760e61e9edf38d11f26d8351485 | diff --git a/salt/modules/zfs.py b/salt/modules/zfs.py
index <HASH>..<HASH> 100644
--- a/salt/modules/zfs.py
+++ b/salt/modules/zfs.py
@@ -39,20 +39,22 @@ def _available_commands():
if not zfs_path:
return False
- _return = {}
+ ret = {}
# Note that we append '|| :' as a unix hack to force return code to be 0.
- res = salt_cmd.run_all('{0} help || :'.format(zfs_path))
+ res = salt_cmd.run_stderr(
+ '{0} help || :'.format(zfs_path), output_loglevel='debug'
+ )
# This bit is dependent on specific output from `zfs help` - any major changes
# in how this works upstream will require a change.
- for line in res['stderr'].splitlines():
+ for line in res.splitlines():
if re.match(' [a-zA-Z]', line):
cmds = line.split(' ')[0].split('|')
doc = ' '.join(line.split(' ')[1:])
for cmd in [cmd.strip() for cmd in cmds]:
- if cmd not in _return:
- _return[cmd] = doc
- return _return
+ if cmd not in ret:
+ ret[cmd] = doc
+ return ret
def _exit_status(retcode): | Log 'zfs help' output at debug
This suppresses the output from this command unless the minion is
running in debug mode. | saltstack_salt | train | py |
b54334fc7148d605747715d7b3bfc5a090cdb1d9 | diff --git a/lib/sass/environment.rb b/lib/sass/environment.rb
index <HASH>..<HASH> 100644
--- a/lib/sass/environment.rb
+++ b/lib/sass/environment.rb
@@ -68,7 +68,7 @@ module Sass
# Pop a stack frame from the mixin/include stack.
def pop_frame
- stack.pop if stack.last[:prepared]
+ stack.pop if stack.last && stack.last[:prepared]
stack.pop
end | [Sass] Don't raise odd errors about #[] for stack overflows. | sass_ruby-sass | train | rb |
016ee28b226f542bf2cdbc1e3aedf07416852a53 | diff --git a/src/ol-ext/format.js b/src/ol-ext/format.js
index <HASH>..<HASH> 100644
--- a/src/ol-ext/format.js
+++ b/src/ol-ext/format.js
@@ -1,7 +1,9 @@
import BaseGeoJSON from 'ol/format/geojson'
import TopoJSON from 'ol/format/topojson'
import { isEmpty } from '../util/minilo'
+import { EPSG_4326 } from './consts'
import { createCircularPolygon } from './geom'
+import { transformPoint } from './proj'
import { isCircle } from './util'
/**
@@ -23,7 +25,15 @@ export function createTopoJsonFmt (options) {
class GeoJSON extends BaseGeoJSON {
writeGeometryObject (geometry, options) {
if (isCircle(geometry)) {
- geometry = createCircularPolygon(geometry.getCenter(), geometry.getRadius())
+ geometry = createCircularPolygon(
+ transformPoint(
+ geometry.getCenter(),
+ options.featureProjection || this.defaultFeatureProjection,
+ EPSG_4326,
+ ),
+ geometry.getRadius(),
+ )
+ options.featureProjection = EPSG_4326
}
return super.writeGeometryObject(geometry, options)
} | custom geojson fmt: replace projection after circle to polygon conversion | ghettovoice_vuelayers | train | js |
737429154e51ef8fbbaefcec0f74f2816864ea83 | diff --git a/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java b/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java
+++ b/src/main/java/com/axibase/tsd/driver/jdbc/DriverConstants.java
@@ -38,7 +38,7 @@ public final class DriverConstants {
public static final String TABLES_PARAM_NAME = "tables";
public static final String DEFAULT_TABLES_VALUE = null;
public static final String EXPAND_TAGS_PARAM_NAME = "expandTags";
- public static final boolean DEFAULT_EXPAND_TAGS_VALUE = true;
+ public static final boolean DEFAULT_EXPAND_TAGS_VALUE = false;
public static final String META_COLUMNS_PARAM_NAME = "metaColumns";
public static final boolean DEFAULT_META_COLUMNS_VALUE = false;
public static final String ASSIGN_INNER_COLUMN_NAMES_PARAM = "assignColumnNames"; | set expandTags value to false by default | axibase_atsd-jdbc | train | java |
6987b45970fd04ec85a5dde334a0a72a5ee48a8f | diff --git a/svtyper/singlesample.py b/svtyper/singlesample.py
index <HASH>..<HASH> 100644
--- a/svtyper/singlesample.py
+++ b/svtyper/singlesample.py
@@ -711,6 +711,7 @@ def genotype_parallel(src_vcf, out_vcf, sample, z, split_slop, min_aligned, sum_
# 1st pass through input vcf -- collect all the relevant breakpoints
logit("Collecting breakpoints")
breakpoints = collect_breakpoints(src_vcf)
+ logit("Collected {} breakpoints".format(len(breakpoints)))
logit("Collecting regions")
regions = [ get_breakpoint_regions(b, sample, z) for b in breakpoints ]
logit("Batch breakpoints into groups of {}".format(breakpoint_batch_size)) | + add message on how many breakpoints we're going to process | hall-lab_svtyper | train | py |
8096d5257492997e75634766f57c5cc159d09b3e | diff --git a/lib/rack/www.rb b/lib/rack/www.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/www.rb
+++ b/lib/rack/www.rb
@@ -15,12 +15,8 @@ module Rack
host = URI(req.host).to_s
if (already_www?(host) && @www == true) || (!already_www?(host) && @www == false)
[status, headers, body]
- elsif !already_www?(host) && @www == true
- url = URI(req.url).scheme + "://www." + host + URI(req.path).to_s
- headers = headers.merge('Location' => url)
- [301, headers, body]
else
- url = URI(req.url).scheme + "://" + host.gsub("www.", "") + URI(req.path).to_s
+ url = prepare_url(req)
headers = headers.merge('Location' => url)
[301, headers, body]
end
@@ -30,5 +26,17 @@ module Rack
def already_www?(host)
host.downcase =~ /^(www.)/
end
+
+ def prepare_url(req)
+ scheme = URI(req.url).scheme
+ host = URI(req.host).to_s.gsub(/^(www.)/, "")
+ path = URI(req.path).to_s
+ if @www == true
+ host = "://www." + host
+ else
+ host = "://" + host
+ end
+ scheme + host + path
+ end
end
end | Removed duplicated code, refactored a bit | stjhimy_rack-www | train | rb |
3e21905fc452cb12e544bbbf3d01b2fddf2d31f7 | diff --git a/lib/OpenLayers/Layer/Vector.js b/lib/OpenLayers/Layer/Vector.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Layer/Vector.js
+++ b/lib/OpenLayers/Layer/Vector.js
@@ -271,6 +271,10 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
if (!dragging) {
this.renderer.root.style.visibility = "hidden";
+ // force a reflow on gecko based browsers to actually hide the svg
+ if (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) {
+ this.div.scrollLeft = this.div.scrollLeft;
+ }
this.div.style.left = -parseInt(this.map.layerContainerDiv.style.left) + "px";
this.div.style.top = -parseInt(this.map.layerContainerDiv.style.top) + "px"; | "svg flicker at end of pan". Gecko-based browsers might not reflow svg if only style properties of dom elements are changed. Fixed by setting the scrollLeft property. r=pgiraud,tschaub (closes #<I>)
git-svn-id: <URL> | openlayers_openlayers | train | js |
5eed28ce9ef1daa2b38d15094425f82e0032d62d | diff --git a/src/js/chosen.js b/src/js/chosen.js
index <HASH>..<HASH> 100644
--- a/src/js/chosen.js
+++ b/src/js/chosen.js
@@ -1113,12 +1113,18 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
};
Chosen.prototype.results_reset = function() {
+ var oldValue = this.form_field_jq.val();
this.reset_single_select_options();
this.form_field.options[0].selected = true;
this.single_set_selected_text();
this.show_search_field_default();
this.results_reset_cleanup();
- this.form_field_jq.trigger("change");
+ var newValue = this.form_field_jq.val();
+ var changeData = {selected: newValue};
+ if (oldValue !== newValue && !newValue.length) {
+ changeData.deselected = oldValue;
+ }
+ this.form_field_jq.trigger("change", changeData);
if(this.active_field) {
return this.results_hide();
} | * add deselected param to change event for chosen single select control. | easysoft_zui | train | js |
5f58daaf57fa8e20fc46be6883129055e54e8cc0 | diff --git a/internal/states/statefile/version4.go b/internal/states/statefile/version4.go
index <HASH>..<HASH> 100644
--- a/internal/states/statefile/version4.go
+++ b/internal/states/statefile/version4.go
@@ -539,7 +539,7 @@ type instanceObjectStateV4 struct {
SchemaVersion uint64 `json:"schema_version"`
AttributesRaw json.RawMessage `json:"attributes,omitempty"`
AttributesFlat map[string]string `json:"attributes_flat,omitempty"`
- AttributeSensitivePaths json.RawMessage `json:"sensitive_attributes,omitempty,"`
+ AttributeSensitivePaths json.RawMessage `json:"sensitive_attributes,omitempty"`
PrivateRaw []byte `json:"private,omitempty"` | fix typo in struct tag (#<I>)
typo found by [`revive`](<URL>) | hashicorp_terraform | train | go |
72b7e7ce8cf16c27ae67f0ea1a8264e58e562ce0 | diff --git a/Builder/FormContractor.php b/Builder/FormContractor.php
index <HASH>..<HASH> 100644
--- a/Builder/FormContractor.php
+++ b/Builder/FormContractor.php
@@ -104,6 +104,7 @@ class FormContractor implements FormContractorInterface
'Sonata\AdminBundle\Form\Type\ModelType',
'sonata_type_model_list',
'Sonata\AdminBundle\Form\Type\ModelTypeList',
+ 'Sonata\AdminBundle\Form\Type\ModelListType',
'sonata_type_model_hidden',
'Sonata\AdminBundle\Form\Type\ModelHiddenType',
'sonata_type_model_autocomplete', | Fixed FormContractor for new ModelListType | sonata-project_SonataDoctrineORMAdminBundle | train | php |
107e04a7eaec5a5a496043052c6d19ea8d2e0894 | diff --git a/lib/dotenv.rb b/lib/dotenv.rb
index <HASH>..<HASH> 100644
--- a/lib/dotenv.rb
+++ b/lib/dotenv.rb
@@ -16,8 +16,7 @@ module Dotenv
with(*filenames) { |f| Environment.new(f).apply! if File.exist?(f) }
end
-protected
-
+ # Internal: Helper to expand list of filenames.
def self.with(*filenames, &block)
filenames << '.env' if filenames.empty? | Use comment instead of "protected" to denote internal method | bkeepers_dotenv | train | rb |
be2f291f5cc049acc2e3ed37d28a3e38fd7172ca | diff --git a/pysat/__init__.py b/pysat/__init__.py
index <HASH>..<HASH> 100644
--- a/pysat/__init__.py
+++ b/pysat/__init__.py
@@ -2,6 +2,7 @@
from __future__ import print_function
from __future__ import absolute_import
import os
+import pysatCDF
# get home directory
home_dir = os.path.expanduser('~') | Testing build of pysatCDF on travis | rstoneback_pysat | train | py |
66a3d178cb5878e2da9f5e61f924b510dbf1b4bb | diff --git a/pandas/tests/frame/test_alter_axes.py b/pandas/tests/frame/test_alter_axes.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/frame/test_alter_axes.py
+++ b/pandas/tests/frame/test_alter_axes.py
@@ -234,9 +234,16 @@ class TestDataFrameAlterAxes:
# need to adapt first drop for case that both keys are 'A' --
# cannot drop the same column twice;
- # use "is" because == would give ambiguous Boolean error for containers
+ # plain == would give ambiguous Boolean error for containers
first_drop = (
- False if (keys[0] is "A" and keys[1] is "A") else drop # noqa: F632
+ False
+ if (
+ isinstance(keys[0], str)
+ and keys[0] == "A"
+ and isinstance(keys[1], str)
+ and keys[1] == "A"
+ )
+ else drop
)
# to test against already-tested behaviour, we add sequentially,
# hence second append always True; must wrap keys in list, otherwise | TST: Don't use 'is' on strings to avoid SyntaxWarning (#<I>) | pandas-dev_pandas | train | py |
0d7e0e8adaf0eb9736ff1d398ab4280f7f528821 | diff --git a/lib/pagelib.php b/lib/pagelib.php
index <HASH>..<HASH> 100644
--- a/lib/pagelib.php
+++ b/lib/pagelib.php
@@ -49,9 +49,15 @@ function page_create_object($type, $id = NULL) {
*/
function page_map_class($type, $classname = NULL) {
- static $mappings = array(
- MOODLE_PAGE_COURSE => 'page_course'
- );
+ static $mappings = NULL;
+
+ if($mappings === NULL) {
+ $mappings = array(
+ MOODLE_PAGE_COURSE => 'page_course'
+ );
+ print_object('Debug info - initial mappings:');
+ var_dump($mappings);
+ }
if(!empty($type) && !empty($classname)) {
$mappings[$type] = $classname; | A small change for the static initialization in page_map_class,
and more debug added just before init is done. | moodle_moodle | train | php |
2e48d37e2883c6157603edea45874724ba2c7b90 | diff --git a/lib/zookeeper/common.rb b/lib/zookeeper/common.rb
index <HASH>..<HASH> 100644
--- a/lib/zookeeper/common.rb
+++ b/lib/zookeeper/common.rb
@@ -37,7 +37,7 @@ protected
def get_watcher(req_id)
@req_mutex.synchronize {
- req_id != ZKRB_GLOBAL_CB_REQ ? @watcher_reqs.delete(req_id) : @watcher_reqs[req_id]
+ (req_id == ZKRB_GLOBAL_CB_REQ) ? @watcher_reqs[req_id] : @watcher_reqs.delete(req_id)
}
end | improve logic in ternary to read more sanely | zk-ruby_zookeeper | train | rb |
3a7f39f43e6ef3da4330706461220775bf0a977b | diff --git a/docs_src/assets/js/src/application.js b/docs_src/assets/js/src/application.js
index <HASH>..<HASH> 100644
--- a/docs_src/assets/js/src/application.js
+++ b/docs_src/assets/js/src/application.js
@@ -134,7 +134,9 @@
htmlBridge
.data('placement', 'top')
.attr('title', 'Copy to clipboard')
- .tooltip()
+ .tooltip();
+
+ htmlBridge.find('object').text("flash object for zero clipboard");
})
// Copy to clipboard | Add text to copy object to resovle error | rei_rei-cedar | train | js |
dba454d5f947251e2b8db3fdef0aafd199e0a398 | diff --git a/cms_lab_publications/admin.py b/cms_lab_publications/admin.py
index <HASH>..<HASH> 100644
--- a/cms_lab_publications/admin.py
+++ b/cms_lab_publications/admin.py
@@ -261,6 +261,7 @@ class PublicationSetAdmin(admin.ModelAdmin):
'number_of_publications',
'pagination',
'searchable',
+ 'is_bulk_pubmed_query_ok',
)
list_filter = (
BulkPubMedQueryStatusFilter,
@@ -273,6 +274,11 @@ class PublicationSetAdmin(admin.ModelAdmin):
'description',
)
+ def is_bulk_pubmed_query_ok(self, obj):
+ return obj.bulk_pubmed_query == ''
+ is_bulk_pubmed_query_ok.boolean = True
+ is_bulk_pubmed_query_ok.short_description = 'Query OK?'
+
def queryset(self, request):
queryset = super().queryset(request)
queryset = queryset.annotate(pub_count=Count('publications')) | Display whether a Publication Set's Bulk PubMed Query status is OK | mfcovington_djangocms-lab-publications | train | py |
1a1991217102a288c77f24650ae05436871e7b52 | diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -10,6 +10,7 @@
error_reporting(E_ALL & ~E_USER_NOTICE | E_STRICT);
+require_once dirname(__FILE__) . "/../vendor/autoload.php";
require_once dirname(__FILE__) . "/../lib/steam-condenser.php";
function getFixture($fileName) { | Load Composer dependencies during tests | koraktor_steam-condenser-php | train | php |
3d66113a1832d3a89bdf2454bb882e6aea6e2c7c | diff --git a/tests/spec/output_spec.rb b/tests/spec/output_spec.rb
index <HASH>..<HASH> 100644
--- a/tests/spec/output_spec.rb
+++ b/tests/spec/output_spec.rb
@@ -105,6 +105,4 @@ describe WinRM::Output do
end
end
end
-
- pending 'parse CLIXML errors and convert to Strings and/or Exceptions'
end | remove pending test regarding exception deserializing. we do that now and cover in integration tests. will add unit tests soon | WinRb_WinRM | train | rb |
0a08b6fb8a2dbd8f3d0c0beaf1638422e511f27c | diff --git a/test/routing_test.rb b/test/routing_test.rb
index <HASH>..<HASH> 100755
--- a/test/routing_test.rb
+++ b/test/routing_test.rb
@@ -473,7 +473,7 @@ class TranslateRoutesTest < ActionController::TestCase
end
end
- test_case = klass.new(nil)
+ test_case = klass.new(:respond_to?)
# Not localized
assert test_case.respond_to?(:people_path) | Fix tests on default urls for Ruby <I> | enriclluelles_route_translator | train | rb |
c5dd6a91bec9cc3d8d2442248841b848ce58f1c7 | diff --git a/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java b/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java
index <HASH>..<HASH> 100644
--- a/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java
+++ b/probes/src/test/java/com/hazelcast/simulator/probes/ProbeTestUtils.java
@@ -24,7 +24,7 @@ public final class ProbeTestUtils {
private static final int HISTOGRAM_RECORD_COUNT = 5000;
private static final int MAX_LATENCY = 30000;
- private static final int TOLERANCE_MILLIS = 500;
+ private static final int TOLERANCE_MILLIS = 1000;
private static final Random RANDOM = new Random();
private static File resultFile = new File("tmpProbeResult.xml"); | Increased TOLERANCE_MILLIS to one second in ProbeTestUtils. | hazelcast_hazelcast-simulator | train | java |
c300467604fffa349968208f963e883a60ef5a77 | diff --git a/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java b/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java
index <HASH>..<HASH> 100644
--- a/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java
+++ b/testsuite/domain/src/test/java/org/jboss/as/test/integration/respawn/RespawnTestCase.java
@@ -396,7 +396,7 @@ public class RespawnTestCase {
@Override
String getKillCommand(RunningProcess process) {
- return "taskkill /pid " + process.getProcessId();
+ return "taskkill /f /pid " + process.getProcessId();
}
} | Add /f option to taskkill command on Windows. Stops respawn test from failing. | wildfly_wildfly | train | java |
3a6369a9403c6822f59408ec6b3718883fdb7dc3 | diff --git a/concrete/src/Permission/Key/WorkflowKey.php b/concrete/src/Permission/Key/WorkflowKey.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Permission/Key/WorkflowKey.php
+++ b/concrete/src/Permission/Key/WorkflowKey.php
@@ -27,7 +27,7 @@ abstract class WorkflowKey extends Key
foreach ($excluded as $inc) {
$pae = $inc->getAccessEntityObject();
- $usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers());
+ $usersExcluded = array_merge($usersExcluded, $pae->getAccessEntityUsers($paa));
}
$users = array_diff($users, $usersExcluded); | WorkflowKey::getCurrentlyActiveUsers() doesn't pass all args to getAccessEntityUsers()
Came about this bug when using the MSW extension. | concrete5_concrete5 | train | php |
b2a4e704deea531f74d4abff94882c7390fd17ae | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -367,8 +367,8 @@ workfly.prototype.resume = function()
//Resume the workflow
this._paused = false;
- //Check if workflow is aborted
- if(this._aborted === true ){ return; }
+ //Check if workflow is aborted or completed
+ if(this._aborted === true || this._completed === true ){ return; }
//Check if workflow running
if(this._running === true){ return; } | index.js: check if workflow is completed before resume it | jmjuanes_tinyflow | train | js |
e77089f73914e045004601c75d3e9b8e7fad335b | diff --git a/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java b/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java
+++ b/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java
@@ -103,7 +103,7 @@ public class TransactionBroadcast {
List<Peer> peers = peerGroup.getConnectedPeers(); // snapshots
// We intern the tx here so we are using a canonical version of the object (as it's unfortunately mutable).
// TODO: Once confidence state is moved out of Transaction we can kill off this step.
- pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : pinnedTx;
+ pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : tx;
// Prepare to send the transaction by adding a listener that'll be called when confidence changes.
// Only bother with this if we might actually hear back:
if (minConnections > 1) | NPE when invoking `PeerGroup.broadcastTransaction()` on peer group with no block chain.
The modified line here seems to have been assuming that `pinnedTx` was being
initialized elsewhere, but it wasn't. | bitcoinj_bitcoinj | train | java |
cf295868dc5be8a4b686b1bd10591b86b29144cf | diff --git a/alerta/server/database.py b/alerta/server/database.py
index <HASH>..<HASH> 100644
--- a/alerta/server/database.py
+++ b/alerta/server/database.py
@@ -18,10 +18,17 @@ class Mongo(object):
# Connect to MongoDB
try:
- self.conn = pymongo.MongoClient(CONF.mongo_host, CONF.mongo_port)
+ self.conn = pymongo.MongoClient(CONF.mongo_host, CONF.mongo_port) # version >= 2.4
+ except AttributeError:
+ self.conn = pymongo.Connection(CONF.mongo_host, CONF.mongo_port) # version < 2.4
+ except Exception, e:
+ LOG.error('MongoDB Client connection error : %s', e)
+ sys.exit(1)
+
+ try:
self.db = self.conn.monitoring # TODO(nsatterl): make 'monitoring' a SYSTEM DEFAULT
except Exception, e:
- LOG.error('MongoDB Client error : %s', e)
+ LOG.error('MongoDB database error : %s', e)
sys.exit(1)
if self.conn.alive(): | support pymongo < <I> | alerta_alerta | train | py |
0efeaa258b19d5b1ba204cc55fbdb6969e0f3e64 | diff --git a/flake8_respect_noqa.py b/flake8_respect_noqa.py
index <HASH>..<HASH> 100644
--- a/flake8_respect_noqa.py
+++ b/flake8_respect_noqa.py
@@ -4,13 +4,17 @@ Always ignore lines with '# noqa'
"""
__version__ = 0.2
-import pep8
+try:
+ from pep8 import StandardReport, noqa
+except ImportError:
+ # Try the new (as of 2016-June) pycodestyle package.
+ from pycodestyle import StandardReport, noqa
-class RespectNoqaReport(pep8.StandardReport):
+class RespectNoqaReport(StandardReport):
def error(self, line_number, offset, text, check):
- if len(self.lines) > line_number - 1 and pep8.noqa(self.lines[line_number - 1]):
+ if len(self.lines) > line_number - 1 and noqa(self.lines[line_number - 1]):
return
else:
return super(RespectNoqaReport, self).error(line_number, offset, | Adjust for pep8 package rename.
Closes #1 | spookylukey_flake8-respect-noqa | train | py |
30ba703bd4b500398820e3da4b8a8679df5ba014 | diff --git a/mocpy/moc.py b/mocpy/moc.py
index <HASH>..<HASH> 100644
--- a/mocpy/moc.py
+++ b/mocpy/moc.py
@@ -371,7 +371,7 @@ class MOC(AbstractMoc):
tmp_moc = tempfile.NamedTemporaryFile(delete=False)
- self.write(tmp_moc.name)
+ self.write(tmp_moc.name, write_to_file=True)
r = requests.post('http://cdsxmatch.u-strasbg.fr/QueryCat/QueryCat',
data={'mode': 'mocfile',
'catName': resource_id, | fix _query
MOC.write prototype has changed over time and _query was using a past version of it. | cds-astro_mocpy | train | py |
13cec37fd72d4c8301fe2bd829ab22799a8ba23d | diff --git a/lib/jsduck/lint.rb b/lib/jsduck/lint.rb
index <HASH>..<HASH> 100644
--- a/lib/jsduck/lint.rb
+++ b/lib/jsduck/lint.rb
@@ -100,7 +100,7 @@ module JsDuck
def warn_singleton_statics
@relations.each do |cls|
if cls[:singleton]
- cls.find_members({:static => true}).each do |m|
+ cls.find_members({:local => true, :static => true}).each do |m|
warn(:sing_static, "Static members don't make sense in singleton class #{@doc[:name]}", m)
end
end | Use the :local option in statics in singleton check.
We don't care about static members inherited from parents and mixins -
they could be completely valid in those other classes - it's the
concrete singleton who's statics interest us. | senchalabs_jsduck | train | rb |
0d75a1fa05296d4e9ff30898ed72567d0a45c64b | diff --git a/src/Artisaninweb/SoapWrapper/Service.php b/src/Artisaninweb/SoapWrapper/Service.php
index <HASH>..<HASH> 100755
--- a/src/Artisaninweb/SoapWrapper/Service.php
+++ b/src/Artisaninweb/SoapWrapper/Service.php
@@ -336,7 +336,8 @@ class Service {
*/
public function header($namespace,$name,$data=null,$mustUnderstand=false,$actor=null)
{
- $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand,$actor);
+ if($actor) $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand,$actor);
+ else $this->headers[] = new SoapHeader($namespace,$name,$data,$mustUnderstand);
return $this;
} | Update add header function
[ErrorException]
SoapHeader::SoapHeader(): Invalid actor
This is the error i get when i don't set the actor. | artisaninweb_laravel-soap | train | php |
9eb0328aa899e522d5c0e8be35614457c8bbf1cd | diff --git a/actions/class.TestRunner.php b/actions/class.TestRunner.php
index <HASH>..<HASH> 100644
--- a/actions/class.TestRunner.php
+++ b/actions/class.TestRunner.php
@@ -282,6 +282,7 @@ class taoQtiTest_actions_TestRunner extends tao_actions_ServiceModule {
}
$this->setData('client_config_url', $this->getClientConfigUrl());
+ $this->setData('client_timeout', $this->getClientTimeout());
$this->setView('test_runner.tpl');
$this->afterAction(false);
@@ -580,4 +581,4 @@ class taoQtiTest_actions_TestRunner extends tao_actions_ServiceModule {
break;
}
}
-}
\ No newline at end of file
+} | add timeout to the test runner | oat-sa_extension-tao-testqti | train | php |
59a981f41eb1f72df8bf49aff4df1c08dad00729 | diff --git a/salt/_compat.py b/salt/_compat.py
index <HASH>..<HASH> 100644
--- a/salt/_compat.py
+++ b/salt/_compat.py
@@ -177,8 +177,19 @@ else:
if PY3:
from io import StringIO
+ from io import BytesIO as cStringIO
else:
from StringIO import StringIO
+ from cStringIO import StringIO as cStringIO
+
+def string_io(data=None): # cStringIO can't handle unicode
+ '''
+ Pass data through to stringIO module and return result
+ '''
+ try:
+ return cStringIO(bytes(data))
+ except (UnicodeEncodeError, TypeError):
+ return StringIO(data)
if PY3:
import queue as Queue | add more stringio support to compat | saltstack_salt | train | py |
84e29ac56f88c72f8a025f285d69fcb7fa2a0f34 | diff --git a/salt/modules/win_file.py b/salt/modules/win_file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/win_file.py
+++ b/salt/modules/win_file.py
@@ -167,11 +167,13 @@ def _resolve_symlink(path, max_depth=64):
return path
-def _change_privilege(privilege_name, enable):
+def _change_privilege_state(privilege_name, enable):
'''
- Change, either enable or disable, the named privilege for this process.
+ Change the state, either enable or disable, of the named privilege for this
+ process.
- If the change did not occur, an exception will be raised.
+ If the change fails, an exception will be raised. If successful, it returns
+ True.
'''
log.debug(
'%s the privilege %s for this process.',
@@ -236,14 +238,14 @@ def _enable_privilege(privilege_name):
'''
Enables the named privilege for this process.
'''
- return _change_privilege(privilege_name, True)
+ return _change_privilege_state(privilege_name, True)
def _disable_privilege(privilege_name):
'''
Disables the named privilege for this process.
'''
- return _change_privilege(privilege_name, False)
+ return _change_privilege_state(privilege_name, False)
def gid_to_group(gid): | Renamed method to better reflect what it does. | saltstack_salt | train | py |
3f52444bbfea61f55eafd5ee8e8dc7823e87bb8b | diff --git a/example_form.php b/example_form.php
index <HASH>..<HASH> 100644
--- a/example_form.php
+++ b/example_form.php
@@ -44,7 +44,7 @@ if (isset($_SESSION['ctform']['error']) && $_SESSION['ctform']['error'] == true
<span class="success">The captcha was correct and the message has been sent!</span><br /><br />
<?php endif; ?>
-<form method="post" action="<?php echo $_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING'] ?>" id="contact_form">
+<form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI'] . $_SERVER['QUERY_STRING']) ?>" id="contact_form">
<input type="hidden" name="do" value="contact" />
<p> | Fix potential XSS in example form. | dapphp_securimage | train | php |
c9e42e801bbeac85fe309f7eb3388ca15b5032d8 | diff --git a/bees/ircbee/ircbee.go b/bees/ircbee/ircbee.go
index <HASH>..<HASH> 100644
--- a/bees/ircbee/ircbee.go
+++ b/bees/ircbee/ircbee.go
@@ -219,10 +219,9 @@ func (mod *IrcBee) Run(eventChan chan bees.Event) {
}
default:
+ time.Sleep(1 * time.Second)
}
}
}
-
- time.Sleep(5 * time.Second)
}
} | Sleep in the inner-most ircbee loop. | muesli_beehive | train | go |
39974f637036ac5a71c5b81ecb97f2bb92586a05 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -35,7 +35,7 @@ module.exports = {
target.options = target.options || {};
// Build all paths
- var bulmaPath = path.join(target.bowerDirectory, 'bulma');
+ var bulmaPath = path.join(target.bowerDirectory || '', 'bulma');
target.options.sassOptions = target.options.sassOptions || {};
target.options.sassOptions.includePaths = target.options.sassOptions.includePaths || []; | Fallback to empty string for undefined bowerDirectory
From what I can tell, nested addons don't have access to the `bowerDirectory` property defined by Ember CLI.
Rather than get an error for passing `undefined` to `Path.join`, this attempts to continue without `target.bowerDirectory`. | open-tux_ember-bulma | train | js |
a33055366d63a345ecb43f622d203c8e3d627ea3 | diff --git a/src/Entity/MetadataCollection.php b/src/Entity/MetadataCollection.php
index <HASH>..<HASH> 100644
--- a/src/Entity/MetadataCollection.php
+++ b/src/Entity/MetadataCollection.php
@@ -108,7 +108,9 @@ class MetadataCollection {
$cacheKey = self::$cachePrefix . 'metadata_entities_list';
$isCacheEnabled = $this->getClient()->isCacheEnabled();
- if ( !count( $this->cachedEntitiesList ) && $isCacheEnabled
+ if ( count( $this->cachedEntitiesList ) ) {
+ return $this->cachedEntitiesList;
+ } elseif ( !count( $this->cachedEntitiesList ) && $isCacheEnabled
&& $this->getCache()->exists( $cacheKey ) ) { // entities list exists
$this->cachedEntitiesList = $this->getCache()->get( $cacheKey );
} else { // entities list is not loaded | Entities metadata cache would be regenerated repeatedly
If MetadataCollection::getEntitiesList() is invoked the second time,
it would regenerate metadata cache despite entity metadata cache
being in memory already. | AlexaCRM_php-crm-toolkit | train | php |
14166ccc302f2b7c61439939abab34acd75232b9 | diff --git a/zipline/test/test_perf_tracking.py b/zipline/test/test_perf_tracking.py
index <HASH>..<HASH> 100644
--- a/zipline/test/test_perf_tracking.py
+++ b/zipline/test/test_perf_tracking.py
@@ -23,7 +23,7 @@ class PerformanceTestCase(unittest.TestCase):
len(self.treasury_curves)
)
self.dt = self.treasury_curves.keys()[random_index]
- self.end_dt = self.dt + datetime.timedelta(days=365+2)
+ self.end_dt = self.dt + datetime.timedelta(days=365)
self.trading_environment = TradingEnvironment(
self.benchmark_returns,
self.treasury_curves, | dropped the extra days in trading range... | quantopian_zipline | train | py |
428b55aa60056bf05c5c41e6554ae6b371c161be | diff --git a/pages.go b/pages.go
index <HASH>..<HASH> 100644
--- a/pages.go
+++ b/pages.go
@@ -6,13 +6,15 @@ import (
"bytes"
"encoding/binary"
"fmt"
- "github.com/golang/protobuf/proto"
- "github.com/sajari/sajari-convert/iWork"
- "github.com/sajari/sajari-convert/snappy"
"io"
"io/ioutil"
"log"
"strings"
+
+ "github.com/golang/protobuf/proto"
+
+ "github.com/sajari/docconv/iWork"
+ "github.com/sajari/docconv/snappy"
)
// Convert PAGES to text | Fix and reorder imports. | sajari_docconv | train | go |
75c9c9f49bd4e6f7415ca9573d62310b21af468c | diff --git a/coursera/utils.py b/coursera/utils.py
index <HASH>..<HASH> 100644
--- a/coursera/utils.py
+++ b/coursera/utils.py
@@ -65,7 +65,7 @@ def clean_filename(s, minimal_change=False):
h = html_parser.HTMLParser()
s = h.unescape(s)
- # strip paren portions which contain trailing time length (...)
+ # Strip forbidden characters
s = (
s.replace(':', '-')
.replace('/', '-') | coursera/utils: Update outdated comment. | coursera-dl_coursera-dl | train | py |
980e2a5e2b9ce56b8d60bfac4cde922a9b58f882 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
setup(
name='tortilla',
- version='0.1.0.dev2',
+ version='0.1.0.dev3',
description='A tiny library for creating wrappers around external APIs',
long_description=long_description,
url='https://github.com/redodo/tortilla', | New dev release: <I>.dev3 | tortilla_tortilla | train | py |
ac34a44f9859d101b310aa01732fb014bc41d6e4 | diff --git a/visidata/undo.py b/visidata/undo.py
index <HASH>..<HASH> 100644
--- a/visidata/undo.py
+++ b/visidata/undo.py
@@ -29,8 +29,10 @@ def undo(vd, sheet):
undofunc(*args, **kwargs)
sheet.undone.append(cmdlogrow)
sheet.cmdlog_sheet.rows.remove(cmdlogrow)
+
+ vd.clearCaches() # undofunc can invalidate the drawcache
+
vd.moveToReplayContext(cmdlogrow)
- vd.clearCaches()
vd.status("%s undone" % cmdlogrow.longname)
return | [undo-] clear drawcache before moving to pre-undo context
Per 6a4e<I>c<I>c<I>e<I>d<I>d<I>e5ed1, upon undo, VisiData tries
to move cursor to row/col of undone command.
If drawcaches are not cleared, VisiData could fail to find that pre-undo
context. | saulpw_visidata | train | py |
87c46113d1ff9fa25322ab9dadf703e0e8a97d41 | diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java
index <HASH>..<HASH> 100644
--- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java
+++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2HeadersFrame.java
@@ -34,7 +34,7 @@ public interface Http2HeadersFrame extends Http2StreamFrame {
int padding();
/**
- * Returns {@code true} if the END_STREAM flag ist set.
+ * Returns {@code true} if the END_STREAM flag is set.
*/
boolean isEndStream();
} | Fix typo in Http2HeadersFrame javadocs (#<I>)
Motivation:
`Http2HeadersFrame#isEndStream()` JavaDoc says `Returns {@code true} if the END_STREAM flag ist set.`. The typo is `ist` word. However, it should be `is`.
Modification:
Changed `ist` to `is`.
Result:
Better JavaDoc by fixing the typo. | netty_netty | train | java |
0b809d71da2990afaf172398d97bd4969186361a | diff --git a/cloudstack.go b/cloudstack.go
index <HASH>..<HASH> 100644
--- a/cloudstack.go
+++ b/cloudstack.go
@@ -729,8 +729,6 @@ func (d *Driver) setNetwork(networkName string, networkID string) error {
if networkID != "" {
networkIDs := strings.Split(networkID, ",")
- networkIDsResult = make([]string, len(networkIDs))
- networkNamesResult = make([]string, len(networkIDs))
for _, value := range networkIDs {
network, _, err = cs.Network.GetNetworkByID(value, d.setParams)
if err != nil {
@@ -741,8 +739,6 @@ func (d *Driver) setNetwork(networkName string, networkID string) error {
}
} else {
networkNames := strings.Split(networkName, ",")
- networkIDsResult = make([]string, len(networkNames))
- networkNamesResult = make([]string, len(networkNames))
for _, value := range networkNames {
network, _, err = cs.Network.GetNetworkByName(value, d.setParams)
if err != nil { | setNetwork: removing slice initialization with wrong size | andrestc_docker-machine-driver-cloudstack | train | go |
aaca93046c5a6d0a16880ac0bc17c6890c57ffa9 | diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js
index <HASH>..<HASH> 100644
--- a/spec/api-browser-window-spec.js
+++ b/spec/api-browser-window-spec.js
@@ -480,6 +480,8 @@ describe('browser-window module', function() {
});
describe('beginFrameSubscription method', function() {
+ this.timeout(20000);
+
it('subscribes frame updates', function(done) {
let called = false;
w.loadURL("file://" + fixtures + "/api/blank.html"); | spec: Give beginFrameSubscription test more time to run | electron_electron | train | js |
Subsets and Splits