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 |
|---|---|---|---|---|---|
f3249577248c480087a95f6ead575c1c061ae990 | diff --git a/message/classes/api.php b/message/classes/api.php
index <HASH>..<HASH> 100644
--- a/message/classes/api.php
+++ b/message/classes/api.php
@@ -196,14 +196,19 @@ class api {
}
// Now, let's get the courses.
+ // Make sure to limit searches to enrolled courses.
+ $enrolledcourses = enrol_get_my_courses(array('id', 'cacherev'));
$courses = array();
- if ($arrcourses = \coursecat::search_courses(array('search' => $search), array('limit' => $limitnum))) {
+ if ($arrcourses = \coursecat::search_courses(array('search' => $search), array('limit' => $limitnum),
+ array('moodle/course:viewparticipants'))) {
foreach ($arrcourses as $course) {
- $data = new \stdClass();
- $data->id = $course->id;
- $data->shortname = $course->shortname;
- $data->fullname = $course->fullname;
- $courses[] = $data;
+ if (isset($enrolledcourses[$course->id])) {
+ $data = new \stdClass();
+ $data->id = $course->id;
+ $data->shortname = $course->shortname;
+ $data->fullname = $course->fullname;
+ $courses[] = $data;
+ }
}
} | MDL-<I> messaging: Limit course search to enrolled courses. | moodle_moodle | train | php |
1710139dab687b98512991263049982a941cb1b7 | diff --git a/cherrypy/lib/lockfile.py b/cherrypy/lib/lockfile.py
index <HASH>..<HASH> 100644
--- a/cherrypy/lib/lockfile.py
+++ b/cherrypy/lib/lockfile.py
@@ -59,25 +59,25 @@ class SystemLockFile(object):
try:
# Open lockfile for writing without truncation:
- fp = open(path, 'r+')
+ self.fp = open(path, 'r+')
except IOError:
# If the file doesn't exist, IOError is raised; Use a+ instead.
# Note that there may be a race here. Multiple processes
# could fail on the r+ open and open the file a+, but only
# one will get the the lock and write a pid.
- fp = open(path, 'a+')
+ self.fp = open(path, 'a+')
try:
- self._lock_file(fp)
+ self._lock_file()
except:
- fp.seek(1)
- fp.close()
+ self.fp.seek(1)
+ self.fp.close()
+ del self.fp
raise
- self.fp = fp
- fp.write(" %s\n" % os.getpid())
- fp.truncate()
- fp.flush()
+ self.fp.write(" %s\n" % os.getpid())
+ self.fp.truncate()
+ self.fp.flush()
def release(self):
if not hasattr(self, 'fp'): | Fix error where lock and unlock do not take a parameter. | cherrypy_cheroot | train | py |
47e02dabdd41263576f5d9ff683e730aee7bfe40 | diff --git a/src/Notification/NotificationsBag.php b/src/Notification/NotificationsBag.php
index <HASH>..<HASH> 100644
--- a/src/Notification/NotificationsBag.php
+++ b/src/Notification/NotificationsBag.php
@@ -420,7 +420,14 @@ class NotificationsBag implements ArrayableInterface, JsonableInterface, Countab
*/
public function __toString()
{
- return $this->toJson();
+ $html = '';
+
+ foreach($this->collections as $collection)
+ {
+ $html .= $collection;
+ }
+
+ return $html;
} | __toString() on NotificationBag now renders all collections. | edvinaskrucas_notification | train | php |
30756a2ab13cc2d68ef839cf9877a6c892bef08f | diff --git a/lib/agent/drivers/control-panel2/index.js b/lib/agent/drivers/control-panel2/index.js
index <HASH>..<HASH> 100644
--- a/lib/agent/drivers/control-panel2/index.js
+++ b/lib/agent/drivers/control-panel2/index.js
@@ -204,15 +204,19 @@ var ControlPanelDriver = function(options) {
this.register_device = function(cb){
logger.info('Attaching device to your account...');
- var register = require('./register');
+ var remote = require('./remote');
- register({api_key: this.api_key}, function(err, data){
+ remote.attach({api_key: this.api_key}, function(err, data){
if (err || !data.device_key)
return cb(err || new Error("Couldn't register this device. Try again in a sec."));
logger.notice('Device succesfully created. Key: ' + data.device_key);
self.device_key = data.device_key;
+ for (var key in data.settings) {
+ common.config.set(key, data.settings[key]);
+ }
+
common.config.update('control-panel', {device_key: data.device_key}, cb);
});
}; | Sync settings from panel when attached. | prey_prey-node-client | train | js |
382cbb099614ff6099a2bed220ed1ca320d2ddd8 | diff --git a/lib/ecwid_api/api/products.rb b/lib/ecwid_api/api/products.rb
index <HASH>..<HASH> 100644
--- a/lib/ecwid_api/api/products.rb
+++ b/lib/ecwid_api/api/products.rb
@@ -5,6 +5,7 @@ module EcwidApi
#
# Returns an Array of Product objects
def all(params = {})
+ params[:limit] ||= 100
response = client.get("products", params)
PagedEnumerator.new(response) do |response, yielder|
@@ -16,7 +17,7 @@ module EcwidApi
response.body[i].to_i
end
- if count + offset >= total
+ if count == 0 || count + offset >= total
false
else
client.get("products", params.merge(offset: offset + count)) | Fixes infinite loop with an incorrect total.
Apparently the total that comes back in the response from Ecwid
is higher than it should be. This caused an infinite loop because
`count + offset` would never reach the total. Eventually, the offset
would be high enough that there weren't any results. So we'll exit
the loop when the `count == 0` as well. | davidbiehl_ecwid_api | train | rb |
1656bb3e2f19da4070ca31b644c30499397f1699 | diff --git a/lib/weblib.php b/lib/weblib.php
index <HASH>..<HASH> 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -3785,7 +3785,7 @@ function page_id_and_class(&$getid, &$getclass) {
if (substr($path, -1) == '/') {
$path .= 'index';
}
- if (empty($path) || $path == '/index') {
+ if (empty($path) || $path == 'index') {
$id = 'site-index';
$class = 'course';
} else { | Fix for bug <I>.
Credits for the report and the patch go to Samuli Karevaara. | moodle_moodle | train | php |
05fb0b5adb445d996d653f36a0263d512e782c9a | diff --git a/lib/helper.js b/lib/helper.js
index <HASH>..<HASH> 100644
--- a/lib/helper.js
+++ b/lib/helper.js
@@ -166,7 +166,7 @@ PokerHelper.prototype.activePlayersLeft = function(hand) {
// find out if it is time to start next hand
PokerHelper.prototype.checkForNextHand = function(hand) {
let activePlayerCount = this.activePlayersLeft(hand);
- if (hand.state == 'showdown') {
+ if (hand.state != 'dealing') {
return (activePlayerCount < 1);
} else {
return (activePlayerCount < 2); | checkForNextHand must be able to check in every hand state except dealing | acebusters_poker-helper | train | js |
8ccce1cbd94166020e4b6901da4e590612525851 | diff --git a/tests/test_score.py b/tests/test_score.py
index <HASH>..<HASH> 100644
--- a/tests/test_score.py
+++ b/tests/test_score.py
@@ -1,4 +1,4 @@
-"""Testing the scoring algorithm"""
+"""Test the scoring algorithm"""
from lantern.score import score
@@ -34,6 +34,6 @@ def test_score_is_averaged_positive_and_negative():
plaintext,
scoring_functions=[
lambda x: -10,
- lambda y: 0
+ lambda y: 2
]
- ) == -5
+ ) == -4 | Update test_score with a better test test case | CameronLonsdale_lantern | train | py |
d5f0435992eb8b3db5a18f045625200a10710f94 | diff --git a/tests.py b/tests.py
index <HASH>..<HASH> 100755
--- a/tests.py
+++ b/tests.py
@@ -240,6 +240,10 @@ class DNSTest(unittest.TestCase):
expected = '4.3.2.1.in-addr.arpa'
self.assertEqual(pycares.reverse_address(s), expected)
+ s = '2607:f8b0:4010:801::1013'
+ expected = '3.1.0.1.0.0.0.0.0.0.0.0.0.0.0.0.1.0.8.0.0.1.0.4.0.b.8.f.7.0.6.2.ip6.arpa'
+ self.assertEqual(pycares.reverse_address(s), expected)
+
def test_channel_timeout(self):
self.result, self.errorno = None, None
def cb(result, errorno): | tests.py: test reverse_address on IPv6 also | saghul_pycares | train | py |
1dc48c2a84fa065bf51d9b233eab9164257c53f4 | diff --git a/src/js/mep-feature-progress.js b/src/js/mep-feature-progress.js
index <HASH>..<HASH> 100644
--- a/src/js/mep-feature-progress.js
+++ b/src/js/mep-feature-progress.js
@@ -7,6 +7,10 @@
'<span class="mejs-time-loaded"></span>'+
'<span class="mejs-time-current"></span>'+
'<span class="mejs-time-handle"></span>'+
+ '<span class="mejs-time-float">' +
+ '<span class="mejs-time-float-current">00:00</span>' +
+ '<span class="mejs-time-float-corner"></span>' +
+ '</span>'+
'</span>'+
'</div>')
.appendTo(controls);
@@ -15,6 +19,8 @@
loaded = controls.find('.mejs-time-loaded'),
current = controls.find('.mejs-time-current'),
handle = controls.find('.mejs-time-handle'),
+ timefloat = controls.find('.mejs-time-float'),
+ timefloatcurrent = controls.find('.mejs-time-float-current'),
setProgress = function(e) {
var
target = e.target,
@@ -48,6 +54,8 @@
current.width(newWidth);
handle.css('left', handlePos);
+ timefloat.css('left', handlePos);
+ timefloatcurrent.html( mejs.Utility.secondsToTimeCode(media.currentTime) );
}
}, | - adds support for a time scrubber | mediaelement_mediaelement | train | js |
ec7c27cd25ebbd1e392e9d717a4c4977d0db310e | diff --git a/src/main/java/de/cinovo/cloudconductor/api/model/HostIdentifier.java b/src/main/java/de/cinovo/cloudconductor/api/model/HostIdentifier.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/cinovo/cloudconductor/api/model/HostIdentifier.java
+++ b/src/main/java/de/cinovo/cloudconductor/api/model/HostIdentifier.java
@@ -1,5 +1,7 @@
package de.cinovo.cloudconductor.api.model;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
@@ -17,6 +19,16 @@ public class HostIdentifier {
private String uuid;
/**
+ * @param name the name
+ * @param uuid the uuid
+ */
+ @JsonCreator
+ public HostIdentifier(@JsonProperty("name") String name, @JsonProperty("uuid") String uuid) {
+ this.name = name;
+ this.uuid = uuid;
+ }
+
+ /**
* @return the name
*/
public String getName() { | adds Hostidentifier to better support uuids | cinovo_cloudconductor-api | train | java |
6c890189dbdd4a2f3ba633a048a88bd5a90ce6bb | diff --git a/box/test/genty/genty.py b/box/test/genty/genty.py
index <HASH>..<HASH> 100644
--- a/box/test/genty/genty.py
+++ b/box/test/genty/genty.py
@@ -46,7 +46,8 @@ def _expand_tests(target_cls):
entries = dict(target_cls.__dict__.iteritems())
for key, value in entries.iteritems():
if key.startswith('test') and isinstance(value, types.FunctionType):
- yield key, value
+ if not hasattr(value, 'genty_generated_test'):
+ yield key, value
def _expand_datasets(test_functions): | Fix genty being used on a parent class and base class defined in separate files and run with a test runner like nose.
Genty needs to not collect tests that have already been genty_generated to avoid expanding already expanded tests. | box_genty | train | py |
cc1ba32f50e4d0d771c7ab4389ddb08516bec072 | diff --git a/cake/libs/router.php b/cake/libs/router.php
index <HASH>..<HASH> 100644
--- a/cake/libs/router.php
+++ b/cake/libs/router.php
@@ -317,8 +317,9 @@ class Router {
if ($named === true || $named === false) {
$options = array_merge(array('default' => $named, 'reset' => true, 'greedy' => $named), $options);
$named = array();
+ } else {
+ $options = array_merge(array('default' => false, 'reset' => false, 'greedy' => true), $options);
}
- $options = array_merge(array('default' => false, 'reset' => false, 'greedy' => true), $options);
if ($options['reset'] == true || $self->named['rules'] === false) {
$self->named['rules'] = array();
@@ -432,7 +433,6 @@ class Router {
for ($i = 0, $len = count($self->routes); $i < $len; $i++) {
$route =& $self->routes[$i];
- $route->compile();
if (($r = $route->parse($url)) !== false) {
$self->__currentRoute[] =& $route; | Removing call to RouterRoute::compile() | cakephp_cakephp | train | php |
64cf85bb36d6c76ec2a51029d6e61e387b323cf4 | diff --git a/holoviews/ipython/magics.py b/holoviews/ipython/magics.py
index <HASH>..<HASH> 100644
--- a/holoviews/ipython/magics.py
+++ b/holoviews/ipython/magics.py
@@ -415,6 +415,9 @@ class OptsCompleter(object):
kws = completions[completion_key][0]
return [kw+'=' for kw in kws]
+ if line.endswith('}') or (line.count('{') - line.count('}')) % 2:
+ return ['-groupwise', '-mapwise']
+
style_completions = [kw+'=' for kw in completions[completion_key][1]]
if line.endswith(')') or (line.count('(') - line.count(')')) % 2:
return style_completions | Added tab-completion for normalization settings in %opts cell/line magic | pyviz_holoviews | train | py |
1e665e58e1ca069b5162573a953450da72eebc89 | diff --git a/js/dracula_graph.js b/js/dracula_graph.js
index <HASH>..<HASH> 100644
--- a/js/dracula_graph.js
+++ b/js/dracula_graph.js
@@ -70,9 +70,12 @@ Graph.prototype = {
//this.snapshots.push({comment: comment, graph: graph});
},
removeNode: function(id) {
+ this.nodes[id].shape.remove();
delete this.nodes[id];
for(var i = 0; i < this.edges.length; i++) {
if (this.edges[i].source.id == id || this.edges[i].target.id == id) {
+ this.edges[i].connection.fg.remove();
+ this.edges[i].connection.label.remove();
this.edges.splice(i, 1);
i--;
} | updated `Graph.removeNode` to correctly remove all the connected shapes | strathausen_dracula | train | js |
7ba964f161406a5aa5029896fa0cfe124139a9a4 | diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Page/Page.php
+++ b/system/src/Grav/Common/Page/Page.php
@@ -1207,7 +1207,7 @@ class Page implements PageInterface
/**
* @return string
*/
- protected function getCacheKey()
+ protected function getCacheKey(): string
{
return $this->id();
} | One more PHP <I> issue | getgrav_grav | train | php |
583e152453e2ab1f0d675d3e7d113bb4aa3ae9a4 | diff --git a/addon/mixins/has-field-status.js b/addon/mixins/has-field-status.js
index <HASH>..<HASH> 100644
--- a/addon/mixins/has-field-status.js
+++ b/addon/mixins/has-field-status.js
@@ -25,8 +25,9 @@ export default Ember.Mixin.create(
initNodeValue: function () {
Ember.run.next(() => {
- this.$('input, select, textarea')
- .not('[type="radio"]')
+ var nodes = this.$('input, select, textarea');
+ if (!nodes) return;
+ nodes.not('[type="radio"]')
.val(this.get('value')).trigger('change');
});
}.on('didInsertElement').observes('field.dynamicAliasReady'), | Fix brittle test with defensive code | dollarshaveclub_ember-uni-form | train | js |
cb2d3edff7871108626ea64f8272dbe0e666022b | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -83,6 +83,7 @@ const clamp = ramda.curry((min, max, n) => {
max = max >= 1 ? max : 1;
if (typeof n !== `number` || n < min) return min;
if (n >= max) return max - 1;
+ return n;
});
exports.clamp = clamp; | Fix a bug in clamp();
Changes to be committed:
modified: library.js | kixxauth_kixx | train | js |
178e9512532cd8f7bccf785927f61d2c7f3cdf76 | diff --git a/core/block_token.py b/core/block_token.py
index <HASH>..<HASH> 100644
--- a/core/block_token.py
+++ b/core/block_token.py
@@ -106,6 +106,7 @@ class List(BlockToken):
nested = 0
yield ListItem(line)
else: yield ListItem(line)
+ if nested: yield List(line_buffer)
@staticmethod
def match(lines): | 🐛 fixed List: not recognizing trailing Lists | miyuchina_mistletoe | train | py |
0fedae636ed1e8c4c63e8e6a25644c8838f3613a | diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -540,6 +540,10 @@ module ActionController
@permitted = new_permitted
end
+ def fields_for_style?
+ @parameters.all? { |k, v| k =~ /\A-?\d+\z/ && v.is_a?(Hash) }
+ end
+
private
def new_instance_with_inherited_permitted_status(hash)
self.class.new(hash).tap do |new_instance|
@@ -570,7 +574,7 @@ module ActionController
when Array
object.grep(Parameters).map { |el| yield el }.compact
when Parameters
- if fields_for_style?(object)
+ if object.fields_for_style?
hash = object.class.new
object.each { |k,v| hash[k] = yield v }
hash
@@ -580,10 +584,6 @@ module ActionController
end
end
- def fields_for_style?(object)
- object.to_unsafe_h.all? { |k, v| k =~ /\A-?\d+\z/ && v.is_a?(Hash) }
- end
-
def unpermitted_parameters!(params)
unpermitted_keys = unpermitted_keys(params)
if unpermitted_keys.any? | push fields_for_style? in to a protected method
this way we don't need to call `to_unsafe_h` to get access to ask
questions about the underlying hash | rails_rails | train | rb |
8fa2f09eeaa38aead94d173b7cd4ce04850271b8 | diff --git a/pandas/core/base.py b/pandas/core/base.py
index <HASH>..<HASH> 100644
--- a/pandas/core/base.py
+++ b/pandas/core/base.py
@@ -366,7 +366,7 @@ class IndexOpsMixin(OpsMixin):
def item(self):
"""
- Return the first element of the underlying data as a python scalar.
+ Return the first element of the underlying data as a Python scalar.
Returns
------- | DOC: capitalize Python as proper noun (#<I>) | pandas-dev_pandas | train | py |
1711e6a52907b3061f1faeca8ac629c985e28acf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ class PyTest(TestCommand):
setup(
name='graphene',
- version='0.10.1',
+ version='0.10.2',
description='GraphQL Framework for Python',
long_description=open('README.rst').read(), | Updated version to <I> | graphql-python_graphene | train | py |
e571156def12f8dbcbabf43156826c056dbcc5f1 | diff --git a/tests/test.views.js b/tests/test.views.js
index <HASH>..<HASH> 100644
--- a/tests/test.views.js
+++ b/tests/test.views.js
@@ -21,10 +21,10 @@ asyncTest("Create a pouch", function() {
// then text, case sensitive
values.push("a");
- values.push("A");
+ //values.push("A");
values.push("aa");
values.push("b");
- values.push("B");
+ //values.push("B");
values.push("ba");
values.push("bb"); | comment out the capitalised collations tests while broken | pouchdb_pouchdb | train | js |
fb252d4bae3ae94b6eab8342578a48093f00d6de | diff --git a/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java b/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java
index <HASH>..<HASH> 100644
--- a/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java
+++ b/kundera-hbase/src/test/java/com/impetus/client/hbase/crud/PersonHBaseTest.java
@@ -44,6 +44,11 @@ public class PersonHBaseTest extends BaseTest
}
@Test
+ public void testDummy()
+ {
+ // just to fix CI issue. TO BE DELETED!!!
+ }
+// @Test
public void onInsertHbase() throws Exception
{
// if (!cli.isStarted) | commented out test case as CI is complaining for HBase connection. | Impetus_Kundera | train | java |
4c4a49ebffe481271e1dbb857317c00e846b72ac | diff --git a/lib/structure_element.js b/lib/structure_element.js
index <HASH>..<HASH> 100644
--- a/lib/structure_element.js
+++ b/lib/structure_element.js
@@ -10,7 +10,6 @@ class PDFStructureElement {
this.document = document;
this._ended = false;
- this._flushed = false;
this.dictionary = document.ref({
// Type: "StructElem",
S: type
@@ -92,6 +91,10 @@ class PDFStructureElement {
}
setParent(parentRef) {
+ if (this.dictionary.data.P) {
+ throw new Error(`Structure element added to more than one parent`);
+ }
+
this.dictionary.data.P = parentRef;
if (this._ended) {
diff --git a/tests/unit/markings.spec.js b/tests/unit/markings.spec.js
index <HASH>..<HASH> 100644
--- a/tests/unit/markings.spec.js
+++ b/tests/unit/markings.spec.js
@@ -426,6 +426,12 @@ EMC
struct.add(document.struct('Bar'));
}).toThrow();
+ struct = document.struct('Foo');
+ let parent = document.struct('Bar').add(struct);
+ expect(() => {
+ parent.add(struct);
+ }).toThrow();
+
expect(() => {
document.struct('Foo', [1]);
}).toThrow(); | Guard against adding a structure element to more than one parent. | foliojs_pdfkit | train | js,js |
fae629ea65cecfcefb894fa996b280014105e0d6 | diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js
index <HASH>..<HASH> 100644
--- a/src/controllers/organisms/RoomView.js
+++ b/src/controllers/organisms/RoomView.js
@@ -113,7 +113,7 @@ module.exports = {
fillSpace: function() {
var messageUl = this.refs.messageList.getDOMNode();
- if (messageUl.scrollTop < messageUl.clientHeight) {
+ if (messageUl.scrollTop < messageUl.clientHeight && this.state.room.oldState.paginationToken) {
this.setState({paginating: true});
this.oldScrollHeight = messageUl.scrollHeight; | Use the pagination token to see when we've reached the room's birth | matrix-org_matrix-react-skin | train | js |
cb5e47494a9d9d620ff10b2ecc74efeb7255d27a | diff --git a/script/farmer.js b/script/farmer.js
index <HASH>..<HASH> 100755
--- a/script/farmer.js
+++ b/script/farmer.js
@@ -66,9 +66,6 @@ farmer.on('bridgeChallenge', (bridge) => {
farmer.on('bridgesConnected', function() {
farmerState.bridgesConnectionStatus = 3;
});
-farmer.on('bridgesDisconnected', function() {
- farmerState.bridgesConnectionStatus = 0;
-});
function transportInitialized() {
return farmer.transport._requiresTraversal !== undefined | Remove event that does not exist at this point | storj_storjshare-daemon | train | js |
3405f37664fc44c96aa3e6b0a451e2209d6d056e | diff --git a/restclients/sws/v5/section_status.py b/restclients/sws/v5/section_status.py
index <HASH>..<HASH> 100644
--- a/restclients/sws/v5/section_status.py
+++ b/restclients/sws/v5/section_status.py
@@ -6,9 +6,6 @@ from restclients.models.sws import SectionStatus
course_res_url_prefix = "/student/v5/course"
def get_section_status_by_label(label):
- import warnings
- warnings.warn("Totally untested against live resources! Don't count on get_section_status_by_label in v5!")
-
if not section_label_pattern.match(label):
raise InvalidSectionID(label) | This has been in production for a while! | uw-it-aca_uw-restclients | train | py |
e0703349c7032511b3f325e3a07df0f0c2bea9b0 | diff --git a/lib/sidetiq/version.rb b/lib/sidetiq/version.rb
index <HASH>..<HASH> 100644
--- a/lib/sidetiq/version.rb
+++ b/lib/sidetiq/version.rb
@@ -8,7 +8,7 @@ module Sidetiq
MINOR = 4
# Public: Sidetiq patch level.
- PATCH = 0
+ PATCH = 1
# Public: Sidetiq version suffix.
SUFFIX = nil | Bump to <I>. | endofunky_sidetiq | train | rb |
3e31e3dc3fc8a6ac036b795964f4caf367be11d0 | diff --git a/openapi-meta/src/test/java/com/networknt/openapi/parameter/IntegrationTest.java b/openapi-meta/src/test/java/com/networknt/openapi/parameter/IntegrationTest.java
index <HASH>..<HASH> 100644
--- a/openapi-meta/src/test/java/com/networknt/openapi/parameter/IntegrationTest.java
+++ b/openapi-meta/src/test/java/com/networknt/openapi/parameter/IntegrationTest.java
@@ -387,7 +387,7 @@ public class IntegrationTest {
runTest("/pets_matrix_obj_ep/;id=001;name=Dog", EXPECTED_MAP_RESULT);
}
- @Test
+ //@Test
public void test_object_matrix_no_explode_path_param_deserialization() throws Exception {
runTest("/pets_matrix_obj_no_ep/;petId=id,001,name,Dog", EXPECTED_MAP_RESULT);
} | fixes #<I> disable a test case as undertow <I> breaks it (#<I>) | networknt_light-rest-4j | train | java |
50f9b66e9a4225a80c5fd4243d228a9b0562f6f7 | diff --git a/src/components/columnWidget/columnWidget.js b/src/components/columnWidget/columnWidget.js
index <HASH>..<HASH> 100644
--- a/src/components/columnWidget/columnWidget.js
+++ b/src/components/columnWidget/columnWidget.js
@@ -61,7 +61,8 @@ class ColumnWidget extends PureComponent {
enabled: false
},
tooltip: {
- followTouchMove: true
+ enabled: false,
+ // followTouchMove: true
}
};
@@ -85,8 +86,9 @@ class ColumnWidget extends PureComponent {
// this is the scope of point
onPointUpdate(e) {
- this.select();
// console.log(this.category, this.y, this.series.name);
+
+ this.select();
emitter.emit('receive_onPointUpdate', {
seriesName: this.series.name,
label: this.category,
@@ -95,9 +97,9 @@ class ColumnWidget extends PureComponent {
}
receiveOnPointUpdate(options, cb) {
- const {label, value, seriesName} = options;
- console.log(label, value, seriesName);
+ // console.log(label, value, seriesName);
+ const {label, value, seriesName} = options;
const nextFauxLegend = this.state.fauxLegend.map(f => {
if (f.seriesName === seriesName) {
f.label = label; | fix(remove unneeded tooltip): (#9) | govau_datavizkit | train | js |
eb039e0bf98c8e4369bb32ae93203bf46bd8384c | diff --git a/lib/queue_classic_plus/queue_classic/queue.rb b/lib/queue_classic_plus/queue_classic/queue.rb
index <HASH>..<HASH> 100644
--- a/lib/queue_classic_plus/queue_classic/queue.rb
+++ b/lib/queue_classic_plus/queue_classic/queue.rb
@@ -40,7 +40,7 @@ module QC
job[:args] = JSON.parse(r["args"])
job[:remaining_retries] = r["remaining_retries"]
if r["scheduled_at"]
- job[:scheduled_at] = Time.parse(r["scheduled_at"])
+ job[:scheduled_at] = r["scheduled_at"].kind_of?(Time) ? r["scheduled_at"] : Time.parse(r["scheduled_at"])
ttl = Integer((Time.now - job[:scheduled_at]) * 1000)
QC.measure("time-to-lock=#{ttl}ms source=#{name}")
end | Port activerecord 6 support from QC::Queue
original commit (<URL>) resolves `no implicit conversion of Time into String`. | rainforestapp_queue_classic_plus | train | rb |
e56be7ff7b4d110c8bba200305f6d2f581e372c9 | diff --git a/lib/steam/community/SteamId.php b/lib/steam/community/SteamId.php
index <HASH>..<HASH> 100644
--- a/lib/steam/community/SteamId.php
+++ b/lib/steam/community/SteamId.php
@@ -252,8 +252,6 @@ class SteamId extends XMLData {
if($this->isPublic()) {
$this->customUrl = strtolower((string) $profile->customURL);
- $this->favoriteGame = (string) $profile->favoriteGame->name;
- $this->favoriteGameHoursPlayed = (string) $profile->favoriteGame->hoursPlayed2wk;
$this->headLine = htmlspecialchars_decode((string) $profile->headline);
$this->hoursPlayed = (float) $profile->hoursPlayed2Wk;
$this->location = (string) $profile->location; | Favorite games have been finally removed from community profiles | koraktor_steam-condenser-php | train | php |
da86d5871b9fd3a3e233470baa974f10b5ca9a7e | diff --git a/salt/runners/manage.py b/salt/runners/manage.py
index <HASH>..<HASH> 100644
--- a/salt/runners/manage.py
+++ b/salt/runners/manage.py
@@ -19,6 +19,7 @@ import salt.key
import salt.client
import salt.output
import salt.utils.minions
+import salt.wheel
FINGERPRINT_REGEX = re.compile(r'^([a-f0-9]{2}:){15}([a-f0-9]{2})$')
@@ -110,10 +111,8 @@ def down(removekeys=False):
ret = status(output=False).get('down', [])
for minion in ret:
if removekeys:
- salt_key_options = '-qyd'
- if 'config_dir' in __opts__:
- salt_key_options = '-qyd --config-dir={0}'.format(__opts__['config_dir'])
- subprocess.call(["salt-key", salt_key_options, minion])
+ wheel = salt.wheel.Wheel(__opts__)
+ wheel.call_func('key.delete', match=minion)
else:
salt.output.display_output(minion, '', __opts__)
return ret | Use wheel to control salt keys in manage runner.
Closes #<I> | saltstack_salt | train | py |
c0dba0f4f2d1d0f364972f4669d77a914e3e597c | diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index <HASH>..<HASH> 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -284,7 +284,7 @@ class Bot(GroupMixin, discord.Client):
See Also
---------
- :meth:`Client.sned_file`
+ :meth:`Client.send_file`
"""
destination = _get_variable('_internal_channel')
result = yield from self.send_file(destination, *args, **kwargs) | [commands] Fix typo in Bot.upload docstring. | Rapptz_discord.py | train | py |
8fe7b898b08103c1d6fce64c3e279a7afd61adfc | diff --git a/Config/AsseticResource.php b/Config/AsseticResource.php
index <HASH>..<HASH> 100644
--- a/Config/AsseticResource.php
+++ b/Config/AsseticResource.php
@@ -47,4 +47,29 @@ class AsseticResource implements SymfonyResourceInterface
{
return $this->resource;
}
+
+ public function exists()
+ {
+ return true;
+ }
+
+ public function getId()
+ {
+ return md5('assetic'.$this->resource);
+ }
+
+ public function getModificationTime()
+ {
+ return -1;
+ }
+
+ public function serialize()
+ {
+ return serialize($this->resource);
+ }
+
+ public function unserialize($serialized)
+ {
+ $this->resource = unserialize($serialized);
+ }
} | Updated the AsseticResource to the new interface
Closes #<I> | symfony_assetic-bundle | train | php |
4febb8e481240f88aefb966bee79526ac8f5fba0 | diff --git a/src/test/java/com/github/greengerong/PrerenderConfigTest.java b/src/test/java/com/github/greengerong/PrerenderConfigTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/github/greengerong/PrerenderConfigTest.java
+++ b/src/test/java/com/github/greengerong/PrerenderConfigTest.java
@@ -1,12 +1,17 @@
package com.github.greengerong;
+import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsNull.notNullValue;
+import static org.junit.Assert.assertThat;
+
public class PrerenderConfigTest {
- @Test(expected = NumberFormatException.class)
+ @Test(expected = Exception.class)
public void should_throw_exception_if_invalid_timeout_value_specified() throws Exception {
//given
Map<String, String> configuration = new HashMap<String, String>();
@@ -23,6 +28,8 @@ public class PrerenderConfigTest {
configuration.put("socketTimeout", "1000");
PrerenderConfig config = new PrerenderConfig(configuration);
//when
- config.getHttpClient();
+ final CloseableHttpClient httpClient = config.getHttpClient();
+
+ assertThat(httpClient, is(notNullValue()));
}
} | [Tech] fix test, make the test to clean | greengerong_prerender-java | train | java |
be17bfe85af859a506862f66cf641873299d0029 | diff --git a/rendering/test.js b/rendering/test.js
index <HASH>..<HASH> 100755
--- a/rendering/test.js
+++ b/rendering/test.js
@@ -351,7 +351,7 @@ if (require.main === module) {
option('headless', {
describe: 'Launch Puppeteer in headless mode',
type: 'boolean',
- default: process.env.CI ? false : true
+ default: false
}).
option('puppeteer-args', {
describe: 'Additional args for Puppeteer', | Avoid render test issues by not running Puppeteer in headless mode | openlayers_openlayers | train | js |
d62130fd8d1cbe2ae77bd2574e40ff53abcfa8ce | diff --git a/src/test/java/water/fvec/FVecTest.java b/src/test/java/water/fvec/FVecTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/water/fvec/FVecTest.java
+++ b/src/test/java/water/fvec/FVecTest.java
@@ -102,7 +102,7 @@ public class FVecTest extends TestUtil {
File file = TestUtil.find_test_file("./smalldata/cars.csv");
Key key = NFSFileVec.make(file);
NFSFileVec nfs=DKV.get(key).get();
- Vec res = new TestNewVec().doAll(1,nfs)._outputFrame.anyVec();
+ Vec res = new TestNewVec().doAll(1,nfs).outputFrame(new String[]{"v"},new String[][]{null}).anyVec();
assertEquals(nfs.at8(0)+1,res.at8(0));
assertEquals(nfs.at8(1)+1,res.at8(1));
assertEquals(nfs.at8(2)+1,res.at8(2)); | Udpated fvec test to work with updates in MRTask2 | h2oai_h2o-2 | train | java |
8650ef92b7d9bc0bf8ba02362919eaeea1c533e6 | diff --git a/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go b/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go
index <HASH>..<HASH> 100644
--- a/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go
+++ b/go/test/endtoend/onlineddl_vrepl_stress/onlineddl_vrepl_mini_stress_test.go
@@ -173,7 +173,7 @@ func TestMain(m *testing.M) {
Name: keyspaceName,
}
- if err := clusterInstance.StartUnshardedKeyspace(*keyspace, 2, true); err != nil {
+ if err := clusterInstance.StartUnshardedKeyspace(*keyspace, 0, false); err != nil {
return 1, err
}
if err := clusterInstance.StartKeyspace(*keyspace, []string{"1"}, 1, false); err != nil { | no need for replicas, make test more lightweight | vitessio_vitess | train | go |
4d2f6e9ed15bf014450558c63cce2e4aee0c3420 | diff --git a/src/Linfo/Parsers/CallExt.php b/src/Linfo/Parsers/CallExt.php
index <HASH>..<HASH> 100644
--- a/src/Linfo/Parsers/CallExt.php
+++ b/src/Linfo/Parsers/CallExt.php
@@ -64,7 +64,7 @@ class CallExt
{
// Merge in possible custom paths
- if (isset(self::$settings['additional_paths']) &&
+ if (array_key_exists('additional_paths', self::$settings) &&
is_array(self::$settings['additional_paths']) &&
count(self::$settings['additional_paths']) > 0) { | Resolves #<I> the right way (#<I>) | jrgp_linfo | train | php |
1c188ebb55ef512653e03b0a03e60d7209a3bc73 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -158,10 +158,8 @@ main:
if (failed) console.log('%d/%d tests failed.', failed, len);
// Tests currently failing.
- if (~failures.indexOf('def_blocks.text')
- && ~failures.indexOf('double_link.text')
- && ~failures.indexOf('gfm_code_hr_list.text')) {
- failed -= 3;
+ if (~failures.indexOf('def_blocks.text')) {
+ failed -= 1;
}
return !failed; | [test] return proper exit code on tests passing. | remarkjs_remark | train | js |
08a3960efe5f7448bd713579ccc2ab5ad6e86f7b | diff --git a/src/main/java/water/fvec/Vec.java b/src/main/java/water/fvec/Vec.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/fvec/Vec.java
+++ b/src/main/java/water/fvec/Vec.java
@@ -527,10 +527,11 @@ public class Vec extends Iced {
Value dvec = chunkIdx(cidx); // Chunk# to chunk data
Chunk c = dvec.get(); // Chunk data to compression wrapper
long cstart = c._start; // Read once, since racily filled in
- if( cstart == start ) return c; // Already filled-in
+ Vec v = c._vec;
+ if( cstart == start && v != null) return c; // Already filled-in
assert cstart == -1; // Was not filled in (everybody racily writes the same start value)
- c._start = start; // Fields not filled in by unpacking from Value
c._vec = this; // Fields not filled in by unpacking from Value
+ c._start = start; // Fields not filled in by unpacking from Value
return c;
}
/** The Chunk for a row#. Warning: this loads the data locally! */ | Fixed race in Vec. getChunkForChunkIdx sets _start and _vec iff _tart == -1, but was setting _start before _vec and so there was a (really narrow) race where _start would be != -1 but _vec would still be null. did hit this race in RebalanceTask. | h2oai_h2o-2 | train | java |
9ccbd14c1ae8b83cd0634a1f79a40d6cabd5a976 | diff --git a/app/view/js/bolt-extend.js b/app/view/js/bolt-extend.js
index <HASH>..<HASH> 100644
--- a/app/view/js/bolt-extend.js
+++ b/app/view/js/bolt-extend.js
@@ -247,7 +247,7 @@ var BoltExtender = Object.extend(Object, {
var tpl = "";
for(var v in packages) {
version = packages[v];
- tpl = tpl+'<tr><td>'+version.name+'</td><td>'+version.version+'</td><td><span class="label label-default"';
+ tpl = tpl+'<tr><td>'+version.name+'</td><td>'+version.version+'</td><td><span class="label label-default';
if(version.buildStatus=='approved') tpl = tpl+' label-success';
tpl = tpl+'">'+version.buildStatus+'</span></td>';
tpl = tpl+'<td><div class="btn-group"><a href="#" data-action="install-package" class="btn btn-primary btn-sm" data-package="'+version.name+'" data-version="'+version.version+'">'; | fix to nesting of attribues | bolt_bolt | train | js |
c230d5656299a0b50405304d3f1d5a09cfe40823 | diff --git a/controller/DeliveryMgmt.php b/controller/DeliveryMgmt.php
index <HASH>..<HASH> 100755
--- a/controller/DeliveryMgmt.php
+++ b/controller/DeliveryMgmt.php
@@ -134,9 +134,15 @@ class DeliveryMgmt extends \tao_actions_SaSModule
$this->getEventManager()->trigger(new DeliveryUpdatedEvent($delivery->getUri(), $propertyValues));
- $this->setData("selectNode", \tao_helpers_Uri::encode($delivery->getUri()));
+ $this->setData('selectNode', \tao_helpers_Uri::encode($delivery->getUri()));
$this->setData('message', __('Delivery saved'));
$this->setData('reload', true);
+
+ $this->returnJson([
+ 'success' => true,
+ 'message' => __('Delivery saved')
+ ]);
+ return;
}
$this->setData('label', $delivery->getLabel()); | Updated form response to comply with uiForm intefration (for forms using CSRF validation) | oat-sa_extension-tao-delivery-rdf | train | php |
4cbf59d32f49b0c84578b95fe256530e46a6cb92 | diff --git a/database/factories/CustomerFactory.php b/database/factories/CustomerFactory.php
index <HASH>..<HASH> 100644
--- a/database/factories/CustomerFactory.php
+++ b/database/factories/CustomerFactory.php
@@ -1,5 +1,5 @@
<?php
-namespace Database\Factories;
+namespace AvoRed\Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Faker\Generator as Faker;
use AvoRed\Framework\Database\Models\Customer; | Update CustomerFactory.php | avored_framework | train | php |
b22b31207d6914fdeab64ff32775089eb3ffc922 | diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/QueryBatcherJobReportTest.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/QueryBatcherJobReportTest.java
index <HASH>..<HASH> 100644
--- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/QueryBatcherJobReportTest.java
+++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/QueryBatcherJobReportTest.java
@@ -607,8 +607,6 @@ public class QueryBatcherJobReportTest extends BasicJavaClientREST {
System.out.println("stopTransformJobTest: Skipped: " + skippedBatch.size());
System.out.println("stopTransformJobTest : Value of doccount from DocumentManager read " + doccount);
Assert.assertEquals(2000 - doccount, successBatch.size());
- // This should be the number of URI read (success count + any failed transform counts
- Assert.assertEquals(2000 - (doccount + failureBatch.size()), successCount.get());
}
} | No Task - Zero diff initiative. Removed changing count. | marklogic_java-client-api | train | java |
e9e28bfb15d6ebb936fa62e9d154d4603b2635b4 | diff --git a/src/plugins/DragDrop.js b/src/plugins/DragDrop.js
index <HASH>..<HASH> 100644
--- a/src/plugins/DragDrop.js
+++ b/src/plugins/DragDrop.js
@@ -1,4 +1,5 @@
-import TransloaditPlugin from './TransloaditPlugin';
+import TransloaditPlugin from '../plugins/TransloaditPlugin';
+
export default class DragDrop extends TransloaditPlugin {
constructor(core, opts) {
super(core, opts);
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -1,6 +1,6 @@
-import Transloadit from './core/Transloadit';
-import DragDrop from './plugins/DragDrop';
-import Tus10 from './plugins/Tus10';
+import Transloadit from './src/core/Transloadit';
+import DragDrop from './src/plugins/DragDrop';
+import Tus10 from './src/plugins/Tus10';
const transloadit = new Transloadit({wait: false});
const files = transloadit | Resolved conflict, fixed test.js (kinda) | transloadit_uppy | train | js,js |
cae65bca8338e9f8d4c867530165cfea9bc1fdeb | diff --git a/python/dllib/src/bigdl/dllib/utils/nest.py b/python/dllib/src/bigdl/dllib/utils/nest.py
index <HASH>..<HASH> 100644
--- a/python/dllib/src/bigdl/dllib/utils/nest.py
+++ b/python/dllib/src/bigdl/dllib/utils/nest.py
@@ -18,7 +18,10 @@ import six
def flatten(seq):
if isinstance(seq, list):
- return seq
+ results = []
+ for item in seq:
+ results.extend(flatten(item))
+ return results
if isinstance(seq, tuple):
seq = list(seq)
@@ -29,7 +32,10 @@ def flatten(seq):
if isinstance(seq, dict):
sorted_keys = sorted(seq.keys())
- return [seq[v] for v in sorted_keys]
+ result = []
+ for key in sorted_keys:
+ result.extend(flatten(seq[key]))
+ return result
return [seq] | Follow up supporting DataFrame in TFDataset (#<I>)
* Fix TFDataset.from_dataframe
* clean up | intel-analytics_BigDL | train | py |
be16b78bc2afc49c439559709672c19f9a5a70f1 | diff --git a/scripts/plugins.js b/scripts/plugins.js
index <HASH>..<HASH> 100644
--- a/scripts/plugins.js
+++ b/scripts/plugins.js
@@ -8,6 +8,7 @@ const filesize = require('rollup-plugin-filesize');
// const builtins = require('rollup-plugin-node-builtins')
// const presetReact = require('babel-preset-react');
+const presetEnv = require('@babel/preset-env');
exports.getPlugins = ({ libs, minify, replace }) => {
const plugins = [];
@@ -47,7 +48,7 @@ exports.getPlugins = ({ libs, minify, replace }) => {
// externalHelpers: true,
// runtimeHelpers: true
presets: [
- ['@babel/preset-env', {
+ [presetEnv, {
useBuiltIns: 'usage', // 'entry'
targets: { ie: 11 },
debug: false | fix babel preset env not found in project | thisconnect_tools | train | js |
10acdce3866a5039ff0a537c428665f3be141c2e | diff --git a/bokeh/models/glyphs.py b/bokeh/models/glyphs.py
index <HASH>..<HASH> 100644
--- a/bokeh/models/glyphs.py
+++ b/bokeh/models/glyphs.py
@@ -8,8 +8,8 @@ from __future__ import absolute_import
from ..enums import Direction, Anchor
from ..mixins import FillProps, LineProps, TextProps
from ..plot_object import PlotObject
-from ..properties import (abstract, AngleSpec, Any, Array, Bool, Dict, DistanceSpec, Enum, Float,
- Include, Instance, NumberSpec, StringSpec, String, Int)
+from ..properties import (abstract, AngleSpec, Bool, DistanceSpec, Enum, Float,
+ Include, Instance, NumberSpec, StringSpec)
from .mappers import LinearColorMapper
@@ -228,7 +228,7 @@ class Gear(Glyph):
How many teeth the gears have. [int]
""")
- pressure_angle = NumberSpec(default=20, help= """
+ pressure_angle = NumberSpec(default=20, help="""
The complement of the angle between the direction that the teeth
exert force on each other, and the line joining the centers of the
two gears. [deg] | fixed flake8 related issues in models/glyphs.py | bokeh_bokeh | train | py |
a420f7ca0634f3d2b95b331036f879f5010161ce | diff --git a/hijack_admin/tests/test_checks.py b/hijack_admin/tests/test_checks.py
index <HASH>..<HASH> 100644
--- a/hijack_admin/tests/test_checks.py
+++ b/hijack_admin/tests/test_checks.py
@@ -77,6 +77,7 @@ else:
class CustomAdminSite(admin.AdminSite):
pass
+ _default_site = admin.site
admin.site = CustomAdminSite()
admin.autodiscover()
@@ -86,3 +87,4 @@ else:
self.assertFalse(warnings)
admin.site.unregister(get_user_model())
+ admin.site = _default_site | Put back admin.site to default at the end of the test | arteria_django-hijack-admin | train | py |
2a6e02ecb45ea82ba46e044b8f81c552090b2cb5 | diff --git a/test/run.py b/test/run.py
index <HASH>..<HASH> 100755
--- a/test/run.py
+++ b/test/run.py
@@ -181,6 +181,8 @@ if not url_server_run([
[ 'api/uptime/', 200 ],
[ 'favicon.ico', 304, { 'eTag': '8f471f65' } ],
[ 'favicon.ico', 200, { 'eTag': 'deadbeef' } ],
+ # [ '/', 404 ],
+ # [ '/../', 404 ],
# [ 'example/example.py', 404 ], TODO
# [ 'example/', 304, { 'eTag': '???' } ], TODO
]): | add more potential tests that require fixing something in the server | JosuaKrause_quick_server | train | py |
ec6a339338f59a966b439bba85f84d0b062c0dbb | diff --git a/benchexec/tools/symbiotic.py b/benchexec/tools/symbiotic.py
index <HASH>..<HASH> 100644
--- a/benchexec/tools/symbiotic.py
+++ b/benchexec/tools/symbiotic.py
@@ -99,9 +99,27 @@ class Tool(OldSymbiotic):
return False
+ def _timeoutReason(self, output):
+ lastphase = 'unknown'
+ for line in output:
+ if line.startswith('INFO: Starting instrumentation'):
+ lastphase='instrumentation'
+ elif line.startswith('INFO: Instrumentation time'):
+ lastphase='instr-finished'
+ elif line.startswith('INFO: Starting slicing'):
+ lastphase='slicing'
+ elif line.startswith('INFO: Total slicing time'):
+ lastphase='slicing-finished'
+ elif line.startswith('INFO: Starting verification'):
+ lastphase='verification'
+ elif line.startswith('INFO: Verification time'):
+ lastphase='verification-finished'
+
+ return lastphase
+
def determine_result(self, returncode, returnsignal, output, isTimeout):
if isTimeout:
- return 'timeout'
+ return self._timeoutReason(output)
if output is None:
return 'error (no output)' | tools/symbiotic.py: give the place of timeouting
Instead of 'TIMEOUT(timeout)' say something like
'TIMEOUT(instrumentation)'. | sosy-lab_benchexec | train | py |
423b7ead5a530f419c6aa476173f7ea98d7e379d | diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/Assignments.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/Assignments.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/Assignments.java
+++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/plan/Assignments.java
@@ -164,6 +164,27 @@ public class Assignments
return assignments.size();
}
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+
+ Assignments that = (Assignments) o;
+
+ return assignments.equals(that.assignments);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return assignments.hashCode();
+ }
+
public static class Builder
{
private final Map<Symbol, Expression> assignments = new LinkedHashMap<>(); | Add Assignments#equals() and Assignments#hashCode() | prestodb_presto | train | java |
c473fc179b8c7dba9912c6f29d9d755041e79d7b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,8 +12,8 @@ setup(
url = 'https://github.com/blakev/python-syncthing',
license = 'The MIT License',
install_requires = [
- 'python-dateutil==2.6.1',
- 'requests==2.20.0'
+ 'python-dateutil==2.8.1',
+ 'requests==2.24.0'
],
extras_require = {
'dev': [
@@ -41,6 +41,7 @@ setup(
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Topic :: System :: Archiving :: Mirroring'
],
)
\ No newline at end of file | Bump deps, declare python <I> support | blakev_python-syncthing | train | py |
edd840d95783ef982e9cb18e346a9bc0dec3df05 | diff --git a/spyder/widgets/ipythonconsole/shell.py b/spyder/widgets/ipythonconsole/shell.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/ipythonconsole/shell.py
+++ b/spyder/widgets/ipythonconsole/shell.py
@@ -37,7 +37,6 @@ class ShellWidget(NamepaceBrowserWidget, HelpWidget, DebuggingWidget):
sig_namespace_view = Signal(object)
sig_var_properties = Signal(object)
sig_get_value = Signal()
- sig_got_reply = Signal()
# For DebuggingWidget
sig_input_reply = Signal()
@@ -47,6 +46,7 @@ class ShellWidget(NamepaceBrowserWidget, HelpWidget, DebuggingWidget):
# For ShellWidget
focus_changed = Signal()
new_client = Signal()
+ sig_got_reply = Signal()
def __init__(self, additional_options, interpreter_versions, *args, **kw):
# To override the Qt widget used by RichJupyterWidget | IPython Console: Move a signal to the right place | spyder-ide_spyder | train | py |
b16eaa9f73cd6910f444edfd4bf40b6ffb40ddeb | diff --git a/clients/python/girder_client/__init__.py b/clients/python/girder_client/__init__.py
index <HASH>..<HASH> 100644
--- a/clients/python/girder_client/__init__.py
+++ b/clients/python/girder_client/__init__.py
@@ -454,7 +454,7 @@ class GirderClient:
**kwargs)
# If success, return the json object. Otherwise throw an exception.
- if result.status_code in (200, 201):
+ if result.ok:
if jsonResp:
return result.json()
else: | girder_client: Test for response success with `result.ok` | girder_girder | train | py |
25533e46f689d575d94f915294577f3ddf1d5fb0 | diff --git a/src/adapt/toc.js b/src/adapt/toc.js
index <HASH>..<HASH> 100644
--- a/src/adapt/toc.js
+++ b/src/adapt/toc.js
@@ -152,7 +152,7 @@ adapt.toc.TOCView.prototype.makeCustomRenderer = function(xmldoc) {
};
/**
- * @param {HTMLElement} elem
+ * @param {!HTMLElement} elem
* @param {adapt.vgen.Viewport} viewport
* @param {number} width
* @param {number} height
diff --git a/src/adapt/vtree.js b/src/adapt/vtree.js
index <HASH>..<HASH> 100644
--- a/src/adapt/vtree.js
+++ b/src/adapt/vtree.js
@@ -80,7 +80,7 @@ adapt.vtree.makeListener = function(refs, action) {
};
/**
- * @param {HTMLElement} container
+ * @param {!HTMLElement} container
* @constructor
* @extends {adapt.base.SimpleEventTarget}
*/ | Refine type annotation (add non-null constraint) | vivliostyle_vivliostyle.js | train | js,js |
05f794b21a4746cb46336bda2a0227925938771d | diff --git a/config/environments/production.rb b/config/environments/production.rb
index <HASH>..<HASH> 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -100,6 +100,7 @@ Rails.application.configure do
# Exception Notification
config.middleware.use ExceptionNotification::Rack,
+ :ignore_crawlers => %w{Googlebot bingbot SeznamBot Baiduspider},
:email => {
:email_prefix => "[Prezento Error] ",
:sender_address => %{"mezurometrics" <mezurometrics@gmail.com>}, | Ignore exceptions produced by crawlers | mezuro_prezento | train | rb |
a30f1c432f4ae4ff25b0ef2ccb390218e24d2508 | diff --git a/safe/impact_functions/earthquake/earthquake_building_impact.py b/safe/impact_functions/earthquake/earthquake_building_impact.py
index <HASH>..<HASH> 100644
--- a/safe/impact_functions/earthquake/earthquake_building_impact.py
+++ b/safe/impact_functions/earthquake/earthquake_building_impact.py
@@ -30,7 +30,7 @@ class EarthquakeBuildingImpactFunction(FunctionProvider):
('medium_threshold', 7),
('high_threshold', 8),
('postprocessors', OrderedDict([
- ('AggregationCategorical', {'on': False})]))
+ ('AggregationCategorical', {'on': True})]))
])
def run(self, layers): | turned on aggregation categorical as default for eq building impact function | inasafe_inasafe | train | py |
f3cbf679ef5fad3b30794a190719eaa6419b1286 | diff --git a/src/NestableTrait.php b/src/NestableTrait.php
index <HASH>..<HASH> 100644
--- a/src/NestableTrait.php
+++ b/src/NestableTrait.php
@@ -1,7 +1,7 @@
<?php namespace Nestable;
use Illuminate\Database\Eloquent\Collection;
-use GC\Services\Nestable\NestableService;
+use Nestable\Service\NestableService;
trait NestableTrait {
diff --git a/src/config/nestable.php b/src/config/nestable.php
index <HASH>..<HASH> 100644
--- a/src/config/nestable.php
+++ b/src/config/nestable.php
@@ -0,0 +1,23 @@
+<?php
+
+return [
+ 'parent'=> 'parent_id',
+ 'primary_key' => 'id',
+ 'cache' => false,
+ 'generate_url' => false,
+ 'childNode' => 'child',
+ 'body' => [
+ 'id',
+ 'name',
+ 'slug',
+ ],
+ 'html' => [
+ 'label' => 'name',
+ 'href' => 'slug'
+ ],
+ 'dropdown' => [
+ 'prefix' => '',
+ 'label' => 'name',
+ 'value' => 'id'
+ ]
+]; | edited namespaces and config file | atayahmet_laravel-nestable | train | php,php |
80e7a622456a7f6ebaf0d61fe3be362f7ba9fb20 | diff --git a/tests/test_plugin_parser.py b/tests/test_plugin_parser.py
index <HASH>..<HASH> 100644
--- a/tests/test_plugin_parser.py
+++ b/tests/test_plugin_parser.py
@@ -26,8 +26,16 @@ def test_pathdirs():
def test_add_plugins():
path_dirs = PathDirs()
+ invalid_dirs = PathDirs(base_dir="/tmp/")
+ invalid2_dirs = PathDirs(plugin_repos="core/")
plugin_parser.add_plugins(path_dirs, "https://github.com/CyberReboot/vent-plugins.git")
+ plugin_parser.add_plugins(invalid_dirs, "https://github.com/CyberReboot/vent-plugins.git")
+ plugin_parser.add_plugins(path_dirs, "test")
+ plugin_parser.add_plugins(path_dirs, "")
+ plugin_parser.add_plugins(invalid2_dirs, "https://github.com/template-change")
def test_remove_plugins():
path_dirs = PathDirs()
+ invalid_dirs = PathDirs(base_dir="/tmp/")
plugin_parser.remove_plugins(path_dirs, "https://github.com/CyberReboot/vent-plugins.git")
+ plugin_parser.remove_plugins(invalid_dirs, "vent-plugins") | Some more tests to increase coverage for plugin_parser: add/remove | CyberReboot_vent | train | py |
a586b88031b94279fd437c49c67b0622c58e5264 | diff --git a/js/chrome/beta.js b/js/chrome/beta.js
index <HASH>..<HASH> 100644
--- a/js/chrome/beta.js
+++ b/js/chrome/beta.js
@@ -15,5 +15,18 @@
this.active = localStorage.getItem('beta') == 'true' || false;
if (this.active) this.on();
+ this.home = function (name) {
+ jsbin.settings.home = name; // will save later
+
+ // cookie is required to share with the server so we can do a redirect on new bin
+ var date = new Date();
+ date.setTime(date.getTime()+(365*24*60*60*1000)); // set for a year
+ document.cookie = 'home=' + name + '; expires=' + date.toGMTString() + ' path=/';
+
+ if (location.pathname == '/') {
+ location.reload();
+ }
+ };
+
//= require "stream"
}).call(jsbin);
\ No newline at end of file | Coming support for personalisation of bins saved. | jsbin_jsbin | train | js |
7d44158c3205b1532ff70ed8b4b362857c65ad8d | diff --git a/src/Role.php b/src/Role.php
index <HASH>..<HASH> 100644
--- a/src/Role.php
+++ b/src/Role.php
@@ -41,6 +41,39 @@ final class Role {
// const XXX = 268435456;
// const XXX = 536870912;
+ /**
+ * Returns an array mapping the numerical role values to their descriptive names
+ *
+ * @return array
+ */
+ public static function getMap() {
+ $reflectionClass = new \ReflectionClass(static::class);
+
+ return \array_flip($reflectionClass->getConstants());
+ }
+
+ /**
+ * Returns the descriptive role names
+ *
+ * @return string[]
+ */
+ public static function getNames() {
+ $reflectionClass = new \ReflectionClass(static::class);
+
+ return \array_keys($reflectionClass->getConstants());
+ }
+
+ /**
+ * Returns the numerical role values
+ *
+ * @return int[]
+ */
+ public static function getValues() {
+ $reflectionClass = new \ReflectionClass(static::class);
+
+ return \array_values($reflectionClass->getConstants());
+ }
+
private function __construct() {}
} | Implement methods 'getMap', 'getNames' and 'getValues' in class 'Role' | delight-im_PHP-Auth | train | php |
7006943e0e9b933386318f4ac03ca65e584d0c0a | diff --git a/benchexec/containerexecutor.py b/benchexec/containerexecutor.py
index <HASH>..<HASH> 100644
--- a/benchexec/containerexecutor.py
+++ b/benchexec/containerexecutor.py
@@ -386,7 +386,8 @@ class ContainerExecutor(baseexecutor.BaseExecutor):
"""
assert self._use_namespaces
- env.update(self._env_override)
+ if root_dir is None:
+ env.update(self._env_override)
args = self._build_cmdline(args, env=env) | Change env to only update its 'home'-value when no root dir is provided | sosy-lab_benchexec | train | py |
ba2176ac6ed8d8bf501e84fc6a9bbe1f744e9980 | diff --git a/picoweb/__init__.py b/picoweb/__init__.py
index <HASH>..<HASH> 100644
--- a/picoweb/__init__.py
+++ b/picoweb/__init__.py
@@ -74,6 +74,8 @@ class WebApp:
else:
self.pkg = ""
if static:
+ if self.pkg:
+ static = self.pkg + "/" + static
self.url_map.append((re.compile("^/static(/.+)"),
lambda req, resp: (yield from sendfile(resp, static + req.url_match.group(1)))))
self.mounts = [] | Include package path in static folder path. | pfalcon_picoweb | train | py |
8c2691f520aaa766d67ac1bdf9c875520906e902 | diff --git a/src/Filter/FilterUrlBuilder.php b/src/Filter/FilterUrlBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Filter/FilterUrlBuilder.php
+++ b/src/Filter/FilterUrlBuilder.php
@@ -454,7 +454,7 @@ class FilterUrlBuilder
foreach ($request->request->all() as $name => $value) {
if (is_array($value)) {
- $value = implode(',', array_filter($value));
+ $value = implode(',', $value);
}
if (in_array($name, $options['postAsSlug'])) {
$filterUrl->setSlug($name, $value); | Do not filter empty values
Range and from/to will not work otherwise | MetaModels_core | train | php |
464aea39a81db88407da99069d5f65dd7a58276b | diff --git a/ui/src/shared/components/Notifications.js b/ui/src/shared/components/Notifications.js
index <HASH>..<HASH> 100644
--- a/ui/src/shared/components/Notifications.js
+++ b/ui/src/shared/components/Notifications.js
@@ -2,7 +2,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
-import Notification from 'src/shared/components/Notification'
+import Notification from 'shared/components/Notification'
const Notifications = ({notifications, inPresentationMode}) =>
<div | Replace reference to src/shared/ with shared/ | influxdata_influxdb | train | js |
a2cc2d7cc89c763ac87ca353d90e2d0303fc2861 | diff --git a/docs/sphinx_util.py b/docs/sphinx_util.py
index <HASH>..<HASH> 100644
--- a/docs/sphinx_util.py
+++ b/docs/sphinx_util.py
@@ -35,6 +35,13 @@ def build_scala_docs(root_path):
for doc_file in scaladocs:
subprocess.call('cd ' + scala_path + ';mv ' + doc_file + ' ' + dest_path, shell = True)
+def convert_md_phase(phase):
+ try:
+ import pypandoc
+ except:
+ return phase
+ return pypandoc.convert(phase, 'rst', format='md')
+
def build_table(table):
if len(table) < 3:
return ''
@@ -56,7 +63,7 @@ def build_table(table):
out += ' * - '
else:
out += ' - '
- out += c + '\n'
+ out += convert_md_phase(c)+ '\n'
out += '```\n'
return out
@@ -91,7 +98,6 @@ def convert_md_table(root_path):
print 'converted %d tables in %s' % (num_table, f)
with codecs.open(f, 'w', 'utf-8') as i:
i.write(output)
- print len(files)
subprocess.call('./build-notebooks.sh') | [docs] also convert md sentencies in a table into rst (#<I>) | apache_incubator-mxnet | train | py |
ba099632b24699ea4f9b4edceb3c1d3293d98d43 | diff --git a/spec/apn/jobs_spec.rb b/spec/apn/jobs_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/apn/jobs_spec.rb
+++ b/spec/apn/jobs_spec.rb
@@ -7,6 +7,7 @@ if defined? Sidekiq
it { should be_a(Sidekiq::Worker) }
it "has the right queue name" do
+ pending
expect(subject.class.instance_variable_get(:@queue)).to eq(APN::Jobs::QUEUE_NAME)
end
end | mark broken test as pending for now | arthurnn_apn_sender | train | rb |
36d2357735b5b7c52db15c602a47877469bcbe2c | diff --git a/carrot/messaging.py b/carrot/messaging.py
index <HASH>..<HASH> 100644
--- a/carrot/messaging.py
+++ b/carrot/messaging.py
@@ -36,7 +36,7 @@ class Message(object):
"""Reject this message.
The message will then be discarded by the server.
"""
- return self.channel.basic_reject(self.delivery_tag)
+ return self.channel.basic_reject(self.delivery_tag, requeue=False)
def requeue(self):
"""Reject this message and put it back on the queue. | requeue is a requirement argument to basic_reject. | ask_carrot | train | py |
be228b6e184f974c3bc2bd0d2f40a1e464e6e43b | diff --git a/lib/metadata/VmConfig/VmConfig.rb b/lib/metadata/VmConfig/VmConfig.rb
index <HASH>..<HASH> 100644
--- a/lib/metadata/VmConfig/VmConfig.rb
+++ b/lib/metadata/VmConfig/VmConfig.rb
@@ -390,7 +390,10 @@ class VmConfig
creds = $miqHostCfg.ems[$miqHostCfg.emsLocal]
elsif $miqHostCfg.vimHost
c = $miqHostCfg.vimHost
- return nil if c[:username].nil?
+ if c[:username].nil?
+ $log.warn "Host credentials are missing: skipping snapshot information."
+ return nil
+ end
creds = {'host' => (c[:hostname] || c[:ipaddress]), 'user' => c[:username], 'password' => c[:password], 'use_vim_broker' => c[:use_vim_broker]}
end
end
@@ -611,7 +614,12 @@ class VmConfig
hostVim = nil
if miqvm.vim.isVirtualCenter?
hostVim = connect_to_host_vim('snapshot_metadata', miqvm.vmConfigFile)
- return if hostVim.nil?
+
+ if hostVim.nil?
+ $log.warn "Snapshots information will be skipped due to EMS host missing credentials."
+ return
+ end
+
vimDs = hostVim.getVimDataStore(ds)
else
vimDs = miqvm.vim.getVimDataStore(ds) | Add waning messages when snapshots missed due to host credentials | ManageIQ_manageiq-smartstate | train | rb |
898c6825eb3bc43e9a8e7085833c08fd6aa5778c | diff --git a/openpnm/core/_models.py b/openpnm/core/_models.py
index <HASH>..<HASH> 100644
--- a/openpnm/core/_models.py
+++ b/openpnm/core/_models.py
@@ -233,6 +233,28 @@ class ModelWrapper(dict):
This class is used to hold individual models and provide some extra
functionality, such as pretty-printing.
"""
+
+ def __call__(self):
+ f = self['model']
+ target = self._find_parent()
+ kwargs = self.copy()
+ for kw in ['regen_mode', 'target', 'model']:
+ kwargs.pop(kw, None)
+ vals = f(target=target, **kwargs)
+ return vals
+
+ def _find_parent(self):
+ r"""
+ Finds and returns the parent object to self.
+ """
+ for proj in ws.values():
+ for obj in proj:
+ if hasattr(obj, "models"):
+ for mod in obj.models.keys():
+ if obj.models[mod] is self:
+ return obj
+ raise Exception("No parent object found!")
+
@property
def propname(self):
for proj in ws.values(): | Giving model wrappers the ability to 'call' themselves | PMEAL_OpenPNM | train | py |
c2a1e5abd1933b62ccd8d1761a0fd730f3e60c8b | diff --git a/rllib/agents/dqn/simple_q.py b/rllib/agents/dqn/simple_q.py
index <HASH>..<HASH> 100644
--- a/rllib/agents/dqn/simple_q.py
+++ b/rllib/agents/dqn/simple_q.py
@@ -17,7 +17,10 @@ from ray.rllib.agents.dqn.simple_q_torch_policy import SimpleQTorchPolicy
from ray.rllib.agents.trainer import Trainer
from ray.rllib.agents.trainer_config import TrainerConfig
from ray.rllib.utils.metrics import SYNCH_WORKER_WEIGHTS_TIMER
-from ray.rllib.utils.replay_buffers.utils import validate_buffer_config
+from ray.rllib.utils.replay_buffers.utils import (
+ validate_buffer_config,
+ update_priorities_in_replay_buffer,
+)
from ray.rllib.execution.rollout_ops import (
synchronous_parallel_sample,
)
@@ -352,6 +355,14 @@ class SimpleQTrainer(Trainer):
else:
train_results = multi_gpu_train_one_step(self, train_batch)
+ # Update replay buffer priorities.
+ update_priorities_in_replay_buffer(
+ self.local_replay_buffer,
+ self.config,
+ train_batch,
+ train_results,
+ )
+
# TODO: Move training steps counter update outside of `train_one_step()` method.
# # Update train step counters.
# self._counters[NUM_ENV_STEPS_TRAINED] += train_batch.env_steps() | [RLlib] Prioritized Replay (if required) in SimpleQ and DDPG. (#<I>) | ray-project_ray | train | py |
e6a67960ec8ca0cd910426015c634a27791805fc | diff --git a/lib/benchmark_driver/runner/time.rb b/lib/benchmark_driver/runner/time.rb
index <HASH>..<HASH> 100644
--- a/lib/benchmark_driver/runner/time.rb
+++ b/lib/benchmark_driver/runner/time.rb
@@ -6,7 +6,7 @@ class BenchmarkDriver::Runner::Time < BenchmarkDriver::Runner::Ips
# Dynamically fetched and used by `BenchmarkDriver::JobParser.parse`
JobParser = BenchmarkDriver::DefaultJobParser.for(Job)
- METRICS_TYPE = BenchmarkDriver::Metrics::Type.new(unit: 's')
+ METRICS_TYPE = BenchmarkDriver::Metrics::Type.new(unit: 's', larger_better: false)
# Overriding BenchmarkDriver::Runner::Ips#set_metrics_type
def set_metrics_type | Fix time runner to regard small number as better | benchmark-driver_benchmark-driver | train | rb |
dc1cc65aea0aed9adf01bc2e89f40a3bc438ffae | diff --git a/app/models/curated_list.rb b/app/models/curated_list.rb
index <HASH>..<HASH> 100644
--- a/app/models/curated_list.rb
+++ b/app/models/curated_list.rb
@@ -4,6 +4,9 @@ class CuratedList
include Mongoid::Document
include Mongoid::Timestamps
+ include Taggable
+ stores_tags_for :sections
+
field "slug", type: String
field "artefact_ids", type: Array, default: [] # order is important
diff --git a/test/models/curated_list_test.rb b/test/models/curated_list_test.rb
index <HASH>..<HASH> 100644
--- a/test/models/curated_list_test.rb
+++ b/test/models/curated_list_test.rb
@@ -6,4 +6,14 @@ class CuratedListTest < ActiveSupport::TestCase
assert !cl.valid?
assert cl.errors[:slug].any?, "Doesn't have error on slug"
end
+
+ test "should include ability to have a section tag" do
+ cl = FactoryGirl.create(:curated_list)
+ tag = FactoryGirl.create(:tag, tag_id: 'batman', title: 'Batman', tag_type: 'section')
+
+ cl.sections = ['batman']
+ cl.save
+
+ assert_equal [tag], cl.sections
+ end
end
\ No newline at end of file | Make curated lists taggable
Primary use case for this is to enable a curated list to be tagged with a single section. | alphagov_govuk_content_models | train | rb,rb |
f7f7d35ff2804566400bf691667866f20a6dac94 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -18,6 +18,7 @@ general_requirements = [
]
api_requirements = [
+ 'markupsafe == 2.0.1', # While flask revision < 2
'flask == 1.1.4',
'flask-cors == 3.0.10',
'gunicorn >= 20.0.0, < 21.0.0', | Fix MarkupSafe revision
As dependency of Flask <I> through Jinja2 <I> | openfisca_openfisca-core | train | py |
413013e537172eb5e69ca670ec10984288a09d76 | diff --git a/lib/metriks/timer.rb b/lib/metriks/timer.rb
index <HASH>..<HASH> 100644
--- a/lib/metriks/timer.rb
+++ b/lib/metriks/timer.rb
@@ -12,6 +12,10 @@ module Metriks
@interval = Hitimes::Interval.now
end
+ def restart
+ @interval.split
+ end
+
def stop
@interval.stop
@timer.update(@interval.duration) | Add restart() method to Timer context to restart timing | eric_metriks | train | rb |
e991b929369008e39d069add17c010b6c81ccb95 | diff --git a/src/main/java/com/deathrayresearch/outlier/columns/packeddata/PackedLocalDateTime.java b/src/main/java/com/deathrayresearch/outlier/columns/packeddata/PackedLocalDateTime.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/deathrayresearch/outlier/columns/packeddata/PackedLocalDateTime.java
+++ b/src/main/java/com/deathrayresearch/outlier/columns/packeddata/PackedLocalDateTime.java
@@ -91,11 +91,11 @@ public class PackedLocalDateTime {
return (((long) date) << 32) | (time & 0xffffffffL);
}
- static int date(long packedDateTIme) {
+ public static int date(long packedDateTIme) {
return (int) (packedDateTIme >> 32);
}
- static int time(long packedDateTIme) {
+ public static int time(long packedDateTIme) {
return (int) packedDateTIme;
} | fixed access level in PackedLocalDateTime | jtablesaw_tablesaw | train | java |
d1098c5df46df31991557cd51696b52cf6aa8883 | diff --git a/src/main/java/org/jboss/pressgang/ccms/docbook/processing/DocbookXMLPreProcessor.java b/src/main/java/org/jboss/pressgang/ccms/docbook/processing/DocbookXMLPreProcessor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/pressgang/ccms/docbook/processing/DocbookXMLPreProcessor.java
+++ b/src/main/java/org/jboss/pressgang/ccms/docbook/processing/DocbookXMLPreProcessor.java
@@ -259,7 +259,7 @@ public class DocbookXMLPreProcessor {
document.getDocumentElement().appendChild(additionalXMLEditorLinkPara);
final Element editorULink = document.createElement("ulink");
- editorLinkPara.appendChild(editorULink);
+ additionalXMLEditorLinkPara.appendChild(editorULink);
editorULink.setTextContent("Edit the Additional Translated XML");
editorULink.setAttribute("url", additionalXMLEditorUrl);
} | Fixed a bug where the additional xml editor link was being included in the wrong para. | pressgang-ccms_PressGangCCMSContentSpec | train | java |
dc5300adb6d46252c26e239ac67e3ca6e5e2d77b | diff --git a/actionpack/lib/action_dispatch/http/mime_negotiation.rb b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/http/mime_negotiation.rb
+++ b/actionpack/lib/action_dispatch/http/mime_negotiation.rb
@@ -48,7 +48,7 @@ module ActionDispatch
@env["action_dispatch.request.formats"] ||=
if parameters[:format]
Array(Mime[parameters[:format]])
- elsif xhr? || (accept && !accept.include?(?,))
+ elsif xhr? || (accept && accept !~ /,\s*\*\/\*/)
accepts
else
[Mime::HTML]
@@ -87,4 +87,4 @@ module ActionDispatch
end
end
end
-end
\ No newline at end of file
+end | Slightly less annoying check for acceptable mime_types. This allows Accept: application/json, application/jsonp (and the like), but still blacklists browsers. Essentially, we use normal content negotiation unless you include */* in your list, in which case we assume you're a browser and send HTML [#<I> state:resolved] | rails_rails | train | rb |
402cc7b5d68775ada6c4c123066f2f01591e9472 | diff --git a/src/Password/Rule.php b/src/Password/Rule.php
index <HASH>..<HASH> 100644
--- a/src/Password/Rule.php
+++ b/src/Password/Rule.php
@@ -394,9 +394,10 @@ class Rule extends Relational
* @param array $rules
* @param mixed $user
* @param string $name
+ * @param bool $isNew
* @return array
*/
- public static function verify($password, $rules, $user, $name=null)
+ public static function verify($password, $rules, $user, $name=null, $isNew=true)
{
if (empty($rules))
{
@@ -581,7 +582,7 @@ class Rule extends Relational
$current = Password::getInstance($user);
// [HUBZERO][#10274] Check the current password too
- if (Password::passwordMatches($user, $password, true))
+ if ($isNew && Password::passwordMatches($user, $password, true))
{
$fail[] = $rule['failuremsg'];
} | Adding flag to indicate is an existing or new password is being rule checked (#<I>) | hubzero_framework | train | php |
92106d0f70664ee2ae129d962df343577ad3931d | diff --git a/packages/vaex-core/vaex/remote.py b/packages/vaex-core/vaex/remote.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-core/vaex/remote.py
+++ b/packages/vaex-core/vaex/remote.py
@@ -120,7 +120,7 @@ class ServerRest(object):
self.io_loop.make_current()
# if async:
self.http_client_async = AsyncHTTPClient()
- self.http_client = HTTPClient()
+ # self.http_client = HTTPClient()
self.user_id = vaex.settings.webclient.get("cookie.user_id")
self.use_websocket = websocket
self.websocket = None
@@ -135,7 +135,7 @@ class ServerRest(object):
def close(self):
# self.http_client_async.
- self.http_client.close()
+ # self.http_client.close()
if self.use_websocket:
if self.websocket:
self.websocket.close() | fix(remote): only use async websocket/http, since sync conflicts with kernel ioloop | vaexio_vaex | train | py |
08b2ee1af3c6934e56079f9b0c5aae903a2013a6 | diff --git a/openquake/commands/webui.py b/openquake/commands/webui.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/webui.py
+++ b/openquake/commands/webui.py
@@ -39,7 +39,7 @@ def webui(cmd, hostport='127.0.0.1:8800'):
"""
db_path = os.path.expanduser(config.get('dbserver', 'file'))
- if not os.access(db_path, os.W_OK):
+ if os.path.isfile(db_path) and not os.access(db_path, os.W_OK):
sys.exit('This command must be run by the proper user: '
'see the documentation for details')
if cmd == 'start': | Allow the WebUI to bootstrap the DB
Former-commit-id: <I>dbd<I>a4e9c<I>ecdef1aabb<I> | gem_oq-engine | train | py |
0c1c9e57b5f9921ab9cd518d44b14e2854769008 | diff --git a/libraries/client.js b/libraries/client.js
index <HASH>..<HASH> 100644
--- a/libraries/client.js
+++ b/libraries/client.js
@@ -519,6 +519,7 @@ client.prototype._fastReconnectMessage = function(message) {
/* Connect to the server */
client.prototype.connect = function() {
var self = this;
+ var deferred = q.defer();
var connection = self.options.connection || {};
@@ -527,6 +528,8 @@ client.prototype.connect = function() {
var serverType = connection.serverType || 'chat';
servers.getServer(self, serverType, preferredServer, preferredPort, function(server){
+ deferred.resolve(true);
+
var authenticate = function authenticate() {
var identity = self.options.identity || {};
var nickname = identity.username || 'justinfan' + Math.floor((Math.random() * 80000) + 1000);
@@ -543,6 +546,8 @@ client.prototype.connect = function() {
self.socket.pipe(self.stream);
});
+
+ return deferred.promise;
};
/* Gracefully reconnect to the server */ | Method connect() is now supporting promises. | twitch-irc_twitch-irc | train | js |
6be90e643ab6cec5089880a6ad77d72df0deec81 | diff --git a/tests/cases/analysis/LoggerTest.php b/tests/cases/analysis/LoggerTest.php
index <HASH>..<HASH> 100644
--- a/tests/cases/analysis/LoggerTest.php
+++ b/tests/cases/analysis/LoggerTest.php
@@ -18,7 +18,16 @@ use lithium\tests\mocks\analysis\MockLoggerAdapter;
class LoggerTest extends \lithium\test\Unit {
public function skip() {
- $this->_testPath = Libraries::get(true, 'resources') . '/tmp/tests';
+ $path = Libraries::get(true, 'resources');
+
+ if (is_writable($path)) {
+ foreach (array("{$path}/tmp/tests", "{$path}/tmp/logs") as $dir) {
+ if (!is_dir($dir)) {
+ mkdir($dir, 0777, true);
+ }
+ }
+ }
+ $this->_testPath = "{$path}/tmp/tests";
$this->skipIf(!is_writable($this->_testPath), "{$this->_testPath} is not readable.");
} | `Logger` test now generates its own temp directories instead of skipping. | UnionOfRAD_lithium | train | php |
45173eea370737d4c908b2b97f5ec37e8db51e5c | diff --git a/src/main.js b/src/main.js
index <HASH>..<HASH> 100644
--- a/src/main.js
+++ b/src/main.js
@@ -33,6 +33,6 @@ if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
if (typeof window !== "undefined") {
window["GeoTIFF"] = {parse:parse};
} else if (typeof self !== "undefined") {
- self["GeoTIFF"] = { parse: parse };
+ self["GeoTIFF"] = { parse: parse }; // jshint ignore:line
} | ignore jshint error about self being undefined | geotiffjs_geotiff.js | train | js |
f5d4656e5b6ae8da479456f3e642e38d841d7b94 | diff --git a/src/Router/IndexedRouter.php b/src/Router/IndexedRouter.php
index <HASH>..<HASH> 100644
--- a/src/Router/IndexedRouter.php
+++ b/src/Router/IndexedRouter.php
@@ -66,7 +66,7 @@ class IndexedRouter extends Router
*/
public function resolve(Request $request): ?Route
{
- foreach( $this->indexes[$request->getMethod()] as $route ){
+ foreach( $this->indexes[$request->getMethod()] ?? [] as $route ){
if( $route->matchUri($request->getPathInfo()) &&
$route->matchMethod($request->getMethod()) && | Fixing bad array access on IdexedRouter. | nimbly_Limber | train | php |
343cff1900fda198942ea4f359048a9d272bc3d0 | diff --git a/src/main/java/org/arp/javautil/collections/Collections.java b/src/main/java/org/arp/javautil/collections/Collections.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/arp/javautil/collections/Collections.java
+++ b/src/main/java/org/arp/javautil/collections/Collections.java
@@ -1,6 +1,9 @@
package org.arp.javautil.collections;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
/**
* Extra utilities for collections.
@@ -33,4 +36,22 @@ public class Collections {
return Iterators.join(c.iterator(), separator);
}
}
+
+ /**
+ * Puts a value into a map of key -> list of values. If the specified key
+ * is new, it creates an {@link ArrayList} as its value.
+ * @param map a {@link Map}.
+ * @param key a key.
+ * @param valueElt a value.
+ */
+ public static <K, V> void putList(Map<K, List<V>> map, K key, V valueElt) {
+ if (map.containsKey(key)) {
+ List<V> l = map.get(key);
+ l.add(valueElt);
+ } else {
+ List<V> l = new ArrayList<V>();
+ l.add(valueElt);
+ map.put(key, l);
+ }
+ }
} | Added Collections.putList to simplify putting new values into maps to lists. | eurekaclinical_javautil | train | java |
3cb04cb9ca295f581db9f8ac026a10d7128b83ce | diff --git a/pygsp/graphs/nngraphs/nngraph.py b/pygsp/graphs/nngraphs/nngraph.py
index <HASH>..<HASH> 100644
--- a/pygsp/graphs/nngraphs/nngraph.py
+++ b/pygsp/graphs/nngraphs/nngraph.py
@@ -92,6 +92,10 @@ class NNGraph(Graph):
N, d = np.shape(self.Xin)
Xout = self.Xin
+ if k >= N:
+ raise ValueError('The number of neighbors (k={}) must be smaller '
+ 'than the number of nodes ({}).'.format(k, N))
+
if self.center:
Xout = self.Xin - np.kron(np.ones((N, 1)),
np.mean(self.Xin, axis=0)) | error if #neighbors greater than #nodes | epfl-lts2_pygsp | train | py |
6c2775aad92b709958389b3144b48ca1f0d47f80 | diff --git a/src/components/Header/HeaderView.js b/src/components/Header/HeaderView.js
index <HASH>..<HASH> 100644
--- a/src/components/Header/HeaderView.js
+++ b/src/components/Header/HeaderView.js
@@ -26,8 +26,8 @@ const HeaderView = ({
href={githubLink}
>
On Github
- </div>
-</nav>);
+ </a>
+</div>);
HeaderView.propTypes = {
items: PropTypes.arrayOf(PropTypes.shape({ | fix: Fix syntax errors made in previous commit | finom_github-embed | train | js |
bd039ea749da4ad6c7f1bc37793da51554156ff3 | diff --git a/src/main/java/com/gistlabs/mechanize/MechanizeAgent.java b/src/main/java/com/gistlabs/mechanize/MechanizeAgent.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/gistlabs/mechanize/MechanizeAgent.java
+++ b/src/main/java/com/gistlabs/mechanize/MechanizeAgent.java
@@ -309,15 +309,10 @@ public class MechanizeAgent {
/** Returns the page object received as response to the form submit action. */
public Page submit(Form form, Parameters formParams) {
- try {
- return request(createSubmitRequest(form, formParams));
- } catch (UnsupportedEncodingException e) {
- throw new MechanizeUnsupportedEncodingException(e);
- }
+ return request(createSubmitRequest(form, formParams));
}
- private HttpRequestBase createSubmitRequest(Form form, Parameters formParams)
- throws UnsupportedEncodingException {
+ private HttpRequestBase createSubmitRequest(Form form, Parameters formParams) {
String uri = form.getUri();
HttpRequestBase request = null; | Minor Refactoring by removing unnecessary try catch block. | GistLabs_mechanize | train | java |
968f797efdd444191778292c5255f4d70f2b8126 | diff --git a/src/toil/provisioners/aws/awsProvisioner.py b/src/toil/provisioners/aws/awsProvisioner.py
index <HASH>..<HASH> 100644
--- a/src/toil/provisioners/aws/awsProvisioner.py
+++ b/src/toil/provisioners/aws/awsProvisioner.py
@@ -172,7 +172,7 @@ class AWSProvisioner(AbstractProvisioner):
for nodeType, workers in zip(nodeTypes, numWorkers):
workersCreated += self.addNodes(nodeType=nodeType, numNodes=workers, preemptable=False)
for nodeType, workers in zip(preemptableNodeTypes, numPreemptableWorkers):
- workersCreated += self.addNodes(nodeType=nodeType, numNodes=workers, preemptable=True, spotBids=self.spotBids)
+ workersCreated += self.addNodes(nodeType=nodeType, numNodes=workers, preemptable=True)
logger.info('Added %d workers', workersCreated)
return leader | Fix creation of spot instances in launchCluster | DataBiosphere_toil | train | py |
d396f5577e3156346abc320e994e241ab06648c0 | diff --git a/Template/Filter/AssetsPath.php b/Template/Filter/AssetsPath.php
index <HASH>..<HASH> 100644
--- a/Template/Filter/AssetsPath.php
+++ b/Template/Filter/AssetsPath.php
@@ -23,9 +23,7 @@ class AssetsPath extends SimpleTemplateFilter implements SimpleTemplateFilterInt
$application = Application::getInstance();
- if($application->hasNiceUris() || !($assetsPath = $application->getRelativeAssetsPath())) {
- $assetsPath = '/';
- }
+ $assetsPath = '/' . ($application->hasNiceUris() ? '' : $application->getRelativeAssetsPath());
// extend <img src="$..." ...> with path to site images
@@ -43,6 +41,7 @@ class AssetsPath extends SimpleTemplateFilter implements SimpleTemplateFilterInt
if($application->getRelativeAssetsPath() && !$application->hasNiceUris()) {
+
// src attributes
$templateString = preg_replace_callback( | Bugfix: Wrong filtering of assets path with nice uris off. | Vectrex_vxPHP | train | php |
dd79de0fe3dd36a22796b2204189563f1b9b4e7d | diff --git a/TextFormatter/ConfigBuilder.php b/TextFormatter/ConfigBuilder.php
index <HASH>..<HASH> 100644
--- a/TextFormatter/ConfigBuilder.php
+++ b/TextFormatter/ConfigBuilder.php
@@ -847,6 +847,21 @@ class ConfigBuilder
// replace (?:x)? with x?
$regexp = preg_replace('#\\(\\?:(.)\\)\\?#us', '$1?', $regexp);
+ // replace (?:x|y) with [xy]
+ $regexp = preg_replace_callback(
+ /**
+ * Here, we only try to match single letters and numbers because trying to match escaped
+ * characters is much more complicated and increases the potential of letting a bug slip
+ * by unnoticed, without much gain in return. Just letters and numbers is simply safer
+ */
+ '#\\(\\?:([\\pL\\pN](?:\\|[\\pL\\pN])*)\\)#u',
+ function($m)
+ {
+ return '[' . preg_quote(str_replace('|', '', $m[1]), '#') . ']';
+ },
+ $regexp
+ );
+
return $regexp;
} | Updated the regexp builder to produce slightly optimized regexps in some cases | s9e_TextFormatter | train | php |
c6ce2dfba892f099342cb2bac9ea470e4e1b6281 | diff --git a/jsftp.js b/jsftp.js
index <HASH>..<HASH> 100644
--- a/jsftp.js
+++ b/jsftp.js
@@ -129,7 +129,7 @@ var Ftp = module.exports = function(cfg) {
if (this.onTimeout)
this.onTimeout(new Error("FTP socket timeout"));
- self.destroy();
+ this.destroy();
}.bind(this));
socket.on("connect", function() {
diff --git a/lib/ftpPasv.js b/lib/ftpPasv.js
index <HASH>..<HASH> 100644
--- a/lib/ftpPasv.js
+++ b/lib/ftpPasv.js
@@ -10,7 +10,7 @@ var S;
try {
S = require("streamer");
} catch (e) {
- S = require("./support/streamer");
+ S = require("../support/streamer/streamer");
}
var ftpPasv = module.exports = function(host, port, mode, callback, onConnect) { | Small bugfixes of scope and require | sergi_jsftp | train | js,js |
e6a7cfd76274c718676bf69ee7a5105497595014 | diff --git a/api/grpc_server.go b/api/grpc_server.go
index <HASH>..<HASH> 100644
--- a/api/grpc_server.go
+++ b/api/grpc_server.go
@@ -49,13 +49,13 @@ func NewGrpcServer(b *server.BgpServer, hosts string) *Server {
func NewServer(b *server.BgpServer, g *grpc.Server, hosts string) *Server {
grpc.EnableTracing = false
- server := &Server{
+ s := &Server{
bgpServer: b,
grpcServer: g,
hosts: hosts,
}
- RegisterGobgpApiServer(g, server)
- return server
+ RegisterGobgpApiServer(g, s)
+ return s
}
func (s *Server) Serve() error { | api/grpc_server: Avoid name collision "server"
To improve code inspection result, this patch renames "server"
variables in NewServer() to "s" because "server" collides the
imported package name "github.com/osrg/gobgp/server". | osrg_gobgp | train | go |
34fb52cb93691a1fdb01a68bd4fa2f9bdf1e2b6c | diff --git a/openpnm/topotools/topotools.py b/openpnm/topotools/topotools.py
index <HASH>..<HASH> 100644
--- a/openpnm/topotools/topotools.py
+++ b/openpnm/topotools/topotools.py
@@ -2392,10 +2392,10 @@ def find_clusters(network, mask=[], t_labels=False):
Examples
--------
>>> import openpnm as op
- >>> from scipy import rand
+ >>> import numpy as np
>>> pn = op.network.Cubic(shape=[25, 25, 1])
- >>> pn['pore.seed'] = rand(pn.Np)
- >>> pn['throat.seed'] = rand(pn.Nt)
+ >>> pn['pore.seed'] = np.random.rand(pn.Np)
+ >>> pn['throat.seed'] = np.random.rand(pn.Nt)
""" | [ci skip] changed doc import | PMEAL_OpenPNM | train | py |
735a08c524f22c3e4066ebaeec7e6de90c9ee94c | diff --git a/src/DateRange.js b/src/DateRange.js
index <HASH>..<HASH> 100644
--- a/src/DateRange.js
+++ b/src/DateRange.js
@@ -41,13 +41,14 @@ class DateRange extends Component {
}
}
- setRange(range) {
+ setRange(range, {silent = false}={}) {
const { onChange } = this.props;
range = this.orderRange(range);
this.setState({ range });
- onChange && onChange(range);
+ if (!silent)
+ onChange && onChange(range);
}
handleSelect(date) {
@@ -99,7 +100,7 @@ class DateRange extends Component {
this.setRange({
startDate: startDate,
endDate: endDate
- });
+ }, {silent: true});
}
} | Added option "silent" to setRange | ParadeTo_react-date-range-ch | train | js |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.