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 |
|---|---|---|---|---|---|
a9a506fcc21b64604b57d149c26021d330155260 | diff --git a/lib/higml/parser.rb b/lib/higml/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/higml/parser.rb
+++ b/lib/higml/parser.rb
@@ -83,9 +83,9 @@ module Higml
def type
case @stripped_source[0]
- when VALUE_INDICATOR: :value
- when IMPORT_INDICATOR: :import
- when COMMENT_INDICATOR: :comment
+ when VALUE_INDICATOR then :value
+ when IMPORT_INDICATOR then :import
+ when COMMENT_INDICATOR then :comment
else
:selector
end | Syntax changed to support <I> | flyingmachine_higml | train | rb |
101b40aa2546225ee6aea3ed72fcfe95d5ae541a | diff --git a/openquake/calculators/ucerf_event_based.py b/openquake/calculators/ucerf_event_based.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/ucerf_event_based.py
+++ b/openquake/calculators/ucerf_event_based.py
@@ -336,7 +336,7 @@ def compute_losses(ssm, src_filter, param, riskmodel, monitor):
res = List()
rlzs_assoc = ssm.info.get_rlzs_assoc()
rlzs_by_gsim = rlzs_assoc.get_rlzs_by_gsim(DEFAULT_TRT)
- hazard = compute_gmfs(grp, src_filter, rlzs_by_gsim, param, monitor)
+ hazard = compute_hazard(grp, src_filter, rlzs_by_gsim, param, monitor)
[(grp_id, ebruptures)] = hazard['ruptures'].items()
samples = ssm.info.get_samples_by_grp() | Renaming [skip hazardlib] | gem_oq-engine | train | py |
3c41105b86fdec14f6f81ac88a1c5440cc74103d | diff --git a/zinnia/tests.py b/zinnia/tests.py
index <HASH>..<HASH> 100644
--- a/zinnia/tests.py
+++ b/zinnia/tests.py
@@ -427,9 +427,12 @@ class ZinniaViewsTestCase(TestCase):
response = self.client.get('/2010/01/01/my-test-entry/')
self.assertEquals(response.status_code, 404)
+ entry.template = 'zinnia/_entry_detail.html'
+ entry.save()
entry.sites.add(Site.objects.get_current())
response = self.client.get('/2010/01/01/my-test-entry/')
self.assertEquals(response.status_code, 200)
+ self.assertTemplateUsed(response, 'zinnia/_entry_detail.html')
def test_zinnia_entry_channel(self):
self.check_publishing_context('/channel-test/', 2, 3) | testing entry template overriding in entry_detail view | Fantomas42_django-blog-zinnia | train | py |
bad964ccd6199737abe3151ca6ddea0127b54128 | diff --git a/go/coredns/plugin/pfdns/pfdns.go b/go/coredns/plugin/pfdns/pfdns.go
index <HASH>..<HASH> 100644
--- a/go/coredns/plugin/pfdns/pfdns.go
+++ b/go/coredns/plugin/pfdns/pfdns.go
@@ -130,6 +130,10 @@ func (pf *pfdns) RefreshPfconfig(ctx context.Context) {
// ServeDNS implements the middleware.Handler interface.
func (pf *pfdns) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
+ id, _ := GlobalTransactionLock.Lock()
+
+ defer GlobalTransactionLock.Unlock(id)
+
pf.RefreshPfconfig(ctx)
state := request.Request{W: w, Req: r} | read lock in pfdns | inverse-inc_packetfence | train | go |
ae4ccb28cd5c35a1dd92fee2c7f1c07f1d8ad557 | diff --git a/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java b/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java
index <HASH>..<HASH> 100644
--- a/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java
+++ b/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java
@@ -196,9 +196,6 @@ public class CompassOverlay extends SafeDrawOverlay implements IOverlayMenuProvi
return;
}
- mAzimuth = 100;
- mIsCompassEnabled = true;
-
if (isCompassEnabled() && !Float.isNaN(mAzimuth)) {
drawCompass(canvas, mAzimuth + getDisplayOrientation(), mapView.getProjection().getScreenRect());
} | Removed some debug lines that I accidentally left in. | osmdroid_osmdroid | train | java |
2e445151f7ec317a369e62325c54ff5788539122 | diff --git a/openquake/commands/dbserver.py b/openquake/commands/dbserver.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/dbserver.py
+++ b/openquake/commands/dbserver.py
@@ -49,10 +49,12 @@ def dbserver(cmd, dbhostport=None,
else:
print('dbserver already running')
elif cmd == 'restart':
- if status == 'running':
- pid = logs.dbcmd('getpid')
- os.kill(pid, signal.SIGINT)
- dbs.run_server(dbpath, dbhostport, loglevel, foreground)
+ print('please use oq dbserver start/stop')
+ # FIXME restart is currently broken
+ # if status == 'running':
+ # pid = logs.dbcmd('getpid')
+ # os.kill(pid, signal.SIGINT)
+ # dbs.run_server(dbpath, dbhostport, loglevel, foreground)
dbserver.arg('cmd', 'dbserver command', | Mark oq dbserver restart as broken
Former-commit-id: <I>fbd<I>c<I>da<I>e<I>f<I>ce<I>bbec5b8 | gem_oq-engine | train | py |
d67ab431667aadabace66e3cd9cb99e58311ea5c | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -72,7 +72,7 @@ master_doc = 'index'
# General information about the project.
project = 'aiohttp_session'
-copyright = '2015, Andrew Svetlov'
+copyright = '2015,2016 Andrew Svetlov'
author = 'Andrew Svetlov'
# The version info for the project you're documenting, acts as replacement for | Update conf.py
<I> year | aio-libs_aiohttp-session | train | py |
e609ada804df6e403647affa632e43105d91b85b | diff --git a/vyper/parser/context.py b/vyper/parser/context.py
index <HASH>..<HASH> 100644
--- a/vyper/parser/context.py
+++ b/vyper/parser/context.py
@@ -103,12 +103,13 @@ class Context:
def make_blockscope(self, blockscope_id):
self.blockscopes.add(blockscope_id)
yield
+
# Remove all variables that have specific blockscope_id attached.
- self.vars = {
- name: var_record
- for name, var_record in self.vars.items()
- if blockscope_id not in var_record.blockscopes
- }
+ released = [(k, v) for k, v in self.vars.items() if blockscope_id in v.blockscopes]
+ for name, var in released:
+ self.memory_allocator.release_memory(var.pos, var.size * 32)
+ del self.vars[name]
+
# Remove block scopes
self.blockscopes.remove(blockscope_id) | feat: release memory upon exit of block scope | ethereum_vyper | train | py |
8fb08a5a76b39ce81ce5d47a2919c0a391c5a9df | diff --git a/src/Foundation/Console/OptimizeCommand.php b/src/Foundation/Console/OptimizeCommand.php
index <HASH>..<HASH> 100644
--- a/src/Foundation/Console/OptimizeCommand.php
+++ b/src/Foundation/Console/OptimizeCommand.php
@@ -78,7 +78,7 @@ class OptimizeCommand extends Command
*/
protected function compileClasses()
{
- $outputPath = $this->framework['path.base'] .Ds .'Boot' .DS .'Compiled.php';
+ $outputPath = $this->framework['path.base'] .DS .'Boot' .DS .'Compiled.php';
//
$preloader = (new Factory)->create(['skip' => true]);
@@ -105,7 +105,7 @@ class OptimizeCommand extends Command
{
$app = $this->framework;
- $core = require __DIR__.DS .'Optimize'.DS.'config.php';
+ $core = require __DIR__.DS .'Optimize' .DS .'config.php';
return array_merge($core, $this->framework['config']['compile']);
} | Improve Nova\Console\OptimizeCommand | nova-framework_system | train | php |
6bcce25adf403c920cbd32c90498c20d75c71e93 | diff --git a/java-client/src/main/java/com/canoo/dolphin/client/impl/ClientContextImpl.java b/java-client/src/main/java/com/canoo/dolphin/client/impl/ClientContextImpl.java
index <HASH>..<HASH> 100644
--- a/java-client/src/main/java/com/canoo/dolphin/client/impl/ClientContextImpl.java
+++ b/java-client/src/main/java/com/canoo/dolphin/client/impl/ClientContextImpl.java
@@ -100,6 +100,7 @@ public class ClientContextImpl implements ClientContext {
if(destroyed) {
throw new IllegalStateException("The client is disconnected!");
}
+ clientDolphin.stopPushListening();
return invokeDolphinCommand(PlatformConstants.DISCONNECT_COMMAND_NAME).thenAccept(v -> destroyed = true);
} | Stop pushListening in disconnect() | canoo_dolphin-platform | train | java |
c8c84e3d1a15dbe65e88e68d300a925e5322a2ba | diff --git a/treeherder/model/models.py b/treeherder/model/models.py
index <HASH>..<HASH> 100644
--- a/treeherder/model/models.py
+++ b/treeherder/model/models.py
@@ -448,7 +448,7 @@ class ExclusionProfile(models.Model):
return list1, list2
query = None
- for exclusion in self.exclusions.all().select_related("info"):
+ for exclusion in self.exclusions.all():
info = exclusion.info
option_collection_hashes = info['option_collection_hashes']
job_type_names, job_type_symbols = split_combo(info['job_types']) | Bug <I> - Error adding exclusion profile after update to Django <I>
We were calling select_related on a non-relational field. Only became
an issue with Django <I>. | mozilla_treeherder | train | py |
08718d95e58eb23f43a4acf1f652144266d16d5e | diff --git a/tests/conftest.py b/tests/conftest.py
index <HASH>..<HASH> 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -37,11 +37,28 @@ from flask_celeryext import FlaskCeleryExt
from invenio_db import db as db_
from invenio_db import InvenioDB
from invenio_pidstore import InvenioPIDStore
+from sqlalchemy.ext.compiler import compiles
+from sqlalchemy.schema import DropConstraint, DropSequence, DropTable
from sqlalchemy_utils.functions import create_database, database_exists
from invenio_records import InvenioRecords
+@compiles(DropTable, 'postgresql')
+def _compile_drop_table(element, compiler, **kwargs):
+ return compiler.visit_drop_table(element) + ' CASCADE'
+
+
+@compiles(DropConstraint, 'postgresql')
+def _compile_drop_constraint(element, compiler, **kwargs):
+ return compiler.visit_drop_constraint(element) + ' CASCADE'
+
+
+@compiles(DropSequence, 'postgresql')
+def _compile_drop_sequence(element, compiler, **kwargs):
+ return compiler.visit_drop_sequence(element) + ' CASCADE'
+
+
@pytest.yield_fixture()
def app(request):
"""Flask application fixture.""" | tests: cascading deletes on PostgreSQL | inveniosoftware_invenio-records | train | py |
7f3900312b8ae255f195d2bdc4d2a1633c118a69 | diff --git a/swarm-server/src/Server.js b/swarm-server/src/Server.js
index <HASH>..<HASH> 100644
--- a/swarm-server/src/Server.js
+++ b/swarm-server/src/Server.js
@@ -1,4 +1,5 @@
"use strict";
+var fs = require('fs');
var Replica = require('swarm-replica');
var sync = require('swarm-syncable');
var Host = sync.Host;
@@ -9,6 +10,7 @@ require('stream-url-ws');
// Host combo where the Host is mostly used for op log aggregation.
// TODO add REST API for state bundles (Replica->Host->REST API)
function Server (options) {
+ options.debug && console.log('swarm server options', options);
this.options = options;
if (!options.ssn_id) {
options.ssn_id = options.user_id || 'swarm';
@@ -20,7 +22,15 @@ function Server (options) {
options.listen = 'ws://localhost:8000';
}
- this.db = level(options.db_path || '.');
+ if (options.db) {
+ this.db = options.db;
+ } else {
+ var db_path = options.db_path || './swarm.db';
+ if (!fs.existsSync(db_path)) {
+ fs.mkdirSync(db_path);
+ }
+ this.db = level(db_path);
+ }
// BIG TODO: propagate ssn grant replica->host
// use exactly the same clock object!!! | chore(server): put db into a dir | gritzko_swarm | train | js |
b0ab92458b38b0b8ba1302e62bc028b5ea4e5499 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -79,6 +79,8 @@ MyVirtualMerchant.prototype.doPurchase = function (order, prospect, creditcard,
query.ssl_avs_address = prospect.billing.adress;
query.ssl_avs_zip = prospect.billing.zipcode;
query.ssl_city = prospect.billing.city;
+ query.ssl_zip = prospect.billing.zipcode;
+ query.ssl_state = prospect.billing.region;
query.ssl_country = prospect.billing.country;
}
} | More details for transactions (state, zip). | continuous-software_node-virtualmerchant | train | js |
c1721b77e53a6008633316ed14ee472b69bca8df | diff --git a/lib/discordrb/commands/command_bot.rb b/lib/discordrb/commands/command_bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/commands/command_bot.rb
+++ b/lib/discordrb/commands/command_bot.rb
@@ -150,7 +150,8 @@ module Discordrb::Commands
event.respond @attributes[:command_doesnt_exist_message].gsub('%command%', name.to_s) if @attributes[:command_doesnt_exist_message]
return
end
- if permission?(event.user, command.attributes[:permission_level], event.server)
+ if permission?(event.user, command.attributes[:permission_level], event.server) &&
+ required_permissions?(event.author, command.attributes[:required_permissions], event.channel)
event.command = command
result = command.call(event, arguments, chained)
stringify(result) | Check for required_permissions? in execute_command | meew0_discordrb | train | rb |
99cc4be448f22501f7874efeebb208d4914f4412 | diff --git a/lnd_test.go b/lnd_test.go
index <HASH>..<HASH> 100644
--- a/lnd_test.go
+++ b/lnd_test.go
@@ -1448,7 +1448,7 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) {
nodes := []*lntest.HarnessNode{net.Alice, carol}
err = lntest.WaitPredicate(func() bool {
return assertNumActiveHtlcs(nodes, numInvoices)
- }, time.Second*5)
+ }, time.Second*15)
if err != nil {
t.Fatalf("htlc mismatch: %v", err)
}
@@ -6089,7 +6089,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest)
}
return true
- }, time.Second*5)
+ }, time.Second*15)
if err != nil {
t.Fatalf(predErr.Error())
} | test: extend timeouts for WaitPredicate on new integration tests | lightningnetwork_lnd | train | go |
0653dc403a2c90473fc993f98c8ea2cdf2108352 | diff --git a/app/controllers/errdo/application_controller.rb b/app/controllers/errdo/application_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/errdo/application_controller.rb
+++ b/app/controllers/errdo/application_controller.rb
@@ -1,7 +1,5 @@
module Errdo
class ApplicationController < ActionController::Base
- helper Errdo::Helpers::ViewsHelper
-
end
end
diff --git a/app/controllers/errdo/errors_controller.rb b/app/controllers/errdo/errors_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/errdo/errors_controller.rb
+++ b/app/controllers/errdo/errors_controller.rb
@@ -3,6 +3,9 @@ require "slim"
module Errdo
class ErrorsController < ApplicationController
+ include Errdo::Helpers::ViewsHelper
+ helper_method :user_show_string, :user_show_path
+
def index
@errors = Errdo::Error.order(last_occurred_at: :desc).page params[:page]
end | Fix issue (bug?) where view helper wouldn't show up in integration test (But would on the server) | erichaydel_errdo | train | rb,rb |
d41118797908b8f94d89a437dfa9c033f9bc1db0 | diff --git a/tests/mustacheTest.php b/tests/mustacheTest.php
index <HASH>..<HASH> 100644
--- a/tests/mustacheTest.php
+++ b/tests/mustacheTest.php
@@ -9,6 +9,10 @@ class MustacheSpecTest extends PHPUnit_Framework_TestCase
*/
public function testSpecs($spec)
{
+ if (preg_match('/(lambdas|delimiters)\\.json/', $spec['file'])) {
+ $this->markTestIncomplete("Skip [{$spec['file']}.{$spec['name']}]#{$spec['no']} , lightncandy do not support this now.");
+ }
+
$php = LightnCandy::compile($spec['template'], Array(
'flags' => LightnCandy::FLAG_HANDLEBARSJS | LightnCandy::FLAG_ERROR_EXCEPTION,
'helpers' => array( | skip tests on lightncandy none supported features | zordius_lightncandy | train | php |
cd5cecb90b6588636f52ed0e481b244b82d5d316 | diff --git a/workbench/clients/pe_indexer.py b/workbench/clients/pe_indexer.py
index <HASH>..<HASH> 100644
--- a/workbench/clients/pe_indexer.py
+++ b/workbench/clients/pe_indexer.py
@@ -64,6 +64,10 @@ def run():
print 'Probably using a Stub Indexer, if you want an ELS Indexer see the readme'
+import pytest
+#pylint: disable=no-member
+@pytest.mark.xfail
+#pylint: enable=no-member
def test():
"""Executes pe_strings_indexer test."""
run() | putting xfail on the indexer clients until we can figure out when travis ELS is now failing | SuperCowPowers_workbench | train | py |
4cddefc2df809102e87457193fa5c19ae763b3ed | diff --git a/src/filesystem/impls/appshell/AppshellFileSystem.js b/src/filesystem/impls/appshell/AppshellFileSystem.js
index <HASH>..<HASH> 100644
--- a/src/filesystem/impls/appshell/AppshellFileSystem.js
+++ b/src/filesystem/impls/appshell/AppshellFileSystem.js
@@ -233,13 +233,30 @@ define(function (require, exports, module) {
encoding = options.encoding || "utf8";
}
- appshell.fs.readFile(path, encoding, function (err, data) {
- if (err) {
- callback(_mapError(err), null);
+ // Execute the read and stat calls in parallel
+ var done = false, data, stat, err;
+
+ appshell.fs.readFile(path, encoding, function (_err, _data) {
+ if (_err) {
+ callback(_mapError(_err));
+ return;
+ }
+
+ if (done) {
+ callback(err, _data, stat);
} else {
- stat(path, function (err, stat) {
- callback(err, data, stat);
- });
+ done = true;
+ data = _data;
+ }
+ });
+
+ exports.stat(path, function (_err, _stat) {
+ if (done) {
+ callback(_err, data, _stat);
+ } else {
+ done = true;
+ stat = _stat;
+ err = _err;
}
});
} | Execute read and stat calls in parallel in AppshellFileSystem.readFile, resulting in a ~4-5% (><I>ms) speedup for Brackets-sized find-in-files queries | adobe_brackets | train | js |
73a46b74a0c9ae5ebd53e248a0c02f43dd84fb4f | diff --git a/monolith/__init__.py b/monolith/__init__.py
index <HASH>..<HASH> 100644
--- a/monolith/__init__.py
+++ b/monolith/__init__.py
@@ -1,7 +1,7 @@
"""
monolith is an argparse based command line interface framework
"""
-VERSION = (0, 1, 0)
+VERSION = (0, 1, 1)
__version__ = '.'.join((str(each) for each in VERSION[:4])) | Bumped version to <I> | lukaszb_monolith | train | py |
d34f5cda25c43f3544428a83a2bdfbb49bee0b70 | diff --git a/fermipy/castro.py b/fermipy/castro.py
index <HASH>..<HASH> 100644
--- a/fermipy/castro.py
+++ b/fermipy/castro.py
@@ -1197,6 +1197,11 @@ class TSCube(object):
self._norm_type = norm_type
@property
+ def nvals(self):
+ """Return the number of values in the tscube"""
+ return self._norm_vals.shape[0]
+
+ @property
def tsmap(self):
""" return the Map of the TestStatistic value """
return self._tsmap
@@ -1257,8 +1262,20 @@ class TSCube(object):
tab_s = Table.read(fitsfile, 'SCANDATA')
tab_f = Table.read(fitsfile, 'FITDATA')
- emin = np.array(tab_e['E_MIN'] / 1E3)
- emax = np.array(tab_e['E_MAX'] / 1E3)
+ emin = np.array(tab_e['E_MIN'])
+ emax = np.array(tab_e['E_MAX'])
+ try:
+ if str(tab_e['E_MIN'].unit) == 'keV':
+ emin /= 1000.
+ except:
+ pass
+ try:
+ if str(tab_e['E_MAX'].unit) == 'keV':
+ emax /= 1000.
+ except:
+ pass
+
+
nebins = len(tab_e)
npred = tab_e['REF_NPRED'] | Added unit checking when create CastroData from FITS files | fermiPy_fermipy | train | py |
b8f5b8aa01989c4209988bae106df90278f77892 | diff --git a/media/boom/js/boom/page/settings.js b/media/boom/js/boom/page/settings.js
index <HASH>..<HASH> 100644
--- a/media/boom/js/boom/page/settings.js
+++ b/media/boom/js/boom/page/settings.js
@@ -306,7 +306,7 @@ boomPage.prototype.childsettings = function() {
page.saveSettings(url, $("form.b-form-settings").serialize())
.done(function() {
- page.saveSettings(url, {sequences : sequences}, 'Child page ordering saved, reloading page');
+ page.saveSettings('/cms/page/settings/sort_children/' + page.id, {sequences : sequences}, 'Child page ordering saved');
});
}
}); | Bugfix: child page manual ordering not saving | boomcms_boom-core | train | js |
c1df97b32a9a57e99817bd19716ebe0465119cc3 | diff --git a/test_duct.py b/test_duct.py
index <HASH>..<HASH> 100644
--- a/test_duct.py
+++ b/test_duct.py
@@ -151,9 +151,10 @@ def test_nesting():
def test_cwd():
# Test cwd at both the top level and the command level, and that either can
- # be a pathlib Path.
- tmpdir = tempfile.mkdtemp()
- another = tempfile.mkdtemp()
+ # be a pathlib Path. Use realpath() on the paths we get from mkdtemp(),
+ # because on OSX there's a symlink in there.
+ tmpdir = os.path.realpath(tempfile.mkdtemp())
+ another = os.path.realpath(tempfile.mkdtemp())
assert tmpdir == pwd().read(cwd=tmpdir)
assert tmpdir == pwd(cwd=tmpdir).read(cwd=another)
if has_pathlib: | handle temp dir symlinks for tests on OSX | oconnor663_duct.py | train | py |
a7f1639c0958c215cf6e7619ddaf60346a0258c5 | diff --git a/go/vt/mysqlctl/split.go b/go/vt/mysqlctl/split.go
index <HASH>..<HASH> 100644
--- a/go/vt/mysqlctl/split.go
+++ b/go/vt/mysqlctl/split.go
@@ -222,12 +222,15 @@ func (mysqld *Mysqld) CreateSplitSnapshot(dbName, keyName string, startKey, endK
return
}
+ // clean out and start fresh
+ relog.Info("removing previous snapshots: %v", mysqld.SnapshotDir)
+ if err = os.RemoveAll(mysqld.SnapshotDir); err != nil {
+ return
+ }
+
cloneSourcePath := path.Join(mysqld.SnapshotDir, dataDir, dbName+"-"+string(startKey)+","+string(endKey))
// clean out and start fresh
for _, _path := range []string{cloneSourcePath} {
- if err = os.RemoveAll(_path); err != nil {
- return
- }
if err = os.MkdirAll(_path, 0775); err != nil {
return
} | Removing all old snapshots when starting a multisnapshot. To have enough space to go on. | vitessio_vitess | train | go |
d71a8b14aaf8c6318a4226713fd83dbfb2d25f3a | diff --git a/java/server/src/org/openqa/selenium/remote/server/handler/internal/ArgumentConverter.java b/java/server/src/org/openqa/selenium/remote/server/handler/internal/ArgumentConverter.java
index <HASH>..<HASH> 100644
--- a/java/server/src/org/openqa/selenium/remote/server/handler/internal/ArgumentConverter.java
+++ b/java/server/src/org/openqa/selenium/remote/server/handler/internal/ArgumentConverter.java
@@ -22,6 +22,7 @@ import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
+import org.openqa.selenium.remote.RemoteWebElement;
import org.openqa.selenium.remote.server.KnownElements;
import java.util.List;
@@ -51,6 +52,10 @@ public class ArgumentConverter implements Function<Object, Object> {
return converted;
}
+ if (arg instanceof RemoteWebElement) {
+ return knownElements.get(((RemoteWebElement) arg).getId());
+ }
+
if (arg instanceof List<?>) {
return Lists.newArrayList(Iterables.transform((List<?>) arg, this));
} | Convert RemoteWebElements decoded from JSON to "known elements".
As of commit e<I>b<I>dc<I>b<I>ecf9c7a9bbe<I>a<I>b<I>ad, the decoded JSON parameters may include a WebElement. It's necessary to convert the element when a RemoteWebElement is passed as the "id" param to SwitchToFrame.
Fixes #<I>. | SeleniumHQ_selenium | train | java |
0bea0cc5b9fc7734f20e17d51a7f9a966b454dce | diff --git a/pkg/services/alerting/datasources/backends.go b/pkg/services/alerting/datasources/backends.go
index <HASH>..<HASH> 100644
--- a/pkg/services/alerting/datasources/backends.go
+++ b/pkg/services/alerting/datasources/backends.go
@@ -2,9 +2,16 @@ package graphite
import (
"fmt"
+
m "github.com/grafana/grafana/pkg/models"
)
+// AlertDatasource is bacon
+type AlertDatasource interface {
+ GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error)
+}
+
+// GetSeries returns timeseries data from the datasource
func GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error) {
if job.Datasource.Type == m.DS_GRAPHITE {
return GraphiteClient{}.GetSeries(job) | feat(alerting): add interface for alert backend | grafana_grafana | train | go |
88e8761a1aee210044872f6ea28900074cf578b6 | diff --git a/src/main/java/org/fit/layout/cssbox/BoxNode.java b/src/main/java/org/fit/layout/cssbox/BoxNode.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fit/layout/cssbox/BoxNode.java
+++ b/src/main/java/org/fit/layout/cssbox/BoxNode.java
@@ -14,6 +14,7 @@ import java.util.List;
import java.util.Map;
import java.util.Vector;
+import org.fit.cssbox.css.CSSUnits;
import org.fit.cssbox.layout.BlockReplacedBox;
import org.fit.cssbox.layout.Box;
import org.fit.cssbox.layout.ElementBox;
@@ -571,7 +572,7 @@ public class BoxNode extends GenericTreeNode implements org.fit.layout.model.Box
Color clr = null;
if (tclr != null)
- clr = tclr.getValue();
+ clr = CSSUnits.convertColor(tclr.getValue());
if (clr == null)
{
clr = box.getVisualContext().getColor(); | Update to the new jStyleParser color API | FitLayout_layout-cssbox | train | java |
38e63ac3c2f4f5543875605aee8effccb58bc067 | diff --git a/src/Snowflake/ImportBase.php b/src/Snowflake/ImportBase.php
index <HASH>..<HASH> 100644
--- a/src/Snowflake/ImportBase.php
+++ b/src/Snowflake/ImportBase.php
@@ -80,8 +80,6 @@ abstract class ImportBase implements ImportInterface
);
}
- $this->dropTable($stagingTableName);
-
$this->importedColumns = $columns;
return new Result([ | snowflake: removed manual drop of temporary table | keboola_php-db-import | train | php |
2c85f31126b96f857d0dc38b5cd2192fc414bc99 | diff --git a/tornado/test/process_test.py b/tornado/test/process_test.py
index <HASH>..<HASH> 100644
--- a/tornado/test/process_test.py
+++ b/tornado/test/process_test.py
@@ -179,6 +179,9 @@ class SubprocessTest(AsyncTestCase):
self.assertEqual(data, b"\n")
def test_stderr(self):
+ # This test is mysteriously flaky on twisted: it succeeds, but logs
+ # an error of EBADF on closing a file descriptor.
+ skip_if_twisted()
subproc = Subprocess([sys.executable, '-u', '-c',
r"import sys; sys.stderr.write('hello\n')"],
stderr=Subprocess.STREAM, | Skip another subprocess test that is flaky on twisted | tornadoweb_tornado | train | py |
6b64c390304ae0d09d5b2f955d223d8eef827d68 | diff --git a/src/python/pants/bin/pants_exe.py b/src/python/pants/bin/pants_exe.py
index <HASH>..<HASH> 100644
--- a/src/python/pants/bin/pants_exe.py
+++ b/src/python/pants/bin/pants_exe.py
@@ -56,6 +56,8 @@ def _help(version, root_dir):
print()
print('Available subcommands:\n\t%s' % '\n\t'.join(_find_all_commands()))
print()
+ print('Friendly docs: http://pantsbuild.github.io/')
+ print()
print("""Default subcommand flags can be stored in ~/.pantsrc using the 'options' key of a
section named for the subcommand in ini style format, ie:
[build] | Pants help text += link to web site | pantsbuild_pants | train | py |
4665a0cf866d04142645978f00c96cd2d2d1f6e5 | diff --git a/src/Spryker/Console/InstallConsoleCommand.php b/src/Spryker/Console/InstallConsoleCommand.php
index <HASH>..<HASH> 100644
--- a/src/Spryker/Console/InstallConsoleCommand.php
+++ b/src/Spryker/Console/InstallConsoleCommand.php
@@ -234,7 +234,7 @@ class InstallConsoleCommand extends Command
*/
protected function getEnvironment()
{
- $environment = (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development');
+ $environment = (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production');
return $environment;
} | PS-<I> Use staging/live env configuration by default (production) | spryker_install | train | php |
9282f0ab39a677f422d6d1a6b7862360643bb718 | diff --git a/views/badge.py b/views/badge.py
index <HASH>..<HASH> 100644
--- a/views/badge.py
+++ b/views/badge.py
@@ -104,18 +104,25 @@ def doi_badge(doi):
if pid is None:
return abort(404)
- return badge(doi)
+ style = request.args.get('style', None)
+
+ return badge(doi, style)
@blueprint.route("/<int:user_id>/<path:repository>.png", methods=["GET"])
@ssl_required
def index_old(user_id, repository):
"""Legacy support for old badge icons."""
- return redirect(url_for('.index', user_id=user_id, repository=repository))
+ style = request.args.get('style', None)
+ full_url = url_for('.index', user_id=user_id,
+ repository=repository, style=style)
+ return redirect(full_url)
@blueprint.route("/doi/<path:doi>.png", methods=["GET"])
@ssl_required
def doi_badge_old(doi):
"""Legacy support for old badge icons."""
- return redirect(url_for('.doi_badge', doi=doi))
+ style = request.args.get('style', None)
+ full_url = url_for('.doi_badge', doi=doi, style=style)
+ return redirect(full_url) | github: activate badge style support for DOI
* Adds support for `style` while generating a badge for
specific DOI. (addresses #<I>). | inveniosoftware_invenio-github | train | py |
4128919974b97acc47d035f1834afdd503017d95 | diff --git a/bika/lims/content/bikasetup.py b/bika/lims/content/bikasetup.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/bikasetup.py
+++ b/bika/lims/content/bikasetup.py
@@ -302,6 +302,7 @@ schema = BikaFolderSchema.copy() + Schema((
{'portal_type': 'ReferenceSample', 'prefix': 'RS', 'padding': '4'},
{'portal_type': 'SupplyOrder', 'prefix': 'O', 'padding': '3'},
{'portal_type': 'Worksheet', 'prefix': 'WS', 'padding': '4'},
+ {'portal_type': 'Pricelist', 'prefix': 'PL', 'padding': '4'},
],
# fixedSize=8,
widget=RecordsWidget(
diff --git a/bika/lims/content/pricelist.py b/bika/lims/content/pricelist.py
index <HASH>..<HASH> 100644
--- a/bika/lims/content/pricelist.py
+++ b/bika/lims/content/pricelist.py
@@ -108,7 +108,7 @@ def create_price_list(instance):
cat = None
if obj.getPrice():
price = float(obj.getPrice())
- totalprice = obj.getTotalPrice()
+ totalprice = float(obj.getTotalPrice())
vat = totalprice - price
else:
price = 0 | Add Pricelist prefix, and fix type error in VAT calculation | senaite_senaite.core | train | py,py |
16fb85f840af3bfc1fb150abaffec558cc3cb418 | diff --git a/pyes/queryset.py b/pyes/queryset.py
index <HASH>..<HASH> 100644
--- a/pyes/queryset.py
+++ b/pyes/queryset.py
@@ -332,7 +332,7 @@ class QuerySet(object):
and returning the created object.
"""
obj = self.model(**kwargs)
- meta = obj.get_meta()
+ meta = obj.get_meta()
meta.connection = get_es_connection(self.es_url, self.es_kwargs)
meta.index=self.index
meta.type=self.type | fixed inconsistent use to QuerySet
it would raise an Error under python<I>
the line <I>:
meta = obj.get_meta()
^
TabError: inconsistent use of tabs and spaces in indentation | aparo_pyes | train | py |
8c7a3fbfcfd0a128fc9af38e7fb2ca8d0ffe18e8 | diff --git a/example/app.js b/example/app.js
index <HASH>..<HASH> 100644
--- a/example/app.js
+++ b/example/app.js
@@ -103,10 +103,12 @@ dom.downloadMap[1].onclick = function () {
dom.uploadMap[0].onchange = function (event) {
uploadMap(map, event);
+ dom.uploadMap[0].value = "";
};
dom.uploadMap[1].onchange = function (event) {
uploadMap(testMap, event);
+ dom.uploadMap[1].value = "";
};
dom.downloadImage[0].onclick = function () { | [fix] reset file input value after map upload | Mindmapp_mmp | train | js |
ed8bd4365682c074c0f36f3c0336297eb2690353 | diff --git a/public/js/source/custom-images-grifus-admin.js b/public/js/source/custom-images-grifus-admin.js
index <HASH>..<HASH> 100644
--- a/public/js/source/custom-images-grifus-admin.js
+++ b/public/js/source/custom-images-grifus-admin.js
@@ -23,8 +23,8 @@
url: eliasis.ajax_url,
type: "post",
data: {
- action: 'replaceOldImages',
- custom_nonce : eliasis.custom_nonce
+ action: 'replaceOldImages',
+ nonce : eliasis.nonce
},
success:function(data) { | Updated to <I> version | eliasis-framework_custom-images-grifus | train | js |
cb6d1827ef8f9a5a74c836d7927ddc579a715c8b | diff --git a/packages/server-web/src/client/store.js b/packages/server-web/src/client/store.js
index <HASH>..<HASH> 100644
--- a/packages/server-web/src/client/store.js
+++ b/packages/server-web/src/client/store.js
@@ -3,11 +3,15 @@ import { replay } from "@todastic/storage-events";
export const store = { todos: [], isAuthenticated: false };
const allEvents = [];
+let currentEventPositon = -1;
export function processEvent(event) {
// console.log(new Date(), "processing event", event);
- allEvents.push(event);
- store.todos = replay(allEvents).todos;
+ if (event.position > currentEventPositon) {
+ allEvents.push(event);
+ currentEventPositon = event.position;
+ store.todos = replay(allEvents).todos;
+ }
// console.log("new store.todos", store.todos);
} | Only process new events. Fix #<I> | compose-us_todastic | train | js |
95b2d5fdcd8e9ab7fa080a5be6492cad0cd9d6ef | diff --git a/lib/aws/xml/parser.rb b/lib/aws/xml/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/aws/xml/parser.rb
+++ b/lib/aws/xml/parser.rb
@@ -73,15 +73,11 @@ module Aws
end
def member(shape, raw)
- case shape
- when Seahorse::Model::Shapes::StructureShape
- structure(shape, raw)
- when Seahorse::Model::Shapes::ListShape
- list(shape, raw)
- when Seahorse::Model::Shapes::MapShape
- map(shape, raw)
- else
- raw
+ case shape.type
+ when :structure then structure(shape, raw)
+ when :list then list(shape, raw)
+ when :map then map(shape, raw)
+ else raw
end
end | Xml::Parser no longer does type checking by class, now uses the Shape#type property. | aws_aws-sdk-ruby | train | rb |
d283d85729a0d29cab65bd6c82cf1583656cd688 | diff --git a/source/core/oxmodule.php b/source/core/oxmodule.php
index <HASH>..<HASH> 100644
--- a/source/core/oxmodule.php
+++ b/source/core/oxmodule.php
@@ -247,7 +247,7 @@ class oxModule extends oxSuperCfg
}
} else {
$aDisabledModules = (array) $this->getConfig()->getConfigParam('aDisabledModules');
- if ( is_array( $aDisabledModules ) && !in_array( $sId, $aDisabledModules ) ) {
+ if ( !empty( $aDisabledModules ) && !in_array( $sId, $aDisabledModules ) ) {
$blActive = true;
}
} | in method isActive changed check from checking variable is array to checking if it is not empty | OXID-eSales_oxideshop_ce | train | php |
975de9dd47849fd9a895045d1be0fce6d8f2b4db | diff --git a/lib/active_median.rb b/lib/active_median.rb
index <HASH>..<HASH> 100644
--- a/lib/active_median.rb
+++ b/lib/active_median.rb
@@ -5,7 +5,7 @@ require "active_median/version"
module ActiveMedian
def self.create_function
# create median method
- # http://wiki.postgresql.org/wiki/Aggregate_Median
+ # https://wiki.postgresql.org/wiki/Aggregate_Median
ActiveRecord::Base.connection.execute <<-SQL
CREATE OR REPLACE FUNCTION median(anyarray)
RETURNS float8 AS | Use https url [skip ci] | ankane_active_median | train | rb |
c86a5ea14f8c7a437c28b960cba640bfbb7847e8 | diff --git a/loompy/loompy.py b/loompy/loompy.py
index <HASH>..<HASH> 100755
--- a/loompy/loompy.py
+++ b/loompy/loompy.py
@@ -769,7 +769,7 @@ def _create_sparse(filename: str, matrix: np.ndarray, row_attrs: Dict[str, np.nd
raise FileExistsError("Cannot overwrite existing file " + filename)
logging.info("Converting to csc format")
matrix = matrix.tocsc()
- window = 64
+ window = 6400
ix = 0
while ix < matrix.shape[1]:
window = min(window, matrix.shape[1] - ix) | Performance bug when creating from sparse | linnarsson-lab_loompy | train | py |
e539e1816d7868cdd458f211f83502bea249b93d | diff --git a/src/Domain/Generic/Model.php b/src/Domain/Generic/Model.php
index <HASH>..<HASH> 100644
--- a/src/Domain/Generic/Model.php
+++ b/src/Domain/Generic/Model.php
@@ -40,6 +40,7 @@ abstract class Model implements ModelInterface
* @return $this
*
* @throws IdAlreadyAssignedException if attempting to re-assign $id
+ * @throws InvalidIdException if the $id is of the wrong type
*/
public function assignId(ModelIdInterface $id)
{ | Added missing exception to method DocBlock | cubicmushroom_hexagonal-components | train | php |
de9cbf61954201943a7b170a7d0a8b34afb5942c | diff --git a/hugolib/config.go b/hugolib/config.go
index <HASH>..<HASH> 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -585,7 +585,6 @@ func loadDefaultSettingsFor(v *viper.Viper) error {
v.SetDefault("cleanDestinationDir", false)
v.SetDefault("watch", false)
- v.SetDefault("metaDataFormat", "toml")
v.SetDefault("resourceDir", "resources")
v.SetDefault("publishDir", "public")
v.SetDefault("themesDir", "themes") | Remove metaDataFormat setting
Not in use anymore. | gohugoio_hugo | train | go |
02ca93e30097d1707736b79ed6ac20589855c12e | diff --git a/ttnctl/cmd/device.go b/ttnctl/cmd/device.go
index <HASH>..<HASH> 100644
--- a/ttnctl/cmd/device.go
+++ b/ttnctl/cmd/device.go
@@ -138,6 +138,10 @@ var devicesInfoCmd = &cobra.Command{
fmt.Println("Dynamic device:")
fmt.Println()
+ fmt.Printf(" AppEUI: %X\n", appEUI)
+ fmt.Printf(" {%s}\n", cStyle(appEUI))
+
+ fmt.Println()
fmt.Printf(" DevEUI: %X\n", device.DevEUI)
fmt.Printf(" {%s}\n", cStyle(device.DevEUI)) | [ttnctl] Print AppEUI for OTAA devices | TheThingsNetwork_ttn | train | go |
6cd74b35660577c70a647d9cbb4ef6a70fb7e435 | diff --git a/paging_result.go b/paging_result.go
index <HASH>..<HASH> 100644
--- a/paging_result.go
+++ b/paging_result.go
@@ -48,6 +48,8 @@ func newPagingResult(session *Session, res Result) (*PagingResult, error) {
return nil, err
}
+ paging.UsageInfo = res.UsageInfo()
+
if paging.Paging != nil {
pr.previous = paging.Paging.Previous
pr.next = paging.Paging.Next | fix #<I> paging.UsageInfo is not initialized in the first page | huandu_facebook | train | go |
ec3b17159c4488f7475aabc842343a2d5989a84b | diff --git a/pythonforandroid/bdistapk.py b/pythonforandroid/bdistapk.py
index <HASH>..<HASH> 100644
--- a/pythonforandroid/bdistapk.py
+++ b/pythonforandroid/bdistapk.py
@@ -87,7 +87,8 @@ class BdistAPK(Command):
'that.')
bdist_dir = 'build/bdist.android-{}'.format(self.arch)
- rmtree(bdist_dir)
+ if exists(bdist_dir):
+ rmtree(bdist_dir)
makedirs(bdist_dir)
globs = [] | Check if bdist_dir exists before removing | kivy_python-for-android | train | py |
3d6d332756a7a2460b87a0952d202186371f63d5 | diff --git a/lib/bummr/outdated.rb b/lib/bummr/outdated.rb
index <HASH>..<HASH> 100644
--- a/lib/bummr/outdated.rb
+++ b/lib/bummr/outdated.rb
@@ -8,10 +8,10 @@ module Bummr
def outdated_gems(all_gems: false)
results = []
- options = []
- options << "--strict" unless all_gems
+ options = ""
+ options << " --strict" unless all_gems
- Open3.popen2("bundle outdated", *options) do |_std_in, std_out|
+ Open3.popen2("bundle outdated" + options) do |_std_in, std_out|
while line = std_out.gets
puts line
gem = parse_gem_from(line)
diff --git a/spec/lib/outdated_spec.rb b/spec/lib/outdated_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/outdated_spec.rb
+++ b/spec/lib/outdated_spec.rb
@@ -53,7 +53,7 @@ describe Bummr::Outdated do
end
it "defaults to false" do
- expect(Open3).to receive(:popen2).with("bundle outdated", "--strict").and_yield(nil, stdoutput)
+ expect(Open3).to receive(:popen2).with("bundle outdated --strict").and_yield(nil, stdoutput)
allow(Bummr::Outdated.instance).to receive(:gemfile).and_return gemfile | Fix "no such file or directory" error
- Resolves <URL> | lpender_bummr | train | rb,rb |
0d2d5c50dfac43eacd6a3637daedb0c85df7da1c | diff --git a/tests/Unit/File/ImageOptionsTest.php b/tests/Unit/File/ImageOptionsTest.php
index <HASH>..<HASH> 100644
--- a/tests/Unit/File/ImageOptionsTest.php
+++ b/tests/Unit/File/ImageOptionsTest.php
@@ -118,17 +118,17 @@ class ImageOptionsTest extends TestCase
$options = new ImageOptions();
$options->setQuality(50);
- $this->assertSame('fm=jpg&q=50', $options->getQueryString());
+ $this->assertSame('q=50', $options->getQueryString());
}
- public function testQueryQualityOverridesFormat()
+ public function testQueryQualityDoesNotOverrideFormat()
{
$options = (new ImageOptions())
->setFormat('png')
->setQuality(50)
;
- $this->assertSame('fm=jpg&q=50', $options->getQueryString());
+ $this->assertSame('fm=png&q=50', $options->getQueryString());
}
public function testQueryProgressive() | Fix tests after PR #<I> | contentful_contentful-core.php | train | php |
7efeb4c216204971c858612dc77bcd60e2d1176f | diff --git a/tohu/v6/spawn_mapping.py b/tohu/v6/spawn_mapping.py
index <HASH>..<HASH> 100644
--- a/tohu/v6/spawn_mapping.py
+++ b/tohu/v6/spawn_mapping.py
@@ -18,5 +18,5 @@ class SpawnMapping:
try:
return self.mapping[g]
except KeyError:
- logger.warning(f"Generator does not occur in spawn mapping: {g}")
+ logger.debug(f"Generator does not occur in spawn mapping: {g}")
return g
\ No newline at end of file | Demote warning to debugging message because this case is expected | maxalbert_tohu | train | py |
adedaa930d345d185e1fdaee824058915370fb96 | diff --git a/parsl/app/bash.py b/parsl/app/bash.py
index <HASH>..<HASH> 100644
--- a/parsl/app/bash.py
+++ b/parsl/app/bash.py
@@ -70,7 +70,7 @@ def remote_side_bash_executor(func, *args, **kwargs):
returncode = proc.returncode
except subprocess.TimeoutExpired:
- raise pe.AppTimeout("[{}] App exceeded walltime: {}".format(func_name, timeout))
+ raise pe.AppTimeout("[{}] App exceeded walltime: {} seconds".format(func_name, timeout))
except Exception as e:
raise pe.AppException("[{}] App caught exception with returncode: {}".format(func_name, returncode), e) | Add units to walltime human readable message (#<I>) | Parsl_parsl | train | py |
7993abb9d8a450e95c32a70690916a89c78a8fb8 | diff --git a/pymongo/replica_set_connection.py b/pymongo/replica_set_connection.py
index <HASH>..<HASH> 100644
--- a/pymongo/replica_set_connection.py
+++ b/pymongo/replica_set_connection.py
@@ -191,8 +191,6 @@ class ReplicaSetConnection(common.BaseObject):
super(ReplicaSetConnection, self).__init__(**self.__opts)
- self.slave_okay = True
-
if db_name and username is None:
warnings.warn("must provide a username and password "
"to authenticate to %s" % (db_name,))
@@ -306,6 +304,13 @@ class ReplicaSetConnection(common.BaseObject):
return self.__arbiters
@property
+ def slave_okay(self):
+ """Is it OK to perform queries on a secondary? This is
+ always True for an instance of ReplicaSetConnection.
+ """
+ return True
+
+ @property
def max_pool_size(self):
"""The maximum pool size limit set for this connection.
""" | ReplicaSetConnection.slave_okay is always True PYTHON-<I> | mongodb_mongo-python-driver | train | py |
0e8191770651568395ace497164e37b1ed448d25 | diff --git a/tests/int/test_int_docker.py b/tests/int/test_int_docker.py
index <HASH>..<HASH> 100644
--- a/tests/int/test_int_docker.py
+++ b/tests/int/test_int_docker.py
@@ -51,7 +51,7 @@ def test_int_docker_git_gem_and_pip_on_mult(helpers):
@pytest.mark.docker
def test_int_docker_pacman_on_arch(helpers):
helpers.run(
- 'pyinfra @docker/archlinux pacman.py',
+ 'pyinfra @docker/archlinux:base-20210131.0.14634 pacman.py',
expected_lines=['docker build complete'],
) | Pin Archlinux tag in Docker tests. | Fizzadar_pyinfra | train | py |
726ab4fe6c49b9d3b56047b47ea4042c583c4e9a | diff --git a/classes/ValidFormBuilder/SelectGroup.php b/classes/ValidFormBuilder/SelectGroup.php
index <HASH>..<HASH> 100644
--- a/classes/ValidFormBuilder/SelectGroup.php
+++ b/classes/ValidFormBuilder/SelectGroup.php
@@ -65,7 +65,7 @@ class SelectGroup extends Base
{
$strOutput = "<optgroup label=\"{$this->__label}\">\n";
foreach ($this->__options as $option) {
- $strOutput .= $option->toHtml($value);
+ $strOutput .= $option->toHtmlInternal($value);
}
$strOutput .= "</optgroup>\n";
@@ -80,9 +80,9 @@ class SelectGroup extends Base
* @param boolean $selected Set this option as selected by default
* @return \ValidFormBuilder\SelectOption
*/
- public function addField($label, $value, $selected = false)
+ public function addField($label, $value, $selected = false, $meta = array())
{
- $objOption = new SelectOption($label, $value, $selected);
+ $objOption = new SelectOption($label, $value, $selected, $meta);
$objOption->setMeta("parent", $this, true);
$this->__options->addObject($objOption); | Fixed an old rendering of optgroups.
Optgroups would not be rendered correctly. | validformbuilder_validformbuilder | train | php |
e9a280ae9a76f76b1b4de73170fe72d0dd98a015 | diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/extractor/CookieRequestExtractor.java b/moco-core/src/main/java/com/github/dreamhead/moco/extractor/CookieRequestExtractor.java
index <HASH>..<HASH> 100644
--- a/moco-core/src/main/java/com/github/dreamhead/moco/extractor/CookieRequestExtractor.java
+++ b/moco-core/src/main/java/com/github/dreamhead/moco/extractor/CookieRequestExtractor.java
@@ -6,9 +6,6 @@ import com.google.common.collect.ImmutableMap;
import java.util.Optional;
-import static java.util.Optional.empty;
-import static java.util.Optional.ofNullable;
-
public final class CookieRequestExtractor extends HttpRequestExtractor<String> {
private final CookiesRequestExtractor extractor = new CookiesRequestExtractor(); | removed unused import in cookie request extractor | dreamhead_moco | train | java |
d5cc1a5b80fae5635e81ba74cd28e183b6c2a866 | diff --git a/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.js b/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.js
index <HASH>..<HASH> 100644
--- a/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.js
+++ b/src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.js
@@ -28,7 +28,11 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer {
}
if (!this._imageData) {
const { width, height } = this.context.canvas;
- this._imageData = this.context.getImageData(0, 0, width, height);
+ try {
+ this._imageData = this.context.getImageData(0, 0, width, height);
+ } catch (error) {
+ console.warn('hit detect failed with tainted canvas, some geometries have external resources in another domain:\n', error);
+ }
}
return this._imageData;
} | fix VectorLayerRenderer getImageData error when some geometries have external resources in another domain fix #<I> (#<I>) | maptalks_maptalks.js | train | js |
3a498e80ff0c4cb23bc99995ae0396d07bd2231c | diff --git a/pkg/server/server.go b/pkg/server/server.go
index <HASH>..<HASH> 100644
--- a/pkg/server/server.go
+++ b/pkg/server/server.go
@@ -179,10 +179,10 @@ func (s *Server) Run() (err error) {
}
err := service.Run(s.context)
- // Mark that we are in shutdown mode
- // So no more services are started
- s.shutdownInProgress = true
if err != nil {
+ // Mark that we are in shutdown mode
+ // So no more services are started
+ s.shutdownInProgress = true
if err != context.Canceled {
// Server has crashed.
s.log.Error("Stopped "+descriptor.Name, "reason", err) | Registry: Fix service shutdown mode trigger location (#<I>) | grafana_grafana | train | go |
eeeb86e5d31d2f6d7d05683cf86348f9226a7275 | diff --git a/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java b/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
+++ b/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java
@@ -524,7 +524,7 @@ public class Drawer {
* @param fireOnClick true if the click listener should be called
*/
public void setSelection(long identifier, boolean fireOnClick) {
- SelectExtension select = FastAdapter.getExtension(getAdapter(), SelectExtension.class);
+ SelectExtension<IDrawerItem> select = getAdapter().getExtension(SelectExtension.class);
if(select != null) {
select.deselect();
select.selectByIdentifier(identifier, false, true);
@@ -588,7 +588,7 @@ public class Drawer {
*/
public boolean setSelectionAtPosition(int position, boolean fireOnClick) {
if (mDrawerBuilder.mRecyclerView != null) {
- SelectExtension select = FastAdapter.getExtension(getAdapter(), SelectExtension.class);
+ SelectExtension<IDrawerItem> select = getAdapter().getExtension(SelectExtension.class);
if (select != null) {
select.deselect();
select.select(position, false); | * adjust for new fastadapter adjustments | mikepenz_MaterialDrawer | train | java |
f85aacb092baee94e5c23bf0f9e8836f718a41b0 | diff --git a/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java b/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java
+++ b/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java
@@ -101,6 +101,8 @@ public abstract class CallableProcedureStatement extends MariaDbPreparedStatemen
CallableProcedureStatement clone = (CallableProcedureStatement) super.clone(connection);
clone.params = params;
clone.parameterMetadata = parameterMetadata;
+ clone.hasInOutParameters = hasInOutParameters;
+ clone.outputParameterMapper = outputParameterMapper;
return clone;
} | [misc] correcting cloning CallableProcedureStatement | MariaDB_mariadb-connector-j | train | java |
6786d6691ae290f3953d63a071049b4c89ac418d | diff --git a/pkg/registry/core/pod/strategy.go b/pkg/registry/core/pod/strategy.go
index <HASH>..<HASH> 100644
--- a/pkg/registry/core/pod/strategy.go
+++ b/pkg/registry/core/pod/strategy.go
@@ -237,7 +237,7 @@ func PodToSelectableFields(pod *api.Pod) fields.Set {
// amount of allocations needed to create the fields.Set. If you add any
// field here or the number of object-meta related fields changes, this should
// be adjusted.
- podSpecificFieldsSet := make(fields.Set, 7)
+ podSpecificFieldsSet := make(fields.Set, 8)
podSpecificFieldsSet["spec.nodeName"] = pod.Spec.NodeName
podSpecificFieldsSet["spec.restartPolicy"] = string(pod.Spec.RestartPolicy)
podSpecificFieldsSet["spec.schedulerName"] = string(pod.Spec.SchedulerName) | Avoid reallocating of map in PodToSelectableFields | kubernetes_kubernetes | train | go |
dc03fd2dfc6f80671085fd3a40c78bf65496f9a4 | diff --git a/trovebox/http.py b/trovebox/http.py
index <HASH>..<HASH> 100644
--- a/trovebox/http.py
+++ b/trovebox/http.py
@@ -104,7 +104,9 @@ class Http(object):
self._logger.info("============================")
self._logger.info("GET %s" % url)
self._logger.info("---")
- self._logger.info(response.text)
+ self._logger.info(response.text[:1000])
+ if len(response.text) > 1000:
+ self._logger.info("[Response truncated to 1000 characters]")
self.last_url = url
self.last_params = params
@@ -158,7 +160,9 @@ class Http(object):
if files:
self._logger.info("files: %s" % repr(files))
self._logger.info("---")
- self._logger.info(response.text)
+ self._logger.info(response.text[:1000])
+ if len(response.text) > 1000:
+ self._logger.info("[Response truncated to 1000 characters]")
self.last_url = url
self.last_params = params | Truncate response logging to <I> characters | photo_openphoto-python | train | py |
35bd8cee8ba3fa85da524d7da547abd292dae71e | diff --git a/test/test_rpc.py b/test/test_rpc.py
index <HASH>..<HASH> 100644
--- a/test/test_rpc.py
+++ b/test/test_rpc.py
@@ -626,7 +626,7 @@ def test_reply_queue_removed_on_expiry(
@skip_if_no_toxiproxy
-class TestDisconnectedWhileWaitingForReply(object):
+class TestDisconnectedWhileWaitingForReply(object): # pragma: no cover
@pytest.yield_fixture(autouse=True)
def fast_reconnects(self): | pragma: no cover on test we don't expect to run | nameko_nameko | train | py |
448c3109784d72fc62c09d613b904036aa434a6e | diff --git a/app/scripts/tests/components/Block.spec.js b/app/scripts/tests/components/Block.spec.js
index <HASH>..<HASH> 100644
--- a/app/scripts/tests/components/Block.spec.js
+++ b/app/scripts/tests/components/Block.spec.js
@@ -4,7 +4,8 @@ import React from 'react'
import { expect } from 'chai'
import { actions as blockActions } from '../../../modules/mobilizations/blocks'
-import { Block, Widget, ColorPicker, DropDownMenu, DropDownMenuItem } from './../../components'
+import { Widget, ColorPicker, DropDownMenu, DropDownMenuItem } from './../../components'
+import { Block } from '../../../modules/mobilizations/blocks/components/block'
const widget1 = { block_id: 1, id: 1, settings: { content: 'My widget1' } }
const widget2 = { block_id: 2, id: 2, settings: { content: 'My widget2' } } | Fix some block related tests; Skip some tests for now, needs to refactor #<I> | nossas_bonde-client | train | js |
6b535eb79fdb65df1e16997fa73e57cfcb806bbe | diff --git a/src/fx.js b/src/fx.js
index <HASH>..<HASH> 100644
--- a/src/fx.js
+++ b/src/fx.js
@@ -81,7 +81,7 @@ jQuery.fn.extend({
for ( p in prop ) {
if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
- return jQuery.isFunction(opt.complete) && opt.complete.call(this);
+ return opt.complete.call(this);
if ( p == "height" || p == "width" ) {
// Store display property
@@ -379,7 +379,7 @@ jQuery.fx.prototype = {
}
// If a callback was provided, execute it
- if ( done && jQuery.isFunction( this.options.complete ) )
+ if ( done )
// Execute the complete function
this.options.complete.call( this.elem ); | jquery fx: removing 2 unnecessary isFunction calls, options.complete is ALWAYS a function. | jquery_jquery | train | js |
ff9d8c8fb8e44378ddf7ab457de8fe7f0b599b76 | diff --git a/torext/mongodb/dstruct.py b/torext/mongodb/dstruct.py
index <HASH>..<HASH> 100644
--- a/torext/mongodb/dstruct.py
+++ b/torext/mongodb/dstruct.py
@@ -8,6 +8,9 @@ from hashlib import md5
from torext.errors import ValidationError
from bson.objectid import ObjectId
+# TODO change dict building mechanism:
+# 1. no str & unicode difference, only str
+# 2. all allow None, except: list, dict, ObjectId
DEFAULT_TYPE_VALUE = {
int: int, | add a little comments on dstruct for future ref | reorx_torext | train | py |
93722204328267a6da65c2a0dbaed8c7a79f89ea | diff --git a/abilian/core/jinjaext.py b/abilian/core/jinjaext.py
index <HASH>..<HASH> 100644
--- a/abilian/core/jinjaext.py
+++ b/abilian/core/jinjaext.py
@@ -6,6 +6,7 @@ from __future__ import absolute_import
from functools import partial
+import lxml.html
from jinja2.ext import Extension
from jinja2 import nodes
@@ -39,6 +40,9 @@ class DeferredJS(object):
class DeferredJSExtension(Extension):
"""
Put JS fragment at the end of the document in a script tag.
+
+ The JS fragment can contains <script> tag so that your favorite editor
+ keeps doing proper indentation, syntax highlighting...
"""
tags = set(['deferJS', 'deferredJS'])
@@ -56,7 +60,20 @@ class DeferredJSExtension(Extension):
[], [], body).set_lineno(lineno)
def defer_nodes(self, caller):
- body = caller()
+ body = u'<div>{}</div>'.format(caller().strip())
+
+ # remove 'script' tag in immediate children, if any
+ fragment = lxml.html.fragment_fromstring(body)
+ for child in fragment:
+ if child.tag == 'script':
+ child.drop_tag() # side effect on fragment.text or previous_child.tail!
+
+ body = [fragment.text]
+ for child in fragment:
+ body.append(lxml.html.tostring(child))
+ body.append(child.tail)
+ body = u''.join(body)
+
deferred_js.append(body)
return u'' | deferJS: allow to let <script> tag within deferJS (for editor syntax highlight for example), and remove it when collecting fragment | abilian_abilian-core | train | py |
482377cda928e264c79a820e01ca71cbea24b402 | diff --git a/lib/Socket.php b/lib/Socket.php
index <HASH>..<HASH> 100644
--- a/lib/Socket.php
+++ b/lib/Socket.php
@@ -66,9 +66,7 @@ class Socket implements Stream {
// Error reporting suppressed since fread() produces a warning if the stream unexpectedly closes.
$data = @\fread($stream, $bytes !== null ? $bytes - $buffer->getLength() : self::CHUNK_SIZE);
- if ($data === '' && (\feof($stream) || !\is_resource($stream))) {
- $this->close();
-
+ if ($data === false || ($data === '' && (\feof($stream) || !\is_resource($stream)))) {
if ($bytes !== null || $delimiter !== null) { // Fail bounded reads.
$deferred->fail(new ClosedException("The stream unexpectedly closed"));
return;
@@ -281,7 +279,6 @@ class Socket implements Stream {
return new Failure(new SocketException("The stream is not writable"));
}
- $data = (string) $data;
$length = \strlen($data);
$written = 0; | Remove call to close method from static context | amphp_socket | train | php |
f3c27b43749ad3daf9c5d6b1d3ea84d5f098ec6d | diff --git a/IDBStore.js b/IDBStore.js
index <HASH>..<HASH> 100644
--- a/IDBStore.js
+++ b/IDBStore.js
@@ -144,6 +144,21 @@
this.store = this.db.createObjectStore(this.storeName, { keyPath: this.keyPath, autoIncrement: this.autoIncrement});
}
+
+ this.indexes.forEach(function(indexData){
+ var indexName = indexData.name;
+
+ // normalize and provide existing keys
+ indexData.keyPath = indexData.keyPath || indexName;
+ indexData.unique = !!indexData.unique;
+ indexData.multiEntry = !!indexData.multiEntry;
+
+ if(!indexName){
+ throw new Error('Cannot create index: No index name given.');
+ }
+
+ }, this);
+
}.bind(this);
}, | Check indexes, throw if no name is given | jensarps_IDBWrapper | train | js |
245ca4a60151a7c936142bc3dda882006cb53f92 | diff --git a/lib/attachs/console.rb b/lib/attachs/console.rb
index <HASH>..<HASH> 100644
--- a/lib/attachs/console.rb
+++ b/lib/attachs/console.rb
@@ -3,7 +3,7 @@ module Attachs
class << self
def detect_content_type(path)
- run "file -Ib '#{path}'" do |output|
+ run "file -ib '#{path}'" do |output|
output.split(';').first
end
end | Fix content type detection for bsd | museways_attachs | train | rb |
95909cdbb582583873a85eac63ca8ef21709db1e | diff --git a/volume/devicemapper/stats_test.go b/volume/devicemapper/stats_test.go
index <HASH>..<HASH> 100644
--- a/volume/devicemapper/stats_test.go
+++ b/volume/devicemapper/stats_test.go
@@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// +build unit
+// +build unit,linux,!darwin
package devicemapper | only run DM stats unit tests on linux | control-center_serviced | train | go |
d4c921fe28d622566ccce953de091524a59219e4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -695,7 +695,7 @@ class BuildSupportMacOS(BuildSupport):
PylonConfig = os.path.join(
FrameworkPath,
FrameworkName,
- 'Versions/Current/Resources/Tools/pylon-config.sh'
+ 'Versions/Current/Resources/Tools/pylon-config'
)
DefineMacros = [ | Fix name of python-config script on macOS. Resolves #<I>. | basler_pypylon | train | py |
5c6d5293387381b6f300fb635e2f5e11e2b962d3 | diff --git a/lib/cms/fortress/application_controller_methods.rb b/lib/cms/fortress/application_controller_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/cms/fortress/application_controller_methods.rb
+++ b/lib/cms/fortress/application_controller_methods.rb
@@ -5,7 +5,8 @@ module Cms
def after_sign_in_path_for(resource)
if resource.class.eql?(Cms::Fortress::User)
session[:site_id] = resource.site_id
- comfy_admin_cms_path
+ #comfy_admin_cms_path
+ dashboard_site_path
else
begin
stored_location_for(resource) || send("after_sign_in_path_for_#{ resource.class.name.underscore }", resource)
@@ -18,7 +19,8 @@ module Cms
def after_sign_out_path_for(resource_or_scope)
# request.referrer
if resource_or_scope.eql?(:cms_fortress_user)
- comfy_admin_cms_path
+ # comfy_admin_cms_path
+ dashboard_site_path
else
begin
stored_location_for(resource_or_scope) || send("after_sign_out_path_for_#{ resource_or_scope.to_s }", resource_or_scope) | change default after login url to dashboard | melvinsembrano_cms-fortress | train | rb |
22c2e59776c0a310bf871b02a718095f461a4cde | diff --git a/stickytape/__init__.py b/stickytape/__init__.py
index <HASH>..<HASH> 100644
--- a/stickytape/__init__.py
+++ b/stickytape/__init__.py
@@ -336,6 +336,7 @@ _stdlib_modules = set([
"htmllib",
"htmlentitydefs",
"xml",
+ "xml/etree",
"xml/etree/ElementTree",
"xml/dom",
"xml/dom/minidom",
@@ -344,6 +345,7 @@ _stdlib_modules = set([
"xml/sax/handler",
"xml/sax/saxutils",
"xml/sax/xmlreader",
+ "xml/parsers",
"xml/parsers/expat",
"webbrowser", | Add xml.etree and xml.parsers to stdlib list | mwilliamson_stickytape | train | py |
a6684eeb786663839cf383ea54b681d429a83177 | diff --git a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
+++ b/railties/lib/generators/test_unit/mailer/templates/functional_test.rb
@@ -7,7 +7,6 @@ class <%= class_name %>Test < ActionMailer::TestCase
@expected.to = "to@example.org"
@expected.from = "from@example.com"
@expected.body = read_fixture("<%= action %>")
- @expected.date = Time.now
assert_equal @expected, <%= class_name %>.<%= action %>
end | don't set @expected.date in generated mailer test | rails_rails | train | rb |
1d5e02fcfd17707c2caf6f42819c39c55e2dcbc2 | diff --git a/lib/browserify-rails/directive_processor.rb b/lib/browserify-rails/directive_processor.rb
index <HASH>..<HASH> 100644
--- a/lib/browserify-rails/directive_processor.rb
+++ b/lib/browserify-rails/directive_processor.rb
@@ -14,10 +14,7 @@ module BrowserifyRails
def evaluate(context, locals, &block)
if commonjs_module?
- dependencies.each do |dep|
- path = File.basename(dep["id"], context.environment.root)
- next if path == File.basename(file)
-
+ dependencies.each do |path|
if path =~ /<([^>]+)>/
path = $1
else | #dependencies already filter the file itself | browserify-rails_browserify-rails | train | rb |
25e9e48ced10ad167ca05b89afdee30fb2634a52 | diff --git a/test/test_girl_friday.rb b/test/test_girl_friday.rb
index <HASH>..<HASH> 100644
--- a/test/test_girl_friday.rb
+++ b/test/test_girl_friday.rb
@@ -137,4 +137,15 @@ class TestGirlFriday < MiniTest::Unit::TestCase
end
end
+ def test_should_create_workers_lazily
+ async_test do |cb|
+ queue = GirlFriday::WorkQueue.new('shutdown', :size => 2) do |msg|
+ assert_equal 1, queue.instance_variable_get(:@ready_workers).size
+ cb.call
+ end
+ assert_nil queue.instance_variable_get(:@ready_workers)
+ queue << 'empty msg'
+ end
+ end
+
end
\ No newline at end of file | Add test for lazily worker instantiation | mperham_girl_friday | train | rb |
45077168e7d27168d47cbfc1452d01cf106bb5c3 | diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py
index <HASH>..<HASH> 100644
--- a/salt/modules/yumpkg.py
+++ b/salt/modules/yumpkg.py
@@ -2597,9 +2597,9 @@ def group_install(name,
targets = []
for group in groups:
group_detail = group_info(group)
- targets.extend(group_detail.get('mandatory packages', []))
+ targets.extend(group_detail.get('mandatory', []))
targets.extend(
- [pkg for pkg in group_detail.get('default packages', [])
+ [pkg for pkg in group_detail.get('default', [])
if pkg not in skip]
)
if include: | Use correct keys from group_info in group_install.
Fixes #<I> | saltstack_salt | train | py |
3cc865c37cd69c09d4cab382404c646960d7b217 | diff --git a/plugins/lineup/LineUp/test/lineup.js b/plugins/lineup/LineUp/test/lineup.js
index <HASH>..<HASH> 100644
--- a/plugins/lineup/LineUp/test/lineup.js
+++ b/plugins/lineup/LineUp/test/lineup.js
@@ -3,15 +3,15 @@ import test from 'tape-catch';
// needed to handle Babel's conversion of for `(x of array)`
import 'babel-polyfill';
-import $ from 'jquery';
-
import LineUp from '..';
test('LineUp component', t => {
- $('body').append($('<div/>').attr({id: 'elem'}).css({width: 800, height: 600}));
+ const div = document.createElement('div');
+ div.setAttribute('style', 'width: 800px; height: 600px');
+
t.ok(LineUp, 'LineUp exists');
t.ok(LineUp.options, 'LineUp options exists');
- let lu = new LineUp(document.getElementById('elem'), {
+ let lu = new LineUp(div, {
data: [
{a: 1, b: 2, c: 'a', d: true},
{a: 3, b: 4, c: 'b', d: false}, | test: fix test corruption from use of jquery in lineup test | Kitware_candela | train | js |
4a13bf2fa9b0d090fe26c5fd843773cae572807d | diff --git a/src/ol/PluggableMap.js b/src/ol/PluggableMap.js
index <HASH>..<HASH> 100644
--- a/src/ol/PluggableMap.js
+++ b/src/ol/PluggableMap.js
@@ -60,7 +60,7 @@ import {create as createTransform, apply as applyTransform} from './transform.js
/**
* @typedef {Object} AtPixelOptions
- * @property {undefined|function(import("./layer/Layer.js").default): boolean} layerFilter Layer filter
+ * @property {undefined|function(import("./layer/Layer.js").default): boolean} [layerFilter] Layer filter
* function. The filter function will receive one argument, the
* {@link module:ol/layer/Layer layer-candidate} and it should return a boolean value.
* Only layers which are visible and for which this function returns `true` | Mark layerFilter in AtPixelOptions as optional | openlayers_openlayers | train | js |
3ea734da92560f67ac379b0b4aef5ebb22f62cfe | diff --git a/test/unit/client-test.js b/test/unit/client-test.js
index <HASH>..<HASH> 100644
--- a/test/unit/client-test.js
+++ b/test/unit/client-test.js
@@ -1,5 +1,4 @@
var Client = require("../../lib/dynode/client").Client,
- DynamoDB = require('../test-helper'),
util = require('utile'),
should = require('should');
@@ -8,7 +7,7 @@ describe("DynamoDB Client unit tests", function(){
client;
beforeEach(function() {
- client = DynamoDB.client;
+ client = new Client({accessKeyId :"MockId", secretAccessKey: "MockKey"});
realRequest = client._request;
}); | making unit tests run without needed aws auth keys on environment | Wantworthy_dynode | train | js |
b492e1feccc1d57254daf747c53a74e5a8c46c37 | diff --git a/service/src/main/java/de/uniulm/omi/cloudiator/sword/service/ServiceBuilder.java b/service/src/main/java/de/uniulm/omi/cloudiator/sword/service/ServiceBuilder.java
index <HASH>..<HASH> 100644
--- a/service/src/main/java/de/uniulm/omi/cloudiator/sword/service/ServiceBuilder.java
+++ b/service/src/main/java/de/uniulm/omi/cloudiator/sword/service/ServiceBuilder.java
@@ -118,9 +118,12 @@ public class ServiceBuilder {
protected Set<Module> getBasicModules(ServiceConfiguration serviceConfiguration,
ProviderConfiguration providerConfiguration) {
Set<Module> modules = new HashSet<>();
- modules.add(new BaseModule(serviceConfiguration, PropertiesBuilder.newBuilder()
- .putProperties(providerConfiguration.getDefaultProperties().getProperties())
- .putProperties(this.properties.getProperties()).build()));
+ PropertiesBuilder propertiesBuilder = PropertiesBuilder.newBuilder()
+ .putProperties(providerConfiguration.getDefaultProperties().getProperties());
+ if (this.properties != null) {
+ propertiesBuilder.putProperties(this.properties.getProperties());
+ }
+ modules.add(new BaseModule(serviceConfiguration, propertiesBuilder.build()));
return modules;
} | fixed null pointer if no properties were defined by the user | cloudiator_sword | train | java |
e437f99b421cf9c8e290f60ab975b1e83547fed1 | diff --git a/src/website/app/demos/Icon/examples/importSyntax.js b/src/website/app/demos/Icon/examples/importSyntax.js
index <HASH>..<HASH> 100644
--- a/src/website/app/demos/Icon/examples/importSyntax.js
+++ b/src/website/app/demos/Icon/examples/importSyntax.js
@@ -21,7 +21,7 @@ export default {
description: `To render a custom icon, use the default export from the \`mineral-ui/Icon\` package.
\`\`\`
-import Icon from 'mineral-ui-icons/Icon';
+import Icon from 'mineral-ui/Icon';
\`\`\`
Import Mineral UI's provided icons directly from the \`mineral-ui-icons\` package. | chore(website): Fix incorrect Icon import syntax | mineral-ui_mineral-ui | train | js |
6b5d077c09e8ba8419dc2aef4320e01cdd8d9dd9 | diff --git a/cmd/geth/js.go b/cmd/geth/js.go
index <HASH>..<HASH> 100644
--- a/cmd/geth/js.go
+++ b/cmd/geth/js.go
@@ -439,7 +439,7 @@ func (self *jsre) interactive() {
func mustLogInHistory(input string) bool {
return len(input) == 0 ||
passwordRegexp.MatchString(input) ||
- leadingSpace.MatchString(input)
+ !leadingSpace.MatchString(input)
}
func (self *jsre) withHistory(datadir string, op func(*os.File)) { | fix console history, lines with leadning whitespace NOT included | ethereum_go-ethereum | train | go |
7988ec5fdcaaa50810ceedb34a2d216ff0dc8fba | diff --git a/include/componentdispatcher_class.php b/include/componentdispatcher_class.php
index <HASH>..<HASH> 100644
--- a/include/componentdispatcher_class.php
+++ b/include/componentdispatcher_class.php
@@ -47,7 +47,7 @@ class ComponentDispatcher extends Component {
$ret["content"] = $component->HandlePayload($_REQUEST, $outputtype);
} else if (preg_match("|^/((?:[^./]+/?)*)(?:\.(.*))?$|", $page, $m)) {
$componentname = str_replace("/", ".", $m[1]);
- $outputtype = any($m[2], "html");
+ $outputtype = (isset($m[2]) ? $m[2] : "html");
$ret["component"] = $componentname;
$ret["type"] = $outputtype; | - Fixed pedantic warning in component dispatcher | jbaicoianu_elation | train | php |
855656bbec85bc3a553936fd462c43798ea21fec | diff --git a/lib/ronin/ui/console.rb b/lib/ronin/ui/console.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/ui/console.rb
+++ b/lib/ronin/ui/console.rb
@@ -166,6 +166,7 @@ module Ronin
irb.context.main.instance_eval do
require 'ronin'
require 'ronin/ui/output'
+ require 'ronin/platform/overlays'
# include the output helpers
include Ronin::UI::Output::Helpers | Explicitly require 'ronin/platform/overlays' from within the Ronin Console. | ronin-ruby_ronin | train | rb |
92fe34e6430c31c62d9d387e96e47fa4cbd66bb8 | diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/fixtures/base_case.py
+++ b/seleniumbase/fixtures/base_case.py
@@ -1687,7 +1687,7 @@ class BaseCase(unittest.TestCase):
timeout = settings.SMALL_TIMEOUT
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
timeout = self.__get_new_timeout(timeout)
- if self.is_element_visible(frame):
+ if type(frame) is str and self.is_element_visible(frame):
try:
self.scroll_to(frame, timeout=1)
except Exception: | Only scroll to iframes before switching to them if identifier is a string | seleniumbase_SeleniumBase | train | py |
74ce98d6feff4bad88e83a8c3d4d8fce995d5287 | diff --git a/pkg/adaptor/mongodb.go b/pkg/adaptor/mongodb.go
index <HASH>..<HASH> 100644
--- a/pkg/adaptor/mongodb.go
+++ b/pkg/adaptor/mongodb.go
@@ -13,7 +13,7 @@ import (
)
const (
- MONGO_BUFFER_SIZE int = 5e6
+ MONGO_BUFFER_SIZE int = 1e6
MONGO_BUFFER_LEN int = 5e5
)
@@ -76,7 +76,7 @@ func NewMongodb(p *pipe.Pipe, path string, extra Config) (StopStartListener, err
tail: conf.Tail,
debug: conf.Debug,
path: path,
- opsBuffer: make([]interface{}, 0, MONGO_BUFFER_SIZE),
+ opsBuffer: make([]interface{}, 0, MONGO_BUFFER_LEN),
bulkWriteChannel: make(chan interface{}),
bulkQuitChannel: make(chan chan bool),
bulk: conf.Bulk,
@@ -242,7 +242,7 @@ func (m *Mongodb) writeBuffer() {
}
}
- m.opsBuffer = make([]interface{}, 0, MONGO_BUFFER_SIZE)
+ m.opsBuffer = make([]interface{}, 0, MONGO_BUFFER_LEN)
m.opsBufferSize = 0
} | use a smaller buffer for mongo adaptor | compose_transporter | train | go |
df6d04cce95433f6e83cb84c4a35da6506ffffec | diff --git a/third_party/code.google.com/p/goauth2/oauth/oauth.go b/third_party/code.google.com/p/goauth2/oauth/oauth.go
index <HASH>..<HASH> 100644
--- a/third_party/code.google.com/p/goauth2/oauth/oauth.go
+++ b/third_party/code.google.com/p/goauth2/oauth/oauth.go
@@ -167,7 +167,10 @@ type Token struct {
// Expired reports whether the token has expired or is invalid.
func (t *Token) Expired() bool {
- if t.Expiry.IsZero() || t.AccessToken == "" {
+ if t.AccessToken == "" {
+ return true
+ }
+ if t.Expiry.IsZero() {
return false
}
return t.Expiry.Before(time.Now()) | oauth: fix Token.Expired
also sent off as <URL> | perkeep_perkeep | train | go |
e18c14132e6d0ac83fbedbf2b98664c0446a57a1 | diff --git a/src/Place/PlaceRepository.php b/src/Place/PlaceRepository.php
index <HASH>..<HASH> 100644
--- a/src/Place/PlaceRepository.php
+++ b/src/Place/PlaceRepository.php
@@ -81,11 +81,6 @@ class PlaceRepository extends ActorRepository implements RepositoryInterface, Lo
*/
protected $organizerService;
- /**
- * @var EventStreamDecoratorInterface[]
- */
- private $eventStreamDecorators = array();
-
private $aggregateClass;
public function __construct(
@@ -304,11 +299,8 @@ class PlaceRepository extends ActorRepository implements RepositoryInterface, Lo
$contactInfo = new CultureFeed_Cdb_Data_ContactInfo();
$event->setContactInfo($contactInfo);
- $cdbXml = new CultureFeed_Cdb_Default();
- $cdbXml->addItem($event);
-
$this->createImprovedEntryAPIFromMetadata($metadata)
- ->createEvent((string)$cdbXml);
+ ->createEvent($event);
return $placeCreated->getPlaceId();
} | III-<I>: Fix loose ends preventing saving places to work & add http logging to Entry API | cultuurnet_udb3-udb2-bridge | train | php |
76d20cca89f3fc0f51e3cc590c2aeaf16343a7bd | diff --git a/cdrouter/captures.py b/cdrouter/captures.py
index <HASH>..<HASH> 100644
--- a/cdrouter/captures.py
+++ b/cdrouter/captures.py
@@ -50,7 +50,7 @@ class SummaryPacket(object):
self.sections = kwargs.get('sections', None)
class SummaryPacketSchema(Schema):
- sections = mfields.Nested(SectionSchema, many=True)
+ sections = mfields.Nested(SectionSchema, many=True, missing=None)
@post_load
def post_load(self, data):
@@ -68,7 +68,7 @@ class Summary(object):
class SummarySchema(Schema):
structure = mfields.Nested(StructureSchema)
- summaries = mfields.Nested(SummaryPacketSchema, many=True)
+ summaries = mfields.Nested(SummaryPacketSchema, many=True, missing=None)
@post_load
def post_load(self, data): | Fix issue with CapturesService.summary | qacafe_cdrouter.py | train | py |
94c29a35338e9b23a3d4332cd5f4ec7774378439 | diff --git a/test/spec/platform_spec.rb b/test/spec/platform_spec.rb
index <HASH>..<HASH> 100644
--- a/test/spec/platform_spec.rb
+++ b/test/spec/platform_spec.rb
@@ -32,7 +32,7 @@ describe "The PHP Platform Installer" do
rescue Errno::ENOENT
expected_status = 0
ensure
- expect(status.exitstatus).to eq(expected_status), "platform.php failed, stderr: #{stderr}, stdout: #{stdout}"
+ expect(status.exitstatus).to eq(expected_status), "platform.php exited with status #{status.exitstatus}, expected #{expected_status}; stderr: #{stderr}, stdout: #{stdout}"
end
begin | slightly improve error message (with exit status) if platform.php test fails | heroku_heroku-buildpack-php | train | rb |
4484dcf64b2107f1a600decffdfc92d2750825f4 | diff --git a/modules/tools-misc/src/main/java/com/wizzardo/tools/misc/UTF8.java b/modules/tools-misc/src/main/java/com/wizzardo/tools/misc/UTF8.java
index <HASH>..<HASH> 100644
--- a/modules/tools-misc/src/main/java/com/wizzardo/tools/misc/UTF8.java
+++ b/modules/tools-misc/src/main/java/com/wizzardo/tools/misc/UTF8.java
@@ -427,6 +427,10 @@ public class UTF8 {
return this;
}
+
+ public int charsDecoded() {
+ return charsOffset;
+ }
}
public static DecodeContext decode(byte[] bytes, int offset, int length, char[] chars, DecodeContext context) { | add charsDecoded method | wizzardo_tools | train | java |
8b23d012ebe992cc607e1055ed648f4702132c01 | diff --git a/embark-ui/src/containers/AppContainer.js b/embark-ui/src/containers/AppContainer.js
index <HASH>..<HASH> 100644
--- a/embark-ui/src/containers/AppContainer.js
+++ b/embark-ui/src/containers/AppContainer.js
@@ -103,6 +103,8 @@ class AppContainer extends Component {
renderBody() {
if (this.shouldRenderLogin()) {
return <Login credentials={this.props.credentials} authenticate={this.props.authenticate} error={this.props.authenticationError} />;
+ } else if (this.props.credentials.authenticating) {
+ return <div></div>;
}
return (
<Layout location={this.props.location} | don't return Layout while authenticating | embark-framework_embark | train | js |
7684e6c491d24031617e1134eebef1829950497d | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -24,7 +24,7 @@ RSpec.configure { |config|
extend(Module.new {
def describe_extended(mod, ext, singleton = false, &block)
- describe(mod, 'when extended by', ext) {
+ describe(mod, "when extended by #{ext}") {
example {
klass = singleton ? class << mod; self; end : mod
klass.ancestors.should include(ext) | spec/spec_helper.rb: Fixed for RSpec 3. | blackwinter_nuggets | train | rb |
ca6a8686bf318ea4139413c3a6a9f1c139648638 | diff --git a/lib/chamber/settings.rb b/lib/chamber/settings.rb
index <HASH>..<HASH> 100644
--- a/lib/chamber/settings.rb
+++ b/lib/chamber/settings.rb
@@ -107,8 +107,15 @@ class Settings
self.namespaces == other.namespaces
end
+ ###
+ # Internal: Returns the Settings data as a Hash for easy manipulation.
+ # Changes made to the hash will *not* be reflected in the original Settings
+ # object.
+ #
+ # Returns a Hash
+ #
def to_hash
- data
+ data.dup
end
def method_missing(name, *args)
diff --git a/spec/lib/chamber/settings_spec.rb b/spec/lib/chamber/settings_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/chamber/settings_spec.rb
+++ b/spec/lib/chamber/settings_spec.rb
@@ -140,5 +140,14 @@ describe Settings do
expect(settings.to_hash).to eql('my_encrypted_setting' => 'hello')
end
+
+ it 'does not allow manipulation of the internal setting hash when converted to a Hash' do
+ settings = Settings.new(settings: {setting: 'value'})
+
+ settings_hash = settings.to_hash
+ settings_hash[:setting] = 'foo'
+
+ expect(settings.setting).to eql 'value'
+ end
end
end | Always duplicate the settings hash before returning it so that we don't have inadvertent modifications | thekompanee_chamber | train | rb,rb |
f16e47fcf6c8a00d331c3ee05248f4f10a35d83b | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -65,9 +65,9 @@ setup(
'Intended Audience :: Developers',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
- 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Natural Language :: English',
'Topic :: Education',
], | Update Python support in setup.py | learningequality_ricecooker | train | py |
57faf598973a0c0e269522e85077b440a1e97a41 | diff --git a/generators/setup-workspace/index.js b/generators/setup-workspace/index.js
index <HASH>..<HASH> 100644
--- a/generators/setup-workspace/index.js
+++ b/generators/setup-workspace/index.js
@@ -98,12 +98,6 @@ class Generator extends Base {
type: String
});
- this.option('verbose', {
- type: Boolean,
- defaults: false,
- description: 'Show logs from spawned processes'
- });
-
this.argument('product', {
required: true
});
@@ -162,11 +156,9 @@ class Generator extends Base {
}
_spawn(cmd, argline, cwd) {
- const stdio = this.options.verbose ? 'inherit' : ['inherit', 'pipe', 'pipe']; // pipe `stdout` and `stderr` to host process
-
const options = cwd === false ? {} : Object.assign({
cwd: this.cwd,
- stdio
+ stdio: 'inherit' // log output and error of spawned process to host process
}, cwd || {});
this.log(`\nRunning: ${cmd} ${argline}\n`) | Remove verbose flag and always log spawned output
#<I>
Since this `setup-workspace` generator is only used by the user and not used in the product build.js we can remove the verbose flag. | phovea_generator-phovea | train | js |
cc2b9a23a269b7f1f01d83698dad20aa16340686 | diff --git a/lib/restbase.js b/lib/restbase.js
index <HASH>..<HASH> 100644
--- a/lib/restbase.js
+++ b/lib/restbase.js
@@ -63,8 +63,8 @@ RESTBase.prototype.request = function (req) {
return Promise.reject(new HTTPError({
status: 403,
body: {
- type: 'access_denied',
- title: 'Access denied'
+ type: 'access_denied#sys',
+ title: 'Access to the /{domain}/sys/ hierarchy is restricted to system users.'
}
}));
} | Add information when denying access to sys | wikimedia_restbase | train | js |
770c761d254088e1b4f6ea8e6c6784b710722318 | diff --git a/src/ResourceTransformer.php b/src/ResourceTransformer.php
index <HASH>..<HASH> 100644
--- a/src/ResourceTransformer.php
+++ b/src/ResourceTransformer.php
@@ -681,7 +681,8 @@ abstract class ResourceTransformer implements ResourceTransformerContract
$childResource = $field->getChildResourceDefinition();
// Process eager loading
- $this->processEagerLoading($childrenQueryBuilder, $childResourceFactory, $childContext);
+ // we actually don't want do eager loading as the eager loading should happen on the root entity
+ //$this->processEagerLoading($childrenQueryBuilder, $childResourceFactory, $childContext);
// fetch the records
$children = $this->getQueryAdapter() | Don't eager load expanded relationships as this causes unexpected issues. | CatLabInteractive_charon | train | php |
1af87ef45d50b38fdf5d7392d3c1061f52f37a21 | diff --git a/lib/ES6ImportsRenamer.js b/lib/ES6ImportsRenamer.js
index <HASH>..<HASH> 100644
--- a/lib/ES6ImportsRenamer.js
+++ b/lib/ES6ImportsRenamer.js
@@ -106,7 +106,8 @@ ES6ImportsRenamer.prototype._renameNextAst = function() {
var importPromises = [];
var body = current.ast.program.body;
for (var i = 0; i < body.length; i++) {
- if (n.ImportDeclaration.check(body[i])) {
+ if (n.ImportDeclaration.check(body[i]) ||
+ (n.ExportDeclaration.check(body[i]) && body[i].source)) {
importPromises.push(this._mapImport(body[i], current.name || current.path));
}
} | Adds support for exports with source | mairatma_es6-imports-renamer | 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.