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 |
|---|---|---|---|---|---|
43a8030a64d3359b360024548f9c147c92841f2b | diff --git a/oide/client/oide/components/filesystemservice/filesystemservice.spec.js b/oide/client/oide/components/filesystemservice/filesystemservice.spec.js
index <HASH>..<HASH> 100644
--- a/oide/client/oide/components/filesystemservice/filesystemservice.spec.js
+++ b/oide/client/oide/components/filesystemservice/filesystemservice.spec.js
@@ -84,6 +84,9 @@ describe('oide.filesystemservice', function(){
httpBackend.when('DELETE', /\/filebrowser\/localfiles.*/).respond(function(){
return [200, {'result': 'DELETED file'}];
});
+ httpBackend.whenGET(/\/filebrowser\/a\/fileutil\?filepath=.*&operation=GET_NEXT_DUPLICATE/).respond(function(){
+ return [200, {'filepath': '/home/saurabh/Untitled12'}];
+ });
}));
describe('Functionality of FilesystemService', function(){
@@ -123,5 +126,12 @@ describe('oide.filesystemservice', function(){
});
httpBackend.flush();
});
+ it('should be able to get the next duplicate filename', function(){
+ $filesystemservice.getNextDuplicate(files[0].filepath, function(data){
+ expect(data.originalFile).toBeDefined();
+ expect(data.filepath).toBe('/home/saurabh/Untitled12');
+ });
+ httpBackend.flush();
+ });
});
}); | add spec to get next duplicate file | SandstoneHPC_sandstone-ide | train | js |
a147979b84549a6f8a66f52487c05a8e8c7ebca0 | diff --git a/service.js b/service.js
index <HASH>..<HASH> 100755
--- a/service.js
+++ b/service.js
@@ -220,12 +220,7 @@ class ServiceConsul extends service.Service {
};
}
- const modified = super._configure(config);
-
- // TODO where does baseUrl come from ?
- delete this.consulOptions.baseUrl;
-
- return modified;
+ return super._configure(config);
}
get consul() {
diff --git a/tests/service_test.js b/tests/service_test.js
index <HASH>..<HASH> 100644
--- a/tests/service_test.js
+++ b/tests/service_test.js
@@ -20,7 +20,6 @@ describe('consul service', function () {
}, {
logLevel: 'trace',
name: 'consul',
- //port: 4713,
checkInterval: 100
}], [ServiceConsul, require('kronos-service-health-check'), require('kronos-service-koa')]).then(
manager => { | fix: no longer needed to delete this.consulOptions.baseUrl | Kronos-Integration_kronos-service-consul | train | js,js |
41381691ac83c308d0a4352f4ffbdd15e75d5e9b | diff --git a/src/Draggable/tests/Draggable.test.js b/src/Draggable/tests/Draggable.test.js
index <HASH>..<HASH> 100644
--- a/src/Draggable/tests/Draggable.test.js
+++ b/src/Draggable/tests/Draggable.test.js
@@ -414,6 +414,28 @@ describe('Draggable', () => {
.toBeInstanceOf(DragStartEvent);
});
+ test('sets dragging to false when `drag:start` event is canceled', () => {
+ const newInstance = new Draggable(containers, {
+ draggable: 'li',
+ });
+ const draggableElement = sandbox.querySelector('li');
+ document.elementFromPoint = () => draggableElement;
+
+ const callback = jest.fn((event) => {
+ event.cancel();
+ });
+ newInstance.on('drag:start', callback);
+
+ triggerEvent(draggableElement, 'mousedown', {button: 0});
+
+ // Wait for delay
+ jest.runTimersToTime(100);
+
+ triggerEvent(draggableElement, 'dragstart', {button: 0});
+
+ expect(newInstance.dragging).toBeFalsy();
+ });
+
test('triggers `drag:move` drag event on mousedown', () => {
const newInstance = new Draggable(containers, {
draggable: 'li', | test(dragging): dragging false on drag:start cancel | Shopify_draggable | train | js |
4f0e0e02e4581ab14b4eb0f8a5fbfdfe82692006 | diff --git a/service/env.go b/service/env.go
index <HASH>..<HASH> 100644
--- a/service/env.go
+++ b/service/env.go
@@ -35,6 +35,11 @@ func (e Environment) IsProduction() bool {
return e == EnvProduction
}
+// IsHosted returns true if env if prod or staging
+func (e Environment) IsHosted() bool {
+ return e == EnvProduction || e == EnvStaging
+}
+
// IsDevelopment returns true iff env is development.
func (e Environment) IsDevelopment() bool {
return e == EnvDevelopment | Add IsHosted flag for checking prod + staging. | octavore_naga | train | go |
fafc170a2509770359400bef4b94862078287055 | diff --git a/lib/Ogone/PaymentResponse.php b/lib/Ogone/PaymentResponse.php
index <HASH>..<HASH> 100644
--- a/lib/Ogone/PaymentResponse.php
+++ b/lib/Ogone/PaymentResponse.php
@@ -43,15 +43,19 @@ interface PaymentResponse extends Response
/**
* @var int
*/
- const STATUS_PAYMENT = 91;
+ const STATUS_AUTHORISATION_NOT_KNOWN = 52;
/**
* @var int
*/
- const STATUS_AUTHORISATION_NOT_KNOWN = 52;
+ const STATUS_PAYMENT = 91;
/**
* @var int
*/
const STATUS_PAYMENT_UNCERTAIN = 92;
+ /**
+ * @var int
+ */
+ const STATUS_PAYMENT_REFUSED = 93;
} | Added response status code <I> | marlon-be_marlon-ogone | train | php |
84702f1e6f00647898b5365e1575d95da79688bc | diff --git a/framework/web/Session.php b/framework/web/Session.php
index <HASH>..<HASH> 100644
--- a/framework/web/Session.php
+++ b/framework/web/Session.php
@@ -96,7 +96,9 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
public function init()
{
parent::init();
- register_shutdown_function([$this, 'close']);
+ if ($this->getIsActive()) {
+ Yii::warning("Session is already started", __METHOD__);
+ }
}
/**
@@ -129,6 +131,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
if ($this->getIsActive()) {
Yii::info('Session started', __METHOD__);
$this->updateFlashCounters();
+ register_shutdown_function([$this, 'close']);
} else {
$error = error_get_last();
$message = isset($error['message']) ? $error['message'] : 'Failed to start session.'; | 1. Added init() warning to session component
2. register_shutdown_function() for Session::close now only calls after successful session open | yiisoft_yii2 | train | php |
9b980fc6a07069ee463474ca293e02c8b560ea4d | diff --git a/staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go b/staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go
+++ b/staging/src/k8s.io/apimachinery/pkg/runtime/scheme.go
@@ -70,7 +70,7 @@ type Scheme struct {
defaulterFuncs map[reflect.Type]func(interface{})
// converter stores all registered conversion functions. It also has
- // default coverting behavior.
+ // default converting behavior.
converter *conversion.Converter
// versionPriority is a map of groups to ordered lists of versions for those groups indicating the | Fix a typo: coverting -> converting | kubernetes_kubernetes | train | go |
0a76c2bdfc090c37fb43c0ec9562c11b88f03cf6 | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -264,6 +264,12 @@ func (s *Server) close() error {
_ = sh.close()
}
+ // Server is closing, empty maps which should be reloaded on open.
+ s.shards = nil
+ s.dataNodes = nil
+ s.databases = nil
+ s.users = nil
+
return nil
} | Clear server maps on close
These maps are reloaded from the metastore on open. | influxdata_influxdb | train | go |
0d50def8030a578cd803d61464575bd134a5fe77 | diff --git a/aagent/watchers/execwatcher/exec.go b/aagent/watchers/execwatcher/exec.go
index <HASH>..<HASH> 100644
--- a/aagent/watchers/execwatcher/exec.go
+++ b/aagent/watchers/execwatcher/exec.go
@@ -8,6 +8,7 @@ import (
"context"
"encoding/json"
"fmt"
+ "math/rand"
"os"
"os/exec"
"sync"
@@ -47,6 +48,7 @@ type Properties struct {
GovernorTimeout time.Duration `mapstructure:"governor_timeout"`
OutputAsData bool `mapstructure:"parse_as_data"`
SuppressSuccessAnnounce bool `mapstructure:"suppress_success_announce"`
+ GatherInitialState bool `mapstructure:"gather_initial_state"`
Timeout time.Duration
}
@@ -160,11 +162,17 @@ func (w *Watcher) intervalWatcher(ctx context.Context, wg *sync.WaitGroup) {
defer wg.Done()
tick := time.NewTicker(w.interval)
+ if w.properties.GatherInitialState {
+ splay := time.Duration(rand.Intn(30)) * time.Second
+ w.Infof("Performing initial execution after %v", splay)
+ tick.Reset(splay)
+ }
for {
select {
case <-tick.C:
w.performWatch(ctx, false)
+ tick.Reset(w.interval)
case <-ctx.Done():
tick.Stop() | (#<I>) Support initial fast gather in execs | choria-io_go-choria | train | go |
6df632b502d8d3a32d08e9a6be1796940b01c803 | diff --git a/app/models/unique_key.rb b/app/models/unique_key.rb
index <HASH>..<HASH> 100644
--- a/app/models/unique_key.rb
+++ b/app/models/unique_key.rb
@@ -32,6 +32,7 @@ class UniqueKey < ActiveRecord::Base
viewable = new_record.viewable
end
end
+ viewable.try(:uuid) # forces uuid creation
viewable
end
end | forces uuid after all viewables creation | o2web_rails_admin_cms | train | rb |
3a604ba0bf113563b0666f06744a749a3c3b769b | diff --git a/aio/scripts/test-pwa-score.js b/aio/scripts/test-pwa-score.js
index <HASH>..<HASH> 100644
--- a/aio/scripts/test-pwa-score.js
+++ b/aio/scripts/test-pwa-score.js
@@ -79,6 +79,9 @@ function launchChromeAndRunLighthouse(url, flags, config) {
return launcher.run().
then(() => lighthouse(url, flags, config)).
+ // Avoid race condition by adding a delay before killing Chrome.
+ // (See also https://github.com/paulirish/pwmetrics/issues/63#issuecomment-282721068.)
+ then(results => new Promise(resolve => setTimeout(() => resolve(results), 1000))).
then(results => launcher.kill().then(() => results)).
catch(err => launcher.kill().then(() => { throw err; }, () => { throw err; }));
} | fix(aio): fix PWA testing on Windows (and reduce flaky-ness)
Adding a delay after Lighthouse has run and before killing the Chrome process
avoids `ECONNREFUSED` errors on Windows and will hopefully prevent such errors
occasionally appearing on CI.
Based on info in:
<URL> | angular_angular | train | js |
33f9bcd6c912d8316ffb37e7e798e072a77dd1fc | diff --git a/lib/bade/version.rb b/lib/bade/version.rb
index <HASH>..<HASH> 100644
--- a/lib/bade/version.rb
+++ b/lib/bade/version.rb
@@ -1,4 +1,4 @@
module Bade
- VERSION = '0.1.1'
+ VERSION = '0.1.2'
end | Bump to version <I> | epuber-io_bade | train | rb |
a35723ddd0ec41cac2ed9c734f7a1dcfee84b1d8 | diff --git a/news-bundle/src/ContaoNewsBundle.php b/news-bundle/src/ContaoNewsBundle.php
index <HASH>..<HASH> 100644
--- a/news-bundle/src/ContaoNewsBundle.php
+++ b/news-bundle/src/ContaoNewsBundle.php
@@ -15,7 +15,7 @@ use Contao\CoreBundle\HttpKernel\Bundle\ContaoBundle;
/**
* Configures the Contao news bundle.
*
- * @author Leo Feyer <https://contao.org>
+ * @author Leo Feyer <https://github.com/leofeyer>
*/
class ContaoNewsBundle extends ContaoBundle
{ | [News] Update the copyright notices | contao_contao | train | php |
753726d0f2eb11a238db674e1ee3e795ac667dd3 | diff --git a/ui/src/dashboards/containers/DashboardPage.js b/ui/src/dashboards/containers/DashboardPage.js
index <HASH>..<HASH> 100644
--- a/ui/src/dashboards/containers/DashboardPage.js
+++ b/ui/src/dashboards/containers/DashboardPage.js
@@ -209,7 +209,11 @@ class DashboardPage extends Component {
const dygraphs = [...this.state.dygraphs, dygraph]
const {dashboards, params} = this.props
const dashboard = dashboards.find(d => d.id === +params.dashboardID)
- if (dashboard && dygraphs.length === dashboard.cells.length) {
+ if (
+ dashboard &&
+ dygraphs.length === dashboard.cells.length &&
+ dashboard.cells.length > 1
+ ) {
Dygraph.synchronize(dygraphs, {
selection: true,
zoom: false, | Dont sync graphs if there is only one graph | influxdata_influxdb | train | js |
27a646c004f46c59c2d4cf57f757b143345f8a15 | diff --git a/Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php b/Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php
index <HASH>..<HASH> 100644
--- a/Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php
+++ b/Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php
@@ -189,14 +189,6 @@ class NodeIndexer extends AbstractNodeIndexer implements BulkNodeIndexerInterfac
]));
}
- if ($node->isRemoved()) {
- // TODO: handle deletion from the fulltext index as well
- $mappingType->deleteDocumentById($contextPathHash);
- $this->logger->log(sprintf('NodeIndexer: Removed node %s from index (node flagged as removed). ID: %s', $contextPath, $contextPathHash), LOG_DEBUG, null, 'ElasticSearch (CR)');
-
- return;
- }
-
$logger = $this->logger;
$fulltextIndexOfNode = [];
$nodePropertiesToBeStoredInIndex = $this->extractPropertiesAndFulltext($node, $fulltextIndexOfNode, function ($propertyName) use ($logger, $documentIdentifier, $node) { | TASK: Remove code that is never used
The case removed with this is never reached, since a removed node will
never be handled here. Instead, due to the way removal is handled in the
Content Repository and the way we use the signals emitted, a removed node
is either handled in removeNode() or not found for an update, since the
publication of a removal was already done at this point. | Flowpack_Flowpack.ElasticSearch.ContentRepositoryAdaptor | train | php |
cdd5ad92801773db2eb2344d7eb8d6b0251c7a12 | diff --git a/rapidoid-http-server/src/main/java/org/rapidoid/setup/App.java b/rapidoid-http-server/src/main/java/org/rapidoid/setup/App.java
index <HASH>..<HASH> 100644
--- a/rapidoid-http-server/src/main/java/org/rapidoid/setup/App.java
+++ b/rapidoid-http-server/src/main/java/org/rapidoid/setup/App.java
@@ -123,6 +123,7 @@ public class App extends RapidoidThing {
Res.reset();
Templates.reset();
JSON.reset();
+ AppBootstrap.reset();
for (Setup setup : Setup.instances()) {
setup.reload(); | Restart bootstrap on app restart. | rapidoid_rapidoid | train | java |
f38a3509a571d014e2e38108c1bc4b07f2fbb969 | diff --git a/rshell/main.py b/rshell/main.py
index <HASH>..<HASH> 100755
--- a/rshell/main.py
+++ b/rshell/main.py
@@ -969,6 +969,7 @@ def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):
"""Function which runs on the pyboard. Matches up with send_file_to_remote."""
import sys
import ubinascii
+ import os
if HAS_BUFFER:
try:
import pyb
@@ -1011,6 +1012,8 @@ def recv_file_from_host(src_file, dst_filename, filesize, dst_mode='wb'):
dst_file.write(write_buf[0:read_size])
else:
dst_file.write(ubinascii.unhexlify(write_buf[0:read_size]))
+ if hasattr(os, 'sync'):
+ os.sync()
bytes_remaining -= read_size
return True
except:
diff --git a/rshell/version.py b/rshell/version.py
index <HASH>..<HASH> 100644
--- a/rshell/version.py
+++ b/rshell/version.py
@@ -1 +1 @@
-__version__ = '0.0.25'
+__version__ = '0.0.26' | Call os.sync to make UART transfer more reliable | dhylands_rshell | train | py,py |
3f6cb155141ec74cf21e30e5e1cc370a671250e7 | diff --git a/test/extended/include.go b/test/extended/include.go
index <HASH>..<HASH> 100644
--- a/test/extended/include.go
+++ b/test/extended/include.go
@@ -57,4 +57,6 @@ import (
_ "github.com/openshift/origin/test/extended/security"
_ "github.com/openshift/origin/test/extended/templates"
_ "github.com/openshift/origin/test/extended/user"
+
+ _ "github.com/openshift/origin/test/e2e/dr"
) | tests: import 'dr' package so that DR tests were registered in disruptive suite | openshift_origin | train | go |
366a003a33f5864844eab75aff08909d16e5568c | diff --git a/lib/adapters/serializers/csv.js b/lib/adapters/serializers/csv.js
index <HASH>..<HASH> 100644
--- a/lib/adapters/serializers/csv.js
+++ b/lib/adapters/serializers/csv.js
@@ -2,6 +2,7 @@ var _ = require('underscore');
var base = require('./base');
var csv = require('csv-write-stream');
var errors = require('../../errors');
+var values = require('../../runtime/values');
module.exports = base.extend({
@@ -11,6 +12,12 @@ module.exports = base.extend({
_.each(points, function(point) {
var keys = _.keys(point);
+ _.each(point, function(value, key) {
+ if (values.isArray(value) || values.isObject(value)) {
+ point[key] = JSON.stringify(value);
+ }
+ });
+
if (!self.headers) {
self.headers = keys;
self.csvWriter = csv({ | CSV stdio serializer supports arrays/objects
Serialize array/object values using JSON, to keep point structure flat
and processable by CSV writer. | juttle_juttle | train | js |
94a701fefb29d42c852676dd05801fc1e494f596 | diff --git a/spyder_kernels/customize/spydercustomize.py b/spyder_kernels/customize/spydercustomize.py
index <HASH>..<HASH> 100644
--- a/spyder_kernels/customize/spydercustomize.py
+++ b/spyder_kernels/customize/spydercustomize.py
@@ -228,18 +228,6 @@ class IPyTesProgram(TestProgram):
TestProgram.__init__(self, *args, **kwargs)
unittest.main = IPyTesProgram
-# Patch ipykernel to avoid errors when setting the Qt5 Matplotlib
-# backemd
-# Fixes Issue 6091
-import ipykernel
-import IPython
-if LooseVersion(ipykernel.__version__) <= LooseVersion('4.7.0'):
- if ((PY2 and LooseVersion(IPython.__version__) >= LooseVersion('5.5.0')) or
- (not PY2 and LooseVersion(IPython.__version__) >= LooseVersion('6.2.0'))
- ):
- from ipykernel import eventloops
- eventloops.loop_map['qt'] = eventloops.loop_map['qt5']
-
#==============================================================================
# Pandas adjustments | Spydercustomize: Remove check for ipykernel versions we don't support anymore | spyder-ide_spyder-kernels | train | py |
54c453cdff9f80b200f8939dae3f38809d073e46 | diff --git a/app/lib/actions/katello/product/reindex_subscriptions.rb b/app/lib/actions/katello/product/reindex_subscriptions.rb
index <HASH>..<HASH> 100644
--- a/app/lib/actions/katello/product/reindex_subscriptions.rb
+++ b/app/lib/actions/katello/product/reindex_subscriptions.rb
@@ -15,7 +15,7 @@ module Actions
plan_self(id: product.id, subscription_id: subscription_id)
end
- def run
+ def finalize
product = ::Katello::Product.find_by!(:id => input[:id])
product.import_subscription(input[:subscription_id])
end | Fixes #<I> - Import sub for custom product after save (#<I>)
Subscriptions were being imported for a custom product, but not
associating to that product's pool. Importing them after they have
been saved with candlepin id will assure the association is being
created. | Katello_katello | train | rb |
3b8898e5a80b2b3184aac6c0f2dd5f858907e3e8 | diff --git a/spyderlib/plugins/__init__.py b/spyderlib/plugins/__init__.py
index <HASH>..<HASH> 100644
--- a/spyderlib/plugins/__init__.py
+++ b/spyderlib/plugins/__init__.py
@@ -307,12 +307,7 @@ class SpyderPluginMixin(object):
title = self.get_plugin_title()
if self.CONF_SECTION == 'editor':
title = _('Editor')
- try:
- shortcut = CONF.get('shortcuts', '_/switch to ' + self.CONF_SECTION)
- except configparser.NoOptionError:
- shortcut = None
- action = create_action(self, title, toggled=self.toggle_view,
- shortcut=shortcut)
+ action = create_action(self, title, toggled=self.toggle_view)
self.toggle_view_action = action
def toggle_view(self, checked): | Revert revision <I>e2a1ab2d<I>
- Adding shortcuts to Panes menu entries created ambiguities in all of them
which let them unapplied | spyder-ide_spyder | train | py |
5c74a029a95ff95dfc961d5cd200225b58843c9b | diff --git a/addons/knobs/src/components/Panel.js b/addons/knobs/src/components/Panel.js
index <HASH>..<HASH> 100644
--- a/addons/knobs/src/components/Panel.js
+++ b/addons/knobs/src/components/Panel.js
@@ -86,6 +86,8 @@ export default class KnobPanel extends PureComponent {
const value = Types[knob.type].deserialize(urlValue);
knob.value = value;
queryParams[`knob-${name}`] = Types[knob.type].serialize(value);
+
+ api.emit(CHANGE, knob);
}
}
}); | REVERT removal of event firing upon knob being set from url state | storybooks_storybook | train | js |
294552ac7005d27161cca7cda2097c7ab87acdb2 | diff --git a/djangocms_page_tags/__init__.py b/djangocms_page_tags/__init__.py
index <HASH>..<HASH> 100644
--- a/djangocms_page_tags/__init__.py
+++ b/djangocms_page_tags/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
-__version__ = '0.6.2'
+__version__ = '0.7.0.dev1'
__author__ = 'Iacopo Spalletti <i.spalletti@nephila.it>' | Bump develop version [ci skip] | nephila_djangocms-page-tags | train | py |
b608acc121d10cf209f72146db21ae4469957c70 | diff --git a/twitter4j-core/src/test/java/twitter4j/HelpMethodsTest.java b/twitter4j-core/src/test/java/twitter4j/HelpMethodsTest.java
index <HASH>..<HASH> 100644
--- a/twitter4j-core/src/test/java/twitter4j/HelpMethodsTest.java
+++ b/twitter4j-core/src/test/java/twitter4j/HelpMethodsTest.java
@@ -45,9 +45,9 @@ public class HelpMethodsTest extends TwitterTestBase {
TwitterAPIConfiguration conf = twitter1.getAPIConfiguration();
assertEquals(3145728, conf.getPhotoSizeLimit());
- assertEquals(20, conf.getCharactersReservedPerMedia());
- assertEquals(19, conf.getShortURLLength());
- assertEquals(20, conf.getShortURLLengthHttps());
+ assertEquals(21, conf.getCharactersReservedPerMedia());
+ assertEquals(20, conf.getShortURLLength());
+ assertEquals(21, conf.getShortURLLengthHttps());
assertEquals(4, conf.getPhotoSizes().size());
assertTrue(20 < conf.getNonUsernamePaths().length);
assertEquals(1, conf.getMaxMediaPerUpload()); | adapting recent t.co changes. | Twitter4J_Twitter4J | train | java |
822844ec09643d1e3cf549949d4bc46b24f0ecae | diff --git a/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java b/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java
index <HASH>..<HASH> 100644
--- a/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java
+++ b/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java
@@ -331,12 +331,12 @@ public class GatewayManagementBeanImpl extends AbstractManagementBean
JSONArray jsonArray = new JSONArray();
for (String balanceeURI : balancees) {
- jsonArray.put(balanceeURI.toString());
+ jsonArray.put(balanceeURI);
}
- jsonObj.put(uri.toString(), jsonArray);
+ jsonObj.put(uri, jsonArray);
} else {
- jsonObj.put(uri.toString(), JSONObject.NULL);
+ jsonObj.put(uri, JSONObject.NULL);
}
}
} catch (JSONException ex) { | Added minor fix (removed unnecessary toString() method) | kaazing_gateway | train | java |
9c2e99e4669cd531f6b3fb77a42b2070054694a7 | diff --git a/src/main/java/com/stripe/model/EventDataDeserializer.java b/src/main/java/com/stripe/model/EventDataDeserializer.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/stripe/model/EventDataDeserializer.java
+++ b/src/main/java/com/stripe/model/EventDataDeserializer.java
@@ -19,6 +19,7 @@ public class EventDataDeserializer implements JsonDeserializer<EventData> {
@SuppressWarnings("rawtypes")
static Map<String, Class> objectMap = new HashMap<String, Class>();
static {
+ objectMap.put("account", Account.class);
objectMap.put("charge", Charge.class);
objectMap.put("discount", Discount.class);
objectMap.put("customer", Customer.class); | Add ability to deserialize account-related events. | stripe_stripe-java | train | java |
4435086697eb4dc05dcf3d6c65a5b37c61076652 | diff --git a/chef/lib/chef/provider/deploy/revision.rb b/chef/lib/chef/provider/deploy/revision.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/provider/deploy/revision.rb
+++ b/chef/lib/chef/provider/deploy/revision.rb
@@ -53,8 +53,7 @@ class Chef
def load_cache
begin
JSON.parse(Chef::FileCache.load("revision-deploys/#{new_resource.name}"))
- rescue
- Chef::Exceptions::FileNotFound
+ rescue Chef::Exceptions::FileNotFound
save_cache([])
end
end
@@ -67,4 +66,4 @@ class Chef
end
end
end
-end
\ No newline at end of file
+end | fix typo in rescue clause
rescue Chef::Exceptions::FileNotFound as intended instead of
StandardError as was actually happening | chef_chef | train | rb |
01bfb2249e0be08968dfbaa755b2c66fcb21b916 | diff --git a/lib/plum/client/legacy_client_session.rb b/lib/plum/client/legacy_client_session.rb
index <HASH>..<HASH> 100644
--- a/lib/plum/client/legacy_client_session.rb
+++ b/lib/plum/client/legacy_client_session.rb
@@ -96,7 +96,7 @@ module Plum
parser = HTTP::Parser.new
parser.on_headers_complete = proc {
resp_headers = parser.headers.map { |key, value| [key.downcase, value] }.to_h
- @response._headers({ ":status" => parser.status_code }.merge(resp_headers))
+ @response._headers({ ":status" => parser.status_code.to_s }.merge(resp_headers))
@headers_callback.call(@response) if @headers_callback
} | client/legacy_client_session: fix response header: ':status' header's value must be String for consistency | rhenium_plum | train | rb |
b24bd73bb8d514811ed6bfb5431b96119eae5500 | diff --git a/scapy/route.py b/scapy/route.py
index <HASH>..<HASH> 100644
--- a/scapy/route.py
+++ b/scapy/route.py
@@ -137,8 +137,9 @@ class Route:
pathes=[]
for d,m,gw,i,a in self.routes:
aa = atol(a)
- if aa == dst:
- pathes.append((0xffffffff,(LOOPBACK_NAME,a,"0.0.0.0")))
+ #Commented out after issue with virtual network with local address 0.0.0.0
+ #if aa == dst:
+ # pathes.append((0xffffffff,(LOOPBACK_NAME,a,"0.0.0.0")))
if (dst & m) == (d & m):
pathes.append((m,(i,a,gw)))
if not pathes: | Issue with virtual local network with address <I> | phaethon_kamene | train | py |
1c5898d94b177368633278f59ec47a2a95570116 | diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index <HASH>..<HASH> 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -922,10 +922,13 @@ class AuthComponent extends Object {
return $this->authenticate->hashPasswords($data);
}
- $model =& $this->getModel();
- if (is_array($data) && isset($data[$model->alias])) {
- if (isset($data[$model->alias][$this->fields['username']]) && isset($data[$model->alias][$this->fields['password']])) {
- $data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]);
+ if (is_array($data)) {
+ $model =& $this->getModel();
+
+ if(isset($data[$model->alias])) {
+ if (isset($data[$model->alias][$this->fields['username']]) && isset($data[$model->alias][$this->fields['password']])) {
+ $data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]);
+ }
}
}
return $data; | Don't get User model if not needed. Fixes #<I> | cakephp_cakephp | train | php |
9a6da353c110c7b520fc11a0d2ff44f97c66a822 | diff --git a/HTSeq/__init__.py b/HTSeq/__init__.py
index <HASH>..<HASH> 100644
--- a/HTSeq/__init__.py
+++ b/HTSeq/__init__.py
@@ -7,8 +7,6 @@ import itertools, warnings
from _HTSeq import *
-import pysam
-
from _version import __version__
#from vcf_reader import *
@@ -721,12 +719,15 @@ class VCF_Reader( FileOrSequence ):
class BAM_Reader( object ):
def __init__( self, filename ):
+ global pysam
self.filename = filename
-
- def seek( self ):
-
+ try:
+ import pysam
+ except ImportError:
+ print "Please Install PySam to use the BAM_Reader Class (http://code.google.com/p/pysam/)"
+ raise
def __iter__( self ):
sf = pysam.Samfile(self.filename, "rb")
for pa in sf:
- yield HTSeq.SAM_Alignment.from_pysam_AlignedRead( pa, sf )
+ yield SAM_Alignment.from_pysam_AlignedRead( pa, sf ) | conditional pysam dependency added | simon-anders_htseq | train | py |
346523967d32f88b9c1a2f0f23a652fd3efc08fa | diff --git a/example/example-advanced-specs.js b/example/example-advanced-specs.js
index <HASH>..<HASH> 100644
--- a/example/example-advanced-specs.js
+++ b/example/example-advanced-specs.js
@@ -17,15 +17,17 @@ co(function * () {
* Module specification.
* @see https://github.com/realglobe-Inc/sg-schemas/blob/master/lib/module_spec.json
*/
- $spec: {
- name: 'sugo-demo-actor-sample',
- version: '1.0.0',
- desc: 'A sample module',
- methods: {
- watchFile: {
- params: [
- { name: 'pattern', desc: 'Glob pattern files to watch' }
- ]
+ get $spec() {
+ return {
+ name: 'sugo-demo-actor-sample',
+ version: '1.0.0',
+ desc: 'A sample module',
+ methods: {
+ watchFile: {
+ params: [
+ { name: 'pattern', desc: 'Glob pattern files to watch' }
+ ]
+ }
}
}
} | Update example-advanced-specs.js | realglobe-Inc_sugo-actor | train | js |
3f967dc5f910c5ffeae2f397a6b0f499c1eb7540 | diff --git a/activesupport/lib/active_support/basic_object.rb b/activesupport/lib/active_support/basic_object.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/basic_object.rb
+++ b/activesupport/lib/active_support/basic_object.rb
@@ -1,21 +1,14 @@
module ActiveSupport
- if defined? ::BasicObject
- # A class with no predefined methods that behaves similarly to Builder's
- # BlankSlate. Used for proxy classes.
- class BasicObject < ::BasicObject
- undef_method :==
- undef_method :equal?
+ # A class with no predefined methods that behaves similarly to Builder's
+ # BlankSlate. Used for proxy classes.
+ class BasicObject < ::BasicObject
+ undef_method :==
+ undef_method :equal?
- # Let ActiveSupport::BasicObject at least raise exceptions.
- def raise(*args)
- ::Object.send(:raise, *args)
- end
- end
- else
- class BasicObject #:nodoc:
- instance_methods.each do |m|
- undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
- end
+ # Let ActiveSupport::BasicObject at least raise exceptions.
+ def raise(*args)
+ ::Object.send(:raise, *args)
end
end
+
end | ::BasicObject always defined in ruby <I> | rails_rails | train | rb |
2bf6a1fef64c8999ec2716ec8d7b598f85ecc269 | diff --git a/plugins/CoreHome/javascripts/dataTable.js b/plugins/CoreHome/javascripts/dataTable.js
index <HASH>..<HASH> 100644
--- a/plugins/CoreHome/javascripts/dataTable.js
+++ b/plugins/CoreHome/javascripts/dataTable.js
@@ -473,7 +473,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
var tableRowLimits = piwik.config.datatable_row_limits,
evolutionLimits =
{
- day: [30, 60, 90, 180, 365, 500],
+ day: [7, 30, 60, 90, 180, 365, 500],
week: [4, 12, 26, 52, 104, 500],
month: [3, 6, 12, 24, 36, 120],
year: [3, 5, 10] | fixes #<I> 7 days in Evolution over the period when Period is Day | matomo-org_matomo | train | js |
dc4b0655587ff398cb84a94968ddc2a922e7bf63 | diff --git a/packages/phenomic/src/commands/build.js b/packages/phenomic/src/commands/build.js
index <HASH>..<HASH> 100644
--- a/packages/phenomic/src/commands/build.js
+++ b/packages/phenomic/src/commands/build.js
@@ -61,7 +61,7 @@ async function build(config) {
debug("building")
const phenomicServer = createServer(db, config.plugins)
const port = await getPort()
- phenomicServer.listen(port)
+ const runningServer = phenomicServer.listen(port)
debug("server ready")
// Build webpack
@@ -86,6 +86,9 @@ async function build(config) {
await config.bundler.build(config)
console.log("📦 Webpack built " + (Date.now() - lastStamp) + "ms")
lastStamp = Date.now()
+
+ runningServer.close()
+ debug("server closed")
}
export default (options) => { | Close phenomic server properly after build | phenomic_phenomic | train | js |
c79cdc1b2e36e78cc48e4e97fa92215cd9878e73 | diff --git a/app/controllers/doorkeeper/application_controller.rb b/app/controllers/doorkeeper/application_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/doorkeeper/application_controller.rb
+++ b/app/controllers/doorkeeper/application_controller.rb
@@ -4,11 +4,7 @@ module Doorkeeper
include Helpers::Controller
- if ::Rails.version.to_i < 4
- protect_from_forgery
- else
- protect_from_forgery with: :exception
- end
+ protect_from_forgery with: :exception
helper 'doorkeeper/dashboard'
end | Remove the dead code for legacy Rails
The Rails 3.x support is dropped since <I>f<I>. | doorkeeper-gem_doorkeeper | train | rb |
79b89a7b60d0d0d8afc3fad5268c8ed4a9ca614f | diff --git a/filters/validations.py b/filters/validations.py
index <HASH>..<HASH> 100644
--- a/filters/validations.py
+++ b/filters/validations.py
@@ -103,7 +103,13 @@ def CSVofIntegers(msg=None):
try:
if isinstance(value, unicode):
if ',' in value:
- value = map(int, filter(bool, value.split(',')))
+ value = map(
+ int, filter(
+ bool, map(
+ lambda x: x.strip(), value.split(',')
+ )
+ )
+ )
return value
else:
return int(value)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@ except (ImportError, OSError):
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
__name__ = 'drf-url-filters'
-__version__ = '0.1.3'
+__version__ = '0.1.4'
__author__ = 'Manjit Kumar'
__author_email__ = 'manjit1727@gmail.com'
__url__ = 'https://github.com/manjitkumar/drf-url-filters' | Fix empty spaces while validating CSV of integers. (#8)
* Fix empty spaces while validating CSV of integers.
* Update setup.py
* Update validations.py | manjitkumar_drf-url-filters | train | py,py |
c3fb2aa856889ffbe760df84b75b7faa4c9b0caf | diff --git a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/Models/PageVersion.php b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/Models/PageVersion.php
index <HASH>..<HASH> 100644
--- a/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/Models/PageVersion.php
+++ b/src/CoandaCMS/Coanda/Pages/Repositories/Eloquent/Models/PageVersion.php
@@ -159,7 +159,7 @@ class PageVersion extends Eloquent {
$new_attribute = new \CoandaCMS\Coanda\Pages\Repositories\Eloquent\Models\PageAttribute;
$new_attribute->type = $page_attribute_type->identifier();
- $new_attribute->identifier = $definition['identifier'];
+ $new_attribute->identifier = $attribute_identifier;
$new_attribute->order = $index;
$this->attributes()->save($new_attribute); | Bugfix - should have been using attribute identifier. | CoandaCMS_coanda-core | train | php |
1b838fd1f80e3aef7e5d9ecda3d80cf54f27f81f | diff --git a/lib/spaceship/base.rb b/lib/spaceship/base.rb
index <HASH>..<HASH> 100644
--- a/lib/spaceship/base.rb
+++ b/lib/spaceship/base.rb
@@ -52,13 +52,12 @@ module Spaceship
module_name = method_sym.to_s
module_name.sub!(/^[a-z\d]/) { $&.upcase }
module_name.gsub!(/(?:_|(\/))([a-z\d])/) { $2.upcase }
- const_name = "#{self.name}::#{module_name}"
- # if const_defined?(const_name)
- klass = const_get(const_name)
+ if const_defined?(module_name)
+ klass = const_get(module_name)
klass.set_client(@client)
- # else
- # super
- # end
+ else
+ super
+ end
end
end | fixes issue #<I> - Module#const_defined? has different behavior in <I> vs <I> | fastlane_fastlane | train | rb |
47de52b1d3d71fdc711eea99ab9bb1dcdc35c043 | diff --git a/swift/storage.py b/swift/storage.py
index <HASH>..<HASH> 100644
--- a/swift/storage.py
+++ b/swift/storage.py
@@ -1,6 +1,7 @@
from StringIO import StringIO
import re
import os
+import posixpath
import urlparse
import hmac
from hashlib import sha1
@@ -103,6 +104,23 @@ class SwiftStorage(Storage):
s = name.strip().replace(' ', '_')
return re.sub(r'(?u)[^-_\w./]', '', s)
+ def get_available_name(self, name):
+ """
+ Returns a filename that's free on the target storage system, and
+ available for new content to be written to.
+ """
+ dir_name, file_name = os.path.split(name)
+ file_root, file_ext = os.path.splitext(file_name)
+ # If the filename already exists, add an underscore and a number (before
+ # the file extension, if one exists) to the filename until the generated
+ # filename doesn't exist.
+ count = itertools.count(1)
+ while self.exists(name):
+ # file_ext includes the dot.
+ name = posixpath.join(dir_name, "%s_%s%s" % (file_root, next(count), file_ext))
+
+ return name
+
def size(self, name):
headers = self.connection.head_object(self.container_name, name)
return int(headers['content-length']) | Override get_available_name with posixpath.join
Fixes #6 | dennisv_django-storage-swift | train | py |
c511134b452aa26ee0796a932cc91a0bdb40c85b | diff --git a/lib/musk/decorator/printable_track.rb b/lib/musk/decorator/printable_track.rb
index <HASH>..<HASH> 100644
--- a/lib/musk/decorator/printable_track.rb
+++ b/lib/musk/decorator/printable_track.rb
@@ -13,16 +13,36 @@ module Musk
"#{position_number}/#{positions_count}"
end
- [:position_number, :positions_count, :year, :comment].each do |method|
- define_method(method) do
- [nil, 0, "0"].include?(@track.send(method)) ? "-" : @track.send(method)
- end
+ def position_number
+ [nil, 0, "0"].include?(@track.position_number) ? "-" : @track.position_number
end
- [:title, :artist, :release, :genre].each do |method|
- define_method(method) do
- @track.send(method) or "-"
- end
+ def positions_count
+ [nil, 0, "0"].include?(@track.positions_count) ? "-" : @track.positions_count
+ end
+
+ def year
+ [nil, 0, "0"].include?(@track.year) ? "-" : @track.year
+ end
+
+ def comment
+ [nil, 0, "0"].include?(@track.comment) ? "-" : @track.comment
+ end
+
+ def title
+ @track.title or "-"
+ end
+
+ def artist
+ @track.artist or "-"
+ end
+
+ def release
+ @track.release or "-"
+ end
+
+ def genre
+ @track.genre or "-"
end
end
end | refactor Musk::Decorator::PrintableTrack | pempel_musk | train | rb |
f666ecb8150c0ec29e1a65053d1a56ee351f0293 | diff --git a/test/extended/operators/images.go b/test/extended/operators/images.go
index <HASH>..<HASH> 100644
--- a/test/extended/operators/images.go
+++ b/test/extended/operators/images.go
@@ -22,7 +22,9 @@ var _ = Describe("[Feature:Platform][Smoke] Managed cluster", func() {
// find out the current installed release info
out, err := oc.Run("adm", "release", "info").Args("--pullspecs", "-o", "json").Output()
if err != nil {
- e2e.Failf("unable to read release payload with error: %v", err)
+ // TODO need to determine why release tests are not having access to read payload
+ e2e.Logf("unable to read release payload with error: %v", err)
+ return
}
releaseInfo := &release.ReleaseInfo{}
if err := json.Unmarshal([]byte(out), &releaseInfo); err != nil { | extended: exit early if unable to read release payload | openshift_origin | train | go |
87f0bd1614919e3a23899901c2242d3f331ad7b7 | diff --git a/v2alpha/soap/client/client_test.go b/v2alpha/soap/client/client_test.go
index <HASH>..<HASH> 100644
--- a/v2alpha/soap/client/client_test.go
+++ b/v2alpha/soap/client/client_test.go
@@ -2,7 +2,6 @@ package client
import (
"context"
- "encoding/xml"
"fmt"
"net/http"
"net/http/httptest"
@@ -92,12 +91,8 @@ func TestPerformAction(t *testing.T) {
c := New(ts.URL + "/endpointpath")
- reqAction := &envelope.Action{
- XMLName: xml.Name{Space: "http://example.com/endpointns", Local: "Foo"},
- Args: &ActionArgs{
- Name: "World",
- },
- }
+ reqAction := envelope.NewAction("http://example.com/endpointns", "Foo",
+ &ActionArgs{Name: "World"})
reply := &ActionReply{}
replyAction := &envelope.Action{Args: reply} | Use envelope.NewAction in client_test. | huin_goupnp | train | go |
873074e21e86a7f49a26d76c30bc24e67673dafe | diff --git a/webassembletool-core/src/main/java/net/webassembletool/cache/Rfc2616.java b/webassembletool-core/src/main/java/net/webassembletool/cache/Rfc2616.java
index <HASH>..<HASH> 100644
--- a/webassembletool-core/src/main/java/net/webassembletool/cache/Rfc2616.java
+++ b/webassembletool-core/src/main/java/net/webassembletool/cache/Rfc2616.java
@@ -346,6 +346,9 @@ public class Rfc2616 {
copyHeader(resource, output, "ETag");
copyHeader(resource, output, "Expires");
copyHeader(resource, output, "Cache-control");
+ // FIXME: We have to copy all headers except those that the RFC says not
+ // to. For now, we just add a missing (and important) header
+ copyHeader(resource, output, "Content-Disposition");
}
private final static void copyHeader(Resource resource, Output output, | copy the Content-disposition header. Just a patch waiting for a black list of headers (and copy of all the others) | esigate_esigate | train | java |
9f8f53deec43e964a1729f18aefdbfa88709342c | diff --git a/gateway/static/script/form.js b/gateway/static/script/form.js
index <HASH>..<HASH> 100644
--- a/gateway/static/script/form.js
+++ b/gateway/static/script/form.js
@@ -65,7 +65,16 @@ $.fn.featform._onSubmit = function(ev) {
var options = $this.data('featform.options');
if (options.method == 'GET') {
var url = options.url;
- var serialized = $this.serialize();
+ var serialized = '';
+ var array = $this.serializeArray();
+ for (var i in array) {
+ if (array[i].value) {
+ if (serialized) serialized += '&';
+ serialized += array[i].name;
+ serialized += "=";
+ serialized += array[i].value;
+ }
+ }
if (serialized) {
url = url + "?" + serialized;
} | Fix gateway GET forms not to put empty values of optional fields into the
query string. | f3at_feat | train | js |
ac57376c1242250be01da11b4b2bb4b587a426cb | diff --git a/src/main/python/rlbot/version.py b/src/main/python/rlbot/version.py
index <HASH>..<HASH> 100644
--- a/src/main/python/rlbot/version.py
+++ b/src/main/python/rlbot/version.py
@@ -8,9 +8,11 @@ __version__ = '1.9.0'
release_notes = {
'1.9.0': """
- *Much* faster core dll initialization! - ccman32
+ - Adding support for a training mode! Check out https://github.com/RLBot/RLBotTraining - DomNomNom
- Allow the user to change the appearance of human and party-member bot agents via the GUI - r0bbi3
- Added game speed info to game tick packet and the ability to modify it via state setting - Marvin
- Make the game stop capturing the mouse cursor if only bots are playing - whatisaphone
+ - Various quality-of-life improvements - DomNomNom
""",
'1.8.3': """
- Allow SimpleControllerState initialization. - Marvin | Updating the <I> version notes. | RLBot_RLBot | train | py |
2993b0092ef408b9a1a595c2f25313c51170f654 | diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
+++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
@@ -118,6 +118,9 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Country':
return new TypeGuess('country', array(), Guess::HIGH_CONFIDENCE);
+ case 'Symfony\Component\Validator\Constraints\Currency':
+ return new TypeGuess('currency', array(), Guess::HIGH_CONFIDENCE);
+
case 'Symfony\Component\Validator\Constraints\Date':
return new TypeGuess('date', array('input' => 'string'), Guess::HIGH_CONFIDENCE); | [Form] Guess currency field based on validator constraint | symfony_symfony | train | php |
ea835d2afcad126ce560147e4546a5a9b7b3f9fd | diff --git a/gnucash_portfolio/lib/__init__.py b/gnucash_portfolio/lib/__init__.py
index <HASH>..<HASH> 100644
--- a/gnucash_portfolio/lib/__init__.py
+++ b/gnucash_portfolio/lib/__init__.py
@@ -1,2 +1,2 @@
from . import Price, database
-from .settings import Settings
\ No newline at end of file
+#from .settings import Settings
\ No newline at end of file | removing Settings from library provided interfaces | MisterY_gnucash-portfolio | train | py |
c0d210ef0571332bfe46e963bcc3c2d61db5bf09 | diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Layer/Grid.js
+++ b/lib/OpenLayers/Layer/Grid.js
@@ -472,7 +472,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
for(var j=0, lenJ=this.grid[i].length; j<lenJ; j++) {
var tile = this.grid[i][j].createBackBuffer();
if(!tile) {
- return;
+ continue;
}
// to be able to correctly position the back buffer we
// place the tiles grid at (0, 0) in the back buffer | just skip tiles that are currently loading when creating the back buffer | openlayers_openlayers | train | js |
6dab9f447a252cd2b3ff177f726608efcbcf0bf1 | diff --git a/modules/images.js b/modules/images.js
index <HASH>..<HASH> 100644
--- a/modules/images.js
+++ b/modules/images.js
@@ -13,7 +13,7 @@ module.exports = function(grunt, util, config) {
var imagesDir = 'images_src';
- var images = !!glob.sync(imagesDir + '/*.{png,jpg,gif}').length;
+ var images = !!glob.sync(imagesDir + '/*.{png,jpg,jpeg,gif}').length;
var svgs = !!glob.sync(imagesDir + '/*.svg').length;
if (!images && !svgs) return config;
@@ -24,7 +24,7 @@ module.exports = function(grunt, util, config) {
options: {
atBegin: true
},
- files: imagesDir + '/*.{png,jpg,gif,svg}',
+ files: imagesDir + '/*.{png,jpg,jpeg,gif,svg}',
tasks: ['images']
}
}
@@ -44,7 +44,7 @@ module.exports = function(grunt, util, config) {
{
expand: true,
cwd: imagesDir,
- src: '*.{png,jpg,gif}',
+ src: '*.{png,jpg,jpeg,gif}',
dest: 'images'
}
] | Images: add JPEG to the list of available extensions. | tamiadev_tamia-grunt | train | js |
f783dec9de9d19ba60c6db4155c82999acdca2e7 | diff --git a/pythran/cxxtypes.py b/pythran/cxxtypes.py
index <HASH>..<HASH> 100644
--- a/pythran/cxxtypes.py
+++ b/pythran/cxxtypes.py
@@ -216,10 +216,14 @@ std::declval<bool>()))
def __add__(self, other):
worklist = list(self.types)
+ visited = set()
while worklist:
item = worklist.pop()
if item is other:
return self
+ if item in visited:
+ continue
+ visited.add(item)
if isinstance(item, CombinedTypes):
worklist.extend(item.types)
return Type.__add__(self, other) | Do not revisit combined types twice
This does speed up some type inference part.
Fix #<I> | serge-sans-paille_pythran | train | py |
0464c40dd55ce105cf1b2e9a2eeeebf2d869a418 | diff --git a/bliss/core/api.py b/bliss/core/api.py
index <HASH>..<HASH> 100644
--- a/bliss/core/api.py
+++ b/bliss/core/api.py
@@ -145,7 +145,7 @@ class CmdAPI:
gds.hexdump(encoded, preamble=cmdobj.name + ':' + pad)
try:
- values = (self._host, self._port, cmdobj.name)
+ values = (self._host, self._port, str(cmdobj))
log.command('Sending to %s:%d: %s' % values)
self._socket.sendto(encoded, (self._host, self._port))
status = True | Issue #<I> - Print arguments when sending a command | NASA-AMMOS_AIT-Core | train | py |
ea114210de1dd8af8a9df2bb92fc759f939fc6b4 | diff --git a/src/main/java/com/profesorfalken/jpowershell/PowerShell.java b/src/main/java/com/profesorfalken/jpowershell/PowerShell.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/profesorfalken/jpowershell/PowerShell.java
+++ b/src/main/java/com/profesorfalken/jpowershell/PowerShell.java
@@ -344,7 +344,7 @@ public class PowerShell implements AutoCloseable {
* @param params the parameters of the script
* @return response with the output of the command
*/
- private PowerShellResponse executeScript(BufferedReader srcReader, String params) {
+ public PowerShellResponse executeScript(BufferedReader srcReader, String params) {
if (srcReader != null) {
File tmpFile = createWriteTempFile(srcReader); | Make public the executeScript method which uses BuffReader | profesorfalken_jPowerShell | train | java |
746ecf1839ee93eacf9d4d4f77587bef3b5a8060 | diff --git a/src/Keboola/Syrup/Command/JobCommand.php b/src/Keboola/Syrup/Command/JobCommand.php
index <HASH>..<HASH> 100644
--- a/src/Keboola/Syrup/Command/JobCommand.php
+++ b/src/Keboola/Syrup/Command/JobCommand.php
@@ -170,6 +170,7 @@ class JobCommand extends ContainerAwareCommand
$status = self::STATUS_RETRY;
} catch (MaintenanceException $e) {
+ $jobResult = [];
$jobStatus = Job::STATUS_WAITING;
$status = self::STATUS_LOCK;
} catch (UserException $e) { | fix: return job status to waiting when maintenance occurs | keboola_syrup | train | php |
1131e2d4ef4f18b87738de2b992de2e58aefe90b | diff --git a/lib/lolcommits/platform.rb b/lib/lolcommits/platform.rb
index <HASH>..<HASH> 100644
--- a/lib/lolcommits/platform.rb
+++ b/lib/lolcommits/platform.rb
@@ -123,8 +123,8 @@ module Lolcommits
# TODO: handle other platforms here (linux/windows) e.g with ffmpeg -list_devices
return unless Platform.platform_mac?
- capturer = Lolcommits::CaptureMacVideo.new
- `#{capturer.executable_path} -l`
+ videosnap = File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', 'videosnap', 'videosnap')
+ `#{videosnap} -l`
end
end
end | fix --devices command for macOS | lolcommits_lolcommits | train | rb |
c450f1d1bc0d695fbb0ce434a5f9f76f0eb20e30 | diff --git a/css_optimiser.php b/css_optimiser.php
index <HASH>..<HASH> 100644
--- a/css_optimiser.php
+++ b/css_optimiser.php
@@ -77,7 +77,7 @@ if($is_custom)
setcookie ('custom_template', $_REQUEST['custom'], time()+360000);
}
else {
- setcookie ('custom_template', $_REQUEST['custom'], time()-3600);
+ setcookie ('custom_template', '', time()-3600);
}
rmdirr('temp'); | Fixed small bug in cookie setting (had also made an earlier change here to avoid custom templates showing up forever) | Cerdic_CSSTidy | train | php |
69818b9d0b3fee9cb051b2b1b7e30f6cd9358ad6 | diff --git a/src/Zephyrus/Security/SecuritySession.php b/src/Zephyrus/Security/SecuritySession.php
index <HASH>..<HASH> 100644
--- a/src/Zephyrus/Security/SecuritySession.php
+++ b/src/Zephyrus/Security/SecuritySession.php
@@ -91,7 +91,7 @@ class SecuritySession
private function laterSessionStart()
{
if (!is_null($this->fingerprint) && !$this->fingerprint->hasValidFingerprint()) {
- throw new \Exception("Session fingerprint doesn't match");
+ throw new \Exception("Session fingerprint doesn't match"); // @codeCoverageIgnore
}
if (!is_null($this->expiration) && $this->expiration->isObsolete()) {
return true; | Added coverage ignore for SecuritySession exception | dadajuice_zephyrus | train | php |
95c6d74c0d31a877182934647a52857395230f3b | diff --git a/dsl/failures.go b/dsl/failures.go
index <HASH>..<HASH> 100644
--- a/dsl/failures.go
+++ b/dsl/failures.go
@@ -14,10 +14,10 @@ func init() {
globalFailHandler = ginkgo.Fail
}
-// RegisterAgoutiFailHandler connects the implied assertions is Agouti's dsl with
+// RegisterAgoutiFailHandler connects the implied assertions in Agouti's dsl with
// Gingko. When set to ginkgo.Fail (the default), failures in Agouti's dsl-provided
// methods will cause test failures in Ginkgo.
-func RegisterAgoutiFailHandler(handler func(message string, callerSkip ...int)) {
+func RegisterAgoutiFailHandler(handler AgoutiFailHandler) {
globalFailHandler = handler
} | Update type of handler provided to RegisterAgoutiFailHandler in dsl | sclevine_agouti | train | go |
544498b24fc0ce87113ee0408f88d0d89a80b6b0 | diff --git a/utool/util_path.py b/utool/util_path.py
index <HASH>..<HASH> 100644
--- a/utool/util_path.py
+++ b/utool/util_path.py
@@ -128,13 +128,14 @@ def delete(path, dryrun=False, recursive=True, verbose=True, ignore_errors=True,
return flag
-def remove_file_list(fpath_list):
+def remove_file_list(fpath_list, verbose=VERBOSE):
print('[path] Removing %d files' % len(fpath_list))
for fpath in fpath_list:
try:
os.remove(fpath) # Force refresh
except OSError as ex:
- printex(ex, 'Could not remove fpath = %r' % (fpath,), iswarning=True)
+ if verbose:
+ printex(ex, 'Could not remove fpath = %r' % (fpath,), iswarning=True)
pass | Option for suppressing warnings when deleting thumbnails | Erotemic_utool | train | py |
5c424e6b110f27c68ee2b5671246fdd5da498da1 | diff --git a/ipymd/test.py b/ipymd/test.py
index <HASH>..<HASH> 100644
--- a/ipymd/test.py
+++ b/ipymd/test.py
@@ -1,12 +1,14 @@
+import sys
import os
import os.path as op
from pprint import pprint
from ipymd.converters import nb_to_markdown, markdown_to_nb, process_latex
-
dir = op.dirname(os.path.realpath(__file__))
-code_wrap = 'atlas' # 'atlas' or 'markdown'
+# atlas or markdown
+code_wrap = sys.argv[1] if len(sys.argv) >= 2 else 'markdown'
+
path_md = op.join(dir, '../notebooks/test_%s.md' % code_wrap)
add_prompt = True | Added CLI option in test.py. | rossant_ipymd | train | py |
80cb13dde6e701ea6f3267c8500fdba559b1e44b | diff --git a/lib/jitsu.js b/lib/jitsu.js
index <HASH>..<HASH> 100644
--- a/lib/jitsu.js
+++ b/lib/jitsu.js
@@ -232,7 +232,7 @@ jitsu.setup = function (callback) {
//
// TODO: replace with custom logger method
//
- console.log(data);
+ // console.log(data);
}
};
}); | [fix] Removing console.log for debug mode. Old .jitsuconf files are defaulted to "debug": true causing debug output for all upgraded versions. | nodejitsu_jitsu | train | js |
e6c59cfec3d5862b2c58696a41ba6368906ef1d9 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,7 @@
-(function(inBrowser) {
+(function(isCommonJs) {
'use strict'
- var React = inBrowser ? window.React : require('react')
+ var React = isCommonJs ? require('react') : window.React
var tabbordionUuid = (function() {
var index = 0
@@ -639,13 +639,13 @@
}
})
- if (inBrowser) {
- window.Panel = Panel
- window.Tabbordion = Tabbordion
- } else {
+ if (isCommonJs) {
module.exports = {
Panel: Panel,
Tabbordion: Tabbordion
}
+ } else {
+ window.Panel = Panel
+ window.Tabbordion = Tabbordion
}
-})(typeof window !== 'undefined')
+})(typeof exports === 'object') | Reverse check from browser to CommonJS | Merri_react-tabbordion | train | js |
75d7bcede30a599f98272fb7737ff0bf3144ba3b | diff --git a/www/medic.js b/www/medic.js
index <HASH>..<HASH> 100644
--- a/www/medic.js
+++ b/www/medic.js
@@ -49,5 +49,15 @@ exports.load = function (callback) {
xhr.onerror = function() {
callback();
}
- xhr.send();
+
+ try {
+ xhr.send(null);
+ }
+ catch(ex) {
+ // some platforms throw on a file not found
+ console.log('Did not find medic config file');
+ setTimeout(function(){
+ callback();
+ },0);
+ }
} | Handle case where file not found throws exception | apache_cordova-plugin-test-framework | train | js |
f5206c2b39e3cd10f82e3f808595428c8bff5dfe | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,2 +1,2 @@
-global.root_path = process.cwd();
+global.rootPath = process.cwd();
module.exports = require('./lib/babel-root-import.js'); | Change root_path to camelcase | detrohutt_babel-plugin-import-graphql | train | js |
6b76b983f962163b151d88b6eb07ca5068f4cad6 | diff --git a/tests/integration-basic/tests.js b/tests/integration-basic/tests.js
index <HASH>..<HASH> 100644
--- a/tests/integration-basic/tests.js
+++ b/tests/integration-basic/tests.js
@@ -37,7 +37,7 @@ describe('Service Lifecyle Integration Test', function() {
if (error.message.indexOf('does not exist') > -1) return;
throw error;
}
- await spawn(serverlessExec, ['remove'], { cwd: tmpDir });
+ await spawn(serverlessExec, ['remove'], { cwd: tmpDir, env });
});
it('should create service in tmp directory', async () => {
@@ -84,7 +84,7 @@ describe('Service Lifecyle Integration Test', function() {
`;
fs.writeFileSync(path.join(tmpDir, 'handler.js'), newHandler);
- return spawn(serverlessExec, ['deploy'], { cwd: tmpDir });
+ return spawn(serverlessExec, ['deploy'], { cwd: tmpDir, env });
});
it('should invoke updated function from aws', async () => { | Ensure to rely on preprepared env | serverless_serverless | train | js |
79766ac30b58a8a7a7ee911c62329e11dab9847d | diff --git a/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java b/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java
+++ b/java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java
@@ -65,6 +65,7 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.openqa.selenium.TestWaiter.waitFor;
+import static org.openqa.selenium.WaitingConditions.elementValueToEqual;
import static org.openqa.selenium.WaitingConditions.pageTitleToBe;
import static org.openqa.selenium.testing.Ignore.Driver.FIREFOX;
@@ -134,8 +135,7 @@ public class FirefoxDriverTest extends JUnit4TestBase {
String sentText = "I like cheese\n\nIt's really nice";
String expectedText = textarea.getAttribute("value") + sentText;
textarea.sendKeys(sentText);
- String seenText = textarea.getAttribute("value");
- assertThat(seenText, equalTo(expectedText));
+ waitFor(elementValueToEqual(textarea, expectedText));
driver.quit();
} | EranMes: Make our tests properly wait for a value, rather than blindly assert.
r<I> | SeleniumHQ_selenium | train | java |
217c08041e3208491e5ae2af0f69f1be074c986f | diff --git a/lib/Sabre/VObject/RecurrenceIterator.php b/lib/Sabre/VObject/RecurrenceIterator.php
index <HASH>..<HASH> 100644
--- a/lib/Sabre/VObject/RecurrenceIterator.php
+++ b/lib/Sabre/VObject/RecurrenceIterator.php
@@ -1039,8 +1039,7 @@ class RecurrenceIterator implements \Iterator {
// all wednesdays in this month.
$dayHits = array();
- $checkDate = clone $startDate;
- $checkDate->modify('first day of this month');
+ $checkDate = new \DateTime($startDate->format('Y-m-1'));
$checkDate->modify($dayName);
do { | Work around hhvm not being able to modify a date with 'first day of this month'
see <URL> | sabre-io_vobject | train | php |
837edc7c08f60595b6a451ef80a3e727c844c167 | diff --git a/tests/tools/internal-rules/no-invalid-meta.js b/tests/tools/internal-rules/no-invalid-meta.js
index <HASH>..<HASH> 100644
--- a/tests/tools/internal-rules/no-invalid-meta.js
+++ b/tests/tools/internal-rules/no-invalid-meta.js
@@ -242,24 +242,14 @@ ruleTester.run("no-invalid-meta", rule, {
column: 5
}]
},
-
- /*
- * Rule doesn't export anything: Should warn on the Program node.
- * See https://github.com/eslint/eslint/issues/9534
- */
-
- /*
- * Should be invalid, but will currently show as valid due to #9534.
- * FIXME: Uncomment when #9534 is fixed in major release.
- * {
- * code: "",
- * errors: [{
- * message: "Rule does not export anything. Make sure rule exports an object according to new rule format.",
- * line: 1,
- * column: 1
- * }]
- * },
- */
+ {
+ code: "",
+ errors: [{
+ message: "Rule does not export anything. Make sure rule exports an object according to new rule format.",
+ line: 1,
+ column: 1
+ }]
+ },
{
code: "foo();",
errors: [{ | Chore: Uncommented test for empty program for no-invalid-meta (#<I>) | eslint_eslint | train | js |
90c0e1624d38be7e6a39d92ddf09d09ab46e80ca | diff --git a/lib/chef/resource/osx_profile.rb b/lib/chef/resource/osx_profile.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/resource/osx_profile.rb
+++ b/lib/chef/resource/osx_profile.rb
@@ -81,7 +81,7 @@ class Chef
def check_resource_semantics!
if mac? && node["platform_version"] =~ ">= 11.0"
- raise "The osx_profile resource is not available on macOS Big Sur or above due to the removal of apple support for CLI installation of profiles"
+ raise "The osx_profile resource is not available on macOS Big Sur or above due to the removal of Apple support for CLI installation of profiles"
end
if action == :remove | Capitalize apple
Dumb change simply to sign-off previous commit. | chef_chef | train | rb |
85f9e7c2a796b8e0a489ad4ff0dca9d746d74118 | diff --git a/lib/session.py b/lib/session.py
index <HASH>..<HASH> 100644
--- a/lib/session.py
+++ b/lib/session.py
@@ -59,7 +59,7 @@ except ImportError:
from invenio.config import CFG_WEBSESSION_EXPIRY_LIMIT_REMEMBER, \
- CFG_WEBSESSION_CHECK_SESSION_ADDR
+ CFG_WEBSESSION_IPADDR_CHECK_SKIP_BITS
_qparm_re = re.compile(r'([\0- ]*'
r'([^\0- ;,=\"]+)="([^"]*)"'
@@ -369,8 +369,8 @@ class SessionManager:
# exceptions -- SessionError.format() by default -- is
# responsible for revoking the session cookie. Yuck.
raise SessionError(session_id=sessid)
- if (session.get_remote_address() >> CFG_WEBSESSION_CHECK_SESSION_ADDR !=
- request.get_environ("REMOTE_ADDR") >> CFG_WEBSESSION_CHECK_SESSION_ADDR):
+ if (session.get_remote_address() >> CFG_WEBSESSION_IPADDR_CHECK_SKIP_BITS !=
+ request.get_environ("REMOTE_ADDR") >> CFG_WEBSESSION_IPADDR_CHECK_SKIP_BITS):
raise SessionError("Remote IP address does not match the "
"IP address that created the session",
session_id=sessid) | Renaming in the sam/better-session commit.
Renamed CFG_WEBSESSION_CHECK_SESSION_ADDR into CFG_WEBSESSION_IPADDR_CHECK_SKIP_BITS
in order to better fit its meaning. Expanded help string. | inveniosoftware_invenio-accounts | train | py |
997afe86e082baf3e9fc76e3d98d375e74ccbd56 | diff --git a/spec/attribute_resolver_spec.rb b/spec/attribute_resolver_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/attribute_resolver_spec.rb
+++ b/spec/attribute_resolver_spec.rb
@@ -154,7 +154,7 @@ describe Attributor::AttributeResolver do
end
end
- context 'with a hash condition' do
+ pending 'with a hash condition' do
end
context 'with a proc condition' do | Mark hash condition spec as pending | praxis_attributor | train | rb |
d3b24fd83f6c201b37ef3d2f5bda57676a94e4a9 | diff --git a/javascript_client/subscriptions/PusherLink.js b/javascript_client/subscriptions/PusherLink.js
index <HASH>..<HASH> 100644
--- a/javascript_client/subscriptions/PusherLink.js
+++ b/javascript_client/subscriptions/PusherLink.js
@@ -34,7 +34,8 @@
// // Do something with `data` and/or `errors`
// }})
//
-import {ApolloLink, Observable} from "apollo-link"
+var ApolloLink = require("apollo-link").ApolloLink
+var Observable = require("apollo-link").Observable
class PusherLink extends ApolloLink {
constructor(options) {
@@ -88,4 +89,4 @@ class PusherLink extends ApolloLink {
}
}
-export default PusherLink
+module.exports = PusherLink | use require and module.exports instead of import/export for the Pusher client | rmosolgo_graphql-ruby | train | js |
6fa5bc7ce70c67708cef8af9cee8b5a0153d2092 | diff --git a/code/pages/NewsHolderPage.php b/code/pages/NewsHolderPage.php
index <HASH>..<HASH> 100644
--- a/code/pages/NewsHolderPage.php
+++ b/code/pages/NewsHolderPage.php
@@ -58,11 +58,6 @@ class NewsHolderPage extends Page {
/** Backwards compatibility for upgraders. Update the PublishFrom field */
$sql = "UPDATE `News` SET `PublishFrom` = `Created` WHERE `PublishFrom` IS NULL";
DB::query($sql);
- /** If the Translatable is added lateron, update the locale to at least have some value */
- if(class_exists('Translatable')){
- $sqlLang = "UPDATE `News` SET `Locale` = '".Translatable::get_current_locale()."' WHERE Locale IS NULL";
- DB::query($sqlLang);
- }
}
/** | Bug: Don't try to set locale, since we don't use the locale-field anymore. | Firesphere_silverstripe-newsmodule | train | php |
49d35956ec7e0d7bb5095c85856befd3e8a2f2e2 | diff --git a/provision/juju/suite_test.go b/provision/juju/suite_test.go
index <HASH>..<HASH> 100644
--- a/provision/juju/suite_test.go
+++ b/provision/juju/suite_test.go
@@ -18,4 +18,11 @@ var _ = Suite(&S{})
func (s *S) SetUpSuite(c *C) {
config.Set("git:host", "tsuruhost.com")
+ err := handler.DryRun()
+ c.Assert(err, IsNil)
+}
+
+func (s *S) TearDownSuite(c *C) {
+ handler.Stop()
+ handler.Wait()
} | provision/juju: also start handler in dry-run mode in normal suite | tsuru_tsuru | train | go |
3684ae11ff18a674541176690f58848e2d581774 | diff --git a/spec/wings/attribute_transformer_spec.rb b/spec/wings/attribute_transformer_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/wings/attribute_transformer_spec.rb
+++ b/spec/wings/attribute_transformer_spec.rb
@@ -2,10 +2,8 @@
require 'wings/attribute_transformer'
RSpec.describe Wings::AttributeTransformer do
- let(:pcdm_object) { work }
- let(:id) { 'moomin123' }
- let(:work) { GenericWork.new(id: id, **attributes) }
- let(:keys) { attributes.keys }
+ let(:id) { 'moomin123' }
+ let(:work) { GenericWork.new(id: id, **attributes) }
let(:attributes) do
{
@@ -15,16 +13,10 @@ RSpec.describe Wings::AttributeTransformer do
}
end
- let(:uris) do
- [RDF::URI('http://example.com/fake1'),
- RDF::URI('http://example.com/fake2')]
- end
-
- subject { described_class.run(pcdm_object, keys) }
-
it "transform the attributes" do
- expect(subject).to include title: work.title,
- contributor: work.contributor.first,
- description: work.description.first
+ expect(described_class.run(work))
+ .to include title: work.title,
+ contributor: work.contributor.first,
+ description: work.description.first
end
end | wings: refactor AttributeTransformer specs | samvera_hyrax | train | rb |
b7021bbab29b7ba1e189e5c8b2683d2d6eeb0b62 | diff --git a/lib/transflow/publisher.rb b/lib/transflow/publisher.rb
index <HASH>..<HASH> 100644
--- a/lib/transflow/publisher.rb
+++ b/lib/transflow/publisher.rb
@@ -30,6 +30,10 @@ module Transflow
self.class.new(publisher, all_args)
end
end
+
+ def subscribe(*args)
+ publisher.subscribe(*args)
+ end
end
def initialize(name, op)
diff --git a/spec/unit/publisher_spec.rb b/spec/unit/publisher_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/publisher_spec.rb
+++ b/spec/unit/publisher_spec.rb
@@ -24,5 +24,17 @@ RSpec.describe Transflow::Publisher do
Transflow::Publisher.new(:step, op).curry
}.to raise_error(/arity is < 0/)
end
+
+ it 'triggers event listener' do
+ listener = spy(:listener)
+
+ op = -> i, j { i + j }
+ publisher = Transflow::Publisher.new(:step, op).curry
+
+ publisher.subscribe(listener)
+
+ expect(publisher.(1).(2)).to be(3)
+ expect(listener).to have_received(:step_success).with(3)
+ end
end
end | Add support for subscribing to a curried publisher | solnic_transflow | train | rb,rb |
0e860d42de2a0ce79e890c1ab972a65972a904b5 | diff --git a/phonopy/interface/siesta.py b/phonopy/interface/siesta.py
index <HASH>..<HASH> 100644
--- a/phonopy/interface/siesta.py
+++ b/phonopy/interface/siesta.py
@@ -65,7 +65,7 @@ def read_siesta(filename):
lattice = siesta_in._tags["latticevectors"]
positions = siesta_in._tags["atomiccoordinates"]
atypes = siesta_in._tags["chemicalspecieslabel"]
- cell = Atoms(numbers=numbers, cell=lattice)
+ cell = Atoms(numbers=numbers, cell=lattice, scaled_positions=positions)
coordformat = siesta_in._tags["atomiccoordinatesformat"]
if coordformat == "fractional" or coordformat == "scaledbylatticevectors": | Fix siesta interface problem generated by the change of Atoms class | atztogo_phonopy | train | py |
c3ed795e59fc3dda826de0fc553e4045bdc2952a | diff --git a/views/app.go b/views/app.go
index <HASH>..<HASH> 100644
--- a/views/app.go
+++ b/views/app.go
@@ -126,6 +126,7 @@ func (app *Application) run() {
app.wg.Done()
}()
screen.Init()
+ screen.EnableMouse()
screen.Clear()
widget.SetView(screen) | Enable mouse support in views.Application (#<I>) | gdamore_tcell | train | go |
da3537ac5170a65cb5dab87b8fccf6188144a7a8 | diff --git a/src/Calendar.js b/src/Calendar.js
index <HASH>..<HASH> 100644
--- a/src/Calendar.js
+++ b/src/Calendar.js
@@ -518,15 +518,7 @@ let Calendar = React.createClass({
onNavigate(date, view)
if (action === navigate.DATE)
- this._viewNavigate(date)
- },
-
- _viewNavigate(nextDate) {
- let { view, date, culture } = this.props;
-
- if (dates.eq(date, nextDate, view, localizer.startOfWeek(culture))) {
this.handleViewChange(views.DAY)
- }
},
handleViewChange(view){ | Always navigate to day view when action is navigate.DATE | intljusticemission_react-big-calendar | train | js |
b54d0b91a987dde9ec73f2d6f065f6d0431ee9c2 | diff --git a/src/main/java/com/j256/simplemagic/ContentInfoUtil.java b/src/main/java/com/j256/simplemagic/ContentInfoUtil.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/j256/simplemagic/ContentInfoUtil.java
+++ b/src/main/java/com/j256/simplemagic/ContentInfoUtil.java
@@ -316,7 +316,7 @@ public class ContentInfoUtil {
private MagicEntries readEntriesFromResource(String resource) throws IOException {
InputStream stream = getClass().getResourceAsStream(resource);
if (stream == null) {
- return null;
+ throw new IllegalStateException("Internal magic file was not found: " + resource);
}
Reader reader = null;
try { | Throw exception if resource not found. | j256_simplemagic | train | java |
20fdb1b7557be9cde2a18739de78f4f2d78339a1 | diff --git a/enrol/ldap/enrol.php b/enrol/ldap/enrol.php
index <HASH>..<HASH> 100755
--- a/enrol/ldap/enrol.php
+++ b/enrol/ldap/enrol.php
@@ -103,7 +103,7 @@ function get_user_courses(&$user, $type) {
}
} else if ($type === 'teacher') {
error_log("Enrolling teacher $user->id ($user->username) in course $course_obj->id ($course_obj->shortname)");
- add_teacher($user->id, $course_obj->id, 1, 0, 0,'ldap');
+ add_teacher($user->id, $course_obj->id, 1, '', 0, 0,'ldap');
}
$CFG->debug=0;
} | Fixed a wrong call to add_teacher in LDAP plugin (Merged from MOODLE_<I>_STABLE) | moodle_moodle | train | php |
734d1e747c126c2824b3c8a2c07e5d0955b5e60a | diff --git a/code/dataobjects/CustomMenuBlock.php b/code/dataobjects/CustomMenuBlock.php
index <HASH>..<HASH> 100644
--- a/code/dataobjects/CustomMenuBlock.php
+++ b/code/dataobjects/CustomMenuBlock.php
@@ -1,4 +1,9 @@
<?php
+
+if (!class_exists('Block')) {
+ return;
+}
+
/**
* A block that allows end users to manually build a custom (flat or nested) menu
* @author Shea Dawson <shea@silverstripe.com.au> | fix(CustomMenuBlock): If not using Shea's Block module and you want to iterate over classes/get configs in an abstract way, you'll cause SS to load this class and throw an error. | symbiote_silverstripe-seed | train | php |
50e3217211b519ff53b1c4d55a030fa71bcf1797 | diff --git a/client/allocdir/alloc_dir_unix.go b/client/allocdir/alloc_dir_unix.go
index <HASH>..<HASH> 100644
--- a/client/allocdir/alloc_dir_unix.go
+++ b/client/allocdir/alloc_dir_unix.go
@@ -28,6 +28,12 @@ var (
)
func (d *AllocDir) linkOrCopy(src, dst string, perm os.FileMode) error {
+ // Avoid link/copy if the file already exists in the chroot
+ // TODO 0.6 clean this up. This was needed because chroot creation fails
+ // when a process restarts.
+ if fileInfo, _ := os.Stat(dst); fileInfo != nil {
+ return nil
+ }
// Attempt to hardlink.
if err := os.Link(src, dst); err == nil {
return nil | Avoiding copying files if they are already present in chrootw (#<I>) | hashicorp_nomad | train | go |
2c625a559d94536e9dcf1068e0c19ea22c3cf133 | diff --git a/src/renderers/canvas.js b/src/renderers/canvas.js
index <HASH>..<HASH> 100644
--- a/src/renderers/canvas.js
+++ b/src/renderers/canvas.js
@@ -87,6 +87,9 @@ Physics.renderer('canvas', function( proto ){
viewport = document.createElement('canvas');
this.el.appendChild( viewport );
+ if (typeof this.options.el === 'string' && this.el === document.body){
+ viewport.id = this.options.el;
+ }
this.el = viewport;
} | canvas renderer creates canvas with specified id if not found in dom | wellcaffeinated_PhysicsJS | train | js |
36bb9a9a632c0cf0ec5cc6c549a1e2e86fcfabcf | diff --git a/gwpy/plotter/layer.py b/gwpy/plotter/layer.py
index <HASH>..<HASH> 100644
--- a/gwpy/plotter/layer.py
+++ b/gwpy/plotter/layer.py
@@ -10,6 +10,10 @@ from .. import version
__author__ = "Duncan Macleod <duncan.macleod@ligo.org>"
__version__ = version.version
+from matplotlib.lines import Line2D
+from matplotlib.collections import PathCollection
+from matplotlib.image import AxesImage
+
try:
from collections import OrderedDict
except ImportError:
@@ -19,7 +23,8 @@ except ImportError:
class LayerCollection(OrderedDict):
"""Object recording the plotting layers on a figure
"""
- LAYER_TYPES = ['Line2D', 'PathCollection']
+ LAYER_TYPES = [Line2D.__class__.__name__, PathCollection.__class__.__name__,
+ AxesImage.__class__.__name__]
def count(self, type_=None):
if type_:
if type_ not in self.LAYER_TYPES:
@@ -38,6 +43,7 @@ class LayerCollection(OrderedDict):
"""The first mappable layer available for use in a Colorbar
"""
for layer in self.viewvalues():
- if layer.__class__.__name__ in ['PathCollection']:
+ if (isinstance(layer, PathCollection) or
+ isinstance(layer, AxesImage)):
return layer
raise ValueError("No mappable layers in this Collection") | plotter.LayerCollection: added type to colors
- now recognises AxesImage for coloring | gwpy_gwpy | train | py |
6d03d711b65eaea7fb8fc91c3792fa819d1af058 | diff --git a/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/HasImage.php b/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/HasImage.php
index <HASH>..<HASH> 100644
--- a/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/HasImage.php
+++ b/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/HasImage.php
@@ -60,9 +60,7 @@ class HasImage implements SpecialAttributeInterface
*/
public function getSearchQuery()
{
- $query = $this->queryFactory->create(QueryInterface::TYPE_MISSING, ['field' => 'image']);
-
- return $this->queryFactory->create(QueryInterface::TYPE_NOT, ['query' => $query]);
+ return $this->queryFactory->create(QueryInterface::TYPE_EXISTS, ['field' => 'image']);
}
/**
@@ -102,7 +100,7 @@ class HasImage implements SpecialAttributeInterface
*/
public function getValue()
{
- return 1;
+ return true;
}
/** | has_image handling now use the exists query insteand of a not missing. | Smile-SA_elasticsuite | train | php |
40e14f7bc2f09bd2082bcde3d977cf84d74d0000 | diff --git a/binding.go b/binding.go
index <HASH>..<HASH> 100644
--- a/binding.go
+++ b/binding.go
@@ -278,6 +278,10 @@ func (self *Binding) Evaluate(req *http.Request, header *TemplateHeader, data ma
default:
redirect := string(statusAction)
+ if !self.NoTemplate {
+ redirect = EvalInline(redirect, data, funcs)
+ }
+
// if a url or path was specified, redirect the parent request to it
if strings.HasPrefix(redirect, `http`) || strings.HasPrefix(redirect, `/`) {
return nil, RedirectTo(redirect)
diff --git a/util/util.go b/util/util.go
index <HASH>..<HASH> 100644
--- a/util/util.go
+++ b/util/util.go
@@ -2,4 +2,4 @@ package util
const ApplicationName = `diecast`
const ApplicationSummary = `a dynamic site generator that consumes REST services and renders static HTML output in realtime`
-const ApplicationVersion = `1.8.6`
+const ApplicationVersion = `1.8.7` | Allow binding status redirects to include templates | ghetzel_diecast | train | go,go |
1a3bc6ff2016fec3a3ea6b67b632c5ee52876bfc | diff --git a/src/amsterdam.py b/src/amsterdam.py
index <HASH>..<HASH> 100755
--- a/src/amsterdam.py
+++ b/src/amsterdam.py
@@ -51,7 +51,7 @@ class Amsterdam:
return datadir
def create_data_dirs(self):
- for directory in ['scirius', 'suricata', 'elasticsearch']:
+ for directory in ['scirius', 'suricata', 'elasticsearch', 'backups']:
dir_path = os.path.join(self.basepath, directory)
if not os.path.exists(dir_path):
os.makedirs(dir_path) | scirius: make backups folder in $basepath | StamusNetworks_Amsterdam | train | py |
5fd152bd0c8bbc43faf1d1f46429a42dee654420 | diff --git a/lib/commands/new.js b/lib/commands/new.js
index <HASH>..<HASH> 100644
--- a/lib/commands/new.js
+++ b/lib/commands/new.js
@@ -38,7 +38,7 @@ module.exports = Command.extend({
this.config = new Config(configPath, {
root: path.join(process.cwd(), this.options.dirName),
- name: this.args.name,
+ name: stringUtils.pascalize(this.args.name),
modulePrefix: stringUtils.dasherize(this.args.name),
id: this.args.id
});
diff --git a/lib/utils/string.js b/lib/utils/string.js
index <HASH>..<HASH> 100644
--- a/lib/utils/string.js
+++ b/lib/utils/string.js
@@ -11,5 +11,8 @@ module.exports = {
},
dasherize: function(str) {
return this.decamelize(str).replace(STRING_DASHERIZE_REGEXP, '-');
+ },
+ pascalize: function(str) {
+ return str ? str.replace(/(\w)(\w*)/g, function(g0,g1,g2){return g1.toUpperCase() + g2.toLowerCase();}) : '';
}
}; | pascalize name so that ENV var is created correctly in generated templates | poetic_ember-cli-cordova | train | js,js |
6c6a190e48d38af8fcddd17ea1adc58b6a0bb673 | diff --git a/src/GenericSnippetKeyGenerator.php b/src/GenericSnippetKeyGenerator.php
index <HASH>..<HASH> 100644
--- a/src/GenericSnippetKeyGenerator.php
+++ b/src/GenericSnippetKeyGenerator.php
@@ -66,18 +66,14 @@ class GenericSnippetKeyGenerator implements SnippetKeyGenerator
*/
private function getSnippetKeyDataAsString(array $data)
{
- $dataString = '';
-
- foreach ($this->usedDataParts as $dataKey) {
+ return array_reduce($this->usedDataParts, function ($carry, $dataKey) use ($data) {
if (!isset($data[$dataKey])) {
throw new MissingSnippetKeyGenerationDataException(
sprintf('"%s" is missing in snippet generation data.', $dataKey)
);
}
- $dataString .= '_' . $data[$dataKey];
- }
-
- return $dataString;
+ return $carry . '_' . $data[$dataKey];
+ }, '');
}
} | Issue #<I>: Refactor GenericSnippetKeyGenerator::getSnippetKeyDataAsString | lizards-and-pumpkins_catalog | train | php |
f33d248d026b16006b56cdf8a2432983dbdce228 | diff --git a/provider/openstack/init.go b/provider/openstack/init.go
index <HASH>..<HASH> 100644
--- a/provider/openstack/init.go
+++ b/provider/openstack/init.go
@@ -11,12 +11,17 @@ import (
const (
providerType = "openstack"
- rootDiskSourceVolume = "volume"
- rootDiskSourceLocal = "local"
// Default root disk size when root-disk-source is volume.
defaultRootDiskSize = 30 * 1024 // 30 GiB
)
+const (
+ // BlockDeviceMapping source volume type for cinder block device.
+ rootDiskSourceVolume = "volume"
+ // BlockDeviceMapping source volume type for local block device.
+ rootDiskSourceLocal = "local"
+)
+
func init() {
environs.RegisterProvider(providerType, providerInstance) | Add comments to constants for BlockDeviceMapping source types. | juju_juju | train | go |
e642601b004b7f14c50e0954dee6d67213dad710 | diff --git a/jawn-core/src/main/java/net/javapla/jawn/core/DeploymentInfo.java b/jawn-core/src/main/java/net/javapla/jawn/core/DeploymentInfo.java
index <HASH>..<HASH> 100644
--- a/jawn-core/src/main/java/net/javapla/jawn/core/DeploymentInfo.java
+++ b/jawn-core/src/main/java/net/javapla/jawn/core/DeploymentInfo.java
@@ -107,6 +107,7 @@ public class DeploymentInfo {
if (path == null) return null;
+ if (path.startsWith(webappPath)) return path;
String p = assertStartSlash(path); | if path is already real just return | MTDdk_jawn | train | java |
208f80c42ecfd02f60d623fa23f49d09146ba8ce | diff --git a/nanoplot/NanoPlot.py b/nanoplot/NanoPlot.py
index <HASH>..<HASH> 100755
--- a/nanoplot/NanoPlot.py
+++ b/nanoplot/NanoPlot.py
@@ -76,6 +76,7 @@ def main():
plots.extend(
make_plots(dfbarc, settings)
)
+ settings["path"] = path.join(args.outdir, args.prefix)
else:
plots = make_plots(datadf, settings)
make_report(plots, settings["path"], logfile) | reset path after processing all barcodes | wdecoster_NanoPlot | train | py |
48c487977f2f91fd8e2b0ba36cb15cffcc378724 | diff --git a/enocean/protocol/packet.py b/enocean/protocol/packet.py
index <HASH>..<HASH> 100644
--- a/enocean/protocol/packet.py
+++ b/enocean/protocol/packet.py
@@ -135,7 +135,8 @@ class Packet(object):
class RadioPacket(Packet):
- destination = ''
+ destination = 0
+ destination_hex = ''
dbm = 0
status = 0
sender = 0
@@ -143,8 +144,13 @@ class RadioPacket(Packet):
learn = True
contains_eep = False
+ def __str__(self):
+ packet_str = super(RadioPacket, self).__str__()
+ return '%s->%s (%d dBm): %s' % (self.sender_hex, self.destination_hex, self.dbm, packet_str)
+
def parse(self):
self.destination = self._combine_hex(self.optional[1:5])
+ self.destination_hex = ':'.join([('%02X' % o) for o in self.optional[1:5]])
self.dBm = -self.optional[5]
self.status = self.data[-1]
self.sender = self._combine_hex(self.data[-5:-1]) | - add RSSI and sender/receiver addresses to RadioPacket logging | kipe_enocean | train | py |
7d36f6346ef6021d544744c5ae9c6b63a5241cbf | diff --git a/packages/types/src/core/records.js b/packages/types/src/core/records.js
index <HASH>..<HASH> 100644
--- a/packages/types/src/core/records.js
+++ b/packages/types/src/core/records.js
@@ -10,7 +10,8 @@ import type {
import { List, Map, Record, Set } from "immutable";
-export { makeLocalKernelRecord, makeDesktopHostRecord } from "./hosts";
+export { HostRef, makeLocalKernelRecord, makeDesktopHostRecord } from "./hosts";
+export { KernelspecsRef } from "./kernelspecs";
/* | refactor: export refs from `records`.
Didn't realize we could only import from `records` here. In the future,
it might make more sense to rename `records` to `index` or something? I
feel like that's the purpose of that file. | nteract_nteract | train | js |
a59dbbeaaf96daff5c471f657b95e7bcd415ef31 | diff --git a/ext_emconf.php b/ext_emconf.php
index <HASH>..<HASH> 100644
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -9,7 +9,7 @@ $EM_CONF[$_EXTKEY] = array (
'description' => 'Boostrap Package delivers a full configured frontend for TYPO3 CMS 6.2, based on the Bootstrap CSS Framework.',
'category' => 'templates',
'shy' => 0,
- 'version' => '6.2.5',
+ 'version' => '6.2.6-dev',
'dependencies' => '',
'conflicts' => '',
'priority' => 'top', | Set version to <I>-dev | benjaminkott_bootstrap_package | train | php |
3d4ba792240ef32081367ba4509dfc0f06ba958a | diff --git a/examples/bottles.rb b/examples/bottles.rb
index <HASH>..<HASH> 100644
--- a/examples/bottles.rb
+++ b/examples/bottles.rb
@@ -88,7 +88,7 @@ class Countdown
end
def subtraction
- %{take #{number.pronoun} #{removal}}
+ %{take #{number.pronoun} #{removal_strategy}}
end
end
end
@@ -100,7 +100,7 @@ class Location
'on'
end
- def removal
+ def removal_strategy
'off'
end
@@ -110,7 +110,7 @@ class Location
end
class Wall < Location
- def removal
+ def removal_strategy
'down'
end
end
@@ -120,7 +120,7 @@ class Box < Location
'in'
end
- def removal
+ def removal_strategy
'out'
end
end | rename removal method in example to removal_strategy | saturnflyer_surrounded | train | rb |
92c8588a2c215d2620a4ad8f2164f40255855f67 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -42,6 +42,7 @@ setup(
'organizations.backends',
'organizations.migrations',
'organizations.templatetags',
+ 'organizations.views',
],
classifiers=[
'Development Status :: 2 - Pre-Alpha', | Add the `views` module to the Python package build
Look like when separating the views into a submodule, it wasn't added to the `setup.py` file. So all pre-release versions on PyPI are lacking the `organizations.views.*`. | bennylope_django-organizations | train | py |
939f03f45adef3b3739d941db0f9b6674eb9a783 | diff --git a/src/main/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java b/src/main/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java
index <HASH>..<HASH> 100644
--- a/src/main/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java
+++ b/src/main/org/openscience/cdk/ringsearch/FiguerasSSSRFinder.java
@@ -218,10 +218,10 @@ public class FiguerasSSSRFinder {
List<List<IAtom>> path = new ArrayList<List<IAtom>>(OKatoms);
List<IAtom> intersection = new ArrayList<IAtom>();
List<IAtom> ring = new ArrayList<IAtom>();
- for (int f = 0; f < OKatoms; f++)
+ for (final IAtom atom : molecule.atoms())
{
- path.set(f, new ArrayList<IAtom>());
- ((List<IAtom>)molecule.getAtom(f).getProperty(PATH)).clear();
+ path.add(new ArrayList<IAtom>());
+ atom.getProperty(PATH, List.class).clear();
}
// Initialize the queue with nodes attached to rootNode
neighbors = molecule.getConnectedAtomsList(rootNode); | Correct addition of atoms to a list. Unlike Vector, a List does not let you use set(int, Obj) unless that index already has an item.
Change-Id: I<I>d<I>e<I>efebb<I>f<I>f<I>fb<I> | cdk_cdk | train | java |
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.