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
|
|---|---|---|---|---|---|
4f39c5b9c9ad279e278509f7dd6d8528a3afe30d
|
diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
index <HASH>..<HASH> 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
@@ -1762,7 +1762,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
return Math.min(clientResumptionTime, serverResumptionTime);
}
- private void processHandledCount(long handledCount) throws NotConnectedException, StreamManagementCounterError {
+ private void processHandledCount(long handledCount) throws StreamManagementCounterError {
long ackedStanzasCount = SMUtils.calculateDelta(handledCount, serverHandledStanzasCount);
final List<Stanza> ackedStanzas = new ArrayList<Stanza>(
handledCount <= Integer.MAX_VALUE ? (int) handledCount
|
Remove not thrown NotConnectedException in XMPPTCPConnection
|
igniterealtime_Smack
|
train
|
java
|
d53b5783684efa4af4f394ad82fc2fa6e14e893e
|
diff --git a/biodata-models/src/main/java/org/opencb/biodata/models/core/Region.java b/biodata-models/src/main/java/org/opencb/biodata/models/core/Region.java
index <HASH>..<HASH> 100644
--- a/biodata-models/src/main/java/org/opencb/biodata/models/core/Region.java
+++ b/biodata-models/src/main/java/org/opencb/biodata/models/core/Region.java
@@ -102,7 +102,7 @@ public class Region {
@Override
public String toString() {
StringBuilder sb = new StringBuilder(this.chromosome);
- if (this.start != 0 && this.end != Integer.MAX_VALUE) {
+ if (this.end != Integer.MAX_VALUE) {
sb.append(":").append(this.start).append("-").append(this.end);
} else {
if (this.start != 0 && this.end == Integer.MAX_VALUE) {
|
biodata: Minor change in toString method of Region
|
opencb_biodata
|
train
|
java
|
f78b5a134773c05b3066a0de2f8445fbb24d5c56
|
diff --git a/pymzn/_mzn/_solvers.py b/pymzn/_mzn/_solvers.py
index <HASH>..<HASH> 100644
--- a/pymzn/_mzn/_solvers.py
+++ b/pymzn/_mzn/_solvers.py
@@ -193,7 +193,7 @@ class Gecode(Solver):
args.append(parallel)
if timeout > 0:
args.append('-time')
- args.append(int(timeout * 1000)) # Gecode takes milliseconds
+ args.append(str(timeout * 1000)) # Gecode takes milliseconds
if seed != 0:
args.append('-r')
args.append(seed)
@@ -344,4 +344,3 @@ optimathsat = Optimathsat(path=config.get('optimathsat'))
#: Default Opturion instance.
opturion = Opturion(path=config.get('opturion'))
-
|
solver: fix bug with timeout cast to str
|
paolodragone_pymzn
|
train
|
py
|
1da8e75782bd45de1bc1a4c0347ac8762ea71e68
|
diff --git a/distutils/tests/test_install.py b/distutils/tests/test_install.py
index <HASH>..<HASH> 100644
--- a/distutils/tests/test_install.py
+++ b/distutils/tests/test_install.py
@@ -19,6 +19,8 @@ from distutils.extension import Extension
from distutils.tests import support
from test import support as test_support
+import pytest
+
def _make_ext_name(modname):
return modname + sysconfig.get_config_var('EXT_SUFFIX')
@@ -29,6 +31,9 @@ class InstallTestCase(support.TempdirManager,
support.LoggingSilencer,
unittest.TestCase):
+ @pytest.mark.xfail(
+ 'platform.system() == "Windows" and sys.version_info > (3, 11)',
+ reason="pypa/distutils#148")
def test_home_installation_scheme(self):
# This ensure two things:
# - that --home generates the desired set of directory names
|
Mark test as xfail. Ref #<I>.
|
pypa_setuptools
|
train
|
py
|
e049ade2682d988e97d00106d77cf2a0158d1336
|
diff --git a/bot.js b/bot.js
index <HASH>..<HASH> 100644
--- a/bot.js
+++ b/bot.js
@@ -43,7 +43,7 @@ twit.stream('statuses/sample', function(stream) {
var isTwss = classify.knn.isTwss({
"promt": tweet.text,
"trainingData": trainingData,
- "numNeighbours": 10
+ "numNeighbours": 2
});
if (isTwss) console.log(tweet.text + '\n');
|
Maybe improved the k-NN slightly
|
DanielRapp_twss.js
|
train
|
js
|
6a53daffdd703ac986678cc9f69ba66fca56d0b2
|
diff --git a/lxd/storage/load.go b/lxd/storage/load.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/load.go
+++ b/lxd/storage/load.go
@@ -32,7 +32,7 @@ func volIDFuncMake(state *state.State, poolID int64) func(volType drivers.Volume
volID, _, err := state.Cluster.StoragePoolNodeVolumeGetTypeByProject("default", volName, volTypeID, poolID)
if err != nil {
if err == db.ErrNoSuchObject {
- return -1, fmt.Errorf("Volume doesn't exist")
+ return -1, fmt.Errorf("Failed to get volume ID, volume '%s' of type '%s' doesn't exist", volName, volType)
}
return -1, err
|
lxd/storage/load: Improves getVolID error when volume not found
|
lxc_lxd
|
train
|
go
|
f045e07f82038f60a7dee0f9b53f391bbaa5e71a
|
diff --git a/tests/test_hooks.py b/tests/test_hooks.py
index <HASH>..<HASH> 100755
--- a/tests/test_hooks.py
+++ b/tests/test_hooks.py
@@ -155,7 +155,9 @@ class TestExternalHooks(object):
assert 'tests' not in os.getcwd()
def test_run_hook(self):
- """Execute hook from specified template in specified output directory"""
+ """Execute hook from specified template in specified output
+ directory.
+ """
tests_dir = os.path.join(self.repo_path, 'input{{hooks}}')
with utils.work_in(self.repo_path):
hooks.run_hook('pre_gen_project', tests_dir, {})
|
Fix pep8 in test_run_hook
|
audreyr_cookiecutter
|
train
|
py
|
c3edc482603e46ae3052c9ef28eb5d0d7b8e3950
|
diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py
index <HASH>..<HASH> 100644
--- a/spyderlib/spyder.py
+++ b/spyderlib/spyder.py
@@ -1246,6 +1246,8 @@ def initialize():
sys.exit = fake_sys_exit
# Translation
+ qt_translator = None
+ app_translator = None
if CONF.get('main', 'translation'):
locale = QLocale.system().name()
qt_translator = QTranslator()
|
Fixed: error when running Spyder with [main] Translate = False
|
spyder-ide_spyder
|
train
|
py
|
4e2ca3c14d077b1b5aa46bda6c66bbd330de03b0
|
diff --git a/modules/__tests__/URLUtils-test.js b/modules/__tests__/URLUtils-test.js
index <HASH>..<HASH> 100644
--- a/modules/__tests__/URLUtils-test.js
+++ b/modules/__tests__/URLUtils-test.js
@@ -260,6 +260,12 @@ describe('formatPattern', function () {
expect(formatPattern(pattern, { id: 'alt.black.helicopter' })).toEqual('comments/alt.black.helicopter/edit');
});
});
+
+ describe('and some params contain special characters', function () {
+ it('returns the correct path', function () {
+ expect(formatPattern(pattern, { id: '?not=confused&with=query#string' })).toEqual('comments/%3Fnot%3Dconfused%26with%3Dquery%23string/edit');
+ });
+ });
});
describe('when a pattern has one splat', function () {
|
[fixed] URI escape path components with special chars
Fixes #<I>
|
taion_rrtr
|
train
|
js
|
0a5e144f9352f7c5ad1abc51809027dfda0b7951
|
diff --git a/lib/expressapp.js b/lib/expressapp.js
index <HASH>..<HASH> 100644
--- a/lib/expressapp.js
+++ b/lib/expressapp.js
@@ -369,6 +369,17 @@ ExpressApp.prototype.start = function(opts, cb) {
});
});
+ router.post('/v1/txproposals/:id/send/', function(req, res) {
+ getServerWithAuth(req, res, function(server) {
+ req.body.txProposalId = req.params['id'];
+ server.sendTx(req.body, function(err, txp) {
+ if (err) return returnError(err, res, req);
+ res.json(txp);
+ res.end();
+ });
+ });
+ });
+
// TODO Check HTTP verb and URL name
router.post('/v1/txproposals/:id/broadcast/', function(req, res) {
getServerWithAuth(req, res, function(server) {
|
add express endpoint for sending tx
|
bitpay_bitcore-wallet-service
|
train
|
js
|
e2e486826454146b6d97b2dd11f4c25e88c03114
|
diff --git a/src/assertions/prop.js b/src/assertions/prop.js
index <HASH>..<HASH> 100644
--- a/src/assertions/prop.js
+++ b/src/assertions/prop.js
@@ -3,21 +3,21 @@ import should from 'should';
const Assertion = should.Assertion;
-Assertion.add('prop', function(expectedKey, expectedValue){
+Assertion.add('prop', function (expectedKey, expectedValue) {
const wrapper = WrapperBuilder(this.obj),
- wrapperProp = wrapper.prop(expectedKey);
+ wrapperProp = wrapper.prop(expectedKey);
- if(arguments.length > 1 && typeof wrapperProp !== 'undefined') {
+ if (arguments.length > 1 && typeof wrapperProp !== 'undefined') {
this.params = {
actual: wrapper.name(),
operator: `prop '${expectedKey}' to have value ${should.format(expectedValue)}, instead found ${should.format(wrapperProp)}`
};
should(wrapperProp).be.eql(expectedValue, ' ');
- }else{
+ } else {
this.params = {
actual: wrapper.name(),
operator: `to have prop '${expectedKey}'`
};
- should(wrapperProp).not.be.undefined(' ');
+ should(wrapperProp).not.be.undefined();
}
});
\ No newline at end of file
|
No args needed for undefined() assert
Errors thrown because no args needed to be passed into the undefined() assert.
Type checking has recently been added to should.js using TypeScript.
|
rkotze_should-enzyme
|
train
|
js
|
12efc890eb535843c7f3c961d898e31cb48437c6
|
diff --git a/angr/engines/successors.py b/angr/engines/successors.py
index <HASH>..<HASH> 100644
--- a/angr/engines/successors.py
+++ b/angr/engines/successors.py
@@ -140,10 +140,9 @@ class SimSuccessors(object):
# trigger inspect breakpoints here since this statement technically shows up in the IRSB as the "next"
state.regs.ip = state.scratch.target
- # Consider those less fortunate among us with no stack pointer
- # EDG and rhelmot would like to warn you that if you don't do this (and don't have a SP)
- # SimProcedures that call other SimProcedures are going to be very broken
- if hasattr(self.initial_state.regs, 'sp'):
+ # For architectures with no stack pointer, we can't manage a callstack. This has the side effect of breaking
+ # SimProcedures that call out to binary code self.call.
+ if self.initial_state.arch.sp_offset is not None:
self._manage_callstack(state)
# clean up the state
|
Change the less-fortunate-among-us check to not trigger breakpoints, also fix narrative voice in comments
|
angr_angr
|
train
|
py
|
8c11ad7c76d936a7ffe939485bbb669e336ea9c2
|
diff --git a/tests/test_models.py b/tests/test_models.py
index <HASH>..<HASH> 100644
--- a/tests/test_models.py
+++ b/tests/test_models.py
@@ -11,7 +11,7 @@ def test_simple_source():
# make a new source without failing
ss = models.SimpleSource()
ss.ra = np.float32(12)
- ss.sanitise()
+ ss._sanitise()
assert isinstance(ss.ra, np.float64)
# convert to string without failing
a = "{0}".format(ss)
|
refactor sanitise -> _sanitise
|
PaulHancock_Aegean
|
train
|
py
|
a5d58b4b7a372cbbfd6d2cbf94e63e8cbe2425a4
|
diff --git a/app/models/alchemy/page.rb b/app/models/alchemy/page.rb
index <HASH>..<HASH> 100644
--- a/app/models/alchemy/page.rb
+++ b/app/models/alchemy/page.rb
@@ -467,19 +467,14 @@ module Alchemy
definition["redirects_to_external"]
end
+ # Returns the first published child
def first_public_child
- self.children.where(:public => true).limit(1).first
+ children.published.first
end
# Gets the language_root page for page
def get_language_root
- return self if self.language_root
- page = self
- while page.parent do
- page = page.parent
- break if page.language_root?
- end
- return page
+ self_and_ancestors.where(:language_root => true).first
end
def copy_children_to(new_parent)
|
Refactors two page methods with scopes.
|
AlchemyCMS_alchemy_cms
|
train
|
rb
|
a15679f5af8302491aeafb3281072dd35daa9f5a
|
diff --git a/examples/hybrid_simple/tests.js b/examples/hybrid_simple/tests.js
index <HASH>..<HASH> 100644
--- a/examples/hybrid_simple/tests.js
+++ b/examples/hybrid_simple/tests.js
@@ -13,7 +13,7 @@ describe('hello', function(){
});
it('should say hello to person', function(){
- expect(hello('Bob')).to.equal('hello Bob')
+ expect(hello('Bob')).to.equal('hello Bob');
});
});
\ No newline at end of file
|
Added a semicolon;
|
testem_testem
|
train
|
js
|
5939d47af634ae47de34764afec881f5af4d40a0
|
diff --git a/dddp/server/views.py b/dddp/server/views.py
index <HASH>..<HASH> 100644
--- a/dddp/server/views.py
+++ b/dddp/server/views.py
@@ -187,6 +187,8 @@ class MeteorView(View):
def get(self, request, path):
"""Return HTML (or other related content) for Meteor."""
+ if path[:1] != '/':
+ path = '/%s' % path
if path == '/meteor_runtime_config.js':
config = {
'DDP_DEFAULT_CONNECTION_URL': request.build_absolute_uri('/'),
|
Normalise paths in dddp.server.views before comparison.
|
jazzband_django-ddp
|
train
|
py
|
01bcf639733328fbf6208c434c3beee13b918f44
|
diff --git a/EventListener/SoftDeleteListener.php b/EventListener/SoftDeleteListener.php
index <HASH>..<HASH> 100644
--- a/EventListener/SoftDeleteListener.php
+++ b/EventListener/SoftDeleteListener.php
@@ -86,9 +86,11 @@ class SoftDeleteListener
}
elseif($manyToMany) {
- $mappedSide = get_class($entity) === $namespace;
- $inversedSide = ($ns && $entity instanceof $ns);
- if ($mappedSide || $inversedSide) {
+ // For ManyToMany relations, we only delete the relationship between
+ // two entities. This can be done on both side of the relation.
+ $allowMappedSide = get_class($entity) === $namespace;
+ $allowInversedSide = ($ns && $entity instanceof $ns);
+ if ($allowMappedSide || $allowInversedSide) {
if (strtoupper($onDelete->type) === 'SET NULL') {
throw new \Exception('SET NULL is not supported for ManyToMany relationships');
|
renamed variables and added comment
|
E-vence_SoftDeleteableListenerExtensionBundle
|
train
|
php
|
849d4f84ab6e77aee0232a454a9894f98f9e9f0d
|
diff --git a/lib/rfd.rb b/lib/rfd.rb
index <HASH>..<HASH> 100644
--- a/lib/rfd.rb
+++ b/lib/rfd.rb
@@ -440,11 +440,11 @@ module Rfd
def ask(prompt = '(y/n)')
command_line.set_prompt prompt
command_line.wrefresh
- while (c = Curses.getch.chr)
- next unless %(y Y n N).include? c
+ while (c = Curses.getch)
+ next unless [78, 89, 110, 121] .include? c # N, Y, n, y
command_line.wclear
command_line.wrefresh
- break %(y Y).include? c
+ break [89, 121].include? c # Y, y
end
end
|
chring a getch explodes when the getch was out of char range
|
amatsuda_rfd
|
train
|
rb
|
5998209e55f9f7fa5e680967e9b223bfad60c762
|
diff --git a/spec/flipper/instrumentation/log_subscriber_spec.rb b/spec/flipper/instrumentation/log_subscriber_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/flipper/instrumentation/log_subscriber_spec.rb
+++ b/spec/flipper/instrumentation/log_subscriber_spec.rb
@@ -81,7 +81,6 @@ describe Flipper::Instrumentation::LogSubscriber do
end
it "logs adapter value" do
- puts log
adapter_line = find_line('Flipper feature(search) adapter(memory) enable')
adapter_line.should include("[ result=")
end
|
Kill a puts with :fire:
|
jnunemaker_flipper
|
train
|
rb
|
304772fa1816e40abdbeff20f9e38ec5d1f57402
|
diff --git a/monasca_common/kafka/producer.py b/monasca_common/kafka/producer.py
index <HASH>..<HASH> 100644
--- a/monasca_common/kafka/producer.py
+++ b/monasca_common/kafka/producer.py
@@ -16,6 +16,7 @@
import logging
import time
+from oslo_utils import encodeutils
from six import PY3
import monasca_common.kafka_lib.client as kafka_client
@@ -53,11 +54,11 @@ class KafkaProducer(object):
success = False
if key is None:
key = int(time.time() * 1000)
- if PY3:
- key = bytes(str(key), 'utf-8')
- messages = [m.encode("utf-8") for m in messages]
- else:
- key = str(key)
+
+ messages = [encodeutils.to_utf8(m) for m in messages]
+
+ key = bytes(str(key), 'utf-8') if PY3 else str(key)
+
while not success:
try:
self._producer.send_messages(topic, key, *messages)
|
Ensures that messages pass to kafka client are bytes string
Story: <I>
Task: <I>
Change-Id: I3ae<I>fbbe<I>bf<I>d<I>c<I>dda<I>d<I>
|
openstack_monasca-common
|
train
|
py
|
72bd315245612e3f6d45e2a8a3a46921e00b6d7b
|
diff --git a/lib/rolify/resource.rb b/lib/rolify/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/rolify/resource.rb
+++ b/lib/rolify/resource.rb
@@ -8,11 +8,16 @@ module Rolify
def find_roles(role_name = nil, user = nil)
roles = user && (user != :any) ? user.roles : self.role_class
roles = roles.where(:resource_type => self.to_s)
- roles = roles.where(:name => role_name) if role_name && (role_name != :any)
+ roles = roles.where(:name => role_name.to_s) if role_name && (role_name != :any)
roles
end
def with_role(role_name, user = nil)
+ if role_name.is_a? Array
+ role_name.map!(&:to_s)
+ else
+ role_name = role_name.to_s
+ end
resources = self.adapter.resources_find(self.role_table_name, self, role_name)
user ? self.adapter.in(resources, user, role_name) : resources
end
|
fixed compatibility issue with Squeel gem when using symbols as role name
closes #<I>
closes #<I>
|
RolifyCommunity_rolify
|
train
|
rb
|
e49470652ac43c584d8b53348e84a26e7a190dde
|
diff --git a/generators/entity-client/index.js b/generators/entity-client/index.js
index <HASH>..<HASH> 100644
--- a/generators/entity-client/index.js
+++ b/generators/entity-client/index.js
@@ -24,7 +24,7 @@ const { entityClientI18nFiles } = require('../entity-i18n/files');
const utils = require('../utils');
const BaseBlueprintGenerator = require('../generator-base-blueprint');
const {
- SUPPORTED_CLIENT_FRAMEWORKS: { ANGULAR, REACT },
+ SUPPORTED_CLIENT_FRAMEWORKS: { ANGULAR, REACT, VUE },
} = require('../generator-constants');
const { GENERATOR_ENTITY_CLIENT } = require('../generator-list');
const { SQL } = require('../../jdl/jhipster/database-types');
@@ -72,7 +72,9 @@ module.exports = class extends BaseBlueprintGenerator {
setupCypress() {
const entity = this.entity;
- this.cypressBootstrapEntities = !entity.reactive || entity.databaseType !== SQL;
+ this.cypressBootstrapEntities =
+ (!entity.reactive || entity.databaseType !== SQL) &&
+ (this.clientFramework !== VUE || !entity.relationships.some(rel => rel.relationshipRequired && rel.collection));
},
};
}
|
Re-enable many-to-many workaround for vue.
|
jhipster_generator-jhipster
|
train
|
js
|
4360f923dba133bc14472ed66ae8e2a61522463b
|
diff --git a/src/components/MultiSelect/MultiSelect.js b/src/components/MultiSelect/MultiSelect.js
index <HASH>..<HASH> 100644
--- a/src/components/MultiSelect/MultiSelect.js
+++ b/src/components/MultiSelect/MultiSelect.js
@@ -12,6 +12,7 @@ import { defaultItemToString } from './tools/itemToString';
import { defaultSortItems, defaultCompareItems } from './tools/sorting';
const { prefix } = settings;
+const noop = () => undefined;
export default class MultiSelect extends React.Component {
static propTypes = {
@@ -203,7 +204,7 @@ export default class MultiSelect extends React.Component {
<ListBox.Field {...getButtonProps({ disabled })}>
{selectedItem.length > 0 && (
<ListBox.Selection
- clearSelection={clearSelection}
+ clearSelection={!disabled ? clearSelection : noop}
selectionCount={selectedItem.length}
/>
)}
|
fix(MultiSelect): disabled multiSelect being able to clear its select… (#<I>)
* fix(MultiSelect): disabled multiSelect being able to clear its selected items
* Update src/components/MultiSelect/MultiSelect.js
clearSection returns noop so that when clicked and disabled no function is ran
|
carbon-design-system_carbon-components-react
|
train
|
js
|
43780030e522c5c03cac4d24cb8bb3c7b11fc3e8
|
diff --git a/ftpretty.py b/ftpretty.py
index <HASH>..<HASH> 100644
--- a/ftpretty.py
+++ b/ftpretty.py
@@ -59,7 +59,7 @@ class ftpretty(object):
a file: opened for writing
None: contents are returned
"""
- if isinstance(local, file):
+ if isinstance(local, io.IOBase):
local_file = local
elif local is None:
local_file = io.StringIO()
@@ -68,7 +68,7 @@ class ftpretty(object):
self.conn.retrbinary("RETR %s" % remote, local_file.write)
- if isinstance(local, file):
+ if isinstance(local, io.IOBase):
local_file = local
elif local is None:
contents = local_file.getvalue()
@@ -94,7 +94,7 @@ class ftpretty(object):
if contents:
# local is ignored if contents is set
local_file = io.StringIO(contents)
- elif isinstance(local, file):
+ elif isinstance(local, io.IOBase):
local_file = local
else:
local_file = open(local, 'rb')
|
PY3: use io.IOBase instead of file
|
codebynumbers_ftpretty
|
train
|
py
|
94e565cdf1b80c4045d4c1dfac1c09bf3b2f3113
|
diff --git a/lib/model/adapters/mongo.js b/lib/model/adapters/mongo.js
index <HASH>..<HASH> 100644
--- a/lib/model/adapters/mongo.js
+++ b/lib/model/adapters/mongo.js
@@ -98,7 +98,7 @@ var Mongo = function (config) {
opts = {};
}
query = transformQuery(query);
- this.collection.find(query)
+ this.collection.find(query, opts.fields)
.sort(opts.sort)
.limit(opts.limit)
.skip(opts.skip)
|
feilds can now be included and excluded from queries
|
mde_ejs
|
train
|
js
|
018605a4dd24ef9d019ab60d906b38604a7b3c81
|
diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -61,7 +61,7 @@ const DOCKER_MONGODB = 'mongo:4.4.1';
const DOCKER_COUCHBASE = 'couchbase:6.6.0';
const DOCKER_CASSANDRA = 'cassandra:3.11.8';
const DOCKER_MSSQL = 'mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04';
-const DOCKER_NEO4J = 'neo4j:4.1.1';
+const DOCKER_NEO4J = 'neo4j:4.1.3';
const DOCKER_HAZELCAST_MANAGEMENT_CENTER = 'hazelcast/management-center:4.0.3';
const DOCKER_MEMCACHED = 'memcached:1.6.6-alpine';
const DOCKER_REDIS = 'redis:6.0.7';
|
Update neo4j docker image version to <I>
|
jhipster_generator-jhipster
|
train
|
js
|
bdd015c6ef20cd0b952403ad5afe21d1d8864668
|
diff --git a/src/Factory/Mail/ConfirmationFactory.php b/src/Factory/Mail/ConfirmationFactory.php
index <HASH>..<HASH> 100644
--- a/src/Factory/Mail/ConfirmationFactory.php
+++ b/src/Factory/Mail/ConfirmationFactory.php
@@ -23,7 +23,7 @@ use Laminas\ServiceManager\Factory\FactoryInterface;
*/
class ConfirmationFactory implements FactoryInterface
{
- public function __invoke(ContainerInterface $container, $requestedName, array $options = [])
+ public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
{
$router = $container->get('Router');
$options['router'] = $router;
|
fix(Applications): Confirmation mail factory is incompatible with Factory Interface.
|
yawik_applications
|
train
|
php
|
c831556dcb66ec152b6d11466934254911b11def
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ except (IOError, ImportError, RuntimeError):
package = 'tapioca'
requirements = [
- 'requests>=2.6,<2.8',
+ 'requests>=2.6',
'arrow>=0.6.0,<0.7',
'six>=1',
]
|
Set requests<I> as minimum dependency on setup.py
|
vintasoftware_tapioca-wrapper
|
train
|
py
|
c93fff20de2daa6f01201ff11229a91433357977
|
diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -10267,6 +10267,20 @@ const devices = [
await configureReporting.brightness(endpoint);
},
},
+ {
+ zigbeeModel: ['BDP3001'],
+ model: '81855',
+ vendor: 'AduroSmart',
+ description: 'ERIA smart plug (dimmer)',
+ extend: generic.light_onoff_brightness,
+ meta: {configureKey: 1},
+ configure: async (device, coordinatorEndpoint) => {
+ const endpoint = device.getEndpoint(1);
+ await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
+ await configureReporting.onOff(endpoint);
+ await configureReporting.brightness(endpoint);
+ },
+ },
// Danfoss
{
|
Support <I> (#<I>)
Added Adurosmart Eria smart plug (dimmer)
|
Koenkk_zigbee-shepherd-converters
|
train
|
js
|
c3bb138ee6316765089888991b6e8846c1897cb4
|
diff --git a/Web/Robot.php b/Web/Robot.php
index <HASH>..<HASH> 100644
--- a/Web/Robot.php
+++ b/Web/Robot.php
@@ -39,7 +39,7 @@ class sb_Web_Robot{
private $cookies = '';
/**
- * Additional headers converted from an array in add_additional_headers
+ * Additional headers converted from an array in set_additional_headers
*
* @var string
*/
@@ -131,12 +131,12 @@ class sb_Web_Robot{
}
/**
- * Add other additional headers
+ * Sets other additional headers
*
* @param array $data
* @return string
*/
- public function add_additional_headers($data){
+ public function set_additional_headers($data){
$additional_headers = '';
|
add_additional_headers() now called set_additional_headers as it is in the phpdocs
|
surebert_surebert-framework
|
train
|
php
|
80731a688d689fd72d2f8c20e7a10de9a5e68762
|
diff --git a/pyinfra/api/facts.py b/pyinfra/api/facts.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/facts.py
+++ b/pyinfra/api/facts.py
@@ -155,6 +155,9 @@ def get_facts(
fact = get_fact_class(name_or_cls)()
name = name_or_cls
+ if isinstance(fact, ShortFactBase):
+ return get_short_facts(state, fact, args=args, ensure_hosts=ensure_hosts)
+
args = args or ()
kwargs = kwargs or {}
if args or kwargs:
|
Restore/fix short fact functionality.
|
Fizzadar_pyinfra
|
train
|
py
|
fa1b2e0103a8694058a3a4f2816479c6fec1a27e
|
diff --git a/lancet/issue_tracker.py b/lancet/issue_tracker.py
index <HASH>..<HASH> 100644
--- a/lancet/issue_tracker.py
+++ b/lancet/issue_tracker.py
@@ -68,11 +68,18 @@ class GitlabTracker(Tracker):
project = self.api.projects.get(project_id, lazy=True)
group = self.api.groups.get(self.group_id, lazy=True)
+ def fromisoformat(datestr):
+ # datetime.date.isoformat is only available on python 3.7+
+ year, month, day = datestr.split("-")
+ return datetime.date(
+ year=int(year), month=int(month), day=int(day)
+ )
+
def is_current(milestone):
return (
- datetime.date.fromisoformat(milestone.start_date)
+ fromisoformat(milestone.start_date)
<= datetime.date.today()
- <= datetime.date.fromisoformat(milestone.due_date)
+ <= fromisoformat(milestone.due_date)
)
if add_to_active_sprint:
|
Restore compatibility with python < <I>
|
GaretJax_lancet
|
train
|
py
|
5a432fbcd81c2e4393cf948206376bb9a668774d
|
diff --git a/test_isort.py b/test_isort.py
index <HASH>..<HASH> 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -673,3 +673,6 @@ def test_settings_combine_instead_of_overwrite():
"""Test to ensure settings combine logically, instead of fully overwriting."""
assert set(SortImports(known_standard_library=['not_std_library']).config['known_standard_library']) == \
set(SortImports().config['known_standard_library'] + ['not_std_library'])
+
+ assert set(SortImports(not_known_standard_library=['thread']).config['known_standard_library']) == \
+ set(item for item in SortImports().config['known_standard_library'] if item != 'thread')
|
Add test to ensure full configurability is still present using 'not_' settings, since settings are no longer fully replaced each time
|
timothycrosley_isort
|
train
|
py
|
35f46e8a87323d4a848461b1416472a48a955f94
|
diff --git a/src/Stagehand/TestRunner/Core/Plugin/PluginRepository.php b/src/Stagehand/TestRunner/Core/Plugin/PluginRepository.php
index <HASH>..<HASH> 100644
--- a/src/Stagehand/TestRunner/Core/Plugin/PluginRepository.php
+++ b/src/Stagehand/TestRunner/Core/Plugin/PluginRepository.php
@@ -86,7 +86,9 @@ class PluginRepository
{
foreach (Finder::create()->name('/^.+Plugin\.php$/')->files()->in(__DIR__) as $file) { /* @var $file \SplFileInfo */
$pluginClass = new \ReflectionClass(__NAMESPACE__ . '\\' . $file->getBasename('.php'));
- if (!$pluginClass->isInterface() && !$pluginClass->isAbstract()) {
+ if (!$pluginClass->isInterface()
+ && !$pluginClass->isAbstract()
+ && $pluginClass->isSubclassOf('Stagehand\TestRunner\Core\Plugin\IPlugin')) {
self::$plugins[] = $pluginClass->newInstance();
}
}
|
Added checking whether the target class is an instance of the IPlugin interface.
|
piece_stagehand-testrunner
|
train
|
php
|
d6c988c62f396813bcaba45c401cfdcd47281385
|
diff --git a/pywal/__main__.py b/pywal/__main__.py
index <HASH>..<HASH> 100644
--- a/pywal/__main__.py
+++ b/pywal/__main__.py
@@ -69,7 +69,7 @@ def get_args(args):
help="Print \"wal\" version.")
arg.add_argument("-e", action="store_true",
- help="Skip Reloading Environment gtk/xrdb/i3/sway/polybar")
+ help="Skip reloading gtk/xrdb/i3/sway/polybar")
return arg.parse_args(args)
|
Keep line length under <I>c
|
dylanaraps_pywal
|
train
|
py
|
6eff3cc2fba257e685dadbb19dda8aa667cb799c
|
diff --git a/tests/mongodb_settings.py b/tests/mongodb_settings.py
index <HASH>..<HASH> 100644
--- a/tests/mongodb_settings.py
+++ b/tests/mongodb_settings.py
@@ -11,7 +11,7 @@ DATABASES['mongo'] = {
}
}
-SOUTH_DATABASE_ADAPTERS = {'mongo': 'django_mongodb_engine.south'}
+SOUTH_DATABASE_ADAPTERS = {'mongo': 'django_mongodb_engine.south_adapter'}
INSTALLED_APPS.extend(['django_mongodb_engine', 'djangotoolbox'])
|
Make sure to load the new mongo south adapter
|
charettes_django-mutant
|
train
|
py
|
2bd76fa32cb648adcff040cd7cb8edad5c5bef4a
|
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private static $freshCache = [];
- const VERSION = '4.4.5';
- const VERSION_ID = 40405;
+ const VERSION = '4.4.6-DEV';
+ const VERSION_ID = 40406;
const MAJOR_VERSION = 4;
const MINOR_VERSION = 4;
- const RELEASE_VERSION = 5;
- const EXTRA_VERSION = '';
+ const RELEASE_VERSION = 6;
+ const EXTRA_VERSION = 'DEV';
const END_OF_MAINTENANCE = '11/2022';
const END_OF_LIFE = '11/2023';
|
bumped Symfony version to <I>
|
symfony_symfony
|
train
|
php
|
5ad2bba28f55fe2cc1d0f65571d022d6dba83b78
|
diff --git a/jquery.cookieBar.js b/jquery.cookieBar.js
index <HASH>..<HASH> 100644
--- a/jquery.cookieBar.js
+++ b/jquery.cookieBar.js
@@ -26,7 +26,7 @@
{
cookiebar.append('<a class="cookiebar-close">Continue</a>');
settings = $.extend( {
- 'closeButtonClass' : '.cookiebar-close'
+ 'closeButton' : '.cookiebar-close'
}, options);
}
@@ -34,7 +34,7 @@
cookiebar.show();
}
- cookiebar.find(settings.closeButtonClass).click(function() {
+ cookiebar.find(settings.closeButton).click(function() {
cookiebar.hide();
$.cookie('cookiebar', 'hide', { path: settings.path, secure: settings.secure, domain: settings.domain, expires: 30 });
return false;
|
fixed an issue with custom close buttons not working
|
carlwoodhouse_jquery.cookieBar
|
train
|
js
|
45bc19451e13bd8a7a4015724c6fda903c88c9b5
|
diff --git a/ait/core/tlm.py b/ait/core/tlm.py
index <HASH>..<HASH> 100644
--- a/ait/core/tlm.py
+++ b/ait/core/tlm.py
@@ -743,7 +743,7 @@ class PacketDefinition(json.SlotSerializer, object):
def simulate(self, fill=None):
size = self.nbytes
- values = bytearray(range(size)) if fill is None else bytearray(str(fill) * size, 'ascii')
+ values = bytearray(range(size)) if fill is None else bytearray(str(fill) * size, 'utf-8')
return Packet(self, values)
|
Updated tlm simulate to use utf-8 encoding
|
NASA-AMMOS_AIT-Core
|
train
|
py
|
80adcf919cc24923e4999f33405def8a93d00105
|
diff --git a/ccmlib/node.py b/ccmlib/node.py
index <HASH>..<HASH> 100644
--- a/ccmlib/node.py
+++ b/ccmlib/node.py
@@ -1002,6 +1002,7 @@ class Node():
with open(full_options['yaml_file'], 'r') as f:
user_yaml = yaml.load(f)
data = common.yaml_merge(user_yaml, data)
+ data.pop('yaml_file')
with open(conf_file, 'w') as f:
yaml.safe_dump(data, f, default_flow_style=False)
|
Do not add yaml_file to cassandra.yaml
|
riptano_ccm
|
train
|
py
|
665a3ed935841217169738038757cca2dbc6b28d
|
diff --git a/Controller/ResourceController.php b/Controller/ResourceController.php
index <HASH>..<HASH> 100644
--- a/Controller/ResourceController.php
+++ b/Controller/ResourceController.php
@@ -325,9 +325,15 @@ class ResourceController extends Controller implements ResourceControllerInterfa
return $this->redirect($redirectPath);
}
+ if ($this->hasParent()) {
+ $returnRoute = $this->getParent()->getConfiguration()->getRoute('show');
+ } else {
+ $returnRoute = $this->config->getRoute('list');
+ }
+
return $this->redirect(
$this->generateUrl(
- $this->config->getRoute('list'),
+ $returnRoute,
$context->getIdentifiers()
)
);
|
Fix delete action redirect (child controller)
|
ekyna_AdminBundle
|
train
|
php
|
bd67f07c7af54a7e0839530c8b8130dff1b3c846
|
diff --git a/bin/eve.js b/bin/eve.js
index <HASH>..<HASH> 100755
--- a/bin/eve.js
+++ b/bin/eve.js
@@ -7,7 +7,7 @@ var minimist = require("minimist");
var config = require("../build/src/config");
var server = require("../build/src/runtime/server");
-const argv = minimist(process.argv.slice(2));
+const argv = minimist(process.argv.slice(2), {boolean: ["server", "editor"]});
// Since our current development pattern uses npm as its package repository, we treat the nearest ancestor directory with a package.json (inclusive) as the directory's "root".
function findRoot(root) {
@@ -23,10 +23,10 @@ function findRoot(root) {
}
+var port = argv["port"] || process.env.PORT || 8080;
var browser = !argv["server"];
-var port = process.env.PORT || argv["port"] || 8080;
-var filepath = argv["_"][0]; // @FIXME: This should really be the first positional argument, not the first of any argument. (undefined if a user flags first).
var editor = argv["editor"] || false;
+var filepath = argv["_"][0];
var internal = false;
var root = findRoot(process.cwd());
|
Fix port flag not overriding ENV and file argument following a boolean flag
|
witheve_Eve
|
train
|
js
|
27c2170178a9e08f0d049cffe3f261ebf8a4bec5
|
diff --git a/kernel/src/main/java/com/qspin/qtaste/config/TestBedConfiguration.java b/kernel/src/main/java/com/qspin/qtaste/config/TestBedConfiguration.java
index <HASH>..<HASH> 100644
--- a/kernel/src/main/java/com/qspin/qtaste/config/TestBedConfiguration.java
+++ b/kernel/src/main/java/com/qspin/qtaste/config/TestBedConfiguration.java
@@ -294,7 +294,12 @@ public class TestBedConfiguration extends XMLConfiguration {
*/
protected static void onConfigurationChange() {
for (ConfigurationChangeHandler handler : configurationChangeHandlers) {
- handler.onConfigurationChange();
+ try {
+ handler.onConfigurationChange();
+ } catch (Exception pExc)
+ {
+ logger.error("An error occured during the testbed configuration change event management:" + pExc.getMessage(), pExc);
+ }
}
}
|
[KERNEL] add exception management in the testbed configuration change event emitter
|
qspin_qtaste
|
train
|
java
|
3761b7fe91c912aa6838c83b8bc4cdbab5d1636c
|
diff --git a/interp/interp_test.go b/interp/interp_test.go
index <HASH>..<HASH> 100644
--- a/interp/interp_test.go
+++ b/interp/interp_test.go
@@ -870,10 +870,12 @@ var fileCases = []struct {
"echo foo >/dev/null; echo bar",
"bar\n",
},
- {
- ">a; echo foo >>b; wc -c <a >>b; cat b",
- "foo\n0\n",
- },
+ // TODO: reenable once we've made a decision on
+ // https://github.com/mvdan/sh/issues/289
+ // {
+ // ">a; echo foo >>b; wc -c <a >>b; cat b",
+ // "foo\n0\n",
+ // },
{
"echo foo >a; wc -c <a",
"4\n",
|
interp: disable test that's failing on AppVeyor
To keep CI green.
Updates #<I>.
|
mvdan_sh
|
train
|
go
|
75b1f691429084fd65a1e906d2a0f8de6a07e280
|
diff --git a/tasks/documentjs.js b/tasks/documentjs.js
index <HASH>..<HASH> 100644
--- a/tasks/documentjs.js
+++ b/tasks/documentjs.js
@@ -10,8 +10,13 @@ module.exports = function(grunt) {
*
* @signature `grunt documentjs[:NAME[@PATH]]`
*
- * Calls the configured grunt task. If no name or path is given, all
- * versions and sites will be generated.
+ * Calls the configured grunt task.
+ *
+ * If no name or path is given, all
+ * versions and sites will be generated.
+ *
+ * If no `documentjs` task is configured, the grunt task will read from
+ * a local _documentjs.json_.
*
* @param {String} [NAME] The name of a version or site that this generation will
* be limited too.
@@ -68,13 +73,15 @@ module.exports = function(grunt) {
return {name: name};
});
}
-
- var docConfig = grunt.config.getRaw(this.name);
-
- configured.generateProject({
- path: process.cwd(),
- docConfig: docConfig
- }, undefined, options)
+ var project = {
+ path: process.cwd()
+ },
+ docConfig = grunt.config.getRaw(this.name);
+
+ if(docConfig) {
+ project.docConfig = docConfig;
+ }
+ configured.generateProject(project, undefined, options)
.then(done,function(err){
console.log(err);
done(err);
|
the documentjs task can read from documentjs.json
|
bitovi_documentjs
|
train
|
js
|
bda5e4b51ec62c23ed2a473158a656b757b8d326
|
diff --git a/vault/activity_log_test.go b/vault/activity_log_test.go
index <HASH>..<HASH> 100644
--- a/vault/activity_log_test.go
+++ b/vault/activity_log_test.go
@@ -445,7 +445,9 @@ func TestActivityLog_MultipleFragmentsAndSegments(t *testing.T) {
// enabled check is now inside AddEntityToFragment
a.enabled = true
// set a nonzero segment
+ a.l.Lock()
a.currentSegment.startTimestamp = time.Now().Unix()
+ a.l.Unlock()
// Stop timers for test purposes
close(a.doneCh)
|
Use a lock to address race. (#<I>)
|
hashicorp_vault
|
train
|
go
|
10ce0541c4a240c6794fe3e326b505a835b9cfe2
|
diff --git a/lib/lolapi.js b/lib/lolapi.js
index <HASH>..<HASH> 100644
--- a/lib/lolapi.js
+++ b/lib/lolapi.js
@@ -149,12 +149,13 @@
historyOptions += '&endIndex=' + options.endIndex;
}
if (options.beginTime) {
- historyOptions += '&beginTime=' + options.beginIndex;
+ historyOptions += '&beginTime=' + options.beginTime;
}
if (options.endTime) {
- historyOptions += '&endTime=' + options.endIndex;
+ historyOptions += '&endTime=' + options.endTime;
}
historyOptions += '&';
+ historyOptions = historyOptions.substr(1);
}
url = util.craftUrl(endpoint, regionAndFunc.region, matchHistoryUrl + '/' +
summonerId + '?' + historyOptions, authKey);
|
fix (MatchHistory) actually use the options too
* right options set for beginTime / endTime
* cleaning url
|
Colorfulstan_LeagueJS
|
train
|
js
|
3015c4ccd88a3a2792449e57a54f7ff6f7270d33
|
diff --git a/src/Admin/AbstractAdmin.php b/src/Admin/AbstractAdmin.php
index <HASH>..<HASH> 100644
--- a/src/Admin/AbstractAdmin.php
+++ b/src/Admin/AbstractAdmin.php
@@ -2914,7 +2914,7 @@ EOT;
$mapper = new ListMapper($this->getListBuilder(), $this->list, $this);
- if (\count($this->getBatchActions()) > 0 && !$this->getRequest()->isXmlHttpRequest()) {
+ if (\count($this->getBatchActions()) > 0 && $this->hasRequest() && !$this->getRequest()->isXmlHttpRequest()) {
$fieldDescription = $this->getModelManager()->getNewFieldDescriptionInstance(
$this->getClass(),
'batch',
|
Add hasRequest to prevent error in dashboard
Add hasRequest to prevent error : `The Request object has not been set` in dashboard
|
sonata-project_SonataAdminBundle
|
train
|
php
|
ec2ed812ca62ef0224654e404ded82e1c3b82ef6
|
diff --git a/lib/plugins/retry.js b/lib/plugins/retry.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/retry.js
+++ b/lib/plugins/retry.js
@@ -34,7 +34,9 @@ retry.prototype.argsKey = function(){
var self = this;
// return crypto.createHash('sha1').update(self.args.join('-')).digest('hex');
if(!self.args || self.args.length === 0){ return ''; }
- return self.args.join('-');
+ return self.args.map(function(elem){
+ return typeof(elem) === "object" ? JSON.stringify(elem) : elem;
+ }).join("-");
};
retry.prototype.retryKey = function(){
|
Stringify elements of args array that are of object type to avoid creating an [object object] key in redis
|
taskrabbit_node-resque
|
train
|
js
|
0cdc525961d3fa98e810ffae6bcc8e3838e36d93
|
diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -1079,7 +1079,7 @@
// Helper function to escape a string for HTML rendering.
var escapeHTML = function(string) {
- return string.replace(/&(?!\w+;)/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
+ return string.replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
};
}).call(this);
|
Fixed escapeHTML function
to skip not only &***;, but also &#***; and &x***;
|
jashkenas_backbone
|
train
|
js
|
c0b3f076d973315b82c38b5a289e0c4a390a6648
|
diff --git a/server/server.js b/server/server.js
index <HASH>..<HASH> 100644
--- a/server/server.js
+++ b/server/server.js
@@ -35,11 +35,10 @@ if (!process.env.SILENT_MODE) {
}
router.get('/', function (req, res) {
- console.log("'" + req.ip + "'");
- if ( req.ip.match(/^16\./) ) {
+ if ( req.ip.match(/^15\./) ) {
res.redirect('/docs/hpe');
}
- else if ( req.ip.match(/^15\./) ) {
+ else if ( req.ip.match(/^16\./) ) {
res.redirect('/docs/hpinc');
}
else {
|
Removed log message and fixed IP mapping
|
grommet_grommet
|
train
|
js
|
b19324c4a07957f6d0fda9be0a7d8cd01ed13572
|
diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -13,7 +13,7 @@ function IndexRegistry(taker) {
DefaultRegistry.call(this);
- var setTask = taker.set || taker._setTask;
+ var setTask = (taker.set || taker._setTask).bind(taker);
setTask('ng:beforeServe', noop);
setTask('ng:afterServe', noop);
|
fix(undertaker): comply with undertaker new <I> interface bis repetita
|
ng-tools_undertaker-lib-tasks
|
train
|
js
|
ba016685ca79cb800e6033214a13cc435ccc4dc7
|
diff --git a/unleash/git.py b/unleash/git.py
index <HASH>..<HASH> 100644
--- a/unleash/git.py
+++ b/unleash/git.py
@@ -5,11 +5,11 @@ from stat import S_ISLNK, S_ISDIR, S_ISREG, S_IFDIR, S_IRWXU, S_IRWXG, S_IRWXO
import time
from dateutil.tz import tzlocal
+from dulwich.errors import NotTreeError
from dulwich.objects import S_ISGITLINK, Blob, Commit, Tree
import logbook
from stuf.collects import ChainMap
-
log = logbook.Logger('git')
HASH_RE = re.compile('^[a-zA-Z0-9]{40}$')
@@ -307,7 +307,7 @@ class MalleableCommit(object):
try:
self.get_path_data(path)
return True
- except KeyError:
+ except (KeyError, NotTreeError):
return False
def get_path_id(self, path):
|
Do not fail if a file exists that is named similar to a directory that is supposed to exist.
|
mbr_unleash
|
train
|
py
|
d58afc50eb7ff8a245904c6420dc44d2b90ee153
|
diff --git a/lib/zold/node/farmers.rb b/lib/zold/node/farmers.rb
index <HASH>..<HASH> 100755
--- a/lib/zold/node/farmers.rb
+++ b/lib/zold/node/farmers.rb
@@ -127,7 +127,7 @@ for #{after.host}:#{after.port} in #{Age.new(start)}: #{after.suffixes}")
stdin, stdout = IO.pipe
Process.fork do
score = score.next
- stdout.puts "#{score.to_s}|#{Process.pid}"
+ stdout.puts "#{score}|#{Process.pid}"
end
Process.wait
stdout.close
|
Issue #<I> - Fix for rubocop
|
zold-io_zold
|
train
|
rb
|
5f777e88fac4ec4e0130102149a6b1fc4432e6a1
|
diff --git a/lib/prey/providers/system/platform/mac/index.js b/lib/prey/providers/system/platform/mac/index.js
index <HASH>..<HASH> 100644
--- a/lib/prey/providers/system/platform/mac/index.js
+++ b/lib/prey/providers/system/platform/mac/index.js
@@ -8,6 +8,8 @@ exports.get_os_version = function(callback){
callback('lion');
}
+// when battery is charging, time remaining is actually
+// what remains until the battery is full.
exports.get_battery_info = function(callback){
var cmd = 'pmset -g batt';
@@ -19,7 +21,8 @@ exports.get_battery_info = function(callback){
var percentage_remaining = output.match(/(\d+)%;/)[1];
var state = output.match(/%;\s+(\w+)/)[1];
- var time_remaining = output.match(/;\s+(\d+:\d+)/)[1];
+ if(time_value = output.match(/;\s+(\d+:\d+)/))
+ var time_remaining = time_value[1];
var data = {
percentage_remaining: percentage_remaining,
|
Fix battery info on Mac when no time remaining is given
|
prey_prey-node-client
|
train
|
js
|
5a48895b27f21cb3c5bdddf9631e80bb6cdb45e6
|
diff --git a/coconut/constants.py b/coconut/constants.py
index <HASH>..<HASH> 100644
--- a/coconut/constants.py
+++ b/coconut/constants.py
@@ -543,6 +543,7 @@ all_reqs = {
),
"mypy": (
"mypy[python2]",
+ "types-backports",
),
"watch": (
"watchdog",
@@ -579,6 +580,7 @@ min_versions = {
"psutil": (5,),
"jupyter": (1, 0),
"mypy[python2]": (0, 900),
+ "types-backports": (0, 1),
"futures": (3, 3),
"backports.functools-lru-cache": (1, 6),
"argparse": (1, 4),
|
Add types-backports req
|
evhub_coconut
|
train
|
py
|
da31f41d353a94f838d7aaac7eb30047f5dcb5d7
|
diff --git a/wireprotocol/2_6_support.js b/wireprotocol/2_6_support.js
index <HASH>..<HASH> 100644
--- a/wireprotocol/2_6_support.js
+++ b/wireprotocol/2_6_support.js
@@ -43,7 +43,7 @@ var executeWrite = function(pool, bson, type, opsField, ns, ops, options, callba
}
// Do we have bypassDocumentValidation set, then enable it on the write command
- if (typeof options.bypassDocumentValidation === 'boolean') {
+ if (options.bypassDocumentValidation === true) {
writeCommand.bypassDocumentValidation = options.bypassDocumentValidation;
}
diff --git a/wireprotocol/3_2_support.js b/wireprotocol/3_2_support.js
index <HASH>..<HASH> 100644
--- a/wireprotocol/3_2_support.js
+++ b/wireprotocol/3_2_support.js
@@ -101,7 +101,7 @@ var executeWrite = function(pool, bson, type, opsField, ns, ops, options, callba
}
// Do we have bypassDocumentValidation set, then enable it on the write command
- if (typeof options.bypassDocumentValidation === 'boolean') {
+ if (options.bypassDocumentValidation === true) {
writeCommand.bypassDocumentValidation = options.bypassDocumentValidation;
}
|
fix(wireprotocol): only send bypassDocumentValidation if true
The bypassDocumentValidation key will only be set if it explicitly
receives a true, otherwise it remains undefined.
Fixes NODE-<I>
|
mongodb_node-mongodb-native
|
train
|
js,js
|
f61ce5d32c33fc98a2d240e08a7c97c7de6e172e
|
diff --git a/src/constructors/css.js b/src/constructors/css.js
index <HASH>..<HASH> 100644
--- a/src/constructors/css.js
+++ b/src/constructors/css.js
@@ -6,7 +6,7 @@ import NestedSelector from "../models/NestedSelector";
import ValidRuleSetChild from "../models/ValidRuleSetChild";
const declaration = /^\s*([\w-]+):\s*([^;]*);\s*$/
-const startNesting = /^\s*([\w\.:&>][^{]+?)\s*\{\s*$/
+const startNesting = /^\s*([\w\.#:&>][^{]+?)\s*\{\s*$/
const stopNesting = /^\s*}\s*$/
/* This is a bit complicated.
@@ -66,6 +66,11 @@ export default (strings, ...interpolations) => {
const newRule = rule(camelize(property), value)
currentLevel.ruleSet.add(newRule)
} else if (popNesting) {
+ if (!currentLevel.parent) {
+ console.error(linesAndInterpolations)
+ console.error(currentLevel)
+ throw new Error("CSS Syntax Error — Trying to un-nest one too many times")
+ }
currentLevel = currentLevel.parent
}
}
|
allowing # for ids in selectors
|
styled-components_styled-components
|
train
|
js
|
c689ff081db4aec3cfcf6d97f56e6e49f9abaf0c
|
diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php
+++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php
@@ -6,6 +6,9 @@ use Doctrine\Tests\OrmTestCase;
abstract class PaginationTestCase extends OrmTestCase
{
+ /**
+ * @var \Doctrine\ORM\EntityManagerInterface
+ */
public $entityManager;
public function setUp()
|
DDC-<I> - adding missing type-hint docblock
|
doctrine_orm
|
train
|
php
|
48dbf0a6c16bdc24f76ffaed166cbde4c8720f6d
|
diff --git a/src/actions/pause.js b/src/actions/pause.js
index <HASH>..<HASH> 100644
--- a/src/actions/pause.js
+++ b/src/actions/pause.js
@@ -3,6 +3,7 @@
import { selectSource, ensureParserHasSourceText } from "./sources";
import { PROMISE } from "../utils/redux/middleware/promise";
+import { togglePaneCollapse } from "./ui";
import {
getPause,
pausedInEval,
@@ -137,6 +138,8 @@ export function paused(pauseInfo: Pause) {
const { line, column } = frame.location;
dispatch(selectSource(frame.location.sourceId, { line, column }));
+
+ dispatch(togglePaneCollapse("end", false));
};
}
|
fix #<I> - expand the right sidebar on pausing at breakpoint
|
firefox-devtools_debugger
|
train
|
js
|
ed5be57bbad462b8232b95c6e37f71ef3b96c303
|
diff --git a/openquake/commonlib/commands/info.py b/openquake/commonlib/commands/info.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/commands/info.py
+++ b/openquake/commonlib/commands/info.py
@@ -50,6 +50,8 @@ def info(name, filtersources=False):
oqparam, sitecol, prefilter=filtersources, in_memory=filtersources)
assoc = csm.get_rlzs_assoc()
print assoc.csm_info
+ print('See https://github.com/gem/oq-risklib/blob/master/docs/'
+ 'effective-realizations.rst for an explanation')
print assoc
if filtersources:
# display information about the size of the hazard curve matrices
|
Added a reference to the documentation
|
gem_oq-engine
|
train
|
py
|
722d560282e0995b8f80a73dbcea6f21c4e2a483
|
diff --git a/src/main/java/info/gehrels/voting/Candidate.java b/src/main/java/info/gehrels/voting/Candidate.java
index <HASH>..<HASH> 100644
--- a/src/main/java/info/gehrels/voting/Candidate.java
+++ b/src/main/java/info/gehrels/voting/Candidate.java
@@ -14,6 +14,10 @@ public class Candidate {
this.name = validateThat(name, not(isEmptyOrNullString()));
}
+ public String getName() {
+ return name;
+ }
+
@Override
public String toString() {
return this.name;
|
Replaced thymeleaf by JSP, Extended the Form binding to hold multiple elections,
|
BGehrels_singleTransferableVoteElections
|
train
|
java
|
78ec31752b9bde7570a77fee09bd1e7a251a30cc
|
diff --git a/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java b/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java
index <HASH>..<HASH> 100644
--- a/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java
+++ b/core/codegen/javagen/src/main/java/org/overture/codegen/vdm2java/JavaCodeGen.java
@@ -255,7 +255,7 @@ public class JavaCodeGen extends CodeGenBase implements IJavaQouteEventCoordinat
{
try
{
- if (!isTestCase(status))
+ if (!getInfo().getDeclAssistant().isLibraryName(status.getIrNodeName()))
{
generator.applyPartialTransformation(status, trans);
}
|
Fix to Java code generator: only transform non-library modules/classes
|
overturetool_overture
|
train
|
java
|
32e5276660165bcb3930bf67e70820354bb808c6
|
diff --git a/src/react/src/routes/SprkAlertDocs/SprkAlertDocs.js b/src/react/src/routes/SprkAlertDocs/SprkAlertDocs.js
index <HASH>..<HASH> 100644
--- a/src/react/src/routes/SprkAlertDocs/SprkAlertDocs.js
+++ b/src/react/src/routes/SprkAlertDocs/SprkAlertDocs.js
@@ -7,7 +7,7 @@ const SprkAlertDocs = () => {
return (
<CentralColumnLayout>
<div className="sprk-u-mbm">
- <SprkAlert message="Information alert message placeholder." variant="info" idString="alert-1"/>
+ <SprkAlert message="Information alert message placeholder." variant="info" idString="alert-1" additionalClasses="sprk-u-mbh"/>
</div>
<div className="sprk-u-mbm">
|
add additionalClasses prop test to react test page
|
sparkdesignsystem_spark-design-system
|
train
|
js
|
2ba55940f2bacf91d495ea2932646cf678977e13
|
diff --git a/tests/cases/access_test.py b/tests/cases/access_test.py
index <HASH>..<HASH> 100644
--- a/tests/cases/access_test.py
+++ b/tests/cases/access_test.py
@@ -24,7 +24,6 @@ from girder.api import access
from girder.constants import AccessType
-
# We deliberately don't have an access decorator
def defaultFunctionHandler(**kwargs):
return
|
Really make pep8 happy this time.
|
girder_girder
|
train
|
py
|
3a27a0a1e7601a5b4d5cc54269f494f986e08604
|
diff --git a/validator/sawtooth_validator/merkle.py b/validator/sawtooth_validator/merkle.py
index <HASH>..<HASH> 100644
--- a/validator/sawtooth_validator/merkle.py
+++ b/validator/sawtooth_validator/merkle.py
@@ -40,7 +40,13 @@ class MerkleDatabase(object):
yield item
def _yield_iter(self, path, hash_key):
- node = self._get_by_hash(hash_key)
+ try:
+ node = self._get_by_addr(path)
+ except KeyError:
+ raise StopIteration()
+
+ if path == INIT_ROOT_KEY:
+ node = self._get_by_hash(hash_key)
if node["v"] is not None:
yield (path, self._decode(node["v"]))
|
Updates for iterating from non-root paths in MerkleDatabase
If the path isn't in the trie, raise StopIteration().
If the path isn't the root node, use _get_by_addr()
to get it.
|
hyperledger_sawtooth-core
|
train
|
py
|
a711166f76a64dc68c56941a45e449bae4d175f6
|
diff --git a/keyring/backend.py b/keyring/backend.py
index <HASH>..<HASH> 100644
--- a/keyring/backend.py
+++ b/keyring/backend.py
@@ -12,6 +12,7 @@ import base64
import json
from keyring.util.escape import escape as escape_for_ini
+import keyring.util.escape
from keyring.util import properties
import keyring.util.platform
import keyring.util.loc_compat
@@ -603,8 +604,10 @@ class CryptedFileKeyring(BasicFileKeyring):
self.keyring_key = keyring_password
config.remove_option(KEYRING_SETTING, CRYPTED_PASSWORD)
- config.write(self.file_path)
- self.set_password('keyring-setting', 'reference password')
+ with open(self.file_path, 'w') as f:
+ config.write(f)
+ self.set_password('keyring-setting', 'password reference',
+ 'password reference value')
from Crypto.Cipher import AES
password = keyring_password + (
@@ -616,6 +619,8 @@ class CryptedFileKeyring(BasicFileKeyring):
cipher = AES.new(password, AES.MODE_CFB,
'\0' * AES.block_size)
password_c = config.get(service, user).decode('base64')
+ service = keyring.util.escape.unescape(service)
+ user = keyring.util.escape.unescape(user)
password_p = cipher.decrypt(password_c)
self.set_password(service, user, password_p)
|
Fixed some issues with the conversion routine from <I>
|
jaraco_keyring
|
train
|
py
|
378f0c59cf66ae21a1c5e7e69d7eb5f08f654a3f
|
diff --git a/glymur/__init__.py b/glymur/__init__.py
index <HASH>..<HASH> 100644
--- a/glymur/__init__.py
+++ b/glymur/__init__.py
@@ -1,5 +1,6 @@
"""glymur - read, write, and interrogate JPEG 2000 files
"""
+import sys
from .jp2k import Jp2k
from .jp2dump import jp2dump
|
Needed to import sys.
|
quintusdias_glymur
|
train
|
py
|
d2e1407de77395465b4a80e51123233c2c96721f
|
diff --git a/builder/setup.py b/builder/setup.py
index <HASH>..<HASH> 100644
--- a/builder/setup.py
+++ b/builder/setup.py
@@ -11,7 +11,7 @@ setup(
include_package_data=True,
install_requires=[
'vr.runners>=2.0.4,<3',
- 'PyYAML>=3.10',
+ 'PyYAML==3.10',
],
entry_points={
'console_scripts': [
|
Pin PyYAML version to <I> to be happy with dependencies
|
yougov_vr.builder
|
train
|
py
|
73d7aa5b82536c9548fe9e2e5f723e937763b97e
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -44,7 +44,7 @@ BIPPath.fromPathArray = function (path) {
BIPPath.fromString = function (text, reqRoot) {
// skip the root
- if (text.startsWith('m/')) {
+ if (/^m\//i.test(text)) {
text = text.slice(2)
} else if (reqRoot) {
throw new Error('Root element is required')
|
Do not use startsWith() as it has limited browser support
|
axic_bip32-path
|
train
|
js
|
679bfbaf5f960fa511daeb3a3cf160ac65af821d
|
diff --git a/exam.js b/exam.js
index <HASH>..<HASH> 100755
--- a/exam.js
+++ b/exam.js
@@ -38,7 +38,7 @@ var exam = module.exports = function (options) {
function readManifest() {
waits++;
fs.readFile(manifestPath, function (err, content) {
- manifest = JSON.parse(content || '{}');
+ manifest = JSON.parse(content || '{"files":[]}');
unwait();
});
}
|
Preventing error when manifest is missing
|
lighterio_exam
|
train
|
js
|
33dc921ef2c629536dd02941c7670a6be7a01ed6
|
diff --git a/lib/jsduck/util/singleton.rb b/lib/jsduck/util/singleton.rb
index <HASH>..<HASH> 100644
--- a/lib/jsduck/util/singleton.rb
+++ b/lib/jsduck/util/singleton.rb
@@ -1,3 +1,4 @@
+require 'singleton'
module JsDuck
module Util
@@ -20,9 +21,7 @@ module JsDuck
module Singleton
def self.included(base)
base.class_eval do
- def self.instance
- @instance ||= self.new
- end
+ include ::Singleton
# Redirect calls from MyClass.method to MyClass.instance.method
def self.method_missing(meth, *args, &block)
|
Use the Ruby Singleton class inside Util::Singleton.
Although our simple implementation worked also just fine, the builtin
Singleton has some more checks built into it - just good to rely on
something that's well tried and tested.
|
senchalabs_jsduck
|
train
|
rb
|
10037b00cb4ca56f2e7bc1a1b512ec5bd6fe8b19
|
diff --git a/salt/client/ssh/ssh_py_shim.py b/salt/client/ssh/ssh_py_shim.py
index <HASH>..<HASH> 100644
--- a/salt/client/ssh/ssh_py_shim.py
+++ b/salt/client/ssh/ssh_py_shim.py
@@ -230,7 +230,7 @@ def main(argv): # pylint: disable=W0613
subprocess.call(salt_argv)
shutil.rmtree(OPTIONS.saltdir)
else:
- os.execv(sys.executable, salt_argv)
+ subprocess.call(salt_argv)
if OPTIONS.cmd_umask is not None:
os.umask(old_umask)
|
Some environments refuse to return the command output
This results in the output from salt-ssh being empty,
this fix ensures that the output is always there
|
saltstack_salt
|
train
|
py
|
05f11fb28def84d8e14a99019ecdccca9c34022a
|
diff --git a/lib/instrumental/agent.rb b/lib/instrumental/agent.rb
index <HASH>..<HASH> 100644
--- a/lib/instrumental/agent.rb
+++ b/lib/instrumental/agent.rb
@@ -473,6 +473,7 @@ module Instrumental
# or we cannot reach the server
# or the connection state of this socket is in a race
logger.error "unable to connect to Instrumental, hanging up with #{@queue.size} messages remaining"
+ logger.debug "Exception: #{err.inspect}\n#{err.backtrace.join("\n")}"
allow_reconnect = false
else
report_exception(err)
|
Add some debug logging to help with test issues
|
Instrumental_instrumental_agent-ruby
|
train
|
rb
|
f5c98ca0b86841e32adb3324db2eaa93fd7d7ba3
|
diff --git a/airflow/operators/hive_to_druid.py b/airflow/operators/hive_to_druid.py
index <HASH>..<HASH> 100644
--- a/airflow/operators/hive_to_druid.py
+++ b/airflow/operators/hive_to_druid.py
@@ -68,7 +68,7 @@ class HiveToDruidTransfer(BaseOperator):
def execute(self, context):
hive = HiveCliHook(hive_cli_conn_id=self.hive_cli_conn_id)
logging.info("Extracting data from Hive")
- hive_table = 'druid.' + context['task_instance_key_str']
+ hive_table = 'druid.' + context['task_instance_key_str'].replace('.', '_')
sql = self.sql.strip().strip(';')
hql = """\
set mapred.output.compress=false;
|
there could be dot in the key string, which is illegal in the hive table name
|
apache_airflow
|
train
|
py
|
21208d2686d132a7f2188e2c7416d9709deaba33
|
diff --git a/plugins/outputs/amqp/amqp.go b/plugins/outputs/amqp/amqp.go
index <HASH>..<HASH> 100644
--- a/plugins/outputs/amqp/amqp.go
+++ b/plugins/outputs/amqp/amqp.go
@@ -249,6 +249,7 @@ func (q *AMQP) Write(metrics []telegraf.Metric) error {
if q.sentMessages >= q.MaxMessages && q.MaxMessages > 0 {
log.Printf("D! Output [amqp] sent MaxMessages; closing connection")
+ q.client.Close()
q.client = nil
}
diff --git a/plugins/outputs/amqp/client.go b/plugins/outputs/amqp/client.go
index <HASH>..<HASH> 100644
--- a/plugins/outputs/amqp/client.go
+++ b/plugins/outputs/amqp/client.go
@@ -55,7 +55,7 @@ func Connect(config *ClientConfig) (*client, error) {
log.Printf("D! Output [amqp] connected to %q", broker)
break
}
- log.Printf("D! Output [amqp] error connecting to %q", broker)
+ log.Printf("D! Output [amqp] error connecting to %q - %s", broker, err.Error())
}
if client.conn == nil {
|
Prevent connection leak by closing unused connections in amqp output (#<I>)
|
influxdata_telegraf
|
train
|
go,go
|
44b00f934388837e1b011326095819b2ec48b2ba
|
diff --git a/doc/source/conf.py b/doc/source/conf.py
index <HASH>..<HASH> 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -151,7 +151,7 @@ html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
+html_last_updated_fmt = '%Y-%m-%d %T%z'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
@@ -177,7 +177,7 @@ html_static_path = ['_static']
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
+html_show_sphinx = False
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
|
added build date/time to HTML footer; due to sphinx restrictions, use local time
|
ga4gh_ga4gh-schemas
|
train
|
py
|
f6c4e5e42e27b1f357eb97b60572202fe3a35929
|
diff --git a/lib/homesick/shell.rb b/lib/homesick/shell.rb
index <HASH>..<HASH> 100644
--- a/lib/homesick/shell.rb
+++ b/lib/homesick/shell.rb
@@ -1,3 +1,5 @@
+require 'thor'
+
module Homesick
# Hack in support for diffing symlinks
class Shell < Thor::Shell::Color
|
Require Thor in Homesick::Shell
|
technicalpickles_homesick
|
train
|
rb
|
aa793eb8b67f0e8bd65edf42958c96296500d726
|
diff --git a/lib/protocol/ColoringEngine.js b/lib/protocol/ColoringEngine.js
index <HASH>..<HASH> 100644
--- a/lib/protocol/ColoringEngine.js
+++ b/lib/protocol/ColoringEngine.js
@@ -235,7 +235,10 @@ ColoringEngine.prototype._computeAssetIds = function (inputs, markerOutputIndex,
} else {
result.push(new TransactionOutput(
outputs[i].v.readInt32LE(0),
- outputs[i].s));
+ outputs[i].s,
+ null,
+ null,
+ OutputType.ISSUANCE));
}
}
|
Ensure issuance outputs always have output type 'isuance'
|
andrewfhart_openassets
|
train
|
js
|
77f5e9f551d872db62c22c4343d14bd24029604d
|
diff --git a/segno/writers.py b/segno/writers.py
index <HASH>..<HASH> 100644
--- a/segno/writers.py
+++ b/segno/writers.py
@@ -332,9 +332,6 @@ def write_eps(matrix, version, out, scale=1, border=None, color='#000',
raise ValueError('Invalid color "{0}". Not in range 0 .. 1'
.format(c))
return c
- if not 0 <= c <= 255:
- raise ValueError('Invalid color "{0}". Not in range 0 .. 255'
- .format(c))
return 1/255.0 * c if c != 1 else c
return tuple([to_float(i) for i in colors.color_to_rgb(clr)])
|
Removed unused check. colors should handle that
|
heuer_segno
|
train
|
py
|
7dd3eec68480ed9204c67b66077dd42de0ac8735
|
diff --git a/client/driver/executor_plugin.go b/client/driver/executor_plugin.go
index <HASH>..<HASH> 100644
--- a/client/driver/executor_plugin.go
+++ b/client/driver/executor_plugin.go
@@ -18,7 +18,7 @@ var HandshakeConfig = plugin.HandshakeConfig{
func GetPluginMap(w io.Writer) map[string]plugin.Plugin {
p := new(ExecutorPlugin)
- p.logger = log.New(w, "executor-plugin-server:", log.LstdFlags)
+ p.logger = log.New(w, "", log.LstdFlags)
return map[string]plugin.Plugin{"executor": p}
}
|
removing the prefix of the logger
|
hashicorp_nomad
|
train
|
go
|
c2318431e1107786a6ece498c31f5d3ca852c774
|
diff --git a/pyflakes/test/test_undefined_names.py b/pyflakes/test/test_undefined_names.py
index <HASH>..<HASH> 100644
--- a/pyflakes/test/test_undefined_names.py
+++ b/pyflakes/test/test_undefined_names.py
@@ -372,13 +372,20 @@ class Test(harness.Test):
class A:
T = range(10)
- X = {x for x in T}
- Y = {x:x for x in T}
Z = (x for x in T)
L = [x for x in T]
B = dict((i, str(i)) for i in T)
''')
+ if version_info >= (2, 7):
+ self.flakes('''
+ class A:
+ T = range(10)
+
+ X = {x for x in T}
+ Y = {x:x for x in T}
+ ''')
+
class NameTests(TestCase):
"""
|
Skip dict/set comprehension with Python <I> and <I>
|
PyCQA_pyflakes
|
train
|
py
|
59351d30291ddce12bb34708bd34fa91d7cf31f3
|
diff --git a/tests/Kwf/Validate/PasswordTest.php b/tests/Kwf/Validate/PasswordTest.php
index <HASH>..<HASH> 100644
--- a/tests/Kwf/Validate/PasswordTest.php
+++ b/tests/Kwf/Validate/PasswordTest.php
@@ -2,7 +2,7 @@
/**
* @group Validate
*/
-class Kwf_Validate_EmailAddressSimpleTest extends Kwf_Test_TestCase
+class Kwf_Validate_PasswordTest extends Kwf_Test_TestCase
{
public function test3of4()
{
|
fix test name (did this test ever run?)
|
koala-framework_koala-framework
|
train
|
php
|
226a00e021a32c9e3eb31270987b604d83fe362e
|
diff --git a/pysat/_params.py b/pysat/_params.py
index <HASH>..<HASH> 100644
--- a/pysat/_params.py
+++ b/pysat/_params.py
@@ -11,8 +11,6 @@ import os
from portalocker import Lock
-import pysat.utils
-
class Parameters(object):
"""Stores user parameters used by pysat.
|
STY: Removed now unused import
|
rstoneback_pysat
|
train
|
py
|
6abc358ac7f163aa63cac4507795cc33d4d21682
|
diff --git a/src/Input.php b/src/Input.php
index <HASH>..<HASH> 100644
--- a/src/Input.php
+++ b/src/Input.php
@@ -349,7 +349,7 @@ class Input implements \Countable
*/
public function getMethod()
{
- return strtoupper($this->server->getRaw('REQUEST_METHOD'));
+ return strtoupper($this->server->getCmd('REQUEST_METHOD'));
}
/**
|
Restrict the values of the request method
|
joomla-framework_input
|
train
|
php
|
16726e65f0c687745a83de1d99d8a8749b7289a3
|
diff --git a/tests/TestCase/Controller/Component/SecurityComponentTest.php b/tests/TestCase/Controller/Component/SecurityComponentTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/Controller/Component/SecurityComponentTest.php
+++ b/tests/TestCase/Controller/Component/SecurityComponentTest.php
@@ -409,7 +409,7 @@ class SecurityComponentTest extends TestCase
$event = new Event('Controller.startup', $this->Controller);
$this->Controller->Security->startup($event);
- $fields = '68730b0747d4889ec2766f9117405f9635f5fd5e%3AModel.valid';
+ $fields = 'an-invalid-token';
$unlocked = '';
$this->Controller->request->env('REQUEST_METHOD', 'GET');
@@ -418,7 +418,7 @@ class SecurityComponentTest extends TestCase
'_Token' => compact('fields', 'unlocked')
];
$this->Controller->Security->startup($event);
- $this->assertFalse($this->Controller->failed);
+ $this->assertTrue($this->Controller->failed);
}
/**
|
Make test check for failure instead of pass.
|
cakephp_cakephp
|
train
|
php
|
ca3b5547cf1847f4b64390cab2a96f7756e57105
|
diff --git a/lib/neo4j/active_rel/persistence/query_factory.rb b/lib/neo4j/active_rel/persistence/query_factory.rb
index <HASH>..<HASH> 100644
--- a/lib/neo4j/active_rel/persistence/query_factory.rb
+++ b/lib/neo4j/active_rel/persistence/query_factory.rb
@@ -15,9 +15,9 @@ module Neo4j::ActiveRel::Persistence
# TODO: This feels like it should also wrap the rel, but that is handled in Neo4j::ActiveRel::Persistence at the moment.
# Builds and executes the query using the objects giving during init.
# It holds the process:
- # * Execute node callbacks if needed
- # * Create and execute the query
- # * Mix the query response into the unpersisted objects given during init
+ # * Execute node callbacks if needed
+ # * Create and execute the query
+ # * Mix the query response into the unpersisted objects given during init
def build!
node_before_callbacks! do
res = query_factory(rel, rel_id, iterative_query).query.unwrapped.return(*unpersisted_return_ids).first
|
Small fix on docs compilation.
|
neo4jrb_neo4j
|
train
|
rb
|
30e14be8287fff40bb3c3486d5dba32feff2af20
|
diff --git a/ncpol2sdpa/physics_utils.py b/ncpol2sdpa/physics_utils.py
index <HASH>..<HASH> 100644
--- a/ncpol2sdpa/physics_utils.py
+++ b/ncpol2sdpa/physics_utils.py
@@ -34,7 +34,7 @@ def get_neighbors(index, lattice_length, width=0, periodic=False):
coords = divmod(index, width)
if coords[1] < width - 1:
neighbors.append(index + 1)
- elif periodic:
+ elif periodic and width > 1:
neighbors.append(index - width + 1)
if coords[0] < lattice_length - 1:
neighbors.append(index + width)
|
get_neighbours function corrected for periodic chains
|
peterwittek_ncpol2sdpa
|
train
|
py
|
4fb3380424d8590f250cd80deaf2ed780cf55c6f
|
diff --git a/ecell4/util/parseobj.py b/ecell4/util/parseobj.py
index <HASH>..<HASH> 100644
--- a/ecell4/util/parseobj.py
+++ b/ecell4/util/parseobj.py
@@ -485,8 +485,8 @@ class SubExp(ExpBase):
def __append(self, obj):
if isinstance(obj, AnyCallable):
self._elems.append(obj._as_ParseObj())
- elif len(self._elems) > 0 and isinstance(obj, SubExp):
- self._elems.extend(obj._elements())
+ # elif len(self._elems) > 0 and isinstance(obj, SubExp):
+ # self._elems.extend(obj._elements())
else:
self._elems.append(obj)
|
Fix a critical bug related to ode again
|
ecell_ecell4
|
train
|
py
|
06c4937cb555870b7c929c0692437b9e33aa7fe7
|
diff --git a/bin/jade.js b/bin/jade.js
index <HASH>..<HASH> 100755
--- a/bin/jade.js
+++ b/bin/jade.js
@@ -190,19 +190,11 @@ function renderFile(path) {
var dir = resolve(dirname(path));
mkdirp(dir, 0755, function(err){
if (err) throw err;
- try {
- var output = options.client ? fn : fn(options);
- fs.writeFile(path, output, function(err){
- if (err) throw err;
- console.log(' \033[90mrendered \033[36m%s\033[0m', path);
- });
- } catch (e) {
- if (options.watch) {
- console.error(e.stack || e.message || e);
- } else {
- throw e
- }
- }
+ var output = options.client ? fn : fn(options);
+ fs.writeFile(path, output, function(err){
+ if (err) throw err;
+ console.log(' \033[90mrendered \033[36m%s\033[0m', path);
+ });
});
});
// Found directory
|
Remove another now-useless special exception handling for watch mode
I have already removed two in <I>b<I>e<I>e<I>f<I>aae<I>e8d9ca<I>e0b<I>.
|
pugjs_then-pug
|
train
|
js
|
c16e6dc0387a0c53148dc3c9725831b46e81fb23
|
diff --git a/group.go b/group.go
index <HASH>..<HASH> 100644
--- a/group.go
+++ b/group.go
@@ -11,8 +11,8 @@ type Group struct {
// Add a sub-group to this group
func (g *Group) NewGroup(path string) *Group {
- path = g.path + path
checkPath(path)
+ path = g.path + path
//Don't want trailing slash as all sub-paths start with slash
if path[len(path)-1] == '/' {
path = path[:len(path)-1]
diff --git a/group_test.go b/group_test.go
index <HASH>..<HASH> 100644
--- a/group_test.go
+++ b/group_test.go
@@ -13,6 +13,24 @@ func TestGroupMethods(t *testing.T) {
}
}
+func TestInvalidSubPath(t *testing.T) {
+ defer func() {
+ if err := recover(); err == nil {
+ t.Error("Bad sub-path should have caused a panic")
+ }
+ }()
+ New().NewGroup("/foo").NewGroup("bar")
+}
+
+func TestInvalidPath(t *testing.T) {
+ defer func() {
+ if err := recover(); err == nil {
+ t.Error("Bad path should have caused a panic")
+ }
+ }()
+ New().NewGroup("foo")
+}
+
//Liberally borrowed from router_test
func testGroupMethods(t *testing.T, reqGen RequestCreator) {
var result string
|
Fixed bug in sub-group path checks
added test case for both root group as well as sub group path checks
|
dimfeld_httptreemux
|
train
|
go,go
|
bfa9a5725d6be251f3d212d2b133847c65af1981
|
diff --git a/lib/tinder/connection.rb b/lib/tinder/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/tinder/connection.rb
+++ b/lib/tinder/connection.rb
@@ -1,3 +1,4 @@
+require 'uri'
require 'faraday'
module Tinder
|
requires uri library to avoid error (NameError: uninitialized constant Tinder::Connection::URI)
|
collectiveidea_tinder
|
train
|
rb
|
aa21be598db18a570aef0d7d86fb3f921a062795
|
diff --git a/lfs/ntlm_test.go b/lfs/ntlm_test.go
index <HASH>..<HASH> 100644
--- a/lfs/ntlm_test.go
+++ b/lfs/ntlm_test.go
@@ -80,16 +80,17 @@ func TestNtlmHeaderParseValid(t *testing.T) {
}
func TestNtlmHeaderParseInvalidLength(t *testing.T) {
-
- defer func() {
- r := recover()
- assert.NotEqual(t, r, nil)
- }()
-
res := http.Response{}
res.Header = make(map[string][]string)
res.Header.Add("Www-Authenticate", "NTL")
- _, _ = parseChallengeResponse(&res)
+ ret, err := parseChallengeResponse(&res)
+ if ret != nil {
+ t.Errorf("Unexpected challenge response: %v", ret)
+ }
+
+ if err == nil {
+ t.Errorf("Expected error, got none!")
+ }
}
func TestNtlmHeaderParseInvalid(t *testing.T) {
|
never want to TEST for a panic
|
git-lfs_git-lfs
|
train
|
go
|
77e03b825d0dbc026cae34dd0c70963385848b5b
|
diff --git a/luigi/scheduler.py b/luigi/scheduler.py
index <HASH>..<HASH> 100644
--- a/luigi/scheduler.py
+++ b/luigi/scheduler.py
@@ -622,7 +622,7 @@ class CentralPlannerScheduler(Scheduler):
self._update_task_history(task_id, status)
self._state.set_status(task, PENDING if status == SUSPENDED else status, self._config)
if status == FAILED:
- task.retry = time.time() + self._config.retry_delay
+ task.retry = self._retry_time(task, self._config)
if deps is not None:
task.deps = set(deps)
@@ -697,6 +697,9 @@ class CentralPlannerScheduler(Scheduler):
return False
return True
+ def _retry_time(self, task, config):
+ return time.time() + config.retry_delay
+
def get_work(self, host=None, assistant=False, **kwargs):
# TODO: remove any expired nodes
|
Move retry_time logic to its own method.
|
spotify_luigi
|
train
|
py
|
eb50ed3a69950f337459ff9b45e3916d96801d84
|
diff --git a/src/Illuminate/Log/Writer.php b/src/Illuminate/Log/Writer.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Log/Writer.php
+++ b/src/Illuminate/Log/Writer.php
@@ -10,8 +10,8 @@ use Monolog\Handler\SyslogHandler;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\ErrorLogHandler;
use Monolog\Logger as MonologLogger;
-use Monolog\Handler\RotatingFileHandler;
use Illuminate\Log\Events\MessageLogged;
+use Monolog\Handler\RotatingFileHandler;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Support\Arrayable;
|
Apply fixes from StyleCI (#<I>)
|
laravel_framework
|
train
|
php
|
36f233e3d0887eae2dbd7d4fc185c2be1a4dc548
|
diff --git a/build/broccoli/build-packages.js b/build/broccoli/build-packages.js
index <HASH>..<HASH> 100644
--- a/build/broccoli/build-packages.js
+++ b/build/broccoli/build-packages.js
@@ -116,6 +116,20 @@ function transpileAMD(pkgName, esVersion, tree) {
entry: `${pkgName}/index.js`,
external,
plugins,
+ onwarn(warning) {
+ let {code} = warning;
+ if (
+ // Suppress known error message caused by TypeScript compiled code with Rollup
+ // https://github.com/rollup/rollup/wiki/Troubleshooting#this-is-undefined
+ code === 'THIS_IS_UNDEFINED' ||
+ // Suppress errors regarding un-used exports. These may be left behind
+ // after DEBUG stripping and Rollup removed them anyway.
+ code === 'UNUSED_EXTERNAL_IMPORT'
+ ) {
+ return;
+ }
+ console.log(`Rollup warning: ${warning.message}`);
+ },
targets: [{
dest: `${pkgName}/dist/amd/${esVersion}/${bundleName}.js`,
format: 'amd',
|
Suppress Rollup warnings
Rollup was tossing out warnings in two cases we simply don't care about
seeing them for.
* Top-level this is treated as undefined. Documented in
<URL>
|
glimmerjs_glimmer-vm
|
train
|
js
|
241636f0f30977c57870e527714492d4857761cf
|
diff --git a/planet/exceptions.py b/planet/exceptions.py
index <HASH>..<HASH> 100644
--- a/planet/exceptions.py
+++ b/planet/exceptions.py
@@ -13,7 +13,12 @@
# limitations under the License.
-class APIException(Exception):
+class PlanetException(Exception):
+ """Root for all exceptions thrown by the SDK"""
+ pass
+
+
+class APIException(PlanetException):
'''General unexpected API response'''
@property
def message(self):
@@ -65,11 +70,11 @@ class InvalidIdentity(APIException):
pass
-class RequestCancelled(Exception):
+class RequestCancelled(PlanetException):
'''Internal exception when a request is cancelled'''
pass
-class AuthException(Exception):
+class AuthException(PlanetException):
'''Exceptions encountered during authentication'''
pass
|
add PlanetException to capture all exceptions thrown by program
|
planetlabs_planet-client-python
|
train
|
py
|
949648aba06a78577673c606426ff487d0551d88
|
diff --git a/subsystem/click.js b/subsystem/click.js
index <HASH>..<HASH> 100644
--- a/subsystem/click.js
+++ b/subsystem/click.js
@@ -50,6 +50,9 @@ phoxy._.click =
,
OnClick: function (event)
{
+ if (window.event.ctrlKey)
+ return; // Ctrl + Click = open in new tab
+
var target = event.target;
while (true)
{
|
Fix "open in new tab" issue
|
phoxy_phoxy
|
train
|
js
|
a5c2976fd9dc80a2318ccced56ca79d8d22e1ed9
|
diff --git a/spec/thinking_sphinx/active_record/property_sql_presenter_spec.rb b/spec/thinking_sphinx/active_record/property_sql_presenter_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/thinking_sphinx/active_record/property_sql_presenter_spec.rb
+++ b/spec/thinking_sphinx/active_record/property_sql_presenter_spec.rb
@@ -235,6 +235,17 @@ describe ThinkingSphinx::ActiveRecord::PropertySQLPresenter do
presenter.to_select.should == "CONCAT_WS(',', CAST(UNIX_TIMESTAMP(articles.created_at) AS varchar), CAST(UNIX_TIMESTAMP(articles.created_at) AS varchar)) AS created_at"
end
+ it "does not split attribute clause for timestamp casting if it looks like a function call" do
+ column.stub :__name => "COALESCE(articles.updated_at, articles.created_at)"
+ column.stub :string? => true
+
+ attribute.stub :name => 'mod_date'
+ attribute.stub :columns => [column]
+ attribute.stub :type => :timestamp
+
+ presenter.to_select.should == "UNIX_TIMESTAMP(COALESCE(articles.updated_at, articles.created_at)) AS mod_date"
+ end
+
it "returns nil for query sourced attributes" do
attribute.stub :source_type => :query
|
Added a spec for the change in commit <I>f2
|
pat_thinking-sphinx
|
train
|
rb
|
546e164d779e5bddb2cc27d490ab65d5d896a3e1
|
diff --git a/lib/routing.js b/lib/routing.js
index <HASH>..<HASH> 100644
--- a/lib/routing.js
+++ b/lib/routing.js
@@ -224,8 +224,8 @@ var route = function(conf, method, pattern, action, rdy, options) {
if (sectionName === 'main' && !isMain) return
var fragment = app.sections[sectionName]
if (fragment) {
- fragment.emit('delete')
if (fragment.template !== template) {
+ fragment.emit('delete')
fragment.template = template
fragment.refresh()
}
diff --git a/lib/state.js b/lib/state.js
index <HASH>..<HASH> 100644
--- a/lib/state.js
+++ b/lib/state.js
@@ -30,8 +30,10 @@ State.prototype.register = function(name, obj) {
if (name in this) {
if (Array.isArray(this[name]) && typeof this[name].reset === 'function')
this[name].reset(obj)
- else
+ else {
this[name] = obj
+ this.emit('changed.' + name)
+ }
return
}
var that = this
|
Fix Fragment/State-Change-related Events
|
rkusa_swac
|
train
|
js,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.