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 |
|---|---|---|---|---|---|
877bd7daf370012fc42949c6a732f431b2e785c2 | diff --git a/clients/web/test/spec/routingSpec.js b/clients/web/test/spec/routingSpec.js
index <HASH>..<HASH> 100644
--- a/clients/web/test/spec/routingSpec.js
+++ b/clients/web/test/spec/routingSpec.js
@@ -362,7 +362,7 @@ describe('Test routing paths', function () {
return $('input#g-core-cookie-lifetime').length === 1;
});
girderTest.testRoute('plugins', false, function () {
- return $('.g-body-title').text() === 'Plugins';
+ return $('.g-body-title').text().indexOf('Plugins') === 0;
});
girderTest.testRoute('assetstores', false, function () {
return $('.g-assetstore-container').length === 1; | Fix expectation of web_client_routing test | girder_girder | train | js |
8c1dbc86a0764385b5626439dbb2506414053bdb | diff --git a/tests/backend/test_util.py b/tests/backend/test_util.py
index <HASH>..<HASH> 100644
--- a/tests/backend/test_util.py
+++ b/tests/backend/test_util.py
@@ -1,7 +1,8 @@
-import pytest
-
+from functools import singledispatch
from types import ModuleType
+import pytest
+
@pytest.fixture
def mock_module():
@@ -9,7 +10,6 @@ def mock_module():
def test_module_dispatch_registers(mock_module):
- from functools import singledispatch
from bigchaindb.backend.utils import make_module_dispatch_registrar
@singledispatch
@@ -26,7 +26,6 @@ def test_module_dispatch_registers(mock_module):
def test_module_dispatch_dispatches(mock_module):
- from functools import singledispatch
from bigchaindb.backend.utils import make_module_dispatch_registrar
@singledispatch | Import std libs at the top
the rationale behind importing under a test function is to import what
is being tested, and perhasp likely to fail, to isolate possible errors
resulting from the import itself
see
<URL> | bigchaindb_bigchaindb | train | py |
802286d3ba3a8ba5b7010e07200ee994d3273f01 | diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/multi_json_spec.rb
+++ b/spec/multi_json_spec.rb
@@ -63,7 +63,7 @@ describe 'MultiJson' do
MultiJson.use :json_gem
end
- it 'should warb about json/pure' do
+ it 'should warn about json/pure' do
Kernel.should_receive(:warn).with(/'json_pure', '~> 1.7.7'/)
MultiJson.use :json_pure
end | Fix a typo in specs [ci skip] | intridea_multi_json | train | rb |
45a157d73f5ab65366538c0f314f6484a1f61de0 | diff --git a/src/net/sf/mpxj/LocaleData.java b/src/net/sf/mpxj/LocaleData.java
index <HASH>..<HASH> 100644
--- a/src/net/sf/mpxj/LocaleData.java
+++ b/src/net/sf/mpxj/LocaleData.java
@@ -76,7 +76,7 @@ public class LocaleData extends ListResourceBundle
TASK_COLUMNS_ARRAY[TaskField.BCWP_VALUE] = "BCWP";
TASK_COLUMNS_ARRAY[TaskField.BCWS_VALUE] = "BCWS";
TASK_COLUMNS_ARRAY[TaskField.SV_VALUE] = "SV";
- TASK_COLUMNS_ARRAY[TaskField.NAME_VALUE] = "Name";
+ TASK_COLUMNS_ARRAY[TaskField.NAME_VALUE] = "Task Name";
TASK_COLUMNS_ARRAY[TaskField.WBS_VALUE] = "WBS";
TASK_COLUMNS_ARRAY[TaskField.CONSTRAINT_TYPE_VALUE] = "Constraint Type";
TASK_COLUMNS_ARRAY[TaskField.CONSTRAINT_DATE_VALUE] = "Constraint Date"; | Updated column name to match Microsoft Project. | joniles_mpxj | train | java |
51b5edaa2f8dfb0acb520ecb394706ade2200a35 | diff --git a/src/Illuminate/Foundation/Console/AboutCommand.php b/src/Illuminate/Foundation/Console/AboutCommand.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Console/AboutCommand.php
+++ b/src/Illuminate/Foundation/Console/AboutCommand.php
@@ -86,6 +86,8 @@ class AboutCommand extends Command
})
->pipe(fn ($data) => $this->display($data));
+ $this->newLine();
+
return 0;
} | Print new line at end of `about` command output | laravel_framework | train | php |
1259c0c59ef4c6642cd1a2e884db8d64a7226dd8 | diff --git a/lib/ecm/contact/version.rb b/lib/ecm/contact/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ecm/contact/version.rb
+++ b/lib/ecm/contact/version.rb
@@ -1,5 +1,5 @@
module Ecm
module Contact
- VERSION = '5.1.0'.freeze
+ VERSION = '5.1.1'.freeze
end
end | Bumped version to <I> | robotex82_ecm_contact2 | train | rb |
9a253dd8fd7eb4384da02cb7ac32aec517a0e03b | diff --git a/lib/millstone.js b/lib/millstone.js
index <HASH>..<HASH> 100644
--- a/lib/millstone.js
+++ b/lib/millstone.js
@@ -385,9 +385,6 @@ function resolve(options, callback) {
try {
l.srs = l.srs || srs.parse(data).proj4;
} catch (e) {}
- try {
- l.srs = l.srs || srs.parse('ESRI::' + data).proj4;
- } catch (e) {}
next(l.srs ? null : new Error('No projection found for layer "' + name + '" at ' + base));
}); | ESRI adding has been moved into node-srs | tilemill-project_millstone | train | js |
efafbb8265d749a2a1c2224aeaf7479ae29c9d53 | diff --git a/src/org/jgroups/protocols/TP.java b/src/org/jgroups/protocols/TP.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/protocols/TP.java
+++ b/src/org/jgroups/protocols/TP.java
@@ -1267,7 +1267,7 @@ public abstract class TP extends Protocol implements DiagnosticsHandler.ProbeHan
processBatch(internal_batch, false, true);
}
catch(Throwable t) {
- log.error(Util.getMessage("IncomingMsgFailure"), local_addr, t);
+ log.error(String.format(Util.getMessage("IncomingMsgFailure"), local_addr), t);
}
}
@@ -1301,7 +1301,7 @@ public abstract class TP extends Protocol implements DiagnosticsHandler.ProbeHan
msg_processing_policy.process(msg, oob, internal);
}
catch(Throwable t) {
- log.error(Util.getMessage("IncomingMsgFailure"), local_addr, t);
+ log.error(String.format(Util.getMessage("IncomingMsgFailure"), local_addr), t);
}
} | Printinting stack trace on incoming message failure | belaban_JGroups | train | java |
cd32ea038ea94d9f755973572e3f0294f3328fa3 | diff --git a/src/Console/RefreshTokenCommand.php b/src/Console/RefreshTokenCommand.php
index <HASH>..<HASH> 100644
--- a/src/Console/RefreshTokenCommand.php
+++ b/src/Console/RefreshTokenCommand.php
@@ -42,7 +42,16 @@ class RefreshTokenCommand extends Command {
$oAth2->setCode($accessToken);
$authToken = $oAth2->fetchAuthToken();
+ if (!array_key_exists('refresh_token', $authToken)) {
+ $this->error('Couldn\'t find refresh_token key in the response.');
+ $this->comment('Below you can check the whole response:');
+ $this->line(json_encode($authToken));
+
+ return;
+ }
+
$this->comment('Copy the refresh token in your googleads configuration file (config/google-ads.php)');
+
// Print refresh token
$this->line(sprintf(
'Refresh token: "%s"', | Add control when creating a new refresh token and there is no refresh_token key in the response | Edujugon_laravel-google-ads | train | php |
345ab27e02cbbf2e9e0ffd97845531365074bcb8 | diff --git a/raiden/smart_contracts/tests/test_cmc.py b/raiden/smart_contracts/tests/test_cmc.py
index <HASH>..<HASH> 100644
--- a/raiden/smart_contracts/tests/test_cmc.py
+++ b/raiden/smart_contracts/tests/test_cmc.py
@@ -315,7 +315,7 @@ contract ChannelManagerContract {
}
'''
-
+@pytest.mark.xfail
def test_cmc():
s = tester.state()
assert s.block.number < 1150000 | marking cmc test as xfail | raiden-network_raiden | train | py |
dc268775bd0409bc79dd4f0005c9aa4949487deb | diff --git a/Resources/public/js/models/ez-contenttypemodel.js b/Resources/public/js/models/ez-contenttypemodel.js
index <HASH>..<HASH> 100644
--- a/Resources/public/js/models/ez-contenttypemodel.js
+++ b/Resources/public/js/models/ez-contenttypemodel.js
@@ -14,7 +14,7 @@ YUI.add('ez-contenttypemodel', function (Y) {
* @namespace eZ
* @class ContentType
* @constructor
- * @extends Model
+ * @extends eZ.RestModel
*/
Y.eZ.ContentType = Y.Base.create('contentTypeModel', Y.eZ.RestModel, [], { | Fixed an issue in content type model documentation | ezsystems_PlatformUIBundle | train | js |
0f6d5b9af61b1a727e1a5f563e37209fb253ac64 | diff --git a/tests/unit_project/test_photos/test_photo.py b/tests/unit_project/test_photos/test_photo.py
index <HASH>..<HASH> 100644
--- a/tests/unit_project/test_photos/test_photo.py
+++ b/tests/unit_project/test_photos/test_photo.py
@@ -45,7 +45,9 @@ class TestPhoto(DatabaseTestCase):
self.thumbnail_path = self.photo.get_thumbnail_path()
def test_thumbnail_html_retrieval_success(self):
- expected_html = u'<a href="%(full)s"><img src="%(thumb)s" alt="%(name)s" /></a>' % {
+ #TODO: This should be in adimn, not models
+ #TODO: There should be a hyperlink working with jquery thickbox
+ expected_html = u'<img src="%(thumb)s" alt="%(name)s" />' % {
'full' : "%(media)sphotos/%(date)s/%(name)s.jpg" % {
"name" : u'%s-example-photo' % self.photo.pk,
"media" : settings.MEDIA_URL, | As stated by developers, thickbox is not working for now | ella_ella | train | py |
fde3e6b15fd23b6f4956bb84e3f398581f31f786 | diff --git a/noop.go b/noop.go
index <HASH>..<HASH> 100644
--- a/noop.go
+++ b/noop.go
@@ -36,4 +36,6 @@ func (*noopSpan) Tag(string, string) {}
func (*noopSpan) Finish() {}
+func (*noopSpan) FinishedWithDuration(duration time.Duration) {}
+
func (*noopSpan) Flush() {}
diff --git a/span.go b/span.go
index <HASH>..<HASH> 100644
--- a/span.go
+++ b/span.go
@@ -45,6 +45,12 @@ type Span interface {
// span.Flush).
Finish()
+ // Finish the Span with duration and send to Reporter. If DelaySend option was used at
+ // Span creation time, FinishedWithDuration will not send the Span to the Reporter. It then
+ // becomes the user's responsibility to get the Span reported (by using
+ // span.Flush).
+ FinishedWithDuration(duration time.Duration)
+
// Flush the Span to the Reporter (regardless of being finished or not).
// This can be used if the DelaySend SpanOption was set or when dealing with
// one-way RPC tracing where duration might not be measured. | Adding FinishedWithDuration to Span interface | openzipkin_zipkin-go | train | go,go |
1f71dfb2f8a3d43336b4a0ecbfb749393e39083d | diff --git a/pyvisa/highlevel.py b/pyvisa/highlevel.py
index <HASH>..<HASH> 100644
--- a/pyvisa/highlevel.py
+++ b/pyvisa/highlevel.py
@@ -1035,7 +1035,8 @@ class VisaLibraryBase(object):
return (ResourceInfo(parsed.interface_type_const,
parsed.board,
- parsed.resource_class, None, None),
+ parsed.resource_class,
+ str(parsed), None),
constants.StatusCode.success)
except ValueError:
return 0, constants.StatusCode.error_invalid_resource_name | fix(highlevel): added resource_name to parse_resource_extended
Using ResourceManager.resource_info returned inconsistent results
between the NI-VISA backend vs other backends which didn't extend
visalib.parse_resource_extended (e.g. PyVISA-sim) and code relying
on the "normalization" behavior of resource_info.resource_name
would not work. | pyvisa_pyvisa | train | py |
6040cb3cf6ed898db1d90c40d8c14f3e4613560e | diff --git a/src/appContext.js b/src/appContext.js
index <HASH>..<HASH> 100644
--- a/src/appContext.js
+++ b/src/appContext.js
@@ -4,6 +4,13 @@
Only exported to enable testing. You shouldn't be accessing this normally.
*/
-export const appContext = {}
-export const app = () => appContext
+if (! global.appContext) {
+ global.appContext = {}
+}
+
+export const appContext = global.appContext
+
+export const app = () =>
+ appContext
+ | Use global to make sure same appContext is available everywhere | mindhivenz_di-js | train | js |
bb3f3bebfaee2d72a90460725f1663c246193340 | diff --git a/src/entities/EntityDatabase.js b/src/entities/EntityDatabase.js
index <HASH>..<HASH> 100644
--- a/src/entities/EntityDatabase.js
+++ b/src/entities/EntityDatabase.js
@@ -15,6 +15,7 @@ BookCitation.schema = {
day: { type: 'string', optional: true },
fpage: { type: 'string', optional: true },
lpage: { type: 'string', optional: true },
+ elocationId: { type: 'string', optional: true },
pageRange: { type: 'string', optional: true }
}
@@ -33,6 +34,7 @@ JournalCitation.schema = {
fpage: { type: 'string', optional: true },
lpage: { type: 'string', optional: true },
pageRange: { type: 'string', optional: true },
+ elocationId: { type: 'string', optional: true },
doi: { type: 'string', optional: true}
} | Add elocation-id property. | substance_texture | train | js |
c00e3c6b8ae3b9642ba3cb5672bf2b8798cfd394 | diff --git a/Tests/Form/Admin/ContactFormBuilderTest.php b/Tests/Form/Admin/ContactFormBuilderTest.php
index <HASH>..<HASH> 100755
--- a/Tests/Form/Admin/ContactFormBuilderTest.php
+++ b/Tests/Form/Admin/ContactFormBuilderTest.php
@@ -25,9 +25,9 @@ class ContactFormBuilderTest extends AbstractFormBuilderTestCase
{
return $this->container->get('contact.form_builder.admin');
}
-
- protected function getFactoryService()
+
+ protected function getDefaultFormData()
{
- return $this->container->get('contact.factory');
+ return $this->container->get('contact.manager')->initResource();
}
} | Changed form test cases to use manager instead of factory | WellCommerce_ContactBundle | train | php |
a919c4f7c8980ecf7ce8f7440aee9dedfb0e2c25 | diff --git a/src/MultipleInput.php b/src/MultipleInput.php
index <HASH>..<HASH> 100644
--- a/src/MultipleInput.php
+++ b/src/MultipleInput.php
@@ -159,6 +159,10 @@ class MultipleInput extends InputWidget
? ArrayHelper::getValue($this->model, $this->attribute, [])
: [];
+ if (!is_array($data) && empty($data)) {
+ return;
+ }
+
foreach ((array) $data as $index => $value) {
$this->data[$index] = $value;
} | Do not render row if data is empty | unclead_yii2-multiple-input | train | php |
113aebc835eff50bf7a852ebfdd8826f56f6e688 | diff --git a/src/wyc/stages/TypePropagation.java b/src/wyc/stages/TypePropagation.java
index <HASH>..<HASH> 100755
--- a/src/wyc/stages/TypePropagation.java
+++ b/src/wyc/stages/TypePropagation.java
@@ -486,8 +486,12 @@ public final class TypePropagation {
// FIXME: need to iterate to a fixed point
environment = propagate(stmt.body,environment,imports);
- // FIXME: need to remove the variable types from the environment, since
- // they are only declared for the duration of the body but not beyond.
+ // Remove loop variables from the environment, since they are only
+ // declared for the duration of the body but not beyond.
+ for(int i=0;i!=elementTypes.length;++i) {
+ String var = stmtVariables.get(i);
+ environment = environment.remove(var);
+ }
return environment;
}
@@ -1094,8 +1098,6 @@ public final class TypePropagation {
Nominal<Type> type = environment.get(expr.var);
- System.out.println("ENVIRONMENT: " + environment);
-
if (expr instanceof Expr.LocalVariable) {
Expr.LocalVariable lv = (Expr.LocalVariable) expr;
lv.type = type; | Yet another fix, this time for for loops and loop variables (which weren't being removed from the environment). | Whiley_WhileyCompiler | train | java |
5cdd98da45d00880c08404705dd34e8bf136fb00 | diff --git a/vyked/bus.py b/vyked/bus.py
index <HASH>..<HASH> 100644
--- a/vyked/bus.py
+++ b/vyked/bus.py
@@ -187,8 +187,6 @@ class TCPBus:
self._handle_ping(packet, protocol)
elif packet['type'] == 'pong':
self._handle_pong(packet['node_id'], packet['count'])
- elif packet['type'] == 'publish':
- self._handle_publish(packet, protocol)
else:
if self.tcp_host.is_for_me(packet['name'], packet['version']):
func = getattr(self, '_' + packet['type'] + '_receiver')
@@ -211,15 +209,6 @@ class TCPBus:
else:
print('no api found for packet: ', packet)
- def _handle_publish(self, packet, protocol):
- service, version, endpoint, payload, publish_id = (packet['name'], packet['version'], packet['endpoint'],
- packet['payload'], packet['publish_id'])
- for client in self._service_clients:
- if client.name == service and client.version == version:
- fun = getattr(client, endpoint)
- asyncio.async(fun(**payload))
- protocol.send(MessagePacket.ack(publish_id))
-
def handle_connected(self):
if self.tcp_host:
yield from self.tcp_host.initiate() | Removed unused method _handle_publish from tcp_bus | kashifrazzaqui_vyked | train | py |
efb068ef9adfb7578db509fa76168ffaa3ea1226 | diff --git a/kubernetes/models/v1/Container.py b/kubernetes/models/v1/Container.py
index <HASH>..<HASH> 100644
--- a/kubernetes/models/v1/Container.py
+++ b/kubernetes/models/v1/Container.py
@@ -93,11 +93,11 @@ class Container(BaseModel):
vol = {
'mountPath': volume.mount_path,
'name': volume.name,
- 'readOnly': 'false'
+ 'readOnly': False
}
if volume.read_only is True:
- vol['readOnly'] = 'true'
+ vol['readOnly'] = True
self.model['volumeMounts'].append(vol)
return self | models/v1/Container: fixes readOnly boolean for volume mount | mnubo_kubernetes-py | train | py |
0303480b1a45b58d09efb69a7913c01cd365396b | diff --git a/contrib/raftexample/raft.go b/contrib/raftexample/raft.go
index <HASH>..<HASH> 100644
--- a/contrib/raftexample/raft.go
+++ b/contrib/raftexample/raft.go
@@ -130,7 +130,7 @@ func (rc *raftNode) entriesToApply(ents []raftpb.Entry) (nents []raftpb.Entry) {
}
firstIdx := ents[0].Index
if firstIdx > rc.appliedIndex+1 {
- log.Fatalf("first index of committed entry[%d] should <= progress.appliedIndex[%d] 1", firstIdx, rc.appliedIndex)
+ log.Fatalf("first index of committed entry[%d] should <= progress.appliedIndex[%d]+1", firstIdx, rc.appliedIndex)
}
if rc.appliedIndex-firstIdx+1 < uint64(len(ents)) {
nents = ents[rc.appliedIndex-firstIdx+1:] | contrib/raftexample: fix typo | etcd-io_etcd | train | go |
5324150ff43ea590c6eead5f50c447872d83ff14 | diff --git a/lib/ditty/models/user.rb b/lib/ditty/models/user.rb
index <HASH>..<HASH> 100644
--- a/lib/ditty/models/user.rb
+++ b/lib/ditty/models/user.rb
@@ -57,7 +57,9 @@ module Ditty
end
def username
- identity_dataset.first.username
+ identity = identity_dataset.first
+ return identity.username if identity
+ email
end
class << self | fix: Default to email as username if the user has no identity | EagerELK_ditty | train | rb |
0a71b8f94d53ae02e9e5f241a0ffe1f0968d7b01 | diff --git a/lib/sortah/components/lens.rb b/lib/sortah/components/lens.rb
index <HASH>..<HASH> 100644
--- a/lib/sortah/components/lens.rb
+++ b/lib/sortah/components/lens.rb
@@ -21,8 +21,8 @@ module Sortah
def run!(email, context)
@email = email
- run_dependencies!(email, context)
return if already_ran?
+ run_dependencies!(email, context)
result = run_block!
email.metadata(name, result) if provides_value?
end | minor optimization -- don't bother to check deps of a lens if we've already run the lens | jfredett_sortah | train | rb |
124f430d44619be5debb0fbac34a04c7edb7ca44 | diff --git a/linux/runcopts/options.go b/linux/runcopts/options.go
index <HASH>..<HASH> 100644
--- a/linux/runcopts/options.go
+++ b/linux/runcopts/options.go
@@ -1,3 +1,3 @@
package runcopts
-const URIBase = "containerd.io/linux/runc"
+const URIBase = "types.containerd.io/linux/runc" | Update base types url for runc opts | containerd_containerd | train | go |
0619e27532e2e29f4adedb5eef2b194ac93439a8 | diff --git a/src/js/mep-player.js b/src/js/mep-player.js
index <HASH>..<HASH> 100644
--- a/src/js/mep-player.js
+++ b/src/js/mep-player.js
@@ -1002,7 +1002,7 @@
posterImg = posterDiv.find('img');
if (posterImg.length === 0) {
- posterImg = $('<img width="100%" height="100%" />').appendTo(posterDiv);
+ posterImg = $('<img width="100%" height="100%" alt="" />').appendTo(posterDiv);
}
posterImg.attr('src', url); | Fix validation issue with generated poster image
The image should have an empty `alt` attribute (decoration). | mediaelement_mediaelement | train | js |
085201820f905f889fb05a562e8bf02bbb188f70 | diff --git a/examples/largeimages/main.rb b/examples/largeimages/main.rb
index <HASH>..<HASH> 100644
--- a/examples/largeimages/main.rb
+++ b/examples/largeimages/main.rb
@@ -4,7 +4,7 @@
require "nokogiri"
require "gcplogger"
-logger = GCPLogger.logger "feedpcbr"
+logger = GCPLogger.logger "largeimagesbot"
require_relative "../get_dimensions"
Imgur.logger = logger | omg I fucked up this log | Nakilon_reddit_bot | train | rb |
5a161ac6a77a4b9bd5471f22333fe8ef2f037683 | diff --git a/tests/test_knowledge.py b/tests/test_knowledge.py
index <HASH>..<HASH> 100644
--- a/tests/test_knowledge.py
+++ b/tests/test_knowledge.py
@@ -29,7 +29,7 @@ class KnowledgeTest(unittest.TestCase):
self.r.add('the dog chases the cat')
self.r.add('the cat eats the fish')
self.r.add('the fish is out of luck')
- #print(self.r)
+ self.assertTrue(len(str(self.r)) > 30)
self.assertEqual(len(self.r.data) , 3)
self.assertEqual(self.r.find('cat') , ['the dog chases the cat', 'the cat eats the fish'])
self.assertEqual(self.r.find('dog') , ['the dog chases the cat']) | added test for rawdata after info added for coverage | acutesoftware_AIKIF | train | py |
265b22b1942ae2a3e26f269a8d11897b4b39abde | diff --git a/salt/states/github.py b/salt/states/github.py
index <HASH>..<HASH> 100644
--- a/salt/states/github.py
+++ b/salt/states/github.py
@@ -713,8 +713,8 @@ def repo_present(
ret['result'] = None
else:
result = __salt__['github.add_team_repo'](name, team_name,
- permission,
- profile=profile)
+ profile=profile,
+ permission=permission)
if result:
ret['changes'][team_name] = team_change
else: | states/github.py fix for incorrect positional argument | saltstack_salt | train | py |
2ac17b322ddeb8990dc2a2bebfe42c28ec001789 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -29,6 +29,9 @@ setup(
classifiers=[
'Development Status :: 4 - Beta',
'Framework :: Django',
+ 'Framework :: Django :: 1.11',
+ 'Framework :: Django :: 2.0',
+ 'Framework :: Django :: 2.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
@@ -36,6 +39,7 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', | Add trove classifiers for all supported Django & Python versions
Per tox.ini, Django <I>, <I>, and <I> are supported along with Python
<I>. | stefanfoulis_django-phonenumber-field | train | py |
55b531857dc1d0982fc949c855de262249015217 | diff --git a/benchexec/tools/cbmc.py b/benchexec/tools/cbmc.py
index <HASH>..<HASH> 100644
--- a/benchexec/tools/cbmc.py
+++ b/benchexec/tools/cbmc.py
@@ -139,6 +139,8 @@ class Tool(benchexec.tools.template.BaseTool):
status = result.RESULT_FALSE_FREE
elif result_str == 'FALSE(no-overflow)':
status = result.RESULT_FALSE_OVERFLOW
+ elif result_str == 'FALSE(valid-memcleanup)':
+ status = result.RESULT_FALSE_MEMCLEANUP
else:
status = result.RESULT_FALSE_REACH
elif 'UNKNOWN' in output: | Fix memcleanup result for CBMC | sosy-lab_benchexec | train | py |
dbdae667f8aa1560edc2284bc5073ebb42b7ae35 | diff --git a/image_test.go b/image_test.go
index <HASH>..<HASH> 100644
--- a/image_test.go
+++ b/image_test.go
@@ -414,7 +414,10 @@ func TestImageCompositeModeLighter(t *testing.T) {
t.Fatal(err)
return
}
- for j := 0; j < img1.Bounds().Size().Y; j++ {
+ // Test fails on j = 0 on TravisCI.
+ // https://travis-ci.org/hajimehoshi/ebiten/builds/355973258
+ // Start j with 1 as a temporary hack.
+ for j := 1; j < img1.Bounds().Size().Y; j++ {
for i := 0; i < img1.Bounds().Size().X; i++ {
got := img1.At(i, j).(color.RGBA)
want := img0.At(i, j).(color.RGBA) | graphics: Temporary hack to pass tests on TravisCI | hajimehoshi_ebiten | train | go |
1f32ef0de22465a69b5db7a96dcf6d3a449eec6f | diff --git a/spec/codeclimate_ci/compare_gpa_spec.rb b/spec/codeclimate_ci/compare_gpa_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/codeclimate_ci/compare_gpa_spec.rb
+++ b/spec/codeclimate_ci/compare_gpa_spec.rb
@@ -5,17 +5,20 @@ module CodeclimateCi
let(:codeclimate_ci) { CodeclimateCi::CompareGpa.new('repo11', 'token1') }
before do
- allow_any_instance_of(ApiRequester).to receive(:branch_info)
+ allow_any_instance_of(ApiRequester).to receive(:branch_info).with('master')
.and_return(
'last_snapshot' => { 'gpa' => 3 }
)
+
+ allow_any_instance_of(ApiRequester).to receive(:branch_info).with('another_branch')
+ .and_return(
+ 'last_snapshot' => { 'gpa' => 2 }
+ )
end
context 'when branch is analyzed' do
- before { allow_any_instance_of(GetGpa).to receive(:gpa).and_return(1) }
-
it 'should not be worse' do
- expect(codeclimate_ci.worse?('master')).to be_falsey
+ expect(codeclimate_ci.worse?('another_branch')).to be_truthy
end
end
end | Fix spec in compare gpa spec | fs_codeclimate_ci | train | rb |
da4fb22e7a368ecc460ac2a875ff38fa3132e422 | diff --git a/src/ast/scopes/Scope.js b/src/ast/scopes/Scope.js
index <HASH>..<HASH> 100644
--- a/src/ast/scopes/Scope.js
+++ b/src/ast/scopes/Scope.js
@@ -27,9 +27,7 @@ class Parameter {
}
export default class Scope {
- constructor ( options ) {
- options = options || {};
-
+ constructor ( options = {} ) {
this.parent = options.parent;
this.isBlockScope = !!options.isBlockScope;
this.isLexicalBoundary = !!options.isLexicalBoundary; | destructure options in Scope constructor
i couldn't think of a reason you'd opt out of destructuring here; apologies if i'm mistaken somehow | rollup_rollup | train | js |
a8295232451dea336cb860c19348c28d4a863bb0 | diff --git a/d3pie/d3pie.js b/d3pie/d3pie.js
index <HASH>..<HASH> 100644
--- a/d3pie/d3pie.js
+++ b/d3pie/d3pie.js
@@ -1305,7 +1305,7 @@ var segments = {
.attr("transform", function() { return math.getPieTranslateCenter(pieCenter); })
.attr("class", pie.cssPrefix + "pieChart");
- var arc = d3.svg.arc()
+ var arc = d3.arc()
.innerRadius(pie.innerRadius)
.outerRadius(pie.outerRadius)
.startAngle(0)
@@ -1337,7 +1337,7 @@ var segments = {
.style("stroke", segmentStroke)
.style("stroke-width", 1)
.transition()
- .ease("cubic-in-out")
+ .ease(d3.easeCubicInOut)
.duration(loadSpeed)
.attr("data-index", function(d, i) { return i; })
.attrTween("d", function(b) { | Compatibility with D3js v4 | benkeen_d3pie | train | js |
c8df0c016d8df9fcd25ad050c540eedeed6df705 | diff --git a/cmd/juju/action/common.go b/cmd/juju/action/common.go
index <HASH>..<HASH> 100644
--- a/cmd/juju/action/common.go
+++ b/cmd/juju/action/common.go
@@ -8,6 +8,7 @@ import (
"fmt"
"io"
"regexp"
+ "sort"
"strconv"
"strings"
"time"
@@ -161,6 +162,7 @@ func (c *runCommandBase) processOperationResults(ctx *cmd.Context, results *acti
for k, v := range failed {
list = append(list, fmt.Sprintf(" - id %q with return code %d", k, v))
}
+ sort.Strings(list)
return errors.Errorf(`
the following task%s failed: | Actions: Sort exec failure order
This was spotted trying to land a fix in develop, where the ordering of
the task failures is a map and we depend on that order to verify test
results. | juju_juju | train | go |
4cea8c302810a28e6290172353895ef1512fd666 | diff --git a/rightscale/rightscale.py b/rightscale/rightscale.py
index <HASH>..<HASH> 100644
--- a/rightscale/rightscale.py
+++ b/rightscale/rightscale.py
@@ -61,6 +61,9 @@ RS_REST_ACTIONS = {
'destroy': None,
},
+ # rs api 1.5 returns a link where rel=self for the ``/api/sessions``
+ # resource. sadly, the href=/api/session. regardless, we don't need
+ # it as an attribute because it's where we started off.
'self': None,
'servers': { | Add reason for ignoring the "self" rel | brantai_python-rightscale | train | py |
381f19bdda8617610e55deeeefc1f0483c14b9e9 | diff --git a/h2o-docs/src/booklets/v2_2015/source/GBM_Vignette_code_examples/gbm_gridsearch_random.py b/h2o-docs/src/booklets/v2_2015/source/GBM_Vignette_code_examples/gbm_gridsearch_random.py
index <HASH>..<HASH> 100644
--- a/h2o-docs/src/booklets/v2_2015/source/GBM_Vignette_code_examples/gbm_gridsearch_random.py
+++ b/h2o-docs/src/booklets/v2_2015/source/GBM_Vignette_code_examples/gbm_gridsearch_random.py
@@ -1,6 +1,6 @@
#Define parameters for gridsearch
ntrees_opt = range(0,100,1)
-max_depth_opt = range(0,20,1)
+max_depth_opt = range(1,20,1)
learn_rate_opt = [s/float(1000) for s in range(1,101)]
hyper_parameters = {"ntrees": ntrees_opt,
"max_depth":max_depth_opt, "learn_rate":learn_rate_opt} | prevent possibility for random gbm search to select max_depth=0 (#<I>) | h2oai_h2o-3 | train | py |
c26296fee8dc386e7673eaeb7acf0efff0013a8d | diff --git a/tests/unit/test_regressions.py b/tests/unit/test_regressions.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_regressions.py
+++ b/tests/unit/test_regressions.py
@@ -331,18 +331,18 @@ from . import foo
assert (
isort.code(
"""
-from .. import foo
-# Comment canary
from . import foo
+# Comment canary
+from .. import foo
""",
ensure_newline_before_comments=True,
force_sort_within_sections=True,
)
== """
-from .. import foo
+from . import foo
# Comment canary
-from . import foo
+from .. import foo
"""
) | squash! Add new option for sorting relative imports in force-sorted sections
Restore unrelated test to original | timothycrosley_isort | train | py |
5866d6cee90145dea1c4abc33ed8964e6544249f | diff --git a/src/NodeRun.js b/src/NodeRun.js
index <HASH>..<HASH> 100644
--- a/src/NodeRun.js
+++ b/src/NodeRun.js
@@ -89,9 +89,21 @@ function addExtension() {
// Only translate as a module if the source module is requesting
// via import syntax
- var m = !!module.parent.__es6;
+ if (module.parent.__es6) {
- text = translate(text, { wrap: m, module: m });
+ text = translate(text, { wrap: true, module: true });
+
+ } else {
+
+ // Node modules are wrapped in function expressions, so return statements
+ // are allowed
+ text = "(function() {" + text + "})";
+
+ text = translate(text, { wrap: false, module: false });
+
+ // Remove function wrapper
+ text = text.slice(13, -2);
+ }
} catch (e) {
diff --git a/test/functional/import-export-legacy.js b/test/functional/import-export-legacy.js
index <HASH>..<HASH> 100644
--- a/test/functional/import-export-legacy.js
+++ b/test/functional/import-export-legacy.js
@@ -1 +1,4 @@
-exports.legacyRelative = "legacy-relative";
\ No newline at end of file
+exports.legacyRelative = "legacy-relative";
+
+// Node modules are wrapped in function expression, so return statements are allowed
+return; | Wrap old-style modules in a function expression before translating, so that return statements are allowed. | zenparsing_esdown | train | js,js |
a66de54f606c0d263ab2f6f2cb1e2cd32ee2c0a0 | diff --git a/lib/ImageHelper.php b/lib/ImageHelper.php
index <HASH>..<HASH> 100644
--- a/lib/ImageHelper.php
+++ b/lib/ImageHelper.php
@@ -28,7 +28,11 @@ class ImageHelper {
const BASE_UPLOADS = 1;
const BASE_CONTENT = 2;
+ static $home_url;
+
public static function init() {
+ self::$home_url = get_home_url();
+
add_action('delete_attachment', array(__CLASS__, 'delete_attachment'));
add_filter('wp_generate_attachment_metadata', array(__CLASS__, 'generate_attachment_metadata'), 10, 2);
add_filter('upload_dir', array(__CLASS__, 'add_relative_upload_dir_key'), 10, 2);
@@ -198,7 +202,7 @@ class ImageHelper {
* @return array
*/
public static function add_relative_upload_dir_key( $arr ) {
- $arr['relative'] = str_replace(get_home_url(), '', $arr['baseurl']);
+ $arr['relative'] = str_replace(self::$home_url, '', $arr['baseurl']);
return $arr;
} | issue #<I>: fix polylang performance issue by caching get_home_url() | timber_timber | train | php |
de9fd93cd1957677791155e4fa066927740df5aa | diff --git a/core/leader/leader.go b/core/leader/leader.go
index <HASH>..<HASH> 100644
--- a/core/leader/leader.go
+++ b/core/leader/leader.go
@@ -56,8 +56,8 @@ type leader struct {
func update(ctx context.Context, l *leader) {
const (
insertQ = `
- INSERT INTO leader (leader_key, leader_address, expiry) VALUES ($1, $2, CURRENT_TIMESTAMP + INTERVAL '10 seconds')
- ON CONFLICT (singleton) DO UPDATE SET leader_key = $1, leader_address = $2, expiry = CURRENT_TIMESTAMP + INTERVAL '10 seconds'
+ INSERT INTO leader (leader_key, address, expiry) VALUES ($1, $2, CURRENT_TIMESTAMP + INTERVAL '10 seconds')
+ ON CONFLICT (singleton) DO UPDATE SET leader_key = $1, address = $2, expiry = CURRENT_TIMESTAMP + INTERVAL '10 seconds'
WHERE leader.expiry < CURRENT_TIMESTAMP
`
updateQ = ` | bugfix: consistent column name
I updated the column name in the db and forgot to change the code.
Thanks @boymanjor for catching this 🙌
Closes chain/chainprv#<I>.
Reviewers: @boymanjor | chain_chain | train | go |
e1eb8b522323b019bd67ac53b5a587a6c05679dc | diff --git a/src/ImageController.php b/src/ImageController.php
index <HASH>..<HASH> 100644
--- a/src/ImageController.php
+++ b/src/ImageController.php
@@ -54,7 +54,7 @@ class ImageController
public function original(): void
{
- throw new \RuntimeException('Use web server configuration to request original/generated images');
+ throw new NotFoundHttpException('Use web server configuration to request original/generated images');
}
public function pipe(string $pipeName, string $imageId) | runtime exception changed to http not found | mrTimofey_laravel-aio-images | train | php |
c6e5f3d15dda44f3b8ac2100d95547cb97e459e5 | diff --git a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCriteria.java b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCriteria.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCriteria.java
+++ b/src/main/java/com/xtremelabs/robolectric/shadows/ShadowCriteria.java
@@ -24,6 +24,7 @@ public class ShadowCriteria {
return accuracy;
}
+ @Implementation
public void setAccuracy(int accuracy) {
this.accuracy = accuracy;
} | Added missing @Implementation annotation that was breaking the build | robolectric_robolectric | train | java |
d6bd6d7104e3159488db206db699a2b03905c524 | diff --git a/test/shared/fetcher.test.js b/test/shared/fetcher.test.js
index <HASH>..<HASH> 100644
--- a/test/shared/fetcher.test.js
+++ b/test/shared/fetcher.test.js
@@ -117,11 +117,11 @@ describe('fetcher', function() {
});
it('should append specified additional options', function () {
- fetcher.buildOptions({foo: 'bar'}).should.be.deep.equal({foo: 'bar', app: this.app});
+ fetcher.buildOptions({foo: 'bar'}).should.be.deep.equal({foo: 'bar', app: this.app, parse: true});
});
it('should merge specified params with specified options that are empty', function () {
- fetcher.buildOptions(null, {foo: 'bar'}).should.be.deep.equal({foo: 'bar', app: this.app});
+ fetcher.buildOptions(null, {foo: 'bar'}).should.be.deep.equal({foo: 'bar', app: this.app, parse: true});
});
it('should merge specified params with the specified options', function () {
@@ -129,6 +129,7 @@ describe('fetcher', function() {
params = {anyParam: 'paramValue'},
expected = {
app: this.app,
+ parse: true,
anyOption: 'withValue',
anyParam: 'paramValue'
}; | update other tests to account for additional parse option | rendrjs_rendr | train | js |
91e8a50812cb00835946e95e2a34f349a66fd09a | diff --git a/hdf5storage/__init__.py b/hdf5storage/__init__.py
index <HASH>..<HASH> 100644
--- a/hdf5storage/__init__.py
+++ b/hdf5storage/__init__.py
@@ -2557,7 +2557,12 @@ def loadmat(file_name, mdict=None, appendmat=True,
if variable_names is None:
data = {pathesc.unescape_path(k): v for k, v in f.items()}
else:
- data = {k: f.read(k) for k in variable_names}
+ data = dict()
+ for k in variable_names:
+ try:
+ data[k] = f.read(k)
+ except:
+ pass
# Read all the variables, stuff them into mdict, and return it.
if mdict is None:
mdict = data | Fixed bug in loadmat where it would fail if a variable was missing rather than getting whatever ones can be gotten. | frejanordsiek_hdf5storage | train | py |
ba22ff3a02d872ecff7b60693b0f88ed309ec9e9 | diff --git a/lib/pdu.js b/lib/pdu.js
index <HASH>..<HASH> 100644
--- a/lib/pdu.js
+++ b/lib/pdu.js
@@ -140,9 +140,10 @@ PDU.prototype._filter = function(func) {
}.bind(this));
} else {
if (key === 'message_payload') {
- this[key] = tlvs[key].filter[func].call(this, this[key], 'short_message' in this);
+ skipUdh = this.short_message && this.short_message.message && this.short_message.message.length;
+ this[key] = tlvs[key].filter[func].call(this, this[key], skipUdh);
} else {
- this[key] = tlvs[key].filter[func].call(this, this[key], key !== 'message_payload');
+ this[key] = tlvs[key].filter[func].call(this, this[key], true);
}
}
} | Fix/message payload udh (#<I>)
fix udh collision when message_payload and short_message | farhadi_node-smpp | train | js |
e261f3897f758440d140f02a581ec357c2f0e500 | diff --git a/rapidoid-commons/src/test/java/org/rapidoid/beany/BeanyPropertiesTest.java b/rapidoid-commons/src/test/java/org/rapidoid/beany/BeanyPropertiesTest.java
index <HASH>..<HASH> 100644
--- a/rapidoid-commons/src/test/java/org/rapidoid/beany/BeanyPropertiesTest.java
+++ b/rapidoid-commons/src/test/java/org/rapidoid/beany/BeanyPropertiesTest.java
@@ -20,7 +20,6 @@
package org.rapidoid.beany;
-import org.junit.Assert;
import org.junit.Test;
import org.rapidoid.annotation.Authors;
import org.rapidoid.annotation.Since;
@@ -54,11 +53,12 @@ public class BeanyPropertiesTest extends BeanyTestCommons {
@Test
public void testGetPropValue() {
Baz baz = new Baz();
- Assert.assertEquals(baz.x, Beany.getPropValue(baz, "x"));
+ Object bazX = Beany.getPropValue(baz, "x");
+ eq(baz.x, bazX);
}
public void testGetIdValue() {
Baz baz = new Baz();
- Assert.assertEquals("114", Beany.getId(baz));
+ eq("114", Beany.getId(baz));
}
} | Resolved ambiguity. | rapidoid_rapidoid | train | java |
290dbbd4a05f78ecf3e4465815b34da6f972f87e | diff --git a/src/Arionum.php b/src/Arionum.php
index <HASH>..<HASH> 100644
--- a/src/Arionum.php
+++ b/src/Arionum.php
@@ -133,7 +133,7 @@ final class Arionum
*
* @param string $address
* @param int $limit
- * @return stdClass[]
+ * @return array<stdClass>
* @throws ApiException
* @api
*/
@@ -151,7 +151,7 @@ final class Arionum
*
* @param string $publicKey
* @param int $limit
- * @return stdClass[]
+ * @return array<stdClass>
* @throws ApiException
* @api
*/
@@ -244,7 +244,7 @@ final class Arionum
* Retrieve the transactions of a specified block.
*
* @param string $blockId
- * @return stdClass[]
+ * @return array<stdClass>
* @throws ApiException
* @api
*/
@@ -346,7 +346,7 @@ final class Arionum
/**
* Retrieve a list of registered masternodes on the network.
*
- * @return array
+ * @return array<stdClass>
* @throws ApiException
* @api
*/
@@ -424,7 +424,7 @@ final class Arionum
* Retrieve the asset balance for a specific address.
*
* @param string $address
- * @return array
+ * @return array<stdClass>
* @throws ApiException
* @api
*/
@@ -446,7 +446,7 @@ final class Arionum
}
/**
- * @param array $query
+ * @param array<string> $query
* @return mixed
* @throws ApiException
* @internal | Update to use generics for array type hints | pxgamer_arionum-php | train | php |
1ede4a82dec9430fec3d78de6d6627ca5ea9e934 | diff --git a/python_jsonschema_objects/validators.py b/python_jsonschema_objects/validators.py
index <HASH>..<HASH> 100644
--- a/python_jsonschema_objects/validators.py
+++ b/python_jsonschema_objects/validators.py
@@ -88,7 +88,7 @@ def pattern(param, value, _):
type_registry = ValidatorRegistry()
@type_registry.register(name='boolean')
-def check_integer_type(param, value, _):
+def check_boolean_type(param, value, _):
if not isinstance(value, bool):
raise ValidationError(
"{0} is not a boolean".format(value))
@@ -117,8 +117,14 @@ def check_string_type(param, value, _):
raise ValidationError(
"{0} is not a string".format(value))
+@type_registry.register(name='array')
+def check_array_type(param, value, _):
+ if not isinstance(value, list):
+ raise ValidationError(
+ "{0} is not an array".format(value))
+
@type_registry.register(name='object')
-def check_null_type(param, value, _):
+def check_object_type(param, value, _):
from python_jsonschema_objects.classbuilder import ProtocolBase
if not isinstance(value, (dict, ProtocolBase)):
raise ValidationError( | Fixed issue in validators.py where the ValidatorRegistry was missing check_array_type and fixed some typos in other type check registries. | cwacek_python-jsonschema-objects | train | py |
6b982c3cb434687d08e991c3bf3ebb8ef2d55332 | diff --git a/asn1crypto/core.py b/asn1crypto/core.py
index <HASH>..<HASH> 100644
--- a/asn1crypto/core.py
+++ b/asn1crypto/core.py
@@ -51,7 +51,6 @@ import sys
import re
from collections import OrderedDict
from datetime import datetime
-from pprint import pprint
import binascii
from . import _teletex_codec
@@ -382,13 +381,6 @@ class Asn1Value():
return self.header + self.contents + self.trailer
- def pprint(self):
- """
- Pretty prints the native representation of the value
- """
-
- pprint(self.native)
-
class ValueMap():
""" | Removed pprint() since it didn't really add any value, especially with .debug() now available | wbond_asn1crypto | train | py |
181369df369608ae8fb1535b79eb756f9ccd618b | diff --git a/src/main/java/edu/washington/cs/knowitall/commonlib/AbstractRange.java b/src/main/java/edu/washington/cs/knowitall/commonlib/AbstractRange.java
index <HASH>..<HASH> 100644
--- a/src/main/java/edu/washington/cs/knowitall/commonlib/AbstractRange.java
+++ b/src/main/java/edu/washington/cs/knowitall/commonlib/AbstractRange.java
@@ -1,5 +1,7 @@
package edu.washington.cs.knowitall.commonlib;
+import edu.washington.cs.knowitall.commonlib.Range;
+
public abstract class AbstractRange {
public abstract boolean isEmpty();
public abstract int getStart(); | Modified imports in AbstractRange. | knowitall_common-java | train | java |
63a28b2e557702a256c8223d870c985879798c3e | diff --git a/lib/models.js b/lib/models.js
index <HASH>..<HASH> 100644
--- a/lib/models.js
+++ b/lib/models.js
@@ -11,19 +11,20 @@ function init(sugar, engine) {
post: Boolean
});
Middleware.pre(function() {
- Middleware.use(function(data, next) {
- sugar.update(Middleware, {
- _id: data._id,
- pre: true
- }, function(err) {
+ Middleware.use(function(next) {
+ sugar.getAll(Middleware, {}, function(err, d) {
if(err) console.error(err);
- next();
+ // TODO: set pre of each true. now setting just first
+ // TODO: implement batch update?
+
+ if(d[0]) sugar.update(Middleware, d[0]._id, {pre: true}, next);
+ else next();
});
});
});
Middleware.post(function() {
- Middleware.use(function(data, next) {
+ Middleware.use(function(next, data) {
sugar.update(Middleware, {
_id: data._id,
post: true | Pass data just to post middleware
Obviously this cannot be done in the case of pre given there is no data
available yet. | sugarjs_sugar-spec | train | js |
70470ae8d2a1a9304cec9110043011b9358d20a3 | diff --git a/src/js/captions.js b/src/js/captions.js
index <HASH>..<HASH> 100644
--- a/src/js/captions.js
+++ b/src/js/captions.js
@@ -151,7 +151,8 @@ const captions = {
toggleClass(this.elements.container, this.config.classNames.captions.enabled, !is.empty(tracks));
// Update available languages in list
- if ((this.config.controls || []).includes('settings') && this.config.settings.includes('captions')) {
+ if ((is.array(this.config.controls) && this.config.controls.includes('settings'))
+ && this.config.settings.includes('captions')) {
controls.setCaptionsMenu.call(this);
}
}, | Fix issue when controls config is string or element | sampotts_plyr | train | js |
50af3f0551f797184787451615655dab5b12213b | diff --git a/plugin.js b/plugin.js
index <HASH>..<HASH> 100644
--- a/plugin.js
+++ b/plugin.js
@@ -56,7 +56,12 @@ function cmifyTransform (filename) {
// handle css files
if (/\.css$/.test(filename)) {
- this.push(createCssModuleSource(filename))
+ try {
+ this.push(createCssModuleSource(filename))
+ }
+ catch (err) {
+ this.emit("error", err);
+ }
} else {
const ast = falafel(src, { ecmaVersion: 6 }, walk)
this.push(ast.toString())
@@ -115,7 +120,12 @@ function cmifyPlugin (b, opts) {
// (so that imported @value updates are carried through hmr)
if (/\.css$/.test(row.id)) {
cmify.invalidateById(row.id)
- row.source = createCssModuleSource(row.id)
+ try {
+ row.source = createCssModuleSource(row.id)
+ }
+ catch (err) {
+ this.emit("error", err);
+ }
}
next(null, row)
} | Do not crash with exception. Emit error event instead. | joshwnj_cmify | train | js |
0b4769289a4219d3e188d89801f51301634aa2a2 | diff --git a/sanic/config.py b/sanic/config.py
index <HASH>..<HASH> 100644
--- a/sanic/config.py
+++ b/sanic/config.py
@@ -1,8 +1,6 @@
import os
import types
-from distutils.util import strtobool
-
from sanic.exceptions import PyFileError
@@ -127,6 +125,23 @@ class Config(dict):
self[config_key] = float(v)
except ValueError:
try:
- self[config_key] = bool(strtobool(v))
+ self[config_key] = strtobool(v)
except ValueError:
self[config_key] = v
+
+
+def strtobool(val):
+ """
+ This function was borrowed from distutils.utils. While distutils
+ is part of stdlib, it feels odd to use distutils in main application code.
+
+ The function was modified to walk its talk and actually return bool
+ and not int.
+ """
+ val = val.lower()
+ if val in ("y", "yes", "t", "true", "on", "1"):
+ return True
+ elif val in ("n", "no", "f", "false", "off", "0"):
+ return False
+ else:
+ raise ValueError("invalid truth value %r" % (val,)) | Drop dependency on disutils (#<I>)
* Drop dependency on distutils
While distutils is part of stdlib, it feels odd to use distutils in main application code.
I personally use a (lean)[<URL> | huge-success_sanic | train | py |
d975f40e4d0fae9b30576228736d8126b3b5e6f8 | diff --git a/src/Fields/Text.php b/src/Fields/Text.php
index <HASH>..<HASH> 100644
--- a/src/Fields/Text.php
+++ b/src/Fields/Text.php
@@ -14,6 +14,7 @@ declare(strict_types=1);
namespace WordPlate\Acf\Fields;
use WordPlate\Acf\Fields\Attributes\ConditionalLogic;
+use WordPlate\Acf\Fields\Attributes\DefaultValue;
use WordPlate\Acf\Fields\Attributes\Instructions;
use WordPlate\Acf\Fields\Attributes\Pending;
use WordPlate\Acf\Fields\Attributes\Placeholder;
@@ -27,7 +28,7 @@ use WordPlate\Acf\Fields\Attributes\Wrapper;
*/
class Text extends Field
{
- use ConditionalLogic, Instructions, Pending, Placeholder, Required, Wrapper;
+ use ConditionalLogic, DefaultValue, Instructions, Pending, Placeholder, Required, Wrapper;
/**
* The field type. | Added DefaultValue to Text (#<I>) | wordplate_acf | train | php |
ef5e00c53ae5c4060d4053494346907087207fa7 | diff --git a/opal/action_pack/core.rb b/opal/action_pack/core.rb
index <HASH>..<HASH> 100644
--- a/opal/action_pack/core.rb
+++ b/opal/action_pack/core.rb
@@ -287,6 +287,10 @@ class ActionController
end
end
+ def current_path
+ `window.location.pathname`
+ end
+
private
def render_path
@@ -616,9 +620,10 @@ class Application
controller = controller_class.new(params)
controller.invoke_action(action)
html, content_for_htmls = controller.render_template(options[:content_for] || {})
- puts "html = #{html}"
+ puts "invoke_controller: html = #{html}"
Document.find(options[:selector]).html = html
content_for_htmls.each do |selector, html|
+ puts "invoke_controller: content_for(#{selector}), html = #{html}"
Document.find(selector).html = html
end
end
@@ -773,10 +778,11 @@ class Application
def go_to_route(url, options={})
puts "go_to_route: url = #{url}"
@current_route_action, @params = self.class.routes.match_url(url)
+ puts "before push_state"
+ History.push_state({}, 'new route', url)
puts "go_to_route: action = #{@current_route_action.name}, params = #{@params}"
@current_route_action.invoke_controller(@current_route_action, @params, options)
puts "go_to_route: after invoke_controller"
- History.push_state({}, 'new route', url)
end
ROUTE_MAP = { | move push state before invoking controller
add current_path method to controller
add debug | boberetezeke_opal-actionpack | train | rb |
d44d3d1eecc7518107ccd43226601f3dfb537916 | diff --git a/src/WSDL/WSDL.php b/src/WSDL/WSDL.php
index <HASH>..<HASH> 100644
--- a/src/WSDL/WSDL.php
+++ b/src/WSDL/WSDL.php
@@ -23,6 +23,7 @@
*/
namespace WSDL;
+use WSDL\Builder\AnnotationWSDLBuilder;
use WSDL\Builder\WSDLBuilder;
use WSDL\XML\XMLProvider;
@@ -64,4 +65,15 @@ class WSDL
$xml->generate();
return new self($xml->getXml());
}
+
+ /**
+ * @param string $class
+ * @return WSDL
+ */
+ public static function fromAnnotations($class)
+ {
+ $annotationWSDLBuilder = new AnnotationWSDLBuilder($class);
+ $WSDLBuilder = $annotationWSDLBuilder->build()->getBuilder();
+ return self::fromBuilder($WSDLBuilder);
+ }
} | Added factory for annotation builder. | piotrooo_wsdl-creator | train | php |
75c91c19ff4e1c558ca068c911414f8373847dc8 | diff --git a/test/refresh_reference_files.py b/test/refresh_reference_files.py
index <HASH>..<HASH> 100644
--- a/test/refresh_reference_files.py
+++ b/test/refresh_reference_files.py
@@ -28,7 +28,7 @@ def _main():
plt.close()
tex_filename = filename[:-3] + "_reference.tex"
- with open(os.path.join(this_dir, tex_filename), "w") as f:
+ with open(os.path.join(this_dir, tex_filename), "w", encoding="utf8") as f:
f.write(code)
return | Make refresh_reference_files work on windows | nschloe_matplotlib2tikz | train | py |
e1111455b04cf87ce48f155827e0bc05070972f9 | diff --git a/src/components/core/core.js b/src/components/core/core.js
index <HASH>..<HASH> 100644
--- a/src/components/core/core.js
+++ b/src/components/core/core.js
@@ -186,9 +186,9 @@ export default class Core extends UIObject {
this.containers.forEach((container) => container.destroy())
this.mediaControl.container = null
this.containerFactory.options = $.extend(this.options, { sources })
- this.containerFactory.createContainers().then((containers) => {
- this.setupContainers(containers)
- })
+ this.containerFactory.createContainers()
+ .then((containers) => this.setupContainers(containers))
+ .then((containers) => this.resolveOnContainersReady(containers))
}
destroy() { | fix(core); trigger CORE_READY event after create container on load | clappr_clappr | train | js |
e471ff4fce5b300b88c40614796915fca26c6f4c | diff --git a/qds_sdk/commands.py b/qds_sdk/commands.py
index <HASH>..<HASH> 100644
--- a/qds_sdk/commands.py
+++ b/qds_sdk/commands.py
@@ -703,7 +703,7 @@ class DbImportCommand(Command):
class CompositeCommand(Command):
@classmethod
- def compose(cls, sub_commands, cluster_label=None, notify=False):
+ def compose(cls, sub_commands, macros=None, cluster_label=None, notify=False):
"""
Args:
`sub_commands`: list of sub-command dicts
@@ -717,9 +717,12 @@ class CompositeCommand(Command):
composite = CompositeCommand.compose([cmd1, cmd2])
cmd = CompositeCommand.run(**composite)
"""
+ if macros is not None:
+ macros = json.loads(macros)
return {
"sub_commands": sub_commands,
"command_type": "CompositeCommand",
+ "macros": macros,
"label": cluster_label,
"can_notify": notify
} | Add support for macros in composite-commands | qubole_qds-sdk-py | train | py |
5fed1b2a4a300218ee572ade2c91ffe1bdf8d520 | diff --git a/lib/svtplay/output.py b/lib/svtplay/output.py
index <HASH>..<HASH> 100644
--- a/lib/svtplay/output.py
+++ b/lib/svtplay/output.py
@@ -1,7 +1,30 @@
import sys
+import os
from svtplay.log import log
+progress_stream = sys.stderr
+
+def progress(byte, total, extra = ""):
+ """ Print some info about how much we have downloaded """
+ ratio = float(byte) / total
+ percent = round(ratio*100, 2)
+ tlen = str(len(str(total)))
+ fmt = "Downloaded %"+tlen+"dkB of %dkB bytes (% 3.2f%%)"
+ progresstr = fmt % (byte >> 10, total >> 10, percent)
+
+ columns = int(os.getenv("COLUMNS", "80"))
+ if len(progresstr) < columns - 13:
+ p = int((columns - len(progresstr) - 3) * ratio)
+ q = int((columns - len(progresstr) - 3) * (1 - ratio))
+ progresstr = "[" + ("#" * p) + (" " * q) + "] " + progresstr
+ progress_stream.write(progresstr + ' ' + extra + '\r')
+
+ if byte >= total:
+ progress_stream.write('\n')
+
+ progress_stream.flush()
+
def progressbar(total, pos, msg=""):
"""
Given a total and a progress position, output a progress bar | Break out progress() to svtplay.output module
Now it is very clear that progressbar() duplicates an existing function. But
obsoleting one or the other is work for the future. | spaam_svtplay-dl | train | py |
30071ab8259ec114b806414cf23f9fabe34237ab | diff --git a/src/wyc/builder/LocalGenerator.java b/src/wyc/builder/LocalGenerator.java
index <HASH>..<HASH> 100644
--- a/src/wyc/builder/LocalGenerator.java
+++ b/src/wyc/builder/LocalGenerator.java
@@ -104,10 +104,6 @@ public final class LocalGenerator {
return generateCondition(target, (Expr.AbstractInvoke) condition, environment);
} else if (condition instanceof Expr.RecordAccess) {
return generateCondition(target, (Expr.RecordAccess) condition, environment);
- } else if (condition instanceof Expr.Record) {
- return generateCondition(target, (Expr.Record) condition, environment);
- } else if (condition instanceof Expr.Tuple) {
- return generateCondition(target, (Expr.Tuple) condition, environment);
} else if (condition instanceof Expr.IndexOf) {
return generateCondition(target, (Expr.IndexOf) condition, environment);
} else if (condition instanceof Expr.Comprehension) { | Ok, wierd, I found two more cases. One for tuple and one for record! | Whiley_WhileyCompiler | train | java |
20119a6be4710229516707b11385c988d40855c8 | diff --git a/saltant/models/resource.py b/saltant/models/resource.py
index <HASH>..<HASH> 100644
--- a/saltant/models/resource.py
+++ b/saltant/models/resource.py
@@ -118,8 +118,8 @@ class ModelManager(object):
task instance to get.
Returns:
- :class:`Model`: A model instance model instance representing
- the model instance requested.
+ :class:`Model`: A model instance representing the resource
+ requested.
"""
# Get the object
request_url = ( | Clean up poor English in docstring | saltant-org_saltant-py | train | py |
5276b2acb1c98b85fdbfef6f01a646e1edec4027 | diff --git a/src/main/java/org/takes/facets/forward/RsForward.java b/src/main/java/org/takes/facets/forward/RsForward.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/takes/facets/forward/RsForward.java
+++ b/src/main/java/org/takes/facets/forward/RsForward.java
@@ -45,7 +45,6 @@ import org.takes.rs.RsWithoutHeader;
*
* @since 0.1
*/
-@ToString(callSuper = true, of = "origin")
@EqualsAndHashCode(callSuper = true, of = "origin")
public class RsForward extends HttpException implements Response {
@@ -198,4 +197,9 @@ public class RsForward extends HttpException implements Response {
) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
}
+
+ @Override
+ public String toString() {
+ return super.toString();
+ }
} | (#<I>) ToString of RsForward should act as Exception | yegor256_takes | train | java |
2fec5dbecd3dc6d2acfcb4df28d29638637ac579 | diff --git a/src/core.js b/src/core.js
index <HASH>..<HASH> 100644
--- a/src/core.js
+++ b/src/core.js
@@ -800,7 +800,7 @@ jQuery.extend({
deferred = {
// then( f1, f2, ...)
- then: function() {
+ then: function then() {
if ( ! cancelled ) {
@@ -820,7 +820,7 @@ jQuery.extend({
elem = args[ i ];
type = jQuery.type( elem );
if ( type === "array" ) {
- deferred.then.apply( deferred , elem );
+ then.apply( this , elem );
} else if ( type === "function" ) {
callbacks.push( elem );
} | Fixed a loop that only worked in webkit. | jquery_jquery | train | js |
f62cb53a150238105354794426a17d9ecbd4704a | diff --git a/texttest.php b/texttest.php
index <HASH>..<HASH> 100644
--- a/texttest.php
+++ b/texttest.php
@@ -86,6 +86,16 @@ Test suite: $name
==========================================
";
+
+ $failures = $result->failures();
+ foreach($failures as $failure) {
+ $test = $failure->failedTest();
+ $testName = $test->getName();
+ $exception = $failure->thrownException();
+ echo "* Failure in $testName: $exception
+
+";
+ }
}
$before = microtime_float(); | [project @ Add output of failures to texttest.php] | openid_php-openid | train | php |
123d29b9be4abcdba6f0fa0a1d3aa56a838091e6 | diff --git a/frontend/src/component/menu/routes.js b/frontend/src/component/menu/routes.js
index <HASH>..<HASH> 100644
--- a/frontend/src/component/menu/routes.js
+++ b/frontend/src/component/menu/routes.js
@@ -1,4 +1,3 @@
-import CreateFeatureToggle from '../../page/features/create';
import CopyFeatureToggle from '../../page/features/copy';
import ViewFeatureToggle from '../../page/features/show';
import Features from '../../page/features'; | fix: remove unused component in routes | Unleash_unleash | train | js |
1ad9239540bc5d7dc488c565bb6c553605553fb9 | diff --git a/core/src/test/java/org/infinispan/test/fwk/JGroupsConfigBuilder.java b/core/src/test/java/org/infinispan/test/fwk/JGroupsConfigBuilder.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/org/infinispan/test/fwk/JGroupsConfigBuilder.java
+++ b/core/src/test/java/org/infinispan/test/fwk/JGroupsConfigBuilder.java
@@ -82,7 +82,7 @@ public class JGroupsConfigBuilder {
String newStartPort;
if (m.find()) {
newStartPort = threadTcpStartPort.get();
- result = m.replaceFirst("start_port=" + newStartPort);
+ result = m.replaceFirst("bind_port=" + newStartPort);
} else {
System.out.println("Config is:" + tcpConfig);
Thread.dumpStack(); | Fixed to use bind_port instead of start_port | infinispan_infinispan | train | java |
6b8287190ec35ef87dcb792308902a93a44c2b3c | diff --git a/supervisor_test.go b/supervisor_test.go
index <HASH>..<HASH> 100644
--- a/supervisor_test.go
+++ b/supervisor_test.go
@@ -327,42 +327,6 @@ func TestServiceList(t *testing.T) {
wg.Done()
}
-func TestDoubleStart(t *testing.T) {
- t.Parallel()
-
- var supervisor Supervisor
-
- var svc1 waitservice
- supervisor.Add(&svc1)
-
- ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
-
- var wg sync.WaitGroup
-
- for i := 0; i < 10; i++ {
- wg.Add(1)
- go func(i int) {
- c := context.WithValue(ctx, "supervisor", i)
- supervisor.Serve(c)
-
- svc1.mu.Lock()
- count := svc1.count
- supervisors := svc1.supervisors
- if count > 1 {
- t.Error("wait service should have been started once:", count, "supervisor IDs:", supervisors)
- }
- svc1.mu.Unlock()
-
- wg.Done()
- }(i)
- }
- <-supervisor.startedServices
-
- cancel()
- <-ctx.Done()
- wg.Wait()
-}
-
func TestRestart(t *testing.T) {
t.Parallel() | Remove redundant step
TestDoubleStart and TestRestart now overlap, because a second call
to supervisor.Serve() will hold still. | cirello-io_supervisor | train | go |
fd320636eb23fd426357e450216bcb7b47343e2e | diff --git a/ariba/assembly.py b/ariba/assembly.py
index <HASH>..<HASH> 100644
--- a/ariba/assembly.py
+++ b/ariba/assembly.py
@@ -67,7 +67,7 @@ class Assembly:
self.scaffolder_scaffolds = os.path.join(self.assembly_dir, 'scaffolds.fa')
self.gapfill_dir = os.path.join(self.assembly_dir, 'Gapfill')
self.gapfilled_scaffolds = os.path.join(self.assembly_dir, 'scaffolds.gapfilled.fa')
- self.final_assembly_fa = os.path.join(self.assembly_dir,
+ #self.final_assembly_fa = os.path.join(self.assembly_dir,
@staticmethod | remove line for now, has syntax error | sanger-pathogens_ariba | train | py |
3bd38a7d525a8288a404ee6510613aa7d669b08f | diff --git a/trunk/metpy/readers/mesonet.py b/trunk/metpy/readers/mesonet.py
index <HASH>..<HASH> 100644
--- a/trunk/metpy/readers/mesonet.py
+++ b/trunk/metpy/readers/mesonet.py
@@ -394,7 +394,7 @@ if __name__ == '__main__':
#Optionally plot a counties shapefile
mapfile = os.path.join(os.environ['HOME'], 'mapdata', 'c_03oc08.shp')
if os.path.exists(mapfile):
- m.readshapefile(mapfile, 'counties', zorder=0)
+ m.readshapefile(os.path.splitext(mapfile)[0], 'counties', zorder=0)
plt.title(data['datetime'][0].strftime('%H%MZ %d %b %Y'))
else: | Need to remove the .shp extension when trying to load a shapefile with basemap.
git-svn-id: <URL> | Unidata_MetPy | train | py |
94ced290bdcfcc94ea32253c26dc4c75c522e816 | diff --git a/lib/spatial_features/unzip.rb b/lib/spatial_features/unzip.rb
index <HASH>..<HASH> 100644
--- a/lib/spatial_features/unzip.rb
+++ b/lib/spatial_features/unzip.rb
@@ -1,27 +1,26 @@
module SpatialFeatures
module Unzip
- def self.paths(file_path, find: nil, &block)
+ def self.paths(file_path, find: nil)
dir = Dir.mktmpdir
paths = []
- entries(file_path) do |entry|
+ entries(file_path).each do |entry|
path = "#{dir}/#{entry.name}"
entry.extract(path)
paths << path
end
- paths = paths.each(&block) if block_given?
paths = paths.find {|path| path.include?(find) } if find
return paths
end
- def self.names(file_path, &block)
- entries(file_path).collect(&:name).each(&block)
+ def self.names(file_path)
+ entries(file_path).collect(&:name)
end
- def self.entries(file_path, &block)
- Zip::File.open(File.path(file_path)).each(&block)
+ def self.entries(file_path)
+ Zip::File.open(File.path(file_path))
end
def self.is_zip?(file) | No need to include `each` in unzip methods
If we want to iterate, we’ll do it externally (which we not currently doing). | culturecode_spatial_features | train | rb |
72eabbb8ac6140add3e2dd80aa190c505b49d39d | diff --git a/lib/fluent/event_router.rb b/lib/fluent/event_router.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/event_router.rb
+++ b/lib/fluent/event_router.rb
@@ -116,6 +116,8 @@ module Fluent
if callback = find_callback
callback.call(es)
end
+ rescue Pipeline::OutputError => e
+ @emit_error_handler.handle_emits_error(tag, e.processed_es, e.internal_error)
rescue => e
@emit_error_handler.handle_emits_error(tag, es, e)
end
@@ -161,6 +163,17 @@ module Fluent
private
class Pipeline
+
+ class OutputError < StandardError
+ attr_reader :internal_error
+ attr_reader :processed_es
+
+ def initialize(internal_error, processed_es)
+ @internal_error = internal_error
+ @processed_es = processed_es
+ end
+ end
+
def initialize
@filters = []
@output = nil
@@ -178,7 +191,12 @@ module Fluent
def emit_events(tag, es)
processed = @optimizer.filter_stream(tag, es)
- @output.emit_events(tag, processed)
+
+ begin
+ @output.emit_events(tag, processed)
+ rescue => e
+ raise OutputError.new(e, processed)
+ end
end
class FilterOptimizer | Apply modifications in pipeline to the records being passed to `@Error` label
Fix #<I>
When an error occurs in the output process in a pipeline,
the modifications made by the filter process are applied to the records
that is passsed to `@Error` label. | fluent_fluentd | train | rb |
e6df315ee87138a08aa75b5fcfdce504d5a0aa4c | diff --git a/lib/skeleton.js b/lib/skeleton.js
index <HASH>..<HASH> 100644
--- a/lib/skeleton.js
+++ b/lib/skeleton.js
@@ -4,6 +4,12 @@ var Promise = require('bluebird');
var lpad = require('./util').lpad;
var Class = require('./class');
+function isPromise( probe ) {
+
+ return probe instanceof Promise || ( probe && probe.then &&
+ probe.constructor && probe.constructor.name === 'Promise' );
+}
+
function formatPath(dir, name) {
return path.join(dir, name);
}
@@ -75,7 +81,7 @@ var Skeleton = Class.extend({
migration = require(this.path).up.apply(this, params);
if( migration === null ) migration = Promise.resolve();
- if( migration instanceof Promise ) {
+ if( isPromise( migration ) ) {
migration
.then(function() {
@@ -118,7 +124,7 @@ var Skeleton = Class.extend({
migration = require(this.path).down.apply(this, params);
if( migration === null ) migration = Promise.resolve();
- if( migration instanceof Promise ) {
+ if( isPromise( migration ) ) {
migration
.then(function() { | refactor(migration): Make check for promise more reliable | db-migrate_node-db-migrate | train | js |
ba73b07013df9780ce3d72ef995028d0507068b5 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -17,7 +17,7 @@ global.sinon = require('sinon');
var jsdoc = require('./lib/gulp-jsdoc');
-chai.Assertion.includeStack = true;
+chai.config.includeStack = true;
global.expect = chai.expect; | Get rid of chai.js `includeStack` deprecation warning. | danielwippermann_resol-vbus | train | js |
cd8674867832c2a63ab2a97a49cbd750b58a0d21 | 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
@@ -1,3 +1,7 @@
+# This needs to go before all requires to be able to record full coverage
+require 'coveralls'
+Coveralls.wear!
+# Now the application requires.
require 'hawkular'
require 'metrics/metrics_client'
require 'inventory/inventory_api'
@@ -8,9 +12,6 @@ require 'rspec/mocks'
require 'socket'
require 'uri'
require 'yaml'
-require 'coveralls'
-
-Coveralls.wear!
module Hawkular::Metrics::RSpec
def setup_client(options = {}) | Move coveralls to the top to pick up all app code. | hawkular_hawkular-client-ruby | train | rb |
c6cf6193a15732410c38de1aaa34388b5ce03620 | diff --git a/dpark/executor.py b/dpark/executor.py
index <HASH>..<HASH> 100755
--- a/dpark/executor.py
+++ b/dpark/executor.py
@@ -314,6 +314,8 @@ class MyExecutor(Executor):
# Keep the file descriptor of current workdir,
# so we can check whether a workdir is in use externally.
self._fd_for_locks = []
+ self.stdout_redirect = None
+ self.stderr_redirect = None
def check_alive(self, driver):
@@ -538,8 +540,10 @@ class MyExecutor(Executor):
except:
pass
- sys.stdout = self.stdout_redirect.reset()
- sys.stderr = self.stderr_redirect.reset()
+ if self.stdout_redirect:
+ sys.stdout = self.stdout_redirect.reset()
+ if self.stderr_redirect:
+ sys.stderr = self.stderr_redirect.reset()
def run(): | Fix executor: use non-exist attr when shutdone without register | douban_dpark | train | py |
7cbfc208c8151fd3418cdc7fa1b784bd4a80afb0 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: MIT
+
var debug = require('debug')('metalsmith-convert'),
path = require('path'),
minimatch = require('minimatch'), | Added SPDX license identifier | tomterl_metalsmith-convert | train | js |
caff42af340129ced082bf760885619c0e3e4e31 | diff --git a/esgfpid/rabbit/asynchronous/thread_builder.py b/esgfpid/rabbit/asynchronous/thread_builder.py
index <HASH>..<HASH> 100644
--- a/esgfpid/rabbit/asynchronous/thread_builder.py
+++ b/esgfpid/rabbit/asynchronous/thread_builder.py
@@ -398,6 +398,7 @@ class ConnectionBuilder(object):
self.statemachine.set_to_permanently_unavailable()
self.statemachine.detail_could_not_connect = True
logerror(LOGGER, error_message)
+ self.__make_permanently_closed_by_error(None, 'give up reconnecting') # Stops ioloop, so thread may stop!
raise PIDServerException(error_message+'\nProblems:\n'+self.__connection_errors_to_string())
def __store_connection_error_info(self, errorname, host): | Stop ioloop before throwing exception. | IS-ENES-Data_esgf-pid | train | py |
0ec6dbd374d300ace856488179e725ffcd0100eb | diff --git a/src/main/java/org/zcore/maven/MergeMojo.java b/src/main/java/org/zcore/maven/MergeMojo.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/zcore/maven/MergeMojo.java
+++ b/src/main/java/org/zcore/maven/MergeMojo.java
@@ -179,12 +179,14 @@ public class MergeMojo extends AbstractMojo {
// prebuffer
int character;
try {
+ // get line seperator, based on system
+ final String newLine = System.getProperty("line.separator");
// read & write
while ((character = input.read()) != -1) {
output.write(character);
}
// append newline
- output.write("\r\n".getBytes());
+ output.write(newLine.getBytes());
// flush
output.flush();
} catch (IOException e) { | Use a platform dependent line seperators | bbqrob_merge-maven-plugin | train | java |
19de5eb53f11bc187a61eb719cd256554e43120d | diff --git a/nanocomp/NanoComp.py b/nanocomp/NanoComp.py
index <HASH>..<HASH> 100644
--- a/nanocomp/NanoComp.py
+++ b/nanocomp/NanoComp.py
@@ -6,7 +6,7 @@ import nanocomp.compplots as compplots
import numpy as np
import logging
from nanomath import write_stats
-from NanoPlot.nanoplotter.timeplots import subsample_datasets
+from nanoplot.utils import subsample_datasets
def main(): | changing path from which to import subsample_datasets | wdecoster_nanocomp | train | py |
4d399211c3240cc6c38a714c55c83ed3bc78ebdf | diff --git a/lock.go b/lock.go
index <HASH>..<HASH> 100644
--- a/lock.go
+++ b/lock.go
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
+// This package is deprecated. It has been replaced with https://go4.org/lock
package lock
import ( | package doc: warn about deprecation
And point to new repo | camlistore_lock | train | go |
83781fd380e5bc76aea7aaa0b4510ab812cd4cfa | diff --git a/src/extensions/scratch3_text2speech/index.js b/src/extensions/scratch3_text2speech/index.js
index <HASH>..<HASH> 100644
--- a/src/extensions/scratch3_text2speech/index.js
+++ b/src/extensions/scratch3_text2speech/index.js
@@ -609,8 +609,9 @@ class Scratch3Text2SpeechBlocks {
let nameArray = languageNames.menuMap[editorLanguage];
if (nameArray) {
// Also get any localized names of spoken languages
- const spokenNameArray = languageNames.spokenLanguages[editorLanguage];
- if (spokenNameArray) {
+ let spokenNameArray = [];
+ if (languageNames.spokenLanguages) {
+ spokenNameArray = languageNames.spokenLanguages[editorLanguage];
nameArray = nameArray.concat(spokenNameArray);
}
// Create a map of language code to localized name | Check for spokenLanguages object | LLK_scratch-vm | train | js |
260d041a5e532c3fd2a7eaef6447ff800442747c | diff --git a/MAVProxy/modules/mavproxy_map/__init__.py b/MAVProxy/modules/mavproxy_map/__init__.py
index <HASH>..<HASH> 100644
--- a/MAVProxy/modules/mavproxy_map/__init__.py
+++ b/MAVProxy/modules/mavproxy_map/__init__.py
@@ -165,6 +165,7 @@ def map_callback(obj):
def unload():
'''unload module'''
+ mpstate.map.close()
mpstate.map = None
mpstate.map_functions = {}
diff --git a/MAVProxy/modules/mavproxy_map/mp_slipmap.py b/MAVProxy/modules/mavproxy_map/mp_slipmap.py
index <HASH>..<HASH> 100755
--- a/MAVProxy/modules/mavproxy_map/mp_slipmap.py
+++ b/MAVProxy/modules/mavproxy_map/mp_slipmap.py
@@ -502,6 +502,8 @@ class MPSlipMap():
if self.is_alive():
self.child.join(2)
+ self.child.terminate()
+
def is_alive(self):
'''check if graph is still going'''
return self.child.is_alive() | map: Map window now closes when module is unloaded. | ArduPilot_MAVProxy | train | py,py |
a247cfe93b28194dc59449f06ea5df1519fab008 | diff --git a/morpfw/identity.py b/morpfw/identity.py
index <HASH>..<HASH> 100644
--- a/morpfw/identity.py
+++ b/morpfw/identity.py
@@ -1,7 +1,17 @@
-import morepath
import pytz
+import morepath
+
+from .authn.pas.utils import has_role
+
+
class Identity(morepath.Identity):
+ def __init__(self, request, userid, **kw):
+ self.request = request
+ super().__init__(userid, **kw)
def timezone(self):
return pytz.UTC
+
+ def is_administrator(self):
+ return has_role(self.request, "administrator", userid=self.userid) | added convenient accessor for is_administrator | morpframework_morpfw | train | py |
c944a287aa6ad9dee96c3468e2209986059093f8 | diff --git a/pyvim/commands/commands.py b/pyvim/commands/commands.py
index <HASH>..<HASH> 100644
--- a/pyvim/commands/commands.py
+++ b/pyvim/commands/commands.py
@@ -1,6 +1,7 @@
from __future__ import unicode_literals, print_function
-import six
import os
+import six
+import sys
__all__ = (
'has_command_handler',
@@ -329,6 +330,17 @@ def _(editor, location, force=False):
editor.cli.set_return_value('')
+@cmd('cq')
+def _(editor):
+ """
+ Quit with non zero exit status.
+ """
+ # Note: the try/finally in `prompt_toolkit.Interface.read_input`
+ # will ensure that the render output is reset, leaving the alternate
+ # screen before quiting.
+ sys.exit(1)
+
+
@cmd('wqa')
def _(editor):
""" | Implemented the :cq command. | prompt-toolkit_pyvim | train | py |
ddb16ee886cfbc223dc72f08f7f3e356f54e40c2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -49,6 +49,7 @@ function getImageSearchResults(searchTerm, callback, start, num) {
// Google CSE returns a JSON object with a field called "error" if quota is exceed.
if(data.error && data.error.errors) {
resultsArray.push(data.error.errors[0]);
+ // return the JSON formatted error message in the callback
callback(resultsArray);
} else {
// search returned results
@@ -58,7 +59,6 @@ function getImageSearchResults(searchTerm, callback, start, num) {
callback(resultsArray);
}
});
-
});
} | Clarified comments to usage quota exceeded error handling. | jjmax75_google-image-search | train | js |
fedc16a50ac2e4c62cc184a86263847316e88ae7 | diff --git a/oauth/models/Oauth_ProviderModel.php b/oauth/models/Oauth_ProviderModel.php
index <HASH>..<HASH> 100644
--- a/oauth/models/Oauth_ProviderModel.php
+++ b/oauth/models/Oauth_ProviderModel.php
@@ -28,11 +28,6 @@ class Oauth_ProviderModel extends BaseModel
return $attributes;
}
- public function initSource()
- {
- $this->source = craft()->oauth->getProviderSource($this->class);
- }
-
public function getSource()
{
return $this->source; | Removed Oauth_ProviderModel::initSource() | dukt_oauth | train | php |
68547bcddcc75555fb8e604188dd7934d80464b8 | diff --git a/src/runtime/test/feature.spec.js b/src/runtime/test/feature.spec.js
index <HASH>..<HASH> 100644
--- a/src/runtime/test/feature.spec.js
+++ b/src/runtime/test/feature.spec.js
@@ -79,7 +79,7 @@ describe('The Feature Helper', function() {
p.end('enableAsync')
asyncFeature.finally.should.equal(true)
- p.report.enableAsync.duration.should.be.greaterThan(400)
+ p.report.enableAsync.duration.should.be.greaterThan(300)
})
it('enables with a callback', function(done) { | preventing timing error in the async test | skypager_skypager | train | js |
a924be1e8f9bb7d759a11a245c29b411a7178ce8 | diff --git a/proctor-store-git/src/main/java/com/indeed/proctor/store/GitProctorCore.java b/proctor-store-git/src/main/java/com/indeed/proctor/store/GitProctorCore.java
index <HASH>..<HASH> 100644
--- a/proctor-store-git/src/main/java/com/indeed/proctor/store/GitProctorCore.java
+++ b/proctor-store-git/src/main/java/com/indeed/proctor/store/GitProctorCore.java
@@ -36,6 +36,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
+import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -409,7 +410,8 @@ public class GitProctorCore implements FileBasedPersisterCore {
public Void call() {
try {
LOGGER.info("Start running `git gc` command to clean up git garbage");
- getGit().gc().call();
+ final Properties call = getGit().gc().call();
+ LOGGER.info("`git gc` has been completed " + call.toString());
} catch (final Exception e) {
LOGGER.error("Failed to run `git gc` command.", e);
} | PROW-<I>: add log to git.gc() command, so that we can know how long it takes. | indeedeng_proctor | train | java |
f7e1feaeba4d89f51011155eb446e2e3fe666e90 | diff --git a/lib/mongo/db.rb b/lib/mongo/db.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/db.rb
+++ b/lib/mongo/db.rb
@@ -602,7 +602,7 @@ module Mongo
if !ok?(doc)
raise MongoDBError, "Error with validate command: #{doc.inspect}"
end
- if !doc['valid']
+ if (doc.has_key?('valid') && !doc['valid']) || (doc['result'] =~ /\b(exception|corrupt)\b/i)
raise MongoDBError, "Error: invalid collection #{name}: #{doc.inspect}"
end
doc
diff --git a/test/db_test.rb b/test/db_test.rb
index <HASH>..<HASH> 100644
--- a/test/db_test.rb
+++ b/test/db_test.rb
@@ -304,7 +304,11 @@ class DBTest < Test::Unit::TestCase
should "validate collection" do
doc = @db.validate_collection(@coll.name)
- assert doc['valid']
+ if @@version >= "1.9.1"
+ assert doc['valid']
+ else
+ assert doc['result']
+ end
end
end | minor: make DB#validate_collection compatible with server <I> and <I> | mongodb_mongo-ruby-driver | train | rb,rb |
c5dae7039a57497e49f30967ac8b8698790980ac | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -16,7 +16,6 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
-import sys
try:
from mock import Mock as MagicMock | remove duplicated import in docs conf.py | kakwa_ldapcherry | train | py |
563e52f8be558f00a262963858baa0f871eb6b3c | diff --git a/jaraco/util/itertools.py b/jaraco/util/itertools.py
index <HASH>..<HASH> 100644
--- a/jaraco/util/itertools.py
+++ b/jaraco/util/itertools.py
@@ -691,6 +691,7 @@ class Peekable(object):
def first(iterable):
"""
Return the first item from the iterable.
+
>>> first(range(11))
0
>>> first([3,2,1])
@@ -698,6 +699,7 @@ def first(iterable):
>>> iter = range(11)
>>> first(iter)
0
+
"""
iterable = iter(iterable)
return next(iterable)
@@ -705,12 +707,14 @@ def first(iterable):
def last(iterable):
"""
Return the last item from the iterable, discarding the rest.
+
>>> last(range(20))
19
>>> last([])
Traceback (most recent call last):
...
ValueError: Iterable contains no items
+
"""
for item in iterable:
pass | Update docstrings to improve rendering. | jaraco_jaraco.itertools | train | py |
fee988a88bc6abe07d01535fa87f946f353f01e1 | diff --git a/packages/node_modules/@webex/internal-plugin-flag/src/flag.js b/packages/node_modules/@webex/internal-plugin-flag/src/flag.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@webex/internal-plugin-flag/src/flag.js
+++ b/packages/node_modules/@webex/internal-plugin-flag/src/flag.js
@@ -1,7 +1,7 @@
/*!
* Copyright (c) 2015-2019 Cisco Systems, Inc. See LICENSE file.
*/
-
+import {flatten} from 'lodash';
import {WebexPlugin} from '@webex/webex-core';
const Flag = WebexPlugin.extend({
@@ -131,7 +131,7 @@ const Flag = WebexPlugin.extend({
})
);
- return responses.flat();
+ return flatten(responses);
},
/** | fix(flag): 'flat' isn't available everywhere | webex_spark-js-sdk | train | js |
2f35b6bfbc679fd85101ad2e83dd10a90726cfac | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -96,12 +96,12 @@ pygments_style = 'sphinx'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
-html_theme_options = {'github_fork': 'litl/rauth', 'index_logo': False}
+html_theme_options = {'index_logo': False}
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'flask_small'
+html_theme = 'flask'
# Add any paths that contain custom themes here, relative to this directory. | using full documentation theme to provide toc | litl_rauth | train | py |
22402a99530a7f7fefb6479e691103e017161265 | diff --git a/src/lib/feed.js b/src/lib/feed.js
index <HASH>..<HASH> 100644
--- a/src/lib/feed.js
+++ b/src/lib/feed.js
@@ -26,7 +26,7 @@ StreamFeed.prototype = {
*/
var xhr = this.client.post({
'url': '/api/feed/'+ this.feedUrl + '/',
- 'form': activity,
+ 'body': activity,
'secret': this.feedToken
}, callback);
return xhr;
@@ -41,7 +41,7 @@ StreamFeed.prototype = {
follow: function(target, callback) {
var xhr = this.client.post({
'url': '/api/feed/'+ this.feedUrl + '/follows/',
- 'form': {'target': target},
+ 'body': {'target': target},
'secret': this.feedToken
}, callback);
return xhr; | fix json posting for browser client | GetStream_stream-js | train | js |
574ecdb5128ee9f167d9471f05c663ee0032cfbe | diff --git a/src/app/services/influxdb/influxdbDatasource.js b/src/app/services/influxdb/influxdbDatasource.js
index <HASH>..<HASH> 100644
--- a/src/app/services/influxdb/influxdbDatasource.js
+++ b/src/app/services/influxdb/influxdbDatasource.js
@@ -120,7 +120,7 @@ function (angular, _, kbn) {
if (!data) {
return [];
}
-
+ return data[0].columns;
});
}; | fixed column typehead, introduced in PR #<I> | grafana_grafana | train | js |
cda80498e119b2edb5d7529bbd13af342b496441 | diff --git a/pysat/utils/_core.py b/pysat/utils/_core.py
index <HASH>..<HASH> 100644
--- a/pysat/utils/_core.py
+++ b/pysat/utils/_core.py
@@ -474,7 +474,10 @@ def load_netcdf4(fnames=None, strict_meta=False, file_format=None,
out.append(pds.DataFrame.from_records(item, index=epoch_name))
out = pds.concat(out, axis=0)
else:
- out = xr.open_mfdataset(fnames, combine='by_coords')
+ if len(fnames) == 1:
+ out = xr.open_dataset(fnames[0])
+ else:
+ out = xr.open_mfdataset(fnames, combine='by_coords')
for key in out.variables.keys():
meta_dict = {}
for nc_key in out.variables[key].attrs.keys(): | STY: don't use open_mfdataset for single files | rstoneback_pysat | train | py |
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.